Videos / Episode 4
Episode 4 · AI Game Development

World, Plants and Sky

Planned YouTube title: AI Game Development - World, Plants and Sky Ep4

How the world of KnightZ was built: real elevation data, rules for map scale, 99 hand-built plant sets with four seasons, more than 60 million plants placed by script, and a volcanic ash sky.

Video coming soonBreakdown published Oct 23, 202613 segments11 maps99 plant sets
Episode 4 title card: World, Plants and Sky
Video coming soonRecording early next week. The full breakdown is below.

Overview

Eleven maps of real ground, 99 plant sets built by hand, more than 60 million plants placed by script, one switch for the seasons and a sky full of volcanic ash. This is how the world of KnightZ was built in two weeks with Claude, Blender and Unreal Engine 5.

Episode 4 covers the environment pipeline from the ground up: real elevation data turned into game terrain, rules for how big a map should feel on foot, plans that place every tree and building, rivers that flow, trees and plants modelled in Blender instead of bought, a season system that drives every leaf, and a custom sky. Each step lists the tools, the numbers and the mistakes that cost time.

11region maps from real elevation
99hand-built plant sets
60 M+plants placed across the maps
4seasons from one switch
Video status. The video for this episode is being recorded now. This page is the full written breakdown and goes live first. The RoadMap has the checklists behind every section below.

Episode plan

#SegmentWhat it shows
1Cold openOne woodland view turning through spring, summer, autumn and winter
2Real groundElevation data and rivers turned into 2017 x 2017 heightmaps
3How big is a map?Crossing time, true-size story sites and squeezed empty land
4Plans before propsPlacement plans, gray box and biomes
5WaterOne continuous river surface and the ford
6Trees from BlenderWhy the bought packs went, and how a tree is built
7Shrubs, climbers and 54 ground plantsFour seasons on one texture sheet
8Five million plantsThe environment test map and the density rules
9One plant list per regionCore, minor and exclusive sets
10The season switchGrass height and autumn colour groups
11The ash skyTwo cloud layers, sun cover, lightning and a red moon
12Streaming and performanceWorld Partition grids and draw distances
13Lessons and what's nextSix mistakes and the next episode

Software and tools

ToolRole in this episode
Claude (desktop app)Planning, every script, review of every capture, project docs as memory between sessions
Claude skills/newtree builds a tree species from a reference folder; plant and shrub procedures saved as docs
Blender 5.2 with Blender MCPTrees, shrubs, climbers, 54 ground plants, water mesh, impostor and wind bakes
Unreal Engine 5.8 with Unreal MCPLandscapes, World Partition, foliage placement, materials, sky system in C++
PythonHeightmaps, placement plans, biome maps, density maps and the season switch
Copernicus GLO-3030 m surface elevation data for the real terrain
OpenStreetMapRivers, brooks and lakes (ODbL)
Pivot Painter 2Per-branch wind on the trees
Git with LFSEvery map and asset committed from the editor

Real ground from elevation data

The game is set in western Britain in AD 548, so the land is real. Each region map starts from a window cut out of satellite elevation data around the real place.

1Get the elevation

Copernicus GLO-30 is a free 30 m surface model of the world. It is a surface model, so it includes trees and buildings. A grey-scale opening with a 90 m kernel strips them off and leaves the ground.

2Add the water

Rivers, brooks and lakes come from OpenStreetMap. Modern water is removed: canals, reservoirs, fish pools and park lakes. River banks are regraded with runoff gullies so the water sits in a believable channel.

3Write the heightmap

Each map becomes a 2017 x 2017 pixel, 16-bit heightmap with masks for forest, field, meadow, moor, marsh, road, river, ruin and rock, plus a metadata file with the exact scale for Unreal. Building pads are flattened into the ground where the manor and other sites stand.

