{"slug": "i-gave-8-ai-agents-an-island-and-watched-a-society-emerge-wars-gossip-grudges", "title": "I gave 8 AI agents an island and watched a society emerge — wars, gossip, grudges, and peace", "summary": "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.", "body_md": "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.\n\nYears later I watched OpenAI's [hide-and-seek multi-agent video](https://www.youtube.com/watch?v=kopoLzvh5jY) ([writeup](https://openai.com/index/emergent-tool-use/)), 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.\n\nSo 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?\n\nThat 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*.\n\n👉 ** Live demo** — runs keyless in \"instinct mode,\" or plug in a key for LLM minds.\n\nThe 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.\n\nThe first design decision was the hardest. Two obvious options, both bad:\n\nSo I split the brain in two:\n\n| Layer | Decides | Cadence | Cost |\n|---|---|---|---|\nLLM mind |\nStrategy (`gather` /`build` /`trade` /`befriend` /`aggress` /`reconcile` /`defend` ), per-neighbor stances, an inner thought, and all dialogue |\n~every 15 sim-days | ~150 calls / 1,000 days |\nUtility engine |\nEach day's concrete action — eat, sleep, gather, steal, attack, gift, trade, make peace | every tick | free, local |\n\nThe 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.\n\nWhen a run ends, each agent's life is distilled into memory lines:\n\nStored in `localStorage`\n\n, 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.*\n\nThis 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:\n\n`runTick`\n\npowers the browser, the tests, and a batch runner.`npm run experiment -- --runs 30 --days 1000 --seed 1`\n\nruns 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`\n\n→ run the experiment → read the table. That was the entire loop.\n\nRunning the same island over and over, with memory on, produced a coherent arc:\n\nThe recurring lesson: every time I patched one form of conflict, the agents found the next-cheapest one. Massacres → wars → theft → litigation. Exactly like us.\n\nTypeScript, 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.\n\n**Try it:** [https://multiagentciv.netlify.app/](https://multiagentciv.netlify.app/)\n\n**Code:** [https://github.com/dhrupo/multi-agent-civilization](https://github.com/dhrupo/multi-agent-civilization)\n\nIf you played the same strategy games I did, I think you'll feel right at home watching this thing run.", "url": "https://wpnews.pro/news/i-gave-8-ai-agents-an-island-and-watched-a-society-emerge-wars-gossip-grudges", "canonical_source": "https://dev.to/dhrupo/i-gave-8-ai-agents-an-island-and-watched-a-society-emerge-wars-gossip-grudges-and-peace-2edj", "published_at": "2026-06-14 07:30:50+00:00", "updated_at": "2026-06-14 07:58:49.101134+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "generative-ai", "large-language-models", "ai-research"], "entities": ["OpenAI", "Claude Code", "Fable", "z.ai GLM", "Gemini", "Netlify", "GitHub", "dhrupo"], "alternates": {"html": "https://wpnews.pro/news/i-gave-8-ai-agents-an-island-and-watched-a-society-emerge-wars-gossip-grudges", "markdown": "https://wpnews.pro/news/i-gave-8-ai-agents-an-island-and-watched-a-society-emerge-wars-gossip-grudges.md", "text": "https://wpnews.pro/news/i-gave-8-ai-agents-an-island-and-watched-a-society-emerge-wars-gossip-grudges.txt", "jsonld": "https://wpnews.pro/news/i-gave-8-ai-agents-an-island-and-watched-a-society-emerge-wars-gossip-grudges.jsonld"}}