« New c/6 Orthogonal Spaceship | Main | By Gosper and By Golly »

2006 March 07

Life Variants
Colored Life

In the past there have been attempts to add color to the Game of Life, but none of them seem to have caught on. Most that I've seen suffer from a major defect that the colors don't reflect the deterministic nature of Life patterns, instead merely overlaying meaningless color for its own sake. These can make for pretty screensavers, but really don't have any practical applications for the serious Life enthusiast.

One exception was found early on. As described in LifeLine #2 (1971), Don Woods attempted to come up with a two-person version in which players would have bits of their own color. When different colors resulted in the birth, the majority color (two out of three) would determine the new cell's color. (The game, called Immigration, also had players adding bits in order to influence the outcome of births, which violates Life's determinism, but does add a competitive element.) This rule, known as "3-State Life" (Two On-states and an Off-state) works well, and even results in some new and interesting phenomena.

3 Phase Glider Hybrid Glider result It can be used, for example, to track the results of the interactions between two objects, as in Glider collisions, to show which object is responsible for which part of the resulting pattern. In many cases, that final pattern has objects of both On-states, or even hybrid objects with both. At left is shown how a hybrid Glider can have cells of both states. This hybrid can even result naturally, as the collision of a Glider with a Toad shows. Other hybrid oscillators are also possible, and a number of other glider collisions resulting in hybrid objects are known.

Because births occur with exactly three neighbors, it's really not possible to extend this idea to even more states and colors, although there is an exception. Dean Hickerson came up with a 5-State Life, which he presented in LifeLine #11 (1973). The majority rule is again applied, but in this case, when three different states were involved in a birth, the fourth state results instead. Unfortunately, unlike 3-State Life, 5-State Life doesn't really track the history of the objects, leading to shifting colors.

Another attempt at a colored Life is on display at Gunnar Johnsson's Games of Life in Colour. After a discussion of 3-State Life, he goes on to present his "Rainbow Game of Life". Here birth cells take on the "arithmetic mean, in the RGB system, of the colours of the three parent cells." The problem with this rule is that after a while, most active patterns will settle down to a muddled gray. There is no way for the colorspace of live cells to grow in size, especially in adding the necessary new cells with pure colors.

Another way to colorize Life is by having multiple On-states, each of a slightly different color. For the purposes of determining births, all On-states are considered to be equivalent, and result in a single On-state for the new cell that is independent of the parents. With properly chosen colors, it's possible to get some motion effects with spaceships. Dave Greene has used some colors to good effect in his MCell-produced Holiday Spaceships. There are also rule sets in MCell which apply to Off-state cells to show they were once active. There are two Off-states, one which can only be set in the initial pattern. This rule is useful when combining components and you need to make sure they won't interact adversely, for example.

Colorized P2 OscillatorsA while back I came up with the idea for a deterministic Life which did support multiple, meaningful colors. Instead of cells having one of a set of quantum On states, each On-state cell would have an associated vector value. This vector could then be represented by a color, using the HSV (Hue-Saturation-Value) color model. When cells result in a birth, their vectors are added. The resulting vector is then scaled to keep it within the colorspace. This feature has the advantage of adding new bright or saturated colors, so unlike Johnsson's Rainbow Life rule, patterns won't become gray masses. As an added feature, every generation a cell's Value color parameter would be reduced by a given amount. Newborn cells would start with a high value, so this would have the effect of "cooling" a cell from an initial "hot" state. Shown here are a few Period 2 oscillators along with their appearance 16 generations later.

3 Phase Glider If only two colors 180° apart are used, the results will be identical to 3-State Life. But colors at other angles can be used to demonstrate other effects, as the sample here shows: The Toad shows its simple 3-State hybrid. A red-green-blue Pentadecthlon makes the transition a yellow-violet. A pair of Heavyweight Spaceships combine to support a hybrid taglong. Finally, a Period 22 Glider Gun emits hybrid Gliders. Also, notice how the Fishhook eaters in the Glider Gun slowly darken. They start at the same color as the rest of their portion of the gun, but darken as they "cool off". And the colors of the Spaceships' cells vary depending on their age as the ship objects move.

Random Colored LifeAlso shown are the results of a 16x16 randomly colored soup, displayed every 10 generations. (Note that some of the ghosting of colors in these pictures is an artifact of the image compression. You work with the tools you've got...)

To test out these ideas, I hacked up my Life program to support them. They seemed to work well, as the above samples show. Since the implementation is grafted onto an existing Life bit model and engine, calculating new generations and displaying them are slow, and bit editing is a bit cumbersome at times. But as the images here show, it works.

I did find a few problems that need to be addressed if anyone were to pursue this further. Left undefined, for example, is what happens if a set of red (0°), green (120°) and blue( (240°) vectors with the same length were responsible for a birth. Also, rounding and precision seems to be important. While theoretically any two opposite colors (i.e., green (120°) and magenta (300°)) should follow 3-Phase rules, my implementation ends up with one or the other 90° color instead. Perhaps a solution would be to restrict the angles to a large set of discrete values, and do the same for vector lengths. Perhaps an implementor should investigate how astronomical gravity simulations deal with such problems.

Merged random Merged sample In putting together these images, I noticed another effect that might be put to good use. The graphics program I used has a "Merge Into One Image" feature, where every image within a directory contributes only a fraction of its color to the resulting image. For colored life, this results in a colorized "history" smear of all the cells that were active at some time. Stable objects reinforce themselves, while oscillators get smeared over their phases. If you look closely, you can even see the trail of the gliders and spaceships.

These ideas are presented here in the hope that someone will put them to good use, as I probably won't go much further with Colored Life any time soon. If you have specific questions, or are interested in implementing this yourself and find I'm not clear about some aspect, please use the author email to contact me.