Commit graph

937 commits

Author SHA1 Message Date
Kelsi
e1614d55a2 chore: ignore and untrack python cache files 2026-02-25 10:42:50 -08:00
Kelsi
c849f9cdfa chore: update camera controller changes 2026-02-25 10:41:54 -08:00
Kelsi
7557e388fb Fix Booty Bay floor fall-through via M2-aware grounding rescue 2026-02-25 10:26:41 -08:00
Kelsi
bdde5f305a Harden WMO grounding rescue to prevent fall-through 2026-02-25 10:24:54 -08:00
Kelsi
2219ccde51 Optimize city performance and harden WMO grounding 2026-02-25 10:22:05 -08:00
Kelsi
dd4b72e046 Avoid log argument evaluation when level is disabled 2026-02-25 09:55:12 -08:00
Kelsi
52accfde80 Optimize login music scanning and warden debug formatting 2026-02-25 09:50:33 -08:00
Kelsi
c26353eda1 Reduce release log spam and harden release logging defaults 2026-02-25 09:46:27 -08:00
Kelsi
5966fedc59 Use outbound local IP for logon challenge with safe fallback 2026-02-25 09:37:52 -08:00
Kelsi
0e8f305087 Add tavern music tracks 2026-02-25 09:29:42 -08:00
Kelsi
fc68c6c6b7 Fix Warden module parse fallback and macOS FMOD integrity aliases 2026-02-25 09:26:34 -08:00
Kelsidavis
1fab17e639 Add Windows build scripts, fix multi-threaded MPQ extraction, and cross-platform temp paths
- Add build.ps1/bat, rebuild.ps1/bat, debug_texture.ps1/bat (Windows equivalents
  of existing bash scripts, using directory junctions for Data link)
- Fix asset extractor: StormLib is not thread-safe even with separate handles per
  thread. Serialize all MPQ reads behind a mutex while keeping CRC computation and
  disk writes parallel. Previously caused 99.8% extraction failures with >1 thread.
- Add SFileHasFile() check during enumeration to skip listfile-only entries
- Add diagnostic logging for extraction failures (first 5 per thread + summary)
- Use std::filesystem::temp_directory_path() instead of hardcoded /tmp/ in
  character_renderer.cpp debug dumps
- Update debug_texture.sh to use $TMPDIR fallback and glob for actual dump filenames
2026-02-25 08:22:45 -08:00
Kelsi
570dec8b88 Fix loading screen graphical artifacts on window resize
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Recreate Vulkan swapchain in LoadingScreen::render() when the dirty flag
is set, so resizing the window during world loading no longer renders
into a stale swapchain with mismatched framebuffers.
2026-02-25 03:45:13 -08:00
Kelsi
4c8fa9f1fe Add Windows and macOS CPU affinity support
- Windows: SetThreadAffinityMask to pin main thread to core 0 and
  exclude workers from core 0
- macOS: thread_policy_set with THREAD_AFFINITY_POLICY tags to hint
  scheduler separation (tag 1 for main, tag 2 for workers)
2026-02-25 03:41:18 -08:00
Kelsi
86505ad377 Merge per-chunk water surfaces, restore incremental tile finalization, and pin main thread CPU affinity
Water deduplication: merge per-chunk water surfaces into per-tile surfaces
to reduce Vulkan descriptor set usage from ~8900 to ~100-200. Uses hybrid
approach — groups with ≤4 chunks stay per-chunk (preserving shore detail),
larger groups merge into 128×128 tile-wide surfaces.

Re-add incremental tile finalization state machine (reverted in 9b90ab0)
to spread GPU uploads across frames and prevent city stuttering.

Pin main thread to CPU core 0 and exclude worker threads from core 0
to reduce scheduling jitter on the render/game loop.
2026-02-25 03:39:45 -08:00
Kelsi
7ca9caa212 Fix Windows ARM64 build: disable x86 asm in StormLib's libtomcrypt
StormLib's bundled libtomcrypt uses x86 inline assembly (bswapl/movl)
gated by __MINGW32__, which is defined on CLANGARM64 too. Pass
-DLTC_NO_BSWAP to force portable C byte-swap fallback.
2026-02-25 03:06:06 -08:00
Kelsi
9b90ab0429 Revert terrain_manager to original finalizeTile to fix water rendering
The incremental advanceFinalization state machine broke water rendering
in ways that couldn't be resolved. Reverted to the original monolithic
finalizeTile approach. The other performance optimizations (bone SSBO
pre-allocation, WMO distance culling, M2 adaptive distance tiers)
are kept.
2026-02-25 02:50:36 -08:00
Kelsi
7dd78e2c0a Fix missing water by finalizing each tile completely per frame
Phase-splitting across frames caused water surfaces to not render
correctly. Changed processReadyTiles to run all phases for each tile
before moving to the next, with time budget checked between tiles.
2026-02-25 02:47:37 -08:00
Kelsi
0b6f5a9313 Add new preview video to README 2026-02-25 02:36:50 -08:00
Kelsi
d47ae2a110 Fix city stuttering with incremental tile finalization and GPU optimizations
Replace monolithic finalizeTile() with a phased state machine that spreads
GPU upload work across multiple frames (TERRAIN→M2→WMO→WATER→AMBIENT→DONE).
Each advanceFinalization() call does one bounded unit of work within the
per-frame time budget, eliminating 50-300ms frame hitches when entering cities.

