Issue with successfully saving and reloading a "score".

Discussion and help for Easy Save 3
Post Reply
andymetoo
Posts: 14
Joined: Thu Apr 07, 2022 10:25 pm

Issue with successfully saving and reloading a "score".

Post by andymetoo »

Hello. Perhaps I'm going about this all wrong, but before I continue experimenting, I figured I'd see if someone else had a better approach to doing this. I have collectible items in my game. When you collect them, the FSM adds one to a variable "Collectibles" and sets the UI text to that variable. I have quick save set to save the text of the UI score. Upon load, ALMOST always (but not always!), the number is one greater than before. Eg, you re-load with 6 collectibles and it loads to 7. You can keep doing this over and over and it'll go 8, 9, 10, etc. However, there have been some instances in the past where the number has not increased, so it's hard to tell.

Anyway, if anyone has had this happen before (or if I'm just going about it like an idiot) then I'd love to hear your advice! Thanks.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Issue with successfully saving and reloading a "score".

Post by Joel »

Hi there,

This would indicate that there is somewhere else in your logic incrementing the number alongside it being loaded.

Please could you replicate this in a new project with a very simple scene which isolates it to Easy Save and private message it to me with instructions.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
andymetoo
Posts: 14
Joined: Thu Apr 07, 2022 10:25 pm

Re: Issue with successfully saving and reloading a "score".

Post by andymetoo »

Hello Joel,
Okay, good to know. I will try to replicate the problem in a different project if need be, but if you're confirming that I am doing it correctly and that it is a problem with my logic elsewhere then I am going to start by looking there! I'll see if I can search through everything and see what the problem is. I'll update if I find anything. Thanks for the reply!
andymetoo
Posts: 14
Joined: Thu Apr 07, 2022 10:25 pm

Re: Issue with successfully saving and reloading a "score".

Post by andymetoo »

Lo and behold, not 30 minutes after I posted the previous message, I figured out the problem. Sorry to waste your time!

For those interested, it's totally my error and kind of embarrassing, but it makes sense now.

I have certain "checkpoints" in my game that it auto-saves at. Also, the collectibles, upon collision, go through a cute little particle-animation before they are deactivated. This leaves a period of about 4 seconds between initially touching the collectible and the collectible object itself eventually becoming deactivated at the end of it's FSM (after playing the animation, etc).

What was happening was I was hitting a collectible (adding to the score), and hitting the auto-save checkpoint within that 4 second buffer period, before the collectible object became "inactive". So, upon reloading, that one collectible in particular was in a limbo-state of having the deactivation FSM in progress, but still active, and would reload as active - thus instantly adding to the score and becoming inactive seconds later.

That felt like a ramble, but I hope it made sense. It's an easy fix as I'll just move that one collectible item further from the save checkpoint. That's the easiest solution.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Issue with successfully saving and reloading a "score".

Post by Joel »

Glad you managed to resolve your issue :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply