An open-source, distributed metaverse you can run with a single command.
Aetharia is a multiplayer 2D world with procedural terrain, server-side physics, AI agents that build autonomously, and an architecture designed to scale across Kubernetes clusters โ from Raspberry Pis to cloud servers.
Inspired by Ready Player One's OASIS. Built for hackers, tinkerers, and dreamers.
- Procedural terrain โ Terraria-style world generated from a seed (same seed = same world everywhere)
- Server-side gravity โ Physics run on the server, so all clients (humans and AI) play by the same rules
- Multiplayer โ See other players in real time with custom names and colors
- AI agents โ Three autonomous NPCs (Claude, Atlas, Forge) explore and build structures while you play
- Real-time world modification โ AI agents place blocks and everyone sees the changes instantly
- Zone architecture โ World is divided into zones, ready for horizontal scaling across cluster nodes
- Profile picker โ Choose your name and color on connect
- Chat system โ Zone-scoped chat (press T to talk)
git clone https://github.com/Ptchwri3/Aetharia.git
cd Aetharia
docker compose up --buildOpen your browser to:
http://localhost:3500
That's it. You're in.
Multiple players? Open more browser tabs, or connect from other devices on your network:
http://<YOUR_IP>:3500/?server=<YOUR_IP>:8080
To stop:
docker compose downTo rebuild after code changes:
docker compose up --buildโโโโโโโโโโโโโโโ WebSocket โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Browser โโโโโโโโโโโโโโโโโโโโโบโ Backend (port 8080) โ
โ (Phaser) โ โ โ
โ port 3500 โ โ โข WebSocket game server โ
โโโโโโโโโโโโโโโ โ โข Server-side gravity โ
โ โข Zone management โ
โโโโโโโโโโโโโโโ WebSocket โ โข Procedural terrain gen โ
โ AI Agents โโโโโโโโโโโโโโโโโโโโโบโ โข World state persistence โ
โ (Node.js) โ โ โข Anti-cheat validation โ
โ Claude โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Atlas โ
โ Forge โ
โโโโโโโโโโโโโโโ
| Service | Port | Description |
|---|---|---|
| backend | 8080 | WebSocket game server โ handles all game logic, physics, terrain, chat |
| frontend | 3500 | Phaser 3 browser client โ renders world, handles input |
| agents | โ | AI agents that connect as players, explore, and build structures |
Aetharia/
โโโ Backend/
โ โโโ Src/
โ โโโ main.js # Server entry โ connections, physics loop, broadcasting
โ โโโ Handlers/
โ โ โโโ handleMessage.js # Message routing โ move, chat, blocks, profiles
โ โโโ Player/
โ โ โโโ player.js # Player factory with physics state
โ โโโ World/
โ โ โโโ terrainGen.js # Seeded procedural terrain generation
โ โ โโโ zoneManager.js # Zone assignment and player tracking
โ โ โโโ worldState.js # Block modification persistence
โ โโโ Utils/
โ โโโ constants.js # Path resolver for shared constants
โ โโโ logger.js # Leveled logging
โ
โโโ Frontend/
โ โโโ Public/
โ โโโ index.html # Game page with loading screen
โ โโโ Src/
โ โโโ main.js # Phaser client โ rendering, input, networking
โ
โโโ AI_Agents/
โ โโโ index.js # Agent spawner โ connects 3 AI players
โ โโโ Decision_Engine/
โ โ โโโ index.js # Physics-aware building decisions
โ โโโ Memory_Core/
โ โโโ index.js # World knowledge storage
โ
โโโ Shared/
โ โโโ Utils/
โ โโโ constants.js # Shared config (tiles, zones, physics, messages)
โ
โโโ Helm/ # Kubernetes Helm chart (ready for cluster deploy)
โโโ K8S/ # Raw Kubernetes manifests
โโโ docker-compose.yml # One-command full stack deployment
โโโ .dockerignore
| Key | Action |
|---|---|
| A / โ | Move left |
| D / โ | Move right |
| W / โ / Space | Jump |
| T | Open chat |
| Enter | Send chat message |
| Escape | Close chat |
Three AI agents connect automatically and inhabit the world:
| Agent | Personality | Behavior |
|---|---|---|
| Claude | Architect | Plans and builds watchtowers, shelters |
| Atlas | Explorer | Traverses the world, requests new chunks |
| Forge | Builder | Constructs structures more frequently |
Agents are physics-aware โ they build on solid ground, verify flat areas before construction, and their blocks must have structural support. They walk along the terrain surface just like human players.
Future: These agents are designed to be upgraded with LLM intelligence (local models via Rookery or cloud APIs) for genuine reasoning, conversation, and creative building.
| Variable | Default | Description |
|---|---|---|
PORT |
8080 | WebSocket server port |
AETHARIA_WORLD_SEED |
12345 | World generation seed (same seed = same world) |
AETHARIA_HEARTBEAT |
30000 | Heartbeat interval (ms) |
AETHARIA_DEBUG |
false | Enable debug logging |
| Variable | Default | Description |
|---|---|---|
BACKEND_URL |
ws://localhost:8080 | Backend WebSocket URL |
AGENT_TICK_RATE |
500 | Decision loop interval (ms) |
cd Backend
npm install
npm start
# Server running on ws://localhost:8080cd Frontend
npm install
npx serve Public -l 3500
# Open http://localhost:3500/?server=localhost:8080cd AI_Agents
npm install
BACKEND_URL=ws://localhost:8080 npm startAetharia ships with a Helm chart for cluster deployment. The zone architecture maps naturally to Kubernetes pods โ each zone can run on a separate node.
# Build and push images
docker build -t youruser/aetharia-backend:latest -f Backend/Dockerfile .
docker build -t youruser/aetharia-frontend:latest -f Frontend/Dockerfile .
docker build -t youruser/aetharia-agents:latest -f AI_Agents/Dockerfile .
docker push youruser/aetharia-backend:latest
docker push youruser/aetharia-frontend:latest
docker push youruser/aetharia-agents:latest
# Update Helm/values.yaml with your image repository
# Deploy
helm upgrade --install aetharia ./Helm \
--namespace aetharia \
--create-namespace
# Verify
kubectl get pods -n aetharia
kubectl get svc -n aetharia- Procedural terrain generation (seeded, deterministic)
- Multiplayer WebSocket server with zone management
- Server-side gravity and collision physics
- AI agents that explore and build
- Player profiles (name + color picker)
- Real-time world modification (block place/remove)
- Chat system (zone-scoped)
- Docker Compose deployment
- LLM-powered AI agents (via Rookery distributed inference)
- Player block placement (click to build/mine)
- Sprite tilesets (replace colored rectangles with pixel art)
- Helm deployment across multi-node K8s cluster
- Day/night cycle
- Inventory system
- VR/3D client (Unity/Unreal)
- Seeded PRNG (mulberry32) ensures deterministic generation
- Chunk-based: 32ร32 tiles per chunk, generated on demand
- Terraria-style layers: air โ grass โ dirt โ stone
- Surface noise with multiple octaves for natural hills
- Trees, caves, water, sand beaches
- 20 tick/sec physics loop applies gravity to all connected entities
- Collision detection against world tiles (solid vs air/water)
- Jump velocity, max fall speed, head bonk on ceilings
- Unstick logic prevents players from getting trapped in terrain
- Authoritative position โ server corrects client positions
- World divided into 5 zones (central, north, south, east, west)
- Players assigned to zones based on tile position
- Zone-scoped broadcasting (players only receive updates from their zone)
- Designed for horizontal scaling: each zone โ separate pod/node
- Modifications stored as overrides on procedural terrain
- Base terrain is never mutated โ generated fresh from seed
- Block changes persist in memory (future: Redis/disk)
- All clients receive real-time block update broadcasts
Josh "Ptchwir3" Nelson Builder of decentralized systems, autonomous drones, and experimental metaverse architectures.
MIT โ do whatever you want with it.