Ren'Py Save System issue
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.
Ren'Py Save System issue
Hello everyone. I am fairly new to Ren'Py and am working to develop my own game. In doing so, I am researching ways to do things by playing other games made with this system. Recently, I have come across two games that have an issue with their save system and this may be that they just used default Ren'Py settings.
My wife and I use the same computer, we have our own Windows logins and our own Steam profiles. I purchased numerous games on Steam and I shared my library with her. While I was at work, she played through a few games and got a bunch of achievements. When I got home, I wanted to play one of those games. I noticed immediately that I had access to all the saves that she had created. I also could not unlock any achievements as the game thought I had already done so. It appears that all the save information was being stored in the same folder that the game was installed in. The same thing happened in another game by another dev. Just to make sure there was nothing wrong with my Steam account, I installed a new game that my wife had not yet played and I was able to get achievements. I also, on another computer, installed one of the games that I was having an issue with and got achievements there as well.
So... Here's the question. How does one get the Windows user information so that the game can store save information within that Windows profile (i.e. c:\users\valaith) instead of saving files into the games install folder? I'd like to inform the devs of their issue and also give them a resolution. Hopefully this resolution can also work on platforms other than Windows. I'd like to use this information for my own game(s) so that other families that use one computer do not have the same issue I am seeing.
Thank you in advance for your help.
My wife and I use the same computer, we have our own Windows logins and our own Steam profiles. I purchased numerous games on Steam and I shared my library with her. While I was at work, she played through a few games and got a bunch of achievements. When I got home, I wanted to play one of those games. I noticed immediately that I had access to all the saves that she had created. I also could not unlock any achievements as the game thought I had already done so. It appears that all the save information was being stored in the same folder that the game was installed in. The same thing happened in another game by another dev. Just to make sure there was nothing wrong with my Steam account, I installed a new game that my wife had not yet played and I was able to get achievements. I also, on another computer, installed one of the games that I was having an issue with and got achievements there as well.
So... Here's the question. How does one get the Windows user information so that the game can store save information within that Windows profile (i.e. c:\users\valaith) instead of saving files into the games install folder? I'd like to inform the devs of their issue and also give them a resolution. Hopefully this resolution can also work on platforms other than Windows. I'd like to use this information for my own game(s) so that other families that use one computer do not have the same issue I am seeing.
Thank you in advance for your help.
Re: Ren'Py Save System issue
*sigh*... This is obnoxious.
What you're asking is a bit much, I doubt many indie developers are gonna bother with such a task.
Still, it might be possible. I assume the game can get the information about the current windows user from the operating system, then cross retrieve a list of possible steam achievements, and keep track of the received achievements for each individual user, offline. I don't really know how steam handles achievements on the same machine. (outside of using separate steam accounts)
And to make matters even MORE fun. Renpy's custom os module doesn't even have the method which would provide the information about the active user. So if they were to do that, they'd either have to put the missing method into renpy, or use it to start a new program which can check the user independently and then give that information to renpy(I think a method like that still exists in renpy). ...All in all, fun times.
Best you can hope for is if they make it possible to create user accounts for the game, so you can keep your saves separate.
As far as achievements go, that isn't happening. Like I said, no idea how steam handles multiple users on the same machine, so you're better off going there and looking into that.
What you're asking is a bit much, I doubt many indie developers are gonna bother with such a task.
Still, it might be possible. I assume the game can get the information about the current windows user from the operating system, then cross retrieve a list of possible steam achievements, and keep track of the received achievements for each individual user, offline. I don't really know how steam handles achievements on the same machine. (outside of using separate steam accounts)
And to make matters even MORE fun. Renpy's custom os module doesn't even have the method which would provide the information about the active user. So if they were to do that, they'd either have to put the missing method into renpy, or use it to start a new program which can check the user independently and then give that information to renpy(I think a method like that still exists in renpy). ...All in all, fun times.
Best you can hope for is if they make it possible to create user accounts for the game, so you can keep your saves separate.
As far as achievements go, that isn't happening. Like I said, no idea how steam handles multiple users on the same machine, so you're better off going there and looking into that.
Phoenix Star - Persistence, perseverance, ambition.
...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Deviant Art: ...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Re: Ren'Py Save System issue
Achievements have to be read from something. Is it the persistent file? I'm not a dev on Steam so I don't know but hopefully someone here is and can answer. Whatever file stores this information needs to be moved to where the save files are (as long as it isn't in the game folder, I assume). That would solve that problem.
As long as the game is written correctly, both my wife and I can pop the same achievement in the same game on the same computer. We've done this. I believe it was a Ren'Py game. I've attempted to reach out to the dev but they are not responding. So I came here in hopes that someone has solved this issue and is willing to share how.
As long as the game is written correctly, both my wife and I can pop the same achievement in the same game on the same computer. We've done this. I believe it was a Ren'Py game. I've attempted to reach out to the dev but they are not responding. So I came here in hopes that someone has solved this issue and is willing to share how.
Re: Ren'Py Save System issue
No, as far as I'm aware the achievements are handled on steam. All the game does is tell the server when to unlock the achievement. So games don't normally need to keep track of the achievements on the computer.
Which now that I think about it, presents a unique problem. Since renpy doesn't like saving when there is an open connection. That makes things a little more complicated, but it's irrelevant.
I really don't think this is an universal problem to solve. It's a matter of how each individual game is made, and most aren't made with your particular problem in mind.
Which now that I think about it, presents a unique problem. Since renpy doesn't like saving when there is an open connection. That makes things a little more complicated, but it's irrelevant.
I really don't think this is an universal problem to solve. It's a matter of how each individual game is made, and most aren't made with your particular problem in mind.
Phoenix Star - Persistence, perseverance, ambition.
...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Deviant Art: ...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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: Ren'Py Save System issue
Right now, Ren'Py stores the achievement information with the game. This lets games be moved between computers (say, on a USB stick), without losing any of the important information.
The best workaround would be to configure Steam such that you and your wife each get your own copy of Ren'Py. Apart from that, if you could somehow make the game/saves directory unreadable and unwritiable, it would force Ren'Py to only look in the other (user-specific) location.
The best workaround would be to configure Steam such that you and your wife each get your own copy of Ren'Py. Apart from that, if you could somehow make the game/saves directory unreadable and unwritiable, it would force Ren'Py to only look in the other (user-specific) location.
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Ren'Py Save System issue
... how about deleting the folder? I assume renpy will just recreate it though.
Another thing you might try is messing with the folder security permissions. Maybe if you remove everyone's permissions from the folder that has the save data it might be enough to confuse the game.(Especially if you are running it from a different user.)
Another thing you might try is messing with the folder security permissions. Maybe if you remove everyone's permissions from the folder that has the save data it might be enough to confuse the game.(Especially if you are running it from a different user.)
Phoenix Star - Persistence, perseverance, ambition.
...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Deviant Art: ...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Re: Ren'Py Save System issue
Let's take Steam out of the equation. The save files would still be an issue if the game was sold outside of Steam. Anyone that played the game on the same computer would have access to all the saves that the previous people made.
This shouldn't be.
This shouldn't be.
This isn't true. I was repeatedly playing one game that my wife played and the achievements wouldn't unlock for me. I followed a guide just to be sure. I played the same game on another computer and I was then able to get the achievement. Steam must be looking at a file on the PC and seeing if the achievement was triggered and then unlocks it. If the file says it was already unlocked, then it won't try to unlock it. Since it was fresh on this other PC, I was able to get the achievement.Saltome wrote:No, as far as I'm aware the achievements are handled on steam. All the game does is tell the server when to unlock the achievement. So games don't normally need to keep track of the achievements on the computer.
Re: Ren'Py Save System issue
Either way PyTom told you what you should do, and I told you how you can make it happen.
Give it a try.
Give it a try.
Phoenix Star - Persistence, perseverance, ambition.
...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Deviant Art: ...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Re: Ren'Py Save System issue
I'm sorry but these are not solutions. Ren'py isn't distributed on Steam so installing it twice doesn't do anything. It shouldn't be up to the end user to get the games to function. I shouldn't have to delete folders or write protect files. If it is a limitation of the software, then we'll leave it at that.
I was hoping that someone might have some code to do the work so that the dev's can fix their game and that I can attempt to use it in my own games. From the look of it right now, I'll have to find a different platform to work with which is unfortunate as I was having fun with Ren'Py.
I was hoping that someone might have some code to do the work so that the dev's can fix their game and that I can attempt to use it in my own games. From the look of it right now, I'll have to find a different platform to work with which is unfortunate as I was having fun with Ren'Py.
Re: Ren'Py Save System issue
And just what renpy game have you played which allows you to have separate steam achievements on the same steam account, on the same machine?
Phoenix Star - Persistence, perseverance, ambition.
...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Deviant Art: ...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Re: Ren'Py Save System issue
You misread something somewhere. We are not using the same Steam account. Steam isn't the problem. The programming of the game is. Steam is just the reason that I figured out that there is a problem.Saltome wrote:And just what renpy game have you played which allows you to have separate steam achievements on the same steam account, on the same machine?
I believe it is. I don't recall ever seeing this issue in the past. Worst case there were save profiles where a player A could save to Block 1 and player B could save to block 2. Here, the saves are fully accessable to all users on the PC with no way of knowing what save belongs to whom.Saltome wrote:I really don't think this is an universal problem to solve
CorrectSaltome wrote:It's a matter of how each individual game is made
Because Indy dev's are not testing for this situation. They most likely see that the game is working and stamp it done. If the dev is the only one that has access to the computer, they would never see this as a problem and thus wouldn't account for it.Saltome wrote: and most aren't made with your particular problem in mind.
Re: Ren'Py Save System issue
Something isn't right here.
When I save a file it creates a copy in both the game/save directory and the %APPDATA% save directory
When loading the list, the game combines the save files from both folders, and if there are save files with the same name but different content, the folder in %APPDATA% takes precedense.
And I couldn't figure out how the game decides which user's appdata to access.
When I save a file it creates a copy in both the game/save directory and the %APPDATA% save directory
When loading the list, the game combines the save files from both folders, and if there are save files with the same name but different content, the folder in %APPDATA% takes precedense.
And I couldn't figure out how the game decides which user's appdata to access.
Phoenix Star - Persistence, perseverance, ambition.
...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Deviant Art: ...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
- Ocelot
- Eileen-Class Veteran
- Posts: 1883
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Ren'Py Save System issue
...It accesses current user...Saltome wrote:And I couldn't figure out how the game decides which user's appdata to access.
Game does not decide anything. It just asks OS where directory for roaming profile data is located. And gets said directory for currently logged in user.
< < insert Rick Cook quote here > >
Re: Ren'Py Save System issue
And how does it do that? I already looked into that, and all the relevant methods from the OS module are gone. So how does it check who the user is?
Phoenix Star - Persistence, perseverance, ambition.
...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
Deviant Art: ...
Lost Legends
[VN][Fantasy][Open World] Lost Legends
(Bug Thread) Lost Legends
(Direct Download)
- Ocelot
- Eileen-Class Veteran
- Posts: 1883
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Ren'Py Save System issue
Here is the code used by Renpy to select user-specific save directory:
https://github.com/renpy/renpy/blob/9b7 ... py.py#L127
https://github.com/renpy/renpy/blob/9b7 ... py.py#L127
Code: Select all
if 'APPDATA' in os.environ:
return os.environ['APPDATA'] + "/RenPy/" + save_directory
else:
rv = "~/RenPy/" + renpy.config.save_directory
return os.path.expanduser(rv)< < insert Rick Cook quote here > >
Who is online
Users browsing this forum: TioNick