Saving Chargen Data
Hey Folks! Still sorting out the bugs in character creation, focusing on the ability to save and load data generated during that process.
Now that chargen is creating social networks for the captain, career history, and other data, I need to bring the save file up-to-speed so it has that info, too. And that means a fair amount of code changes for reading/writing json data.
Json has a few limitations on the type of data it can store, so many of the in-game data types have a corresponding Json storage class. It tends to store more advanced data in simpler formats, by breaking them into basic types.
Fortunately, a lot of what I added in chargen data was almost already in these formats. So making storage containers was only necessary for a couple of them, and the read/write code was pretty straightforward.
Unfortunately, it's been a while since I tested save/load, and I think I've added quite a bit since then. Been finding several null pointer bugs in things like pathfinding, homeworlds, and social network that needed handling before save will even generate a file. And once I get all those fixed, I still have to verify it actually restored that info correctly.
In more exciting news, I made a few tweaks to the code so that it generates actual NPCs for each social contact now. And furthermore, I added the rest of the homeworlds to the system map. So in theory, social contacts will be wandering around one of the various stations in the system when the player eventually makes their maiden voyage.
Still no real narrative arc, and they won't travel or anything. But one step at a time.
It also looks like I have some more content review to do tomorrow. Both Michael and Emily sent revisions of their current work, so there should be some new stuff there soon!