Sunday, February 20, 2011

Algorithms and Asteroids

I've been reading a lot about different terrain generation algorithms.  When it comes to creating realistic terrain, it's hard to beat the Perlin and Simplex Noise algorithms. The math is above my head, but the code isn't hard to follow. has a good implementation and use case in C#.  I'm going to try and implement it in Unity and see if I can get it to work.

I've also looked at the diamond-square algorithm and it seems simple enough to apply.  I had a basic version of it in my Minecraft clone that I've posted about before, but it wasn't 100% right.

I've been playing a lot with an idea I had a couple of days ago.  The basic premise is that you spawn on an asteroid and you have to mine other asteroids around you for parts.  I haven't fully fleshed it out but I was able to create a basic version:  Use your arrow keys or WASD to move around.  Left click creates a block and right click deletes.  Hold down spacebar to jump.  The game is best played in fullscreen mode.

I think that could be a lot of fun if I kept working at it.  I'm currently working on saving/loading the sectors to disk.

I like how easy Unity makes it to create games like this.  I wish I had the $1500 to buy the professional version (which in my opinion is very fairly priced for all that it does) mainly so I can have realtime shadows and use of the Profiler.

 Anyway, back to programming.  My friend Ryan has also started a blog at  Check him out if you get the chance.