Game Development Asked by Tair Galili on February 28, 2021
I am currently developing a game in unity and I want to add some sort of saving system that saves the following:
As you can see, the data I want to save is global, and has nothing to do with any specific scene.
How would you reccomend save this kind of data? I have heard about the EasySave asset but I don’t know if it is the right choice: it is pretty expensive and I belive that there has to be some easier, cheaper (even free) way to save the data.
I’ll appreciate any answer or consideration.
Unfortunately Unity does not have a build-in savegame system. So every game needs to develop an own savegame system which is tailored to the architecture and requirements of that specific game. That means there is no "best" way to save data, only the way which is best for you.
When you have very little data to save, then using the PlayerPrefs class can be a quick and easy way to do it. In your particular case, this could be sufficient. But it is intended for, well, preferences. A short list of key-value pairs. It is not designed to hold large amounts of data, and even allowing more than one savegame quickly becomes messy.
So you likely won't get around inventing your own savegame file format which you read and write with the standard C# classes like StreamWriter
/ StreamReader
(for text-based formats) or FileStream
(for binary-based format).
When you only want to save the game state between scene changes, then you only need to persist the data which you already need to handle between scenes. That makes a lot of things a lot easier, because you already have a good overview of what data you have.
But if you want to have a system which allows to save and reload the game at any time, then it gets a lot more complicated. Such a system needs to:
As you can see from the complexity of some of these points, this is not something where one solution fits every game. But a couple tools that could come in handy for creating your savegame system could be:
Correct answer by Philipp on February 28, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP