Space Invader Generator

Image

I read about a very interesting technique some time ago. A method was proposed for generating a completely random set of low resolution space invader like creatures. The idea was extremely simple and elegant. The key to the technique is its use of symmetry, since the human mind likes to find form and meaning in symmetric things.

For my implementation I chose a size of 5×5 pixels for my invaders and a line of symmetry down the middle. More specifically, the first three pixels of each row are random, and the last two are mirrors of the first two. For this technique I implemented my own pseudo random number generator using a linear feedback shift register technique. The color of each of the invaders shown corresponds to the seed of the random number generator when it was formed. This seed could be used to re-generate any space invader, but this implementation does not support this currently since the seed is 32bits wide and a colour is clearly 3x8bits or 24bits.

The code can be found here:

http://pastebin.com/223eTMka

It would be great to add this to a game like geometry wars and have all of your enemies procedurally generated, from their visuals down to their abilities. The scope for using this in a retro computer game seem really endless.

5 thoughts on “Space Invader Generator

  1. Ehem, Is this art at all copyrighted? I would Like to use it for an avatar that I’m editing to be a background

  2. Interesting concept. For your implementation of 5×5 images, you only have 15 unique bits for each (5 rows of 3 bits each, as the last two bits per row are derived from the first two). That means there are a total of 32768 possible unique ‘Invaders’ that can be generated. I’m sure you could adjust your algorithm to take the 24 bit colour and turn it in to a 15 bit invader…

Leave a comment