Additional performance improvements:
- Pre-allocate bone SSBOs at M2 instance creation instead of lazily during
  first render frame, preventing hitches when many skinned characters appear
- Enable WMO distance culling (800 units) with active-group exemption so
  the player's current floor/neighbors are never culled
- Add 4-tier adaptive M2 render distance (250/400/600/1000 based on count)
- Remove dead PendingM2Upload queue code superseded by incremental system

Fix tile re-enqueueing bug: keep tiles in pendingTiles until committed to
loadedTiles (not when moved to finalizingTiles_) so streamTiles() doesn't
re-enqueue tiles mid-finalization. Also handle unloadTile() for tiles in
the finalizingTiles_ deque to prevent orphaned water/M2/WMO resources.
2026-02-25 02:36:23 -08:00
Kelsi
8fe53171eb Fix release packaging and macOS stack overflow crash
- Fix StormLib package name: libstormlib-dev → libstorm-dev (correct
  Ubuntu package name) across all CI workflows and extract_assets.sh
- Build StormLib from source on Windows CI (no MSYS2 package exists),
  ensuring asset_extract.exe is included in release archives
- Update extract_assets.sh/.ps1 to prefer pre-built asset_extract
  binary next to the script (release archives) before trying build dir
- Move ADTTerrain allocations from stack to heap in prepareTile() to
  fix stack overflow on macOS (worker threads default to 512 KB stack,
  two ADTTerrain structs ≈ 560 KB exceeded that)
2026-02-25 01:55:16 -08:00
Kelsi
624744da86 Fix Windows release packaging: replace rsync/7z with cp/zip
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
MSYS2 doesn't have rsync or 7z by default. Use cp -r for assets
and install zip package for archive creation.
2026-02-24 05:46:45 -08:00
Kelsi
e31c2ffda8 Add GitHub Release workflow with asset extraction tools
Tag-triggered (v*) workflow that builds all 5 platforms and creates
a GitHub Release with bundled binaries, Data/, and asset extraction
tools (asset_extract, extraction scripts, pipeline GUI).
2026-02-24 05:04:37 -08:00
Kelsi
d045c1215a Fix Warden module parsing and DBC loading for Classic expansion
Warden: copy/skip pair order was reversed — format is [copy][data][skip]
per MaNGOS/TrinityCore, not [skip][copy][data]. All copy sizes read as 0,
causing module load failure and server disconnect.

DBC: when binary DBCs aren't available (no MPQ extraction), fall back to
expansion CSV files even for visual DBCs (CreatureDisplayInfo, CharSections,
ItemDisplayInfo, etc.) instead of failing with "DBC not found".
2026-02-24 04:42:36 -08:00
Kelsi
60c26a17aa Fix audio playback not stopping when Stop button clicked
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Use spawn context for clean subprocess isolation and add kill() fallback
after terminate() to ensure the audio process is reliably stopped.
2026-02-23 22:26:17 -08:00
Kelsi
55faacef96 Add M2/WMO 3D viewer with textured rendering, animation, and audio playback
- New tools/m2_viewer.py: Pygame/OpenGL viewer for M2 models (textured
  rendering, skeletal animation, orbit camera) and WMO buildings
- M2 viewer: per-batch texture mapping, CPU vertex skinning, animation
  playback with play/pause/speed controls, wireframe overlay toggle
- WMO viewer: root+group file parsing (MOTX/MOMT/MOVT/MOVI/MONR/MOTV/MOBA),
  per-batch material rendering with BLP textures
- Asset browser: "Open 3D Viewer" buttons for M2 and WMO previews,
  audio Play/Stop buttons using pygame.mixer in subprocess
- Handles both WotLK (v264) and Vanilla (v256) M2 formats
2026-02-23 22:22:39 -08:00
Kelsi
edf0a40759 Fix asset browser BLP errors, M2 wireframes, and add anim filter
- BLP: blp_convert takes one arg, not two; was passing an output path
  that caused conversion failures
- M2: vertex header offsets were wrong (used 80/100 instead of 60/68),
  producing garbage vertex counts that failed the sanity check
