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

That requires an update...

A few days ago I wrote about the troubles I went through to create a proof of concept for a new hull idea. In today's blog: How I threw out everything, again, and ended up with what I wanted, but completely different.

For the first POC (yes, I wrote more), I had, in short, the following idea:

  1. Build a cube in every cell orthogonally connected to an interior.
  2. Follow a bunch of rules to decide what other cells should get a cut-off shape hull
  3. For each hull, find only the surfaces facing outward
  4. Create a unified, watertight mesh from those surfaces

My thinking was, once I have a watertight mesh, making it look nice and spaceship-like would be trivial. Well, it wasn't, but making a correct mesh wasn't trivial either, so I got stuck. As per usual. Frustrated, I went back to an idea I had a while ago: Use marching cubes to find the outside, but I quickly found out why I'd abandoned it: It didn't create a watertight mesh, I couldn't prevent it from cutting into interiors for strange shapes, and it was quite CPU heavy.

So, back to my cells to surfaces to mesh idea... With one difference: I decided to ditch the decorative hull pieces and, for now, even make it impossible/impractical for the player to place them. This is 'a loss', it makes it more difficult for me to allow players to style the hull of their ship, but that's a battle for later.

With the decorative pieces out, "where should hull be" became a simple question of "where is interior" and "what should hull look like" became a few mathematical operations. "What surface faces outside" wasn't even a question anymore, it fell out of the code that generated the skin, for free. And all done in the model.

Suddenly things were moving fast, but with an interesting hull shape, hull appearance became important: If I can't make it look nice and spaceship-y, this entire exercise was as futile as resistance is. I downloaded some skins, and... Was very disappointed with the result. I couldn't get it right, things were too detailed, ignored the geometry of my ship, and... It didn't create the look I was going for. What I want is the outside to look... "clean", a bit boring even? functional? An access panel here and there, rivets holding things together... So, one simple shader later, and I have a pretty decent result, even keeping in mind the symmetry of the ship. Nice...

Then there was the 'inside'. I had this idea of having a "real" hull: an empty space between the deadly vacuum of space, and the interior of the ship. Using some prefabs I bought, I created a simple, tileable cube of trusses, placed it inside each hull piece, wrote a shader to cut off the trusses inside and outside the ship, so they wouldn't poke through anything and... Well, other than some minor bugs and decisions for later, I'm pretty pleased with the result.

A small, nailshaped spaceship Even simple shapes look nice.

The outside of a ship with a few, different sized decks Here you can see the outside of a ship with a few, different sized decks.

The same ship with the top deck opened up, trusses standing between the rooms and the skin. And when you look inside, you can see the trusses that bind the skin and the interior together.

A weirdly shaped ship with a hole in it And even strange shapes, including holes are possible.

That was the easy part →
All entries