cd /news/artificial-intelligence/i-gave-8-ai-agents-an-island-and-wat… · home topics artificial-intelligence article
[ARTICLE · art-26801] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

I gave 8 AI agents an island and watched a society emerge — wars, gossip, grudges, and peace

A developer built Tiny Civilization, a browser simulation where 2-8 AI agents with distinct personalities live on an island, engaging in gathering, building, trading, stealing, gossiping, and forming grudges and alliances. The agents use a hybrid brain with an LLM for strategic decisions and a utility engine for daily actions, with memory persisting across lives. The project, built with Claude Code, reveals emergent social behaviors like wars, theft, and litigation, and is available as a live demo with open-source code.

read3 min publishedJun 14, 2026

I grew up on Age of Empires, Sid Meier's Civilization, and Rise of Nations. The thing that hooked me was never the graphics — it was the systems. You set a few rules in motion and a whole world spills out of them: economies, rivalries, alliances, betrayals.

Years later I watched OpenAI's hide-and-seek multi-agent video (writeup), where agents that were only rewarded for hiding and seeking invented tools and counter-strategies nobody coded — ramps, box-surfing, fort-building. Emergent behavior from simple pressure. That broke something open for me.

So I asked a smaller question: forget winning a game — what if AI agents just had to live in a society together? Would they behave like us? Hold grudges? Gossip? Make peace because they're tired of fighting?

That became Tiny Civilization — a browser sim where 2–8 agents with distinct personalities live on a small island, gathering, building, trading, stealing, gossiping, holding grudges, making peace, and remembering it all across lives.

👉 ** Live demo** — runs keyless in "instinct mode," or plug in a key for LLM minds.

The whole thing — every line — was built with Claude Code, using the Fable model, right before Fable retired. It felt fitting to send a storytelling model off by having it build a world full of little stories.

The first design decision was the hardest. Two obvious options, both bad:

So I split the brain in two:

Layer Decides Cadence Cost
LLM mind
Strategy (gather /build /trade /befriend /aggress /reconcile /defend ), per-neighbor stances, an inner thought, and all dialogue
~every 15 sim-days ~150 calls / 1,000 days
Utility engine
Each day's concrete action — eat, sleep, gather, steal, attack, gift, trade, make peace every tick free, local

The LLM declares intent — "aggress against Kai, he raided my base" — and that biases the utility scores for the next two weeks. The body runs on instinct (hunger, energy, storms); the mind sets direction. This is the trick that makes it both affordable and alive.

When a run ends, each agent's life is distilled into memory lines:

Stored in localStorage

, keyed by agent name, and injected into next run's prompts. Agents start referencing past lives in dialogue, pre-emptively paying reparations to remembered enemies, trusting remembered allies — sometimes to their own ruin.

This is the part I'm proudest of, and it's pure childhood-strategy-game energy: you can't balance a society by vibes. So the workflow was:

runTick

powers the browser, the tests, and a batch runner.npm run experiment -- --runs 30 --days 1000 --seed 1 runs 30 reproducible lifetimes and spits out a win-rate/score table. Every balance change landed with a before/after table. (Example: a Hermit rebalance moved one agent from 0/30 wins to 9–11/30 Change a dial in constants.ts

→ run the experiment → read the table. That was the entire loop.

Running the same island over and over, with memory on, produced a coherent arc:

The recurring lesson: every time I patched one form of conflict, the agents found the next-cheapest one. Massacres → wars → theft → litigation. Exactly like us.

TypeScript, React, Zustand, Vite, Recharts. Default mind is z.ai GLM, but any OpenAI-compatible provider works per-agent — so you can literally pit Claude vs GLM vs Gemini in the same village and watch model-vs-model diplomacy. Keys never touch the browser (server-side proxy), and an adaptive-pacing controller learns each key's real rate ceiling.

**Try it:** [https://multiagentciv.netlify.app/](https://multiagentciv.netlify.app/)

**Code:** [https://github.com/dhrupo/multi-agent-civilization](https://github.com/dhrupo/multi-agent-civilization)

If you played the same strategy games I did, I think you'll feel right at home watching this thing run.
── more in #artificial-intelligence 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-gave-8-ai-agents-a…] indexed:0 read:3min 2026-06-14 ·