How could Achievements be wiped but not the Gallery?

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.
Message
Author
skybeargames
Newbie
Posts: 18
Joined: Fri May 31, 2019 12:16 am
Completed: The Nine Lives of Nim: Fortune's Fool , Wonderland Nights: White Rabbit's Diary
Projects: Her Jentle Hi-ness
Tumblr: skybeargames
itch: skybeargames
Location: New Zealand
Contact:

How could Achievements be wiped but not the Gallery?

#1 Post by skybeargames »

Hi all, first time question poster, long time lurker.

I've got a friend I've made on Twitter who has an unusual conundrum with one of my games, and I just cannot figure out what is up with her problem.

The game is The Nine Lives of Nim: Fortune's Fool. This person has played it, unlocked all the achievements, and then updated the game when I released the voice acting update to find that all her achievements are gone in the game's internal achievements record. Steam still has them unlocked though.

BUT, to complicate matters, the galleries in the game are still all filled in!

I'm very confused. I was under the impression that the Achievements API uses persistent data. The only difference I can see in how I programmed my achievements screen and my gallery screen is that the gallery is looking at persistent image unlock variables, and my achievements index is looking at achievement.has. How can one be unlocked, but the other suddenly be locked after an update?

Now, there are a few more complicating factors that I have gleaned from talking to her.
1) It seems another non-Ren'py game is having the same problem for her, internal achievements are showing as locked but Steam says she has them. I asked if she wiped her caches or anything, she can't remember doing so. She's playing on the same machine as before.
2) The game did have a name/branding change after initial release. She unlocked everything before the name change in November last year. I have no idea if this would have any impact. I didn't change any code around the gallery or achievements areas in any of the updates (art upgrade and name change November last year, voice acting update last month).

Does anyone have any ideas? I've tried a bunch of hypotheticals but nothing is working for me. achievements.sync() and achievements.Sync() don't seem to make a difference. Very strange!!

(P.S. I am totally expecting the answer to be something that is going to make me kick myself :lol: )

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: How could Achievements be wiped but not the Gallery?

#2 Post by emz911 »

Haven't seen your code, could you have defined or make default your persistent achievement variables? It's hard to tell what's wrong this way.
Despite what's causing the problem, you might want to let players regain their achievements in-game by checking them in init:

Code: Select all

If achievement.has("achievement_name") and not persistent.achievementname:
      #Make the persistent variable to true again
Somewhere along those lines should make up for their lost achievements.

skybeargames
Newbie
Posts: 18
Joined: Fri May 31, 2019 12:16 am
Completed: The Nine Lives of Nim: Fortune's Fool , Wonderland Nights: White Rabbit's Diary
Projects: Her Jentle Hi-ness
Tumblr: skybeargames
itch: skybeargames
Location: New Zealand
Contact:

Re: How could Achievements be wiped but not the Gallery?

#3 Post by skybeargames »

Hey, I appreciate the difficulty with not showing my code, I'll do so if I can think of where it's going to be important because it's a lot of code we're talking about here. But I'll show relevant samples below, thanks.

So I don't have any Achievement persistent values. I was relying solely on the Achievements API to do that. No problems with it up until now. Reading the documentation it says that "By default, the achievement stores information in the persistent file". I'm wondering if the next thing to try is registering the achievements right at the top of the game, rather than immediately before granting them. Maybe if I sync after that, it will make it all pop back in?

Here is how I grant achievements:
$ achievement.grant("My spirits, as in a dream")
$ achievement.register("My spirits, as in a dream")
$ achievement.sync()

Here is how I unlock a gallery picture:
scene bg faerie with fade
$ persistent.unlock_faeriebg = True

Here is how I have coded my achievements screen:
if achievement.has("Fortune's Cat"):
text "{color=#ab944c}You have finished the Friend of Cats storyline.{/color}"
else:
text "You have not finished the Friend of Cats storyline."

For making my gallery I used Dirchansky's Gallery tutorial: https://dirchansky.itch.io/come-for-a-d ... l-tutorial

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2399
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: How could Achievements be wiped but not the Gallery?

#4 Post by Ocelot »

