Hey Folks! Today was all about ships and ship systems, as I started prepping for adding docking to the game.

Initially, that meant a lot of reading and thinking, as I refreshed my memory on how everything worked in code, then tried to come up with ways to represent the concept of a docked "other" ship. How would AI know it could pathfind on another ship? What about gas exchange between ships? What about room and item ID uniqueness?

As I started to form a picture of what was needed, that last point became a clear place to start: I would need a better ID system to ensure things could be tracked uniquely across multiple ships/stations.

It was a fairly easy change to make: just a simple change from numerical ID to a string. There's even a built-in library for generating a guaranteed unique id (a.k.a. GUID). So I updated all ID references in the game to be string GUIDs, and I think we can now have two ships dock without any item ID collisions. (Room IDs might also need this, but I'll get to that when ready.)

The next thing I decided to do was to build a more representative ship layout, with a docking system, nav station, batteries, atmo, bed, toilet, and fridge. Still far from a complete ship, but it gives me a chance to make sure all the current systems I've developed still work.

Incidentally, they don't :)

Looks like I made changes along the way that broke a few things. Not to mention some errors. My code to calculate input points around an object, for example, wasn't working when rotated. (I had my Y axis flipped, and my rotation in the wrong handedness.) So untangling that took some time.

Then, once I had my powered things using power, and my gas things pumping gas, I noticed another issue: opening the docking airlock wouldn't vent any air. In fact, my ship seemed to think it had an airtight room outside the port wall, and that the docking airlock room was infinite in size.

As it turns out, my code to calculate rooms was tripping on some edge cases, such as a port-side docking system. And, as far as I can tell, maybe the docking system itself? Somehow the bulkheads around the docking airlock are being treated as walls, portals, obstructions, and walkable, all at the same time. So who can blame the room generation code for getting confused by that?

Tomorrow, I'll see if I can figure out why that's happening. Once done, I can verify that the ship atmo sim is working again, and then...I guess load a second ship, rotate and align it to the docking ring, and see what happens?


Marc13Bautista's picture

Nice! I hope you'll add ship customization (those ground tiles look rather strange) in addition with the ship layout.

Free Elusive Skill = Athletic x4 in ATN Enclave encounter

ra1's picture

Ugh I hate GUIDs. They are so...uninformative, and unnecessarily long. If I am going to have a string that long, I prefer to have something the tells me about what I am looking at.

dcfedor's picture

@Marc, the hope is that players will be able to customize both ship layout and appearance. Like with NEO Scavenger, I'll probably only create one example of each item type at first, until there's a near-complete list of features.

Then, I'll go back and add alternatives to each type as time allows. And so far, the stuff is all in text data files and images, so users can add more.

@ra1, I know what you mean. I'm not sure they need to be as long as they are, for one thing. And the ambiguity is pretty easy to solve by tacking-on a prefix or suffix of the item's name or type.

In practice, though, some portion of the ID will need to be an ambiguous random string. Even something as diverse as human first+last names have collisions :)

Dan Fedor - Founder, Blue Bottle Games