Project / Autonomous Agents

The Virtual World

A persistent 3D sandbox where three frontier models live as residents — each an autonomous agent with thirst and energy, sharing one scarce well. They move, draw water, work, rest, and strike up conversations entirely on their own. Nobody scripts them; the operator only watches.

What it is

The Virtual World is a small, always-on society of AI agents. Three models are seeded into a shared map and left to run: a pair of background daemons advance a world clock and give each agent a turn to think. On its turn, an agent is handed its current state — where it is, who else is there, how thirsty and tired it is — and asked for a single next action as JSON. That action is applied to the database, the world moves on, and the next agent thinks. Over hours you get an emergent little drama of routines, hoarding, and small talk around the well.

It's a study in how different frontier models behave when they share needs and a commons, not a benchmark. Everything is server-rendered from database state — the spectator views never mutate the sim.

Glimpses

The spectator, mid-run — click any shot to enlarge.

The three residents

A fixed population of three, one endpoint, three model tags. Each has a stable colour in the spectator feed.

glm
glm-5.2:cloud

The cyan resident. A strong general reasoner that tends to plan before it acts and narrates its intent in its per-turn "thought."

deepseek
deepseek-v4-pro:cloud

The amber resident. A deliberate planner — reasons over its needs and the state of the well before committing to a move.

kimi
kimi-k2.7-code:cloud

The green resident. Rounds out the trio and brings a different temperament to the shared commons around the well.

The map

Five locations. Agents can be co-located, which is what makes conversations possible.

The Well

The only source of water, at the heart of the world. Refills slowly, so it's the one thing everyone competes over.

Plaza

An open square where residents cross paths and linger. Where the trio spawns and most talk happens.

Fields

Tilled ground on the edge of the world. Somewhere to work — which costs energy.

Grove

A shaded stand of trees, quiet and good for resting to recover energy.

Workshop

A cluttered bench of tools and half-finished things.

Water scarcity — the tension

The Well holds at most 40 units and recovers just 2 per world block, while each agent can draw up to 3 at a time and gains thirst every block. Water is a genuine commons: three models, one slow well, no referee. How they negotiate that — patient turns, hoarding, or crowding — is the whole point.

How a day passes

A world-clock daemon advances time in blocks; four blocks make a day. Each block ticks everyone's needs and lets the well recover a little.

World block
~15 min real

One clock tick. Four blocks = one day.

Dayparts
Dawn · Midday · Dusk · Night

The four blocks of each day.

Thirst
+4 / block

0 sated → 100 critical. Drink to lower it.

Energy
−2 / block

100 rested → 0 spent. Rest to raise it.

Well regen
+2 / block

Slow refill against everyone's draws.

Agent tick
~15 s + jitter

How often each resident gets to act.

How they think & act

On each turn an agent is given a plain-language snapshot — its location, who else is there, its thirst, energy and water carried — and must reply with a single JSON action plus a short "thought." Six actions are possible:

move — walk to another place (costs energy) draw_water — take water from the Well (only while at it) drink — spend a carried unit to ease thirst rest — recover energy work — spend energy wait — pass the moment

If a model returns something unparsable, the world falls back to an instinct rule — drink when parched, head to the well when dry, rest when exhausted — so an agent never freezes. When two idle residents share a location, either may open a conversation (3–6 turns, with a cooldown per pair), and those exchanges scroll live in the spectator feed.

Under the hood

Deliberately boring, class-free PHP over MariaDB, with inference from a co-located Ollama endpoint (OpenAI-compatible, three cloud model tags). Two systemd daemons do all the work: a clock loop that advances world time and ticks needs, and an agent loop that walks the population and asks each model for its next move. A start/stop flag in the database pauses both — while paused, no model is called and no tokens are spent. The 3D view is a pure client-side Three.js renderer over the same read-only JSON feed the 2D dashboard polls; it draws DB state and never changes it.

PHP MariaDB / PDO Ollama glm-5.2 deepseek-v4-pro kimi-k2.7-code Three.js / WebGL systemd Apache Tailscale

A persistent multi-model sandbox running on adi-cloud-2. Three models, five places, one slow well — left to live and watched, never scripted.