Game of Life: several competing populations
Conway’s Game of Life
is a small, simple set of rules for
cellular automata.
Operating like a simulation, there is a starting state where certain points on
a 2 dimensional board are populated, and the rules of the game determine the
next state, generating interesting, unpredictable, and ultimately lifelike
patterns over time.
Cells die or stay dead, unless:
The traditional set of rules tracks a single population, even though it may
form several distinct islands and disjointed groups. For this project,
deathmatch refers to multiple populations with respective identities over
time (e.g. red vs blue).
Choose:
__dir__
is used in the gemspec and for shape loading)
gem install conway_deathmatch
# defaults to 70x40 board and an acorn shape
conway_deathmatch
# deathmatch triggered by several populations
conway_deathmatch --one "acorn 30 30" --two "diehard 20 10"
A shape is simply a set of points. Classic shapes are defined in a yaml file:
There is another yaml file with shapes discovered via proving_ground.
Just one file, aside from shape loading: Have a look-see
Boundaries are toroidal, meaning that cells “wrap” at the edges, such that the left edge is adjacent to the right edge, and likewise with top and bottom. Thus, the grid has the topography of a torus (i.e. doughnut).
This project was inspired by http://gameoflifetotalwar.com/ (hereafter CGOLTW).
You should check it out. It updates the classic set of rules, which support
only a single population, for multiple populations which are able to compete
for space and population.
This project exists not to compete with CGOLTW but as a supplementary
project for exploration and learning. My initial motivation was to make a
“proving ground“ for searching for simple shapes and patterns with high birth
rates for determining successful CGOLTW strategies.
Coming into this project, I had significant background knowledge concerning
Conway’s Game of Life, but I could not have recited the basic rules in any
form. After being inspired by competing in CGOLTW, I read their one background
page and then the
wikipedia page. I
deliberately avoided any knowledge of any other implementations,
considering this project’s implementation as of December 5 (2014) to be the
naive, simple approach.