Ren'Py Handling Story Branches

Deleted member 107261

The Real Hentai Agent
Game Developer
Jul 11, 2017
229
217
I was mostly curious how other devs approach decisions that may branch off into different results.
I've been toying with this idea for 1 or 2 features in a project of mine that will have long lasting repercussions (basically, once you make the decision you get 1 of 2 game-long rewards).

An example of choosing armor over a weapon, as an example. Are there maybe some advanced methods for dealing with this sort of thing -- other than event flags?
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
I was mostly curious how other devs approach decisions that may branch off into different results.
I've been toying with this idea for 1 or 2 features in a project of mine that will have long lasting repercussions (basically, once you make the decision you get 1 of 2 game-long rewards).

An example of choosing armor over a weapon, as an example. Are there maybe some advanced methods for dealing with this sort of thing -- other than event flags?
In my experience, this is just handled by using variables. (Maybe what you're calling "event flags.") When you present the player with a menu, remember the choice he/she made. Best to do this for every choice offered - variables cost very little, and you never know when, in 0.5, you might decide that that choice in 0.1 should now be significant.

Oh, you can bundle the variables into class instances, if you want. But you don't have to - I've seen both sandbox and visual novel-type games that just use a whole series of simple yes/no variables, and I've seen others that use all sorts of more advanced storage mechanisms. A lot of it comes down to how you want/like to code.

Note, for most VN's, (IMHO) doing anything other that vanilla variables is probably overcomplicating things. This may be different for sandbox games. For example, in Whores of Thrones (for which I'm the coder) I developed a whole "quest-and-event" framework because that allowed me to very easily add events and deal with the fact that the player may execute them in any order. Not that it HAD to be done that way - it was just what seemed to make sense to me from a programming point of view. But for the VN's for which I've been the coder, that kind of sophistication was almost never warranted.

Basically, my advice is to choose the simplest method that will do the job well, an the one that you understand the best. Complexity for complexity's sake is an anti-pattern.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,284
Alright, I hurt myself few days ago, you don't need this kind of nightmare so I'll pass the details. It's not a big deal, but I can't really bend my knees and it sometimes hurts like hell. This mean that I can't sleep and had some times to kill.

Why do I tell you this ? Well because I past through your question, and decided to use this time to write a "Have a dynamic story that react to player choices" how-to. I'm sure that you'll find the answer you're searching for in it.