Ren'Py Daz Guidance on setting up a new "season/section" of a game :)

TessSadist

Well-Known Member
Donor
Game Developer
Aug 4, 2019
1,298
5,562
Hi everyone!

I have a basic question and I figured there are some very smart people here that can help me get started in the right direction for research!

I am about to finalize another update of my current game called Karlsson's Gambit (the Beta is public now), and I am realizing I need to try and split off the next update into a new chunk/season/file (I apologize I am not very tech proficient so just trying to explain as best as I can) because the ability to create an Android port under 2GB is getting threatened with future updates. My current build normally is zipping at about 9.5GB (I know it's not really optimized very well so looking into that too), but I also would like ideally to be able to do the following:

1) Allow a player to make saves that can "transfer" over to a new season/game file (not sure how this works but I think you know what I mean?)

2) Allow flags and relevant data from prior choices to also transfer over to the new file/season as well so everything in terms of writing a new script file works easily with the same transitions, characters, etc.

3) Ideally, trying to keep everything as simple as possible for a non-tech dev, lol. (so less extra files/separate things, etc.) I even know how unwise it is in some ways to have all dialogue in one script file, but I am still doing it because I'm so uncomfortable changing anything I don't 100% understand. (so I can't make many changes, heh)

I was thinking as a basic start of just opening up Being a DIK (a game I know that does a season/save transfer thing) as a first step, but I don't really know if this is the best option or if there is another thing I can research in looking into this stuff. I feel like if I can study some templates/ideas that I can figure things out, but I don't really have a good frame of reference as a starting point.

Any help greatly appreciated :)
 

gojira667

Member
Sep 9, 2019
325
320
Not sure why this is tagged with [DAZ], but is what you are asking about.
It's a Ren'Py feature specifically made to "share information between Ren'Py games." You need to add it to the 1st game before finishing it and need to have specified all relevant data to import for the 2nd game. Since you need to pick what you are keeping, you of course dump everything else which can be nice depending on how things evolved during development.

If it's just the size split and the first game is e.g. Chapters 1-6 while the second continues with Chapter 7 then you can instead just keep going.
Have it be a new game and then change the save directory to be the same as the first game. Copy over all relevant defaults and defines, classes, etc. to the new script file(s).
It will automatically see all old saves. If you update store._version variable to some 2.x value before the final save in the first game then you can require saves to have store._version > 2.x in the loading screen of the 2nd game in order to be loaded.

You may want to wait and see if Karenina, Baskin-Robbins, etc. chime in. I don't believe I've looked at any game's script files that have made use of either method. Plus anything else I haven't considered...
 
Last edited:
  • Like
Reactions: TessSadist

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,188
1) Allow a player to make saves that can "transfer" over to a new season/game file [...]
2) Allow flags and relevant data from prior choices to also transfer [...]
3) Ideally, trying to keep everything as simple as possible for a non-tech dev, lol. [...]
Two possibilities, both answering those three points.


The first one is to use Multi persistent as said above.
It will need that you decide what variables have to be kept, and also plan it so the player will be able to save more than one route ; personally I have four different for your game.


The second way is both more simple, and a bit more complicated to explain.
You start the next episode in the same label that you finished the previous one. And you ensure that config.save_directory have the same value for both episode ; in order for Ren'Py to find the save files.
Then, when the player will run the second episode, they can just load a previous save file, and it will works with the new episode. Something like this:
First episode:
Code:
label itsTheEnd:
    "It's the end of this update, hope you enjoyed it."
    "Please, same your game now. And ensure that you save here, not some dialog line above."
Second episode:
Code:
label start:
    "Oh, you should really play the first episode before this one."
    [...]

label itsTheEnd:
    "Welcome back, player. Ready to continue your adventure ?"
    [...]
I can extend one/both explanation if you/someone want/need.
 

TessSadist

Well-Known Member
Donor
Game Developer
Aug 4, 2019
1,298
5,562
Not sure why this is tagged with [DAZ], but is what you are asking about.
It's a Ren'Py feature specifically made to "share information between Ren'Py games." You need to add it to the 1st game before finishing it and need to have specified all relevant data to import for the 2nd game. Since you need to pick what you are keeping, you of course dump everything else which can be nice depending on how things evolved during development.

If it's just the size split and the first game is e.g. Chapters 1-6 while the second continues with Chapter 7 then you can instead just keep going.
Have it be a new game and then change the save directory to be the same as the first game. Copy over all relevant defaults and defines, classes, etc. to the new script file(s).
It will automatically see all old saves. If you update store._version variable to some 2.x value before the final save in the first game then you can require saves to have store._version > 2.x in the loading screen of the 2nd game in order to be loaded.

You may want to wait and see if Karenina, Baskin-Robbins, etc. chime in. I don't believe I've looked at any game's script files that have made use of either method. Plus anything else I haven't considered...
Ok, I have saved that link and will look it over, and yeah, I didn't need to include Daz, heh. I'm just being honest in that I don't know much of what I am doing and I never had even read a line of code (much less tried to use it) before starting this game, so I'm very ignorant. In fact, I just learned in my own thread from a helpful person that I could use parenthesis in the code to group things, haha! if (x,y,z) so I felt pretty silly...

Appreciate the help, getting to this on the weekend I hope to try and figure out something :)
 

TessSadist

Well-Known Member
Donor
Game Developer
Aug 4, 2019
1,298
5,562
Two possibilities, both answering those three points.


The first one is to use Multi persistent as said above.
It will need that you decide what variables have to be kept, and also plan it so the player will be able to save more than one route ; personally I have four different for your game.


The second way is both more simple, and a bit more complicated to explain.
You start the next episode in the same label that you finished the previous one. And you ensure that config.save_directory have the same value for both episode ; in order for Ren'Py to find the save files.
Then, when the player will run the second episode, they can just load a previous save file, and it will works with the new episode. Something like this:
First episode:
Code:
label itsTheEnd:
    "It's the end of this update, hope you enjoyed it."
    "Please, same your game now. And ensure that you save here, not some dialog line above."
Second episode:
Code:
label start:
    "Oh, you should really play the first episode before this one."
    [...]

label itsTheEnd:
    "Welcome back, player. Ready to continue your adventure ?"
    [...]
I can extend one/both explanation if you/someone want/need.
Ok, I will try and look over this and come up with a question or two, I appreciate the help! I think I would prefer the safest option moving forward in terms of something not breaking and being useful moving forward for players over my own convenience.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
If it were me, I'd probably go down the multi-game persistent route.

In effect, it creates a common save file containing all the values you need to pass between the two separate games/chapters.

At the end of game-1, you copy all the variables into variables held within a multi-game persistent storage area.
At the start of game-2, you check to see if there's a multi-game persistent area and either copy the values from there or do something else (let the player pick from a set "standard" profiles/values that are used instead or just tell the player they need to play game-1 first or anything in between).

Here's a simple example I wrote a while ago:
https://f95zone.to/threads/making-a-season-2.57338/post-3872935

The only quirk is that it won't work for Android. In my example, I specifically code stuff to only work if it's running on a PC (WinDoze, Mac, Linux). I don't know if it'd generate an error - but I know because of the way Android stores it's file, it's not possible to have a shared folder like the other operating systems.