[M20-P3] 客户端世界(Act I)、运行时按种子生成 DRLG、WorldView 解耦与移动预测(档 A 里程碑) #511
Labels
No Label
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: troytt/diablo2-web#511
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景与目标
解耦渲染/UI 与单机
GameEngine,实现客户端权威镜像ClientWorld;在收到0x03 D2GS_LOADACT时按服务端下发的地图种子实时生成与服务端逐位一致的 Act I 地图,完成单位表、本地移动预测、他人/NPC 同步与聊天,达成档 A(技术验证)。核心内容与 1.13c Ground Truth 对标
WorldView只读接口与act-scene.ts解耦:src/scene/act-scene.ts抽出渲染与 HUD 所需的只读视图接口WorldView(地图瓦片与碰撞、玩家与远端单位姿态、地面物品、自动地图揭示状态)。GameEngine与联机ClientWorld各自实现WorldView,确保单机 136 关卡回归测试零破坏。0x03 D2GS_LOADACT (act, mapId, areaId)与0x01难度后,在 Web Worker 中调用DRLG_AllocDrlg按服务端mapId实时生成 Act I 关卡与房间。DRLGROOMTILE_GetTileCache:按房间种子pDrlgRoom.pSeed+D2CMP_10081_GetTileRarity抽取),不再二次调用 SplitMix64pickVariant。0x07 D2GS_MAPREVEAL/0x08 D2GS_MAPHIDE激活与卸载房间,使用运行时按需打包的 DT1 贴图页渲染。(type, guid):0x59 / 0x5B / 0x5C(玩家分配与入局离局)、0xAC(怪物与城镇 NPC 分配)、0x51(场景物件)、0x09(关卡 Warp)、0x0A(移除单位)。src/game/char-appearance.ts合成自己与其他玩家的 16 部位 COF 装备外观。0x01 Walk/0x03 Run(或朝单位0x02/0x04),客户端使用 D2Common 寻路同步预测位置;收到0x15 D2GS_REASSIGNPLAYER时按服务端坐标纠偏。0x0F / 0x10(玩家)与0x67 / 0x68 / 0x69 / 0x6D(怪物/NPC),结合animdata.json驱动 8/16 方向行走/跑动/待机动画。0x15、下行0x26)。验收标准(档 A 里程碑)
0x07 D2GS_MAPREVEAL房间坐标 100% 命中本地 DRLG 生成的对应房间,无一例错位。Game.exe)进入同一局罗格营地与鲜血荒地,互相看到对方实时走动、朝向、装备外观与聊天消息。npm run typecheck、vitest与 136 关卡审计全部零回归通过。