Forces at Play
Forces at Play is a cellular automaton I created in 2022. (If you don’t know what a cellular automaton is, you can think of it as a simple sandbox game where you build machines out of basic units called “cells”.) The source code is available on Github.
Forces at Play was inspired by a game called Cell Machine by Sam Hogan. In Cell Machine, you only have a fixed number of cells to work with, and you must arrange them to accomplish a specific goal. However, Forces at Play is more open-ended; you can place as many cells as you want, and you can do whatever you want with them. I also added two types of cell that don’t exist in Cell Machine: shifters and destroyers.
There are nine kinds of cell:
Empty (white square)
Pusher (blue square with arrow)
Moves in the direction of the arrow, pushing the cells in front of it, unless blocked by a wall or a board.
Box (black square with white square inside it)
Doesn’t do anything on its own, but can be moved by other cells.
Wall (solid black square)
Cannot be moved by other cells.
Board (black square with parallel lines)
Boards with horizontal lines can move horizontally but not vertically; boards with vertical lines can move vertically but not horizontally.
Destroyer (red square with parallel lines)
Adjacent cells in the direction of the lines are safe; adjacent cells perpendicular to the lines are deleted.
Shifter (purple square with arrow)
Similar to the pusher, but doesn’t move itself, only the cells in front of it.
Rotator (green square with arc)
Rotates the adjacent cells. There are two types of rotator: the one with a “C” rotates things counterclockwise, and the one with a “Ɔ” rotates things clockwise.
Generator (yellow square with arrow)
Creates copies of the cell behind it.
- Click: select cell
- Click and drag: select region
- Arrow keys: move selected region
- W: create wall
- E: create box
- F: create/edit board
- D: create/edit destroyer
- R: create/edit rotator
- Q: create/edit pusher
- S: create/edit shifter
- A: create/edit generator
- Backspace or tab: delete region
- Space: start/stop automaton
- Digits 1-5: change animation speed (1 is slowest, 5 is fastest)
Copy and paste
You can copy and cut regions of the grid using ctrl-C and ctrl-X respectively. Use ctrl-V to paste the copied pattern.
When you copy a pattern, a text representation of that pattern is saved to your
device’s clipboard. This allows you to save and import patterns by converting
them into text and vice versa. For example, try pasting the following text
onto the canvas:
A spaceship is a pattern that moves across the screen in a regular manner. Spaceships are classified by their speed, measured as a fraction of the “speed of light” (the speed at which pushers move, denoted by the letter c). For example, a spaceship that moves forward by two cells every five steps is said to have a speed of 2c/5.
|c/6, c/8, c/10, …||PFre1zZ1z|
A stacker is a pattern that uses a generator to create a box every N generations. The number N is called the “period” of the stacker.
|p8, p10, p12, …||2r;;r;2rQ;3eG;3s;3w|
|p9, p11, p13, …||2z;;2r;;Z;2rQ;3eG;3s;3w|
A gun is a pattern that creates a pusher every N generations. If the pushers always go in the same direction, the number N is called the “period”. If the pushers alternate direction, the number N is called the “mod” or the “half-period”. Guns that output more complex spaceships, rather than just pushers, can also be constructed.
|p5, p7, p9, …||2R;R;1P1Rw;1A|
|p6, p10, p12, …||wR;2P1Rw;2A|
|m4, m6, m8, …||2S1S;;wr1P1Rw;3A|
|m7, m9, m11, …||RDr;;rAR;1P;1A|
A rake is a moving gun, or a spaceship that shoots pushers. Rakes which shoot backward are called “backrakes”.
|double barrel c/4 rake||5Pzrf;PZrfA|
|c/4 side rake||2Pfrez;PAeFrez|
|4-bit binary counter||r1R;