[Parity][motion-input][S1][H] 远程单位(怪物、NPC、佣兵、其他玩家)的移动速度一律用玩家的基础走/跑常量 9 / 13.5 #586

Closed
opened 2026-10-02 11:42:42 +00:00 by troytt · 0 comments
Owner

1.13c 客户端保真度审计立项(基准快照:7bd1090 / main @ 77a20c7)

证据标记说明:V-data = 1.13c MPQ 数据表 (.txt / animdata.d2 / .tbl / pal.pl2);V-src = D2MOO 逆向源码;V-bin = 1.13c DLL 反汇编;K = 1.13c 公认行为。

来源审计项:motion-input#6 — [S1][H] 6. 远程单位(怪物、NPC、佣兵、其他玩家)的移动速度一律用玩家的基础走/跑常量 9 / 13.5

  • 位置:src/client/motion/interpolate.ts:77-102(resolveRemoteMoveSpeed 回退到 D2_BASE_*)、:133(spawnOrSnap 写死步行速度);session/online-session.ts:1406-1414(调用 startMove 时不传 speedSubTilesPerSec 和 moveType)。范围外的根因:netproto/d2gs/s2c/movement.ts:124-159(0x67 只读了 id/moveType/x/y;0x68 只读到 targetId 为止)
  • 代码:speedSubTilesPerSec: running ? D2_BASE_RUN_SUBTILES_PER_SEC : D2_BASE_WALK_SUBTILES_PER_SEC
  • 原版:
    • 基础速度来自 UNITS_GetBaseVelocity:玩家 = charstats WalkVelocity << 8,怪物 = monstats Velocity << 8(V-src D2Common Units.cpp:1288-1299),再乘以 nVelocityPercent / 100(Units.cpp:1672-1693)。
    • 服务器在 0x67(偏移 0x0C 为 nPathType,0x0D 为 int16 nVelocity,0x0F 为 maxDistance)和 0x68(0x11 为 nPathType,0x12 为 nVelocity)里下发怪物当前的 STAT_VELOCITYPERCENT(V-src D2CommonDefinitions/include/D2PacketDef.h:1457-1485;D2Game SCmd.cpp:329-374、377-417)。
    • monstats 里各怪物速度差别很大(V-data monstats.txt,Velocity/Run):zombie1 #5 为 1/3,akara #148 为 1/1,cain1 #146 为 2/2,quillrat1 #63 为 3/3,fallen1 #19 为 5/5,act2guard1 #203 为 4/7,roguehire #271 为 7/11,navi #266 为 8/8。
  • 影响:所有怪物和 NPC 都按玩家速度移动。Akara、僵尸这类慢速单位会以数倍速度滑到目标点再停住;冰冻减速、狂热光环、怪物跑步都体现不出来。和服务器的位置偏差累积后会触发硬吸附(interpolate.ts:24 的 5 子格)。每个场景都能看到。另外,interpolate.ts:77-82 的注释说"bit 0x10 表示跑",代码判断的却是 0x17 / 0x18 / &0x02,注释和实现不一致。
  • 建议:netproto 解出 0x67/0x68 的 nPathType、nVelocity、maxDistance。插值器按单位的 monstats Velocity / Run(玩家用 charstats)乘以 nVelocity / 100 计算速度,并保留 25% 下限。spawnOrSnap 不要预置速度。
  • 已有 issue:—(#543 只涉及转向)
> **1.13c 客户端保真度审计立项**(基准快照:`7bd1090` / `main @ 77a20c7`) > 证据标记说明:`V-data` = 1.13c MPQ 数据表 (`.txt` / `animdata.d2` / `.tbl` / `pal.pl2`);`V-src` = D2MOO 逆向源码;`V-bin` = 1.13c DLL 反汇编;`K` = 1.13c 公认行为。 ### 来源审计项:`motion-input#6` — [S1][H] 6. 远程单位(怪物、NPC、佣兵、其他玩家)的移动速度一律用玩家的基础走/跑常量 9 / 13.5 - 位置:`src/client/motion/interpolate.ts:77-102`(`resolveRemoteMoveSpeed` 回退到 `D2_BASE_*`)、`:133`(`spawnOrSnap` 写死步行速度);`session/online-session.ts:1406-1414`(调用 `startMove` 时不传 `speedSubTilesPerSec` 和 `moveType`)。范围外的根因:`netproto/d2gs/s2c/movement.ts:124-159`(0x67 只读了 id/moveType/x/y;0x68 只读到 targetId 为止) - 代码:`speedSubTilesPerSec: running ? D2_BASE_RUN_SUBTILES_PER_SEC : D2_BASE_WALK_SUBTILES_PER_SEC` - 原版: - 基础速度来自 `UNITS_GetBaseVelocity`:玩家 = charstats `WalkVelocity << 8`,怪物 = monstats `Velocity << 8`(V-src D2Common `Units.cpp:1288-1299`),再乘以 `nVelocityPercent / 100`(`Units.cpp:1672-1693`)。 - 服务器在 0x67(偏移 0x0C 为 `nPathType`,0x0D 为 int16 `nVelocity`,0x0F 为 maxDistance)和 0x68(0x11 为 `nPathType`,0x12 为 `nVelocity`)里下发怪物当前的 `STAT_VELOCITYPERCENT`(V-src `D2CommonDefinitions/include/D2PacketDef.h:1457-1485`;D2Game `SCmd.cpp:329-374`、`377-417`)。 - monstats 里各怪物速度差别很大(V-data `monstats.txt`,Velocity/Run):zombie1 #5 为 1/3,akara #148 为 1/1,cain1 #146 为 2/2,quillrat1 #63 为 3/3,fallen1 #19 为 5/5,act2guard1 #203 为 4/7,roguehire #271 为 7/11,navi #266 为 8/8。 - 影响:所有怪物和 NPC 都按玩家速度移动。Akara、僵尸这类慢速单位会以数倍速度滑到目标点再停住;冰冻减速、狂热光环、怪物跑步都体现不出来。和服务器的位置偏差累积后会触发硬吸附(`interpolate.ts:24` 的 5 子格)。每个场景都能看到。另外,`interpolate.ts:77-82` 的注释说"bit 0x10 表示跑",代码判断的却是 0x17 / 0x18 / `&0x02`,注释和实现不一致。 - 建议:netproto 解出 0x67/0x68 的 `nPathType`、`nVelocity`、maxDistance。插值器按单位的 monstats `Velocity` / `Run`(玩家用 charstats)乘以 `nVelocity / 100` 计算速度,并保留 25% 下限。`spawnOrSnap` 不要预置速度。 - 已有 issue:—(#543 只涉及转向)
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: troytt/diablo2-web#586
No description provided.