Hexagonal Cellular Automata Techniques

By George Maydwell
June 2002
Revised June 2003

Introduction

My experience writing SARCASim, the Super Animation-Reduction Cellular Automata Simulator, made me decide to write Collidoscope, a screen saver based upon hexagonal cellular automata technology. Experiments with SARCASim revealed that hexagonal cellular automata represented an excellent impedance match with the currently available consumer PC's in the marketplace. Calculations showed that without performing display SARCASim's cellular automata engine was fast, capable of updating an 800 by 600 cell hexagonal cellular automata at roughly fifty frames per second. This size hexagonal cellular automata corresponds to the now commonly available 1600 by 1200 monitor setting. In addition to being the right speed, Hexagonal cellular automata presented symmetry possibilities absent in rectangular cellular automata.

Using Microsoft's DirectDraw interface made the display time negligible in comparison to the compute time when advancing a cellular automata by a generation. It also had the advantage of allowing color table animation, allowing for more visually interesting color cellular automata. Soon I had Collidoscope, but what I really needed was interesting sets of hexagonal cellular automata rules to put into it. This paper is an introduction to some of the techniques I developed in order to make interesting hexagonal cellular automata. Many of the same techniques can be used to advantage when attempting to define visually interesting rectangular cellular automata, as I demonstrate on my Modern Cellular Automata and Color Game Of Life Visual Exhibition web sites.

June 2003 Revisions

In the year since I first published this paper I've developed a version of Modern Cellular Automata which supports hexagonal geometry. The new applet was used to embed two more cellular automata into this paper to accompany the descriptions of Silk and George's Brain. I've added new links into the Modern Cellular Automata site, including links to tools which can be used to experiment with hexagonal cellular automata and links to the Modern Cellular Automata software distribution. The latter lets you experiment on your own computer without being connected to the internet.

Where are the Interesting Hexagonal Cellular Automata?

The search for visually interesting hexagonal cellular automata rules has been one of the holy grails of cellular automata research. It is relatively easy to find cyclic cellular automata rules which work on a hexagonal grid, but interesting decay based rules (which may have refractory states in addition to dead states and live states) are more difficult to find. Brian's Brain is the prototypical rectangular decay rule, and Conway's Game of Life may be considered a decay rule with zero refractory states.

So why has there been a historic paucity of visually interesting hexagonal cellular automata? First and foremost it seems that attempting to construct interesting hexagonal cellular automata with only six neighbors is a difficult undertaking. The vast majority of Collidoscope's decay rules are twelve neighbor rules. Very few of Collidoscope's rules are six neighbor rules.

Constructing interesting hexagonal cellular automata with less than four states also seems difficult. Collidoscope has no two state decay rules and only a handful of three state decay rules. Most of the interesting decay rules in Collidoscope have four or more states.

Traditionally, hexagonal cellular automata rules have been defined using the same methodology as is used for defining rule variants of Conway's Game of Life. Simply omitting two opposing corners from an eight cell neighborhood results in a six cell hexagonal neighborhood. Researchers using traditional techniques have thus usually been limited to rules with six neighbors and two states, making it difficult for them to discover the interesting hexagonal cellular automata rules which Collidoscope takes advantage of.

Animation-Reduction Cellular Automata

Collidoscope uses the Animation-Reduction cellular automata methodology pioneered in SARCASim. This methodology is particularly well suited for decay rules. It results in fast cellular automata. Dozens of state values are available for use. Arbitrary cell neighborhoods may be specified. Finally, steps may easily be combined into sequences. ARCA methodology enables implementation of the techniques presented in this paper.

Hexagonal Superpixels

Collidoscope uses hexagonal superpixels, groups of four display pixels each, to represent hexagonal geometry. Each successive row of superpixels is offset from the previous row by half a superpixel. During intermediate stages of next generation calculation, only the top left state value in each superpixel is modified. When the final state for the next generation is computed its state value is replicated into all display pixels belonging to the superpixel.

Hexagonal Neighborhoods

Collidoscope uses nine different hexagonal neighborhoods in its cellular automata:

