Commit graph

97 commits

Author SHA1 Message Date
Kelsi
312a7e03e0 fix(editor): update minimap legend with hole indicator 2026-05-05 08:09:13 -07:00
Kelsi
aed6e00aac feat(editor): Generate Complete Zone now includes water fill + beach smoothing 2026-05-05 08:07:49 -07:00
Kelsi
426863f19a feat(editor): smooth beaches tool for natural water-land transitions
- Smooth Beaches button in Water panel: creates gentle beach slopes
  near water level by blending terrain toward waterline height
- Configurable beach width (15 units default)
- Quadratic falloff creates natural concave beach profile
- Use after filling water to soften harsh land-water edges
- Workflow: sculpt → fill water → smooth beaches → paint sand
2026-05-05 08:06:20 -07:00
Kelsi
c8897eca83 feat(editor): Create + Generate button in New Terrain dialog 2026-05-05 08:04:05 -07:00
Kelsi
171fff3843 chore(editor): include editor version in zone manifest export 2026-05-05 08:02:38 -07:00
Kelsi
e7ce94448a chore(editor): update About dialog with current stats 2026-05-05 08:01:09 -07:00
Kelsi
b113c218bd feat(editor): voronoi cell noise for organic terrain patterns
- Voronoi noise generator: creates cell-like terrain patterns with
  ridge features at cell boundaries (F2-F1 distance field)
- Configurable cell count (5-100) and amplitude
- Toggle between Value noise and Voronoi in the noise generator section
- Creates interesting mesa/plateau formations and organic shapes
- Random cell centers with per-cell height variation
2026-05-05 07:59:10 -07:00
Kelsi
e65fc7caa2 chore(editor): bump version to 0.2.0 (89 commits, 8.9k lines) 2026-05-05 07:57:09 -07:00
Kelsi
d247aee728 fix(editor): Generate Complete Zone resets terrain first for clean slate 2026-05-05 07:54:26 -07:00
Kelsi
5f9bf5c924 feat(editor): height offset tool for shifting entire terrain up/down
- Offset Heights: shifts all terrain heights by a constant amount
  (-100 to +100 range with Apply button)
- Useful for raising terrain above water level or sinking below
- Slider + Apply button in the Noise Generator section
2026-05-05 07:53:01 -07:00
Kelsi
d50e4b3f78 feat(editor): invert button in sculpt panel alongside reset 2026-05-05 07:51:21 -07:00
Kelsi
825939db3b feat(editor): invert heights, fill entire tile with water, remove all water
- Invert Heights: flips terrain upside-down around midpoint (mountains
  become valleys and vice versa)
- Fill Entire Tile with Water: one-click fills all 256 chunks at the
  configured water height and liquid type
- Remove ALL Water: clears water from every chunk instantly
- Water panel now has three water operations: fill tile, remove under
  brush, remove all
- fillWater() and invertHeights() methods on TerrainEditor
2026-05-05 07:49:48 -07:00
Kelsi
bd1356bd08 fix(editor): enlarge sculpt panel default size for all generators 2026-05-05 07:46:46 -07:00
Kelsi
2d5692d5ad feat(editor): thermal erosion simulation for natural terrain aging
- Thermal Erosion: physically-based material transfer where steep
  slopes shed material to neighbors based on angle of repose
- Configurable iterations (1-50) and talus angle (10-80 degrees)
- Lower talus angle = more aggressive erosion (sandy terrain)
- Higher angle = less erosion (rocky terrain holds steep slopes)
- Creates natural talus fans at cliff bases and rounded hilltops
- Workflow: sculpt/generate → thermal erosion → smooth → auto-paint
2026-05-05 07:45:16 -07:00
Kelsi
9be32a6634 feat(editor): terrain terrace/step generator for layered landscapes
- Terrace tool: quantizes terrain heights into N flat shelves
  (like rice paddies, cliff shelves, or stepped pyramids)
- Configurable step count (2-20)
- Finds actual height range and divides evenly
- Auto-stitches chunk edges after terracing
- Useful for creating tiered arenas, agricultural zones, or
  stylized Meso-American terrain
