Keeping player data after upgrading game version?

Creating Games? Developing something for fun?

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
soloista
Posts: 10
Joined: Tue Apr 07, 2015 12:50 pm

Keeping player data after upgrading game version?

Post by soloista » Tue Apr 07, 2015 12:58 pm

Hi - first post so usual apologies apply if this is in the wrong place, I have had a search but couldn't find an answer.

I am building a game made up of levels which must be solved to unlock the next level. I'd like to add more levels over time but am thinking that when I upgrade the game I want to make sure that I don't overwrite the player's progress in the earlier version, so am wondering how best to store progress/achievements so that they are not erased when the game is upgraded, any ideas? (if there are some standard stacks already for this that would be great too! :D ).

Thank you in advance

soloista
Posts: 10
Joined: Tue Apr 07, 2015 12:50 pm

Re: Keeping player data after upgrading game version?

Post by soloista » Tue Apr 07, 2015 3:55 pm

Am I on the right lines: Save player achievements to a .txt file outside of the app - seems like a sensible thing to do to encrypt this to stop people editing it themselves?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6151
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Keeping player data after upgrading game version?

Post by FourthWorld » Tue Apr 07, 2015 4:23 pm

Any data that is saved in any app is saved in a file separate from the executable; modern OSes don't allow executables to modify themselves, and as you note even if it were possible to save the data with the executable that data would be lost each time the user upgrades.

Both OS X's Application Data folder or Windows' AppData folder are user-writable, but both are hidden by default and most users understand that's for a reason. It's not impossible for a user to poke around and edit files through other means (it is, after all, their data), but uncommon (since most understand it'll likely break the file and make the data unusable).
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

soloista
Posts: 10
Joined: Tue Apr 07, 2015 12:50 pm

Re: Keeping player data after upgrading game version?

Post by soloista » Tue Apr 07, 2015 4:37 pm

Aha, thank you, that makes life easier! So I should just be able to save game data to the AppData folder as a simple text file?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6151
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Keeping player data after upgrading game version?

Post by FourthWorld » Tue Apr 07, 2015 4:52 pm

You can get the path to the user's AppData folder with specialFolderPath(26)

FWIW, other folder path constants are listed here:
http://www.sonsothunder.com/devres/live ... ile010.htm
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

soloista
Posts: 10
Joined: Tue Apr 07, 2015 12:50 pm

Re: Keeping player data after upgrading game version?

Post by soloista » Tue Apr 07, 2015 5:14 pm

Thank you - I was worried that I'd build the app and only then think about upgrades... this is much easier, thank you

Post Reply

Return to “Creating Games”