six
far
sar
star
far star
sar star
asterisk
far asterisk
sar asterisk

Most of Collidoscope's cellular automata are constructed using the twelve neighbor Star Of David neighborhood. The far and sar neighborhoods and variants are used for setting up grids on top of the hexagonal grid used for the cellular automata world. The far neighborhoods divide the universe into four partitions, whereas the sar neighborhoods divide the universe into three partitions. These are useful for adding cheap special effects to some cellular automata. Note that Collidoscope allows a rule to use a different neighborhood for each step.

Rule Compilers

The use of high-level rule specifications allows easy experimentation with a cellular automata's rules. Collidoscope uses two different rule compilers, one for cyclic cellular automata and the other for decay rule cellular automata. These instantiate rules by translating high-level rule specifications into ARCA low-level rule specifications. A high-level rule specification for Conway's Game of Life might look like this:
	decay(eight + 3/23, 2)
The final "2" indicates that this rule specifies a two state cellular automata.

Colorization

Color cellular automata are far more visually interesting than monochromatic cellular automata. Collidoscope maximizes the color utilization inherent in a cellular automata rule specification. Consider Conway's Game of Life, which can easily be made into a three color cellular automata:
	red for birth with three neighbors
	green for stays alive with two neighbors
	blue for stays alive with three neighbors
Seeing Conway's Game of Life in three colors provides visual improvement over the single color generally employed.

Cellular automata which utilize refractory states provide additional opportunities for colorization. Collidoscope uses multiple colors for a rule's refractory states. A live cell's neighbors are already counted for the purposes of determining whether the live cell survives or becomes refractory. Collidoscope uses these neighbor counts to determine the color with with a cell with refractory or live state is displayed.

Canonical Weighted Form

All of Collidoscope's decay rules are counting rules, in which transitions are determined solely by the number of live neighbors of a cell. Simple counting rules give a very coarse control. Finer grained control can be achieved by using weighted counting rules which add an increment whose value is dependent upon whether the neighbor is a near neighbor or far neighbor. Assuming that a cellular automata rule specifies N near neighbors and N far neighbors, then the canonical weighted form of the rule uses a counting weight of N+1 for the near neighbors. By considering a cell's total count as two base N+1 digits, each combination of near and far neighbor counts is specified by one and only one total.

The ultimate in control for a twelve cell neighborhood is achieved by using base seven weighted counting, where near neighbors count as seven and far neighbors count as one. This canonical form allows each combination of near and far neighbor to be colored differently, or indeed even to behave differently.

Consider a birth in Conway's Game of Life. If we use base five, counting adjacent (near) cells as five and diagonal (far) cells as one, then there are four different ways for this birth to occur:

	total = 15, three adjacent neighbors, no diagonal neighbors
	total = 11, two adjacent neighbors, one diagonal neighbor
	total = 7, one adjacent neighbor, two diagonal neighbors
	total = 3, no adjacent neighbors, three diagonal neighbors
Applying the same technique to cells that stay alive allows one to construct a Conway's Game of Life with eleven distinct colors. Conversion of a rule to canonical weighted form maximizes color utilization.

Viewing the exact same cellular automata rule over and over can be boring. Its far more interesting if the rule changes and doesn't always act the same. Consider a variation of Conway's Game of Life in which cells with no adjacent neighbors and three diagonal neighbors die instead of living. A Variation such as this may exhibit differences from the original which vary from subtle to substantial. Collidoscope makes use of even subtle differences on the theory that subtle differences induce visual interest as the viewer's brain innately attempts recognition. Conversion of a rule to the canonical weighted form gives the maximum amount of control possible for effecting subtle variations.

Temporal Rules

SARCASim allows one to define cellular automata rules with an arbitrary number of steps. Collidoscope does the same but adds an additional innovation. If each step is considered to be counting followed by decision, then Collidoscope will display the cellular automata world after each step. In contrast, SARCASim will only display the end result of the sequence of steps. Clearly this innovation adds a temporal dimension to a cellular automata, as it appears to the viewer as if the cellular automata rules are changing over time. Indeed they are. Collidoscope's temporal cellular automata rules range from having only a couple of steps to having literally hundreds of steps.

