jnqtech studio emblem
jnqtech

My Validator Rejected 21,500 Lines of AI Terrain (6,096 Floating Road Vertices) — Building the Valley in Code & Headless Blender

Why I threw away 21,533 lines of AI control-map terrain after roads floated four meters in midair, rebuilt world creation in deterministic Python and headless Blender, fixed a nasty Windows D3D11 shader bug, and hit 60 FPS twilight atmosphere on phones.

The Pall2026-12-02·6 min read·World Building · Blender · Shaders · Mobile 60 FPS
My Validator Rejected 21,500 Lines of AI Terrain (6,096 Floating Road Vertices) — Building the Valley in Code & Headless Blender
In This 7-Part Series: Building The Pall▾
  1. 01I Never Meant to Build an MMORPG: How an AI-Org Experiment Escalated Into The Pall6m
  2. 02One Prompt, 18 AI Employees, 76 Ticks — And Why the Charging Wolf Looked Like a Tree5m
  3. 03I Banned Three.js, Built Custom WebGPU, Tested Unreal and Unity, Then Came Back to Three.js6m
  4. 04The 6-Hour Crash Test That Failed on Interval #4,277 — And the 10% Slow Linux Clock7m
  5. 05583 Tracker Commits, Zero Features, and 192 GiB of Evidence: Cutting 85% of My Own AI Bureaucracy13m
  6. 06My Validator Rejected 21,500 Lines of AI Terrain (6,096 Floating Road Vertices) — Building the Valley in Code & Headless BlenderREADING
  7. 07From 5 Struggling Bots to 1,500+ MMORPG Players on One €10.49 ARM VPS15m

Early on, I fell for a tempting assumption of my own: that I could have an image model paint elevation, biome, and road control maps, feed those pixels into a heightfield script, and walk around a finished 3D world. I tried it. I had the AI write 21,533 lines of code trying to make it work — and my own automated validator threw the whole build in the trash.

6,096
Floating Road Vertices
Up to 4.21 m off the ground (0% support)
85.66%
AI Control-Map Ambiguity
4.71M pixels needed palette repair
50–64
Mobile Draw Calls
Full 4-phase twilight Valley @ 60 FPS
275 FPS
Desktop After Shader Fix
Verified across 77,012 frames

An Honest Rejection: 6,096 Floating Road Vertices

Back in late August (pallwright-ai-terrain-prototype), the early continent looked too flat, so I ran a focused experiment: let an image model paint categorical elevation, biome, and road-corridor control maps on top of the continent vision, then compile dramatic mountain relief directly from those pixels.

Some pieces looked exciting — the northwest mountain massif climbed to 169.8 meters and all 24 rivers routed downhill cleanly. Then the inspection pipeline checked 27 camera presets and printed a blunt red verdict: Build verdict: REJECT.

  • Every single emitted road vertex — 6,096 vertices in total — had 0.0 terrain-support coverage, floating up to 4.21 meters in midair like jagged roller-coaster ribbons.
  • Worse, translating fuzzy AI-edited PNG pixels back into strict physical terrain categories imposed an 85.66% pixel-ambiguity burden (over 4.71 million pixels had to be forcibly snapped back to valid palette classes, shaving 98.98 million cubic meters off the terrain envelope!).
August 24 side-by-side verdict: old stepped Unity cliffs on the left versus the rejected AI-terrain experiment on the right, where dark serrated road geometry cuts across the hillside with zero ground contact.
August 24 side-by-side verdict: old stepped Unity cliffs on the left versus the rejected AI-terrain experiment on the right, where dark serrated road geometry cuts across the hillside with zero ground contact.

Stylized low-poly art can look great when the world feels grounded — but roads hovering four meters above the dirt broke the illusion immediately for me. Throwing away 21,500 lines of code stung for about ten minutes, and then it gave me a practical rule for my own pipeline: I use AI images for mood and layout ideas, not as direct source data for physical roads or collision.

Side Quest: Deterministic Cartography & World Compilers

From that rejection came a deterministic compiler pipeline (world-generator-v2 and the-pall-living-world v1/v2). Instead of guessing heights from PNG pixels, world intent lived as typed text and code: coupled terrain erosion, D8 watershed hydrology, cut-and-fill road grading, and deterministic bridge crossings.

CARTOGRAPHY: Sep 2 — deterministic atlas with 12 rivers, 25 drainage channels, 22 roads, and 49 crossings passing 11/11 automated gates.
CARTOGRAPHYSep 2 — deterministic atlas with 12 rivers, 25 drainage channels, 22 roads, and 49 crossings passing 11/11 automated gates.
3D TERRAIN: Sep 3 — deterministic Three.js terrain test with sculpted peaks, central lake, carved outlets, and dusk lighting.
3D TERRAINSep 3 — deterministic Three.js terrain test with sculpted peaks, central lake, carved outlets, and dusk lighting.
Moving from fuzzy pixels to deterministic world compilers — vector/4K cartography passing 11/11 quality gates (left) and carved river valleys at dusk in browser Three.js (right).

Building the South Start Valley: Scripted Ground + Headless Blender

When Lean Alpha unlocked real gameplay in late October, I needed an unforgettable starting zone that didn't feel like a flat empty desert. My brief to the world AI lane was simple: "Think of Teldrassil in WoW — an ancient place with massive trees that split the view so walking doesn't feel empty like Tanaris."

