Commit graph

73 commits

Author SHA1 Message Date
Kelsi
28d63addc4 feat(editor): brush size presets/hotkeys, export dialog update
- Brush size presets: S(15)/M(50)/L(100)/XL(180) buttons in sculpt panel
- [ / ] bracket keys adjust brush radius by 10 units (clamped 5-200)
- Export dialog now lists all output formats (ADT+WDT, WOT+WHM, WOM,
  WOB, PNG, JSON) instead of just ADT/WDT
- Document bracket keys in help panel
2026-05-05 14:00:49 -07:00
Kelsi
97da4c38f0 feat(editor): auto-save settings UI, multi-tile zone.json, toast notify
- Auto-save toast notification when auto-save fires
- Edit > Auto-Save Settings: enable/disable toggle, interval slider
  (60-900s), countdown timer display
- Zone manifest now scans output directory for all exported ADT tiles
  and includes them in zone.json (adjacent tiles no longer orphaned)
- Auto-save interval and enabled state exposed via EditorApp accessors
2026-05-05 13:58:07 -07:00
Kelsi
a7e34ad102 feat(editor): adjacent tile edge stitching, Escape clears all state
- Adjacent tile export now stitches border heights from current tile
  for seamless edges, exports both ADT and WOT/WHM open format
- Escape key now clears NPC selection and path capture state in
  addition to object selection and gizmo mode
2026-05-05 13:53:30 -07:00
Kelsi
533c218983 feat(editor): select all, recent zones, minimap selection highlights
- Ctrl+A selects all placed objects, context menu has Select All item
- selectAll() added to ObjectPlacer, works with multi-select transforms
- Recent Zones submenu in File menu (last 8 loaded zones, deduplicated)
- Minimap: selected objects shown as white dots with gold ring outline
  vs yellow dots for unselected objects
- Help panel updated with Ctrl+A and Ctrl+Shift+Click documentation
2026-05-05 13:52:02 -07:00
Kelsi
ddf97e9b8a feat(editor): multi-select objects, time-of-day lighting, WOT loading
- Multi-select: Ctrl+Shift+Click adds objects to selection, transforms
  (move/rotate/scale/delete) operate on all selected objects at once
- Time-of-day slider (0-24h) with automatic sun angle, light color,
  ambient, fog, and sky color transitions (dawn/day/dusk/night)
- View > Sky/Lighting menu: color pickers for light/ambient/fog, fog
  distance sliders, preset buttons (Dawn/Noon/Dusk/Night)
- loadADT prefers WOT/WHM open format from custom_zones/output dirs
- Selection count display when multiple objects selected
- setSkyPreset now delegates to setTimeOfDay for consistency
2026-05-05 13:47:23 -07:00
Kelsi
d2acdc7620 feat(editor): texture eyedropper, WOT/WHM preference loading
- Texture eyedropper: pickTextureAt() samples dominant texture at world
  position by reading chunk alpha maps. Alt+Click in paint mode or
  click the Eyedropper button to activate
- loadADT now checks custom_zones/ and output/ for WOT/WHM open format
  files first, falling back to ADT binary only if not found
- Fix unused variable warning in scatterPatches
- Document Alt+Click in help panel
2026-05-05 13:39:53 -07:00
Kelsi
acfbf19144 feat(editor): path preview line, transform undo, complete undo coverage
- River/road tool now shows translucent blue path preview ribbon with
  edge lines between start and end points before applying
- Preview follows cursor when waiting for end point, locks when set
- Undo support for all remaining operations: rotateTerrain90, mirrorX,
  mirrorY, scaleHeights, offsetHeights, invertHeights, smoothBeaches
- Every terrain-modifying operation in the editor is now undoable
2026-05-05 13:33:28 -07:00
Kelsi
7e02db73df feat(editor): generator undo, quit confirmation, state cleanup
- All terrain generators now undoable: crater, mesa, hill, voronoi,
  dunes, detail noise, thermal erosion, canyon, island, ridge, road,
  river, perlin noise — all wrapped with recordGeneratorUndo/commit
- Unsaved changes warning on quit: Save & Quit / Quit / Cancel dialog
- createNewTerrain clears quest editor and path capture state
- recordGeneratorUndo/commitGeneratorUndo helper methods snapshot all
  256 chunks before/after any generator operation
