diff --git a/CHANGELOG.md b/CHANGELOG.md index 866f0918..03d49042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,42 @@ - Extract 8 domain handler classes from GameHandler - Replace 3,300-line switch with dispatch table - Multi-platform Docker build system (Linux, macOS arm64/x86_64, Windows cross-compilation) +- Decompose ChatPanel monolith into 15+ modules under `src/ui/chat/` with IChatCommand interface, ChatCommandRegistry, MacroEvaluator, ChatMarkupParser/Renderer, ChatBubbleManager, ChatTabManager, GameStateAdapter, and 11 command modules (PR #62) +- Decompose WorldMap (1,360 LOC) into 16 modules under `src/rendering/world_map/` with WorldMapFacade (PIMPL), CompositeRenderer, DataRepository, CoordinateProjection, ViewStateMachine, 9 overlay layers (PR #61) +- Extract reusable CatmullRomSpline module to `src/math/` with O(log n) binary search and fused position+tangent evaluation (PR #60) +- Decompose TransportManager (1,200→500 LOC): extract TransportPathRepository, TransportClockSync, TransportAnimator; consolidate 7 duplicated spline parsers into `spline_packet.cpp` (PR #60) + +### Features +- Spell visual effects system with bone-tracked ribbons and particles (PR #58) +- GM command support: 190-command data table with dot-prefix interception, tab-completion, `/gmhelp` with category filter (PR #62) +- ZMP pixel-accurate zone hover detection on world map (PR #63) +- Textured player arrow (MinimapArrow.blp) on world map (PR #63) +- Multi-segment path interpolation for entity movement (PR #59) +- Character screen keyboard navigation (Up/Down/Enter) (PR #59) + +### Bug Fixes (v1.8.10+) +- Fix walk/run animation persisting after entity arrival (PR #59) +- Fix entity teleport during dead-reckoning overrun phase (PR #59) +- Fix Vulkan crash on window resize when minimized (0×0 extent) (PR #59) +- Fix quest log not populating on quest accept (PR #59) +- Fix hit-reaction animation being overridden on next frame (PR #59) +- Fix ChatType enum values to match WoW wire protocol (SAY=0x01 not 0x00) (PR #62) +- Fix BG_SYSTEM_* values from 82–84 (UB in bitmask shifts) to 0x24–0x26 (PR #62) +- Fix infinite Enter key loop after teleport (PR #62) +- Remove stale kVOffset (-0.15) from zone hover detection causing ~15% vertical offset +- Add null guard for cachedGameHandler_ in ChatPanel input callback +- Fix cosmic highlight aspect ratio with resolution-independent square rendering +- Skip transport waypoints with broken coordinate conversion instead of silent use +- Fix spline endpoint validation bypass for entities near world origin +- Fix off-by-one in chat link insertion buffer capacity check +- Zero window border in world map to eliminate content/window gap + +### Tests +- Add 19 new test files (27 total, up from 8): + - Chat: chat_markup_parser, chat_tab_completer, gm_commands, macro_evaluator + - World map: world_map, coordinate_projection, exploration_state, map_resolver, view_state_machine, zone_metadata + - Transport/spline: spline, transport_components, transport_path_repo + - Animation: animation_ids, locomotion_fsm, combat_fsm, activity_fsm, anim_capability, indoor_shadows ### Bug Fixes (v1.8.2–v1.8.9) - Fix VkTexture ownsSampler_ flag after move/destroy (prevented double-free) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aac6cdf0..95269468 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ make -C build -j$(nproc) ## Code Style - **C++20**. Use `#pragma once` for include guards. -- Namespaces: `wowee::game`, `wowee::rendering`, `wowee::ui`, `wowee::core`, `wowee::network`. +- Namespaces: `wowee::game`, `wowee::rendering`, `wowee::rendering::world_map`, `wowee::ui`, `wowee::ui::chat`, `wowee::math`, `wowee::core`, `wowee::network`. - Conventional commit messages in imperative mood: - `feat:` new feature - `fix:` bug fix @@ -37,9 +37,12 @@ See [docs/architecture.md](docs/architecture.md) for the full picture. Key names | Namespace | Responsibility | |---|---| -| `wowee::game` | Game state, packet handling (`GameHandler`), opcode dispatch | +| `wowee::game` | Game state, packet handling (`GameHandler`), opcode dispatch, spline parsing | | `wowee::rendering` | Vulkan renderer, M2/WMO/terrain, sky system | +| `wowee::rendering::world_map` | Modular world map (16 components: facade, compositor, layers, etc.) | | `wowee::ui` | ImGui windows and HUD (`GameScreen`) | +| `wowee::ui::chat` | Modular chat system (15+ components: commands, markup, macros, etc.) | +| `wowee::math` | Reusable math modules (CatmullRomSpline) | | `wowee::core` | Coordinates, math, utilities | | `wowee::network` | Connection, `Packet` read/write API | @@ -56,17 +59,22 @@ Helper variants: `registerWorldHandler` (requires `isInWorld()`), `registerSkipH ## Testing -There is no automated test suite. Changes are verified by manual testing against -WoW 3.3.5a private servers (primarily ChromieCraft/AzerothCore). Classic and TBC -expansion paths are tested against their respective server builds. +27 unit tests cover core systems, animation, transport/spline, world map, and chat. +See [TESTING.md](TESTING.md) for the full guide. Run with `./test.sh --test`. +Manual testing against WoW 3.3.5a private servers (primarily ChromieCraft/AzerothCore) +is expected for gameplay-affecting changes. ## Key Files for New Contributors -| File | What it does | +| File / Directory | What it does | |---|---| | `include/game/game_handler.hpp` | Central game state and all packet handler declarations | | `src/game/game_handler.cpp` | Packet dispatch registration and handler implementations | | `include/network/packet.hpp` | `Packet` class -- the read/write API every handler uses | | `include/ui/game_screen.hpp` | Main gameplay UI screen (ImGui) | +| `src/ui/chat/` | Modular chat system (commands, markup, macros, tab completion) | +| `src/rendering/world_map/` | Modular world map (facade, compositor, layers, coordinate projection) | +| `src/math/spline.cpp` | Reusable CatmullRomSpline math | +| `src/game/spline_packet.cpp` | Unified spline packet parsing for all expansions | | `src/rendering/m2_renderer.cpp` | M2 model loading and rendering | | `docs/architecture.md` | High-level system architecture reference | diff --git a/README.md b/README.md index 69e0a6dd..a7e2408f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Protocol Compatible with **Vanilla (Classic) 1.12 + TBC 2.4.3 + WotLK 3.3.5a**. > **Legal Disclaimer**: This is an educational/research project. It does not include any Blizzard Entertainment assets, data files, or proprietary code. World of Warcraft and all related assets are the property of Blizzard Entertainment, Inc. This project is not affiliated with or endorsed by Blizzard Entertainment. Users are responsible for supplying their own legally obtained game data files and for ensuring compliance with all applicable laws in their jurisdiction. -## Status & Direction (2026-03-30) +## Status & Direction (2026-04-14) - **Compatibility**: **Vanilla (Classic) 1.12 + TBC 2.4.3 + WotLK 3.3.5a** are all supported via expansion profiles and per-expansion packet parsers. All three expansions are roughly on par. - **Tested against**: AzerothCore/ChromieCraft, TrinityCore, Mangos, and Turtle WoW (1.17). diff --git a/TESTING.md b/TESTING.md index 3846b15d..09553b88 100644 --- a/TESTING.md +++ b/TESTING.md @@ -83,15 +83,44 @@ pacman -S --needed mingw-w64-x86_64-clang-tools-extra ``` tests/ - CMakeLists.txt — CMake test configuration - test_packet.cpp — Network packet encode/decode - test_srp.cpp — SRP-6a authentication math (requires OpenSSL) - test_opcode_table.cpp — Opcode registry lookup - test_entity.cpp — ECS entity basics - test_dbc_loader.cpp — DBC binary file parsing - test_m2_structs.cpp — M2 model struct layout / alignment - test_blp_loader.cpp — BLP texture file parsing - test_frustum.cpp — View-frustum culling math + CMakeLists.txt — CMake test configuration + + # Core + test_packet.cpp — Network packet encode/decode + test_srp.cpp — SRP-6a authentication math (requires OpenSSL) + test_opcode_table.cpp — Opcode registry lookup + test_entity.cpp — ECS entity basics + test_dbc_loader.cpp — DBC binary file parsing + test_m2_structs.cpp — M2 model struct layout / alignment + test_blp_loader.cpp — BLP texture file parsing + test_frustum.cpp — View-frustum culling math + + # Animation + test_animation_ids.cpp — Animation ID constants + test_locomotion_fsm.cpp — Locomotion state machine transitions + test_combat_fsm.cpp — Combat animation state machine + test_activity_fsm.cpp — Activity state machine + test_anim_capability.cpp — Animation capability queries + test_indoor_shadows.cpp — Indoor shadow rendering + + # Transport & Spline + test_spline.cpp — CatmullRomSpline math (interpolation, binary search, looping) + test_transport_components.cpp — Transport clock sync and animator + test_transport_path_repo.cpp — TransportPathRepository (DBC loading, path inference) + + # World Map + test_world_map.cpp — World map integration tests + test_world_map_coordinate_projection.cpp — UV projection, zone/continent spatial lookups + test_world_map_exploration_state.cpp — Server exploration mask, local tracking + test_world_map_map_resolver.cpp — Cross-map navigation (Outland, Northrend) + test_world_map_view_state_machine.cpp — COSMIC→WORLD→CONTINENT→ZONE transitions + test_world_map_zone_metadata.cpp — Zone level ranges and faction labels + + # Chat + test_chat_markup_parser.cpp — Item link and markup parsing + test_chat_tab_completer.cpp — Tab-completion for names and commands + test_gm_commands.cpp — GM command data table and dispatch + test_macro_evaluator.cpp — Macro conditional evaluation ``` The Catch2 v3 amalgamated source lives at: @@ -116,10 +145,11 @@ Tests are _not_ built by default. Enable them with `-DWOWEE_BUILD_TESTS=ON`. # Configure (only needed once) cmake -B build -DCMAKE_BUILD_TYPE=Release -DWOWEE_BUILD_TESTS=ON -# Build test targets (fast — only compiles tests and Catch2) -cmake --build build --target \ - test_packet test_srp test_opcode_table test_entity \ - test_dbc_loader test_m2_structs test_blp_loader test_frustum +# Build all test targets +cmake --build build --parallel $(nproc) + +# Or build specific test targets +cmake --build build --target test_packet test_spline test_world_map ``` Or simply run a full rebuild (builds everything including the main binary): @@ -138,9 +168,7 @@ cmake -B build_asan \ -DWOWEE_ENABLE_ASAN=ON \ -DWOWEE_BUILD_TESTS=ON -cmake --build build_asan --target \ - test_packet test_srp test_opcode_table test_entity \ - test_dbc_loader test_m2_structs test_blp_loader test_frustum +cmake --build build_asan --parallel $(nproc) ``` CMake will print: `Test targets: ASAN + UBSan ENABLED` when configured correctly. @@ -378,10 +406,7 @@ The following commands map to typical CI jobs: -DWOWEE_BUILD_TESTS=ON - name: Build test targets - run: | - cmake --build build_asan --target \ - test_packet test_srp test_opcode_table test_entity \ - test_dbc_loader test_m2_structs test_blp_loader test_frustum + run: cmake --build build_asan --parallel $(nproc) - name: Run ASAN tests run: ./test.sh --asan diff --git a/docs/architecture.md b/docs/architecture.md index b7da1c6e..d5ca993f 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -125,6 +125,19 @@ Wowee follows a modular architecture with clear separation of concerns: - Distance-weighted light volume blending - Fog color/distance parameters +**World Map System** (`src/rendering/world_map/`) - Modular map architecture: +- `WorldMapFacade` - Public API (PIMPL pattern), composes all components +- `CompositeRenderer` - Vulkan tile pipeline + off-screen FBO compositing (1024×768 FBO, 1002×668 visible) +- `DataRepository` - DBC zone loading, ZMP pixel map, POI/overlay storage +- `CoordinateProjection` - UV projection, zone/continent spatial lookups +- `ExplorationState` - Server exploration mask + local fog-of-war tracking +- `ViewStateMachine` - COSMIC → WORLD → CONTINENT → ZONE navigation with transitions +- `InputHandler` - Keyboard/mouse input → `InputAction` mapping +- `OverlayRenderer` - Layer-based ImGui overlay system (Open/Closed Principle) +- `MapResolver` - Cross-map navigation (Outland, Northrend detection) +- `ZoneMetadata` - Zone level ranges and faction data for labels +- 9 overlay layers (each implements `IOverlayLayer`): player marker, party dot, taxi node, POI marker, quest POI, corpse marker, zone highlight, coordinate display, subzone tooltip + ### 3. Networking (`src/network/`) **TCPSocket** (`tcp_socket.hpp/cpp`) - Platform TCP @@ -183,10 +196,28 @@ Wowee follows a modular architecture with clear separation of concerns: - Player, Unit, GameObject subtypes - GUID-based lookup, field extraction (health, level, display ID, etc.) -**TransportManager** - Transport path evaluation -- Catmull-Rom spline interpolation from TransportAnimation.dbc -- Clock-based motion with server time synchronization -- Time-closed looping paths (wrap point duplicated, no index wrapping) +**TransportManager** - Transport lifecycle and server sync +- Delegates path data to `TransportPathRepository` +- Delegates spline math to `math::CatmullRomSpline` +- Clock-based motion with `TransportClockSync` +- Reduced from ~1,200 to ~500 lines after decomposition + +**TransportPathRepository** - Transport path data +- DBC loading (TransportAnimation.dbc, TaxiPathNode.dbc) +- Path inference heuristics for server spawn→DBC mapping +- Z-only elevator detection vs XY transport paths + +**math::CatmullRomSpline** (`src/math/`) - Reusable spline module +- Catmull-Rom interpolation with O(log n) binary search segment lookup +- Fused position+tangent evaluation (single call per frame per transport) +- Time-closed (looping) and clamped (non-looping) path modes +- `orientationFromTangent()` for smooth transport/entity facing + +**SplineBlockData** (`src/game/spline_packet.hpp/cpp`) - Unified spline parsing +- Consolidates 7 duplicated spline parsers into shared functions +- `parseMonsterMoveSplineBody()` (WotLK/TBC), `parseMonsterMoveSplineBodyVanilla()` +- `parseWotlkMoveUpdateSpline()`, `parseClassicMoveUpdateSpline()` +- Packed delta decoding (11+11+10-bit signed, ×0.25 scale) **Expansion Helpers** (`game_utils.hpp`): - `isActiveExpansion("classic")` / `isActiveExpansion("tbc")` / `isActiveExpansion("wotlk")` @@ -244,7 +275,7 @@ Wowee follows a modular architecture with clear separation of concerns: **Screens:** - `AuthScreen` - Login with username/password, server address, security code - `RealmScreen` - Realm list with population and type indicators -- `CharacterScreen` - Character selection with 3D animated preview +- `CharacterScreen` - Character selection with 3D animated preview, keyboard navigation - `CharacterCreateScreen` - Race/class/gender/appearance customization - `GameScreen` - Main HUD: chat, action bar, target frame, minimap, nameplates, combat text, tooltips - `InventoryScreen` - Equipment paper doll, backpack, bag windows, item tooltips with stats @@ -253,6 +284,22 @@ Wowee follows a modular architecture with clear separation of concerns: - `TalentScreen` - Talent tree UI with point allocation - `SettingsScreen` - Graphics presets (LOW/MEDIUM/HIGH/ULTRA), audio, keybindings +**Chat System** (`src/ui/chat/`) - Modular chat architecture: +- `ChatPanel` - Main chat UI (tabs, input, message display) +- `ChatInput` - Input handling and history +- `ChatTabManager` - Tab creation, switching, per-tab filters +- `ChatTabCompleter` - Tab-completion for player names, commands, channels +- `ChatCommandRegistry` - Slash command dispatch with `IChatCommand` interface +- `ChatMarkupParser` / `ChatMarkupRenderer` - Item link parsing and colored rich-text rendering +- `ChatBubbleManager` - Floating chat bubbles above entities +- `ChatSettings` - Per-channel color, font size, timestamp options +- `MacroEvaluator` - WoW-style macro conditional evaluation (`[mod:shift]`, `[target=focus]`, etc.) +- `GameStateAdapter` / `InputModifierAdapter` - Testable abstractions over game state +- `ItemTooltipRenderer` - Chat-embedded item tooltip rendering (510 LOC) +- `CastSequenceTracker` - `/castsequence` state tracking +- 11 command modules under `commands/`: channel, combat, emote, GM, group, guild, help, misc, social, system, target +- 190-command GM data table with dot-prefix interception and `/gmhelp` + ### 8. Audio System (`src/audio/`) **AudioEngine** - miniaudio-based playback @@ -313,7 +360,7 @@ Wowee follows a modular architecture with clear separation of concerns: ## Code Style - **C++20 standard** -- **Namespaces**: `wowee::core`, `wowee::rendering`, `wowee::game`, `wowee::ui`, `wowee::network`, `wowee::auth`, `wowee::audio`, `wowee::pipeline` +- **Namespaces**: `wowee::core`, `wowee::rendering`, `wowee::rendering::world_map`, `wowee::game`, `wowee::ui`, `wowee::ui::chat`, `wowee::math`, `wowee::network`, `wowee::auth`, `wowee::audio`, `wowee::pipeline` - **Naming**: PascalCase for classes, camelCase for functions/variables, kPascalCase for constants - **Headers**: `.hpp` extension, `#pragma once` - **Commits**: Conventional style (`feat:`, `fix:`, `refactor:`, `docs:`, `perf:`) diff --git a/docs/status.md b/docs/status.md index c337ca2f..c1afbcb5 100644 --- a/docs/status.md +++ b/docs/status.md @@ -1,6 +1,6 @@ # Project Status -**Last updated**: 2026-03-30 +**Last updated**: 2026-04-14 ## What This Repo Is @@ -36,8 +36,19 @@ Implemented (working in normal use): - Multi-expansion: Classic/Vanilla, TBC, WotLK, and Turtle WoW (1.17) protocol and asset variants - CI: GitHub Actions for Linux (x86-64, ARM64), Windows (MSYS2 x86-64 + ARM64), macOS (ARM64); container builds via Podman +Recent refactors (PRs #59-63, April 2026): + +- Chat system decomposed into 15+ modules under `src/ui/chat/` with 11 command modules, GM command support, macro evaluator, and tab completion +- World map decomposed into 16 modules under `src/rendering/world_map/` with overlay layer system, view state machine, and ZMP-based hover detection +- TransportManager decomposed: spline math extracted to `src/math/`, path data to TransportPathRepository, 7 duplicated spline parsers consolidated into `spline_packet.cpp` +- Spell visual effects system with bone-tracked ribbons and particles +- Entity movement improvements: multi-segment path interpolation, terrain height clamping, walk/run animation fix +- 27 unit tests (up from 8), covering chat, world map, spline math, transport, and animation systems +- Code quality fix pass: 7 issues resolved across hover detection, null safety, buffer bounds, and coordinate validation + In progress / known gaps: +- World map: zone hover detection has edge cases with some zone boundaries; cosmic highlight sizing is approximate - Transports: M2 transports (trams) working with position-delta riding; WMO transports (ships, zeppelins) working with path following; some edge cases remain - Quest GO interaction: CMSG_GAMEOBJ_USE + CMSG_LOOT sent correctly, but some AzerothCore/ChromieCraft servers don't grant quest credit for chest-type GOs (server-side limitation) - Visual edge cases: some M2/WMO rendering gaps (some particle effects)