The concern is: what if my game has a rare bug that I haven’t tested for or a future bug is released in a future update that is a server side bug and it causes a players data to be invalid / wrong (I have lot’s’ of data including upgrades, pets, workers, cash, areas etc and there’s alot more) If any of this data becomes corrupt the player essentially can no longer play the game because the server side code won’t work and won’t know what to do with this invalid data. If a bug got released like this that I hadn’t tested for then the game could potentially be ruined for many people and the game will die.
How can I prevent this?
One option would be the save the data with different keys each time.
e.g. plrid_updateid_key
You would just store the last player save id in another datastore. No id = no player data so no need to check the history ofthe update ids.
No data would be lost between updates and can be rolled back if needed.
There is a datastore method to get previous versions. Combined with the ListKeysAsync method, you could loop through all keys, check if there’s data from after the bug was released, and roll it back with the GetVersionAsync method if necessary.
Wouldn’t that cause some people to lose data that didn’t experience the bug because they played the game since the bug was released but never actually triggered it.
This is especially bad because people can buy pets with robux as a developer product and they would lose this data without getting their robux refunded
the chances of this happening is like 0% as long you dont get a backdoor and use good datastore saving modules like profileservice but if it does happen you could just open up requests for data recovery
I’m using my own data saving. I didnt’ use profile service because I feared lack of “official documentation” as well as the fact that I just couldn’t get my head around how it worked.
Why are the chances 0%?
Lot’s of bugs could cause data to be set to sometihng unexpected and that person can now never play the game properly again without getting their data reset or rolled back
profileservice is really trusted and used by almost all games on the frontpage,
its 0% because when an error happens in a script, its limited to the thread currently running, which means theres no way it would affect other peoples saving and even lets say it somehow does, it would only affect the current server (aslong you have coded it properly)
working with datastores in general is sensitive so you should use a separate experience to test your data scripts if it requires
My game is fairly large, with about 14,000 lines of code. It’s a week away from “beta testing” and maybe 2-3 weeks away from launch. Is it realistically possible to transfer my whole game to Profile Service, or would that be ridiculous and require a complete redesign? I’m asking because I’m not sure how Profile Service works, but I’m willing to learn.
As for the 0% issue, the thread is irrelevant because any script, anywhere, in any thread, can “change the person’s data.” And if their data becomes invalid, then it doesn’t matter if my data-saving script works; their data is permanently broken. If the bug is rare but not nonexistent, and let’s say it affects 1% of users, imagine the game has 10,000 players every month. That would mean 100 people would be completely losing all their data and can no longer play the game.
profileservice looks hard and complex at first but behind the scenes its really simple to use, for transferring it would be just copy pasting most of the stuff but still modifying major things
PF works like this
- you load the players “profile” (data) onto a variable
- you run a function that processes that profile, lets say the profile has a table called “OwnedCars”, you just loop through it and give him the cars in game
- when the player leaves, you run your save function, which changes the profile variable and changes the table “OwnedCars”
- after changing the profile, you can now just “release” the profile, which actual saves it to the database and tells other servers that this players data is ready to be loaded again with no problem
- doing it this way helps in preventing dataloss, item duplication etc
if your datastore is that large id just recommend fixing this ‘bug’ by properly debugging it and adding more checks
So if profile service works by all the players data being stored in a table. Wouldn’t that mean that leaderstats wouldn’t work and show up in the top right corner as the cash if being stored in a table. Also how would you as the developer easily change your data e.g. give yourself good pets if it’s all stored in a table rather than folders (with folders obvs you can just edit the int values, bool values etc)
*dictionary
No, just… get the value out of the dictionary
If you coded this thing even half-decently, all your data storage should be server-side, which means it shouldn’t be able to be tampered with…
Dictionary is a type of table
Most is in a folder called PlayerData (like leaderstats but doesn’t show on the leaderboard)
Then all I need to do to is go onto server mode in studio and I can cahnge what I want in the folder
So it’s all still replicasted to the client but if the client changes it then all the important checks are still done on the server