N
N
Neyury2016-05-14 13:28:42
Programming
Neyury, 2016-05-14 13:28:42

How is data stored in games?

More interested in how data is stored in single-player games and applications. I understand that there are two ways, this is the creation of files and the use of the database. But how exactly is this done, and when is which method used?
For example, how is data stored in the game "Space Rangers"? Each NPC has its own ship, its own equipment and characteristics, it does not disappear from the game and does not appear in a random place in the world, its position is always known. In addition, the game has a search for all objects. If the game uses a database, then how exactly does it look and be implemented? (I understand that this may not be known, but at least theoretically, or how would you implement such a thing)
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Georgy Pelageykin, 2016-05-14
@Neyury

There is a similar task now, there is a pet project like KR and other similar games. In order to resolve this issue, I do something like this:
The save/load cycle for, say, a star system is:
Actually, I recently started to implement this business, incl. I don't know yet how easy it will be to use. It is quite possible that I don’t see many pitfalls, or they will come up as the game becomes more complicated (for example, when more logical connections are added, you will have to check so as not to serialize the same thing several times, receiving different objects when loading. Therefore, everything should have some ID, to prevent duplication).
Since I wrote it, I will be grateful if more experienced developers point out major rakes in this approach, if any.

D
Dmitry Belyaev, 2016-05-14
@bingo347

There are two approaches:
1) save all changes in real time, more often used in online games, since they do not need the ability to roll back. With this approach, it is better to use some kind of database
2) save by event, more often used in single games, as it allows the player to roll back to one of the previous saves, it is better to use files in which the serialized game object model will be stored

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question