Commit Graph

93 Commits

Author SHA1 Message Date
Kelsi
ce105ced9f Add unlit rendering for M2 glow/additive batches
Batches with the M2 unlit material flag (0x01) or additive blend modes
(3+) now skip lighting, shadows, and fog, emitting texture color directly.
Fixes lantern glow quads appearing as dull transparent circles.
2026-02-06 03:28:21 -08:00
Kelsi
20f89b2d4a 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
e327344a9b Trigger player model visual update when online inventory changes
rebuildOnlineInventory() now sets a dirty flag that GameScreen checks
each frame to call updateCharacterGeosets/Textures and loadEquippedWeapons.
2026-02-06 03:13:42 -08:00
Kelsi
a3055267f6 Fix online mode combat and implement server inventory sync
Right-click now attacks hostile NPCs (npcFlags==0) and interacts with
friendly ones in online mode. Parse UNIT_FIELD_FLAGS (59) and
UNIT_NPC_FLAGS (82) from update packets. Stop auto-attack when target
dies or despawns. Add CMSG_ITEM_QUERY_SINGLE/SMSG_ITEM_QUERY_SINGLE_RESPONSE
to populate inventory from server item objects and player slot fields.
2026-02-06 03:11:43 -08:00
Kelsi
ce4299fe51 Parse M2 render flags and apply per-batch blend modes
Water/lava batches in fountain and Ironforge M2 models use non-opaque
blend modes (alpha, additive) defined in the M2 material table. Without
parsing these, they rendered as solid surfaces extending visibly beyond
their containers. Now each batch looks up its blend mode from the
material array and sets the appropriate GL blend function.
2026-02-06 01:54:25 -08:00
Kelsi
b83ec336b6 Implement M2 texture animation (UV scrolling) for fountain water
Parse M2TextureTransform entries and texture transform lookups from the
M2 binary, then apply per-batch UV offsets in the vertex shader using
the existing animation time base and global sequence durations.
2026-02-06 01:49:27 -08:00
Kelsi
c48af4926a 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
25191de47b Revert "Fix geoset filtering using correct geosetId from M2 batch"
This reverts commit 937c5961c9.
2026-02-05 23:27:59 -08:00
Kelsi
937c5961c9 Fix geoset filtering using correct geosetId from M2 batch
M2 batches have a geosetIndex field that determines the geoset group for
filtering (0-18=body, 1xx=hair, etc.). We were incorrectly using submeshId
from the submesh struct instead. Now properly stores and uses geosetId.
2026-02-05 23:26:30 -08:00
Kelsi
20eef54ccf 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
7fd5708f1f 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
9b62acd72d 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
300edd2c7c 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
5ecca080d5 Add ZLIB linking and file logging support
- Add ZLIB find_package and linking for addon compression
- Add file logging to logs/wowee.log
2026-02-05 21:03:27 -08:00
Kelsi
d970385815 Fix world server authentication for AzerothCore
- Use 6-byte CMSG header (uint16 size + uint32 opcode) for client-to-server
- Enable RC4 encryption immediately after sending AUTH_SESSION
- Encrypt all 6 header bytes to match AzerothCore expectations
- Add 8-byte addon info (addonCount + clientTime) for proper parsing
- Fix CharCreateResult enum to use correct WoW 3.3.5a response codes
- Add CHAR_NAME_* error codes for name validation messages
- Allow character list refresh from CHAR_LIST_RECEIVED state
2026-02-05 21:03:11 -08:00
Kelsi
8a9a2c6d3d Clamp character appearance using DBC ranges 2026-02-05 18:22:11 -08:00
Kelsi
d2fcf5e71f Use auth username for world connection 2026-02-05 18:18:15 -08:00
Kelsi
961ddb187e 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
9828eb2880 Add one-time spawn camera pan 2026-02-05 18:06:52 -08:00
Kelsi
f7e2d52faf Fix heightmap loading detection and widen wall collision radius
- Use explicit loaded flag for heightmap instead of checking height values
- Increase player collision radius from 0.50 to 0.55 for better wall collision
2026-02-05 18:01:16 -08:00
Kelsi
7525230e86 Add mouse sensitivity and invert mouse to settings UI
Larger settings window (440x520) to fit all sections.
2026-02-05 17:51:14 -08:00
Kelsi
697c4b8218 Persist single-player settings and add defaults 2026-02-05 17:40:15 -08:00
Kelsi
46939808ad 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
7060c80b81 Add audio volume controls to settings 2026-02-05 17:32:21 -08:00
Kelsi
f5185c08cf 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
01de332d4c 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
79e4bfd6c3 Add shadows toggle and F4 hotkey 2026-02-05 16:14:11 -08:00
Kelsi
528f645350 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
6a49a7e01f Add video settings UI and refresh loading assets 2026-02-05 16:11:00 -08:00
Kelsi
77070468b5 Add escape menu with logout/quit/settings 2026-02-05 16:01:38 -08:00
Kelsi
0ef0a9e028 Add /logout chat command 2026-02-05 15:59:06 -08:00
Kelsi
b758f45a9f Add GPU occlusion query culling for WMO groups
Renders bounding boxes in depth-only pre-pass and queries GPU for
visibility. Groups fully occluded in previous frame are skipped.
Significantly improves performance in dense areas like Stormwind.
2026-02-05 15:51:08 -08:00
Kelsi
b05089aa3f Play tavern music file on login screen 2026-02-05 15:44:42 -08:00
Kelsi
02f8328747 Play looping MP4 behind auth screen 2026-02-05 15:34:29 -08:00
Kelsi
41ac8f646e 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
ca84384402 Store password hash instead of plaintext for login persistence
Save SHA1(UPPER(user):UPPER(pass)) hash to login.cfg instead of the
plaintext password. On subsequent logins, use the stored hash directly
with a new authenticateWithHash() method that bypasses password hashing.
The password field shows a placeholder when using a stored hash.
2026-02-05 15:09:16 -08:00
Kelsi
5ece5b1ce6 Fix single-player spawn coords and show action bar spell names 2026-02-05 15:07:13 -08:00
Kelsi
060f2bbb9f Add 3D character model preview to character creation screen
Render an animated M2 character model in the creation screen using a
dedicated CharacterRenderer with an offscreen FBO. Preview updates on
race/gender/appearance changes, supports mouse-drag rotation, and
composites skin, face, hair scalp, and underwear textures from
CharSections.dbc. Extracts getPlayerModelPath() to a shared free
function in game/character.
2026-02-05 14:58:45 -08:00
Kelsi
48d2808872 Add sqlite single-player persistence with autosave 2026-02-05 14:55:42 -08:00
Kelsi
33226fa953 Use created character data and DB start items/spells 2026-02-05 14:35:12 -08:00
Kelsi
776a617f61 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
cf54db4554 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
3ca8944ced Emulate server loot/xp and combat feedback in single-player 2026-02-05 14:01:26 -08:00
Kelsi
738dafb65b Add system chat for key game events 2026-02-05 13:22:15 -08:00
Kelsi
5ef11fdc7d Fix auth protocol to match real WoW 3.3.5a client format
Three critical bugs fixed:
- LOGON_CHALLENGE request: set protocol byte to 0x03 (was 0x00) and
  reverse FourCC strings (game/platform/os/locale) to match real client
- Response parsers: remove double-read of opcode byte that shifted all
  field reads by one, preventing successful auth with real servers
- LOGON_PROOF response sizes: success=32 bytes, failure=4 bytes to match
  TrinityCore/AzerothCore format

Also adds missing auth result codes (0x13-0x20, 0xFF) including
IGR_WITHOUT_BNET (0x17) which Warmane was returning.
2026-02-05 12:39:34 -08:00
Kelsi
bc9c7f09b1 Fix non-blocking TCP connect for remote servers and persist login info between sessions 2026-02-05 12:25:00 -08:00
Kelsi
a52e28191e Improve auth error feedback with specific failure reasons, version mismatch details, and connection timeout 2026-02-05 12:17:09 -08:00
Kelsi
78442f8aea Add XP tracking with level-up, kill XP formula, and server-compatible SMSG_LOG_XPGAIN support 2026-02-05 12:07:58 -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