Commit graph

59 commits

Author SHA1 Message Date
Kelsi
6f33392155 Add progress bar to loading screen and handle resize during loading
Loading screen now shows a gold progress bar with percentage and status
text. All loading steps poll SDL events for window resize and quit.
2026-02-06 14:43:18 -08:00
Kelsi
a0c24e70f9 Load creature display DBC lookups at startup instead of first spawn
Moves buildCreatureDisplayLookups() from lazy init on first creature
spawn to eagerly run after asset manager init, eliminating a 133s hang.
2026-02-06 14:37:31 -08:00
Kelsi
394e91cd9e Add character screen model preview, item icons, stats panel, and fix targeting bugs
Enhanced the C-key character screen with a 3-column layout featuring a 3D
character model preview (with drag-to-rotate), item icons loaded from BLP
textures via ItemDisplayInfo.dbc, and a stats panel showing base + equipment
bonuses. Fixed selection circle clipping under terrain by adding a Z offset,
and corrected faction hostility logic that was wrongly marking hostile mobs
as friendly.
2026-02-06 14:24:38 -08:00
Kelsi
7128ea1417 Restructure inventory UI, add vendor selling, camera intro on all spawns, and quest log
Split inventory into bags-only (B key) and character screen (C key). Vendor window
auto-opens bags with sell prices on hover and right-click to sell. Add camera intro
pan on all login/spawn/teleport/hearthstone events and idle orbit after 2 minutes.
Add quest log UI, SMSG_MONSTER_MOVE handling, deferred creature spawn queue, and
creature fade-in/movement interpolation for online mode.
2026-02-06 13:47:03 -08:00
Kelsi
60be428250 Add quest opcodes, fix gossip select packet, and NPC combat animations
Fix CMSG_GOSSIP_SELECT_OPTION missing menuId field (was causing
ByteBufferException). Add 12 quest opcodes and clickable quest items in
gossip dialog. NPC attack/death animation callbacks now work for both
single-player and server-spawned creatures, and SMSG_ATTACKERSTATEUPDATE
triggers NPC swing animations.
2026-02-06 11:45:35 -08:00
Kelsi
81b1f87313 Fix lantern glow rendering and add NPC combat animations
Disable depth testing for additive/mod blend mode batches so glow quads
render as proper light halos instead of visible transparent discs. Add
NPC swing callback to play attack animation (anim 16) when NPCs melee
in single-player combat.
2026-02-06 03:39:36 -08:00
Kelsi
fbeb14fc98 Add movement packed GUID, inventory money display, and character screen buttons
Fix movement packets to include packed player GUID prefix so the server
tracks position. Fix inventory money display being clipped by child panels.
Add Back and Delete Character buttons to character selection screen with
two-step delete confirmation.
2026-02-06 03:24:46 -08:00
Kelsi
4bb2828b21 Fix NPC head/facial hair rendering and add helmet model loading
- Add race/gender suffix to helmet M2 paths (e.g. _HuM for Human Male)
  so helmet models actually load from MPQ archives
- Include bald scalp mesh (submeshId=1) for hairStyle=0 to cover the
  hole at the crown of the body base mesh
- Fix CharacterFacialHairStyles.dbc column indices (no ID column, so
  cols 0/1/2 for race/sex/variation instead of 1/2/3)
- Convert facial hair DBC values to proper submeshIds by adding group
  base (100+, 200+, 300+)
