top of page

Spaceships Dev Log #1: Building Tools

About two months ago I went and visited my brother. While I was staying with him (s/o for the hospitality and coffee!) he brought up the idea of neural networks and decided to pick up processing and started making some little cubes that ran around the screen. Well, his did, he implemented a reasonable method and got it running before trying to make improvements and I dove headfirst into improvements and optimization and....never got mine to work. With work picking up, and a destination wedding to attend the idea got shelved and I didn't intend to pick it back up. But an idea caught my attention, what if a neural network could be applied to an AI spaceship, placed in a procedural solar system, and left to develop for a few hundred generations? Every time you jumped between systems you'd be facing a new, organic, enemy type. Maybe one system with few bodies and low gravity would almost exclusively use missiles, another high gravity system would rely on lasers to avoid gravity pulling them off course, the possibilities were endless.

So learning from the past, I set out on a much simpler path: Creating a small spaceship I could fly around and some simple AI that would approach, retreat, or try to match my movement. I threw together an engine, living quarter, and bridge in blender and brought them over to Godot (my engine of choice) and ....well it wasn't pretty. I don't know how to use blender that well it turns out, and at some point some vertices got deleted and the ships looked like Steve from Minecraft had a baby with the runner-up of a Cthulhu look-alike competition. Not pretty. But I'm nothing if not someone who constantly tries to polish, uh "mud", so I slapped them into Godot and made a go of it. It went shockingly well, I got them to move forward, backward, approach, retreat, and identify if a ship was neutral, an enemy, or an ally. And then the mud hit the fan.

Everything I'd done had used relative coordinates which works fine until a ship leaves range, spins on an axis, or moves behind an enemy and then only the computer knows where they'll go. I threw a band-aid on it and tried to move on to adding some cannons, which went almost worse. So I threw everything out, deleted everything in the resource tree, and started from scratch. I also threw out the models and started using primitives. This time, I started from the second start building global references into the project as well as adding player control so I could verify that forces were being added in the correct direction every time. I even added a few fun things like exploding barrels, a zooming camera, engine particles for visual feedback, and two control modes: RCS and Angular.

So, where does that leave us? Going back to the drawing board (slightly). Instead of leaving all the functioning to be completely rigid, I'm spending some time working on a modular component system. The goal isn't to build a completely scalable solution but rather unify some top level functions (damage, collision layers/masks, communication, etc) in a easier to implement way than defining tens of different connections, receivers, and broadcasters. Right now I'm calling this the Alpha 0.1, and the goal for Alpha 0.1 is to be able to add a fully functional engine using the component system.

6 views0 comments

Recent Posts

See All
Post: Blog2_Post
bottom of page