2026-05-05 07:43:10 -07:00
Kelsi
f3846919a4 feat(editor): winding canyon generator with seeded sine-wave path
- Canyon Generator: carves a winding canyon across the entire tile
  using layered sine waves for natural serpentine shape
- Configurable width, depth, and seed for different canyon shapes
- Quadratic falloff at edges for smooth cliff walls
- Random seed button for quick shape exploration
- Fill with Water mode for instant river canyon
2026-05-05 07:37:27 -07:00
Kelsi
7971fd7989 feat(editor): island terrain generator with beach falloff
- Island Generator: creates raised center terrain dropping to edges
  with configurable center height and edge drop depth
- Flat interior plateau → gradual beach slope → steep underwater drop
- Preserves existing noise detail at 30% blend for natural variation
- Add water around the island for instant ocean environment
- Workflow: New Terrain → Island → Noise → Smooth → Auto-paint
2026-05-05 07:35:18 -07:00
Kelsi
f15fbf508f feat(editor): Reset + Apply noise button for quick terrain iteration 2026-05-05 07:32:41 -07:00
Kelsi
623aeff417 feat(editor): Ctrl+N and Ctrl+O shortcuts for New/Load dialogs 2026-05-05 07:31:20 -07:00
Kelsi
97f1d9c003 docs(editor): add quick actions to help overlay (Ctrl+N/O, middle-drag) 2026-05-05 07:29:04 -07:00
Kelsi
47bf2d662b feat(editor): random seed button for noise generator 2026-05-05 07:28:14 -07:00
Kelsi
629bfd6377 feat(editor): hole indicators on minimap (H marks on chunks with terrain holes) 2026-05-05 07:26:54 -07:00
Kelsi
9a3b253b14 feat(editor): frustum culling toggle in View menu 2026-05-05 07:25:32 -07:00
Kelsi
e516c3c71f feat(editor): one-click Generate Complete Zone pipeline
- File > Generate Complete Zone: runs the full procedural pipeline
  in one click: noise → smooth (3 passes) → recalc normals →
  height-based auto-paint (sand/grass/rock/snow) → slope-based
  cliff paint (rock on steep faces)
- Creates a fully textured, natural-looking zone from flat terrain
- Removed stale quickGenerate checkbox from New Terrain dialog
2026-05-05 07:21:59 -07:00
Kelsi
59c6dab2b3 feat(editor): auto-paint by slope for natural cliff texturing
- Auto-Paint by Slope: paints rock texture on steep terrain surfaces
  with configurable slope threshold (0.1 - 0.9)
- Uses per-vertex normal Z component to detect steepness
- Alpha blending based on slope gradient for smooth transitions
- Workflow: sculpt terrain → recalc normals → auto-paint slope → rock
  appears naturally on cliffs while flat areas keep their biome texture
2026-05-05 07:19:05 -07:00
Kelsi
8aee357a34 feat(editor): selected object name labels in viewport 2026-05-05 07:16:52 -07:00
Kelsi
2ed521a8f7 feat(editor): NPC name labels floating above markers in viewport
- Creature names rendered as screen-space text above each NPC marker
- Red text for hostile, green for friendly
- Labels project from 3D world position to screen coordinates
- Only visible when NPC is in front of camera (clip.w > 0)
- Much easier to identify placed creatures at a glance
2026-05-05 07:15:12 -07:00
Kelsi
0742abfe94 fix(editor): separate NPC marker updates from M2 rebuild cycle
- NPC placement now only updates cheap marker geometry (no M2 reload)
- Full M2 rebuild only triggers when PLACED OBJECT count changes
  (not NPC count — NPCs use markers, not M2 instances for now)
- Split lastObjectCount_ into lastObjCount_ + lastNpcCount_ to track
  objects and NPCs independently
- Prevents the destructive clear+reload cycle that caused GPU crashes
  when rapidly placing multiple NPCs
2026-05-05 07:13:24 -07:00
Kelsi
16308011ee fix(editor): filter bad M2 models, toast on tile not found, robustness
- Filter known effect/particle models from NPC presets (alliancebomb,
  blackhole, etc.) that cause vertex explosions — these are particle
  effect models misclassified as creatures
