Skip to content

About

A code-built 3D world where colossal walking machines roam overgrown ruins. Procedural mechanisms, terrain-aware inverse kinematics, deterministic simulation, and cinematic WebGL rendering.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

machine-wilds

A Claude Code skill and the engine behind it. Give it a place and it builds a 3D world you can walk through in the browser: a ruined, overgrown landscape where giant walking machines keep their rounds in the mist. The machines are put together from code, part by part, and their feet land on the real height and slope of the ground.

machine-wilds: the relay station against the low sun with the walker at its feet

Play in the browser Watch the film

A personal project by Jeongrok Oh, an MMO server architect. Two habits from server work run through it: every machine's state is recomputed from the clock, and nothing is rendered until automated checks on the bodies pass.

How it works

Machines

Each leg is a planar chain of segments solved in closed form. Every powered joint has a two-part hydraulic cylinder, and a search places its two anchors so the rod stays at least 15 % inside the barrel over the joint's whole range of motion. Fittings (pipes, hoses, rivets, hatches, ladders, rails) are laid on afterwards, and each kind has an age that puts rust streaks, grime and moss where water would run.

Pose as a function of time

Given the world clock t, the gait computes where every foot is, from the machine's closed way and the phase of each leg, with no state carried between frames. The page, a still, a frame of the film and the Node checks all get the same pose for the same t, so film frames can be drawn in any order and a stopped render picks up where it left off. The walker's own two-legged machine is the exception: it follows the keys, so it steps from state.

Footfalls on real ground

Each foot reads the height and slope where it will land; a planted foot is fixed in the world (measured slip 0.00 mm against a 4 mm limit); the body's height and lean come from the feet that carry it, and steps shorten on a grade.

Checks before rendering

scripts/gym.mjs runs the same gait code in Node, without a browser, and judges every machine over a whole lap against 27 limits: slip, reach, joints folding past their stops, the cylinders' stroke, clearance under the belly, determinism (the same t twice must agree to 1e-9), a breathing idle, and anticipation and recovery around each big move. Every kind must also cross a test course with a 14° ramp, a 1.2 m drop, a 12° side slope, a ditch and a mound. A kind that fails is fixed in its own numbers or in the line of its way, never by loosening a limit.

Renderer

A deferred WebGL 2 renderer on three.js r170, forked from the scanned-realm skill. Surfaces, models and leaf atlases are Poly Haven CC0 scans, fetched when a realm is built (not committed) and reduced to levels of detail with meshoptimizer at load. Machine lamps are marched through the fog as beams with halos. The weather runs through clear, rain, snow, mist and haze, and the hour through a full day.

A film the page plays

lib/89_cine.js plays a list of shots with free cameras while the walker's machine is driven by keys. ?film=1 plays it live; examples/iron-valley/trailer.mjs steps the same shots to draw frames (3,857 for the example) and joins them with sound synthesized from the machines' footfalls. On a machine with no GPU, timing one quality setting at a time showed the shadow maps were half of each frame: at half their resolution a frame went from 8.7 s to 4.1 s with no difference visible at 960 × 540.

