[Parity][map][S1][F] 运行时自动地图不读 automap.txt:每帧用通行网格合成"地板 cel 0 + 墙 cel 9"的假图层(三座预置城镇的自动地图同样缺失) #622

Closed
opened 2026-10-02 11:42:48 +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 公认行为。

来源审计项:map#1 — [S1][F] 运行时自动地图不读 automap.txt:每帧用通行网格合成"地板 cel 0 + 墙 cel 9"的假图层(三座预置城镇的自动地图同样缺失)

位置:

  • src/client/map/map-worker.ts:250-253(MapWorkerEngine.getLevelView):调用 buildLevelViewFromSession(this.session, areaId, this.ctx, { tileAtlas, revealMode }),没有传 automapOptions。
  • src/common/world/d2map.ts:1178-1179:只有传了 automapOptions 时才生成 scene.automap。
  • src/client/map/level-view.ts:488:scene.automap 为空,所以 LevelView.automap 也为空。
  • src/client/automap/automap-view.ts:611:...(view.automap !== undefined ? { automap: view.automap } : {})。
  • src/client/scene/world-renderer.ts:1153-1158:这里也不补 automap。
  • src/client/ui/minimap.ts:892:const automapLayer = level.automap ?? this.getOrSynthesizeAutomapLayer(level)。
  • src/client/ui/minimap.ts:1384-1446(getOrSynthesizeAutomapLayer),合成规则:
    • 1398:阻挡格 → cellNo: 9。
    • 1408:可走格 → cellNo: 0。
    • 1426:标记 'waypoint' → cellNo: 309。
    • 1436:其他标记 → cellNo: 306。
    • 1442:levelTypeId: 1,fSaved: 0。
    • 1460-1466(cellBlocked):只按格子中心子格 cx*5+2 采样。

代码:

const automapLayer = level.automap ?? this.getOrSynthesizeAutomapLayer(level)   // minimap.ts:892
if (this.cellBlocked(level, x, y)) { walls.push({ cellNo: 9, ... }) } else { floors.push({ cellNo: 0, ... }) }

原版: 自动地图 cel 由 automap.txt 按 LevelName / TileName / Style / StartSequence..EndSequence 查表得到。每种墙片、门、楼梯、小站都有专用 cel。

  • 城镇小站:V-data automap.txt #78 1 Town / fl / 0 / 54..54 / Waypoint / Cel1=307。
  • 野外墙按朝向取不同 cel:V-data automap.txt #83-#90 1 Wilderness,wr/wl/wtll 对应 Cel1 = 11 / 18 / 10 / 20 / 21 / 35 / 21 / 24。
  • 合成用的 cel 9:在 automap.txt 的 Cel1 列中只被 #2565 使用,即 4 Lava / fl / style 31 / seq 20-23 / Type1=WL_BttmEdge,是 Act4 熔岩的一种边缘图块,不是通用"墙"。V-data。
  • 合成用的 309 和 306:Cel1 列中没有任何行使用。
    • 309 是 objects.txt 中水井的 AutoMap 值,如 well #111/#113/#115……。
    • 306 是 Seal #392-#396 的 AutoMap 值。
    • V-data。
  • 预置城镇:V-src DrlgPreset.cpp:1794-1799。Lut Gholein / Pandemonium Fortress / Harrogath 走 pfTownAutomap(nLevelId, nPickedFile, …) 预置城镇自动地图;其余预置关卡(dwAutoMap≠0)在 1803-1822 对所有房间调用 pfAutomap。
  • 仓库里已有完整实现 buildLevelAutomap(src/common/world/d2map.ts:639),但只在离线 baker 中被调用(src/baker/packers/pack-act-assets.ts:1183-1196,传 automapTable / levelTypeId / layerId / objectsTable …,缺表直接抛错)。客户端运行时从未使用。

影响(正常游玩可见):

  • 所有关卡的自动地图都是"每个可走格画 MaxiMap cel 0,每个阻挡格画 Act4 熔岩边缘 cel 9"拼出来的块状轮廓。
  • 没有朝向墙、门、楼梯、桥、洞口等任何专用图块。
  • 关卡外的 void(阻挡=1)也被画成"墙"。
  • Act2/4/5 的图集选择不再生效:合成 cel 的 fSaved=0,一律用 MaxiMap/MaxiMapS(minimap.ts:978)。
  • 三座预置城镇的手绘自动地图完全缺失。
  • 注释写着"standalone unit tests 用"的合成路径,实际是线上唯一路径。

建议:

  • MapWorkerEngine.getLevelView 构建时传 automapOptions:automap.txt、levels.txt 的 LevelType / Layer、objects.txt,以及预置城镇的 pfTownAutomap 数据。
  • 把 LevelView.automap / MinimapLevel.automap 改成必填字段。
  • 缺失时抛错或 reportMissingArt,删除 getOrSynthesizeAutomapLayer。

