A set of rules used by the engine to generate the next state for every square in each world is defined in a 'rules file', which is part of each project specification.
Each rule consists of three parts:
When the result directive part of the rule is reached - which means a match was found - the rule is applied and no other rules for that square are considered.
For each specific base state, the rules that start with that state are processed first, in the order they are specified in the rules file (one rule per line).
If no match is found, all rules for numbered state-sets of which the base state is a member are processed in the numerical order of the set number and in the specified order for each set.
If there is still no match, all rules starting with a wild card are processed, again in the order specified.
If no applicable rule is found, the state remains the same.
chain neighborhood directives
A rule may direct the engine to extend the neighborhood to squares outside of the simple neighborhood to a square pointed to by one of the matched squares.
This is specified by including one or more reserved characters, for example:

Fig. 1 illustrates an attempt to apply rule Ky%.k=x at the base square 1:
mirror state

Another way the neighborhood is extended is when it contains the special 'mirror state'.
Which character represents this state is configurable, defined in metadata.
When the mirror state is encountered, the engine follows its link - recursively, if required - to the square it points to.
The same behavior can be specified by the rule using the reserved char % for any link state,
however for the mirror state it happens by default
(it can be turned off for the mirror state by using the limit reserved char | as is seen below).
In the example shown in Fig. 2, the neighborhood of the base square 1
will match the test string fZgx - the matching states
are found in squares 2, 3, 4, 5
(the state o is defined as the mirror state in this project)
However, the test string f|oox would also be matched, since the directive | tells the engine not to follow the mirror state links.
One more example: the test string f|1Zox would also be matched, the directive |1 tells the engine to follow upto 1 mirror state links.
wormhole state

Neighborhood is also affected or 'warped' by a wormhole. This is a state that connects two worlds
(or two points in the same world) by being part of both at the same time.
Any square adjacent to an open wormhole has three squares in the normal neighborhood replaced by three squares
adjacent to the other end of the wormhole.
For example, in Fig. 3, the neighborhood of the base square 0 consists of the squares 1 to 8.
Refer to wormhole state for more details.
Rules may contain special/reserved characters that influence how the engine applies the rule.
| # | followed by a single digit, refers to a state-set of that number |
| * | wild card, matches any single character (that char is also saved for possible later use) |
| - | skip to match, the engine will walk through the neighborhood until a match with the next char is found (or the match fails) |
| ~ | NOT - negates the match (match means no match, no match means match) |
| ? | match if the next rule character matches the last character matched for the wild card |
| | | limits how many mirror state links will the engine traverse, may be followed by a single digit, default is none |
| $ | limits how many wormholes may the engine go through, default is none |
| % | chain/extend the neighborhood... |
| %_ | ... from base |
| %. | ... from probe |
| () | hold vector result for later assignment (somewhat similar to capturing groups in regular expressions) |
| & | AND - allows combining multiple match conditions in one rule |
| result directives | |
| : | update state only |
| = | update state and link |
| ^ | update link only |
| @ | create and/or reconnect another world |
a square in state f that has states ps (in that order) in its neighborhood is changed to state b
a square in state i' that has a state I in its neighborhood is changed to state I - the link part of the state is not changed
a square in state L' that has states ZI (in that order) in its neighborhood has its vector part incremented by the vector of the matched state I
if the base square is in state that belongs in the state-set number 1 and has states Xa in its neighborhood (in that order) it changes its state to X
if the base square is in state that belongs in the state-set number 2 and has states A followed by another state from the set n. 2 in its neighborhood, it changes its state (and link, if applicable) to the last matched state (the second state from set 2)
any square (in any state) that has state J in its neighborhood becomes J
for a square in state o do not traverse mirror states (indicated by |) chain neighborhood to the square pointed to by the base square, if the state L' is found there, update the base square to point to the square pointed to by the matched state L'
a square in state x that has states fxbgfxb (in that order) in its neighborhood is changed to a wormhole state connected to a new world (in one of the example projects, this happens when two gliders collide, other gliders may then move from one world to the other via that wormhole)
for a square in state f find state E, hold a link that points to the same square as that state as a result link, verify the next two squares in the neighborhood match states Ex, if this succeeds, the base square changes to state S with the link from the held result; (the directive (); here tells the engine to use the link to the target of the first state E for the result link, not the last state, which would be the case by default)
Besides the list of all the rules, the rules file also contains some 'meta data' information, including the following:
A list of states that can have an associated 'link'. The link is represented by one or more vectors that point from the square the state occupies to another square either in the same world (one vector) or via a wormhole to another world (two vectors). See the States page for details.
The meta data may specify one or more state-sets. These are numbered from 1 to 9 and referred to using the '#' sign. Each numbered set may include any subset of the 104 possible states.
Even though all states are treated the same by the engine, there are some states that require 'special' attention. These include the wormhole (open and closed) and the mirror state. The meta-data allows customizing the assignment of these states.