This is something really strange. Are you sure that you don't call achievement.clear_all() anywhere? This is the only thing I can think about. Also it looks like your game does not properly connect to Steam there: achievement.has returns True if achievement is granted in any backend, be it persistent data, or steam.

Syncing achievements tries to grant steam achievements unlocked in persistent data, so it would not help there.
< < insert Rick Cook quote here > >

skybeargames
Newbie
Posts: 18
Joined: Fri May 31, 2019 12:16 am
Completed: The Nine Lives of Nim: Fortune's Fool , Wonderland Nights: White Rabbit's Diary
Projects: Her Jentle Hi-ness
Tumblr: skybeargames
itch: skybeargames
Location: New Zealand
Contact:

Re: How could Achievements be wiped but not the Gallery?

#5 Post by skybeargames »

Nope, no clear_all, but that's a fair call :lol:

That is interesting to hear that it's not connecting properly with just achievement.has on the achievements screen. And also, achievement.has is how I grant certain new game plus features. So... the problem is with achievement.has? Do you think? Is there something I have to do to connect it up again? Did something change in a Ren'py update perhaps?

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: How could Achievements be wiped but not the Gallery?

#6 Post by emz911 »

skybeargames wrote: Tue Jun 08, 2021 11:19 pm Nope, no clear_all, but that's a fair call :lol:

That is interesting to hear that it's not connecting properly with just achievement.has on the achievements screen. And also, achievement.has is how I grant certain new game plus features. So... the problem is with achievement.has? Do you think? Is there something I have to do to connect it up again? Did something change in a Ren'py update perhaps?
What do you mean you use achievement.has to grant other features? This statement only checks for the achievement, returning true if unlocked. For granting you use achievement.grant, not has... It might help if you could show the codes where you unlock achievements, "grant other features," as well as the code of the screen where you check for them.

skybeargames
Newbie
Posts: 18
Joined: Fri May 31, 2019 12:16 am
Completed: The Nine Lives of Nim: Fortune's Fool , Wonderland Nights: White Rabbit's Diary
Projects: Her Jentle Hi-ness
Tumblr: skybeargames
itch: skybeargames
Location: New Zealand
Contact:

Re: How could Achievements be wiped but not the Gallery?

#7 Post by skybeargames »

No problem, here we go:

Here is how I grant achievements:

Code: Select all

$ achievement.grant("My spirits, as in a dream")
$ achievement.register("My spirits, as in a dream")
$ achievement.sync()
Here is how I have coded my achievements screen:

Code: Select all

if achievement.has("Fortune's Cat"):
text "{color=#ab944c}You have finished the Friend of Cats storyline.{/color}"
else:
text "You have not finished the Friend of Cats storyline."
Here is how I grant special bonuses for new game plus:

Code: Select all

if achievement.has("Fortune's Cat"):
                    $ KNO += 3

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: How could Achievements be wiped but not the Gallery?

#8 Post by emz911 »

Hmm I don't immediately see any problem with the code... Just to make sure, if you clear persistent and test these achievements yourself, they work as intended right?
You also said that you changed the game name/branding, where specifically did the change happen in? options.rpy? If so, I wonder if the Renpy achievement module has something to do with the game's name...
We can do some elimination first then ask in the Discord server!

skybeargames
Newbie
Posts: 18
Joined: Fri May 31, 2019 12:16 am
Completed: The Nine Lives of Nim: Fortune's Fool , Wonderland Nights: White Rabbit's Diary
Projects: Her Jentle Hi-ness
Tumblr: skybeargames
itch: skybeargames
Location: New Zealand
Contact:

Re: How could Achievements be wiped but not the Gallery?

#9 Post by skybeargames »

Yep, my achievements do unlock as expected if I clear persistence and re-unlock them.

Good idea, here is what I have in options.rpy:

The original release:

Code: Select all

define config.name = _("Prince of Cats")
define build.name = "PrinceOfCats"
The latest release:

Code: Select all

define config.name = _("The Nine Lives of Nim: Fortune's Fool")
define build.name = "FortunesFool"
Not sure about whether the Achievements module relies on them. I do know it needs the steamappid but that's definitely correct in both releases.

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: How could Achievements be wiped but not the Gallery?

#10 Post by emz911 »

