demonstration 11 of 11 · mudiii.html

MMORPG

A fox and a handful of goblins each plan their own next move across a shared town square, rendered in three dimensions. Every one of them acts only on what it has personally seen.

What it demonstrates

This is the same engine as the flat game pages, drawn in three dimensions, and it is the one to open when you want the demonstration to look like a game rather than a diagram.

A goblin can walk straight into a fox it has not spotted. That is not a bug and it is not scripted. The goblin's plan was computed against what the goblin believed, and the fox was not in it.

Click the square to drop food and watch the goblins' plans change on the next tick. Address one by name in chat and tell it something, true or false, and watch it act on that instead.

Three cameras: follow one character, see through its eyes, or look down on the whole board. A top-down map panel shows what is actually there, so you can compare it against what any one character believes.

Three chase boards ship: a twelve by twelve square with one fox and three goblins, a ten by ten market row with stall lanes to corner a goblin in, and a fourteen by fourteen chapel yard with open ground and two foxes.

A fourth scenario in the same dropdown is not a chase at all: the classic wolf-goat-cabbage river crossing, played here with a fox in the wolf's part (no CC0 wolf model exists yet, and the class name is a fact, so a rename costs nothing when one does). It is a logic puzzle solved by search rather than watched as a fight, and it opens paused, with nothing left to chance.

Next Chat you can replay

Chat you can replay

The opening is the world's own. The chat exchanges are assertions from the turn engine's test file.

The opening line.

a fox prowls the town square; goblins pick over the stalls for scraps. Neither is yours to move. Watch, or address one by name in chat.

The first line of corpus/worlds/src/town-square.jsonl.

Tell the fox where the goblin is. It believes you and moves there on the next tick.

tmct> @fox the goblin is east
told the fox-1 the goblin-1 is at cell-3-2
fox-1 is now at cell-3-2

Asserted in test/services/mudiii-turn.test.mjs.

Tell a goblin where food is, by cell.

tmct> @goblin the crumb is at cell-6-7
told the goblin-1 the crumb-9 is at cell-6-7

Asserted in test/services/mudiii-turn.test.mjs.

A tick with the fox in sight of the goblin. The goal line, the plan and the mood all come out of the same decision.

fox-1 at cell-5-5, goblin-1 at cell-8-5
goal: chasing goblin-1, last seen at cell-8-5
plan: east, east, east
mood: angry

Asserted in test/services/predator-prey.test.mjs. “Last seen” is literal: it is the believed position, which may be out of date.

Next What it looks like

What it looks like

The square in three dimensions, with the HUD showing each character's current goal.

The tmct mudiii page showing a fox and goblins moving through a 3D town square, each reacting only to what it has personally seen
mudiii.html. A fox and three goblins on the town square, each acting on its own view of it.
Next What it works out

What it works out

Belief, not visibility. Each character's view of another is computed by one function, in four rungs. A removed character is believed nowhere. A character inside the vision radius is known exactly. Otherwise the newest thing anyone told this character about it. Otherwise nothing at all.

Vision is Chebyshev distance, default radius four, with no line of sight test. Buildings block movement, not sight. Keeping sight simple is what stops belief and the planner disagreeing.

The decision ladder. Every tick, every character takes the first rung that applies: deliver, carry, escape a trap, avoid a rival it can see, chase or forage toward the nearest believed target, hold position, or wander on a seeded roll. The rung's name is also the goal line you read in the HUD.

The plan. The chase rung calls the same bounded breadth-first search the Hanoi page uses, over the board's own movement graph, toward the believed cell. If no path exists yet it takes one greedy step and tries again next tick. That is the whole reason a goblin walks into a fox: the plan was correct for what it knew.

The board. Cells are named, distance is Chebyshev, and the prop vocabulary decides what blocks movement: blacksmith, bush, cart, fence, house, inn, oak, stall, well.

Where the cast comes from. A town-square world ships the board only. The engine mints the characters onto it at seeded cells at start, so the opening cast is derived from the layout rather than read from the world's rows.

What you can change. Talking to a character writes a real addressed fact. It is read back through the belief function on the next tick, exactly like something the character saw. Which means you can lie to it.

The focus panel. A panel under the chat follows whichever character you follow. It shows what that character believes and its plan, as a numbered list. It also shows the imperative sentences the character inherited from its class, plus its own drive facts. On the river crossing the same panel numbers the whole crossing the search found. It checks off each move once playback passes it, so the plan on screen and the boat on the stage never disagree.

