Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+3)

Hi! Can you tell us a bit about your programming skills? That may help us to determine how to help you.

In my case, when I want to store game data as a level, map or a game state, I serialize data (considering your classes are well defined), to be able to store it later in something like a XML/XAML/JSON file. You can encrypt it and all, so players won't see a readable text file, but if it's your first time with this, when serializing, leave it without encryption at first so you can open the file easily with text editors. That will help you debugging.

The Load part is a little trickier, because you may need to rebuild from that, deserializing and then reinstantiating all the game elements from the data you stored when saving.

The part about "(considering your classes are well defined)" is very important so your data is well enough designed so when serializing you won't end with bloated save files, redundant data, or loops in your class structure (this is will crash your serialization).

You can find this Unity asset extremely helpful for the task:

https://assetstore.unity.com/packages/tools/input-management/json-net-for-unity-...

And this documentation:

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/serial...

https://www.c-sharpcorner.com/article/serializing-objects-in-C-Sharp/

Hope this helps!

Good luck!