Cellular Automata files formats

Go back to MCell Home

 

 

MCell and MCLife (*.MCL)

MCL is a relatively new Cellular Automata file format introduced with MCLife 1.20, and continued in MCell. It’s an ASCII format combining both Life 1.05 and RLE and introducing extensions necessary to store all MCell features.

The file in version 4.00 can contain the following keywords:

#MCell The file type and version specifier. Example:
#MCell 4.00
#GAME Optional game type, one of: 'Life', 'Generations', 'Weighted Life', 'Vote for Life', 'Rules table', 'Cyclic CA', '1-D totalistic', 'Neumann binary', 'General binary', 'Larger than Life', 'Margolus', 'User DLL', 'Special rules'; default is 'Life'. Example:
#GAME Generations
#RULE Optional rule expressed as text; default is '23/3'. Since the version 2.30 long rules can be split into several #RULE lines. Example:
#RULE 345/34/6
or
#RULE NW4,NN1,NE0,WW1,ME0,EE4,SW0,SS4,SE1,HI0,RS2,RS3,RS6,RS7,RS8,RS9,
#RULE RS11,RS12,RS13,RS14,RS15,RB5,RB10,RB11,RB14,RB15
#SPEED Optional game speed, 0..5000, 0 is fastest, 5000 is 5 seconds per generation; if the parameter is missing, default is 'no change'. Example:
#SPEED 50
#BOARD Optional board size nn x mm; if the parameter is missing, default is 'no change'. Example:
#BOARD 300x300
#CCOLORS Optional count of states (colors), 2..256; if the parameter is missing, default is 'no change'. This parameter is ignored in rules defining the count of colors, for example in Generations family. Example:
#CCOLORS 16
#COLORING Optional coloring method for rules without history. 1 is standard, 2 is alternate; if the parameter is missing, default is 'no change'. Example:
#COLORING 2
#WRAP Optional 'wrap at edges' flag, 1 or 0; if the parameter is missing, default is 'no change'. Example:
#WRAP 0
#PALETTE Optional color palette name, without an extension. Example:
#PALETTE MCell standard
#D Optional description (comment) line; there is no limit to the count of description lines. Example:
#D Another interesting small starting pattern
#L The data line in extended RLE syntax, supporting 256 cell states:
  • dead cells are saved as ‘.’,
  • live cells are saved as: A-state 1, B-state 2, ..., X-state 24. Cells in states greater that 24 are output  using two characters. The state character 'A'..'X' is preceeded with one of 'a','b'..'j' characters. Prefix 'a' means "add 24", 'b' means "add 48", .., 'j' means "add 240",
  • as in RLE, new lines are represented with ‘$’s.

Examples:
#L 9.3A$9.5A$8.DACCBBA$6.3A..B3AC$4.AABBAD..ADDAB$4.A3BA3
#L 9aB

#DIV Optional diversities.
#DIV #SYSTEM - general diversities activity,
#DIV #NOISE - noise parameters,
#DIV #BHOLE - black hole parameters,
#DIV #SNOVA - supernova parameters,
#DIV #STRIN - string injection parameters.

Examples:
#DIV #SYSTEM,act=1
#DIV #NOISE,act=1,cycl=1,cell=3,stt=1
#DIV #BHOLE,act=1,x=-30,y=-30,size=10
#DIV #SNOVA,act=1,x=30,y=30,size=10,stt=1
#DIV #STRIN,act=1,rep=1,x=0,y=0,str=1,1,1,0,0,0

There is no limit to the data line length, anyhow MCell saves lines not longer than 70 characters.

All keywords except for the #MCell can be omitted; than the default values are used.

An example of the .MCL file:

#MCell 3.00
#GAME Generations
#RULE 3467/25/6
#SPEED 20
#BOARD 300x300
#WRAP 0
#D
#D The universe of Worms.
#D
#D Discovered by Mirek Wojtowicz
#D 1999.04.08
#L ..DE.DED$.CE.E.DD$BDBABBC$.CACCEC$.A.BD.B$..B3C$3.3A$..4A$3.AA31$8.AA$
#L 7.4A$7.3A$7.3CB$6.B.DB.A$6.CECCAC$6.CBBABDB$5.DD.E.EC$5.DED.ED

 