Hillshade of the real terrain at the manor with the Severn
The manor window: hillshade from the elevation data with the Severn loop in blue.
River channel cut into the terrain
The river channel cut into the ground with the brook joining from the south.
River banks before and after regrading
River banks before (left) and after the regrade with runoff gullies (right).
MapGround range in gameReal reference
M03 The Wrekin103 to 396 mSummit 407 m
M04 Wenlock Edge96 to 276 mEdge top about 280 m
M06 The Long Mynd221 to 512 mPole Bank 516 m
M07 The Stiperstones247 to 523 mManstone Rock 536 m
M10 The Clee Hills183 to 532 mAbdon Burf 540 m
M11 Salinae26 to 59 mRiver about 30 m, hill about 55 m
Lesson. Summits read 4 to 14 m low. The same 90 m opening that strips trees also trims narrow hilltops. A summit restore pass is on the list.

How big should a map feel?

A real valley takes a long time to cross on foot. The rules below were settled in one design session and applied to every map.

  • Measure in time. Crossing a map at a 5 m/s jog should take 10 to 15 minutes.
  • True size by default. Only empty land (moor, bog, deep wood, long field runs) can be squeezed, and never more than 2x.
  • Places stay true size. The manor, buildings, towns, ruins and fords sit in keep zones that are copied 1:1. Buildings are moved, never scaled.
  • Height is never compressed. Squeezed land gets steeper, so slopes over 33 degrees outside keep zones are smoothed (30 passes).
  • Density target. Something worth stopping for every 1 to 2 minutes of walking.
  • The simulation keeps real acres. The fields you see are a sample of real-size strips; the manor's books use the true total.
Crossing time for each region map
Crossing time for every map. Five maps are squeezed by 1.15x to 1.25x, the rest are true size. Salinae is a small town map by design.

The warp is separable and monotone, so rivers stay continuous. Every later tool converts real coordinates to game coordinates through the same warp table stored with the map.

Owner decisions before the overnight build (condensed)
Scope: rebuild M02 to M10, build M11 Salinae new.
Elevation: same source and method as M01 (bank regrade with runoff gullies, building pads).
Scale: compress per the map scale procedure. Keep zones 1:1, height never scaled, slopes capped.
Foliage: M01 density, our own plants only, per the plant allocation by map.
Clearings: building footprint + 8 m with no trees, shrubs or tall plants;
short grass allowed from 2 m outside the walls.
What it did: Claude rebuilt ten maps overnight with no step errors.
Why it worked: every rule pointed at a saved project doc, so nothing had to be explained twice, and the clearing rule was a number, not a description.

Plans before props

Nothing is placed by hand. A Python planner per map reads authored zones (the manor, fields, coppice, ford, ruins) and writes rule rasters at 1 m. Trees, props and buildings are then scattered with Poisson spacing so nothing overlaps and nothing lines up.

  • The hub gray box: 49,259 placeholder props in 74 sets, so scale and walking time could be tested before any art existed.
  • The coppice wood near the manor is managed the period way: six panels cut on rotation under oak standards.
  • Every building pad is cleared for its footprint plus 8 m.
Gray-box manor with placeholder buildings
The manor in gray box: placeholder blocks and props on the real ground before final art.

Biomes

Each map is split into biomes from the plan masks and the terrain: slope, height above the nearest water, altitude over 250 m, building footprints and scene zones. Edges are softened with noise so one biome bleeds into the next.

Biome maps for ten regions
Biome maps for M02 to M11. Dark green woodland, light green pasture, purple moor, blue-green wet ground, yellow fields.
MapMain biomes
M05 The Long ForestWoodland 80%, wet woodland along the brooks 16%
M06 The Long MyndHeather and bilberry moor 58%, batch woods 20%, bog and flush 8%, rock and scree 4%
M09 The MeresMere-country woods and carr 56%, pasture 25%, water 6%, bog 3%
M11 SalinaePasture 54%, strip fields 17%, town 11%, wet grassland 7%

Water that flows

The Severn, the mill leat and the brook share one continuous water mesh built in Blender: 9 tiles, 119,000 triangles, with the flow direction baked into the mesh. The material moves the surface downstream, lightens it in the shallows and fades it at the banks.

  • The Severn is about 3 m deep.
  • The ford is 50 cm deep, so it can be waded.
