[DRLG] 第二幕户外关卡改用 D2MOO 1:1 移植(关卡 41–46) #496

Open
opened 2026-09-27 15:29:39 +00:00 by troytt · 0 comments
Owner

背景

#455 的第一幕部分已完成(b6fc251):第一幕 8 个户外关卡(2–7、17、39)改由 D2MOO(D2Common 1.13c)逐函数 1:1 移植的 TypeScript 代码生成,并用原生 D2MOO oracle(tools/d2moo-oracle)逐阶段比对:scripts/drlg-diff.ts --levels 2-7,17,39 --seeds 32 在 act → levelGrid → rooms → maps → activation → mapTiles 全部阶段 0 差异。本 issue 用同样的方法处理第二幕。

范围(Levels.txt DrlgType = 3,第二幕)

41 Rocky Waste、42 Dry Hills、43 Far Oasis、44 Lost City、45 Valley of Snakes、46 Canyon of the Magi。

需要移植的 D2MOO 函数

  • DrlgOutDesr.cpp:DRLGOUTDESR_InitAct2OutdoorLevel、DRLGOUTDESR_PlaceDesertTransitionToTown
  • DrlgOutPlace.cpp:DRLGOUTPLACE_CreateLevelConnections 的第二幕分支、DRLGOUTPLACE_LinkAct2Outdoors、DRLGOUTPLACE_LinkAct2Canyon
  • DrlgOutdoors.cpp:DRLGOUTDOORS_GenerateLevel 的第二幕分派。DRLGOUTDOORS_SpawnAct12Waypoint / SpawnAct12Shrines 第一幕已移植,两幕共用。

目前 src/game/drlg/ 中这些分支按规则直接 throw(未移植),第二幕仍走旧的近似生成器。

同时删除(不留 fallback)

  • wilderness.ts 旧生成器中第二幕的路径。
  • world-graph.ts 中第二幕臆造的门朝向(assignGateSides)和缝合边:真实的连接由 DRLGOUTPLACE_CreateLevelConnections 给出,和第一幕一样由烘焙写入 actLayouts。

验收

  1. oracle 扩展到第二幕;npx tsx scripts/drlg-diff.ts --levels 41-46 --seeds 32 全阶段 0 差异(含 activation / mapTiles),另跑 --isolated。
  2. 重新烘焙;scripts/render-drlg-compare.ts 对比图 XOR 为空,缺失瓦片 0。
  3. 136 关无头浏览器审计(scripts/audit-levels-browser.ts)通过;verify:world-graph、verify:world-walk 通过。
## 背景 #455 的第一幕部分已完成(b6fc251):第一幕 8 个户外关卡(2–7、17、39)改由 D2MOO(D2Common 1.13c)逐函数 1:1 移植的 TypeScript 代码生成,并用原生 D2MOO oracle(`tools/d2moo-oracle`)逐阶段比对:`scripts/drlg-diff.ts --levels 2-7,17,39 --seeds 32` 在 act → levelGrid → rooms → maps → activation → mapTiles 全部阶段 0 差异。本 issue 用同样的方法处理第二幕。 ## 范围(Levels.txt `DrlgType = 3`,第二幕) 41 Rocky Waste、42 Dry Hills、43 Far Oasis、44 Lost City、45 Valley of Snakes、46 Canyon of the Magi。 ## 需要移植的 D2MOO 函数 - `DrlgOutDesr.cpp`:`DRLGOUTDESR_InitAct2OutdoorLevel`、`DRLGOUTDESR_PlaceDesertTransitionToTown` - `DrlgOutPlace.cpp`:`DRLGOUTPLACE_CreateLevelConnections` 的第二幕分支、`DRLGOUTPLACE_LinkAct2Outdoors`、`DRLGOUTPLACE_LinkAct2Canyon` - `DrlgOutdoors.cpp`:`DRLGOUTDOORS_GenerateLevel` 的第二幕分派。`DRLGOUTDOORS_SpawnAct12Waypoint` / `SpawnAct12Shrines` 第一幕已移植,两幕共用。 目前 `src/game/drlg/` 中这些分支按规则直接 throw(未移植),第二幕仍走旧的近似生成器。 ## 同时删除(不留 fallback) - `wilderness.ts` 旧生成器中第二幕的路径。 - `world-graph.ts` 中第二幕臆造的门朝向(`assignGateSides`)和缝合边:真实的连接由 `DRLGOUTPLACE_CreateLevelConnections` 给出,和第一幕一样由烘焙写入 `actLayouts`。 ## 验收 1. oracle 扩展到第二幕;`npx tsx scripts/drlg-diff.ts --levels 41-46 --seeds 32` 全阶段 0 差异(含 activation / mapTiles),另跑 `--isolated`。 2. 重新烘焙;`scripts/render-drlg-compare.ts` 对比图 XOR 为空,缺失瓦片 0。 3. 136 关无头浏览器审计(`scripts/audit-levels-browser.ts`)通过;`verify:world-graph`、`verify:world-walk` 通过。
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#496
No description provided.