- Add "Hide .anim/.skin" checkbox (on by default) to filter ~30k
  companion files from the directory tree
2026-02-23 20:51:33 -08:00
Kelsi
6e2d51b325 Fix asset browser hanging on launch with large manifests
Manifest keys use backslashes but tree splitting used forward slashes,
causing all 241k entries to land at root level. Combined with O(N)
any(startswith) checks per entry, this produced an O(N^2) hang. Re-key
manifest by the forward-slash 'p' field and build a directory index in
a single O(N) pass so tree operations are O(1) lookups.
2026-02-23 20:45:19 -08:00
Kelsi
2a1bd12f5b Fix game objects rendering with player textures
When M2Renderer's descriptor pool was exhausted, batch.materialSet
would be VK_NULL_HANDLE and the bind was skipped, but the draw call
still executed using the previously bound descriptor set from
CharacterRenderer — causing game objects to render with the player's
skin/armor textures. Skip the entire batch instead.
2026-02-23 20:41:06 -08:00
Kelsi
739ae5b569 Add Asset Browser tab to pipeline GUI with inline previews
New tab lets users explore extracted assets visually: BLP textures
rendered via blp_convert+Pillow, M2/WMO wireframes with mouse-drag
rotation and zoom, DBC/CSV tables with named columns from
dbc_layouts.json, ADT heightmap grids, text file viewer, audio
metadata, and hex dumps. Directory tree lazy-loads from manifest.json
with search and file-type filtering.
2026-02-23 20:35:32 -08:00
Kelsi
ef04dde2fe Update asset pipeline GUI documentation
Cover all new features: cancel extraction, background override rebuild,
zip-slip protection, extractor auto-detection order, readonly dropdowns,
and selection preservation. Reorganize into per-tab sections with tables.
2026-02-23 20:09:26 -08:00
Kelsi
f95770720f Fix security, bugs, and UX in asset pipeline GUI
- Fix zip slip vulnerability: validate extracted paths stay within target
- Fix redundant mkdir before rmtree in rebuild_override()
- Add build/asset_extract and Windows .ps1 fallback to extractor search
- Preserve pack list selection across refreshes
- Add Cancel Extraction button with process.terminate()
- Run override rebuild in background thread to avoid UI freeze
- Fix locale combobox state to readonly
- Add asset_pipeline/ to .gitignore
- Make script executable
2026-02-23 20:06:41 -08:00
Kelsi
20dd5ed63b Add cross-platform Python asset pipeline GUI 2026-02-23 20:03:07 -08:00
Kelsi
aaab2115d1 Fix all remaining build warnings and eliminate UB in binary parsers
Resolve 57 compiler warnings (unused params/vars, ignored return values,
enum mismatch) and replace undefined-behavior reinterpret_cast with
memcpy in DBC, BLP, and Warden module loaders for ARM64 portability.
2026-02-23 19:58:38 -08:00
Kelsi
22518f0936 Suppress third-party header warnings and Vulkan struct init noise
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
- Add -Wno-missing-field-initializers for GCC (Vulkan designated
  initializer patterns in valid C++20 trigger this)
- Mark extern/ and vk-bootstrap as SYSTEM includes to suppress
  warnings from vendored headers (VMA, stb, miniaudio, nlohmann)
2026-02-23 19:20:55 -08:00
Kelsi
997318ae06 Fix all build warnings
- vk_utils.hpp: mark unused 'msg' parameter with [[maybe_unused]]
- world_packets.cpp: write exactMatch field to auction list packet
  (was accepted as parameter but never serialized)
- game_screen.cpp: remove unused bagIcons array and unused info variable
- talent_screen.cpp: remove unused nextRank and pMin variables
2026-02-23 19:16:47 -08:00
Kelsi
a825450048 Enable MSYS2 update on windows-arm64 to fix stale PGP keyring
The CLANGARM64 runner's cached MSYS2 install has outdated PGP keys,
causing "signature is unknown trust" errors. Setting update: true
refreshes the keyring before installing packages.
2026-02-23 18:57:49 -08:00
Kelsi
de6983e385 Track VulkanMemoryAllocator header in extern/
vk_mem_alloc.h was in extern/ but gitignored, causing macOS CI to fail
with 'vk_mem_alloc.h' file not found. Whitelist it alongside the other
vendored headers.
2026-02-23 18:54:00 -08:00
Kelsi
0210c24186 Pin vk-bootstrap to v1.3.302 for Vulkan 1.3 header compatibility
Latest vk-bootstrap HEAD uses Vulkan 1.4 types
(VkPhysicalDeviceVertexAttributeDivisorFeatures) that don't exist in
the Vulkan 1.3.275 headers shipped by Ubuntu 24.04. Pin to v1.3.302,
the latest release compatible with Vulkan 1.3 headers.
2026-02-23 18:51:33 -08:00
Kelsi
42b8e3141a Add Vulkan and shaderc packages to security workflow
CodeQL and sanitizer jobs were missing libvulkan-dev, vulkan-tools,
and glslc — same fix as the build workflow.
2026-02-23 18:49:15 -08:00
Kelsi
b5f754a9cc Add pkg-config fallback for Vulkan discovery
Some distros and CMake versions fail to find Vulkan via FindVulkan.cmake
even when libvulkan-dev is installed. Fall back to pkg-config (vulkan.pc)
and create the Vulkan::Vulkan imported target manually if needed.
2026-02-23 18:47:42 -08:00
Kelsi
22fa771d00 Fix CI failures: add vk-bootstrap submodule and fix MSYS2 stormlib
- Add vk-bootstrap as a git submodule (was in extern/ but not tracked,
  causing "vk-bootstrap not found" on all CI jobs)