I split the craftsmanship right down the middle:

  • Code sculpts all ground, terraces, brooks, and roads (pipeline/valley/build.py): Every road and footpath is carved directly into the continuous heightfield in Python and exported into one shared binary collision format read identically by both the Rust server and the browser WASM.
  • Headless Blender 4.5 LTS manufactures every rock, cliff, stone arch, lantern, and building (pipeline/props/blender_author.py): Driven entirely from Git-versioned Python scripts through one consistent faceted style filter.
  • Live-WASM geometry census: Whenever Valley geometry changes, an automated census script walks simulated players through the game's actual compiled WebAssembly movement rules over rims, ledges, hollows, and bounds to catch stuck traps before shipping. For example, when I noticed getting snagged running off terrace edges, the census revealed why: my millimeter-strict slope rules refused even a 1 mm step onto a steep terrace wall, so a shallow mud dip just behind the rim left the lip millimeters above the player's feet and snagged 737 of 5,806 test walks. Lowering rim lips by 20 mm dropped snags down to 9 across a full-world walk census.
BEFORE: Early Valley exit passage before sculpting the faceted Pass Arch.
BEFOREEarly Valley exit passage before sculpting the faceted Pass Arch.
AFTER: Headless Blender faceted stone Pass Arch framing the Beta exit gate.
AFTERHeadless Blender faceted stone Pass Arch framing the Beta exit gate.
Carving the faceted Pass Arch framing the Valley exit gate in headless Blender (Nov 17) — bare terrain passage before (left) and sculpted stone arch after (right).
THE PALL (Nov 19) — early lore presence in-world: dark creeping Pall ground breaking through the terraced meadow.
THE PALL (Nov 19) — early lore presence in-world: dark creeping Pall ground breaking through the terraced meadow.

Fixing a Sneaky Windows Shader Bug & Shipping 60 FPS Twilight

In late November, I relaxed my strict August untextured-facet rules to chase real atmosphere — smooth painted ground variation, warm pools of light, and a world that actually changes mood across a full four-phase day/night cycle.

First, I hit a classic cross-platform WebGL gut punch on November 28: two GLSL ES 3.00 patterns that Linux and Android OpenGL drivers quietly accepted — sampling a sampler2DShadow inside a vertex shader (airSpecksVertex) and calling textureLod on a sampler2DShadow in a fragment shader — failed hard on Windows ANGLE Direct3D11 (FXC error X4532 and CONTEXT_LOST_WEBGL). Moving the shadow compare into uniform fragment control flow with standard texture() fixed all 15 Valley shaders, and verifying on my own desktop held 269–275 FPS across 77,012 frames with zero late shader compiles.

Then came the five-stage Valley Atmosphere pass:

  • Clear-foreground distance fog (fogStart) so your hero and nearby enemies stay razor-sharp while distant ridges soften into haze.
  • Six forward practical point lights and 27 glowing roadside lanterns guiding players naturally down the cobbled Gateyard road at dusk.
  • Baked radial (spherical) tree-crown normals so stylized canopies catch moonlight and sunbeams softly instead of showing harsh faceted seams.
  • Drifting mist wisps, subtle canopy breeze sway, procedural clouds, twinkling stars, and a silver-blue crescent moon — all inside 50 to 64 draw calls (167k–225k triangles) holding 60 FPS on phones.
DAY: Nov 28 — clear sunlit Gateyard terraces, painted ground variation, and distant ancient canopy silhouettes.
DAYNov 28 — clear sunlit Gateyard terraces, painted ground variation, and distant ancient canopy silhouettes.
TWILIGHT: Nov 28 — warm golden-violet dusk with 27 glowing lanterns coming alive along the cobblestones.
TWILIGHTNov 28 — warm golden-violet dusk with 27 glowing lanterns coming alive along the cobblestones.
Same Valley hub, shifting mood — crisp daylight (left) into warm lantern-lit twilight (right) inside 50–64 mobile draw calls.

I also came full circle on sound in R21i (November 29): back in August, the very first spec flatly stated "Audio: Dropped from v1." By the end of November, the game shipped with 76 compact audio clips (1.06 MiB total, lazy-loaded and cached, blending 17 CC0 community effects from creators like Kenney and rubberduck with bespoke ambient loops for the brook, campfire, cave, and twilight forest). Stepping out of the Gateyard with the lanterns glowing and the brook humming in the background was the exact moment The Pall stopped feeling like a technical demo and started feeling like a place I actually wanted to play.

FEN NIGHT: Nov 28 — low blue mist wisps, fireflies, and glowing blooms in the Valley's poison fen.
FEN NIGHTNov 28 — low blue mist wisps, fireflies, and glowing blooms in the Valley's poison fen.
BROOK BRIDGE: Nov 28 — cyan bridge lantern, rushing brook, faceted pass arch, and village rooftops beyond.
BROOK BRIDGENov 28 — cyan bridge lantern, rushing brook, faceted pass arch, and village rooftops beyond.
Exploring further into the Valley at dusk — glowing violet fen flowers and blue mist (left) and the lantern-lit Brook Bridge village approach (right).

In parallel with that November Valley polish, there was one massive question I had been stress-testing since November 7: the world felt alive and phones held 60 FPS — but how many concurrent players could my tiny €10.49/month ARM64 VPS actually survive before melting? When I started testing, six bots broke it.

FEATURED GAME · OPEN ALPHA · FREE (LV 1–6)

The Pall

A phones-first dark-fantasy browser MMORPG built on a custom Rust realm server — play the Levels 1–6 South Start Valley free in Open Alpha with zero app store install and no invite code required.

View The Pall →
RELEASE & DEVLOG ALERTS

Follow Future Deep Dives & Game Launches

No spam — only real engineering writeups, alpha updates, and launches.

← All Devlogs