Difference between revisions of "LifeViewer"
Line 420: | Line 420: | ||
format rules. Typically @TREE rules run much faster so if possible ensure there is an @TREE version of the rule before the @TABLE | format rules. Typically @TREE rules run much faster so if possible ensure there is an @TREE version of the rule before the @TABLE | ||
version (if present). | version (if present). | ||
LifeViewer supports the @COLORS section but does not support the | LifeViewer supports the @COLORS section and the @NAMES section but does not support the @ICONS section (which will be ignored if present). | ||
===Aliases=== | ===Aliases=== |
Revision as of 09:53, 1 May 2021
LifeViewer | |
Homepage | Click here |
---|---|
Purpose | Life simulation |
Created by | Chris Rowett |
Platform | HTML5 / Javascript |
LifeViewer is a browser-based scriptable pattern viewer and editor used to simulate Life and a wide range of other 1D and 2D cellular automata.
If you want to use LifeViewer on your own site then the latest release can be downloaded here.
LifeViewer features
- Smooth non-integer zoom with anti-aliasing and rotation.
- Colour themes with cell history and longevity.
- Pseudo 3D layers and stars.
- Multiple ways to automatically track patterns with the camera as they evolve.
- Script language that allows many features to be customized including Waypoint animations.
- Support for multiple embedded LifeViewers and/or a single popup LifeViewer.
- Ability to step back to earlier generations for all patterns and reverse playback for reversible Margolus and PCA patterns.
- Random pattern and rule generation.
- Real time auto-scaling population graph.
- Pattern annotation with Labels, Arrows, Lines and Polygons.
- Programatically pasting cells onto the grid at defined intervals (for example: glider injection).
- Ability to build patterns from RLE recipes with transformations.
- Identification of oscillator and spaceship periods.
- Automatic scaling for high DPI displays including smartphones and tablets.
- Editor with unlimitied undo/redo and multiple clipboards.
Rule support
LifeViewer supports the following rule families:
Built-in Rules
- 2-state Margolus rules.
- 2-state Outer-totalistic Life-like cellular automata (from ranges 1 to 500, supporting a wide variety of pre-programmed neighbourhood families, as well as custom neighbourhoods and weighted neighbourhoods).
- 2-state Isotropic non-totalistic Life-like cellular automata (for range-1 Moore and range-1 hexagonal).
- 2-state Non-isotropic Life-like cellular automata (for range-1 Moore, hexagonal and von Neumann).
- Generations rules (as an extension of the outer-totalistic, non-totalistic and non-isotropic rulespaces).
- Alternating rules.
- Partitioned cellular automata (PCA) rules.
- Elementary cellular automata (even numbers only).
- [R]History rules.
- [R]Super rules.
- RuleTable rules (either inline or from a Rule Repository).
Click on "Expand" to the right to view example patterns for each rule family.
- 2-state Margolus rules.
- Example: Critters (M15,14,13,3,11,5,6,1,7,9,10,2,12,4,8,0)
- Example: Critters (M15,14,13,3,11,5,6,1,7,9,10,2,12,4,8,0)
- 2-state Outer-totalistic Life-like cellular automata (from ranges 1 to 500, including Larger than Life).
- Example: Soldier Bugs (R7,C2,M1,S65..114,B65..95,NM)
- Example: Soldier Bugs (R7,C2,M1,S65..114,B65..95,NM)
- 2-state Isotropic non-totalistic Life-like cellular automata (for range-1 Moore and range-1 hexagonal).
- Example: Just Friends (B2-a/S12)
- Example: Just Friends (B2-a/S12)
- 2-state Non-isotropic Life-like cellular automata (for range-1 Moore, hexagonal and von Neumann).
- Example: MAP//8IAN1+KYD/9QAA/f8AAOu/AQD38wAI//8IgP39Akrn/wAB/78DAP/+AAD/ugAA//sQCN3+AIDfvwhD//sAQA
- Example: MAP//8IAN1+KYD/9QAA/f8AAOu/AQD38wAI//8IgP39Akrn/wAB/78DAP/+AAD/ugAA//sQCN3+AIDfvwhD//sAQA
- Generations rules (as an extension of the outer-totalistic, non-totalistic and non-isotropic rulespaces).
- Example: Fireworks (2,13,21)
- Example: Fireworks (2,13,21)
- Alternating rules.
- Example: alternlife (B13/S012345678|B/S15)
- Example: alternlife (B13/S012345678|B/S15)
- Partitioned cellular automata (PCA) rules.
- Example: PCA_4 (2PCA4,0,2,4,12,8,5,9,7,1,6,10,11,3,13,14,15)
- Example: PCA_4 (2PCA4,0,2,4,12,8,5,9,7,1,6,10,11,3,13,14,15)
- Weighted rules.
- Example: R2,C2,S2-3,B4,7-8,NW0010001210120210121000100
- Example: R2,C2,S2-3,B4,7-8,NW0010001210120210121000100
- Elementary cellular automata (even numbers only).
- Example: Wolfram 30 (W30)
- Example: Wolfram 30 (W30)
- [R]History rules.
- Example: LifeHistory
- Example: LifeHistory
- [R]Super rules.
- Example: LifeSuper
- Example: LifeSuper
- RuleTable rules from a repository.
- Example: Byl-loop
- Example: Byl-loop
Repository Rules
LifeViewer can load rules from the Rule: namespace here on LifeWiki. The rules must be in RuleTable format. LifeViewer supports both @TABLE and @TREE format rules. Typically @TREE rules run much faster so if possible ensure there is an @TREE version of the rule before the @TABLE version (if present). LifeViewer supports the @COLORS section and the @NAMES section but does not support the @ICONS section (which will be ignored if present).
Aliases
LifeViewer contains a large list of alias names for particular rules. This list of rule name aliases can be found by clicking the Aliases button under Help.
Grid and neighbourhood support
LifeViewer supports many different neighbourhoods on square, hexagonal or triangular grids.
Click on "Expand" to the right to view the full list of supported neighbournoods per grid type.
- square grid:
- outer-totalistic:
- Moore
- von Neumann
- circular
- cross
- L2
- saltire
- star
- checkerboard
- hash
- custom (CoordCA)
- non-totalistic
- non-isotropic
- Margolus
- PCA
- Weighted
- outer-totalistic:
- hexagonal or offset-square grid:
- outer totalistic:
- hexagonal
- tripod
- asterisk
- custom (CoordCA)
- non-totalistic
- non-isotropic
- outer totalistic:
- triangular grid:
- outer totalistic:
- triangular Moore
- triangular edges
- triangular vertices
- triangular inner
- triangular outer
- custom (CoordCA)
- outer totalistic:
Bounded grid types
LifeViewer supports patterns on "unbounded" grids (maximum 16384x16384 in size) and the following bounded grid types:
- Plane
- Cylinder (with optional shift)
- Torus (with optional shift)
- Klein-bottle (with optional shift)
- Cross-surface
- Sphere
For range 2+ neighbourhoods only Plane, and Torus (without shift) are supported.
Native support for BSFKL, Extended Generations and deficient rules is also planned.[1][2][3] Support for 1D totalistic rules and multiple neighbourhoods rules may also be planned.[4][5]
Keyboard commands
A visual map of keyboard shortcuts is shown below:
Below is a list of keyboard commands by category:
Playback controls
Click on "Expand" to the right to view Playback controls.
Key | Description |
Enter | toggle play / pause |
Space | pause / next generation |
B | pause / previous generation |
Backspace | pause / previous generation |
Tab | pause / next step |
Shift Tab | pause / previous step |
Esc | pause if playing |
R | reset to generation 0 |
- | decrease generation speed |
+ | increase generation speed |
Shift - | minimum generation speed |
Shift + | maximum generation speed |
D | decrease step size |
E | increase step size |
Shift D | minimum step size |
Shift E | maximum step size |
0 | reset step and speed |
Ctrl P | toggle pause playback while drawing |
Alt T | toggle throttling |
W | toggle waypoint playback and loop |
Shift P | toggle just loop |
Alt O | toggle autostart |
Alt P | toggle stop |
Multi-Viewer controls
Click on "Expand" to the right to view Multi-viewer controls.
Key | Description |
Shift R | reset all LifeViewers to generation 0 |
Z | stop playback in all other LifeViewers |
Shift Z | stop playback in all LifeViewers |
Camera controls
Click on "Expand" to the right to view Camera controls.
Key | Description |
V | restore saved camera position |
Shift V | save current camera position |
F | fit pattern to display |
Shift F | toggle autofit |
Shift H | toggle autofit history mode |
Ctrl F | fit selection to display |
Ctrl M | center pattern on display |
[ | zoom out |
] | zoom in |
Shift [ | halve zoom |
Shift ] | double zoom |
1 | 1x zoom |
2 | 2x zoom |
4 | 4x zoom |
8 | 8x zoom |
6 | 16x zoom |
3 | 32x zoom |
Shift 3 | 64x zoom |
Shift 1 | integer zoom |
Shift 2 | -2x zoom |
Shift 4 | -4x zoom |
Shift 8 | -8x zoom |
Shift 6 | -16x zoom |
Left | pan left |
Right | pan right |
Up | pan up |
Down | pan down |
Shift Left | pan north west |
Shift Right | pan south east |
Shift Up | pan north east |
Shift Down | pan south west |
< | rotate left |
> | rotate right |
Shift < | rotate left 90 degrees |
Shift > | rotate right 90 degrees |
5 | reset angle |
View controls
Click on "Expand" to the right to view View controls.
Key | Description |
Q | increase number of layers |
A | decrease number of layers |
P | increase layer depth |
L | decrease layer depth |
C | next colour theme |
Shift C | previous colour theme |
Alt C | default theme |
Display controls
Click on "Expand" to the right to view Display controls.
Key | Description |
G | toggle generation statistics |
Shift G | toggle generation display mode |
Y | toggle population graph |
Shift Y | toggle graph lines |
7 | decrease graph opacity |
9 | increase graph opacity |
Shift W | toggle performance warning |
/ | toggle cell type for hex and triangular grids |
T | toggle timing information |
Shift T | toggle extended timing information |
I | toggle pattern and engine information |
Shift I | toggle information bar |
Ctrl Q | toggle cell anti-aliasing |
Alt B | toggle cell borders |
X | toggle gridlines |
Shift X | toggle major gridlines |
Ctrl G | toggle auto gridlines |
Alt G | convert pattern to [Rule]Super |
Alt H | convert pattern to [Rule]History |
Alt J | convert pattern to [Rule]Standard |
Ctrl L | toggle kill escaping gliders |
S | toggle stars |
O | open screenshot in separate window |
Shift O | open population graph in separate window |
Shift U | toggle UI |
Alt U | toggle autohide UI during playback |
Alt W | toggle rainbow mode |
Pattern controls
Click on "Expand" to the right to view Pattern controls.
Key | Description |
Alt N | new pattern |
Alt R | change rule |
Ctrl O | open original or last saved pattern |
Ctrl+Shift O | open clipboard as pattern |
Ctrl S | save pattern |
Alt Z | randomize pattern and rule |
Ctrl+Alt Z | randomize pattern only |
F6 | toggle oscillator and spaceship identification |
Ctrl+F6 | fast identification |
External clipboard controls
Click on "Expand" to the right to view External clipboard controls.
Key | Description |
Alt S | toggle sync cut and copy with external clipboard |
Ctrl+Shift C | copy original pattern |
Ctrl C | copy current selection |
Ctrl+Alt C | copy current selection with comments |
Ctrl+Shift X | cut original pattern |
Ctrl X | cut current selection |
Ctrl+Alt X | cut current selection with comments |
Ctrl J | copy rule definition |
K | copy camera position |
Shift K | copy camera position and view |
Edit controls
Click on "Expand" to the right to view Edit controls.
Key | Description |
F1 | toggle draw/pan mode |
F2 | draw mode |
Shift F2 | toggle smart drawing |
F3 | pick mode |
F4 | select mode |
F5 | pan mode |
Ctrl A | select all |
Shift A | shrink selection |
Alt A | toggle auto-shrink selection |
Ctrl C | copy |
Ctrl D | toggle states display |
Ctrl I | invert selection |
Ctrl K | remove selection |
Ctrl V | paste |
Ctrl+Shift V | paste to selection |
Ctrl X | cut |
Ctrl Y | redo edit |
Ctrl Z | undo edit |
Ctrl+Shift Z | redo edit |
Ctrl Space | advance selection |
Shift Space | advance outside |
Shift L | cycle paste location |
Shift M | cycle paste mode |
Shift 5 | random fill |
Alt K | pick cell state to replace with drawing state |
Ctrl+Alt K | clear current drawing state cells |
Del | clear cells in selection |
Shift Del | clear outside selection |
> | rotate selection clockwise |
< | rotate selection counter-clockwise |
Alt X | flip selection horizontally |
Alt Y | flip selection vertically |
Alt Left | nudge selection 1 cell left |
Alt Right | nudge selection 1 cell right |
Alt Up | nudge selection 1 cell up |
Alt Down | nudge selection 1 cell down |
Esc | hide paste |
Enter | perform paste |
Ctrl 0 | select state 0 for drawing |
Ctrl 1 | select state 1 for drawing |
Shift B | toggles clipboard library |
Alt 0 | make clipboard 0 active |
Alt 1 | make clipboard 1 active |
Alt 2 | make clipboard 2 active |
Alt 3 | make clipboard 3 active |
Alt 4 | make clipboard 4 active |
Alt 5 | make clipboard 5 active |
Alt 6 | make clipboard 6 active |
Alt 7 | make clipboard 7 active |
Alt 8 | make clipboard 8 active |
Alt 9 | make clipboard 9 active |
Help controls
Click on "Expand" to the right to view Help controls.
Key | Description |
Up | scroll up one line |
Down | scroll down one line |
Page Up | scroll up one page |
Page Down | scroll down one page |
Shift Page Up | scroll up one section |
Shift Page Down | scroll down one section |
Home | go to first help page |
End | go to last help page |
Themes
Themes are used to define the colours of cells, the background and the grid lines. Some Themes also specify whether major grid lines are used and if so on what interval. Most Themes provide a visual representation of cell history and longevity.
The default Theme is "Blues" but this can be changed by clicking Theme in the Settings menu or with the THEME script command.
Grid
GRID: grid line colour
GRIDMAJOR: major grid line colour and interval
Two-state Themes
BACKGROUND: cell never occupied
ALIVE: cell just born
ALIVERAMP: cell alive for several generations
DEAD: cell just died
DEADRAMP: cell dead for several generations
There are 63 (AGESTATES) states from ALIVE to ALIVERAMP.
There are 63 (HISTORYSTATES) states from DEAD to DEADRAMP.
Click on "Expand" to the right to see the definitions of the available two-state Themes.
Mono | |||||
---|---|---|---|---|---|
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 255 | 255 | White | |
DEAD | 0 | 0 | 0 | Black | |
Blues | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 0 | 255 | 255 | Aqua | |
ALIVERAMP | 255 | 255 | 255 | White | |
DEAD | 0 | 0 | 255 | Blue | |
DEADRAMP | 0 | 0 | 47 | ||
Fire | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 144 | 0 | ||
ALIVERAMP | 255 | 255 | 0 | Yellow | |
DEAD | 160 | 0 | 0 | ||
DEADRAMP | 32 | 0 | 0 | ||
Poison | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 0 | 255 | 255 | Aqua | |
ALIVERAMP | 255 | 255 | 255 | White | |
DEAD | 0 | 128 | 0 | Green | |
DEADRAMP | 0 | 24 | 0 | ||
Yellow | |||||
BACKGROUND | 0 | 32 | 128 | ||
ALIVE | 255 | 255 | 0 | Yellow | |
ALIVERAMP | 255 | 255 | 255 | White | |
DEAD | 128 | 0 | 128 | Purple | |
DEADRAMP | 0 | 47 | 0 | ||
Gray | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 176 | 176 | 176 | ||
ALIVERAMP | 240 | 240 | 240 | ||
DEAD | 104 | 104 | 104 | ||
DEADRAMP | 16 | 16 | 16 | ||
Inverse | |||||
BACKGROUND | 255 | 255 | 255 | White | |
ALIVE | 0 | 0 | 0 | Black | |
DEAD | 255 | 255 | 255 | White | |
Day | |||||
BACKGROUND | 255 | 255 | 255 | White | |
ALIVE | 0 | 0 | 255 | Blue | |
ALIVERAMP | 0 | 0 | 0 | Black | |
DEAD | 0 | 255 | 255 | Aqua | |
DEADRAMP | 240 | 240 | 240 | ||
Occupied | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 240 | 240 | 240 | ||
DEAD | 240 | 240 | 240 | ||
Red | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 240 | 240 | 240 | ||
DEAD | 160 | 0 | 0 | ||
LifeHistory | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 0 | 240 | 0 | ||
ALIVERAMP | 16 | 255 | 16 | ||
DEAD | 0 | 0 | 160 | ||
DEADRAMP | 0 | 0 | 96 | ||
Generations | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 255 | 0 | Yellow | |
ALIVERAMP | 255 | 255 | 255 | White | |
DEAD | 255 | 0 | 0 | Red | |
DEADRAMP | 64 | 0 | 0 | ||
Golly | |||||
BACKGROUND | 48 | 48 | 48 | ||
ALIVE | 255 | 255 | 255 | White | |
DEAD | 48 | 48 | 48 | ||
GRID | 80 | 80 | 80 | ||
GRIDMAJOR | 112 | 112 | 112 | ||
GRIDMAJOR | 10 | ||||
MCell | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 255 | 0 | Yellow | |
DEAD | 0 | 0 | 0 | Black | |
GRID | 64 | 0 | 0 | ||
GRIDMAJOR | 99 | 3 | 1 | ||
GRIDMAJOR | 5 | ||||
Catagolue | |||||
BACKGROUND | 192 | 255 | 238 | ||
ALIVE | 0 | 0 | 0 | Black | |
DEAD | 160 | 221 | 204 | ||
GRID | 160 | 221 | 204 | ||
GRIDMAJOR | 160 | 221 | 204 | ||
GRIDMAJOR | 0 | ||||
Caterer | |||||
BACKGROUND | 54 | 57 | 62 | ||
ALIVE | 255 | 255 | 255 | White | |
DEAD | 54 | 57 | 62 | ||
GRID | 0 | 0 | 0 | Black | |
GRIDMAJOR | 0 | 0 | 0 | Black | |
GRIDMAJOR | 0 | ||||
Life32 | |||||
BACKGROUND | 255 | 255 | 255 | White | |
ALIVE | 0 | 0 | 128 | Navy | |
DEAD | 255 | 255 | 255 | White | |
GRID | 192 | 192 | 192 | Silver | |
GRIDMAJOR | 128 | 128 | 128 | Gray | |
GRIDMAJOR | 5 | ||||
Margolus | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 255 | 0 | Yellow | |
ALIVERAMP | 255 | 255 | 255 | White | |
DEAD | 0 | 0 | 128 | Navy | |
DEADRAMP | 0 | 0 | 47 | ||
GRID | 32 | 32 | 255 | ||
GRIDMAJOR | 64 | 64 | 128 | ||
GRIDMAJOR | 2 | ||||
PCA | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 176 | 176 | 176 | ||
ALIVERAMP | 240 | 240 | 240 | ||
DEAD | 64 | 64 | 64 | ||
DEADRAMP | 24 | 24 | 24 | ||
Book | |||||
BACKGROUND | 255 | 255 | 255 | White | |
ALIVE | 0 | 0 | 0 | Black | |
DEAD | 192 | 220 | 255 | ||
DEADRAMP | 255 | 220 | 192 | ||
GRID | 192 | 192 | 192 | Silver | |
GRIDMAJOR | 209 | 209 | 209 | ||
GRIDMAJOR | 0 |
Multi-state Themes
Multi-state Themes are used for Generations rules.
BACKGROUND: cell never occupied
ALIVE: cell alive
DYING: cell just starting dying
DYINGRAMP: cell about to die
DEAD: cell just died
DEADRAMP: cell dead for several generations
Rule defines states from DYING to DYINGRAMP
63 (HISTORYSTATES) states from DEAD to DEADRAMP
Click on "Expand" to the right to see the definitions of the available multi-state Themes.
Mono | |||||
---|---|---|---|---|---|
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 255 | 255 | White | |
DYING | 255 | 255 | 255 | White | |
DYINGRAMP | 0 | 0 | 0 | Black | |
DEAD | 0 | 0 | 0 | Black | |
Blues | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 0 | 255 | 255 | Aqua | |
DYING | 0 | 255 | 255 | Aqua | |
DYINGRAMP | 0 | 0 | 255 | Blue | |
DEAD | 0 | 0 | 128 | Navy | |
DEADRAMP | 0 | 0 | 47 | ||
Fire | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 144 | 0 | ||
DYING | 255 | 144 | 0 | ||
DYINGRAMP | 240 | 0 | 0 | ||
DEAD | 160 | 0 | 0 | ||
DEADRAMP | 32 | 0 | 0 | ||
Poison | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 0 | 255 | 255 | Aqua | |
DYING | 0 | 255 | 255 | Aqua | |
DYINGRAMP | 0 | 192 | 0 | ||
DEAD | 0 | 128 | 0 | Green | |
DEADRAMP | 0 | 24 | 0 | ||
Yellow | |||||
BACKGROUND | 0 | 32 | 128 | ||
ALIVE | 255 | 255 | 0 | Yellow | |
DYING | 255 | 255 | 0 | Yellow | |
DYINGRAMP | 192 | 64 | 64 | ||
DEAD | 128 | 0 | 128 | Purple | |
DEADRAMP | 0 | 47 | 0 | ||
Gray | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 240 | 240 | 240 | ||
DYING | 240 | 240 | 240 | ||
DYINGRAMP | 160 | 160 | 160 | ||
DEAD | 104 | 104 | 104 | ||
DEADRAMP | 16 | 16 | 16 | ||
Inverse | |||||
BACKGROUND | 255 | 255 | 255 | White | |
ALIVE | 0 | 0 | 0 | Black | |
DYING | 0 | 0 | 0 | Black | |
DYINGRAMP | 255 | 255 | 255 | White | |
DEAD | 255 | 255 | 255 | White | |
Day | |||||
BACKGROUND | 255 | 255 | 255 | White | |
ALIVE | 0 | 0 | 255 | Blue | |
DYING | 0 | 0 | 255 | Blue | |
DYINGRAMP | 0 | 255 | 255 | Aqua | |
DEAD | 0 | 192 | 192 | ||
DEADRAMP | 240 | 240 | 240 | ||
Occupied | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 240 | 240 | 240 | ||
DYING | 240 | 240 | 240 | ||
DEAD | 240 | 240 | 240 | ||
Red | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 255 | 255 | White | |
DYING | 160 | 160 | 160 | ||
DEAD | 160 | 0 | 0 | ||
LifeHistory | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 16 | 255 | 16 | ||
DYING | 16 | 255 | 16 | ||
DYINGRAMP | 0 | 128 | 160 | ||
DEAD | 0 | 0 | 160 | ||
DEADRAMP | 0 | 0 | 96 | ||
Generations | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 255 | 0 | Yellow | |
DYING | 255 | 255 | 0 | Yellow | |
DYINGRAMP | 255 | 0 | 0 | Red | |
DEAD | 128 | 0 | 0 | Maroon | |
DEADRAMP | 64 | 0 | 0 | ||
Golly | |||||
BACKGROUND | 48 | 48 | 48 | ||
ALIVE | 255 | 255 | 0 | Yellow | |
DYING | 255 | 255 | 0 | Yellow | |
DYINGRAMP | 255 | 0 | 0 | Red | |
DEAD | 48 | 48 | 48 | ||
MCell | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 255 | 0 | Yellow | |
DYING | 255 | 255 | 0 | Yellow | |
DYINGRAMP | 0 | 255 | 0 | Lime | |
DEAD | 0 | 0 | 0 | Black | |
Catagolue | |||||
BACKGROUND | 192 | 255 | 238 | ||
ALIVE | 0 | 0 | 0 | Black | |
DYING | 2 | 129 | 2 | ||
DYINGRAMP | 96 | 192 | 139 | ||
DEAD | 160 | 221 | 204 | ||
Caterer | |||||
BACKGROUND | 54 | 57 | 62 | ||
ALIVE | 255 | 170 | 0 | ||
DYING | 255 | 170 | 0 | ||
DYINGRAMP | 255 | 85 | 0 | ||
DEAD | 54 | 57 | 62 | ||
Life32 | |||||
BACKGROUND | 255 | 255 | 255 | White | |
ALIVE | 0 | 0 | 128 | Navy | |
DYING | 0 | 0 | 128 | Navy | |
DYINGRAMP | 0 | 0 | 64 | ||
DEAD | 255 | 255 | 255 | White | |
Margolus | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 255 | 255 | 0 | Yellow | |
DYING | 255 | 255 | 0 | Yellow | |
DYINGRAMP | 64 | 64 | 128 | ||
DEAD | 0 | 0 | 128 | Navy | |
DEADRAMP | 0 | 0 | 47 | ||
PCA | |||||
BACKGROUND | 0 | 0 | 0 | Black | |
ALIVE | 240 | 240 | 240 | ||
DYING | 240 | 240 | 240 | ||
DYINGRAMP | 160 | 160 | 160 | ||
DEAD | 64 | 64 | 64 | ||
DEADRAMP | 24 | 24 | 24 | ||
Book | |||||
BACKGROUND | 255 | 255 | 255 | White | |
ALIVE | 0 | 0 | 0 | Black | |
DYING | 128 | 128 | 128 | Gray | |
DYINGRAMP | 24 | 24 | 24 | ||
DEAD | 192 | 220 | 255 | ||
DEADRAMP | 255 | 220 | 192 |
Scripts
LifeViewer supports a large number of script commands than can be used to control playback, the camera, labels and annotations, colours and many other aspects.
Scripts must be embedded in pattern comments. Commands must be surrounded by whitespace.
For example loading the following pattern into LifeViewer will start playback automatically (AUTOSTART) and then stop at generation 30 (STOP 30).
#C [[ AUTOSTART STOP 30 ]] x = 3, y = 3, rule = Life o$ obo$ 2o!
It's also valid to have script commands after the RLE since this area is treated as comments.
x = 3, y = 3, rule = Life o$ obo$ 2o! [[ ANGLE 30 GPS 5 AUTOSTART THEME Fire ]]
Only text surrounded by [[ and ]] is interpreted as script commands.
#C An example [[ ZOOM 16 ]] with camera settings [[ X -4 Y 5 ]] #C and [[ GRID ]] grid lines. x = 3, y = 3, rule = Life o$ obo$ 2o!
Below is a list of script commands by category:
Parameter conventions
The parameter conventions for the commands below are listed here.
Click on "Expand" to the right to view the Parameter conventions.
Parameter | Description |
A|B | either A or B |
(A) | A is optional |
A* | zero or more A |
A+ | one or more A |
<1..3> | integer range |
<1.0..3.0> | decimal range |
General
These commands are used to mark sections in the pattern comments that contain script commands.
Click on "Expand" to the right to view the General commands.
Command | Description |
[[ | start script section |
]] | end script section |
SUPPRESS | suppress overwrite warning |
Playback
These commands control pattern playback including whether to start automatically, whether to stop or loop, and playback speed. Also in this section are commands controlling various playback settings.
Click on "Expand" to the right to view the Playback commands.
Command | Description |
AUTOSTART (OFF) | start play automatically |
LOOP <1..>|OFF | loop at generation |
STOP <1..>|OFF | stop at generation |
GPS <1..60> | set steps per second |
STEP <1..64> | set generations per step |
HARDRESET | always use hard reset |
VIEWONLY | disable playback |
NOSTEPBACK | disable step back |
NOREPORT | disable stop messages |
NOPERFWARNING | disable performance warning |
NOTHROTTLE | disable playback throttling |
EXCLUSIVEPLAY | starting playback pauses others |
IGNOREEXCLUSIVE | ignore other pause requests |
Camera
These commands control the camera. You can specify the position, zoom, and rotation of the camera. You can also specify camera motion to have it track in a particular direction to follow a moving pattern.
Click on "Expand" to the right to view the Camera commands.
Command | Description |
ANGLE <0..359> | set camera angle |
X <-4096..4096> | set camera x position |
Y <-4096..4096> | set camera y position |
ZOOM <-16.0..64.0> | set camera zoom |
Z | same as ZOOM |
AUTOFIT (OFF) | fit pattern to display |
HISTORYFIT (OFF) | autofit uses pattern history |
STATE1FIT (OFF) | autofit only uses state 1 |
TRACK X Y | camera tracking |
X | horizontal speed cells/gen |
Y | vertical speed cells/gen |
TRACKBOX E S W N | camera box tracking |
E | east edge speed cells/gen |
S | south edge speed cells/gen |
W | west edge speed cells/gen |
N | north edge speed cells/gen |
TRACKLOOP P X Y | camera tracking with loop |
P | period |
X | horizontal speed cells/gen |
Y | vertical speed cells/gen |
Waypoints
These commands allow you to setup a list of Waypoints for the camera to follow during playback. For each waypoint you can specify a camera position (with a subset of the Camera commands), playback speed (with a subset of the Playback commands) and then a target generation by which you want the camera to reach that position.
Click on "Expand" to the right to view the Waypoint commands.
Command | Description |
T <0..> | waypoint at generation |
PAUSE <0.0..> | pause for time |
LINEAR ALL|X|Y|ZOOM | linear motion |
BEZIER ALL|X|Y|ZOOM | bezier motion (default) |
TIME | save timing at waypoint start |
Points of Interest
These commands allow you define a set of static Points of Interest at locations on the grid. Once defined you can jump the camera to any POI via buttons on the UI or keyboard shortcuts. You can also specify an action at each POI like starting or stopping playback.
Click on "Expand" to the right to view the Point of Interest commands.
Command | Description |
POI | define point of interest |
POIT <0..> | start POI at generation |
POIRESET | reset generation at POI |
POIPLAY | start playback at POI |
POISTOP | stop playback at POI |
POITRANS <0..200> | set POI transition speed |
<command>|ALL INITIAL | use initial value for POI |
"<string>" | define message |
POIADDLABELS | add Labels as POIs |
Annotations
These commands allow you to annotate the pattern with Labels, Arrows, Polylines and Polygons. You can specify annotation size, colour and motion. You can also specify at which zooms and generations annotations appear and disappear.
Click on "Expand" to the right to view the Annotation commands.
Command | Description |
LABEL X Y ZOOM | define label at position |
(MAXZOOM) (FIXED) | ... zoom range and fixed position |
"<string>" | ... label text |
LABELSIZE <4..128> | define label font size |
(FIXED) | ... optionally fix size |
LABELALPHA <0.0..1.0> | define label font alpha |
LABELT <0..> <0..> <0..> | generation range / fade |
LABELANGLE <0..359> | label angle |
(FIXED) | ... optionally fix angle |
LABELTARGET X Y D|OFF | label target and distance |
LABELTRACK DX DY|FIXED | label move per generation |
ARROW X1 Y1 X2 Y2 ZOOM | define arrow at position |
(MAXZOOM) (FIXED) | ... zoom range and fix position |
ARROWSIZE <1..64> <0.0..1.0> | line width and head multiple |
ARROWALPHA <0.0..1.0> | define arrow alpha |
ARROWT <0..> <0..> <0..> | generation range / fade |
ARROWANGLE <0..359> | arrow angle |
(FIXED) | ... optionally fix angle |
ARROWTARGET X Y D|OFF | arrow target and distance |
ARROWTRACK DX DY|FIXED | arrow move per generation |
POLYLINE X1 Y1 X2 Y2 .. ZOOM | define outline polygon |
(MAXZOOM) (FIXED) | ... zoom range and fix position |
POLYFILL X1 Y1 X2 Y2 .. ZOOM | define filled polygon |
(MAXZOOM) (FIXED) | ... zoom range and fix position |
POLYSIZE <1..64> | line width |
POLYALPHA <0.0..1.0> | define polygon alpha |
POLYT <0..> <0..> <0..> | generation range / fade |
POLYANGLE <0..359> | polygon angle |
(FIXED) | ... optionally fix angle |
POLYTARGET X Y D|OFF | polygon target and distance |
Display
These commands control the various display settings including width and height of the LifeViewer window, whether grid lines are displayed, and how cells are drawn.
Click on "Expand" to the right to view the Display commands.
Command | Description |
WIDTH <560..4096> | set LifeViewer width |
HEIGHT <240..4096> | set LifeViewer height |
POPUPWIDTH <560..4096> | set popup width |
POPUPHEIGHT <240..4096> | set popup height |
TITLE "<string>" | set popup window title |
#B | program build number |
#N | pattern name |
#O | pattern originator |
#R | rule name |
#A | rule alias |
#T | program title |
#0..9 | saved timing as average fps |
## | # symbol |
LAYERS <1..10> | set number of layers |
DEPTH <0.0..10.0> | set layer depth |
GRID (OFF) | display gridlines |
GRIDMAJOR <0..16> | set major grid line interval |
AGESTATES <0..63> | number of age states to draw |
HISTORYSTATES <0..63> | number of history states to draw |
STARS (OFF) | display stars |
HEXCELLS | hexagonal cells for hexagonal grid |
TRIANGULARCELLS | triangular cells for triangular grid |
SQUARECELLS | square cells for hexagonal or triangular grid |
CELLBORDERS | display cell borders |
NOGUI | disable menus and hotkeys |
AUTOHIDEGUI | hide menus during playback |
SHOWTIMING | show timing information |
EXTENDEDTIMING | extended timing information |
SHOWGENSTATS | show generation statistics |
SHOWINFOBAR | show information bar |
RAINBOW | use rainbow colours |
Thumbnails
These commands allow you to specify that LifeViewer starts as a thumbnail. You can also specify whether it expands inline or launches into a separate window when clicked or tapped.
Click on "Expand" to the right to view the Thumbnail commands.
Command | Description |
THUMBNAIL (OFF) | start at 1/4 size |
THUMBSIZE <2..4> | set thumbnail divisor |
THUMBLAUNCH (OFF) | thumbnail launches viewer |
THUMBZOOM <-16.0..64.0> | set thumbnail zoom |
THUMBSTART | start playback on thumbnail expand |
Population Graph
These commands allow you to customize the Population Graph and have it enabled by default or completely disabled.
Click on "Expand" to the right to view the Population Graph commands.
Command | Description |
GRAPH | display population graph |
GRAPHOPACITY <0.0..1.0> | population graph opacity |
GRAPHPOINTS | population graph use points |
NOGRAPH | disable population graph |
Colours
These commands allow you to specify the colour of cells, the grid lines, selections, the population graph, annotations and the UI.
Click on "Expand" to the right to view the Colour commands.
Command | Description |
THEME <0..19>|name | set theme |
name = CUSTOM | set custom theme |
COLOR BACKGROUND R G B | set theme background |
COLOR ALIVE R G B | set theme alive color |
COLOR ALIVERAMP R G B | set theme alive ramp |
COLOR DEAD R G B | set theme dead color |
COLOR DEADRAMP R G B | set theme dead ramp |
COLOR DYING R G B | set theme dying color |
COLOR DYINGRAMP R G B | set theme dying ramp |
COLOR BOUNDARY R G B | set boundary color |
COLOR <0..1> R G B | set state color |
COLOR BOUNDED R G B | set bounded color |
COLOR SELECT R G B | set select color |
COLOR PASTE R G B | set paste color |
COLOR ADVANCE R G B | set advance color |
COLOR GRID R G B | set grid color |
COLOR GRIDMAJOR R G B | set grid major color |
COLOR STARS R G B | set star color |
COLOR TEXT R G B | set waypoint message color |
COLOR ERROR R G B | set error message color |
COLOR GRAPHBG R G B | set graph background color |
COLOR GRAPHAXIS R G B | set graph axis color |
COLOR GRAPHALIVE R G B | set graph alive color |
COLOR GRAPHBIRTH R G B | set graph birth color |
COLOR GRAPHDEATH R G B | set graph death color |
COLOR LABEL R G B | set label text color |
COLOR ARROW R G B | set arrow line color |
COLOR POLY R G B | set polygon color |
COLOR UIFOREGROUND R G B | set UI foreground color |
COLOR UIBACKGROUND R G B | set UI background color |
COLOR UIHIGHLIGHT R G B | set UI highlight text color |
COLOR UISELECT R G B | set UI selected color |
COLOR UILOCKED R G B | set UI locked color |
COLOR UIBORDER R G B | set UI border color |
COLOUR | same as COLOR |
Pattern
These commands allow you programatically paste cells onto the grid during playback. This can be used for glider injection. Other settings including the grid size and whether to automatically kill escaping gliders are also here.
Click on "Expand" to the right to view the Pattern commands.
Command | Description |
XOFFSET <-4096..4096> | set pattern x offset |
YOFFSET <-4096..4096> | set pattern y offset |
DELETERANGE <1..16> | set boundary delete range |
NOCOPY | disable pattern source copy |
NOSOURCE | hide pattern source |
MAXGRIDSIZE <9..14> | set maximum grid size 2^n |
RECIPE name X Y (<1..>)+ | create a named recipe |
RLE name rle | create a named rle |
(X Y) (TRANS) | ... X Y and transformation |
IDENTITY | identity |
FLIP | flip |
FLIPX | flip X |
FLIPY | flip Y |
SWAPXY | swap X and Y |
SWAPXYFLIP | swap X and Y and flip |
RCW | rotate clockwise |
RCCW | rotate counter-clockwise |
PASTE name|rle (X Y) | paste rle at optional X Y |
(TRANS) | ... optional transformation |
PASTET <0..> | set paste generation |
(recipe|<1..>+)* | ... optional delta list |
PASTET EVERY <1..> | set paste interval |
(<0..> (<1..>)) | ... optional start and end |
PASTEDELTA X Y | set position delta for PASTET EVERY |
PASTEMODE <0..15>|mode | set paste mode |
0 0000 ZERO 1 0001 AND | |
KILLGLIDERS | suppress escaping gliders |
Randomize
These commands allow you to specify parameters for random pattern and rule generation.
Click on "Expand" to the right to view the Randomize commands.
Command | Description |
RANDOMIZE | create random pattern |
RANDSEED <string> | set random seed |
RANDWIDTH <1..1024> | set random pattern width |
RANDHEIGHT <1..1024> | set random pattern height |
RANDFILL <1..100> | set random pattern fill percentage |
RANDCHANCE FIXED | keep rule fixed |
RANDCHANCE <item> <0..100> | set percentage chance for <item> |
ALL | all conditions |
B | all birth conditions |
S | all survival conditions |
B<0..n> | specified birth condition |
S<0..n> | specified survival condition |
Colours
LifeViewer supports colour names that can be used in place of R G B values for relevant script commands.
For example: [[ COLOUR ALIVE Green ]]
Click on "Expand" to the right to view the list of colour names and values.
AliceBlue | 240 | 248 | 255 | |
AntiqueWhite | 250 | 235 | 215 | |
Aqua | 0 | 255 | 255 | |
Aquamarine | 127 | 255 | 212 | |
Azure | 240 | 255 | 255 | |
Beige | 245 | 245 | 220 | |
Bisque | 255 | 228 | 196 | |
Black | 0 | 0 | 0 | |
BlanchedAlmond | 255 | 235 | 205 | |
Blue | 0 | 0 | 255 | |
BlueViolet | 138 | 43 | 226 | |
Brown | 165 | 42 | 42 | |
BurlyWood | 222 | 184 | 135 | |
CadetBlue | 95 | 158 | 160 | |
Chartreuse | 127 | 255 | 0 | |
Chocolate | 210 | 105 | 30 | |
Coral | 255 | 127 | 80 | |
CornflowerBlue | 100 | 149 | 237 | |
Cornsilk | 255 | 248 | 220 | |
Crimson | 220 | 20 | 60 | |
Cyan | 0 | 255 | 255 | |
DarkBlue | 0 | 0 | 139 | |
DarkCyan | 0 | 139 | 139 | |
DarkGoldenRod | 184 | 134 | 11 | |
DarkGray | 169 | 169 | 169 | |
DarkGreen | 0 | 100 | 0 | |
DarkKhaki | 189 | 183 | 107 | |
DarkMagenta | 139 | 0 | 139 | |
DarkOliveGreen | 85 | 107 | 47 | |
DarkOrange | 255 | 140 | 0 | |
DarkOrchid | 153 | 50 | 204 | |
DarkRed | 139 | 0 | 0 | |
DarkSalmon | 233 | 150 | 122 | |
DarkSeaGreen | 143 | 188 | 143 | |
DarkSlateBlue | 72 | 61 | 139 | |
DarkSlateGray | 47 | 79 | 79 | |
DarkTurquoise | 0 | 206 | 209 | |
DarkViolet | 148 | 0 | 211 | |
DeepPink | 255 | 20 | 147 | |
DeepSkyBlue | 0 | 191 | 255 | |
DimGray | 105 | 105 | 105 | |
DodgerBlue | 30 | 144 | 255 | |
FireBrick | 178 | 34 | 34 | |
FloralWhite | 255 | 250 | 240 | |
ForestGreen | 34 | 139 | 34 | |
Fuchsia | 255 | 0 | 255 | |
Gainsboro | 220 | 220 | 220 | |
GhostWhite | 248 | 248 | 255 | |
Gold | 255 | 215 | 0 | |
GoldenRod | 218 | 165 | 32 | |
Gray | 128 | 128 | 128 | |
Green | 0 | 128 | 0 | |
GreenYellow | 173 | 255 | 47 | |
HoneyDew | 240 | 255 | 240 | |
HotPink | 255 | 105 | 180 | |
IndianRed | 205 | 92 | 92 | |
Indigo | 75 | 0 | 130 | |
Ivory | 255 | 255 | 240 | |
Khaki | 240 | 230 | 140 | |
Lavender | 230 | 230 | 250 | |
LavenderBlush | 255 | 240 | 245 | |
LawnGreen | 124 | 252 | 0 | |
LemonChiffon | 255 | 250 | 205 | |
LightBlue | 173 | 216 | 230 | |
LightCoral | 240 | 128 | 128 | |
LightCyan | 224 | 255 | 255 | |
LightGoldenRodYellow | 250 | 250 | 210 | |
LightGray | 211 | 211 | 211 | |
LightGreen | 144 | 238 | 144 | |
LightPink | 255 | 182 | 193 | |
LightSalmon | 255 | 160 | 122 | |
LightSeaGreen | 32 | 178 | 170 | |
LightSkyBlue | 135 | 206 | 250 | |
LightSlateGray | 119 | 136 | 153 | |
LightSteelBlue | 176 | 196 | 222 | |
LightYellow | 255 | 255 | 224 | |
Lime | 0 | 255 | 0 | |
LimeGreen | 50 | 205 | 50 | |
Linen | 250 | 240 | 230 | |
Magenta | 255 | 0 | 255 | |
Maroon | 128 | 0 | 0 | |
MediumAquaMarine | 102 | 205 | 170 | |
MediumBlue | 0 | 0 | 205 | |
MediumOrchid | 186 | 85 | 211 | |
MediumPurple | 147 | 112 | 219 | |
MediumSeaGreen | 60 | 179 | 113 | |
MediumSlateBlue | 123 | 104 | 238 | |
MediumSpringGreen | 0 | 250 | 154 | |
MediumTurquoise | 72 | 209 | 204 | |
MediumVioletRed | 199 | 21 | 133 | |
MidnightBlue | 25 | 25 | 112 | |
MintCream | 245 | 255 | 250 | |
MistyRose | 255 | 228 | 225 | |
Moccasin | 255 | 228 | 181 | |
NavajoWhite | 255 | 222 | 173 | |
Navy | 0 | 0 | 128 | |
OldLace | 253 | 245 | 230 | |
Olive | 128 | 128 | 0 | |
OliveDrab | 107 | 142 | 35 | |
Orange | 255 | 165 | 0 | |
OrangeRed | 255 | 69 | 0 | |
Orchid | 218 | 112 | 214 | |
PaleGoldenRod | 238 | 232 | 170 | |
PaleGreen | 152 | 251 | 152 | |
PaleTurquoise | 175 | 238 | 238 | |
PaleVioletRed | 219 | 112 | 147 | |
PapayaWhip | 255 | 239 | 213 | |
PeachPuff | 255 | 218 | 185 | |
Peru | 205 | 133 | 63 | |
Pink | 255 | 192 | 203 | |
Plum | 221 | 160 | 221 | |
PowderBlue | 176 | 224 | 230 | |
Purple | 128 | 0 | 128 | |
RebeccaPurple | 102 | 51 | 153 | |
Red | 255 | 0 | 0 | |
RosyBrown | 188 | 143 | 143 | |
RoyalBlue | 65 | 105 | 225 | |
SaddleBrown | 139 | 69 | 19 | |
Salmon | 250 | 128 | 114 | |
SandyBrown | 244 | 164 | 96 | |
SeaGreen | 46 | 139 | 87 | |
SeaShell | 255 | 245 | 238 | |
Sienna | 160 | 82 | 45 | |
Silver | 192 | 192 | 192 | |
SkyBlue | 135 | 206 | 235 | |
SlateBlue | 106 | 90 | 205 | |
SlateGray | 112 | 128 | 144 | |
Snow | 255 | 250 | 250 | |
SpringGreen | 0 | 255 | 127 | |
SteelBlue | 70 | 130 | 180 | |
Tan | 210 | 180 | 140 | |
Teal | 0 | 128 | 128 | |
Thistle | 216 | 191 | 216 | |
Tomato | 255 | 99 | 71 | |
Turquoise | 64 | 224 | 208 | |
Violet | 238 | 130 | 238 | |
Wheat | 245 | 222 | 179 | |
White | 255 | 255 | 255 | |
WhiteSmoke | 245 | 245 | 245 | |
Yellow | 255 | 255 | 0 | |
YellowGreen | 154 | 205 | 50 |
Info
LifeViewer engine information and details about the currently loaded pattern can be found by pressing 'I', or clicking the Info button under Help.
References
- ↑ Chris Rowett (January 26, 2019). Re: Pattern viewer for forum threads (discussion thread) at the ConwayLife.com forums
- ↑ Chris Rowett (January 26, 2019). Re: Pattern viewer for forum threads (discussion thread) at the ConwayLife.com forums
- ↑ Chris Rowett (December 20, 2019). Re: Pattern viewer for forum threads (discussion thread) at the ConwayLife.com forums
- ↑ Chris Rowett (October 15, 2019). Re: Pattern viewer for forum threads (discussion thread) at the ConwayLife.com forums
- ↑ https://www.conwaylife.com/forums/viewtopic.php?f=3&t=1622&p=75700#p75775
External links
- LifeViewer at the Life Lexicon
Forum threads
- LifeViewer - Life simulator in HTML5 (discussion thread) at the ConwayLife.com forums
- Pattern viewer for forum threads (discussion thread) at the ConwayLife.com forums