Back to Space, for a Bit

Hey Folks! As mentioned yesterday, I'm going to step back from the NEO Scavenger engine port for a while. Cool off. Recharge my batteries a bit. I still think I'll tackle it at some point, but I can't really spare any more time on it as it's already delayed the space prototype by over a month. And there aren't really any good builds visible on the horizon.

Let's just say that was my due failure for now, and whatever I tackle next will be awesome. Cause karma, or something.

Anyway, I thawed-out the space prototype from cryosleep, and resumed working on that. When we last left off, the main issue was figuring out how to tie together all of these systems I've created into something that's actually fun. It's interesting right now, but there isn't a flow to it. No real game loop.

I have a few ideas to address that, but I think there are a few missing pieces before I can. Things like formalizing who is crew vs. a visitor, salvaging items from a ship, installing new items onto a ship, scheduling crew tasks/sleep, and buying supplies like food. I think these types of features might help tie together some of the loose systems that don't quite touch yet. Get money flowing in and out of the player's coffers, an ebb and flow to the ship's equipment, and importantly, reasons to go places and do things.

Before I do that, however, I nibbled on something smaller to get back familiarity with the project. Namely, I cleaned-up some redundant character data that appears during chargen. It seems I had a few extra calls to initialize characters' homeworlds, resulting in stacked conditions for their homeworld, strata, and other penalites. I cleaned that up, and characters no longer get double starting homeworlds/strata.

I also cleaned up the self-help kiosk so it no longer shows stuff you shouldn't be able to choose there. E.g. homeworld and strata are determined elsewhere, and this is only meant for physical/mental traits. In the process, I also found a way to remove extra whitespace from the conditions json so it is much more readable now. (Which, in turn, means faster editing/prototyping.)

Once these were done, I turned to a much bigger, more fundamental task: shallow vs. deep ship loading.

It's long been a pain point for me that any sort of ship data I work with in the game involves a noticeable loading time. Even with stations being relatively tiny layouts, loading a dozen of them at the start of the game causes a delay. And anytime the game needs to load a social contact on a new ship, or even the player's new ship when finishing chargen, there's also a lag spot.

Going forward, a lot of ships are going to be in the game at any given time, and this can't happen every time I load one. (Not to mention, will there even be enough ram?)

That's where "shallow" ships come in. Rather than loading the entire layout, hooking up all the hardware, calculating rooms, and all that other stuff nobody will even notice when off-screen, a shallow ship is just a shell with necessary data. The ship's name, positional info, where it's going, and a pointer to the full data when I need to load it.

The exception are crew. The game needs to look-up NPCs across the system when figuring out plots/quests, and this means knowing their stats to see if they have important variables on them. The good news is that they are comparatively light to load compared to a ship. I suspect even stations with a dozen or more of these NPCs won't be too bad. And they already have "shallow" versions of their own in case that becomes a problem. (The social network for any given NPC assumes they are all shallow unless more info is specifically requested on one.)

Anyway, I mostly have this working now. And it is indeed faster in practice. New games have much less loading time, and the only noticeable lag time is clicking "Launch" when finishing chargen. (Which is basically the same lag that used to happen when choosing a ship during career history, just that now it happens at the end of chargen instead of the middle.)

The one bug I'm seeing right now involves loading a save game. I get duplicate items on the playership, all set at 0,0. Looks like maybe a cloning and/or parenting issue.

With this done, I should hopefully be able to spawn more ships without hurting the gameplay much. And turn my attention to the gameloop stuff above.

Tags: Ostranauts