Ren'Py Same game but separate episodes

monkeyposter_7

Thirsty for my Guest
Game Developer
Nov 23, 2018
330
1,181
What's the best way to (code) separate episodes with renpy?

Since the choices and variables need to continue among all of them

I will be doing a "full version" each time, but i also want to make each episode as a separate download, so people that got the last one don't have to download again

But i have no clue how to even start coding this
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,611
2,258
I'll say more or less the same as I did in that other thread... keep it simple.

Follow the path of least resistance that pretty much everyone has developed so far...
... release 1 game multiple times in incremental steps, even if that means people effectively download chapter 1 a dozen times eventually.

Have one version of your RenPy source... and when you build it this month, call it Chapter 1. When you build it next month, call it Chapter 2... and so on. When you finally release Chapter 22 (or whatever), be sure to get it tagged as [Complete].
Where Chapter 3 would includes Chapters 1, 2 and 3.

All your concerns for people not needing to download old chapters each time is just going to cause you headaches.
... which is easier to fix with "compressed" versions and such.
When I was created a patched version of a game here on the site... I created two downloadable versions... the patch only (about 70meg) and a full download at 2gig... More people downloaded the 2gig version than downloaded the smaller patch.


But if you really want to do it the hard way... You have two simple(ish) options...

Have 1 game per chapter. Something like does. Each chapter is effectively a separate game. Almost no overlap.
In RenPy - you'd get around issue of shared variables by using .
Consider it a common data area, shared by all your games.

The second option is to have 1 game in multiple chapters... but break up each chapter into it's own .rpa archive.
I've seen games build .rpa archives this way, but can't recall any that make each .rpa file a separate download.
It's going to get messy.
You'd need to look at the way RenPy builds archives using the options.rpy configuration.
Effectively you need a way of saying "this file goes in this archive, that file goes there, those files go in that other one."

I've not tested this... but something like...

Python:
# options.rpy
# [...]
    # Declare three archives.
    build.archive("chapter01", "all")
    build.archive("chapter02", "all")
    build.archive("chapter03", "all")

    # Put script files into their chapter archives.
    build.classify("game/chapter01.rpy*", "chapter01")
    build.classify("game/chapter02.rpy*", "chapter02")
    build.classify("game/chapter03.rpy*", "chapter03")

    # Put images into the right archive.
    build.classify("game/images/ch01/**", "chapter01")
    build.classify("game/images/ch02/**", "chapter02")
    build.classify("game/images/ch03/**", "chapter03")

    # Put sounds into the right archive.
    build.classify("game/sounds/ch01/**", "chapter01")
    build.classify("game/sounds/ch02/**", "chapter02")
    build.classify("game/sounds/ch03/**", "chapter03")
All of which presumes you can a common naming strategy for chapter files and directories.
It doesn't really cover things like fonts or other common files. Or if you use common script files (I like to keep my character definitions and animation definitions separate in files like characters.rpy and animations.rpy).

And the main problem for me, is that if you encounter a bug in Chapter 2 while writing Chapter 3... it doesn't really give you much choice except to re-release Chapter 2. At least if you bundle everything together, nobody notices if you fix things retroactively.
Of course, altering code that has already been released has it's own issues... but you weren't asking about that.
And the other reality is that more than half of developers would just leave it broken.

You don't have permission to view the spoiler content. Log in or register now.
 

monkeyposter_7

Thirsty for my Guest
Game Developer
Nov 23, 2018
330
1,181
This seems very complicated, and you that know coding are saying to avoid it also...

hmm

What do u think about making a full game, but i remove all the images from ep1
and u just have to copy and replace everything in game folder?

Or is that, like the lame way to do it?
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,611
2,258
I'd say what happens when you've got a new players who starts playing at Chapter 3?
They download chapter 3... and it doesn't work, because 1 and 2 are missing?

My instincts say that if you're already replying with "This seems very complicated [...]", then the sort of solutions that you're looking for aren't worth the headaches they would cause you.