Maybe experiment by creating a new game. Unlock the achievements with the same code, change those name configurations, then launch the game again and check if the achievements are lost. If you can't replicate it, the problem is most probably on the users side (can't think of anything else that would cause this problem!)

skybeargames
Newbie
Posts: 18
Joined: Fri May 31, 2019 12:16 am
Completed: The Nine Lives of Nim: Fortune's Fool , Wonderland Nights: White Rabbit's Diary
Projects: Her Jentle Hi-ness
Tumblr: skybeargames
itch: skybeargames
Location: New Zealand
Contact:

Re: How could Achievements be wiped but not the Gallery?

#11 Post by skybeargames »

Thanks emz911, I'll give it a go when I get a chance and post up here how it goes. I'm not sure it will happen for me because it was just that one user experiencing it. But QA life continues :D

skybeargames
Newbie
Posts: 18
Joined: Fri May 31, 2019 12:16 am
Completed: The Nine Lives of Nim: Fortune's Fool , Wonderland Nights: White Rabbit's Diary
Projects: Her Jentle Hi-ness
Tumblr: skybeargames
itch: skybeargames
Location: New Zealand
Contact:

[Solved] Re: How could Achievements be wiped but not the Gallery?

#12 Post by skybeargames »

Heya I just wanted to update you guys who were helping me.

I got another bug report from a different user, this time someone who was a brand-new user who wasn't getting the achievements to unlock on Steam. So I knew it had to be something with the connection to Steam itself that was messed up.

Did some reading and realised something had changed between updates: the usage of define config.steam_appid rather than just putting it in a .txt file in your ren'py directory which was the old way of doing it.

So now not only do achievements unlock for the new user, but the achievements page is now fully unlocked for the user who already achieved everything prior to this latest update.

Thanks team, and as my toddler would say "All doney".

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: How could Achievements be wiped but not the Gallery?

#13 Post by emz911 »

Nice to know!!! I certainly needed this information before updating my game lol. I do wonder if we should post this reminder, as well as updates like being able to download the SDK now directly from the launcher, under the Steam Achievements Guide (somewhat outdated but extremely useful) for others who might need the information: viewtopic.php?f=51&t=50060#p486320

User avatar
Bertran
Regular
Posts: 33
Joined: Tue May 02, 2017 12:58 pm
Projects: Run, Kitty!
Deviantart: bertranway
Skype: bertranway
Contact:

Re: [Solved] Re: How could Achievements be wiped but not the Gallery?

#14 Post by Bertran »

skybeargames wrote: Mon Jun 28, 2021 5:59 pm Heya I just wanted to update you guys who were helping me.

I got another bug report from a different user, this time someone who was a brand-new user who wasn't getting the achievements to unlock on Steam. So I knew it had to be something with the connection to Steam itself that was messed up.

Did some reading and realised something had changed between updates: the usage of define config.steam_appid rather than just putting it in a .txt file in your ren'py directory which was the old way of doing it.

So now not only do achievements unlock for the new user, but the achievements page is now fully unlocked for the user who already achieved everything prior to this latest update.

Thanks team, and as my toddler would say "All doney".

You mean, somewhere in the script of the game I should paste

define config.steam_appid = 1630630

?

Also, if I put .txt file also, it still will work on Mac?

skybeargames
Newbie
Posts: 18
Joined: Fri May 31, 2019 12:16 am
Completed: The Nine Lives of Nim: Fortune's Fool , Wonderland Nights: White Rabbit's Diary
Projects: Her Jentle Hi-ness
Tumblr: skybeargames
itch: skybeargames
Location: New Zealand
Contact:

Re: [Solved] Re: How could Achievements be wiped but not the Gallery?

#15 Post by skybeargames »

Bertran wrote: Sun Nov 14, 2021 4:27 am
You mean, somewhere in the script of the game I should paste

define config.steam_appid = 1630630

?

Also, if I put .txt file also, it still will work on Mac?
Yes to the first part. I put it in my options.rpy personally.

I can't vouch for the last part sorry as I don't have a Mac to test on, but I did leave the txt file in the folder rather than delete it, just in case it would somehow break something.

Post Reply

Who is online

Users browsing this forum: Google [Bot]