14

Sometimes you might want to store your savegame data somewhere else than on the users hard drive. You might offer a cloud save service, for example. In that case you would use SaveDataToMemory to create a savegame in a memory buffer and then send that memory buffer to a server via network. Another possible use-case could be to always keep the last savegame ...


9

Text files are a perfectly fine way to create savegames. It's easy to implement and it allows you as the developer to edit savegame files in a text editor in order to test things more quickly. But for easier parsing and better compatibility between versions, you might want to use a standard markup format like XML, JSON or YAML which you serialize and ...


2

The rotation comes from the calculation of the index in load_from_file(), it should be: chunk[i][j] = std::stoi(tokens[i * Constants::BIOMESIZE + j]); That said, it would be much better if you could save the file in such a way that you can load it back the same way. Instead of using "," as a separator, use a space (" "). Then you can ...


1

When updating the app, all the saved data will remain the same. This includes local files you write to, which you seem to be using.


1

I tested the code as I didn't see anything wrong with it and it works fine. Be sure to check if there are any yields, breaks, anything that could stop PlayerRemoving event from firing / executing the whole code.


1

If your game requires a server anyway, then the most platform-independent method is indeed to store savegames server-sided and use accounts with passwords to synchronize savegames between devices owned by the same person. Accessing the savegames on the server could be done via a webservice.


1

As you’ve noted, you’ve got two ways to handle conflicting data. Either pick one, or try to merge the two games together. I have worked on games that have done both, and I highly recommend the first option. With the first option, whenever there is a conflict, the game simply presents the options to the user, with a bit of info about each save state (eg. ...


1

Several possibilities here. But you could simply have a dictionnary of ID/Prefab saved in a Scriptable Object that would act as a database for you. Then you would just have to save the ID of the prefab you want in your JSON save file. At runtime, when you load your JSON file, you'll end up with a bunch of IDs, and the only thing you'll have to do is to go to ...


1

If you want to prevent casual passcode guessing, add a couple checksum bits somewhere into the passcode. Calculate the value of these bits from the values of those bits which contain actual data. When you parse a passcode, check if the values of the checksum bits matches, and if not, reject the passcode. You can do that with a stock hash algorithm or by ...


1

So you already have added a property for "quantity" on your objects. This is a good start. There are a lot of approaches to this but the most straightforward approach is to use an "InventoryManager" class. So rather than directly adding items to your inventory, they would pass through the InventoryManager. This class simply scans your inventory contents to ...


1

If you want to be sure they won't misuse save data don't give it to them in any form :) You may give them some key to save stored on for example firebase or playfab that they can recover by entering it or just create authentication mechanism that will connect them to all their data saved in cloud. If you don't really care just give them that JSON. If ...


Only top voted, non community-wiki answers of a minimum length are eligible