Life 1.05 (*.LIF, *.LIFE)

This ASCII format just draws the pattern with "." and "*" symbols. The lines length should not exceed 80 characters.

The "#Life" line is followed by optional description lines, which begin with "#D" and are followed by no more than 78 characters of text. Leading and trailing spaces are ignored, so the following two "#D" lines are equivalent:

#D This is a Description line
#D     This is a Description line

There should be no more than 22 "#D" lines in a .LIF file.

Next comes an optional rule specification. If no rules are specified, then the pattern will run with whatever rules the Life program is currently set to. The patterns in the collection here enforce "Normal" Conway rules using the "#N" specifier. Alternate rules use "#R" ("#N" is exactly the same as "#R 23/3"). Rules are encoded as Survival/Birth, each list being a string of digits representing neighbor counts. Since there are exactly eight possible neighbors in a Conway-like rule, there is no need to separate the digits, and "9" is prohibited in both lists. For example,

#R 125/36

means that the pattern should be run in a universe where 1, 2, or 5 neighbors are necessary for a cell's survival, and 3 or 6 neighbors allows a cell to come alive.

Next come the cell blocks. Each cell block begins with a "#P" line, followed by "x y" coordinates of the upper-left hand corner of the block, assuming that 0 0 is the center of the current window to the Life universe.

This is followed by lines that draw out the pattern in a visual way, using the "." and "*" characters (off, on). Each line must be between 1 and 80 characters wide, inclusive; therefore, a blank line is represented by a single dot, whereas any other line may truncate all dots to the right of the last "*". There is no limit to the number of lines in a cell block.

Any line of zero length (just another carriage return) is completely ignored. Carriage returns are MSDOS-style (both 10 and 13).

For example, a glider in Life1.05 format is saved as:

#Life 1.05

***
*..
.*.

Life 1.05 format was designed to be easily ported. You can just look at a pattern in this format in a text editor, and figure out what it is. Alan Hensel's pattern collection (http://www.mindspring.com/~alanh/lifep.zip) is stored in Life 1.05 format.

 


Life 1.06 (*.LIF, *.LIFE)

This ASCII format is just a list of alive cells. Life 1.06 was designed to be easy and quick for the Life program to write. It turns out that for Life 1.05 it is very hard to find a quick, optimal algorithm for choosing cell blocks. So this format is just a list of (x y) coordinates with live cells, which could potentially be very long.

The above glider is saved as:

#Life 1.06
0 0
0 1
1 0
1 2
2 0

 


RLE (*.RLE)

RLE ("Run Length Encoded") format is best for larger patterns. It is more cryptic, but not terribly so.

The first line is a header line, which has the form

x = m, y = n

where m and n are the dimensions of the pattern. RLE-writers should produce spacing as shown, but RLE-readers are best not to assume this spacing because it isn't clear that it was originally mandated.

The pattern itself begins on the next line and is encoded as a sequence if items of the form <run_count><tag>, where <tag> is one of the following

b = a dead cell
o = a live cell
$ = end of a line of the pattern

and <run_count> is the number of occurrences of <tag> and can be omitted if equal to 1. The last <run_count><tag> item is followed by a ! character. Dead cells at the end of a pattern line do not need to be encoded, nor does the end of the last line of the pattern. Whitespace is permitted between <run_count><tag> items (and between the last <run_count><tag> item and the following !), but except for carriage returns and line feeds this is not recommended. It is not permitted to place whitespace in the middle of a <run_count><tag> item, although it's a good idea for RLE-readers to be able to cope with this anyway.

Lines in the RLE file must not exceed 70 characters, but again it's a good idea for RLE-readers to be able to cope with longer lines. DOS, Unix and Mac newline conventions are all acceptable.