Just do what almost everyone else already does... Release Chapter 1. Then release Chapter 2 (which also includes chapter 1)... Rinse and repeat.

Yes, someone downloading the full version every release will be downloading stuff they already have. But that's much simpler for YOU. It's also what everyone is used to doing already... so fuck it.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,979
16,236
To summarize, you'll have to face four different problems :

1) The psychological problem.

Following a game, and suddenly discovering that it have been released as a brand new thing is always a little disturbing. Is this something new, or is this the continuation of what I already played ? Is the story the continuation of what I previously seen, or is it a new story ? Is this file including the previous parts or not ? Too many questions can come to mind when facing this situation.
Unless your story is really addicting, if you do it too often, you'll risk to face a loss of players. Having to do all the thinking and manipulations every now and then, why not. But having to do them every two/three updates, it's something different. We play for our pleasure, not because we want to pass few minutes preparing the game.

So, the "new game" thing must happen for a reason, like by example what was done with . The first game stopped when the said daughter came back to her original location. It's not just a new chapter of the story, it's a new volume of the series. Here the justification of the new game was strong, and even if it could have been seen as annoying by some, it was legit.
This being opposed to games that have a "new game" for random reasons, by example, or because the file size start to grow too much, by example. Don't take me wrong, both games are interesting despite their own flaws, but the need to start a new game every two (ES) updates or every five (DML) ones is the biggest of these flaws, and it will prevent these games to reach the level of support they could have expected at first.


2) The new player's pitfall.

If someone follow your game from the start, the fact that it is split in multiple games can at most be annoying, that's all. But you must also take in count that it's not everybody that will discover your game during its few first months of life. So, you need to think about what can happen to the players trying to join the folks after the end of the "first game".
These peoples will face at least two links. One labeled "last update" and one labeled something like "update 0.5". The one they'll download is obvious, it's the first one. The more advanced will be the story when they'll join, the less they will understand it. So, you'll need to do as authors do for books. Firstly the game will need to summarize what happened before. Secondly, you'll have to reintroduce every single significant characters and locations, in every one of your games ; a small introduction, but still you can't name the big bad boy of the game and expect for a new player to understand that there should be a very dramatic music playing in background.
It's great, it solve the problem of new players, but it create a problem for old ones. Have you ever read multiple volume of a book series in a row ? Aren't all these "previously in my series" and all these reintroduction of character annoying after some times ? Well, the exact same thing will happen to players following your game since a long time. So you'll have to choice. Either you don't really gain new players, or you'll slowly loss the old ones.

Some may argue that the new players just have to play the game from the start. Yeah, it's not false... The two games I named as counter example already have 3 different games both. Are you ready to download three games in a row just to play them ? Will you be still ready to download all the needed games in a row when they'll have 10 different ones ? It will end by being discouraging, right ?


3) The technical issues - save compatibility.

While it's not this difficult to do, it's also not this easy.
Basically speaking, each game share their save files with the previously released games. This can be done really easily by editing the "options.rpy" file and changing the value of "config.save_directory". Every games sharing the same value for this configuration variable, will use the exact same directory for their save files. Then, either you rely on persistent values, like @79flavors said above, or you rely on the behavior of Ren'py to achieve the load of a save coming from another game.

Working with persistent values have its flaws. You'll have to discriminate your variables, some are needed locally for this game only, other will be needed in every single games. You'll have to prefix with "persistent." the one that need to be kept, will naming directly the other. How many times before you start to mix your thoughts and have a "whatever" variable and a "persistent.whatever" one, all supposed to be the same one ?
Relying on Ren'py's behavior is easier. You end your game in a label named, by example, "start_of_game_5", and you have the same label in the new game you created for the next update. Ren'py will load correctly the save file and you'll have access to all the saved variables. But there's a pitfall even with this method. The said "start_of_game_5" label must be big enough to ensure that player will effectively save inside it. Don't expect them to save when you'll display some kind of "save here" message on the screen. Too many games do this, and fail to be compatible when you'll play the next update. So, many players will save few interactions before this message. Usually it ensure the save compatibility, in this particular case, it can in fact break it because they'll be in a label unknown of the "new game".


