Starship CEO
This is where messages will pop up
--:--:-- v0.1 · in development

That was the easy part

"so... this now looks good... However... This was the easy part of the challenge..." I told Claude, after about two days of trying to get a working POC.

In an effort to delay actually building out the game, I decided I wanted to do some work on the hull... Again... It started with a few simple wishes:

  1. There is a bug about walls when you create an interior into a hull piece.
  2. The ship doesn't look much ship-like

I thought it would be easy enough: I have a ship, consisting of hullpieces, put a material on it and... Every individual hull piece looks like a separate ship, because the shader can't pull one texture over multiple (uncombined) meshes. So... ? Combine them, easy peasy... Well, maybe easy peasy for you, I haven't got the faintest idea of what I'm doing. I understand what a mesh is, what a material is, a texture, but now Claude is talking about albedo and height maps, meshes not being watertight and UV-distances...

And it seems it's not that easy to 'just find the outside', no matter how hard I shout at Claude. Or Gemini or ChatGPT for that matter, they all struggle.

Of course I'm not completely oblivious, but this is the first time I do extensive work on 3D objects, so to me, this was far more difficult than coming up with a TimeExpandedA* algorithm to prevent airplanes crashing or moving through each other. It doesn't help that Claude, Gemini and ChatGPT all seem, if possible, even more clueless when it comes to geometry. I can upload the same image to the trinity and ask them all 'what is the name of this shape', and get three completely different answers with, of course, the obligatory and seemingly endless stream of 'You're right, I '-excuses. Well... More than three, because Gemini alone came up with three different names for one and the same shape, insisting it was different, because it was rotated...

But yes, even finding the correct name was a hassle, but worth it. After some extensive research ("Hej Gemini, how/what [..]") and the manual creation of some example, Claude and I finally agreed on the lingo to use when I ~scold~ talk to him.

And even before I finished that, the project got bigger. Talking to my best mate, he eventually convinced me my current rules for placing hull pieces were stoopid (an interior should be surrounded by a hull only on its six orthogonal sides). He insisted that all cells touching an interior should be a hull, ie: including those that only touch one point. He was also quite adamant I use the hull pieces I now call 'decorative' as real hull pieces, so the ship can place half cells automatically.

Somewhat overwhelmed by that task, I initially resisted. It was too difficult. I can't know what types of ship a player makes, what weird and unreachable places they carve out, how can I write code that automagically places the correct hull piece, if I don't even know what the hull piece should be?

Overwhelmed, but also curious about what it would look like if I followed his idea, I set Claude to work with a proof of concept. I started on a few rules, got into some arguments about naming and the difference between a pyramid and a four-sided pyramid, but after some hassle, I had my rules:

  1. A cell that touches four or more full hulls gets a Full Cube.

  2. A cell that touches three full hulls, two of them facing each other, gets a Full Cube. That is a groove one cell wide, and a groove one cell wide is a gap rather than a shape.

  3. A cell that touches two connected, full (ie: square) faces gets a Right Iscosceles Triangular Prism. In the image: Surface A and B are touching each other.

  4. A cell that touches three full (ie: square) faces, where all faces touch in one point, gets a Hull Minus Trirectangular Tetrahedron.

  5. A cell that touches three half hulls, touching in one corner, gets a Trirectangular Tetrahedron.

  6. A cell touching one full hull and two half hulls, all touching in one corner, gets an Oblique Square Pyramid.

Full Cube
A full cube
Right Iscosceles Triangular Prism
A right iscosceles triangular prism
Oblique Square Pyramid
An oblique square pyramid
Pyramid
A square pyramid
Trirectangular Tetrahedron
A Trirectangular tetrahedron
Hull Minus Trirectangular Tetrahedron
A cube minus the trirectangular tetrahedron

And the results!

Two round decks on a stalk, the corners of every deck cut back to a slope.

An L of two corridors running into a round hall, with every outside corner rounded off.

A wide, flat hull of several rooms with a hole through the middle of it, seen from above.

After about 1 1/2 day of fighting, I am nearly there! All I have to do now is... ow... Shit... 'All' I got to do now is:

  • Still find only the faces that are on the outside (note: This was my original problem)
  • Use that to create one mesh so we can use one material/texture/shader to paint it as one object
  • Still think of something to put 'in' the hull
  • Write the shader that puts all of this together
  • If I go for this automatic placement (and I think I will), do I let players still place (what are now called) decorative hull pieces? Should the automagic layer of the ship react to that? Can the 'code' place hull pieces somewhere a player has already placed a decorative hull piece? Are they the same?

... As they used to say, back in my day:

FFFFFFFFFuuuuuuuuuuuuuuuuuuuu!!!!

You can play with the POC if you want, but note: This tool was not designed to have any QoL, the descriptions are AI-generated & unchecked; all I can say is 'orange' is interior, you can author multiple floors and 'Good luck'.

The refactor which you knew that would come →
All entries