I mentioned in this week’s diecast (around the 18:30 mark) that I thought Rebel Galaxy would have been improvedother flaws not withstanding if it had some procedurally generated spaceships, instead of just the stock ones. If proc-gen is an unfamiliar term, Shamus has written a few articles on it. Okay, more than a few. Actually, it’s all he talks about when he has time to stop complaining about videogames, but you know how life is, what with work and family and sleep, who has time for obsessions?
So, why am I talking about proc-gen then? Well, it’s an obsession of mine as well, and a large part of what drew me to this site. I could go on about my own projects but I think we’ve done enough introduction, so instead let’s make apractically unlimited set of
procedurally generated spaceship!
The right way to start a project like this is to decide on a programming language, and some code conventions. Then you set up your development environment, and begin writing header files. No, wait, that’s not right. That’s how to… actually that’s not the right way to do anything. To design something you need a goal, not a set of processes. In this case the goal is to program the computer to be able to design and model spaceships, and that’s basically impossible if you can’t even…
Do it Yourself First
So that’s where we start. It may feel like a waste of time to start a programming project by doing the work by hand. But this feeds back into the point about code documentation and game design. Programming a computer to do design means communicating something complicated in simple terms to someone who”something that” in this case, but the principle is the same has no idea what you’re talking about. That’s hard enough when you’re an expert, but when you don’t know how to do it yourself, it becomes next to impossible.
Ok, so where do we start with spaceships? Well, I don’t know about you, but the first ingredient I want for a spaceship is:
Ahh! Mmmm! Nah! Ehh! None of that! I won’t have any; Oh! Well, you’ve gone and done it now. Yes yes, you’re very clever for, But you don’t have to, Yes, that’s how it goes but. But… But now you’re just saying “Space!” over and over!
So after we’ve blacked out the background and added some far-away stars and a close-up star or two, and a few big colored spheres for planets I think we can finally begin with the ship part of the spaceship that you’ve all been waiting for. And, like so many other things, let’s begin this design with squares. And because I prefer making 3D spaceships, let’s volumetrize that square and:
Throw Some Cubes Together
Cubes are special for being clearly artificial. Spheres appear everywhere in nature,Just look at the background! but the right angles of the square, and by extension of the cube, implies intent and planning. Cubes are, in some senses, the essential artifact.
Still though, some greebles wouldn’t hurt.
Now, I wouldn’t recommend stopping with the cubeStar Trek Borg vessels notwithstanding, though the overbearing simplicity of the shape grants a profound insight into the radical conformity of that fictional collective. but there’s no harm in starting there. We can make arrays of cubes, and cubes covered in cubes, and fairly soon we arrive at something that somewhat resembles a spaceship of some kind.
It’s missing something though, isn’t it? We have something that looks manufactured, but it might just as well be a modern building. We need another shape, one that still connotes artificiality, but also implies motion. We need the circle! And as long as we’re doing squares, or rectangles really at this point, let’s combine the principles and use:
Lathes of Rectangles
Yessir, that’s more like it. I’m feeling the spaceshippiness already.
Lathes are great because they look like wheels and turbines and rocket engines without even trying.
So now that we have our two essential elements, we should start playing with the functional sections of a spaceship. For lack of a better plan, I propose to start at the back and work forward. And what’s at the back of every spaceship?
I always think of engineering as being characterized by lots of cables and tubes and pipes snaking everywhere, so let’s do that.
Maybe some of the pipes are glowing? With, I dunno, radioactive fuel? It’s a spaceship! Glowy bits!
And of course, we need some engines. Big engines! Small engines! Short ones and long ones! Engines for the engine god! That’s what an Engineer is, right?Let me have this. It’s better this way.Probably.
Okay, so we have the engine territory, but now we need a territory for all the people that will get thrown all over the place by the explosions from the guns that we’ll get to near the end of this article. That’s right, we need the:
Now, as fun as it would be to start procedurally generating the interior of this spaceship, and making procedurally generated bunk halls and captain’s chairs and massage parlors and such, this very temptation brings me to my second principle of design. You’ve probably heard the phrase “Don’t re-invent the wheel” which warns against redeveloping familiar technology. This one is similar, and can be phrased as, “Don’t depict the familiar” or, at least, not if you can help it. The familiar is really difficult to get right, exactly because everyone knows what it should look like. Everyone is familiar with beds and chairs and doorways, so, why bother? Instead of spending a bunch of time making things that everyone already knows about, let’s just nod to them with a bit of shorthand in the form of lit-up windows.
Adding windowsNope! Not doing that joke either. does two things for us. As above, it lets us imply crew quarters without actually modeling them. But just as important, it lets us indicate scale.
And just like that, we can turn a tiny spaceship into a huge one, all with one little parameter. Pretty neat!
Okay, we have engines and crew, now let’s add the part I was complaining about earlier. Some big empty spaces between the dangerous engines and the fenestrated quarters that we can fill full of:
I think all we need for this is to make some big modular blocky parts. We can put them on the engineering section, for, storing fuel! And cargo on the crew section to store, rations I guess?
And then add something that looks like a door to themMoar rectangles!.
And I guess that will do it for the cargo section!
And with that, all that’s left are the:
Which are basically the opposite of cargo, long narrow lathes instead of short blocky cubes.
From there we can do turrets, which are just gimballed guns. We’ll add some cargo units to the guns for ammunition storage.
So, that’s the process! Obviously I could add more detail and improve the design, but that’s not the point. The point is to take the design process from start to finish and get comfortable with the steps involved.
You can download the source file for all of this, and play with it yourself. Next step is to make three or four more of these, and really solidify the process, and then, finally, we can start writing some code.
 other flaws not withstanding
 practically unlimited set of
 ”something that” in this case, but the principle is the same
 Ahh! Mmmm! Nah! Ehh! None of that! I won’t have any; Oh! Well, you’ve gone and done it now. Yes yes, you’re very clever for, But you don’t have to, Yes, that’s how it goes but. But… But now you’re just saying “Space!” over and over!
 Just look at the background!
 Star Trek Borg vessels notwithstanding, though the overbearing simplicity of the shape grants a profound insight into the radical conformity of that fictional collective.
 Let me have this. It’s better this way.
 Nope! Not doing that joke either.
 Moar rectangles!
Game at the Bottom
Why spend millions on visuals that are just a distraction from the REAL game of hotbar-watching?
Crysis 2 has basically the same plot as Half-Life 2. So why is one a classic and the other simply obnoxious and tiresome?
In Defense of Crunch
Crunch-mode game development isn't good, but sometimes it happens for good reasons.
Secret of Good Secrets
Sometimes in-game secrets are fun and sometimes they're lame. Here's why.
A Lack of Vision and Leadership
People fault EA for being greedy, but their real sin is just how terrible they are at it.