Defold Lab piece 04 · the lab's first 3D piece · verified playthrough, desktop + mobile

Dovecote

A clockwork winder walks the ledges of a sea-cliff dovecote and he cannot be steered — the spring in his back only knows one direction. What you can do is turn the storeys under him, so that a stair swings round to meet his feet before the spring runs out. A complete 3D turn puzzle authored end to end by AI agents in the real Defold engine: every model built in Blender, every tower proved solvable offline before it shipped.

Play it now

1 2 3 (or ↑ ↓) pick a storey · ← → turn it · Q E orbit · R retry · P pause · full touch controls · 1.48 MB over the wire · starts in seconds

▶  Play

The contract, and the tower

The piece starts as a written art-direction contract, and a written contract is a stricter colour spec than a painting: twenty colours committed as exact hex, and — because this is a 3D piece — every one of them compiled straight into the fragment shader as a constant array, with each face's UV encoding nothing but its palette index. There is no colour texture anywhere in Dovecote. That is also why the palette lives in exactly one file: two copies of an ordered list are two chances to shift every index after a new entry and silently repaint the whole tower.

Dovecote art-direction contract board
The written contract's visual half — palette, proportions, tower geometry
Dovecote in-engine frame
The same tower, live in the engine

A solver that proves the towers

The clock rules live twice: once in Python, where they author the four towers and search each one for a winning schedule of rotations; and once in Lua at runtime, stepped at a fixed 1/60 so a recorded schedule replays exactly. The generator also records the exact clock and spring ITS simulator ends on, and the game replays the Lua rules against those numbers AT BOOT: two implementations agreeing that a tower “wins” is not enough, they have to agree on the numbers, or a slow drift will one day put the winder on the wrong side of a sector at the moment a storey locks. Then a second, deliberately different search — iterative-deepening over rotation times, sharing simulated prefixes — re-derives a winning line from the tower data alone, and the bot plays what it found on the keyboard. All four towers, every round.

the offline solver's output, proving each tower
The offline solver's own output — this panel is generated by re-running the search, so it cannot drift from the towers that shipped
a later tower in the engine
Tower 3 — turning the storey he is standing on carries him with it

Everything in frame is a Blender mesh

No engine primitive ships in this piece. The storey drum, its stair, the cap and its hatch, the vane, the headland with its drystone wall and sea edge, the doves and the winder himself are all built by script in Blender and exported as glTF for Defold model components. The winder's face is the part worth pointing at: the eye sockets are welded to his head, but the glass lenses and the slot mouth are separate models, so he can blink on a timer and hold his lenses wide with the slot dropped open when the spring falls under a quarter — an expression assembled from two meshes and no rig at all.

the doves released
The hatch: he climbs out and the doves go up
the last tower
Tower 4 — every alignment out, a box on every storey, a short spring

The instant-load signature

This lab exists to prove a real-engine game can be playing before a phone user loses interest — and a 3D piece has to clear the same bar as a 2D one. Every payload ships pre-compressed and is inflated in the browser, so any static host serves it optimally. Measured first-playable times, Playwright CDP network throttling:

Connection profileThroughput / RTTFirst playable frame
Wi-Fi / 4G10 Mbps · 60 ms1.9–1.9 s
Fast 3G (HSPA+ class)6 Mbps · 150 ms2.9–3.2 s
Chrome DevTools "Fast 3G" preset1.44 Mbps · 562 ms10.5–10.5 s

Total transfer 1.48 MB of a 3.14 MB bundle — the smallest payload this lab has shipped, and it is the 3D piece. Nothing here is compression cleverness: no colour texture ships at all. Every face's UV encodes an index into the contract palette and the palette is compiled into the fragment shader as a constant array, so the whole look of the piece costs twenty vec3 constants instead of an atlas. The lab's own line is a first playable frame within 4 s on the fast-3G profile, and this clears it by about a second — worth stating plainly because the previous piece in this cycle, a 2D one carrying a 2048-wide sprite atlas, missed the same line by 0.3 s. Measured headless on software rendering, on a host shared with another lab's renderer, so a real GPU and a real device both boot faster than these figures.

Real engine features, earned

3D model components

Every mesh is a Blender-authored glTF loaded as a Defold model component — drum, stair, cap, vane, headland, winder, doves.

An authored material

Hand-written vertex and fragment programs: half-lambert key, ambient fill and a rim term, with the whole contract palette compiled in as a constant array.

Perspective camera

An orbiting perspective camera that frames the whole tower and can be swung round it while the winder keeps walking.

Factories

Storeys, stairs, the cap, the vane and the released flock are all factory-spawned from the tower data — no hand-placed instances.

GUI scenes

Resolution-independent HUD in physical pixels — one layout from desktop to phone portrait, with touch storey-select and turn controls.

Message passing

The clock owns the rules and posts events; the winder, the storeys and the HUD only ever receive them.

fixed 1/60 step8 sectors per storey walk 0.72 sectors/sclimb 1.15s turn 0.45s20-colour palette in-shader 4 towers, all solver-provedarrows + 1/2/3 + Q/E orbit + touch pauselocalization-ready strings