Short description
This article discusses custom neighborhoods in cellular automata, which are variations of the standard neighborhood used in the “Game of Life” cellular automaton. Custom neighborhoods can be created using manual layouts or build templates. Manual layouts involve constructing a binary code to represent the desired neighborhood, while build templates use predesigned patterns to create the neighborhood. Examples of custom neighborhoods are provided, including directional options that create interesting patterns on the outskirts of the standard field, as well as custom templates proposed by enthusiasts. The article concludes by discussing the limitations and difficulties of implementing custom neighborhoods in popular cellular automaton simulators.
directed and user neighborhoods
👾, Habre!
In the past weeks, we’ve been introduced to different variations of alternative neighborhoods – from location accounting in Hensel notation, through alternative location patterns, to weighted neighborhoods. Today we will add a small finishing touch to the theme of the surroundings of the standard field – the location of the user.
In this series, we discuss cellular automata, a discrete model based on a grid of cells that change (or do not change) their state depending on the number of neighbors.
The account of neighbors is determined by the rules established by us. There are many variations of the rules, and they have been systematized into certain changes.
The most popular configuration is “B/S”, or “lifelike”, after the name of the extremely wellknown cellular automaton “Game of Life”, where
B/S
means that in our rule we describe only two parameters – the number of neighbors necessary for the birth of a new cell in an empty cell, and the number of neighbors for the survival of an existing cell.
In each article in the series, we delve deeper into this configuration, adding new options or enhancing existing ones. Sometimes we look at other configurations.
To understand today’s article, it is enough to know that:
 the neighbor search is initially performed in a radius of 1 (8 surrounding cells – ), but we can set another one by adding to the rule Rxwhere x – the radius we need;
 we can change the neighbor search neighborhood template. Initially, Moore’s neighborhood is meant – R to each side (and diagonal) of the cell under consideration – but specifying Nxx we will define a different template, which of course will change the appearance of the rule. Today we continue to expand this part of the rule. Familiarity with previous expansions is not necessary, but you can certainly read them and other expansions for more consistent reading. Links at the end of the material and in the profile.
Custom neighborhoods can be divided into two types – manual layouts and build templates. Let’s start with the first ones.
❯ Manual layouts
This type is supported in the notation via the neighborhood parameter
N@x
where
x
– the code of our location, compiled according to certain rules:
 We construct our location in onedimensional form, sequentially specifying zeros and ones to account for each neighborhood cell. For example, the von Neumann neighborhood for a radius of 2 would look like
00100 01110 11c11 01110 00100
(spaces for reading, construction takes place without them);  We take away the central cell cin this version, it is never taken into account (only if the configuration/implementation does not support the option M in the rule, but it still does not apply to the neighborhood parameter);
 We translate the resulting binary number into the hexadecimal number system. Everything, the code for the notation is ready. For example, with the von Neumann neighborhood and R2 it will