How a realm is made

  1. Input: one line about a place, what it was, why it was left, and the hour.
  2. Brief: the rise and fall of the land and where the ruins stand; for each kind of machine its job, size, weight, legs, gait numbers, set piece and lamps; the ways the machines walk.
  3. Numbers first: gym.mjs walks every machine over the test course and along its way on the real land, without a browser, and reports in numbers.
  4. Parts and world: joints and cylinders, fittings, a body, head and lamps written new for each kind; ruins and forest from scanned surfaces and models; footprints pressed into the ground.
  5. Look: a cast sheet per kind (four sides, walk, idle, set piece), close sheets, the page check (check.mjs), stills.
  6. Output: one walkable page (scans read from assets/ or from Poly Haven's server), with the sheets, map and stills.

The example world (examples/iron-valley)

A pass where a maintenance yard was left forty years ago. The land is 640 m across, from −3 m at the brook to 47 m on the north ridge, with a broken viaduct, a hall, pylons, a container yard. Nineteen machines of eight kinds: two long-necked watchers, three six-legged carriers, a relay station 73 m tall that weighs 5,200 t and walks the rim, five flying kites, two turtles, a crayfish, four woodlice, and the walker's own body. Sources are in examples/iron-valley/src/, the design in its BRIEF.md.

Each picture opens the live page at that spot and hour.

A small two-legged machine on a foggy viaduct at night, its head lamp lighting the barrier ahead
Plover, from behind · third person · mist
The walker's own body: two legs, 1.9 m, 0.3 t. Its lamp (B) lights the fog.
The viaduct seen from above, a beam thrown forward onto the barrier
The viaduct from above · top view · mist
Top view. The wheel or + and − change the height.
A white two-legged machine walking beside a cracked forest road at midday
Plover on the forest road · third person · clear
Feet land on the real ground height; a planted foot does not slide.
Beyond the broken end of the viaduct a crane machine raises its neck and sweeps the valley with a searchlight
At the end of the viaduct · mist · 20:24
The crane stops 26 m ahead, raises its head and looks round (the set piece called survey: anticipation, peak, recovery).
A four-legged crane among firs in evening fog, its searchlight cutting a beam
The crane's searchlight · crane · 25 m · 86 t
One searchlight (an 8° cone) at the end of a long neck, seen as a beam in the fog.
A six-legged carrier walks toward the camera on a dark forest road, two amber eyes in the fog
The porter's two eyes · porter · 6 legs · 38 t
A rusty steel cargo frame and a tripod gait. Each foot is set to the height and slope where it lands.
Five machine birds flying over the trees in night fog, each dropping a beam of light
Five kites · kite · 9.4 m span · flies
The wings are powered bones. A kite slows as it climbs, banks before it turns, beats a few times and glides.
A huge eight-legged machine passing beyond a dark forest, lit windows in the building on its back
The relay station passes · ridge · 73 m · 5,200 t
One stride takes 15 s. The ground shakes at every footfall and the footprints stay pressed in.
Two eyes of a giant machine coming head-on through fog, throwing two beams
The relay station's eyes · two eyes, 33 m up
Every kind has its own lamp colour and count, so they can be told apart by their lights alone.
A campfire inside a half-collapsed concrete hall with a generator, fuel drums and crates
The fire in the hall · mist · 22:30
The one warm light in the cold fog.
In the dawn mist a long white leg streaked with rust passes, raising dust
Dawn, under the legs · mist · 06:30
White ceramic casing with rust streaks and grime; a drum and a hydraulic cylinder at every joint.
A white crane passes the end of the viaduct at the height of its back
A back at eye level · clear · 13:00
The viaduct deck is 22 m up, the height of the crane's back.
A covered car beside a cracked asphalt road in a spruce forest with ferns
The old road · scans · Poly Haven CC0
Asphalt, concrete, forest floor, ferns and the covered car are all scans.
A six-legged carrier with yellow-cased legs kneels on a slope while the small walker looks up
The porter kneels in the yard · porter · 38 t · kneel
The set piece kneel: it rises a little, the cargo bed drops 1.7 m, it waits, then stands back up past its own height.
A four-legged machine with a mossy domed shell stands by a marsh, two amber eyes lit
The turtle by the tarn · turtle · 150 t · a dome of plate
A shell as wide as a house. One stands by the tarn, one walks the east floor. Set piece: pull the neck in and settle.
An eight-legged plated machine by a brook in night fog, its red eyes turning the fog red
The crayfish in the brook · crayfish · 64 t
The valley's monster: two claws, feelers, a jointed tail and tail fan, red eyes on stalks. Set piece: rear up.
Three small six-legged machines with arched rusty plates walk in a line on a spruce forest floor
Woodlice in file · woodlice · 1.6 t · four in file
Four machines the size of a person walk 5 m apart, stop together and curl up together.
Beyond a dawn-lit forest a giant machine carrying a building and a mast walks along a distant ridge
The relay station on the far rim · film · dawn
The film's first shot: the hour runs from 5 to 9 in the morning while the relay station walks the rim.
A small two-legged machine in the rain before a giant crane's legs and the viaduct piers
Where the walker landed, before the crane · rain · the leap from the viaduct
Over the barrier and 15 m down. Rain, wet ground, ripples.
Looking down past a flying machine bird at the broken viaduct and a four-legged machine below
In the film, following a kite · free camera · light mist 08:30
A shot from the film the page plays (?film=1): 28 shots from dawn to night, live. Esc hands over to walking.
Backlit in haze, giant legs in cream casing and yellow housings pass close, raising dust
Under the relay station's legs · casing legs · deck 28 m overhead
The walkable land reaches the rim road, so you can walk in among its legs as it goes. Plated casing, joint housings, foot pads.
In sunlit haze a giant machine with two lit eyes walks down a forest road trailing long shadows
The relay station against the sun · haze · 18:12
The haze weather: far things fade to pale silhouettes, near things keep their colour.

Checks you can see

Every kind is turned in a studio before it goes into the world, and every gait is drawn over a cut through the real land. A kind that does not pass is fixed in its numbers or its way. Each sheet links to the source it checks.

Cast sheet of the crane from four sides beside an orange 1.75 m figure
Crane · 66 bones · 72k / 20k / 8k triangles
Front, back, both sides and three-quarter; walk on both sides; idle; the set piece at anticipation, peak and recovery.
Cast sheet of the six-legged porter, steel cargo frame and container, two amber eyes
Porter · 78 bones · 84k / 22k / 9k triangles
Insect legs (slew ring, arm, thigh, shin) with a hydraulic cylinder at every joint.
Cast sheet of the eight-legged relay station: concrete building, mast, cased legs, landing pad
Relay station · 103 bones · 127k / 36k / 13k triangles
66 × 73 × 33 m. The orange dot at its feet is a 1.75 m person.
Cast sheet of the turtle: bolted domed shell, rusted rim, four legs, blunt head
Turtle · 53 bones · 18.2 × 7.1 × 14.6 m
The shell is a loft over the top half with three rows of plate on it. The settling move at anticipation, peak and recovery.
Cast sheet of the crayfish: red plates, two claws, feelers, jointed tail, eight legs
Crayfish · 89 bones · 99k / 25k / 11k triangles
Claws, feelers and tail are bones that follow the body late. The rearing move.
Cast sheet of the woodlouse: seven arched plates, six legs, an orange 1.75 m figure
Woodlouse · 65 bones · 4.2 × 1.7 × 2.8 m
A kind the size of a person. The test course shrinks its drop and ditch to its size.
Close sheet of the crane: panelled white casing, rails, hatch, ladder, tanks and pipes
Crane at arm’s length · --cast --close
The hydraulic pack under the belly with a hose to each hip; rails, ladders, inspection hatches, rust streaks.
Close sheet of the porter: lattice legs, rivets, cylinder tie rods and valves
Porter at arm’s length · tie rods · valve blocks · lacing · rivets
Every cylinder has tie rods, a valve block, steel pipe and hoses; the legs carry conduit and junction boxes.
Close sheet of the relay station: windows, ladders, deck pipes, riveted legs, ringed eyes
Relay station, deck and legs · mains · accumulators · stacks · galleries
Mains on both sides of the deck, an accumulator at each hip, ladders and walkways on the building.
Cast sheet of the two-legged plover: white body, bird legs, lamp head, four walking moments
Plover (the walker's body) · walk · run · turn · back · hop
Walk and run at each quarter, turning on the spot, stepping back, a hop at crouch, air and landing.
Cast sheet of the flying kite: keel body, two-part wings with feather plates, fan tail
Kite · 9 bones · flies: bank, beat, glide
All sides, four moments of a wingbeat, the glide from below, the bank in a turn. Checked on height, bank, load and wing angle.
Close sheet of the kite: white back casing, rusty feather plates, two-part wings
Kite from above and below · weathered blades, one pale leading edge
The feathers are weathered steel; only the back and leading edge are white ceramic. Drives and push rods at the wing roots.
Side drawing of a machine skeleton walking over a ramp, a drop, a side slope, a ditch and a mound
The test course · gym.mjs --course
Ramp, drop, side slope, ditch, mound. Planted feet blue, lifted feet red, cylinders orange; every leg its own length.
Relief map of the valley with contours, three machine ways and footfall dots
The land and the ways · gym.mjs --map
Slopes steeper than 30° in red; each dot is one footfall.

The starter: Lantern Quarry

starter/ takes a different topic all the way through: a quarry cut in terraces and flooded. It designs its own lamp warden with two-segment, backward-kneed legs, one walking the rim and one standing in the water, and its own walker's body.

A four-legged machine standing in a flooded quarry at dawn, its lamp on the water
The lamp warden in the water · warden · 14 t
It stands, breathes, and lowers its lamp to the water and back (the set piece dip).
A small two-legged machine with a mast lamp walking at a forest edge in late afternoon
Linkboy with its lamp · the starter's own walker's body
Two-segment legs with backward knees, designed for the quarry rather than borrowed from the example.
Cast sheet of Linkboy: toolbox body, steel legs, caged lamp on a mast
Linkboy · cast sheet
The starter designs its own walker’s body too.
Cast sheet of the lamp warden: pump body, short mast, caged lamp
Lamp warden · cast sheet
A fourth kind of body, designed for the quarry.

Quick start

Requirements: Node 18+ with Playwright's Chromium, curl and ffmpeg. gym.mjs needs Node alone. The page needs WebGL 2 and a real GPU.

cp -r starter my-realm                              # the starter: a flooded quarry and two wardens
node scripts/gym.mjs my-realm --course --sheet      # the machine on the test course, no browser (out/gym-course.png)
node scripts/gym.mjs my-realm --map --sheet         # on its own way, on the realm's land (out/map.png)
node scripts/fetch-assets.mjs my-realm              # the scans: 28 MB from Poly Haven, CC0
node scripts/build.mjs my-realm                     # writes my-realm/index.html
node scripts/render.mjs my-realm --cast             # each kind turned in a studio (out/cast-<kind>.jpg)
node scripts/check.mjs my-realm                     # must print "check OK"
cd my-realm && python3 -m http.server 8000          # walk it at http://localhost:8000/

The example works the same way with examples/iron-valley (101 MB of scans). Without the scans a realm still builds and walks with ?scan=0, on surfaces baked from code. SKILL.md has the whole workflow, from a topic to a finished realm; references/ holds the notes behind each step.

Controls: W A S D or the arrows to walk, the mouse to look, Shift to run, Space to hop, V to switch the camera (first person, behind, above), the wheel or + and − to zoom, B for the lamp, N for the scout camera (the walker's own wide lens: carried, grainy, torn when its fault crackles), Tab for the menu (the hour, the weather, quality, sound and every key). On a phone, two thumbs and the ☰ button; a gamepad works too, and the HUD then shows its buttons. The HUD is laid out like a console game's: the walker's machine and the hour top left, a compass with the giants (red while one is watching you), the named places and anything you can use, and the buttons that matter bottom right. Walk up to something you can use and a marker shows it from afar, then a prompt with its key: when Ridge, the biggest, stops on the rim and lets its cage down, R takes you up to its deck to walk the bow while it walks on, and R again takes you down. 1 to 4 set the hour, 5 to 8 the weather, T cycles both, M toggles sound, P shows numbers, H hides the HUD.

Limits

The stills and films here were rendered on a machine with no GPU, so frame rates on real GPUs have not been measured; what is kept in hand is what can be counted (draw calls, triangles, passes; references/PERF.md). Machine lamps cast no shadows of their own, so a beam can leak past a tree. The machines walk fixed ways and do not avoid each other at run time; the ways are spaced by the offline checks.

Where it comes from

Made in motion-skills from three of its skills: scanned-realm for the engine and the scans, walking-colossus for the stateless gait, and machine-build-reel for machines as mechanisms and their checks. It moved here with its history. Scans from https://polyhaven.com (CC0). AnyMachine (MIT) is a reference: machine-build-reel follows its method of building a machine as a parts list and checking it by script, and its shelled machines prompted the example's shelled kinds. No code, design or asset of it is used, and none of any game's. references/SOURCE.md has the details.

Licence

  • Code: PolyForm Noncommercial 1.0.0. Use it, change it and share it for personal and other noncommercial purposes. Commercial use (paid courses, client work, products) needs a licence from the owner.
  • Films, stills and other pictures: © 2026 jungrok5, all rights reserved (MEDIA-LICENSE.md). Watch and share the original posts; no re-uploads, edits, or use in lectures, courses or ads without permission.
  • Parts by others keep their own licences: three.js and meshoptimizer (MIT, in vendor/), the Poly Haven scans (CC0, not committed). See CREDITS.md.

About

A code-built 3D world where colossal walking machines roam overgrown ruins. Procedural mechanisms, terrain-aware inverse kinematics, deterministic simulation, and cinematic WebGL rendering.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages