Commit graph

56 commits

Author SHA1 Message Date
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
Kelsi
00fd1249d8 feat(editor): key 6 for Quest mode, update help overlay 2026-05-05 06:11:54 -07:00
Kelsi
f59d79537a feat(editor): quest editor with objectives, rewards, and quest chains
- New Quest mode (key 6) with full quest creation panel:
  - Title, description, required level
  - Quest giver / turn-in NPC ID linkage
  - Up to 4 objectives: Kill, Collect, Talk, Explore, Escort, Use Object
  - Rewards: XP and gold
  - Quest chain support via nextQuestId linking
- Quest list showing all created quests with level and objective count
- Save quests to JSON (included in Export Zone package)
- Foundation for campaign system: create quest chains across NPCs,
  link objectives to placed creatures, build storylines
2026-05-05 06:10:14 -07:00
Kelsi
434fdf6c7f feat(editor): center on terrain (Home key), navigation improvements
- "Center on Terrain" (Home key or View menu): resets camera to center
  of loaded tile at 300 units altitude with 45-degree downward pitch.
  Essential for recovering when camera gets lost in empty space.
- Toast confirmation on center action
2026-05-05 05:48:00 -07:00
Kelsi
12acbfb2d5 feat(editor): scroll wheel zoom, clickable minimap navigation
- Scroll wheel now zooms camera (moves along look direction) instead
  of adjusting speed. Much more intuitive for terrain editing.
- Shift+scroll adjusts camera speed (old behavior preserved)
- Click on minimap to teleport camera to that location on the terrain
- Zoom speed scales with current camera speed for consistent feel
2026-05-05 05:44:24 -07:00
Kelsi
f891bd02a5 feat(editor): import ADT doodad/WMO placements on load
- Loading an existing ADT now imports its MDDF (doodad) and MODF (WMO)
  placements into the object placer with correct position/rotation/scale
- Allows editing zones that already have objects placed in them
- Mutable getObjects() accessor for bulk import operations
- Log shows imported doodad + WMO count on load
2026-05-05 05:42:14 -07:00
Kelsi
864415d246 feat(editor): auto-load objects/NPCs, mode buttons, number key shortcuts
- Loading an ADT now auto-loads objects.json and creatures.json from
  the output directory if they exist (full session persistence)
- Toolbar buttons now highlight active mode in blue (clearer visual)
- Number keys 1-5 switch modes: 1=Sculpt 2=Paint 3=Objects 4=Water 5=NPCs
- Toast shows loaded object/NPC count on zone open
2026-05-05 05:29:30 -07:00
Kelsi
befa12f9e6 fix(editor): Clear All, New Terrain reset, right-click menu, gizmo drag
- Clear All now actually removes all objects and NPCs (was only clearing
  selections before). Uses new ObjectPlacer::clearAll() method.
- New Terrain clears all objects/NPCs and resets viewport before creating
  fresh terrain. Fixes stale state from previous session.
- Right-click context menu works on both objects AND NPCs with
  appropriate options for each (Move/Rotate/Scale for objects,
  Fly To/Duplicate for NPCs)
- Gizmo drag: left-click now confirms the transform (ends drag) instead
  of requiring mouse-up. Right-click cancels. Camera no longer steals
  mouse events while gizmo is active.
- Right-click on unselected area passes through to camera correctly
2026-05-05 05:20:53 -07:00
Kelsi
d9ed7be36c feat(editor): fly-to-object, export README, quality of life
- "Fly To" button on selected objects and NPCs: moves camera 30 units
  above the selected item for quick navigation on large zones
- Export now generates README.txt with zone summary: map name, tile
  coords, object/NPC counts, and file listing
- Complete export package: zone.json + WDT + ADT + objects.json +
  creatures.json + README.txt
2026-05-05 05:16:43 -07:00
Kelsi
8c9407e0f5 feat(editor): object save/load JSON, working duplicate, export objects
- Object placer save/load: objects.json persists placed M2/WMO objects
  across sessions (path, position, rotation, scale, type)
- Fixed Duplicate button in Object panel: now actually creates a copy
  with correct path/type/scale instead of being a no-op stub
- Export Zone now saves objects.json alongside ADT/WDT/creatures/manifest
- Object JSON loader parses all fields for full round-trip
2026-05-05 05:14:03 -07:00
Kelsi
e0d14de5d2 feat(editor): zone manifest for client loading, export workflow complete
- Zone manifest (zone.json): generated on export with map name, map ID,
  tile list, biome, creature flag, and file paths. This is what the
  wowee client will read to discover and load custom zones.
- Export workflow now produces a complete loadable zone package:
  zone.json + MapName.wdt + MapName_X_Y.adt + creatures.json
- ZoneManifest class with save/load (JSON format)
- Custom map IDs start at 9000+ to avoid conflicting with retail maps
- New Terrain dialog shows helper text for map name format
2026-05-05 05:06:41 -07:00
Kelsi
89312120f4 feat(editor): heightmap export, help overlay, keyboard reference
- Export Heightmap: File > Export Heightmap saves terrain as 16-bit
  RAW grayscale (129x129) for use in external terrain editors or
  as a backup. Configurable max height scale.
- Help overlay (F1 or Help menu): lists all keyboard shortcuts
  organized by category (navigation, editing, object transform, view)
- Round-trip heightmap workflow: import → edit → export
2026-05-05 04:52:36 -07:00
Kelsi
2f96f112bd feat(editor): heightmap import, toast notifications, workflow polish
- Import Heightmap: File > Import Heightmap loads RAW 8/16-bit grayscale
  files (129x129 or 257x257) and maps to terrain heights with configurable
  scale. Supports standard terrain editor heightmap formats.
- Toast notifications: non-intrusive green popup at bottom center for
  user feedback (save confirmations, import results, errors)
- Toasts fade out after 3 seconds with alpha animation
- Auto-save now shows toast on save
- Quick-save (Ctrl+S) shows toast confirmation
2026-05-05 04:49:43 -07:00
Kelsi
a91233a6ec feat(editor): erosion brush, NPC load, auto-save
- Erode brush mode: simulates water erosion by moving height downhill
  based on slope, creating natural drainage patterns and gullies
- NPC JSON loader: File > Load NPCs parses saved creatures.json back
  into the spawn list (round-trip save/load now works)
- Auto-save: every 5 minutes when unsaved changes exist, exports the
  full zone (ADT + WDT + creatures) to the output directory
- Sculpt mode now has 6 brush types: Raise/Lower/Smooth/Flatten/Level/Erode
2026-05-05 04:44:54 -07:00
Kelsi
42749e9b58 feat(editor): procedural noise generator, sky presets, viewport lighting
- Noise Generator in Sculpt panel: applies procedural value noise
  with configurable frequency, amplitude, octaves, and seed
  to create hills/valleys across entire tile instantly
- Sky/Lighting presets: View > Sky menu with Day (blue sky, high sun),
  Dusk (orange, low sun), Night (dark blue, moonlight)
- Viewport clear color and light direction now configurable at runtime
- Noise uses smoothstep interpolation with octave fractal layering
2026-05-05 04:40:37 -07:00
Kelsi
ba96de7138 fix(editor): normal recalculation after sculpt, mode switch cleanup
- Terrain normals recalculated after height changes (smooth lighting
  on sculpted terrain instead of flat-shaded appearance)
- Ghost preview and brush indicator cleared when switching modes
  (prevents stale model instances or circles persisting)
- File > Clear All resets undo history and selections
- Normal computation uses finite differences from neighbor heights,
  handles both outer (9x9) and inner (8x8) vertex grid positions
2026-05-05 04:24:20 -07:00
Kelsi
5daa359e74 feat(editor): object scatter, camera bookmarks, shortcut hints
- Object scatter tool: place N copies of selected M2/WMO in a radius
  with random rotation and scale range (Min/Max Scale slider)
- Camera bookmarks: F5 saves current position, View > Load Bookmark
  to jump back — useful for working on different parts of a large zone
- Shortcut hints shown at bottom of Object panel
  (G=move, R=rotate, T=scale, Del=remove)
- DragFloatRange2 for min/max scale in scatter UI
2026-05-05 04:20:26 -07:00
Kelsi
48026421c9 feat(editor): NPC scatter tool, adjacent tile creation, multi-tile prep
- Scatter tool: place N creatures in a radius around cursor position
  with random rotation and uniform disk distribution
- File > Add Adjacent Tile: creates and exports a blank tile N/S/E/W
  of current (foundation for multi-tile zone editing)
- Scatter UI: count slider (1-30), radius slider (10-200)
- Scatter places all copies with same stats/behavior as template
2026-05-05 04:14:29 -07:00