Question by
theklassyfox · Mar 30, 2019 at 03:50 AM ·
savesave datasaveloadsave game
How should I save entity's data that have different variables to store?
My game has a map and it can be modified by users like Minecraft. For example, there are chests, trees, animals, NPCs, and chests. Each one should store the position when unloading a map, but they also have different variables for each to be stored. For example, chests should store an array of items, trees should store the time when it should produce fruits, animals should store hp, NPCs should store inventory(items) and hp. All these should go into save file data and I need a method to save and load them and consistent way to save them.
Comment