Skip to content

Add terrain generation plugin#289

Open
vldvoiculescu wants to merge 2 commits into
Garux:masterfrom
vldvoiculescu:terrain-generator-plugin
Open

Add terrain generation plugin#289
vldvoiculescu wants to merge 2 commits into
Garux:masterfrom
vldvoiculescu:terrain-generator-plugin

Conversation

@vldvoiculescu

Copy link
Copy Markdown

Terrain Generator is a procedural BSP brush generation plugin for NetRadiant-custom. It generates playable geometry (terrain and tunnels) as func_group entities directly inside the editor, using configurable noise-based heightmaps.

Supported shapes: Flat, Hill, Crater, Ridge, Slope, Volcano, Valley, Tunnel, Slope Tunnel

Key features:

  • Generate from a selected brush (uses its XYZ bounds as the generation area) or from manual size input
  • Adjustable sub-square size, noise type (Perlin/Simplex/Random), variance, frequency, and terrace stepping
  • Texture selection integrated with Radiant's texture browser

Build command:

make MAKEFILE_CONF=msys2-Makefile.conf BUILD=debug DEPENDENCIES_CHECK=off DOWNLOAD_GAMEPACKS=no INSTALL_DLLS=no install/plugins/terrain_generator.dll

@Garux

Garux commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Found problems:

  • repeated show plugin window command shows unlimited number of plugin windows
  • generate from selection, undo: original brush is missing
  • generate from selected group entity: brush is removed, entity node is not (=empty group entity)
  • generate from selection, select different brush, generate - generated from 1st selection AABB; unchecking 'use reference' changes this; checkbox functionality is not clear, possibly should add a tooltip with info; 'generate from current selection' seems to be better behavior default; or if intent is to always use original AABB by default, it should be more clear for user, like do not update shown xyz values, better UI text
  • generate from small brush - 'no valid brush' message
  • 'pick' button does nothing in layouts w/o floating texture browser; would make sense to explain user what to pick in this case
  • click pick twice, tex bro is not auto hidden on selection
  • pick already picked shader - tex bro is not auto hidden; i suggest to only useTextureBrowser_show(), as it's good for UX, and remove the hide logic
  • weird symbols in feedback: TerrainGenerator: generating tunnel â�� bounds (1024 x 1024 x 64), step (64 x 64), texture: textures/

Ideas

  • it would be good to select generated stuff to make result more clear for user
  • if you care to manage texture unwrapping, brush API function accepting UV coords can be added, there is code in radiant to convert UVs to .map texture projection
  • it makes sense to flag generated brushes detail

@vldvoiculescu

Copy link
Copy Markdown
Author

Addressed from your list:

✅ Repeated command spawning unlimited plugin windows
✅ Undo leaving the original brush missing
✅ Generating from a group entity leaving an empty group
✅ Confusing "use reference" / wrong AABB on a different brush
✅ "No valid brush" message on a small brush
✅ Pick doing nothing without a floating texture browser
✅ Pick not auto-hiding (twice / already-picked shader)
✅ Weird symbols in console feedback
✅ Idea: select the generated geometry
✅ Idea: flag generated brushes as detail

Biggest refactor — removed the reference-values mechanism. Instead of the confusing "use reference" checkbox (which froze the first brush's AABB for the whole session), each generated func_group now stores its own footprint size as a key. Regeneration reuses that piece's stored size while taking position from the live selection — so it never accumulates, never picks up another brush's size, and follows the terrain if you move it. The checkbox and all the reference state/UI are gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants