World Of Noumena | Update
This release focused on pushing the MUD toward a scalable, multi-node architecture while adding in-world tools for lore and puzzle interaction. Below is a technical walkthrough of the main changes and how they fit together.
Distributed Zone Architecture
Zones now shard across BEAM nodes using consistent hashing. The core changes:
WorldOfNoumena.Clustercomputes a hash ring and assigns zone ownership.WorldOfNoumena.Zonereplaces the old global room-tracking GenServer; each zone process tracks occupants and broadcasts within its shard.WorldOfNoumena.ZoneManagerstarts/stops zone servers on each node as ownership changes.WorldOfNoumena.Worldis now a facade that routesenter/leave/say/emote/broadcastto the appropriate zone process.
Player Process Migration
Players are now separate from socket connections:
- The TCP connection process handles login and forwards input/output.
- The
PlayerGenServer handles all commands, state, and room interactions. - When moving across zone boundaries, the
Playermigrates to the owning node. The connection updates its trackedplayer_pidand continues streaming output.
This isolates socket lifecycles from game state and makes cross-node movement explicit.
NPC and World Event Sharding
NPCs and events now respect zone ownership:
NPC.Managerstarts default NPCs only for locally owned zones and reacts to node up/down.- Admin spawn commands route to the zone owner for the target room.
- World events and room scripts are executed on nodes that own the relevant zone or are elected leader for global events.
Archive Terminals and Log Indexing
The Archives are now a first-class interface:
- Rooms tagged with
:archiveexpose anarchivecommand set. Archives.Logcaptures global and zone-scoped broadcasts for later retrieval.- Players can search and read lore with
archive searchandarchive read. - Logs are accessible via
archive logs, with zone-specific and global views. - Optional external data can be loaded from JSON via
ARCHIVE_EXTERNAL_PATH.
This gives the world a queryable memory without external tooling.
Puzzle Framework
Rooms tagged with :puzzle can host lattice-style symbol puzzles:
WorldOfNoumena.Puzzlesdefines room-bound puzzles with symbols, prompts, and solutions.puzzle enter <sequence>checks the attempt and persists solved state in the player process.- Successful solves can trigger emotes or unlock additional archive entries.
The puzzle system is lightweight but designed to grow into multi-step or data-driven puzzles.
Tooling and Operational Updates
To make distribution testable locally:
docker-compose.ymlbrings up Postgres plus multiple BEAM nodes.Makefileadds cluster run targets (cluster-node1,cluster-node2,cluster-node3).TELNET_PORTandGATEWAY_PORTcan be configured at runtime per node.
Code Quality and Maintenance
Several refactors landed to reduce complexity and Credo warnings:
- Flattened nested conditionals in player/admin flows.
- Refactored BFS pathfinding in
Roomfor readability. - Simplified storage transaction flow for character creation.
- Updated map/join patterns to use
Enum.map_join/3where appropriate.
Next Steps
Immediate follow-ups:
- Persist puzzle progress per character instead of process memory.
- Add richer archive ingestion (structured metadata, indexed search).
- Expand puzzles into multi-room sequences with stateful progression.
- Introduce zone-aware item persistence across nodes.