Two step temporal cellular automata rules seem to be useful for creating cellular automata in which objects appear to move at two different speeds. Having both slow and fast objects in the same cellular automata adds to visual interest. Collidoscope's Silk cellular automata is an example. In its simplest form Silk is specified in Collidoscope as:

	decay(star(2,1) + 456/ + star(2,1) + 456/1, 4)

Silk
(Click to restart)

Silk is thus a four state cellular automata with two refractory states. It uses a star neighborhood and weighted counting with near neighbors counting as two and far neighbors counting as one. New cells are birthed in empty cells whose count is between four and six inclusive. On alternate steps, live cells with only a single far neighbor stay alive, otherwise they become refractory for two steps just like all other live cells. This kind of step alternation seems to favor the creation of objects that appear to move at half the speed of other objects.

Two or more cellular automata rules can also be combined using seasonal variation, in which one rule is repeated for a large number of steps before another rule is switched to. If the rules are closely related the effects can be subtle. When the number of steps between rule switches is reduced to a more moderate number the cellular automata can appear to have a rhythm or heartbeat.

Another temporal technique used by Collidoscope is transient induction: repeating a rule for a large number of steps, and then using a different rule for only a single step. Inducing a transient is useful for teasing out the dynamic behavior often inherent in a cellular automata. John Elliott's Hextenders is a good example. One of the few interesting six neighbor hexagonal cellular automata rules, it is even more interesting when perturbed by a transient once every hundred steps:

	decay(99 * (six + 23/1345) + six + 234/13456, 10)

Transients are also notably used in Collidoscope's George's Brain variants in which formations periodically stop and restart:

	decay(99 * (star + 34/5678) + six + 235/235, 3)

George's Brain With Pole Freezers
(Click to restart)

Collidoscope's variety of neighborhoods provides independent grid capabilities. Collidoscope's Phasers set of rules switches back and forth between using the far star and sar star neighborhoods.

Temporal techniques have not been widely used in cellular automata until Collidoscope, which makes extensive use of them. Use of these techniques substantially expands the number of visually interesting cellular automata which may be constructed.

Non-deterministic Rules

Collidoscope is built on non-determinism. It chooses one cellular automata rule specification from among many in a non-deterministic manner, and the specifications themselves can be non-deterministic, producing different cellular automata rules each time instantiated. The result is a very powerful compact notation, capable of expressing a multitude of cellular automata rule variations in a single specification.

Non-deterministic specification is useful for defining classes of cellular automata rules with variations as described previously. It is also quite useful for specification of periods in temporal cellular automata, where different step periods can result in different emergent behaviors. Collidoscope only has on the order of a hundred different rule specifications, but these specify a combinatorial variety of cellular automata rules which is well beyond my capability to enumerate.

It should be noted that the traditional notion of a non-deterministic cellular automata rule is entirely different from Collidoscope's notion.

Conclusions

Collidoscope considerably extends the repertoire of techniques available for defining visually interesting hexagonal cellular automata. It is able to do this partially because it is not bound by the limitations or restrictions of traditional cellular automata methodology. Animation-Reduction cellular automata methodology supports implementation of weighted twelve neighbor counting rules which distinguish between near and far neighbors and allow multiple colors to be used in the display of a cellular automata. Use of the canonical weighted counting form allows the maximum amount of control to be applied to the rules of a cellular automata. Use of temporal techniques gives a heartbeat to a cellular automata. Finally, non-deterministic rule specification provides a compact notation which can express a wider variety of emergent cellular automata behavior than can be tested.

References

Animation-Reduction Cellular Automata
Collidoscope
Color Game Of Life Visual Exhibition
John Elliot's Cellsprings/Web (Hextenders example)
Modern Cellular Automata
Modern Cellular Automata Hexagonal Extension
Author hexagonal cellular automata experimentation tool
AuthorXY hexagonal cellular automata comparison tool
Modern Cellular Automata Software Distribution (.zip file)
SARCASim