How to approach dev'ing VN with weird Story Mechanic

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
User avatar
illuminate001
Veteran
Posts: 412
Joined: Thu Jul 02, 2009 1:46 pm
Completed: DSGR, Let's MEAT Adam, Sexy Litter, Bara Boarders
Projects: Secret Project
Organization: Soulsoft Electronic Arts
Tumblr: soulsoftea
itch: soulsoftea
Location: Orlando, FL
Contact:

How to approach dev'ing VN with weird Story Mechanic

#1 Post by illuminate001 »

I have an idea for a VN with an interesting story mechanic, but I wanted to find out how possible it is technically and also how difficult.

The idea: there's a main story/character and 2 sub-characters. When you finish the main story, you may play the story of the 2 sub-characters.

- Is this mechanic possible and how would you recommend this be set up?

The trick is, depending on how you played the main story...events in the 2 sub-characters stories would change. So the game would have to remember those choices made even after the game is shut down, but also be tied to the saves.

- How would you approach setting this up and are there any pitfalls you can see straight off the bat?

Obviously there's already some complications. What happens if you finish MainStory, then Save onto Save.1. You get halfway through a Sub-Story and Save onto Save.2. Then replay MainStory and make different choices but load Save.2? I'm guessing you'd have to limit the player from replaying MainStory until they play both Sub-Stories...or, the entire game can only have 1 state of "being" and if you want to change the outcome of the Sub-Stories, you'd have to delete the entire game and reinstall it fresh?

I'm confused as to how this would all work obviously.
ImageImage
ImageImage

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How to approach dev'ing VN with weird Story Mechanic

#2 Post by Imperf3kt »

You could use persistent data and just hide the other two parts behind a typical if/else conditional
The problem here, as you noted, is if a player decides to replay from the beginning.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Xerofit51
Veteran
Posts: 376
Joined: Thu Jan 09, 2014 12:58 am
Completed: Freak-quency, Harvest-Moon spin off
Projects: Freak-quency
Deviantart: xerofit51
Location: Indonesia
Contact:

Re: How to approach dev'ing VN with weird Story Mechanic

#3 Post by Xerofit51 »

I have a similar system in my next game, I used like a looooooooooottttt of conditions and persistent data. About the replay, it can be an issue so just try to think of all the conditionals that might happen. Is it a headache? Yes, is it hard to code, no.

Mutive
Veteran
Posts: 344
Joined: Tue Nov 21, 2017 2:23 am
Completed: Eidolon, Minion!, Love Furever, Epilogue
Contact:

Re: How to approach dev'ing VN with weird Story Mechanic

#4 Post by Mutive »

illuminate001 wrote: Wed Nov 22, 2017 8:01 pm
- Is this mechanic possible and how would you recommend this be set up?
Yes. This is completely doable. Set up is probably along the lines of using a counter. (Where you set $ ending = 0 initially, but once it's reached, change it to 1. Add an if else statement to the beginning of your game where if ending + ending1 + ending2 + ending3 + ending4 + ending5 > 3, newending = 1" or some such. I mean, you'll have to change the logic around depending on what you're trying to do, but the idea is more or less the same, and it's pretty easy to program in.)

The trick is, depending on how you played the main story...events in the 2 sub-characters stories would change. So the game would have to remember those choices made even after the game is shut down, but also be tied to the saves.
Again, doable. Just have all the critical things you want saved tied to save variables.
Obviously there's already some complications. What happens if you finish MainStory, then Save onto Save.1. You get halfway through a Sub-Story and Save onto Save.2. Then replay MainStory and make different choices but load Save.2? I'm guessing you'd have to limit the player from replaying MainStory until they play both Sub-Stories...or, the entire game can only have 1 state of "being" and if you want to change the outcome of the Sub-Stories, you'd have to delete the entire game and reinstall it fresh?
You do need to determine what you import from. You could probably create some kind of "master counter" that looks at all saves, but that's going to be a PITA if you try to track every variable from earlier saves.

But it could be pretty doable. Let's play with a toy example.

Game 1:
You do a bunch of stuff, which is recorded with local saves.

Master save only takes into account that you got romance_alice_ending

Which gives you, oh, I don't know, +2 to romance alice in the later game

GREAT!

That's all you continue with in other file (which is master_file)

Then in game two, there are other local variables, that take into account sad_and_alone_forever_ending

Which gives you, maybe, +2 to stamina in the later game

You don't try to import everything from the earlier games, just the qualities that you want to carry over then.
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue

User avatar
illuminate001
Veteran
Posts: 412
Joined: Thu Jul 02, 2009 1:46 pm
Completed: DSGR, Let's MEAT Adam, Sexy Litter, Bara Boarders
Projects: Secret Project
Organization: Soulsoft Electronic Arts
Tumblr: soulsoftea
itch: soulsoftea
Location: Orlando, FL
Contact:

Re: How to approach dev'ing VN with weird Story Mechanic

#5 Post by illuminate001 »

Hmmm this is a very complex issue indeed, as I "sort" of get what you mean Mutive, but for once I think I may have to resort to actually hiring/working with a programmer/engineer at this point. I mean, I fully coded my last games and I think I could pull this off too, however for code efficiency and knowing how to set it up hierachy-wise without making a ton of mistakes and wasting time, I think I may need someone beyond my current skill set.

Also, Im sure I can find a bunch of resources online on persistent data (Ive never used/set those in renpy before as far as I know) for Renpy games, but have any of you encountered tutorials that are especially helpful for artists or non-coders?

One last thing, the changes for events in Sub-stories isn't just depending on the ending. I'd like it to be like this: So pretend you have the option in the MainStory to talk to PersonA but instead talk to PersonB. Then in the Sub-Story, PersonA will turn to PersonC for comfort and you'll see their interaction instead of another scene. I'm assuming that's also possible. Right? As an "ending" is just another set variable.
ImageImage
ImageImage

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How to approach dev'ing VN with weird Story Mechanic

#6 Post by Imperf3kt »

I just thought of something.
You could hust add another layer of conditionals to where you get awarded points.

Lets say for example, in game 1 you get 2 romance points as previously stated.
The issue here is if somebody saves in game 2, then plays game 1 again, they'll gain a FURTHER 2 romance points.

But this can be avoided with some simple logic.

Code: Select all


default persistent.carry_on_points = 0
default persistent.game_clear = False
# start label after default.

    if not persistent.game_clear and <however you check to award points>:
        $ persistent.carry_on_points += 2
        $ alice_romance_points += 2
    else:
        $ alice_romance_points += 2

# later, at the end of game 1
    $ persistent.game_clear = True

# later, in game 2

    if <whatever condition>:
        # probably some lind of function to add carry_on_points to alice_romance_points
The exact way you do it depends on how you set up the rest of your game.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

philat
Eileen-Class Veteran
Posts: 1900
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How to approach dev'ing VN with weird Story Mechanic

#7 Post by philat »

I think it depends mostly on how you want to structure the game/saves.

For one thing, does there really need to be a disconnect between the MainStory/SubA/SubB that would require persistent data rather than just regular save data? Specifically, is there a reason you need them to be separate save files, as opposed to "you finish the main story, the game fake-ends, and then continues on to Sub A or Sub B"? (I'm thinking of
Nier:Automata here, as in route B and route C/D basically happen linearly after route A, and in that order.
)

If you really DO need the saves to be separate, perhaps you can have the user choose which save to continue on from (think Mass Effect save imports). I've never tried it, but conceptually, it should be pretty simple to spit out the game-affecting variables to an external file (you can search the forum for various methods to write to file from within renpy) and then choose a save to import those values when starting a sub-route.

User avatar
illuminate001
Veteran
Posts: 412
Joined: Thu Jul 02, 2009 1:46 pm
Completed: DSGR, Let's MEAT Adam, Sexy Litter, Bara Boarders
Projects: Secret Project
Organization: Soulsoft Electronic Arts
Tumblr: soulsoftea
itch: soulsoftea
Location: Orlando, FL
Contact:

Re: How to approach dev'ing VN with weird Story Mechanic

#8 Post by illuminate001 »

Thanks Imperf3kt for the idea! In other words, it's very doable but also very dependant on having a far-reaching view into the overall architecture of the Story system itself. It'll take alot of planning and not something you can just wing.

@Philat - Hey again! Actually I do kind of like your idea. The main thing is I wanted it to feel like the game completed and then now these 2 special separate Chapters are now available and you can pier into the minds/hearts of the other characters in any order that interests you. It's the finality that I like, in that you've made your choices and ended the story and there's no going back. Let's see how your actions directly affected the others form their point of view in a voyeuristic sort of way. I think the game fake ending is cool, then using smart visuals and treatment, I can make it so the player now has to advance from that fake ending and can choose Sub-Story A or B

You guys are so smart :)
ImageImage
ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users