Field Life

Particle life as a grid of concentrations

tl;dr

  • A cellular automaton on a grid
  • Every cell holds a concentration of each colour
  • A matrix says which colours attract or repel each other
  • Mass only moves between neighbouring cells, so each colour keeps its total

Prior work

Particle life

A 2D space
Particles
of several colours
a min and max radius of influence
within the min radius, every particle repels
an attraction or repulsion towards every colour
one number for every pair of colours: the matrix
the matrix reparametrises the simulation
each particle also has a velocity
forces push the velocity on every update
More particles
the matrix behind it
another matrix
and another
More colours, more particles

MaCE mass-conserving cellular automata · Papadopoulos & Guichard (2025)

A grid of cells
each cell has some value
at each time step we compute a delta: how much we want to change that value, from local information
in the MaCE paper this delta is called the affinity, A
the affinities are normalised with a softmax over each cell's 3×3 neighbourhood
β sets how picky: low spreads the mass evenly, high sends it to the highest A
and each cell gets a contribution from the cells around it
every cell does this, all at once
mass only moves, so the total never changes
A can be anything: here, mass is drawn to nearby mass and to a drifting wave
\( \displaystyle \text{share}_{\,j} \;=\; \frac{e^{\beta A_j}}{\sum_{k \,\in\, 3\times3} e^{\beta A_k}} \)

Field Life

A grid
one channel per particle colour
each cell holds a value in every channel
blended additively
blended by dominance
each channel has a kernel: bells over distance, normalised to sum to 0
two knobs per bell: its height a and its width σ
and there is an interaction matrix
convolving: how much of each colour is around, counted by its kernel
red's row of the matrix: pulled towards (+) or pushed from (−) each colour
summed: where red wants to go
repel needs crowding: a tight blur G of all the mass, any colour
force scales that; repel pushes mass out of crowded cells, whatever their colour
MaCE moves the mass along A; β sets how sharply
\( \displaystyle K(r) = \sum_i a_i\, e^{-\left(\frac{r/R}{\sigma_i}\right)^{2}} \qquad a = (1,\,-6.25) \quad \sigma = (0.354,\,0.141) \)
\( \displaystyle U_d \;=\; K_d \ast \rho_d \)
\( \displaystyle M_{\text{red},d}\; U_d \)
\( \displaystyle \sum_d M_{cd}\, U_d \)
\( \displaystyle \text{crowd} \;=\; \sum_d G \ast \rho_d \qquad G\!:\ \text{a Gaussian, width } 0.22\,R \)
\( \displaystyle A_c \;=\; F \sum_d M_{cd}\, U_d \;-\; \text{repel} \sum_d G \ast \rho_d \)
\( \displaystyle \text{share}_{\,j} \;=\; \frac{e^{\beta A_{c,j}}}{\sum_{k \,\in\, 3\times3} e^{\beta A_{c,k}}} \qquad \beta = 3 \)

Field Life

What else can we do with it?

Training a lizard

the lizard emoji, as the fit saw it
the target: a picture
the start: a disc holding a fixed amount of each of 12 colours
run it, compare with the picture, backpropagate through every step
it learns the matrix, force, repel, β, the seed and every kernel
each kernel: 20 bells, each at its own distance, with angular lobes
fitted on roughly the first 1000 steps; past that, nothing keeps it in shape
all 12 colours: the lizard is three of them, the rest is the scaffold that grows it
\( \displaystyle \text{loss} = \big\| \rho(t) - \text{picture} \big\|^2 \)
\( \displaystyle K(r,\theta) = \sum_{i=1}^{20} a_i\, e^{-\left(\frac{r/R \,-\, \mu_i}{\sigma_i}\right)^{2}} \cos(m_i\theta + \varphi_i) \)
The live field needs this folder served over http, e.g. python3 -m http.server