Recommended practices for "multiple and separate storylines" structure?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Recommended practices for "multiple and separate storylines" structure?

#1 Post by 017Bluefield »

I already have one storyline with my current project. Start from point A, proceed all the way to point B. Thing is, I'm aiming for my project to have another storyline, separate from the first but also (hypothetically) accessible from the start. Are there any recommended or best practices when approaching this?
  • Start
  • Menu:
    1. Apple
      1. Beginning
      2. Middle
      3. End
      4. (loop to Menu)
    2. Butter
      1. Beginning
      2. Middle
      3. End
      4. (loop to Menu)
  • Quit

User avatar
Dsiak
Newbie
Posts: 15
Joined: Fri Jul 06, 2018 10:26 pm
IRC Nick: [Actual Horse]
Contact:

Re: Recommended practices for "multiple and separate storylines" structure?

#2 Post by Dsiak »

If you mean a way to write the narrative like that I am short on ideas, but to organize the structure of the project as in the folders and scripts here is what I would do.

root:

  • Common Asset (image or music or sfx etc):
    common assets
    • A asset
    • B asset...

  • main script.rpy
  • main screens.rpy

  • A scripts:
    A screens.rpy
    beginning.rpy
    middle.rpy
    end.rpy

  • B scripts:
    B screens.rpy
    beginning.rpy
    middle.rpy
    end.rpy


Then on your main script you can just call the chapters as they come, and you can squeeze new blocks in the middle or change the orders without having to copy and paste copious amount of lines:
  • Start
  • Menu:
    1. Apple
      • call beginning_a
      • if flag call route_c else call middle_a
      • call end_a
      • (loop to Menu)
    2. Butter
      • call beginning_b
      • middle_b
      • end_b
      • (loop to Menu)
  • Quit
Keeping the flow visible on the main script makes it easy to understand and modify. I do this all the time when I have a god class (which is far to frequent). The point is basically to keep your main script clean of anything except directing and connecting the various chapters of your project.
neigh

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: Recommended practices for "multiple and separate storylines" structure?

#3 Post by 017Bluefield »

Thank you for the insight! Gonna keep this thread open, just in case there're other ways to handle this.

Post Reply

Who is online

Users browsing this forum: Google [Bot]