Anything after the final ! is ignored. It used to be common to put comments here (starting on a new line), but the usual method for adding comments is now by means of #C lines (see below).

Later RLE enhancements

(1) The header line may be preceded by any number of lines beginning with the # character. The # is followed by a letter indicating the type of information that the line provides. These letters generally follow the conventions for XLife files which are described in the file xlife.man in the XLife distribution, although some of the letters
described there are not necessarily meaningful in RLE files. An RLE-reader should ignore any line marked with a letter it does not know about. Here is a list of letters likely to be encountered in practice:

C  - indicates that a line of comment follows. This is the only really common use of # lines. Example:

#C 'Twas brillig and the slithy toves 

c - same as C, but not really correct. Example:

#c Did gyre and gimble in the wabe.

O - says when and by whom the file was created. RLE files produced by XLife usually have this line. Example:

#O ook "The Librarian"@unseen.edu Fri Apr 30 19:38:52 1999

P - essentially the same as R. This line is produced by Life32, which generates coordinates which probably won't be of use to anyone unless the user has taken care to make sure they are (which is unlikely). Best ignored. Example:

#P 90 136

R - gives the coordinates of the top left-hand corner of the pattern. RLE files produced by XLife usually have this line, and the coordinates are usually negative with the intention of placing the centre of the pattern at the origin. Example:

#R -22 -57

r - gives the rule for a totalistic cellular automaton in the form survival_counts/birth_counts (e.g. 23/3 for Life). This line is usually present in RLE files created by XLife. But the normal method of indicating the rule is described in (2) below. Example:

#r 23/36

(2) The rule for which the pattern is designed can be indicated in the header line, which then takes the form

x = m, y = n, rule = abc

where abc is the rule's designation, such as B36/S23 for HighLife. This type of extended header line is usual whenever the pattern is not intended for Conway's Life. As with ordinary header lines, RLE-writers should adhere to the spacing shown, but RLE-readers are best not to assume it.

(3) Letters other than b and o may be used for the <tag>s to represent extra states. Unless the cellular automaton has more than 26 states it's a good idea to stick to lowercase letters. RLE-readers that cannot handle more than two states should treat all letters other than b (and perhaps B) as equivalent to o.

 

For example, the following is the common glider in RLE format:

x = 3, y = 3
3o$o$bo!

The large Mark D. Niemiec's site (http://home.interserv.com/~mniemiec/) has thousands of files saved in RLE format. The files contain an RLE file syntax extension - they use “x”, “y”, and “z” characters to denote 3 more cell states.

 


dbLife (*.L)

Essentially the same format as RLE. David I. Bell used this format for his large collection dbLifeLib (http://canb.auug.org.au/~dbell/archive/c3.tar.gz). Some patterns in this format mix the Life 1.05 format with RLE.

 


ProLife (*.PLF)

ProLife is the only popular binary file format used for storing Cellular Automata files. The authors of the format did several tricks to make this format hard to decipher. Note that ProLife patterns are limited to a maximal width of 320 cells.

The large guns library (Dieter Leithner and Peter Rott, http://www.mindspring.com/~alanh/guns2.zip) is stored in ProLife format.

 


XLife 2.0 (*.LIF, *.LIFE)

This was developed at about the same time as the Life 1.05 format, for the same reasons, and the results are very similar.

XLife recognizes the symbol "#C" for a comment, instead of "#D". Many XLife patterns contain also the #O keyword that says when and by whom the file was created. The default extension is ".life" instead of ".LIF".

The familiar glider is saved as:

#Life 1.05
***
*..
.*.

Webmaster: Mirek Wójtowicz
envelope info@mirekw.com,
envelope mirwoj@life.pl
globe http://www.mirekw.com


MCell mirrors:
globe USA  http://psoup.math.wisc.edu/mcell/
globe Europe  http://www.mirwoj.opus.chelm.pl

Last update: 15 Sep 2001