Home Articles Tutorials Resources About
Game of Life on the GPU   Last update: 2008-07-29 20:16:12 by Rim van Wersch


This sample demonstrates how Conway's Game of Life can be implemented on the GPU. More information on the Game of Life can be found over here. For a quick look at what it can do, check out the short movie below, which shows the first few generations of Gosper's Glider Gun and solving a traditional and fat maze.

The GPU implementation obviously uses a texture to store the generation data, which allows for the neighbor sampling and rules to be executed completely on the GPU. I haven't done any specific benchmarks, but this unoptimized sample easily maintains several 100 FPS while evaluating a 800x600 grid, which looks promising.

The sample also comes with a couple of custom rulesets to solve mazes as demonstrated here. These rules are conveniently implemented as seperate shader techniques (see notes below on usage). The traditional maze solver seems to work out well and the fat maze solver has been fixed with some help from Christer (thanks!), so that also works out nicely.

Usage notes
The sample comes with a few textures containing simple starting figures. The demo app also has basic support for .cells files used by Bitstorm's Game of Life lexicon, which should give you plenty of scenarios to toy with. To support multiple rulesets, a custom token was introduced to the simple .cells parser (#ShaderTechniqueName), which can be found in the Maze.cells and FatMaze.cells scenarios below.



Files for this resource

Filename Size
  GameOfLife.zip 23.8 KB
  GameOfLife.wmv 106.6 KB
  FatMaze.cells 418.0 B
  Maze.cells 412.0 B


Further reading

 
XNA info is sponsored by vector4. All content is copyright © 2005-2010 by its respective authors | About XNA info | Terms of Use | RSS feed