The river crossing. A farmer must ferry a fox, a goat and a cabbage across a river one at a time, never leaving the fox alone with the goat or the goat alone with the cabbage. Nothing here is a JS rule written for this one puzzle. The fox's appetite for the goat is a fact, fox eats goat, the same predicate that makes a fox chase a goblin on the chase boards. The "may not be left alone" constraint is derived from that fact and from who guards whom, not authored a second time. Follow one of the four passengers and its own card shows the plan a bounded search found: the classic seven crossings, goat first and goat last. Press play and the boat crosses the river one leg at a time on the 3D stage, farmer and cargo aboard. Pause holds the boat where it stopped, and step takes a single crossing. Delete the fox's appetite for the goat in the card and the plan redraws itself shorter, live, with no turn spent. Give the fox a second appetite no single farmer can cover and the panel reports that no plan was found, never a shortened one standing in for a real answer. Open it directly at mudiii.html?scenario=river, or say "open the river crossing" in the page's chat.

Next How it is built

How it is built

src/services/predator-prey.mjs is the tick engine. It is written against roles, so fox is the predator role and goblin is the prey role.

src/domain/agent-belief.mjs holds belief. It imports nothing, so a belief is a pure function of the fact set and the observer.

src/domain/town-square-world.mjs holds the board: cell naming, distance, direction deltas and the prop vocabulary.

src/services/mudiii-viz.mjs builds the page shell and src/services/mudiii-scene.mjs holds the three-dimensional scene: model loading, the camera update, the render loop and click handling. The models are listed in data/mudiii-assets.json.

The three.js vendor bundle is built inside this page's own build step rather than beside the shared assets, because it is the only page that loads it. A build with no town-square world skips the compile entirely.

One ticker drives the whole simulation, through a serial queue, so every character's turn lands in a defined order.

src/domain/agent-traits.mjs holds the drive vocabulary every class and instance reads: what it pursues, evades, consumes and guards, walked up the class chain so an instance can override its species and a spawn copies its class's rows onto itself. The same file derives the river crossing's constraint from those rows rather than a hand-authored rule. The plan itself is src/domain/planning.mjs's bounded search over the action domain src/domain/domain.mjs compiles, the same machinery the Hanoi page runs.

Next Related work

Related work

Multi-agent planning under partial observability, and the belief model behind it.

  • Rao and Georgeff, “BDI Agents: From Theory to Practice”, 1995.Belief, desire, intention. The goal line in the HUD is the intention; the belief is what it was computed against.
  • Fikes and Nilsson, “STRIPS”, Artificial Intelligence 2(3–4), 1971.The action model the movement search grounds against.
  • Ghallab, Nau and Traverso, Automated Planning and Acting, 2016.Planning and acting as one loop. Here it runs once per character per tick.
  • Steel and Ho, Planning and Execution using Partial Decision, 1993; Steel and Alami (eds.), Recent Advances in AI Planning (ECP'97), LNCS.Planning when you do not know everything, kept in docs/references/planning/STEEL_AND_HO.md.
  • Molineaux, Klenk and Aha, on goal driven autonomy, 2010; Cox, “Perpetual Self-Aware Cognitive Agents”, AI Magazine 28(1), 2007, pp. 32–45.Dropping a goal that has stopped making sense, which is what the ladder does every tick.
  • Reiter, “On Closed World Data Bases”, in Logic and Data Bases, Plenum, 1978.A character that believes nothing about a fox is not asserting there is no fox. The same open-world reading is why the river crossing reports no plan found rather than guessing one.
  • Chow, “On optimum recognition error and reject tradeoff”, IEEE Trans. Information Theory 16(1), 1970.The literature's name for a refusal is abstention. The river crossing's panel abstains for the same reason tmct's chat lane does: nothing found, not a score under a threshold.
  • Alcuin of York, Propositiones ad Acuendos Juvenes, c. 800–810.The oldest known statement of the wolf, goat and cabbage crossing, among the earliest river-crossing puzzles on record.
Next Credits and further reading

Credits and further reading

The name is homage, not succession. Roy Trubshaw wrote the first MUD on Essex University's own machine in 1978, and Richard Bartle, a fellow Essex student, took it over in 1980 and built out most of its world; MUD2, their 1985 successor, is still live. tmct is a deterministic, text-first world engine, squarely in the tradition they founded, but this page is not affiliated with, or endorsed by, Trubshaw, Bartle, MUSE Ltd, or either of their games. The rig conventions this square's characters use, and the practical debt for how to draw and animate a small cast of them at all, are borrowed from a sibling project, world-of-claudecraft.

Assets and related pages.

  • public/models/CREDITS.md, the credits for every three-dimensional model on the square.
  • three.js, bundled first party as vendor/three.js and loaded only by this page.
  • MUD1 and MUD2, Trubshaw and Bartle's own games, on Wikipedia.
  • Classical AI planning, for the search every character calls each tick.
  • README for the full bibliography.
Next demo Fact based world visualisation