- Whitelist extern/vk-bootstrap in .gitignore
- Move stormlib to a separate optional install step on both Windows CI
  jobs (mingw-w64-x86_64-stormlib doesn't exist in MSYS2 repos)
2026-02-23 18:45:39 -08:00
Kelsi
ebab8f3ccc Add missing Vulkan and shaderc packages to Linux CI and docs
Linux CI was missing libvulkan-dev, vulkan-tools, and glslc, causing
find_package(Vulkan REQUIRED) to fail. Also update BUILD_INSTRUCTIONS
Ubuntu and Arch sections to include Vulkan/shaderc packages.
2026-02-23 18:42:00 -08:00
Kelsi
685736fa16 Fix macOS asset extraction auto-build and docs
- extract_assets.sh: detect Homebrew and pass CMAKE_PREFIX_PATH,
  OPENSSL_ROOT_DIR, and PKG_CONFIG_PATH when auto-building on macOS
  (bare cmake couldn't find Homebrew deps)
- README.md: fix macOS brew command that had comments after line
  continuations (breaks shell execution)
- BUILD_INSTRUCTIONS.md: expand macOS asset extraction section with
  auto-build note and expansion targets
2026-02-23 18:40:26 -08:00
Kelsi
f66b9eb154 Fix macOS build process and make shell scripts cross-platform
- Add vulkan-loader, vulkan-headers, shaderc to macOS CI brew install
- Add vulkan-loader and shaderc to macOS PKG_CONFIG_PATH
- Replace Linux-only `nproc` with portable fallback in build.sh,
  rebuild.sh, extract_assets.sh, and tools/backup_assets.sh
- Replace `ldconfig` StormLib check with portable detection
  (ldconfig, pkg-config, brew lib) in extract_assets.sh
- Update BUILD_INSTRUCTIONS.md macOS section with vulkan/shaderc
  packages and MoltenVK explanation
- Add macOS prerequisites to README.md
2026-02-23 18:35:53 -08:00
Kelsi
eb549a9b7a Fix Windows build process and add Windows asset extraction scripts
- Add missing MSYS2 packages to CI: vulkan-loader, vulkan-headers,
  shaderc, stormlib (both x86-64 and arm64), unicorn (arm64)
- Make vulkan-1.dll copy conditional via find_file (fixes MSYS2 builds)
- Use find_library for wininet/bz2 in asset_extract (graceful fallback)
- Add extract_assets.ps1 and extract_assets.bat for Windows users
- Expand BUILD_INSTRUCTIONS.md with MSYS2, vcpkg, and macOS sections
- Update README.md to reference Windows scripts and platforms
2026-02-23 18:32:47 -08:00
Kelsi
06979e5c5c Prevent player snapping to WMO roofs when jumping inside buildings
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Anchor WMO floor probe to last ground Z when airborne so the detection
ceiling doesn't rise with the jump and catch roof/ceiling geometry.
2026-02-23 11:03:18 -08:00
Kelsi
bf997e1900 Distance-cull terrain derivative normal mapping
Fade bump strength from full at 50 units to zero at 125 units to
avoid noisy/harsh appearance on distant terrain.
2026-02-23 10:54:56 -08:00
Kelsi
9a1b78bffd Fix character preview facing and add 4x MSAA to preview render target
Character was facing stage-left (yaw 180) instead of toward camera;
corrected default yaw to 90. Added MSAA support to VkRenderTarget with
automatic resolve attachment, and enabled 4x MSAA for the character
preview off-screen pass.
2026-02-23 10:48:26 -08:00
Kelsi
d65b170774 Make shadows follow player movement continuously
Remove freeze-while-moving and idle smoothing logic from shadow
center computation. Texel snapping already prevents shimmer, so
the shadow projection can track the player directly each frame.
2026-02-23 08:47:38 -08:00