N@23BDC4
.
This is, of course, much shorter than the initial appearance and the related version of the notation in the hanging neighborhood, but for this we sacrifice visibility. To understand what kind of neighborhood is hidden behind the code, we need to expand back the initial representation of the neighborhood. However, it is this option that is supported in the most popular spaceship simulators, and even if you create your own, you will also have to support this format, whatever you do. Or use the notation of weighted neighborhoods, but with unit weights. Also as an option. But let’s move on to the examples.
The directional options built without complete symmetry, which is intuitively suggested, look most interesting on the user’s outskirts.
R2/G2/S46,89/B69/N@839DE7
_{Or NW10000 01110 01011 01111 00111}
– Neighbor search radius. Regulates the neighborhood.
G
is the number of cell states. The minimum is 2 (alive/dead), higher values are responsible for the duration of “aging” of a cell, when it is no longer considered a living neighbor for other cells, but has not yet released a new cell for birth. If correct, it is customary to use in HROT and LtL
C
(Count of states).
M
is a boolean parameter, whether the cell’s own state is taken into account when counting neighbors. HROT does not have this parameter (=always assumed to be 0), but we will keep the option to use this parameter.
S
– values and/or ranges of the number of neighbors necessary for cell survival. Ranges are written with a hyphen (if considering backward compatibility with LtL, a colon and ellipsis can be used or
t
), values and ranges are separated by commas.
B
– completely similar
S
but is responsible for the number of neighbors necessary for the birth of a new cell.
N
– Designation of the neighborhood used. This is exactly what we are talking about today.
/
– separator between rule parameters. The correct notation uses “
,
» (yes, both between parameters and between ranges/values), but there is also a variant without separators between parameters.
Characteristics of the example – Animation duration; [ускорение анимации от 100мс. на фрейм, если есть]; field size; the size and percentage of central filling at the start.
There are many very simple but amusing examples in directed neighborhoods. Like these “drops on the glass”…
^{20 p., 356×356, 300×20%}
R2/G2/S1,3/B2,4/N@3C00
_{NW00000 00000 11011 00000 00000}
… just lines (note the ship at the top of the example)
^{25 p., 356×356, 300×20%}
R4/G3/S/B2/N@1018080000202
_{NW000000000 000000000 000000000 000010000 000101000 000010000 000000000 000000001 000000010}
… conventional guided ships
^{47 p., 178×178, 50×50%}
R3/G3/S/B2/N@E1860001
_{NW0000000 0000000 0011100 0010100 0011000 0000000 0000001}
… more complex spawning shipssteam locomotives
^{49s., speed ×1.5, 356×356, 50×50%}
R2/G3/S0/B3/N@FFD9C4
_{NW11111 11111 01010 01110 00100}
^{44 p., 356×356, 3×100%}
R1/G2/S23/B23/N@4D
_{NW010 001 101}
… and many other structures
^{18s., speed ×1.5, 178×178, 50×20%}
R2/G2/S03/B12/N@891891
_{NW10001 00100 01010 00100 10001 (and here is FC)}
Finally, let’s look at a more familiar, ornamental look.
^{16 p., 356×356, 1×100%; every other frame is cropped to smooth out flickering}
❯ Custom neighborhood templates
Although any other neighborhood can be realized through manual notation
(except for balanced ones, they have their own analogue)
, it is not a complete replacement. The manual border is inconvenient, difficult to perceive, and, most importantly, it is strictly limited to the radius for which it is written. Neighborhood templates are free of these drawbacks. We are already
considered 10 “recognized” neighborhoods
But, since the potential for creating new templates is huge, users did not forget to describe their own.
Of course, trying to remember all the developments is neither possible nor meaningful, so, for example, we will consider only a set of templates proposed by the enthusiast Antonio Sánchez Chinchón, which he described during the implementation of his own cyclic spacecraft simulator.
Moore’s contour
^{View of the neighborhood in radii 14}
The first pattern in this list simply removes the inner cells near the base border. We have already mentioned this and the next two proposed templates in the material on cyclic spacecraft, and now we will look at examples in the HROT configuration.
Rule: (abs(x) == R)  (abs(y) == R)
Marking: Mr
Notation in the notation is exclusively the author’s and, unfortunately, is not supported by popular simulators, however, as well as user templates in general. They can be implemented only in the same simulators, and for use in, for example, Golly and LifeViewer, translations will have to be made to N@/NW under each radius.
^{61 p., 356×356, 50×70%  R3/G3/S920/B4,7/NMr}
^{13 p., 356 356, 1 100%  R3/G3/S26,8,10,12,14,16,18,20,22,24/B12,4,6/NMr}
Von Neumann contour
Similarly to the previous one, the second most popular neighborhood is also modified. At even radii, we can observe the division of the field into parts, depending on the parity.
Rule: abs(x) + abs(y) == R
Marking: Nr
^{24 p., 237 237, 6 100%  R4/G2/S516/B5,1316/NNr}
The behavior of even/odd fields can be supplemented with an odd cyclic grid – so, moving along connected boundaries, the shape will change parity.
^{28 p., 237×237, 100×15%  R4/G3/S411/B69/NNr}
Sshape #1
The first example of a directed pattern.
Rule: ((y < 0) & (x > 0))  ((y > 0) & (x < 0))
Marking: S1
^{48 p., 356×356, 200×2%  R2/G3/S5/B2/NS1}
^{8 p., 356×356, 2×100%  R7/G4/S07/B12/NS1}
Hourglass
Rule: abs(y) > abs(x)
Marking: D1
^{31 p., 712×712, 200×100%  R3/G2/S316/B79/ND1}
^{43 p., 356×356, 200×10%  R3/G4/S3/B46/ND1}
Hourglass remote
Rule: (abs(y) == abs(x))  (abs(y) == R)
Marking: D2
^{15 p., 356×356, 200×20%  R4/G2/S25/B4/ND2}
^{10 p., 178×178, 20×100%  R2/G2/S19/B3/ND2}
Corners
Or “inverted von Neumann neighborhood”.
Rule: abs(y) + abs(x) > R
Marking: C2
^{14 p., 356×356, 8×100%  R4/G4/S19/B840/NC2}
^{30 p., 356×356, 250×25%  R2/G2/S311/B69/NC2}
Tick Mark
A combination of a diagonal cross and a Moore contour.
Rule: (abs(y) == abs(x))  (abs(y) == R)  (abs(x) == R)
Marking: TM
^{26 p., 356×356, 50×5%  R2/G7/S615/B3/NTM}
^{8 p., 356×356, 1×100%  R4/G3/S020/B1,1730/NTM}
Sshape #2
Rule: (x == 0)  (y == R) & (x < 0)  (y = R) & (x > 0)
Marking: S2
^{23 p., 356×356, 50×20%  R4/G2/S/B3/NS2}
^{20 p., 712×712, 2×100%  R2/G2/S15/B1/NS2}
Literally according to one random example per neighborhood.
^{Chess board mod 2 – Nb3 – (x % 2 == 0) & (y % 2 == 0)}
^{8 p., 356×356, 1×100%  R4/G2/S09/B1/Nb3}
^{Von Neumann contour mod 2 – Nrl – (abs(y) + abs(x) == R) & (x % 2 == 0)}
^{40 p., 356×356, 50×95%  R4/G3/S/B2/NNrl}
^{T – NT – (x == 0)  (y == R)}
^{H – NH2 – (y == 0)  (abs(x) == R)}
^{52 p., 356×356, 50×15%  R3/G2/S12/B4/NH2}
^{M – NM2 – (abs(x) == R)  (abs(y) == abs(x)) & (y > 0)}
^{15 p., 356×356, 1×100%  R2/G2/S02,4/B1/NM2}
^{U – NU – (y == R)  (abs(x) == R)}
^{34 p., 356×356, 50×15%  R3/G3/S/B45/NU}
^{Z – NZ – (abs(y) == R)  (y == x)}
^{19 p., 356×356, 20×100%  R6/G3/S0/B56/NZ}
^{Lines – Nln – (x == 0)  (x == R) & (y < 0)  (x == R) & (y > 0)}
^{27 p., 356×356, 50×20%  R3/G2/S1/B3/Nln}
← Previous part

Next part (TBA) →