Fixing a bug / patching a game without breaking saves
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.
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.
- Rosstin
- Veteran
- Posts: 368
- Joined: Mon Jan 31, 2011 5:43 pm
- Completed: Rex Rocket, Kitty Love, King's Ascent
- Projects: Road Redemption, Queen At Arms
- Organization: Aqualuft Games
- Contact:
Fixing a bug / patching a game without breaking saves
So, the worst happened. Someone find a bug deep in our game, in the version we released on Steam. Is there a way we can update the build and fix it without breaking saves?
The worst part is that I have no idea how the Renpy save system works. Does it work by line number? If I alter the script to correct a spelling error will that break saves?
The worst part is that I have no idea how the Renpy save system works. Does it work by line number? If I alter the script to correct a spelling error will that break saves?
- Zetsubou
- Miko-Class Veteran
- Posts: 523
- Joined: Wed Mar 05, 2014 1:00 am
- Completed: See my signature
- Github: koroshiya
- itch: zetsuboushita
- Contact:
Re: Fixing a bug / patching a game without breaking saves
Fix it and try?
ie. Create a save at a place likely to be affected, fix the bug, then try to load it.
It depends totally on your code how easy it is, but Renpy seems pretty good at this.
Spelling changes, adding lines of text, even adding menu choices works okay, as long as the flow remains the same.
But moving existing text into a new label, or changing the logic of a scene, or deleting content may cause a break.
ie. Create a save at a place likely to be affected, fix the bug, then try to load it.
It depends totally on your code how easy it is, but Renpy seems pretty good at this.
Spelling changes, adding lines of text, even adding menu choices works okay, as long as the flow remains the same.
But moving existing text into a new label, or changing the logic of a scene, or deleting content may cause a break.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
Re: Fixing a bug / patching a game without breaking saves
That's excellent adviceZetsubou wrote:Fix it and try?
Otherwise almost any change shouldn't break the saves, but if you add new properties to an object (for example), you may have to mess with label start in order to inject it to all objects which had their state saved. It depends on the case but your options are really, really wide here as Ren'Py's saving system is very flexible.
- Vaendryl
- Regular
- Posts: 39
- Joined: Thu Dec 26, 2013 10:10 pm
- Projects: Sunrider
- Organization: Love in Space
- IRC Nick: vaendryl
- Contact:
Re: Fixing a bug / patching a game without breaking saves
in my experience things will usually be okay though changing label names and removing lines can get problematic.
Particularly if you use a lot of python stuff (your own classes etc) it may be a good idea to use the 'after_load' label which can fix/update some stuff before a save finishes loading and things start being drawn on screen.
Particularly if you use a lot of python stuff (your own classes etc) it may be a good idea to use the 'after_load' label which can fix/update some stuff before a save finishes loading and things start being drawn on screen.
- PyTom
- Ren'Py Creator
- Posts: 16122
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Fixing a bug / patching a game without breaking saves
it really depends on the change - if you can explain what change you made, we can give you advice on what the right way to maintain save compatibility is.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Fixing a bug / patching a game without breaking saves
I would say, If you change a misspelled variable which is crashing the game when the script gets to it because it doesn't exist, that will not break your saves.
If you change an existing variable into one with a different name and call it, you will have the save call an undefined variable, and that will crash.
If all you are doing is changing some text in the dialogue then there should be no issues.
The saves break if your game tries to read from the saved game a variable which doesn't exist in the saved game.
If you change an existing variable into one with a different name and call it, you will have the save call an undefined variable, and that will crash.
If all you are doing is changing some text in the dialogue then there should be no issues.
The saves break if your game tries to read from the saved game a variable which doesn't exist in the saved game.
- Rosstin
- Veteran
- Posts: 368
- Joined: Mon Jan 31, 2011 5:43 pm
- Completed: Rex Rocket, Kitty Love, King's Ascent
- Projects: Road Redemption, Queen At Arms
- Organization: Aqualuft Games
- Contact:
Re: Fixing a bug / patching a game without breaking saves
In this case, we had an undeclared variable crashing the game when it got to that line, and so we added a line declaring that to our points.rpy file (where we declare all our variables.)
I was hoping for some documentation in-general about how it works-- do saves work by line number? A combination of label and line number?
What we did ultimately was update it: the crasher was on a specific path at the end, only one person had gotten there, and only 20 people had downloaded the game at that point, so there weren't a ton of nightmare scenarios for us. But in case this happens in the future (I don't think it will but you never know), I'd like to know what I can and can't safely do.
I was hoping for some documentation in-general about how it works-- do saves work by line number? A combination of label and line number?
What we did ultimately was update it: the crasher was on a specific path at the end, only one person had gotten there, and only 20 people had downloaded the game at that point, so there weren't a ton of nightmare scenarios for us. But in case this happens in the future (I don't think it will but you never know), I'd like to know what I can and can't safely do.
Re: Fixing a bug / patching a game without breaking saves
Prolly the best case scenario, you are very likely to fix it by adding any random file with:Rosstin wrote:In this case, we had an undeclared variable crashing the game when it got to that line
Code: Select all
default var_name = proper_value
- Rosstin
- Veteran
- Posts: 368
- Joined: Mon Jan 31, 2011 5:43 pm
- Completed: Rex Rocket, Kitty Love, King's Ascent
- Projects: Road Redemption, Queen At Arms
- Organization: Aqualuft Games
- Contact:
Re: Fixing a bug / patching a game without breaking saves
Yeah, that's what we did.xela wrote:Prolly the best case scenario, you are very likely to fix it by adding any random file with:Rosstin wrote:In this case, we had an undeclared variable crashing the game when it got to that line
and it should be fixed.Code: Select all
default var_name = proper_value
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot]