
Spaceship Generator - mnem
https://github.com/a1studmuffin/SpaceshipGenerator/
======
daredevildave
Sadly it doesn't seem to generate UVs for the models. But using the cube
projection in Blender seems to do an OK job.

Add a skybox and a couple of simple particle effects in PlayCanvas.

And we have some WebGL spaceships :-)

[https://playcanv.as/p/kZtPZpnH/](https://playcanv.as/p/kZtPZpnH/)

~~~
imh
Holy crap that site basically stops my computer.

~~~
coderdude
That feeling when your cell phone is better than someone's desktop.

~~~
zeristor
Firefox yes. Safari no.

Chrome though would start opening everything on Google apps.

------
andreasklinger
I love that the ships look more like "skyscrapers in space" then airplane like
spaceships we usually see in tv shows/movies.

This is most likely (according to multiple hard scifi authors) a much more
realistic depiction of how spaceships are going to look like.

Example given: The Expanse - "Flip and Burn"
[https://www.youtube.com/watch?v=X4EiW1bHwsQ](https://www.youtube.com/watch?v=X4EiW1bHwsQ)

~~~
pmontra
See Mistake 6 at [http://www.dedoimedo.com/physics/sci-fi-
mistakes.html](http://www.dedoimedo.com/physics/sci-fi-mistakes.html)

Mistake 7 also hints about the possible shape when there are no preferred
orientations.

Also interesting

[http://www.popularmechanics.com/space/deep-
space/a8140/what-...](http://www.popularmechanics.com/space/deep-
space/a8140/what-would-a-starship-actually-look-like-12869471/)

[http://www.theregister.co.uk/2011/11/24/spaceship_design/](http://www.theregister.co.uk/2011/11/24/spaceship_design/)

~~~
wnkrshm
Since you linked these pages, you and others also might find this interesting:

[http://www.projectrho.com/public_html/rocket/misconceptions....](http://www.projectrho.com/public_html/rocket/misconceptions.php)

In my opinion Atomic Rocket contains the most accurate discussion of hard
science fiction I've ever encountered.

~~~
pault
I just spent the last 6 hours reading a fraction of the pages on that site.
Thanks for the link!

------
maxander
I saw the headline and initially assumed it would be some droll Game of Life
invention. Then I thought, no, maybe its some automatic sci-fi art generation
script. And I was rewarded!

Procedural generation like this is quite possibly key to the future of indie
games- if you don't have the team to design large sets of art assets, its
important to be able to put _something_ pretty out there using your own wit.
(A good example would be No Man's Sky.)

~~~
moron4hire
You are severely underestimating the effort good procedural content takes.

~~~
Retr0spectrum
And perhaps you are severley underestimating the effort large-scale world
assets take to create.

I agree that doing procedural generation properly takes a lot of work, but
there's a reason that AAA open-world games like GTAV cost hunderends of
millions of dollars to develop.

~~~
MaulingMonkey
There's a reason that AAA open-world games like GTAV are using rather limited
procedural generation, too.

The problem is that to create N pieces of satisfyingly unique procedurally
generated content, you need M pieces of content that were carefully designed
within additional restrictions to make them combineable in various fashions -
making them harder to create. Then you add code to glue that all together. If
you think M=0, that just means you've hardcoded your content in code.

When N >> M - e.g. you're generating thousands of similar-yet-distinct
roguelike levels, trees, etc. - procedural generation can pay off.

But even for large-scale world assets, it's frequently the case that N < M.
Making the content non-procedurally is going to be cheaper - fewer limitations
to worry about, and fewer pieces of content to actually generate. A few clever
tricks - rotating, retexturing, tweaking a base model, etc. - let you make a
lot of non-procedural content without creating each piece from scatch, and
lets you stretch that content to appear like you have more variations than you
actually do.

------
duncanawoods
I don't really like most procedural generation. It has no meaning and the
results are not intellectually stimulating. At best you can't spot the pattern
and parameters but you usually can after a few examples.

An idea I am more interested in is that you generate requirements and use an
optimiser to solve the actual design. This way, there is a hidden "why". With
some study, a human might be able to discern why x is so thick or why A is
attached to B. When a design has a use in mind then it has meaning.

~~~
lotyrin
Yeah, as I was watching the animation for the algo, I was thinking how nice
it'd be if you added purpose to all these segments and features, then produced
ships for various applications through fitness algorithms and evolution.

Simulate a small space economy, create a DAG of how components and materials
are produced, simulate situations this ship will be placed in and calculate
net present value, see the outcome in the difference between a freighter and a
fighter.

~~~
foota
Would be pretty funny to see a genetic algorithm go to play on that. I imagine
it would end up something like most people screwing around with a spaceship
builder "and what if we add forty engines?"

------
intrasight
I find the arguments of procedural vs artistic content somewhat humorous given
that artistic content is just an attempt to create something that is a
fascimile of actual natural and human generated artifacts. The natural world
is by definition procedural (unless you believe in a Creator). The human
artifacts have some artistry - but only in the broad strokes. Most buildings,
and most details of architected buildings, follow a procedural semantic. The
natural decay of human artifacts follow a procedural semantic.

I assume that in the near future of VR that few will play "AAA games" (and
hence few will exist) because they won't be able to complete with free
procedurally generated environments.

~~~
teraformer
I don't know why you're getting downvoted, because you're absolutely right.
Most human architecture is highly procedural, with many tradesmen specializing
in highly repetitive, focused tasks, that have predictable, reliable outcomes,
in order to produce safe structures based on well-understood principles.

As for the VR thing, I think that will gain less traction because the idea of
sleeping one's life away, strapped into goggles and headphones, is only so
attractive.

~~~
stcredzero
_Most human architecture is highly procedural, with many tradesmen
specializing in highly repetitive, focused tasks, that have predictable,
reliable outcomes_

Yes, but human architecture is shaped by forces following from function. (As
in Alexander's Pattern Language of Design.) That's why it becomes interesting,
because we can relate to how the architecture relates to human needs and
perceptions.

------
smilekzs
I find Blender quite handy when it comes to (randomized/parameterized)
generation of 3D objects for the purpose of rendering, although I've only done
really simple things. However the API, while in Python (which is good), feels
very unpythonic and clumsy, all while being severely under-documented. It
would be really nice if the API could be cleaned up in a future major
release...

------
sandworm101
Cool, but the ships are all rather samey. They all spring from the root hull,
with a main body being longer than it is wide. Perhaps that is needed to
conform with our terrestrial concept of "ship". But I think it could be
improved by randomizing the number or shape of starting hulls. It would also
be interesting to see what could be done by extruding spherical shapes rather
than boxes.

------
mortenjorck
The selected examples got me thinking: Those eight are presumably examples the
author felt turned out particularly well. Could one build a neural network
trained on generated ships that "turned out well" to automatically generate
better-looking random ships?

Could this sort of process be used in games where procedural generation might
otherwise be rejected because it looks "too random"?

~~~
KayEss
You can think of the random possibilities as exploring one path through a huge
tree of possibilities. You can then pick 9 paths for the next step and have
the user choose the one they prefer and keep repeating until the user feels
that they're done.

We used to use this sort of approach to produce random shapes for animation
and display on large screens in clubs in the mid-90s. You can also animate by
tweening one or more parameters at particular branching points or between
branches. If you pick the right places on these ships that could produce some
interesting movement in the craft as well.

------
Tloewald
Very cute, although the ships look samish (would probably be interesting to
start with different base templates etc.

Still, it's only a few steps away from "random British 1970s SF book cover".

~~~
IgorPartola
Do you have a link to the book cover generator? Or is that a metaphor?

~~~
fit2rule
I think he might have meant Chris Foss:

[http://www.chrisfossart.com](http://www.chrisfossart.com)

I grew up imagining these spaceships becoming reality, and now .. they sort of
are .. at least, I can bend and play with spaceships just like them now,
albeit .. in Blender .. ;)

------
tenpies
The extreme examples remind me so much of the Shivan ships in the Freespace
series.

I don't think the script replaces a professional designer, but this is awesome
for brainstorming ship ideas.

------
sargun
My physics knowledge is pretty weak. Wouldn't you want a space ship to be
closer to something like an oblate spheroid? Less surface area <-> volume
ratio builds cheaper, lighter space ships presumably? The primary thing I'm
unsure of is steering, but how much of a problem can that be?

~~~
kwekly
Pure speculation, but I think heat dissipation is probably the more important
bottleneck of spaceship design -- no convective cooling, so you potentially
want more surface area to increase radiation.

I think aerodynamics (both lift to weight and streamlining) are the reason for
the compact design of aircraft and submarines (also perhaps reducing the
profile for military vehicles).

Weight maybe an issue for maneuvering in combat, but there's tons of
structural material literally floating around in space, so I'd wager that base
material cost would not a limiting constraint.

------
DanBC
Something to do this in Lego Digital Designer would get _considerable_
interest.

~~~
wlievens
I did pretty much that for a previous challenge in /r/proceduralgeneration -
procedural castles, where I used LDraw as backend for rensering.

------
eggy
Great work! I love a lot of the ships you show. I'll have to look at the code
next weekend. I liked the city-building scripts from years ago in Blender too.
Fun stuff to create a ton of assets automatically.

I was working on a procedural art generator in Blender in 2006, and I tried to
use genetic programming written in Lisp to create random parameters into a
fixed generator I had written in Python copied from a parametric formula
renderer. I can't remember the original author. I couldn't get it to work
well, and got sucked into Processing shortly thereafter, and other things
Blender.

You could meld your script with a Genetic Program to present quick renders it
evolves, and use Neural Nets to drive towards what you like, and away from
what you don't to evolve a design. This cuts the search space, and thus the
time, down from a simply random form generator in producing images you may
want.

You've killed my next weekend!

Again, great work!

------
100ideas
Form follows function! No wait... I think I have it backwards

------
noahbradley
Awesome stuff. Would love to see concept artists incorporating procedural
generated assets in their workflow. Produce 100 samples like this, teach the
computer which ones they prefer, produce 100 more, take a few and refine them
by hand.

~~~
themodelplumber
A lot of artists in various industries use Alchemy to generate ideas like
this.

I like to use the ms reading on my stopwatch when I don't have anything else
nearby. I'll draw up a few scales like inorganic <\---> organic, long <\--->
short, heavily armed <\---> unarmed, and then get a 0-99 ms reading for each
by pausing my stopwatch.

Edit: Example.
[https://www.instagram.com/p/BG0Gr5BRBs7/](https://www.instagram.com/p/BG0Gr5BRBs7/)

The same can be done for character gen, scenario gen, life choices :), etc.

------
smcameron
When I tried to run it, I got:

Traceback (most recent call last): File "/spaceship_generator.py", line 737,
in <module> File "/spaceship_generator.py", line 711, in generate_spaceship
AttributeError: 'BevelModifier' object has no attribute 'offset_type'

I ran it with Blender 2.69

~~~
smcameron
Works with 2.77a though.

------
agumonkey
Very macross of you.

------
zeristor
Has anyone 3D printed one of these models?

[http://www.shapeways.com/tutorials/prepping_blender_files_fo...](http://www.shapeways.com/tutorials/prepping_blender_files_for_3d_printing)

------
zeristor
Dawkins wrote the biomorph software to demonstrate evolution, you got to
select squiggles and breed them.

What would be call is to evolve spaceships by selective breeding.

No doubt this being The Internet this was done by a Russian seven years ago,
and I failed to GTFA.

------
wlievens
Thing is, /r/proceduralgeneration is running a monthly challenge for exactly
this right now but I haven't seen it listed as entry yet. Check out the
previous entries, some of them are neat (others less so).

~~~
cridenour
It's the top link on the challenge thread, isn't it?

------
hoanganhlam
[http://stellarismods.com/graphics/spaceships/](http://stellarismods.com/graphics/spaceships/)

------
laretluval
I'm delighted by how little code this is!

------
kordless
Someone should be working on spaceship guidance software with UI interfaces
for humans. We're going to need it.

------
hetfeld
There is an error in script.

seed = 'tweer' obj = generate_spaceship(seed)

Python can't redefine functions as variables. Seed is a function.

~~~
y4mi
i'm not the author but i frequently code in python and am unable to understand
what you're saying from that snipped of code.

1\. you can overwrite everything in python

2\. seed has been set to a string

3\. obj uses the value of previously set 'seed' variable, which should be a
string at that point.

its not a good idea, like overwriting the id variable, but it should work...

and just in case somebody wonders: its still possible to use the "true" seed()
by calling it over __builtins__.seed()

i did similar stuff previously without realizing and only found out about this
after i switched to a real IDE that warned me about overwriting inbuilt
functions

~~~
ecdavis
'seed' is explicitly imported on line 18, then overwritten on line 736, and
yet it's used as a function on line 526. As far as I can tell, that is an
error.

    
    
        >>> from random import seed
        >>> def f(): return seed(10)
        >>> seed = 50
        >>> f()
        Traceback (most recent call last):
          File "<pyshell#4>", line 1, in <module>
            f()
          File "<pyshell#2>", line 1, in f
            def f(): return seed(10)
        TypeError: 'int' object is not callable
        >>> 
    

I haven't run the script, so take this with a grain of salt.

EDIT: Since generate_spaceship is always called with an empty random_seed
parameter, this error won't happen when the script is run.

------
wtbob
This … this is awesome. Thanks for sharing!

------
gravypod
If this works as "advertised" then this is amazing. I'd love to see a game
implement this.

------
hobo_mark
For a second I had to look if this was from the "limit theory" guy but no, RIP
LT.

------
hydroo
Awesome work! Now I need website where I can just generate them and view them
in webgl.

------
lifeisstillgood
Oh wow - I can procedurally generate 3D models ?!!! Blender tutorial needed
:-)

~~~
moogly
Coincidentally, Blender's UI was procedurally generated as well.

------
stretchwithme
I'm guessing not the algorithm used to create the Destiny.

------
personjerry
Why are there windows on a spaceship?

~~~
wanderingstan
[https://youtu.be/C-qEmmpGYvA?t=36s](https://youtu.be/C-qEmmpGYvA?t=36s)

Seems to be human nature.

~~~
srtjstjsj
Was that a historically accurate representation of the spacecraft designer's
German accents, or was the movie gratuitously racist?

------
planteen
This is very impressive. Nice work.

------
throwaway_fish
Could you do procedural cars?

------
dave2000
> Start with a box.

And end with some boxes stuck together.

~~~
ocdtrekkie
This is a pretty standard 3D modelling strategy, unsurprisingly, called "box
modelling". You can create an incredible amount of things with box modelling.
Including, obviously, a lot of spaceships. I built several crud spaceship
designs with box modelling back in school. The main key advantage, is all of
your 'parts' are built off of a single object in the editor, and aligned
perfectly.

The other thing though, you can do to a box modelled project, is round all the
edges to varying degrees, and end up with something looking much more fluid
and amorphous. However, I suspect the results would be far more unpredictable
if he through something like that into this script, so it'd be difficult to go
there procedurally.

~~~
quietplatypus
Yeah back when I made 3D models of star trek spaceships (trekkie in your name
significant?) that was one of the go-to methods for making the shuttles,
smaller craft, borg (obviously), but stuff like Voyager and the Enterprise-E
you would often resort to more advanced lofting/spline patch based techniques
and work off of a sketch.

