I make games.
One part of the games is the data, such as say an inventory. This data is organized as classes. Each class that needs to be saved or loaded has appropriate methods. This adds up real quick.
The easiest and fastest way to do this is to to just save the raw data, the zeros and ones if you will. Internally the data can be things like a string, or integer. So you just save all the strings and int, and load them in the correct order. But the smallest upgrade to your game, and your save files no longer work.
Another common method is key value pairs. Here you save two things together. As in “age = 24”. This provides a little more flexibility compared to the above method. Your save file won’t break when more things are added, but there is a lot of overhead.
Then there is the need to link things together. Imagine the sims where a sim can be friends with another sim. You would only save an identifier, like the sims full name. Then when you load, you need to link it back together by finding the sim with that name. Linking is usually done after loading all the other data, otherwise you may try to link to something which hasn’t been loaded yet.
I’m glad you understand how much work goes into something as trivial as saving and loading.
Latest Answers