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.

In This 7-Part Series: Building The Pall▾
- 01I Never Meant to Build an MMORPG: How an AI-Org Experiment Escalated Into The Pall6m
- 02One Prompt, 18 AI Employees, 76 Ticks — And Why the Charging Wolf Looked Like a Tree5m
- 03I Banned Three.js, Built Custom WebGPU, Tested Unreal and Unity, Then Came Back to Three.js6m
- 04The 6-Hour Crash Test That Failed on Interval #4,277 — And the 10% Slow Linux Clock7m
- 05583 Tracker Commits, Zero Features, and 192 GiB of Evidence: Cutting 85% of My Own AI Bureaucracy13m
- 06My Validator Rejected 21,500 Lines of AI Terrain (6,096 Floating Road Vertices) — Building the Valley in Code & Headless BlenderREADING
- 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.
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!).

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.


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.



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.


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.


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.
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.