Docking Initiated, and OOO Monday
Hey Folks! Made some decent progress today on the docking system. Not "completely operational," as they say, but getting there.
The first task was to get the game to spawn additional ships, since it was only ever designed to work with one at a time. Fortunately, this wasn't too bad. Just repeating the same steps to load the first ship thankfully "just worked." I could load a second ship right on top of the first.
The next step was to get those ships aligned so their docking systems connected. This turned out to be harder.
I spent nearly half the day just trying to get a ship to rotate correctly. Getting the visual part of it to rotate was a cinch. It was the tile data for the ship that caused headaches. All that info that tells you where you can and cannot place items needs to be rotated and translated any time the ship moves or rotates. And some bookkeeping info on the ship also needed to be updated.
Once I had that sorted out, it wasn't too hard to query each ship for the docking systems (if any), figure out their relative positions and rotations, and then adjust the new ship's position and orientation to align it's docking system so they linked up.
And voila! We have the image above, of my test ship with a test space station.
As I said above, there's still a way to go yet. This is far from functional in any way. While both ships are honest-to-goodness real ships at the correct locations, we don't have systems or AI running on either yet. I'll have to start working on the code for that next week.
And speaking of, it's a long weekend here in the USA. So I'll be taking Monday off. Hopefully, I'll be back with a fresh brain, ready to tackle the rest of the docking changes. Have a good one, all!