Overview
A modernization of the 1970s BASIC game "KING" (the old pollution/island-governing game). You run an island for an eight-year term, balancing the treasury -; currency is "Rallods," and each citizen costs 100R/year to keep alive -; against population, land use, crops and pollution. It's the early, all-in-one ancestor of what later became KING: Archipelago.
The whole game is one self-contained HTML file with no client libraries: pure HTML, CSS and vanilla JavaScript, no build step, no frameworks.
Background
The original KING dates to the 1970s -; a BASIC type-in about governing an island and managing pollution. This version keeps that economic-tragedy spine but adds three modern things: real-time competitive multiplayer, AI players with distinct strategies, and a richer ecological model where islands affect each other. A 39 KB standards-aligned Teacher's Guide ships alongside it, with lesson plans and rubrics, so it reads as a classroom-ready environmental-economics sim rather than a toy.
How It Works
Multiplayer is genuinely peer-to-peer. A tiny Node.js WebSocket server handles only the signaling handshake (rooms join via 4-letter codes); after that, game state flows directly over a WebRTC data channel between peers, with Google STUN for NAT traversal. The host is authoritative. If you'd rather, it falls back to fully-offline local hot-seat play.
The AI players come in four flavours, each with its own decision function:
// four AI temperaments, each its own strategy makeBalancedDecisions() // keeps a 30% treasury reserve makeIndustrialistDecisions() // sells land hard, pollutes makeEnvironmentalistDecisions() // protects, plants, cooperates makeAggressiveDecisions() // all-in, then exploit
The environment model is two-tiered. Each island tracks air, water and soil quality, biodiversity and forest health, plus a wildlife sub-model where pollinators quietly gate crop yield. Above that sits a shared archipelago environment -; ocean health, fish stocks, a global temperature -; with pollution that drifts between neighbours. So an opponent's Industrialist AI mechanically degrades your air quality: an emergent tragedy-of-the-commons, with inter-island fish-trading and carbon-offset agreements on top.
Current Status
Archived as a functional, polished game -; the dev summary calls it "fully functional in both single and multiplayer modes." It's the summer-2025 single-file original; the next spring it was refactored into the modular KING: Archipelago (engine + renderers + island art).
- Single-file build with no external dependencies; runs by opening the HTML.
- Online play requires manually running the small signaling server; no public deployment.
- Shipped with a 39 KB Teacher's Guide and a user manual.