Persistent data not so persistent

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
Voight-Kampff
Veteran
Posts: 351
Joined: Sat Sep 05, 2009 8:47 am
Contact:

Persistent data not so persistent

#1 Post by Voight-Kampff »

So this is a little disconcerting.

For no apparent reason, the working directory that I had been using for my project appears to have stopped recording persistent data.

I assumed it was just a one-off issue. So, I used the Ren'Py launcher to delete the persistent data, and then relaunch the project. I changed a few menu items, sped through a couple of scenes and saved in a couple of spots. Then I exited and relaunched. Nope.

Oh, sure, the save games were in the right slots and they loaded up fine. But all persistent data was not saved (all menu options reverted, and it did not record the fact that I had already been through a couple scenes already).

So, I tried again—this time manually deleting all information at the file system level in the "saves" and "saves_bak" folders. Same results.

Fine. I downloaded a nice, new, shiny copy of Ren'Py 6.99.8, copied my working directory over there and...same result. Whether I use the Ren'Py launcher to delete the persistent data, or if I delete the files manually, it never records persistent data. And I've now tried this across two different systems (both Win 7, both as Administrators).

Any ideas?

EDIT: Ooo. I just tried building an exe from the project, and the exe suffers the same fate as well. DOH! :?

EDIT 2: We use a file called "scenes.rpy" to hold all of our script, dialog, sprite transitions, audio, etc. I took a previous version of the game which did not exhibit this problem and placed the latest copy of "scenes.rpy" in it. The problem manifest immediately. AND, when I reverted back, and overwrote that new copy with an old copy, the problem remained—even after deleting the persistent data. Snuh? :?:

EDIT 3: Scratch that. I finally narrowed it down to the options.rpy. Apparently, Ren'Py hates—HATES—when I try to register a custom voice channel. When I do, I can launch the game once just fine, and all subsequent game launches result in the persistent data just going out the window.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Persistent data not so persistent

#2 Post by PyTom »

Hm.. Can you send me the code that causes the problem? It's possible something is being stuck in persistent that isn't allowed. That would cause a problem, probably when loading persistent, but maybe saving it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Voight-Kampff
Veteran
Posts: 351
Joined: Sat Sep 05, 2009 8:47 am
Contact:

Re: Persistent data not so persistent

#3 Post by Voight-Kampff »

PyTom wrote:Hm.. Can you send me the code that causes the problem? It's possible something is being stuck in persistent that isn't allowed. That would cause a problem, probably when loading persistent, but maybe saving it.
Well, after more testing, I believe I can tell you what's going on—and I think, ultimately, it's irrelevant.

There is just a single line of code that I put into the options.rpy file that caused the issue:

Code: Select all

renpy.music.register_channel("dialog", voice, loop=False, tight=False)
However, that was being used in conjunction with RenPy 6.13.8.

When I placed that same code into a copy running RenPy 6.99.8, everything appears to work just fine. All preferences are remembered upon restarting.

So, it would appear the issue is only relevant to really old versions of RenPy.
Last edited by Voight-Kampff on Mon Feb 22, 2016 3:54 pm, edited 1 time in total.

Voight-Kampff
Veteran
Posts: 351
Joined: Sat Sep 05, 2009 8:47 am
Contact:

Re: Persistent data not so persistent

#4 Post by Voight-Kampff »

<sigh> No, I take that back.

Putting that same line of code in 6.99.8 does appear to eventually manifest the issue.

Interestingly, unlike with 6.13.8, if I use the RenPy console to delete the persistent file, and then comment out the line from options.rpy and restart the game, it starts working again and remembers user preferences, location in the game, etc.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Persistent data not so persistent

#5 Post by PyTom »

"Eventually"? Does it happen after the dialog channel has been used?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Voight-Kampff
Veteran
Posts: 351
Joined: Sat Sep 05, 2009 8:47 am
Contact:

Re: Persistent data not so persistent

#6 Post by Voight-Kampff »

Well, it's a very bizarre scenario—which I didn't recognize until afterwards. So I'm having trouble identifying what triggered the issue.

I think MAYBE it might have something to do with the fact that I was using Notepad++ to perform some editing.

While using Notepad++, I opened a completely fresh, known, good working copy of the options.rpy file. I then copied and paste the code above into the file and saved. I then had the RenPy launcher open up the game. It opened fine. I closed it. Opened it. Fine. Closed it. Opened it. Fine. And so on. I did that perhaps a half dozen times. And each time the game worked as expected and all persistent data was intact.

At some point, I decided to add in a little more code. Essentially, code for emphasize_audio. When I did that, for some reason, the game would no longer launch. Instead, I received an error message in regards to tab characters not being allowed.

Odd. I didn't see any tab characters in Notepad++. After fiddling with it for a while, I eventually opened the file in JEdit. Yup. There's a tab character—clear as day.

So, I delete it. Then I launch the game—and it works fine. BUT, I then opened it a second time, and the persistent file issue manifest itself again.

I have to guess that even though the above code was paste into the options.rpy, since I was using Notepad++, it SOMEHOW managed to avoid both generating an error (due to a tab character) and managed to avoid being properly evaluated?

Anyway, long story longer:

I removed the above code from the options.rpy file. Instead, I added the following to our script.rpy file:

Code: Select all

$ renpy.music.register_channel("dialog", "voice", loop=False, tight=False)
That works properly. But, I will note that initially, I did NOT have quotation marks around "voice". With the quotation marks missing, the same issue manifest in which persistent data would not be recognized.

All that being said, even though we now have a working "dialog" audio channel on the "voice" mixer, I have yet to get emphasize_audio to do anything. Eh, that'll have to be a different topic, assuming I can't fumble my way thought it first.

Post Reply

Who is online

Users browsing this forum: No registered users