For everyone — The mailbox of virtual worlds

Nothing is simpler than a mailbox: you drop in a letter without asking whether the recipient is home, asleep, or away on vacation. The letter waits, neatly stacked, until it is collected. A message queue is the computing version of that mailbox — and it is what lets very large systems talk to each other without stepping on each other's toes.

That is how many everyday services work: bookings, payments, sensors. Each component drops off its message and moves on; each recipient processes at its own pace. If a machine breaks down, the mail waits to be delivered later instead of being lost. Without this mechanism, all it takes is for one element to be slow — or down — for the whole chain to stall or lose information.

For a virtual world like the one Yokul builds, populated by tens of thousands of actors that perceive, decide and act, this mailbox is the nerve of the conversation: every perception is a letter to deliver, every action triggers others. The project first held these queues together by hand, in the good old days of hand-rolled loops, before entrusting the service to open source tools, durable and sized to the real means of a small nonprofit — a mailbox finally built to weather the storms.

And the detail is worth telling right away: the great turning point was not triggered by a book or a training course, but by a conversation. Around 2011, exchanges with the engineers of a large company — about something entirely unrelated to message queues — suddenly revealed what industrial tooling made possible. Ideas also spread by contamination: that is the story the full text tells.

The full text

A virtual world populated by tens of thousands of actors is, at its heart, one immense conversation: each one perceives, decides, acts — and, in doing so, generates new events for the rest of the world. As long as the conversation takes place within a single process, a simple event array and a loop are enough. When it must cross machines, zones and scales, something else is needed: a message queue.

The problem a queue solves

A message queue rests on a simple principle: a producer drops off a message and waits for nothing — a consumer picks it up when it can. Between the two, a broker takes care of storage, ordering, delivery and recovery. The decoupling is threefold:

  • temporal: producer and consumer don't need to be active at the same time;
  • spatial: they can run on different machines — the key to any scaling up;
  • semantic: the producer doesn't know how the message will be processed.

In theory, all of this is solidly charted: the JMS specification (2001) normalized queues and subscription topics (topics) on the Java side, and the reference book Enterprise Integration Patterns (Hohpe & Woolf, 2003) catalogued the integration patterns — publish/subscribe, content-based routing, the dead letter queue for undeliverable messages, aggregation, throttling when the receiver runs too slowly. In the Java ecosystem, Apache ActiveMQ (2004) made these patterns accessible to any project, and later RabbitMQ, Kafka and NATS declined the idea from other angles.

The hand-rolled loop, in the 2000s

The Yokul project did not start out with message brokers (broker, the software that keeps letters waiting for delivery). Back in the 2000s — the era of virtual city populations and the Neverwinter Nights script engine (see the timeline in Vibe coding and the redesign of yokul.org) — the circulation of events already existed, but by hand:

chaque tick de simulation :
  1. collecter les perceptions à distribuer
  2. les déposer dans des files gérées "au cordeau"
     (listes indexées, priorités à la main)
  3. chaque acteur consomme sa file : décide, agit
  4. les actions produisent de nouveaux événements → retour en 1

This setup already embodied the right principles — a single point of passage, per-recipient queues, a controlled order — but its cost exploded as the world grew: who creates the queue? Who purges it? What happens if the producer runs faster than the consumer? One crash, and the conversation stops dead. The queue was the nerve of the world; it held together by a thread.

2011: the loop moves to the industrial mailbox

The spark did not come from the field. Exchanges with the engineers of a large company I was working with at the time — exchanges that were not at all about these topics — brought home the possibilities genuinely opened up by these technologies: an industrialized queue, a distributed cache, computing close to the data. As early as 2011, the existing simulation loop was redesigned and migrated: the hand-rolled queues became queues and subscription topics managed by a durable mailbox, and the world began to converse along a clean scheme:

Aspect Hand-rolled loop (2000s) ActiveMQ-based loop (2011)
Dropping off perceptions in-memory lists, manual purging persisted queue, acknowledgments
Failure resilience one crash wipes everything messages replayed after restart
Scaling a single process consumers distributed across the cluster
Producer surplus loss or freeze of the tick the buffer absorbs, auto-regulated
Multiple listeners recoding every time topics: N subscribers, zero recoding

The tool search was guided by a double constraint: real technical capabilities (active caches, event streams, scaling) and real means — those of a small nonprofit. Hence the focus on open source, self-hosted, sized for Yokul's internal needs rather than for a server-room demonstration.

Messages that move closer to the data

Then came the second step, a conceptual one this time: in a simulation, the queue and the state of the world are inseparable. This led to active caches — those distributed caches that don't just store, but push events when data changes. The details of the chosen platform are covered in Apache Ignite; here, just keep the idea: a container of shared states became a data space that notifies. The producer no longer merely drops a message into a queue — it changes a piece of data, and the data itself warns whoever must react. That is the crossroads between the (classic) message queue and the (modern) data grid: at the crossroads lies living modeling.

perception ──> QUEUE ──> décision ──> action ──┐
     ▲                                          │
     └────────── événements du cache actif ◄───┘
           (état du monde modifié = nouveaux stimuli)

This architecture directly feeds the behavioral modeling described in Behavior Model and, downstream, the actors' memory and decision-making under uncertainty (see Bayesian networks).

And today?

The loop itself has not fundamentally changed in nature since 2011: it has changed engines. The latest is a process engine (workflow engine): instead of each actor chaining its steps alone, the sequence of steps — perceive, decide, act, but also long processes like a journey of several simulated days or a phased construction — is described separately, and an engine unrolls it step by step, remembering where it is and resuming at the right place after an interruption. This engine is a full participant in the loop: it subscribes to the same events, and the trace it leaves allows the simulation to cross interruptions without losing the thread.

Key takeaways

  • A queue decouples the world along three dimensions: time, space, semantics.
  • Principles precede tools: the hand-rolled loop of the 2000s already had the right ideas, without the industrialization.
  • An out-of-domain conversation — with engineers who had nothing to do with the subject — was enough to trigger the 2011 migration. Ideas also spread by contamination.
  • The choice of tools (ActiveMQ, Ignite) was dictated by Yokul's real needs and by the nonprofit's real means: open source, measured.

See also