- "Find Tile" button now shows toast when no ADT exists for a map
- Vertex validation catches NaN/infinite/extreme positions before GPU
- These models are now skipped entirely from the creature browser
2026-05-05 07:10:29 -07:00
Kelsi
c60ddcfed4 fix(editor): stop destructive M2 rebuild on every NPC click, fix Clear All
Root cause of GPU crashes (VK_ERROR_DEVICE_LOST): every NPC placement
triggered a full clear+reload of ALL M2 models. After several cycles
the GPU state corrupted, causing vertex explosions and device lost.

Fixes:
- NPC placement now only updates cheap marker geometry (no M2 reload)
- Full M2 rebuild only happens when object COUNT changes (not every click)
- clearAllObjects() properly resets viewport, placer, spawner, markers,
  and history in one call with vkDeviceWaitIdle fence
- New Terrain uses clearAllObjects() for consistent reset
- Clear All menu item calls clearAllObjects()
- M2 vertex validation: rejects models with NaN/infinite/extreme
  vertex positions before GPU upload (prevents vertex explosions)
- NPC marker building extracted to updateNpcMarkers() method
  (can be called independently without M2 rebuild)
2026-05-05 07:07:33 -07:00
Kelsi
1c58911da0 feat(editor): ridge/mountain range generator between two points
- Ridge Generator: creates mountain ranges by setting start and end
  points, with configurable width and height
- Cross-section uses quadratic falloff, along-axis uses sqrt taper
  for natural mountain range silhouette (wider at center, tapering
  at both ends)
- Same start/end workflow as river/road tools
2026-05-05 07:00:05 -07:00
Kelsi
d6c58b5dc9 feat(editor): hill/valley generator with smooth bell curve shape
- Hill Generator: creates smooth bell-curve hills at cursor position
  with configurable radius and height
- Valley mode: same shape inverted, creates natural depressions
- Uses (1-t^2)^2 falloff for very smooth natural-looking slopes
- Two buttons: "Create Hill" and "Create Valley" for quick terrain
  shaping without switching brush modes
2026-05-05 06:57:18 -07:00
Kelsi
88416bbb1d fix(editor): NPC markers always on top, mesa generator, terrain tools
- NPC markers now render with NO depth test (via gizmo pipeline) so
  they're always visible even on sloped/rough terrain
- Mesa/Plateau generator: creates raised flat areas with steep cliff
  edges — configurable radius, height, and edge steepness
- NPC markers drawn after gizmo in the render pipeline to guarantee
  they appear on top of everything
- Fixes NPC visibility on non-flat terrain
2026-05-05 06:55:04 -07:00
Kelsi
1502c2ed85 feat(editor): crater generator for lakes, arenas, impact sites
- Crater Generator in Sculpt panel: creates a bowl-shaped depression
  with configurable radius, depth, and raised rim height
- Parabolic bowl interior with sinusoidal rim and smooth outer falloff
- Perfect for creating lakes (fill with Water mode), arenas, or
  impact craters for volcanic zones
- One click at cursor position, uses brush position for center
2026-05-05 06:50:24 -07:00
Kelsi
496f97f9db feat(editor): middle mouse orbit camera around terrain point
- Middle mouse drag orbits camera around the terrain point under cursor
  (or 100 units ahead if no terrain hit)
- Maintains distance from pivot while rotating yaw/pitch
- Much more intuitive for inspecting terrain features, placed objects,
  and NPC positions from different angles
- Works alongside right-drag (free look) and WASD (fly)
2026-05-05 06:48:05 -07:00
Kelsi
62cfb92c38 feat(editor): persistent window layout between sessions (ImGui ini) 2026-05-05 06:45:13 -07:00
Kelsi
6e62cab8bc docs(editor): add terrain tools workflow to help overlay 2026-05-05 06:43:45 -07:00
Kelsi
5d50a29d44 feat(editor): brush radius indicator on minimap
- Yellow circle on minimap shows current brush position and radius
- Scales proportionally with terrain tile size
- Visible in all brush-based modes (Sculpt/Paint/Water)
- Helps orient where you're working relative to the full tile
2026-05-05 06:42:16 -07:00
Kelsi
f593606251 feat(editor): reset-to-flat button for terrain, consolidation
- "Reset to Flat" button in Noise Generator section: zeroes all heights
  across entire tile for starting over without creating a new terrain
