We're Loaded!

Hey Folks! I think loading is mostly working now.

Today's screenshot shows a sample game I loaded from a json file generated in an earlier session. Notable features include:

  • The player ship is the tiny room with a chair at the bottom of the screen.
  • The currently docked station is the larger layout of rooms and corridors above. (MTRS station)
  • All ship and station parts are loaded with their previous stats, positions, etc.
  • Ditto for all rooms and tiles on each ship (for things like pathfinding, atmospheric sim).
  • Each of the crew members were recreated with the stats from last session, at correct positions and orientations.
  • Each crew's interaction queue was restored where they left off.
  • Each item and crew's log message history is saved and restored.
  • Each crew's current pathfinding goal is restored.
  • Each crew's appearance is restored. (Pictured here is Lu, with the same face and shirt from when he was saved.)

In theory, the System is restored, too. Meaning all planets, moons, and ships are where they should be. I haven't tested this yet, though. I'll need to try a more complete ship for that, since I cannot undock and fly without a reactor, and a reactor cannot run without fuel, etc.

Just to recap: I launched the game, clicked "New Game" on the main menu to spawn the default ship docked at MTRS. Then I spawned 2 random crew members onto my ship, saved the game, and quit. I then relaunched the game, clicked "Continue," and we're pretty much looking at the same way I left it!

It's such a small-seeming thing in a game these days, but saving and loading is a huge task behind the scenes. And it's probably far from done, as most of today was spent fixing little things I noticed were broken or missing each time I tested the save file a bit further.

Tomorrow, I'll continue testing the save file for data retention of in-flight stuff. Once I can reliably save and load a ship, crew, and system arbitrarily, I think I'll be in decent enough shape to start following a specific crew around to see how their story develops (or doesn't). This should help me figure out where I need to focus to make it exciting to load up the game again. Which, on first instinct, might be setting up the player/captain's backstory and rivals/friends, and some sort of encounter system to handle choices. We shall see!


matsy's picture

Do you use unit tests?

dcfedor's picture

To a degree, I suppose. But not anything rigorous.

When developing features, I'll often test their atomic functionality before trying to combine them. And when I make a significant change to the game, I'll usually run through some ad-hoc regression tests.

But I feel like if an honest-to-goodness AAA lead programmer joined the team, they'd shake their head :)

Dan Fedor - Founder, Blue Bottle Games