4) The technical issues - the case of new players.

Alright, you've solved all the problems I talked about above. You'll start a "new game" only in relevant place of your story and don't do it too often. You've understood that the "continue with this label" solution is better than the persistent values one. This imply that you'll have a label name "start_of_game_5" which will be the start of this game for old players, and the regular "start" label for the new players. In this "start" label, you'll put a summary of the previous games, so players will not be lost in the story. You'll also set a flag that will include a short reintroduction of characters and locations, so the new players will really not be lost in the story.
In short, you think that you're ready... But you aren't.

What will happen if a player start your game at the third "new game" without wanting to play the previous ones ? After all, you did everything for this to be possible, because you don't want to force a new player to play the many previous games if he don't want to. So, you've a player aware of everything, that will understand enough to not be lost... but will also have no back history in the game. He have made no progress, he have made no choice. When the game will branch here or there, depending if he'd stole his roommate panties or not, you'll face a "no issue" situation because this player haven't stole the panties, but he also haven't not stole it.

This mean that you'll also have to generate this values when the game start. Here, the solution of facility is to generate an intermediary state for all the variables (inside the "start" label). But the problem is that it will force the player to have a given behavior. If he want to play the game as a good guy and you force the intermediary state for the bad guy path, you'll create inconstancy in the story. Things like "Hey, I know you pass your time to peek at me when I shower", followed by, "you're the nicest guy I know, not even looking at my panties when you had the occasion to do so".
The other solution is to make the player face theoretical situations. You'll ask him few questions like, "You've a crush on your roommate, one day, you found one of her panties in a place it shouldn't be. She surely have lost it, it will not miss her more if you take it. Will you take it ?". Then, you'll not just use the answer to define the value of a variable, but to determine the behavior of the player and so define many variables. By example, add a more direct question to this one. One that looks like, "When going to the bathroom to take your shower, you see your roommate panties on top of the laundry basket. Do you take it ?"
It the player answered "no" to both, he's a good guy, you'll set the variables according to this. If he answered "yes" to both, he's a bad guy, once again set the variables in consequence. If he answered "yes" to the first one, but "no" to the second, he's ready to perv, but fear the consequences. And it he answered "no" to the first one, but "yes" to the second, he's a full time perv ; the first panties didn't interested him, it was a clean one, but the second was touching her skin few minutes ago...


And voilà. You now know all what you needed to know about releasing a game in multiples parts (and not just multiples updates). As you can see, it's not impossible... but it imply way more works from the author to be done in an effective and reliable way that will not annoy the players.
 

Retro

Retired
Former Staff
Sep 7, 2017
3,217
18,849
Use .webp, keep the file size small, and don't worry about "having to download it again"
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,896
2,876
A trick to keeping game sizes small -- use sprites whenever possible. They can be used over and over again, but only need to be included in the game once. Also have a stock set of backgrounds. Save custom rendering for cases where custom rendering is really needed. This makes the game much smaller and easier to manage. Sprites are the overlay characters that are in the sample game that Ren'py ships with.

When you use sprites, make them all the same size and cropped the same way. Consistent lighting is important too. Have fun.
 

Deleted member 167032

Alternate Existence
Donor
Game Developer
Aug 16, 2017
2,719
4,944
Use GIMP or PS to compress your images, webm for animations. You will not loose quality when compressing files if done correctly.
 

polywog

Forum Fanatic
May 19, 2017
4,065
6,295
What's the best way to (code) separate episodes with renpy?

Since the choices and variables need to continue among all of them

I will be doing a "full version" each time, but i also want to make each episode as a separate download, so people that got the last one don't have to download again

But i have no clue how to even start coding this

I was going to suggest check out DMD, then I read your username. Updates were just an rpa file that added a day to the game.
So you didn't have to download the whole thing again and again. Depending on what host you use, if you get paid per dl or per GB upload it both ways. full game for new players. rpa for add a day users