- Hide hair geosets under helmets and replace with bald scalp cap
2026-02-06 01:36:06 -08:00
Kelsi
5623f9ea6c Keep scalp mesh visible under helmets to prevent transparency 2026-02-06 01:04:59 -08:00
Kelsi
e8fecfb3be Fix NPC hair/geoset rendering using DBC lookups
Use CharHairGeosets.dbc to map (race, sex, hairStyleId) to the correct
group 0 scalp mesh instead of the broken 101+hairStyleId formula. Filter
group 0 submeshes so only the body base and correct hair mesh render
(prevents overlapping scalp variants). Fix ItemDisplayInfo.dbc column
indices (5→7) and geoset formulas for equipment. Add CharSections.dbc
hair texture lookup and CharacterFacialHairStyles.dbc support.
2026-02-06 01:02:35 -08:00
Kelsi
9de3f2d327 Fix NPC body parts by applying baked texture to all skin slots
Baked NPC textures must be applied to all skin-related texture slots
(type 1 char skin, type 2 object skin, type 6 hair) since body parts
use different texture slots. Removed separate hair texture lookup as
baked textures already include the complete NPC appearance.
2026-02-05 23:48:06 -08:00
Kelsi
9c5e2fb93d Fix geoset filtering with expanded body range and debug logging
Expanded body part geoset range from 0-18 to 0-99 to cover all humanoid
submesh IDs. Added per-model debug logging to track submesh IDs and
geoset filtering behavior.
2026-02-05 23:33:28 -08:00
Kelsi
136dd0ac43 Disable NPC geoset filtering to fix missing body parts
Geoset filtering was incorrectly hiding NPC body parts because submesh
IDs don't match the expected geoset ID convention. Disabled until proper
mapping is implemented.
2026-02-05 23:29:10 -08:00
Kelsi
3e50b1071d Fix character spawning at saved position instead of default preset
selectSpawnPreset() was always returning a preset (Goldshire by default),
overriding the saved character position. Now returns nullptr when no
WOW_SPAWN env var is set, allowing saved position to be used.
2026-02-05 23:24:52 -08:00
Kelsi
9e3d12c0dc Fix NPC missing body parts by using baked textures as-is
Baked NPC textures already include complete appearance (skin, features,
armor). Equipment component textures are designed for player characters
with different UV layout and were causing body parts to disappear.
2026-02-05 23:15:57 -08:00
Kelsi
10ceb2b3a8 Add helmet model attachment and fix NPC textures
Load and attach helmet M2 models to humanoid NPCs from ItemDisplayInfo.dbc.
Revert equipment texture compositing since baked NPC textures are 256x256
(incompatible with 512x512 region system). Add debug logging for equipment
display IDs.
2026-02-05 23:05:35 -08:00
Kelsi
9083eec974 Add equipment geosets for humanoid NPCs
Load equipment display IDs from CreatureDisplayInfoExtra.dbc and look up
geoset groups from ItemDisplayInfo.dbc. Apply appropriate geosets for
chest, pants, boots, gloves, tabard, and cape. Hide hair when NPC wears
a helmet.
2026-02-05 22:57:32 -08:00
Kelsi
09cec89f6c Add hair textures and geosets for humanoid NPCs
Set correct hair style and facial hair geosets based on CreatureDisplayInfoExtra.
Load hair textures from CharSections.dbc using race, sex, hairStyleId, and
hairColorId for proper hair coloring on humanoid NPCs.
2026-02-05 22:54:47 -08:00
Kelsi
0d11886dee Fix humanoid NPC textures using baked NPC textures from DBC
Load CreatureDisplayInfoExtra.dbc to get baked texture names for humanoid
NPCs. Apply textures from Textures\BakedNpcTextures\ to type-1 texture
slots. Also spawn player model in online mode and set active character
GUID for both single-player and online modes.
2026-02-05 22:47:21 -08:00
Kelsi
c28376e193 Fix online mode creature spawning and packet parsing
- Fix encryption desync by tracking decrypted header bytes in world socket
- Fix UPDATE_OBJECT movement block parsing to handle 3.3.5a update flags
- Fix UNIT_FIELD_DISPLAYID index (67, not 71)
- Add creature spawn/despawn callbacks with DBC-based model loading
- Add SMSG_COMPRESSED_UPDATE_OBJECT opcode support
2026-02-05 21:55:52 -08:00
Kelsi
a4fcc38c12 Load terrain when entering world in online mode
Add world entry callback that triggers terrain loading when receiving
SMSG_LOGIN_VERIFY_WORLD. Fix coordinate conversion by applying
serverToCanonical() to properly swap X/Y axes from server format.
2026-02-05 21:28:21 -08:00
Kelsi
c1b998534f Use auth username for world connection 2026-02-05 18:18:15 -08:00
Kelsi
9511d051e2 Simplify wall collision and add intro camera pan
- Remove complex ramp/edge filtering that was skipping building walls
- Simpler wall detection: any vertical geometry above step height
- Add intro camera pan on game start
2026-02-05 18:12:27 -08:00
Kelsi
5401683a8d Add one-time spawn camera pan 2026-02-05 18:06:52 -08:00
Kelsi
f1bdf0bb67 Add missing includes for audio and camera controller 2026-02-05 17:55:30 -08:00
Kelsi
d1e9bbeb1f Persist single-player settings and add defaults 2026-02-05 17:40:15 -08:00
Kelsi
76c4268ed8 Use zone-specific floor cache files
Save/load floor cache per map (e.g., cache/wmo_floor_Azeroth.bin) instead
of a single global file. Saves current zone's cache before teleporting,
loads target zone's cache after terrain streaming completes.
2026-02-05 17:35:17 -08:00
Kelsi
12a7604450 Automate WMO floor cache pre-computation
Add precomputeFloorCache() method that samples all WMO bounds at load time
and populates the persistent floor height grid. Called after terrain
streaming completes (initial spawn and teleport) when cache is empty.
2026-02-05 17:30:08 -08:00
Kelsi
125cf588bb Add pre-computed WMO floor cache and improve save logging
- Add initial floor cache for faster collision on first run
- Log absolute path when saving cache for debugging
2026-02-05 17:26:18 -08:00
Kelsi
a96ea0758c Optimize WMO rendering and collision performance
- Add texture-sorted batch merging with glMultiDrawElements to reduce draw calls
- Pre-compute merged batches at load time instead of per-frame
- Add persistent floor height cache with disk save/load (cache/wmo_floor_cache.bin)
- Reduce collision focus radius and sweep steps for faster collision checks
- Add floor cache size to performance HUD
- Reduce WMO group distance culling to 80 units
2026-02-05 17:20:30 -08:00
Kelsi
ebf349ec7c Add shadow toggle (F4) and distance-based WMO group culling
Shadow toggle allows disabling shadow pass for performance testing.
Distance culling skips WMO groups beyond 200 units. Occlusion queries
disabled by default as overhead outweighs benefits in dense scenes.
2026-02-05 16:11:24 -08:00
Kelsi
66f78bb192 Add /logout chat command 2026-02-05 15:59:06 -08:00
Kelsi
77a21609a8 Add WMO portal culling infrastructure and fix single-player character flow
Portal-based visibility culling for WMO rendering (disabled by default,
needs debugging for complex WMOs like Stormwind). Skip character creation
screen when characters already exist in single-player mode.
2026-02-05 15:31:00 -08:00
Kelsi
140a2e2c22 Fix single-player spawn coords and show action bar spell names 2026-02-05 15:07:13 -08:00
Kelsi
0ff34364b6 Add sqlite single-player persistence with autosave 2026-02-05 14:55:42 -08:00
Kelsi
c89fccdfeb Use created character data and DB start items/spells 2026-02-05 14:35:12 -08:00
Kelsi
2db690a866 Fix crash in character creation by deferring callback to next update
The charCreateCallback was firing synchronously during ImGui render,
causing a state transition before the create screen's ImGui::End() was
called. Defer the callback to GameHandler::update() and ensure update()
runs during CHARACTER_CREATION and CHARACTER_SELECTION states.
2026-02-05 14:18:41 -08:00
Kelsi
0605d1522d Add character creation screen with race/class/appearance customization
Implements a full character creation UI integrated into the existing flow.
In single-player mode, auth screen now goes to character creation before
entering the world. In online mode, a "Create Character" button on the
character selection screen sends CMSG_CHAR_CREATE to the server. Includes
WoW 3.3.5a race/class combo validation and appearance range limits.
2026-02-05 14:13:48 -08:00
Kelsi
129bbac9b3 Add single-player MOTD default 2026-02-05 14:09:03 -08:00
Kelsi
e6e3093467 Emulate server loot/xp and combat feedback in single-player 2026-02-05 14:01:26 -08:00
Kelsi
1383e6c159 Fix realm list by updating auth handler during REALM_SELECTION state 2026-02-05 13:59:33 -08:00
Kelsi
ed5d10ec01 Add single-player local combat system with auto-attack, NPC aggro, and death 2026-02-05 12:01:03 -08:00
Kelsi
b16578e2b9 Fix single-player NPC loading outside Goldshire 2026-02-04 23:37:30 -08:00
Kelsi
28a8e806e1 Fix WMO spawn presets to avoid terrain snapping 2026-02-04 23:30:03 -08:00
Kelsi
ae37e5592e Load single-player NPC spawns from local AzerothCore SQL assets 2026-02-04 23:18:50 -08:00
Kelsi
5f519e77e3 Disable local test NPC spawning 2026-02-04 22:29:47 -08:00
Kelsi
47945451be Rewrite minimap to use pre-baked BLP tile textures from MPQ archives
Replace the 3D top-down rendered minimap with WoW's native pre-rendered
BLP tile textures loaded via md5translate.trs. Tiles are composited into
a 3x3 grid FBO with proper axis transposition matching the ADT terrain
convention. The screen shader provides camera-rotation, circular mask,
directional player arrow, and 20% transparency. Minimap is now on by
default with the N toggle key removed.
2026-02-04 20:06:27 -08:00
Kelsi
d8e2becbaa Add teleporter panel and server-compatible coordinate conversions
Teleporter panel (T key) lets the player teleport between Goldshire,
Stormwind Gate, Ironforge, and Westfall in single-player mode. Adds
serverToCanonical/canonicalToServer conversion at the network packet
boundary so positions are compatible with TrinityCore/MaNGOS/AzerothCore
emulator servers.
2026-02-04 18:27:52 -08:00
Kelsi
6690910712 Unify coordinate systems with canonical WoW world coordinates
Centralizes all coordinate conversions in core/coordinates.hpp with
proper canonical WoW coords (+X=North, +Y=West, +Z=Up). Fixes critical
tile calculation bug that was loading wrong surrounding tiles during
terrain streaming, and fixes position sync sending ADT-raw format
instead of canonical coordinates to the server.
2026-02-04 17:37:28 -08:00
Kelsi
dede5a99d4 Fix shutdown order for terrain streaming threads 2026-02-04 16:07:28 -08:00