Theme: Tokyo Night (Press T)
MIT LICENSE Open Source World Simulation on GitHub →
FLATLAND

Beautiful, emergent & agentic 2D world simulation

The autonomous artificial life ecosystem for the age of agents. Watch geometry live, build, and evolve under immutable natural laws. Developed from Edwin A. Abbott's 1884 classic.

$ curl -fsSL https://raw.githubusercontent.com/longphanmn/flws/main/setup.sh | bash
longphanmn.github.io/flws-web · Day 1044 (Tick 1,251,932 · 481 Alive · 11 Clans)
Live Telemetry
Flatland Live World Simulation
Core Principles

Built for Hackability & Emergence

Flatland is an open playground for multi-agent dynamics, artificial life research, and mathematical modeling.

01 / GEOMETRIC REALITY

Developed from Abbott

Embraces Abbott's core 1884 premise—2D spatial constraints, vertex hierarchies, and generational ascendance—evolving into an authentic autonomous ALife ecosystem.

02 / NATURAL LAWS

Laws Over Fates

God (The Sphere) governs exclusively through universal laws: metabolism, density damping, and seasonal climate cycles. Zero hand of God touches individual fates.

03 / AGENTIC LIVING

Oral Lore & Castes

Organisms form clans, construct houses, stockpile granaries, and elders transmit highest skill masteries to sleeping youth through indoor oral lore.

Morphology & Biomechanics

Geometric Caste Hierarchy

Physical form determines societal role. Side counts govern perception and longevity, while razor apex angles dictate kinetic piercing damage.

θ_min ∈ [10°, 59.5°] · Razor Apex

Isosceles Triangles (Soldiers)

Vanguard · Clan Phalanx · Acute Kinetic Piercing

With two long sides and an acute apex, Isosceles soldiers are natural combatants. Over generations, peaceful lineages undergo generational creep (+0.5° per generation) until promoting to regular Equilateral Artisans.

Vertices (K)
3 (Isosceles)
Apex Angle
10° – 59.5°
Trait Modifier
+15% Stamina
Engineered Ecosystem

Natural Laws & Evolutionary Systems

Flatland is governed by mathematical principles, recurrent neuroevolution, and biological homeostasis calibrated from Spaceland.

01 / NEURAL CONTROLLER 15 Hz Inference

Micro-Elman RNN Architecture

Every organism is powered by a 295-parameter evolvable neural network (16 → 12 → 7). 16 sensory raycasting inputs process obstacle distance, food nutrient scent gradients, kin presence, predator proximity, and internal metabolic starvation ratios. 12 recurrent hidden units provide continuous temporal memory across ticks, enabling complex kiting, forage navigation, and buddy-trust bonding.

295 Evolvable Weights 16 Ray Sensors 12 Recurrent Memory Units 7 Motor Outputs OpenMP Vectorized
02 / MORPHOLOGY & ANNEALING λ(g) → 0

Polar Genomes & Biomechanical Trait Baking

Organisms possess polar coordinate genomes (r_i, φ_i) with vertex counts K ∈ [3, 64]. Green-Gauss and Shoelace formulas dynamically bake rotational inertia (I_zz), area, razor apex angle (θ_min), and kinetic pierce multipliers. Evolutionary Annealing transitions from strict Abbott orthodoxy (λ = 1.0) over 250 generations down to λ → 0, unlocking unconstrained speciation, veteran battle scars, and ancestral starburst coronas.

Shoelace Area & Green-Gauss I_zz Razor Apex Pierce (θ_min) 250-Gen Annealing Decay Battle Veteran Scars Gen 50+ Starburst Coronas
03 / DYNAMIC HOMEOSTASIS ξ Soft-Cap · η Safeguards

Density Soft-Cap Damping (ξ) & Safeguards (η)

Ecosystem equilibrium is maintained through dual automated feedback forces. When approaching carrying capacity (K_cap = 400, ceiling 500), Density Soft-Cap Damping (ξ) activates quadratic birth suppression, +35% crowding metabolic burn, and resource throttling. When population drops to famine thresholds (K_safe = 0.3 × K_cap), Extinction Safeguards (η) grant emergency relief and trigger a divine Genesis Miracle at critical floor K_crit = 12 to reseed the world.

ξ Damping Steepness (6.0) +35% Crowding Strain η Emergency Relief (0.3×) Genesis Miracle Floor (12) Euthanasia Mercy
04 / SOCIAL DYNAMICS Utility AI · Lore

Cognitive Agency, Oral Lore & Clan Geopolitics

Multi-objective utility AI replaces hard-coded trees, scoring actions against survival, duty, and heritable traits (brave, cautious, altruistic, builder). Organisms maintain spatial mental waypoints (home, rich_food, danger). Resting elders transmit highest skill masteries (🌾 Farming, ⚔️ Combat, 🦴 Foraging, 🌿 Healing) to sleeping youth through indoor oral lore, while rival clans rally behind Sacred Avatars, wage Casus Belli wars, or barter via trade caravans.

Multi-Objective Utility AI Spatial Mental Maps Indoor Elder Oral Lore 8 Sacred Avatars Casus Belli & Trade Caravans
God Laws & Profiles

The Sphere World Presets

Universal natural laws calibrated in Spaceland. Inspect how carrying capacity, metabolism, and food abundance shift across presets.

Balance Default
Goldilocks harmony for 200–350 inhabitants.
Sustainable Peace
1,000-day prosperous peace and rich granaries.
Theocracy Spaceland
Divine avatars, glowing temples, and holy synods.
Warlords Combat
Clash of clans, granary raids, and spear phalanxes.
Chaos Extreme
Wildfires, plagues, earthquakes, and predators.
Extinction Collapse
Famine (120 food) and harsh winter tests.
Boom Urban
High reproduction and 800 carrying capacity.
Balance (Default Goldilocks)

Goldilocks harmony tuned for 200–350 inhabitants with carrying capacity 400, gentle wars, rare predation, agriculture, soft-cap damping (ξ), and flourishing multi-generational clans.

Population Target 200 – 350
Food Abundance 380 Units
Carrying Capacity 400
Risk & Volatility Low
Quickstart & Deployment

Clone & Run in 60 Seconds

FastAPI backend, native C OpenMP engine, WebSockets streaming, and React 18 Canvas rendering.

⚡ One-Command Automatic Setup & Launch (Recommended)
# Automatically clones backend & frontend, configures .env, installs dependencies & boots simulation
curl -fsSL https://raw.githubusercontent.com/longphanmn/flws/main/setup.sh | bash

>> Ready at http://localhost:5173 (Web UI) · http://localhost:8000 (Backend API & Living Wiki)
Manual Clone & Run (Linux / macOS)
# Clone backend repository
git clone https://github.com/longphanmn/flws.git
cd flws

# Auto-clones frontend & boots full stack
./run.sh

>> Ready at http://localhost:5173
Docker Compose
# Launch multi-container stack via Docker Compose
cd flws
./run.sh docker

# Or native compose command
docker compose up --build

>> WebSockets listening on :8000
Sound off