12 Commits
Author SHA1 Message Date
shenandshen b3808d8d0c Align AVA2 Windows behavior and improve mobile touch interactions 2026-10-13 23:46:26 -07:00
shenleiandClaude Opus 5.5 47e867252f Terrain: stream the 3x3 blocks around the player
CMapOutdoor keeps the 3x3 terrain blocks around the player loaded and
reloads them on a block change; we loaded only the warp block, so the
map ended at its edge. Stitch the set into one TerrainHeightmap, fix the
attr.atr cell mapping, and reload terrain, areadata and water per block
from CPythonBackground::Update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:38:11 +09:00
shenleiandClaude Opus 5.5 15b2397b54 Build against the real SpeedTree SDK; keep assert-based tests in release
SDK 62a5f5a carries the SpeedTree runtime, so the local mirror/shim is no
longer needed. attack_combo and ava2_render_3d tests called the code under
test inside assert() and segfaulted under NDEBUG; undefine it like
hardware_scene_test. android/build.sh prefers the SDK adb. Desktop ctest
59/59 incl. speedtree_forest; device 60 fps with real trees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 11:03:57 +09:00
shenleiandClaude Opus 5.5 c556795ecf Keep SetWeapon/AttachPart helper attachments across rebinds
Helper attachments made outside the part slots were attached to
PART_MAIN only and dropped whenever the parts were rebound (LOD level
change, shape change, slot update). They are now recorded on the actor,
attached to the drawn instance and re-attached after the slots. A slot
taking the same bone drops the helper (last writer wins, as before);
SetRace/SetModel clear them. LODs missing a helper's bone stay on
PART_MAIN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 18:18:14 +09:00
shenleiandClaude Opus 5.5 bfd42bd776 Swap actor body to _lod_ meshes by camera distance
Port CGrannyLODController level selection: _lod_01.._03 are queued
{lod_03, lod_02, lod_01, main}, loaded lazily, and chosen from the
camera-target/camera distance bands (actors) or the building factor.
Parts, skins and the current motion follow the drawn instance.

Shipped LODs that drop an attaching bone in use (lion2_lod_02/03 lose
"saddle", shaman_miyeom_lod_* lose equip_left/right) stay on PART_MAIN,
and bone queries fall back to PART_MAIN for bones a LOD lacks.
Weapon item LODs are not ported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:56:41 +09:00
shenleiandClaude Opus 5.5 b2c7c6ce7d Animate distant LOD actors at the original reduced animation FPS
Port CGrannyLODController::UpdateLODLevel and
CGrannyModelInstance::Update(dwAniFPS): actors whose model has a
_lod_01.gr2 sibling and stand more than 500 units from the camera
target get 30-120 animation FPS by camera distance (LODDISTANCE_ACTOR
5000, LODDISTANCE_BUILDING 25000 for models of 500+ units), and their
pose time only advances every 120/fps frames, so the SDK's cached pose
is reused in between. Restarted or switched motions re-sample at once.
The _lod_ meshes themselves are still not swapped in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:36:41 +09:00
shenleiandClaude Opus 5.5 545cbb1e5d render: resolve GPU textures once per draw and sort by handle
RenderSceneGPU resolves each draw's texture while classifying it and
sorts opaque draws by the texture handle instead of comparing paths;
invalid draws are dropped before sorting. Bumps sdk (skin cache).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:30:32 +09:00
shenleiandClaude Opus 5.5 f03f63e700 render: draw tri-groups as index sub-ranges of one resident mesh
Render3DDraw/HardwareBatch carry first_index/index_count; resident
meshes are uploaded once per model and groups draw with firstIndex.
Bumps sdk to 9ec7fa1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:27:05 +09:00
shenleiandClaude Opus 5.5 837ccc2f31 Share GPU skinning palette per instance; push it once per change
Render3DDraw/HardwareBatch hold the SDK's shared palette instead of
copying 16 floats per bone per draw, and HardwareScene re-pushes the
uniform only when the palette pointer changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:12:14 +09:00
shenandshen 281418f351 Fix cross-platform rendering and optimize frame performance
Correct selection orientation, game-entry lifecycle, mounted NPCs, labels and skill panels. Add the native GPU scene path, resident geometry, bounded texture and Python caches, and collision broad phase.

Pin the independently maintained Metin2 SDK through a submodule and document reproducible setup. Include rendering regressions and macOS packaging improvements.

Validation: client Debug build and 12 targeted client tests passed; SDK build and all 14 SDK tests passed.
2026-10-11 17:55:53 -07:00
shenleiandClaude Opus 5.5 9077aa389a AVA2 client Windows parity passes (gr2 BitKnit2/64-bit, GamePhase handlers, python modules)
- gr2: BitKnit2 decompression, 64-bit LE files, compressed curves
- net: remaining GamePhase handlers, generated GC packet table
- python: event/chat/chr/minimap/guild/quest/messenger/shop-search and
  other native modules ported against the AVA2 Windows client
- render: D3D8 fixed-function lighting in Gr2ModelRenderer, terrain
  without baked shade; cape/NPC equipment attachment
- tests + audits updated; docs/PORT-PLAN.md and WINDOWS-PARITY.md

Batch 4 (render pipeline: background.*, app.RenderGame/UpdateGame,
camera bindings, main.cpp fake-content removal) is still in progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:43:01 +09:00
shen 9f748eb05a AVA2 cross-platform client parity baseline 2026-10-06 00:53:42 -07:00