Fix tree rendering and authored collision, add FPS display and packaging safeguards

This commit is contained in:
shen
2026-10-14 19:16:39 -07:00
parent b3808d8d0c
commit 3166b61321
35 changed files with 31336 additions and 49 deletions
+34
View File
@@ -1931,3 +1931,37 @@ UpdateGame 更新阶段建立缓存,渲染阶段尾迹读取该快照。相机
参考 d2r-mobile 的交互思路,移除闲置固定摇杆,真实落点与绘制中心分离,补齐技能独立多指归属、拖动方向提示、按住遵守冷却重试、最近敌人选择、完整快捷按钮热区及物品拖拽抬高。增加 NPC/入口和掉落物热区、接近交互、失焦取消与实例/物品 generation 防复用。保留原版双击/长按物品面板及报文,新增真实 HUD、库存和目标/技能/NPC 字节测试。详见 [移动交互调整](MOBILE-INTERACTION-2026-10-13.md)。真机多指、精确模型点击体、完整寻路和技能范围预览仍待验证/实现。
本批最终验证:完整构建成功,62/62 CTest(63.67 秒),移动专项 4/4,严格 ASan/UBSan 4/4(19.86 秒),无执行路径诊断。Python C 代码未全部同等插桩。方法/协议审计及 git diff --check 通过。SDK/参考/服务器未修改,尚未提交或推送。
### 2026-10-14 树木:包围裁剪、透明测试、静态网格与资源碰撞
改为实际 min/max 包围及整树冠距离裁剪;默认树干/frond 使用共享静态流和实例 world 矩阵,材质路径模板缓存,叶片仍按相机/摇摆更新。接通原版森林/实例/环境风强生命周期并移除 ×0.05;修复树干 alpha=84 GREATER、软件 alpha reference 0/调制时序/浮点边界。接通 authored 球/圆柱到角色 BODY 与飞行物查询,保留忽略 box 和平移规则,防高速完整跨越;生命周期删除和真实 SPT 加载失败不产生假树。485 个当前真实 SPT 两次全 LOD 快照一致且无截断。详见 [树木修复记录](TREE-RENDERING-2026-10-14.md)。原 DLL 数值、GPU 叶片/风 shader、真机性能和完整球体响应仍待对齐。
验证:62/62 完整 CTest(48.61 秒)、专项 6/6、严格 ASan/UBSan 5/5(4.07 秒)通过,包含实际 GPU 回读;方法/协议与 diff 检查通过。资源审计额外确认 280 个文件在 token 22000 处停止扩展解析,不能将无截断视为元数据完整;客户端已记录诊断,未知扩展继续保留为明确待办。SDK/参考/服务器未修改,尚未提交/推送。
### 2026-10-14 — Game FPS display and movement altitude check
Added an always-visible, non-interactive FPS badge at the safe top centre of the game screen. It counts completed SDL presentations over half-second windows (including pacing/render cost), resets on phase transitions and foreground resume, and remains hidden outside the game. It does not use the existing app.GetRenderFPS stub, which currently returns the requested rate.
Corrected MapObjectManager movement collision to test actor BODY sphere altitude against the 3D mesh OBB instead of an infinitely tall 2D footprint. Added real-model regression checks for solid obstruction, passage above/below geometry and ActorInstance walking above an object. Added rate-limited device logs for attempted movement that produces no displacement, including map, position, next position and terrain block flag.
Verified: desktop and Android builds; 4/4 focused CTests (player_motion, touch_game, flying_target, speedtree_forest); capped desktop 10 FPS measured 10.0 and displayed 10; desktop 30 FPS cap under scene load measured 16.4 and displayed 17; physical PJZ110 Android preview displayed 10 at a 10 FPS cap. Updated APK installed with existing data retained, then restored normal login launch. Evidence: build/verification/fps-movement-2026-10-14/.
Remaining: the user's specific blocked region still needs a live retest after login; this change alone does not prove its cause. Static objects still use mesh OBB proxies rather than original authored .mdatr primitives, which can incorrectly cover openings. The original Python FPS getters and app.SetFPS host integration remain separate parity gaps.
### 2026-10-14 — Reported town gate falsely sealed by mesh OBB
Live device logs pinpointed the continuing movement obstruction to metin2_map_a1 near (66041.5, 71337.5), with terrainBlock=0. The corresponding a1-middledam-01.gr2 instance at (66907.429688, 19664.039063, 72199.484375), yaw 30 degrees, has six authored planes in its companion .mdatr. The former whole-mesh OBB incorrectly seals its doorway.
MapObjectManager now reads validated little-endian AttributeData plane sets, transforms quaternion axes and centres with the same (x,z,-y) basis and object transform as the rendered model, and uses source plane crossing/radius/rectangle tests for movement and flying collision. Movement permits escape from a plane overlap. Broad-phase candidates include authored plane extents. Valid empty attributes suppress dummy collision; missing, truncated or mixed/non-plane files retain the existing OBB fallback.
Verified with the reported real gate and coordinates: the old 2D footprint intersects the doorway; the authored-plane movement test clears it; ActorInstance moves 2000 units through the entire opening; all six wall planes still block approaching spheres and allow escape. Empty/truncated attribute and above/below-OBB regressions pass. Desktop/Android builds and 4/4 focused CTests passed. APK: build/verification/fps-movement-2026-10-14/ava2-gate-fix.apk.
Deployment pending: USB disconnected before this gate-fix APK could install. The phone currently has the earlier FPS/3D-altitude fix. Reconnect and install gate-fix APK, then verify the reported passage on the live device. Remaining parity gaps: authored non-plane .mdatr primitives and height meshes, mesh-proxy camera/2D collision queries, original Python FPS getter values.
### 2026-10-14 — Mac test package and gate-fix device installation
After USB reconnection, installed the gate-fix Android APK successfully with adb install --user 0 -r (application data retained). Live passage/movement retest remains separate; the user reports additional running issues and requested a Mac package first.
Built the current workspace as macOS arm64 RelWithDebInfo and packaged full game resources into dist/AVA2.app, with dist/AVA2-macOS-arm64.tar.gz for transfer. Bundled/relocated all non-system dylibs and applied ad-hoc signatures for local testing. Verified strict deep codesign, all 88,052 asset-manifest hashes, internal bundle links, and inclusion of the reported gate .mdatr. Isolated-data packaged executable checks exited successfully in normal login (45 frames) and game preview (35 frames); opened the normal application for manual login and gameplay testing. Evidence: build/verification/macos-package-2026-10-14/.
Packager now excludes saved-account lib/wa_ac.py and optional no.py auto-login overrides from both manifest and adapted-script layers, preventing host user state from entering the test package; packaging regression passed. This is a local Apple Silicon test build, not a notarized release. Live running/animation correctness is still under investigation.