Libove Blog

Personal Blog about anything - mostly programming, cooking and random thoughts

#gamedev

I've refactored the persistence system of my game entirely. Before the refactor I saved an intermediate representation, which was created by the level generation. When a room was loaded the representation was transformed into entities to be added to the world state. As I also had to track the positions of books and scrolls, I had to pollute the structure further and further. This made adding new mechanics difficult as I had to somehow fit it into this awkward structure.

My new approach is to simply save all entities (I use fat structs to represent everything) belonging to a room in a single file. Whenever something changes in a room, I can just serialize all entities and be done.





Interactions

Liked by B-Up Games

Liked by adelang