Adds EditorApp::snapAllSpawnsToGround() and a menu item under
Generate, mirroring the --snap-zone-to-ground CLI for users who
want the action without context-switching to a terminal.
Walks every NPC + object, casts a downward ray from baseZ+500y,
and writes the hit Z into spawn.position.z. Patrol waypoints on
each NPC are snapped too. Marks the project dirty + auto-save
pending so the change persists without a manual Ctrl+S.
Existing per-selection "Snap Ground" button on the right panel is
unchanged; this is the bulk version for "I just edited terrain
under a populated area."
The Zone Audio panel previously only offered five hardcoded preset
paths. Replaced with a recursive directory walk of <data>/Sound/
Music and <data>/Sound/Ambience for any .mp3/.wav/.ogg files.
Results cached after the first scan; a Refresh button forces a
rebuild for when the user drops new files in.
Two ImGui combos populate from the scan:
- "Music File" — picks from Sound/Music
- "Ambience File" — picks from Sound/Ambience
Each combo has a "(none)" option to clear. Selecting an entry
updates both the manifest field and the existing manual text input
buffer below, so users can fine-tune the path after picking from
the combo.
EditorApp gets a public getDataPath() so the UI can reach the
configured asset root without exposing the rest of the private
state.
Audio playback preview is the remaining piece — needs SDL_mixer
or similar wired into the editor; not in this commit.
Adds EditorApp::randomPopulateZone(creatureCount, objectCount, seed)
and a Generate-menu submenu with sliders for both counts plus a
seed input. Same logic and bestiary as the --random-populate-zone
CLI: 12 creature templates with level jitter, 5 placeholder WMO
prop types with randomized rotation/scale.
Spawns are placed within the loaded tile's world bbox, marked
dirty + auto-save pending so the populated content persists across
restarts.
The CLI command remains for CI / scripting / batch workflows; the
menu serves designers who want to populate from the GUI without
context-switching to a terminal.
Same-seed reproducibility: a hover hint reminds the user that the
seed determines the output deterministically.
The path tool gains a "Append selected <object|NPC> as path point"
button that captures the currently-selected entity's world position
into pathPoints_. Workflow: place an inn + a town hall, select inn
→ click append, select town hall → click append, click Apply Path.
The road is then drawn between the two object positions.
When no object/NPC is selected, the button area shows a hint
instead. The button auto-kicks pathCapture_ from None into Waiting*
on first use so the user doesn't have to remember the setup
sequence.
Works with the multi-point polyline path tool from the previous
commit — append three or more objects to route a road through them
in order.
Path capture replaced with std::vector<glm::vec3> pathPoints_. The
flow is now: click "Click Start Point" → click terrain for first
point → keep clicking for additional waypoints → press Apply when
done, or Cancel to scrap. Apply iterates each consecutive pair as a
segment, calling carveRiver + paintAlongPath + fillWaterAlongPath
(or flattenRoad for road mode) per segment.
Hard-capped at 64 captured points so a runaway click handler can't
unboundedly grow the polyline. Toast at end reports the segment
count so users see the polyline took.
PathCapture states extended: None / WaitingStart / WaitingEnd /
WaitingMore. Backwards-compatible getPathStart()/getPathEnd()
return first/last points so the existing path-preview wiring keeps
working.
The river path tool used to carve the channel and texture the banks
but never added a water layer — users had to manually run
"Fill Water" afterward, which floods the entire tile. The fix is a
new TerrainEditor::fillWaterAlongPath() method that adds water
layers only to chunks the river segment passes through (within
width + chunk-half-diagonal of the line).
Per-chunk water height is set to the chunk's post-carve minimum
terrain height + 0.5y offset so the water sits visibly in the
channel without overflowing onto banks.
The river apply path now invokes carveRiver → paintAlongPath →
fillWaterAlongPath in sequence. Toast updated to mention all three.
Multi-point rivers are still next on the list — the underlying
math takes a single segment today, so a polyline river needs a UI
revamp to capture N points + a per-segment loop. Ack'd, not done
this commit.
CreatureSpawn::behavior defaulted to Stationary, so newly placed
NPCs would never move at runtime. The "NPCs do not patrol or
wander, they stay put" complaint was a default-value issue, not a
missing feature — switching the default to Wander (radius 10y)
gets normal NPCs roaming out of the box.
Added a tooltip on the Behavior combo making it explicit that this
is the runtime mode (the editor's preview doesn't run movement
logic; the behavior kicks in once the zone ships and the server
consumes the exported SQL). Lists what each mode means:
Stationary / Patrol / Wander / Scripted.
Existing zones with explicitly-set Stationary NPCs are preserved
on load — only fresh defaults are affected.
Three issues fixed in one pass:
1. Z-offset was 35 yards — nameplates floated way above the actual
NPC position. Dropped to 3.5 yards (just above an average
creature's head) so the label reads as attached.
2. Horizontal alignment was a fixed -30 px offset, which only looked
centered for ~6-character names. Switched to ImGui::CalcTextSize
and centering on the projected position.
3. Nameplates were always-on, which got noisy fast on populated
zones. Added "Nameplate on selected only" checkbox in the NPC
panel (default ON); when unchecked, all NPCs show their names.
Vertical position also slightly tightened (sy - textSz.y - 2 vs
sy - 10) so the text baseline aligns rather than floating below.
The "Create Crater at Cursor" button used the brush's last hover
position, which was stale by the time the user clicked the button —
the cursor had to move onto the button itself, dragging the brush
position along with it. Result: crater spawned somewhere between
where the user wanted and the button.
New flow: button arms a "click on terrain to place crater" mode
(captures the user's chosen radius/depth/rim at arm time). The next
left-click anywhere on terrain spawns the crater at the actual click
position, regardless of brush state. Button label changes to "ARMED
— click on terrain to place" while waiting, with a Cancel button +
Esc to dismiss.
Misses on terrain leave the mode armed so the user can retry without
re-pressing the button.
When a user picks a creature preset, faction stays 0 (server treats this
as 'use template') unless the user already typed a value. Now defaults
based on the preset category:
Critter -> 250 (critter, indifferent to all)
hostile preset -> 14 (monster, hostile to all)
friendly preset -> 35 (friendly to all)
Means picking 'Wolf' from the preset list immediately produces a hostile
NPC that actually attacks players in-game without further configuration.
The respawnTimeMs field was loaded/saved/exported but never editable
through the UI. Added a DragFloat showing seconds (range 5-86400) in
both the template and the selected-NPC editors. SQL export already
divides by 1000 for AzerothCore's spawntimesecs column.
Last batch of stat fields missing from the selected-NPC editor. Now any
property a user could set on the template can also be edited on an
already-placed NPC, without removing and re-placing.
Adds Hostile/Quest/Vendor/Inn/Train/Bank/Auc/Repair/Flight checkboxes
to the selected-NPC editor matching the template editor's set. Lets
users toggle these on already-placed NPCs without removing and
re-placing them.
The CreatureSpawn struct has a faction field that was already exported
to creature_template.faction but wasn't editable. Added an InputInt with
a tooltip listing the common AzerothCore FactionTemplate IDs (Stormwind,
Monster, Beast, Friendly, Critter, etc.) so users can pick the right
hostility/disposition without referencing the DBC manually.
CreatureSpawn struct gains four AzerothCore-standard NPC flag bits:
trainer -> npcflag 0x10
repair -> npcflag 0x1000
banker -> npcflag 0x20000
auctioneer -> npcflag 0x200000
Saved/loaded via the JSON spawn file, exported to creature_template.npcflag,
exposed as checkboxes in the NPC template panel. Lets users build full
city NPCs (city auctioneer, weapon trainer, etc.) without dropping to SQL.
Helps users understand the search base — 'Pool: 1234 M2 56 WMO' tells
them why their filter might be matching too many results, and gives a
quick view into how much asset variety the loaded data has.
Template was a SliderFloat 0.5-10 while the selected-NPC editor uses
DragFloat 0.1-50. Inconsistent ceilings made it surprising that an NPC
could be scaled higher after placement than during placement. Now both
use DragFloat with the same range.
Previously waypoints could only be appended or removed; reordering meant
clearing and re-adding the whole path. Now each waypoint row has up/dn
swap buttons and a +after that inserts a new waypoint at the current
brush cursor right after this index — slicing long segments doesn't
require redoing the rest of the path.
Cam in dim yellow, cursor (when brush is on terrain) in cyan. Useful for
quickly noting positions where to drop spawns/objects without flying over
to read the brush coords manually.
The SQL exporter writes objective targets to RequiredNpcOrGo/RequiredItem
slots based on the objective's targetName field, but the UI never let
the user fill that field. Added an InputText for Target ID and, for Kill
objectives, a dropdown that auto-fills with the entry of any placed NPC.
A zone with 50+ creatures made finding a specific spawn tedious. Added
a case-insensitive name-filter input above the list, capped at 200
visible entries with a 'refine filter' hint when exceeded.
Helpful for navigation and noting positions for spawn placement, plus
diagnostic value when debugging coordinate issues. Shown only after a
terrain is loaded.
SQL export uses CreatureSpawn.displayId for creature_template.modelid1.
Without it AzerothCore can't render the creature in-game. Added an
InputInt + warning text so users can set the displayId manually until
auto-discovery from CreatureDisplayInfo.dbc lands.
The scatter tool spawned creatures all at the cursor's z-height which
made them hover when scattered over uneven terrain. Added a Snap to
Ground checkbox (defaults to on) that raycasts each scattered NPC and
places it on the actual surface.
Right-click context menu on a selected NPC now mirrors the object menu:
Snap to Ground drops it to terrain elevation, Face Camera rotates the NPC
to face the current camera position. Also annotates Duplicate with the
Ctrl+D shortcut hint.
The patrol list now shows total loop distance and gives each waypoint a
draggable wait-time field (0-60s). Helps tune patrol pacing without re-saving
the JSON manually.
Once an NPC is placed there was no way to resize it without removing and
re-placing. Added a Scale DragFloat in the selected-creature editor with
the same 0.1-50 range used for placed objects.
NPC markers now show a yellow ground-triangle pointing in the orientation
direction so users can see facing without selecting. Object panel gained
the Ctrl+Wheel rotation hint to match the NPC panel.
Added orientation slider in NPC panel with random button. Ctrl+Wheel now
rotates the placement preview (objects and NPCs) instead of zooming —
Shift makes the step finer (5 deg vs 15 deg). Ghost preview now shows
the actual orientation that the placed NPC will have.
Many WoW instances (Dire Maul, Blackrock Depths, etc.) are WMO-only
maps with no ADT terrain tiles. The editor now handles these:
- loadWMOInstance(): reads WDT, detects WDTF_GLOBAL_WMO flag, loads
the root WMO path from MWMO chunk, places it as an object with
correct position/rotation from MODF chunk
- Automatic fallback: when loadADT fails to find tiles, tries
WMO-only loading before showing error
- Load dialog: "Find Tile" detects WMO-only instances and shows
"WMO-only instance — click Load to open" instead of "not found"
- Camera positioned near the WMO for immediate editing
- Blank terrain floor generated as ground reference
"Count" button next to "Find Tile" scans all 64x64 tile coordinates
and shows how many ADT tiles exist for the selected map. Helps users
understand the scope of a map before loading individual tiles.
- NPC markers reduced from 30-unit poles to 8-unit poles (was
overwhelming and obscuring terrain). Base 1.5u, diamond top 1u
- "Show Position Markers" checkbox in NPC panel to toggle visibility
- Markers hidden when checkbox unchecked — useful when M2 creature
models are rendering and markers are redundant
- Marker alpha reduced for less visual noise
One-click generation of a complete AzerothCore/TrinityCore server module
from editor zone data. File > Generate Server Module creates:
- sql/01_map.sql: map_dbc + area_table_dbc registration
- sql/02_spawns.sql: creature_template + creature + waypoint_data + quests
- sql/03_teleport.sql: game_tele entry for .tele command
- sql/04_zone_flags.sql: sanctuary/PvP area flags
- conf/mod_wowee.conf.dist: worldserver.conf snippet with zone settings
- README.md: step-by-step server admin installation guide
- module.json: machine-readable module manifest
Server admins can import the SQL files, add the config snippet, and
restart their server to have the custom zone fully operational with
NPC spawns, patrol paths, quests, teleport commands, and zone flags.
Private server integration: export creature spawns, patrol waypoints,
and quest definitions as ready-to-import SQL for AzerothCore/TrinityCore.
- creature_template: name, level, health, mana, damage, armor, faction,
npcflag (questgiver/vendor/flightmaster/innkeeper), displayId, scale
- creature: spawn position, orientation, respawn time, wander distance,
movement type (stationary/wander/patrol)
- creature_addon + waypoint_data: patrol path waypoints with delays
- quest_template: title, description, completion text, level, XP, money
- All use ON DUPLICATE KEY UPDATE for safe re-imports
- Auto-exported as spawns.sql alongside other assets on zone save
- File > Export Server SQL menu item for standalone export
- Map ID from zone metadata panel used in spawn table
- exportZoneMap(): renders terrain as colored top-down image with
height-based coloring (blue lowlands → green plains → brown hills →
white peaks), water overlay, hole visualization, doodad markers
- Configurable resolution (128-2048px, default 512)
- Auto-exported as zone_map.png alongside other assets on save
- File > Export Zone Map menu with resolution slider
- Useful for documentation, server admin tools, custom map websites
- Map ID: configurable integer input (0-65535) for private server
integration. Custom zones default to 9000+ to avoid Blizzard conflicts
- Display Name: editable text field for in-game world map/loading screen
- Description: multi-line text field for zone documentation
- Zone Flags: Allow Flying, PvP Enabled, Indoor, Sanctuary checkboxes
- All fields serialized to zone.json under "flags" key
- Info panel shows quest count alongside objects/NPCs
- Zone manifest gains audio fields: musicTrack, ambienceDay,
ambienceNight, musicVolume, ambienceVolume
- Serialized to/from zone.json under "audio" key
- Info panel: collapsable "Zone Audio" section with text inputs for
music/ambience paths and volume sliders
- Preset selector: Elwynn Forest, Durotar, Darkshore, Dungeon, None
- ZoneManifest stored persistently on EditorApp so audio settings
survive between exports (was recreated each save)
- Custom zones can now specify their own background music and ambient
soundscapes via zone.json
- importHeightmapImage(): loads any resolution PNG/JPG/BMP/TGA via
stb_image, supports both 8-bit and 16-bit precision, maps to terrain
vertices with bilinear coordinate mapping
- Both image import and RAW import now wrapped with undo
(recordGeneratorUndo/commitGeneratorUndo)
- UI: File > Import Heightmap now offers "Import Image" (any format)
and "Import RAW" (binary) as separate options
- Enables professional terrain workflows: paint in Photoshop/GIMP,
generate in World Machine/Gaea, import directly as terrain