The ford on the Severn
The ford: shallow enough to cross on foot.
River and alders under the ash sky
The river with alders on the bank, under the ash sky.

Trees built in Blender

The first plan was to buy foliage. An audit of the bought packs changed that: most did not match the period or the region, some had no textures, and the clean-up removed 2,911 packages and 13 GB. New rule: only fully textured packs are kept, and every plant in the game is built for KnightZ.

1Grow a skeleton

A Python script grows each tree in four levels: trunk, limbs, branches and branchlets, with twigs and leaf cards riding on the last level. Rules per species set the shape: a tall leader for ash, a cone for alder, a dense tangle for hawthorn.

2Bark and leaf cards

Bark is tiled with species detail. Leaves are cards cut from a leaf sheet with opacity, roughness and translucency packed into one mask.

3Wind

Pivot Painter 2 stores a pivot and a direction for every branch, so wind moves the trunk, limbs, branches and twigs separately.

4Far trees

Impostors: the tree is rendered from 144 directions (12 x 12) into a 2048 atlas. Past a set distance the mesh is swapped for one flat card that shows the right view.

5Seasons and budget

Each species has mature, young and old forms and spring, summer, autumn and winter states. Young oaks keep their brown leaves through winter, as real ones do. Full detail is capped at 5,000 triangles.

Oak variants in summer and winter
The oak set: young, mature, veteran, pollard and dead forms in summer (top) and winter (bottom).
Ash and alder variants in summer
Ash and alder, summer.
Ash and alder variants in winter
Ash and alder, winter.
Oaks in Unreal with wind
Oaks in Unreal with per-branch wind.
A row of trees fading from mesh to impostor
Distance test: meshes near the camera, impostor cards far away.
Building a new species
/newtree "Rowan reference folder"
What it does: the skill reads the reference photos in the folder and builds mature, young and old forms in three seasons with levels of detail and the 5,000-triangle cap, then updates the procedure and writes the Unreal import notes.
Why it matters: after the oak, every species was a one-line prompt. 21 species and 66 meshes exist now.

The full species list with every step is on the Trees checklist.

Shrubs, understory and climbers

Below the canopy sit 11 shrubs (hazel coppice, hawthorn and blackthorn thickets, holly, elder, osier willow, dog rose, dogwood, spindle, guelder rose and juniper), 4 understory plants (bracken, bramble, heather and bilberry) and 2 climber kits.

The ivy kit has mats, caps, edges, hangs and stems for ruined Roman walls. The honeysuckle kit has twines, loops, sprays and hangs. Both are also baked onto host trees, split by species so each region gets its own: birch on the Wrekin, wych elm on Wenlock Edge, lime in the Long Forest, alder in the Meres and ash on the Clee Hills.

Ivy kit pieces
The ivy kit.
Dogwood in autumn
Dogwood in autumn, one of the Wenlock Edge plants.

54 ground plants, four seasons on one sheet

The ground layer has 54 plants: woodland flowers, ferns, mosses, fungi and litter; grasses and meadow herbs; reeds, sedges and bog plants; and the crops of the manor (spelt, six-row barley, oats, rye, peas, field beans, flax, leeks, onions, garlic, brassicas and orchard fruit). Each is under 1,000 triangles.

One texture sheet, four seasons

Every plant's texture sheet is split into four quarters: spring top-left, summer top-right, autumn bottom-left, winter bottom-right. The material shifts the texture coordinates by half a sheet to pick the season, so a season change costs nothing at run time and needs no second mesh.

Bluebell in spring, summer, autumn and winter
Bluebell from one mesh and one sheet: spring, summer, autumn and winter.
Six-row barley card sheet
A crop card sheet: six-row barley.
Ramsons close-up
Ramsons, spring.
Flax close-up
Flax, one of the manor crops.

All 54 with their regions are on the Ground Plants checklist.

Five million plants on a test map

