ConwayTree is an attempt to explore 3D structures formed by generations of Conway's Life cellular automaton (with time as the third axis). I used the Minecraft clone by Michael Fogleman as 3D engine.
You can find the general description on the ConwayTree project's page and some related videos on my ConwayTree youtube playlist.
First of all, make sure you have the latest 2.x python installed. Then clone (or download) this repository and try to run the script. The script requires pyglet multimedia library. If it is missing on your computer, try to install it with the following command:
pip install pyglet
Note: Some Mac users may need to build pyglet from source code due to problems with the stable version of pyglet on latest 64-bit Intel Macs. The known solution for this situation is:
- Download the latest snapshot of the pyglet sources (right now the latest version is 1.2alpha)
- Build and install it according the official instructions:
sudo python setup.py install
Please note you'll need superuser privileges.
The simplest way to try ConwayTree is to type python conway_tree.py
command in your favorite console. This will bring up a ConwayTree instance with famous R-pentomino pattern as a seed (generation zero pattern laying on the ground level of visible 3D environment).
Hit H
key to get help on controls.
You can give the filename of prefab pattern as a parameter for the script to start with some different seed pattern: python conway_tree.py patterns/cow.cells
- use
mouse
to look around I
to invert the mouse Y-axisESC
to unlock the mouse cursorW``A``S``D
to move aroundTAB
to turn fly mode on/off (default=on)SPACE
to jump (while not flying)Q
andE
to strafe vertically (while flying)ENTER
orZ
to compute the next Life generationX
to run/pause automatic computing of Life generationsR
sometimes is helpful against visual glitchesL
to show/hide the statistics barH
to show/hide the information about control keys
The current version of ConwayTree supports simplest ASCII plain text:
.
(period) character means a dead (or absent) cell- any other symbol means an alive one
- the right alignment of a pattern is not necessary
E.g. R-pentomino pattern can be specified like this:
.XX
XX
.X
The frame saving mode could be activated using the special run parameter save_frames
(it must be the last parameter in any case). In the frame saving mode ConwayTree creates (if necessary) folder frames
and saves each frame it produces during the run, one by one. This mode was made especially for making video movies of evolving Life structures.
Each frame file uses the JPG format and has a name like "frame_XXXXXXXX.jpg", where XXXXXXXX is the number of the given frame.
However, assembling the movie from separate frames is up to you. As for me, I used the rtJPG2Video utility under Windows OS. On Mac and Linux you can try ffmpeg or MEncoder (part of MPlayer project).
By default, the blocks forming the Conway Life tree are covered with one of the two prepackaged textures.
texture.png
is the solid one, while texture.png_transparent
demonstrates the transparency trick. Just replace the texture.png
with the texture.png_transparent
file to take a look on it. You can also play and change the file with textures by yourself.
- Some troubles are known on Mac with the default version of the pyglet library -- check the 'Installation' section for the solution.
- Some glitches are possible while visualizing huge structures with many living cells. The reason for that is the way the original Michael Fogleman's queue processing routine works: it rejects tail of queue whenever the desired FPS is lost. If you really need glitch-free rendering (for movie capturing, for example), you could replace the
self.model.process_queue()
in theWindow.update()
method withself.model.process_entire_queue()
. It should remove the glitches, at a cost of significant slow-down.
- John Conway for the game of Life
- Michael Fogleman for the Minecraft clone code
- zarazum@ as a co-thinker and beta-tester
- the Conwaylife.com portal for a huge collection of Life patterns