Files
EVEngine/examples/linear-structures
西风逍遥游 f7962f43fe feat(examples): developer-experience and AI-native showcase examples
- devlab: flagship --debug example (console/snapshot/AI panel/pause/hot
  reload/error slice), make devlab target with RUN_ARGS support
- ai-game: agent-drivable live game + agent_demo.py (pause/read/mutate/
  verify/snapshot/restore/screenshot loop)
- ai-editor: headless eve mcp editor host demo (JSON View + ViewModel MVVM)
- examples: fill all missing READMEs + config.nut, add examples/ index
- load.nut: add key_just_pressed/clampf/persist helpers; dedupe 19 examples
- rpg/cardgame: move JSON definitions to data files
- fix eve mcp crash: ModuleManager::requireAll() instantiates modules in
  the headless host (IEditorHost etc. were null)
- graphics: actionable screenshot error when readback was just enabled
- CI: smoke all examples (devlab with --debug) + DevLab hot-reload test

Fixes surfaced by the new CI smoke (examples had never been smoke-tested):
- scene_director kit: camera slot doubled as function + instance and was
  nulled by reset(); move the live Camera3D into cameraObj
- readTextFile used non-existent readn()/len(); use file.read()
  (rpg/cardgame/hex-levels)
- daynight used non-existent keyboard.wasPressed() -> key_just_pressed
- outline passed ints to float-only drawSolidRect; linear-structures
  slider passed an int value
- scene-ecs beginNode() requires (id, name); ai-stage guarded compilestring
- smoke_examples.sh: timeout -k 3 so SIGTERM-ignoring hosts cannot hang CI
2026-08-21 19:18:52 +08:00
..

Linear Structures — tileable procedural 3D props

A rendering test for the procgen mesh recipes that build linear, tileable structures from a single unit segment repeated along the X axis. Six recipes are demonstrated side by side:

Recipe Structure
mesh.fence wooden fence (posts + 3 rails)
mesh.stonewall stone wall (rubble body + cap)
mesh.bridge bridge (deck + handrails + cross beams)
mesh.greatwall Great Wall (body + walkway + outer merlons + inner guard)
mesh.hedge hedgerow (leafy base + bush blobs)
mesh.chevaldefrise cheval de frise (top rail + crossed X legs + feet)

The textures are CC0 images downloaded from Wikimedia Commons (see ATTRIBUTION.md), loaded with wrap sampling so the grain/brick tiling stays continuous across unit seams. If an asset file is missing the example falls back to a procedural texture, so it still runs.

Run

make run/win32-debug GAME=examples/linear-structures

Controls

  • Tab — cycle through the six structures.
  • + / - — grow / shrink the number of repeated units.
  • Segments / Unit length sliders rebuild the active structure live.
  • Pause rotation button (or toggle in code) orbits the camera.

Reusable API

local p = procgen.newParams();
p.setInt("segments", 8);      // repeat count along X
p.setFloat("segLength", 2.0); // length of one tileable unit
p.setFloat("height", 1.5);    // per-kind override
p.setFloat("uvRepeat", 2.0);  // texture repeats per world unit
local mesh = procgen.generateMesh("mesh.stonewall", p, gfx);

Shared params: segments, segLength, height, depth, thickness, scale, uvRepeat. Each unit is designed so its cross-section at x=0 matches x=segLength, so tiling is seamless.