Sunday 31 March 2013

Unity - Conway's Game of Life

Hey everyone. So instead of working on my coursework, I decided instead to recreate Conway's Game of Life. Now I know I could have used DirectX or some other render framework to create this, but instead I was working in Unity at the time so I chose to use that. If you'd like to play the game go ahead, read on for some more information about the project.

For those who don't know, Conway's Game of Life is a so called 'Zero-player game' the purpose of which is for the user to devise a starting state and watch it grow. To allow this to happen there are a few rules that are specified to allow the system to progress. Firstly there are two states which each cell has, namely Dead or Alive. Each cell has 8 neighbouring cells and after each time step or generation the following rules are applied:


  1. Any live cell with fewer than two live neighbours dies, as if caused by under-population.
  2. Any live cell with two or three live neighbours lives on to the next generation.
  3. Any live cell with more than three live neighbours dies, as if by overcrowding.
  4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
Although basic, these rules lead to some very interesting patterns. For example, one of my favourites, the 'beehive'.
The Beehive
Classed as a still life and one of the more common of the randomly occurring patterns. Although if you add a life to one of the corners it will result in four more beehives.

An interesting pattern
Now if you do the same for each of these four, like this: 



 This results in a really cool explosion type system that last for quite a few generations. A so called "Methuselah".
Wacky patterns!
After a few hundred generations, this system eventually results in 8 gliders and stabalises.

System begins stablising, note the 8 gliders.

There are an infinite variation of patterns, new and interesting ones are discovered all the time. The system has got to the stage where automated processes are used to try to discover new patterns.

If you'd like to give it a shot, play the version I made here on my blog. It's still a bit buggy and requires some new features which I will get around to implementing when I have a chance but it has the full functionality of the game. 

Anyways, enjoy and please tell me what you think! Until next time.


Email : markmmiller@hotmail.co.uk
Xbox Live : Dr Death MK 2
Steam : 7thsanctum

No comments:

Post a Comment