2026-05-05 13:26:38 -07:00
Kelsi
97e7a4c71a feat(editor): complete importOpen, keyboard shortcuts, DBC exporter
- importOpen now loads WHM alpha maps + full WOT metadata (textures,
  layers, holes, water) — was height-only stub
- DBC exporter migrated to nlohmann/json (last naive JSON file)
- Add Z-axis gizmo constraint (Z key) alongside X/Y
- Add Ctrl+Y as alternate redo binding
- Add F1 keyboard shortcut for help panel toggle
- Update help panel: document Z-axis, Ctrl+Y, all shortcuts
2026-05-05 13:15:00 -07:00
Kelsi
08500384e2 refactor: migrate all remaining JSON to nlohmann/json
- npc_spawner: save/load with proper JSON (25+ fields + patrol paths)
- zone_manifest: save/load with nlohmann (was naive string concat/parse)
  - load now parses all fields: mapId, baseHeight, tiles, hasCreatures
- custom_zone_discovery: parse zone.json with nlohmann, extract mapId
  and tile coordinates (was only reading name/author/description)
- object_placer: save/load with nlohmann (was substring parsing)
- editor_app: stats.json export uses nlohmann, score display now /6

Zero naive JSON string concatenation remains in the editor codebase.
2026-05-05 13:10:07 -07:00
Kelsi
6b3cdd325a feat(editor): click-to-place path points for river/road carver
- River/Road tool now uses click-capture mode instead of button-based
  cursor position — click terrain directly to set start and end points
- 3-step flow: Click Start → Click End → Apply Path (with preview text)
- Cancel button available at each step
- Path state tracked on EditorUI with setPathPoint()/clearPath()
- Intercepts terrain clicks before mode-specific handling when active
2026-05-05 13:00:23 -07:00
Kelsi
4e2f704124 fix(editor): undo now covers texture painting, fix stale buffer bug
- Extend undo/redo to snapshot alpha maps and texture layers alongside
  heights — texture painting operations are now fully undoable
