Guess that to do.

Finally stopped procrastinating and reworked the savegame format. It’s a bit more like Minecraft now.

Instead of a single world.bin containing every board and their respective entities, there’s now a world.bin that only contains some meta information on the region and the player data, and a series of Board###.brd files with each board and their entities.

Instead of loading the entire region in memory, only recently active boards are loaded, and flushed to disk after a period of not having Update() called. So in the corner of the world, only four boards are in memory plus the recently seen, at the sides only six, and anywhere else nine. And in dungeons, only the recently seen are in memory.

If an NPC moves from one board to another, they’ll physically move from one file to another – but only when both boards are flushed.

Not only is this somewhat more memory efficient, and does it cut down on loading and saving times, but it also opens the door to region switching ala Minecraft, letting the player travel to an entire new region in the same game world, to be generated when the player actually gets to that point, all by adding another level of folders! Noxico\Save name\Region name. BAM.

And dungeons. Can’t forget the dungeons. I can just scatter entrances all over the region now and just mark them as “ungenerated” or something. At the current world size (which is 8) I have 64 board files. This number would increase as I try to enter more dungeons.

[ ]

Leave a Reply

Your email address will not be published. Required fields are marked *