Docking Refactor

Hey Folks! Decided to try and make up lost time on the prototype today, and continue work on the docking system.

When we last left docking, I was able to load a new ship into the scene, and align it with the current ship so their docking systems mated. This was a good start, but largely only visual.

Today's task was less about visual and more about mechanics. Today was about making everything in the game "see" other docked ships. And that kind of change uproots a lot of code.

Most of today involved me looking at red squiggly lines in the code editor, mapping out changes to functions and properties so they stopped assuming just one ship, and started asking whether it should also include docked ships. And in some places, this meant rewriting significant code. E.g. some places relied upon some tricks involving arrays and tile indices, but with multiple ships (and therefore multiple arrays), a simple index would no longer do.

Fortunately, it only took a few hours to make all the necessary changes, and the game was once again compiling and running late in the day. I can even nearly repeat Friday's test dock between a ship and space station! (See image above.)

However, it's far from done.

For one thing, you'll notice the space station's red tile overlays are not aligned correctly. Something about the code that rotates and aligns the docked ship screws with tile positions. So that's task #1.

Secondly, I still can't order my AI to walk from ship A to ship B. They can spawn on either and work fine, but there's a bug preventing them from pathfinding or seeing the other ship. I have a feeling it's the former. So that's task #2.

On the plus side, I accidentally opened an airlock between two docked ships and the gas flowed from one to the other! On the downside, this happened despite me only opening the airlock on one ship, and seemed to skip the tiles that overlap between them. So I think this may be the beginnings of a task #3: figure out how to deal with overlapping ship tiles when docked.

Still, not a bad day! Not a lot more to look at, but it's a major step towards completing the overall game. I was sort of dreading this task, due to the complexity and amount of code rewriting it suggested. But, as with many programming tasks, it's often the assumed hard ones that turn out easy, and the assumed easy ones that kill you :)


Toupz's picture

Hello sir I been following you ever since I had Neo Scavenger 4 years ago i think, I am excited about space prototype being a huge sci-fi games nerd! Keep up the good work sir :D

dcfedor's picture

Thanks, Toupz! Hopefully, the game will be worth the wait :)

Dan Fedor - Founder, Blue Bottle Games

Marc13Bautista's picture

Pfft. Everything is worth the wait as long as there's effort being put into it!

Free Elusive Skill = Athletic x4 in ATN Enclave encounter

dcfedor's picture

Well, maybe not everything :)

Dan Fedor - Founder, Blue Bottle Games