- Useful workflow: reset → noise → smooth → scale → clamp → auto-paint
2026-05-05 06:40:26 -07:00
Kelsi
3ac40d27ad feat(editor): road flattener tool alongside river carver
- River/Road Carver section now has two modes:
  - River: carves a channel below terrain (existing)
  - Road: flattens terrain to interpolated height between start/end
- Road mode smoothly transitions height along the path with quadratic
  falloff at edges for natural embankment shape
- Set Start → Set End + Apply workflow works for both modes
- Roads follow terrain slope by interpolating between start/end heights
- Pair with Paint mode to add cobblestone/dirt texture on the road
2026-05-05 06:37:54 -07:00
Kelsi
d253aed635 feat(editor): Find Valid Tile button, improved ADT loading workflow
- "Find Valid Tile" button in Load dialog: auto-scans manifest for the
  first available ADT tile of the selected map (checks center range
  25-45 first for open world, then full 0-63 for dungeons)
- Fixes "wrong coords" issue — dungeons use different tile coords than
  open world maps, now auto-detected
- Map name lowercased for manifest lookup consistency
- Tile check shows green "Tile found" or red "Tile not found" indicator
2026-05-05 06:35:37 -07:00
Kelsi
79a091526e fix(editor): much larger NPC markers, river carver tool
- NPC markers now 30 units tall with octagonal base, colored pole,
  and yellow diamond at top — visible from any camera altitude
- Red pole = hostile, green pole = friendly, yellow top = all NPCs
- River/Path Carver: set start point, set end point, carves a channel
  between them with configurable width and depth
- Smooth quadratic falloff at edges for natural riverbank shape
- Pair with Water mode to fill carved channels
2026-05-05 06:32:39 -07:00
Kelsi
d573f3a678 feat(editor): river/path carver tool for terrain channels
- River Carver in Sculpt panel: carves a channel between two points
  with configurable width and depth
- Set Start at cursor, then Set End + Carve to create the channel
- Smooth quadratic falloff at edges for natural riverbank shape
- Works by projecting each terrain vertex onto the line segment and
  lowering height based on distance from center
- Auto-stitches chunk edges after carving
- Pair with Water mode to fill the carved channel with liquid
2026-05-05 06:30:26 -07:00
Kelsi
14bb2cf7de feat(editor): one-click flatten platform for building sites
- "Create Flat Platform at Cursor" button in Sculpt panel
- Instantly flattens terrain under brush radius to cursor height
- Perfect for creating building sites, road beds, camp grounds
- Applies 30 iterations of flatten for a thorough result
- Restores previous brush mode after completion
2026-05-05 06:28:05 -07:00
Kelsi
9555a4a91a feat(editor): quest NPC linking via spawn list dropdowns
- Quest giver and turn-in NPC now selected from a dropdown of placed
  creatures instead of typing raw IDs — shows name + id for each
- Links quests directly to NPCs you've already placed on the map
- "None" option to unset NPC link
- Much more intuitive quest→NPC workflow
2026-05-05 06:26:15 -07:00
Kelsi
dd2b9294b5 feat(editor): terrain mirror X/Y for symmetric zone design
- Mirror X: copies left half of terrain to right half (mirrored)
- Mirror Y: copies top half to bottom half (mirrored)
- Useful for creating symmetric zones, arenas, or balanced landscapes
- Auto-stitches all chunk edges after mirror for seamless results
- UI buttons in Sculpt panel under "Mirror Terrain" section
2026-05-05 06:24:28 -07:00
Kelsi
ac88aed250 feat(editor): quick generate checkbox in New Terrain dialog 2026-05-05 06:22:44 -07:00
Kelsi
df4cc809f4 feat(editor): quest link hint in NPC panel for workflow guidance 2026-05-05 06:21:00 -07:00
Kelsi
673cfa6368 feat(editor): show all biome texture paths in New Terrain dialog 2026-05-05 06:19:49 -07:00
Kelsi
506fcc29f3 feat(editor): auto-scatter checkbox for height-based object placement 2026-05-05 06:18:47 -07:00