- Bracket paint mode with beginStroke/endStroke like sculpt mode
- Fix stale static char buffer in quest objective loop (showed wrong
  objective's description when editing multiple objectives)
- Zero-initialize all quest UI text buffers for null termination safety
- Fix unused variable warnings in terrain_editor.cpp
2026-05-05 12:58:11 -07:00
Kelsi
2eec089ef5 fix(editor): harden JSON handling, quest loading, and content validation
- Quest editor: add loadFromFile() with nlohmann/json, chain validation
  with circular reference detection, wire into ADT load and save pipeline
- Project: replace naive substring JSON parsing with nlohmann/json for
  both save() and load(), fix shell injection in gitCommit()
- Content pack: replace manual JSON with nlohmann/json, validate binary
  format magic numbers (WHM1/WOM1/WOB1), add WOB to openFormatScore
  (now scores 0-6), mark invalid files with (!) in summary
2026-05-05 12:48:50 -07:00
Kelsi
4fc0361f7a feat: complete client integration for all 6 open formats
- Wire WOB buildings into WMO render pipeline (loads→converts→renders)
- Implement JSON DBC loading in DBCFile::loadJSON() with nlohmann/json
- Wire JSON DBC override into AssetManager (custom_zones/output scan)
- Add WMO→WOB conversion with full geometry (fromWMO)
- Replace placeholder WOB export with real WMO→WOB conversion in editor
- Add --convert-wmo CLI flag for batch WMO→WOB conversion
- Store discovered custom zones on Renderer with getCustomZones() accessor
- Add isCustomZone_ member to TerrainManager

All 6 Blizzard format replacements now fully load in the client:
  ADT→WOT/WHM, WDT→zone.json, BLP→PNG, DBC→JSON, M2→WOM, WMO→WOB
2026-05-05 12:41:19 -07:00
Kelsi
f20e602d32 fix(editor): minor README formatting improvement in export 2026-05-05 12:14:31 -07:00
Kelsi
8bf02b5880 feat(editor): zone stats.json export with open format score and content summary 2026-05-05 11:48:57 -07:00
Kelsi
5c229e9603 feat(editor): auto-export hole mask PNG alongside terrain on zone save 2026-05-05 11:44:52 -07:00
Kelsi
053278da7c fix(editor): accurate file count in export toast (includes all PNGs and textures) 2026-05-05 11:38:56 -07:00
Kelsi
196e67dddb feat(editor): auto-export water mask PNG alongside terrain on zone save 2026-05-05 11:37:31 -07:00
Kelsi
02c2d62a02 feat(editor): comprehensive export summary log with format breakdown 2026-05-05 11:22:55 -07:00
Kelsi
ae7942ef39 feat(editor): zone thumbnail included in export for content pack browsing 2026-05-05 11:21:11 -07:00
Kelsi
60048c0ee4 docs(editor): export README now lists all open format types 2026-05-05 11:16:38 -07:00
Kelsi
77a91de9f1 feat(editor): heightmap preview PNG export for zone documentation
- Exports 129x129 grayscale PNG showing terrain elevation
- Auto-normalizes to 0-255 based on actual height range
- Useful for zone documentation, thumbnails, and previews
- Auto-exported alongside WOT/WHM/normals on every save
2026-05-05 11:14:58 -07:00
Kelsi
d990b2819d feat(editor): auto-export alpha maps alongside terrain on zone save 2026-05-05 11:10:08 -07:00
Kelsi
25f1893b49 feat(editor): auto-export terrain normal map PNG alongside WOT/WHM 2026-05-05 11:03:23 -07:00
Kelsi
4148c890dc feat(editor): auto-export WMO buildings as WOB placeholders on zone save
- Zone export now creates WOB placeholder files for all placed WMO
  buildings in output/MapName/buildings/
- Full WMO→WOB conversion (with geometry) requires group file loading
  which is complex — placeholders reserve the path structure for now
- All 6 format conversions now auto-run on every zone export:
  ADT→WOT/WHM, BLP→PNG, DBC→JSON, M2→WOM, WMO→WOB, WDT→zone.json
2026-05-05 10:44:38 -07:00
Kelsi
adfa1d7086 feat(editor): export toast shows open format completeness score (X/5) 2026-05-05 10:40:15 -07:00
Kelsi
5e2cb6fb3c feat(editor): auto-convert placed M2 objects to WOM on zone export
- Zone export now converts all placed M2 models to WOM open format
- Deduplicates: each unique M2 path converted only once
- WOM files saved to output/MapName/models/ with original path structure
- Uses WoweeModelLoader::fromM2() for M2→WOM conversion
- Combined with PNG texture export, zones can now be fully distributed
  without any Blizzard proprietary files

Full open format export pipeline:
  Terrain: ADT→WOT/WHM | Textures: BLP→PNG | Data: DBC→JSON
  Models: M2→WOM | Buildings: WMO→WOB (manual) | Map: WDT→zone.json
2026-05-05 10:31:51 -07:00
Kelsi
176115f279 feat(editor): DBC→JSON export for open format zone data tables
- DBCExporter: converts Blizzard DBC binary data tables to JSON
- Exports zone-relevant DBCs: AreaTable, Map, Light, LightParams,
  ZoneMusic, SoundAmbience, GroundEffectTexture/Doodad, LiquidType
- Auto-detects string vs numeric vs float fields
- Zone export now includes data/ directory with JSON DBCs
- Client can load these via existing CSV/JSON fallback paths

Format replacement progress:
- DONE: ADT → WOT/WHM (terrain)
- DONE: WDT → zone.json (map definition)
- DONE: BLP → PNG (textures)
- DONE: DBC → JSON (data tables)
- TODO: M2 → open model format
- TODO: WMO → open building format
2026-05-05 10:21:14 -07:00
Kelsi
cb3de59b5c feat(editor): BLP→PNG texture export for open format zones
- TextureExporter: converts Blizzard BLP textures to standard PNG
  for fully open redistribution of custom zones
- collectUsedTextures(): finds all texture paths referenced by terrain
- exportTexturesAsPng(): loads BLP via asset manager, writes RGBA PNG
  using stb_image_write to output/MapName/textures/
- Zone export now automatically converts all used textures to PNG
- Client's PNG override system already loads these automatically
  (checks for .png alongside .blp before loading)

Format replacement progress:
- DONE: ADT→WOT/WHM (terrain)
- DONE: WDT→zone.json (map definition)
- DONE: BLP→PNG (textures — auto-exported on zone save)
- TODO: DBC→JSON, M2→open model, WMO→open building
2026-05-05 10:17:03 -07:00
Kelsi
5adb6cb364 feat(editor): export toast shows file count for better feedback 2026-05-05 10:11:50 -07:00
Kelsi
c28d3f8a99 feat(editor): open terrain format integrated into export workflow
- File > Export Open Format (.wot/.whm) menu item for standalone export
- Every zone export (Ctrl+S, Export Zone) now also writes .wot/.whm
  alongside the ADT/WDT — dual format output
- Export package now contains: ADT + WDT + WOT + WHM + JSON files
- Both Blizzard-compatible (for existing servers) and open format
  (for wowee-native loading and redistribution)
2026-05-05 09:34:49 -07:00
Kelsi
be18ceea73 feat(editor): Export Content Pack button in File menu
- File > Export Content Pack (.wcp) saves zone + packs into WCP archive
- Auto-saves zone first, then bundles into the novel WCP format
- WCP is a custom format unique to wowee (not MPQ, not CASC)
- Output: output/MapName.wcp ready for distribution
- Toast notification on success/failure
2026-05-05 09:29:57 -07:00
Kelsi
34c06ede4e fix(editor): redo works in all modes, center uses real chunk positions
- Ctrl+Shift+Z redo now works globally (was only in Sculpt mode)
- Ctrl+Z undo works in all modes with toast confirmation
- centerOnTerrain() uses actual mesh chunk positions instead of formula
- Toast shows "Undo" / "Redo" / "Undo placement" for user feedback
2026-05-05 09:00:53 -07:00
Kelsi
66debe9cec fix(editor): camera auto-centers on actual terrain chunks after ADT load
- Camera now positions at the center of actual loaded terrain chunks
  instead of using formula-based coordinates that can be wrong for
  instanced maps
- Falls back to formula if no valid chunks loaded
- Fixes camera starting far from terrain on some maps
2026-05-05 08:58:07 -07:00
Kelsi
84e9146522 feat(editor): toast notification when importing ADT doodads/WMOs 2026-05-05 08:56:52 -07:00
Kelsi
61f0f39611 fix(editor): ADT doodad/WMO coordinate conversion, auto-find tile on map select
- ADT doodad/WMO positions now converted from ADT space to render coords
  via core::coords::adtToWorld() — fixes objects appearing at wrong positions
  when loading existing WoW maps
- Selecting a map in the Load dialog now auto-finds the first valid tile
  (no more clicking "Find Tile" manually — it's automatic)
- Better error messages with toast for failed terrain loads
- Validates mesh has valid chunks before attempting GPU upload
2026-05-05 08:55:09 -07:00
Kelsi
9c0bc5fbd1 fix(editor): override ADT internal coords with filename coords on load
Root cause of ADT loading failures: instanced maps (dungeons, raids)
have arbitrary internal coord values (e.g. tile 62,0 for a file named
_28_27.adt). The terrain mesh generator uses these coords to compute
world positions, resulting in chunks placed thousands of units away
from the camera → "Failed to upload terrain to GPU".

Fix: override terrain_.coord with the tileX/tileY from the filename
before mesh generation. This ensures chunks are positioned correctly
regardless of what the ADT file's internal header says.
2026-05-05 08:49:26 -07:00
Kelsi
16a096b25d fix(editor): include quest count in export README, version tag 2026-05-05 08:37:51 -07:00
Kelsi
66b6404d25 fix(editor): recalculate normals after detail noise in Generate pipeline 2026-05-05 08:30:07 -07:00
Kelsi
571ea38efd feat(editor): Generate Complete Zone now adds detail roughness step 2026-05-05 08:22:09 -07:00
Kelsi
aed6e00aac feat(editor): Generate Complete Zone now includes water fill + beach smoothing 2026-05-05 08:07:49 -07:00
Kelsi
d247aee728 fix(editor): Generate Complete Zone resets terrain first for clean slate 2026-05-05 07:54:26 -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
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
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
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
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
9a547f66d2 chore(editor): add multi-tile WDT placeholder comment for future 2026-05-05 06:13:02 -07:00