The hub was copied to an environment test map, 3 km by 3 km, so ground cover could be tuned without touching the real map. The ash sky was swapped for plain white light there so plant colours could be judged on their own.

  • 10 biomes from the existing masks: grazed pasture, woodland interior, wood edge, hay meadow, wet grassland, river bank, fallow, two crop fields and the manor gardens.
  • 44 plant layers, each with its own meshes, spacing, scale and random seed.
  • Density = biome weight x clump noise (8 to 45 m) x broad noise (160 m). That gives drifts, thin grazed patches and carpets of one flower.
  • 5,244,259 plants, grouped into one batch per mesh per 256 m cell.
Plant sizeDraw distance
Litter and moss30 to 60 m
Short herbs60 to 110 m
Tall herbs and tussocks140 to 200 m
Reeds320 m
Crops650 m
Woodland floor with bluebells and ferns
Woodland floor.
Hay meadow
Hay meadow.
Strip field of grain
Crop strips.
Pasture with clover and buttercups
Pasture after the ground-grass fix.
Black leaves. Leaves turned black under some light angles. The cause was the normals on the leaf cards. The fix went into the shared plant materials, so every plant in the project was fixed at once.

After the owner approved the test map, the same planting was rebuilt on the real hub: 5,559,591 plant instances, 33,681 trees and shrubs and 249,300 crop tiles.

One plant list per region

All 99 plant sets were assigned to the 11 maps by real habitat. Core sets are the dominant or signature plants of a map; minor sets appear at low weight. Every map has at least one set of its own, so each place looks different on the ground.

MapPlants found only here
M01 Pengwern (the manor)Orchard apple and pear, spelt, barley, peas, field beans, flax
M02 ViroconiumFeral plum from Roman gardens, elder scrub, ivy on ruined walls
M04 Wenlock EdgeWych elm, dogwood, spindle
M05 The Long ForestSmall-leaved lime, wild cherry, honeysuckle, holly understory
M06 The Long MyndJuniper
M07 The StiperstonesReindeer lichen
M08 The High CountryRowan
M09 The MeresAlder and willow carr
M11 SalinaeAsh pollards, guelder rose
Plant sets by region
Plant sets assigned to each region.
Trees and ground plants per map
Plants placed per map after the overnight build. The Long Forest has the most trees; the moors carry the most ground plants.
The Wrekin in autumn
The Wrekin: hanging woods below the open crest.
Heather and bilberry on the Long Mynd
Pole Bank on the Long Mynd: heather and bilberry.

The season switch

One call sets the season for the whole project: set_season('autumn'). It drives the plant material parameters, the older tree materials and the day of the year for the sun.

SeasonSheet quarterGrass heightLeavesSun day
SpringTop leftHalfFresh green120
SummerTop rightFullFull growth196
AutumnBottom leftFullColour by species303
WinterBottom rightFull, deadBroadleaf trees bare15
Autumn groupSpecies
RedHawthorn, blackthorn, bramble, dog rose, wild cherry, rowan, dogwood, spindle, guelder rose, crab apple, bilberry
OrangeField maple, apple, pear, plum, both oaks
RustBracken
GoldAsh, birch, hazel, willow, lime, wych elm, elder, alder
Stays greenHolly, yew, juniper, heather, moss, clover
The same woodland in four seasons
One woodland view in spring, summer, autumn and winter.
Floating trees. Trees were placed with collision on, so later trees landed on the crowns of earlier ones. All 233,344 trees, shrubs and crops were dropped again with collision off: 7,971 moved, and a check of 6,158 found none floating. Placement now always runs with collision off.

The volcanic ash sky

Twelve winters after the sun went grey, the light comes through ash. The brief for the sky was short:

Sky brief (condensed)
Black volcanic ash clouds. Lightning every 20 to 30 minutes, not constant.
Thin high cloud always over the sun so it glows red.
Now and then a heavy black cloud covers the sun: darker, but never black, always a red glow.
A dim red moon at night.
What it did: Claude wrote one sky system in C++ that drives the sun, moon, clouds, lightning and haze together.
Why it worked: every line is something you can see and check in a screenshot.
PartSetting
Heavy ash layer1.5 to 5.3 km, drifting coverage
High veil8.5 to 10 km, always present, keeps the sun red
Gap toward the sunHeavy ash thins along the sightline, wider at low sun
Sun coverA heavy cell every 6 to 14 minutes for about 150 s; light floor 30 percent
LightningEvery 20 to 30 minutes, 1 to 3 strokes, 3 to 12 km away
ThunderDelayed by distance at 343 m/s
Day48 minutes, red moon at night
The manor under the ash sky with the sun showing
Sun clear: ground brightness 17.
The manor with a heavy cell over the sun
Sun covered: ground brightness 7, never black.
Lightning inside the ash
Lightning lights the inside of the ash.
Night under the red moon
Night under the red moon.
Two crashes. The editor crashed in the cloud shadow pass because the cloud material was not flagged for volumetric cloud use. Setting that flag fixed it. A second crash at startup came from a cloud layer saved with an unfinished shader, so the layer is now created at run time, only after its shaders are ready.
The hall lit by firelight
Inside, firelight: the hall has 12 lights sharing one flicker pattern.

Streaming and performance

Every map is a World Partition level. Content is split into grids that load at different distances, so the player only holds what is near.

GridCell sizeLoading range
Terrain512 m6 km
Trees256 m700 m
Buildings256 m600 m
Detail128 m300 m
Ground cover256 m200 m
  • Distant trees switch to a hierarchical level of detail with impostor cards.
  • Grass and small clutter fade at 50 to 80 m; shrubs at 150 to 300 m.
  • First standalone measurement at the hub's north gate: about 6.7 ms per frame (about 150 fps) with about 570,000 plant and prop instances in range, before the five-million-plant pass.
  • The ten new maps hold about 8.8 GB of streamed actor files between them.

Lessons

#MistakeFix
1Bought foliage that did not fit the periodBuild every plant for the game; keep only fully textured packs
2Trees placed with collision on landed on other treesPlace with collision off, switch it on after
3A re-run left the first ground-cover pass behindWorld Partition only deletes loaded actors: load the folder first
4Grass kept spawning old meshesRecompile and save the terrain material, then flush the grass cache
5Console commands during a level load crashed the editorNever run them from Python while a map is loading
6Summits 4 to 14 m lowThe tree-stripping filter trims narrow tops; restore pass planned

What's next

  • Autumn colours for the older oak, ash and alder canopies.
  • Summit restore on the ten new maps and a far-view build for each.
  • Replace the placeholder blocks with finished buildings and scene sets (see the Buildings checklist).
  • Playtest each map for crossing time and points of interest.

Episode talking points

Show the talking points

Cold openSame woodland, four seasons, one switch. Every plant here was built for this game in Blender. Here's how the world came together.

Real groundSatellite elevation, trees stripped off, real rivers cut in. Eleven maps of real Shropshire, each a 2017 pixel heightmap.

ScaleReal land is slow to cross. Rule: 10 to 15 minutes at a jog, story places true size, only empty land squeezed, height never squeezed.

PlansNothing placed by hand. Zones, 1 m rules and Poisson spacing; gray box first, 49,259 placeholders on the hub.

WaterOne continuous river mesh with the flow baked in. Severn 3 m deep, ford 50 cm.

TreesBought packs out: 13 GB deleted. Skeleton, cards, Pivot Painter wind, impostors, seasons, 5,000 triangles. Then /newtree for the other 20 species.

Ground plants54 plants, four seasons on one sheet, under 1,000 triangles each.

Five millionTest map, 10 biomes, 44 layers, density from noise. Five million plants, then onto the real hub.

Regions99 sets, each map with plants of its own. 60 million plus across all maps.

SeasonsOne call. Grass height, colour groups, the sun's day. The floating trees bug.

SkyThe brief in four lines. Two cloud layers, sun cover, lightning, red moon. Two crashes and their fixes.

PerformanceWorld Partition grids, draw distances, 6.7 ms at the gate.

WrapSix lessons, the RoadMap page, next episode.