已有 issue: —(#549 只修了"随区域切换",不涉及图层来源)

> **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 公认行为。 ### 来源审计项:`map#1` — [S1][F] 运行时自动地图不读 automap.txt:每帧用通行网格合成"地板 cel 0 + 墙 cel 9"的假图层(三座预置城镇的自动地图同样缺失) **位置:** - `src/client/map/map-worker.ts:250-253`(`MapWorkerEngine.getLevelView`):调用 `buildLevelViewFromSession(this.session, areaId, this.ctx, { tileAtlas, revealMode })`,**没有传 `automapOptions`**。 - `src/common/world/d2map.ts:1178-1179`:只有传了 `automapOptions` 时才生成 `scene.automap`。 - `src/client/map/level-view.ts:488`:`scene.automap` 为空,所以 `LevelView.automap` 也为空。 - `src/client/automap/automap-view.ts:611`:`...(view.automap !== undefined ? { automap: view.automap } : {})`。 - `src/client/scene/world-renderer.ts:1153-1158`:这里也不补 `automap`。 - `src/client/ui/minimap.ts:892`:`const automapLayer = level.automap ?? this.getOrSynthesizeAutomapLayer(level)`。 - `src/client/ui/minimap.ts:1384-1446`(`getOrSynthesizeAutomapLayer`),合成规则: - 1398:阻挡格 → `cellNo: 9`。 - 1408:可走格 → `cellNo: 0`。 - 1426:标记 'waypoint' → `cellNo: 309`。 - 1436:其他标记 → `cellNo: 306`。 - 1442:`levelTypeId: 1`,`fSaved: 0`。 - 1460-1466(`cellBlocked`):只按格子中心子格 `cx*5+2` 采样。 **代码:** ```ts const automapLayer = level.automap ?? this.getOrSynthesizeAutomapLayer(level) // minimap.ts:892 if (this.cellBlocked(level, x, y)) { walls.push({ cellNo: 9, ... }) } else { floors.push({ cellNo: 0, ... }) } ``` **原版:** 自动地图 cel 由 automap.txt 按 `LevelName / TileName / Style / StartSequence..EndSequence` 查表得到。每种墙片、门、楼梯、小站都有专用 cel。 - 城镇小站:V-data `automap.txt` #78 `1 Town / fl / 0 / 54..54 / Waypoint / Cel1=307`。 - 野外墙按朝向取不同 cel:V-data `automap.txt` #83-#90 `1 Wilderness`,wr/wl/wtll 对应 Cel1 = 11 / 18 / 10 / 20 / 21 / 35 / 21 / 24。 - 合成用的 cel 9:在 automap.txt 的 Cel1 列中只被 #2565 使用,即 `4 Lava / fl / style 31 / seq 20-23 / Type1=WL_BttmEdge`,是 Act4 熔岩的一种边缘图块,不是通用"墙"。V-data。 - 合成用的 309 和 306:Cel1 列中没有任何行使用。 - 309 是 objects.txt 中水井的 AutoMap 值,如 `well` #111/#113/#115……。 - 306 是 `Seal` #392-#396 的 AutoMap 值。 - V-data。 - 预置城镇:V-src `DrlgPreset.cpp:1794-1799`。Lut Gholein / Pandemonium Fortress / Harrogath 走 `pfTownAutomap(nLevelId, nPickedFile, …)` 预置城镇自动地图;其余预置关卡(`dwAutoMap`≠0)在 1803-1822 对所有房间调用 `pfAutomap`。 - 仓库里已有完整实现 `buildLevelAutomap`(`src/common/world/d2map.ts:639`),但只在离线 baker 中被调用(`src/baker/packers/pack-act-assets.ts:1183-1196`,传 `automapTable / levelTypeId / layerId / objectsTable …`,缺表直接抛错)。客户端运行时从未使用。 **影响(正常游玩可见):** - 所有关卡的自动地图都是"每个可走格画 MaxiMap cel 0,每个阻挡格画 Act4 熔岩边缘 cel 9"拼出来的块状轮廓。 - 没有朝向墙、门、楼梯、桥、洞口等任何专用图块。 - 关卡外的 void(阻挡=1)也被画成"墙"。 - Act2/4/5 的图集选择不再生效:合成 cel 的 `fSaved=0`,一律用 MaxiMap/MaxiMapS(`minimap.ts:978`)。 - 三座预置城镇的手绘自动地图完全缺失。 - 注释写着"standalone unit tests 用"的合成路径,实际是线上唯一路径。 **建议:** - `MapWorkerEngine.getLevelView` 构建时传 `automapOptions`:automap.txt、levels.txt 的 `LevelType` / `Layer`、objects.txt,以及预置城镇的 `pfTownAutomap` 数据。 - 把 `LevelView.automap` / `MinimapLevel.automap` 改成必填字段。 - 缺失时抛错或 `reportMissingArt`,删除 `getOrSynthesizeAutomapLayer`。 **已有 issue:** —(#549 只修了"随区域切换",不涉及图层来源)
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#622
No description provided.