hayho
New Member
Posts: 3
|
Post by hayho on Dec 17, 2020 8:23:53 GMT
Hi, echo and everyone:
Sorry in advance if the question seems dumb. I put all of my game data in the database of simpleSQL. My problem is , if I want to add a save/load feature in my game. So that player can have older version of the working copy of the database to replace the current one. What is the best way of doing it?
I do notice there are information about Upgrade Path in both manual and FAQ. Is it how I should do it?
Also, I bought another plugin from assets store: Easy Save - The Complete Save & Load Asset, would it help at all in this case?
Thanks a lot.
|
|
|
Post by echo17 on Dec 17, 2020 14:10:20 GMT
One way would be to have multiple databases like you suggest, but I would not recommend that. Instead, I would use a relational table system:
1) Have a table in your database that keeps track of the games, like:
GameID INT TimeSaved TEXT ... etc.
2) Change all your other tables to have a GameID field. Then when you want to access a particular game's data, you'd just filter on the GameID (or use a join to the Game table).
The upgrade path is only needed when you make structure changes to your database, like adding/deleting a field to a table, or adding/deleting a new table. So that you don't stomp on your user's data, the upgrade path makes incremental version changes to the database, preserving the data it contains.
I have not used Easy Save, so I could not speak to how to incorporate it.
|
|