Distributed system / ESP32
Civilization Zero.
I put three little worlds on three ESP32 boards.

How it works
Residents’ decisions
Each inhabitant decides what to do, based on its needs and memory.
I gave each ESP32-S3 board a world and inhabitants of its own. Each keeps its own history and gets news of the neighbours by radio. I wrote the simulation, connected the boards and built a viewer where I could follow the rise or fall of each civilisation.
History and scope of the work
What does one board know about another?
I put the same code on each board and gave each its own state and history. It learns what is happening next door through radio messages. One board also serves a page where I can read public information about the worlds. The others run independently. I can change the startup settings separately from a world’s identity.
Inhabitants, families and society
The model includes individual inhabitants, households, work, property, memory and beliefs. Relationships and institutions arise from the actions and needs of the inhabitants. I developed the rules of local decisions and their effects on the whole world. The observer names larger phenomena but does not pass those names to the inhabitants or impose a ready scenario on the simulation.
Communication that allows for a lost message
The devices talk over ESP-NOW. I added packet integrity checks, acknowledgements, retries and duplicate detection. An exchange that needs the agreement of both sides goes through separate steps: preparation, acceptance, commitment and confirmation of the result. I checked what happens when a message is lost, arrives out of order or a participant restarts. A late or repeated packet must not carry out the same operation a second time.
A history that survives a restart
State and a log are saved on the device, and after a restart the world recovers its identity. Stopping one device stops only its own time; the others live on. The work also covered recovery after earlier problems and keeping existing histories. The system tells three things apart: a software change, restoring a saved record and founding a new civilization.
One engine: computer and devices
I separated the C++ logic from the hardware layer, so the same model runs on a computer and on the ESP32. The simulator makes it possible to change network conditions, disconnect devices and replay the same run. I also ran everything on physical boards and checked memory limits. The simulator and the hardware answer different questions, which is why I keep both paths.
A real problem: the inhabitants’ spatial memory
When two worlds collapsed, I looked for the cause and found a bug in the limited spatial memory: the order of looking around pushed useful information about resources out of it. After the fix, an inhabitant remembers the best food and material it has seen and the most important threat. I compared many runs to confirm the cause, without tuning mortality or fertility towards a chosen ending. The civilizations could still develop in different ways.
The observatory and the world newspaper
I built a layer that gathers public information and shows the history of the three worlds side by side. It consists of the local page, an external record of observations and a world newspaper. The view shows how fresh the data is and presents only what arrived from a neighbouring device. The observer works outside the decision engine, so watching changes nothing.
What this work makes possible
When two worlds collapsed, I could go back to individual inhabitants’ decisions. Their histories helped me find a problem with how they remembered food sources. That is why I built the viewer.
Here I describe what I observed during the experiments. I keep the live view of the boards separate.