[DRLG-M1] 核心迷宫专用布局例程与基于 LvlPrest ID 的精准预设替换 #73
Labels
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: troytt/diablo2-web#73
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?
目标与背景
以暴雪原版 1.13c
D2Common.dll(Ordinal 10006DRLG_InitLevel, Ordinal 10008DRLGPRESET_GetLevelPrestIdFromRoomEx, RVA0x52660) 及DRLGMAZE_GenerateLevel为黄金标准,彻底重构现行maze-special-passes.ts与maze.ts。缺陷与审计发现
p.name.startsWith(namePrefix)猜测预设,容易因命名、大小写、空格差异导致特殊房间替换失败。LEVEL_CLAWVIPERTEMPLELEV2): 固定放置太阳祭坛大厅 (LVLPREST_ACT2_TOMB_TAINTED_SUN_X);LEVEL_SEWERSA3LEV1): 初始化 5 房间网格并强制替换 SW/SE/NW/NE 四角出口;LEVEL_CELLAROFPITY): 按种子在ICE_RIVER_A与ICE_RIVER_B之间随机决定拯救安雅河流;LVLTYPE_ACT5_TEMPLE): 严格执行 1.13c 硬编码四向重映射表 (nExpansionHardcodedPresetsRemapping);DRLGMAZE_PlaceAct1Barracks);DRLGMAZE_PlaceAct4Lava)。DRLGMAZE_MergeMazeRooms的二维 Orth 邻接与基于LvlMaze.txt.Merge(dwMerge / 1000) 的动态门框成环逻辑。验收条件
LvlPrest.txt数值 ID 精确映射表。npm run typecheck0 errors。npx vitest run全量通过并新增针对 1.13c 典型种子的特征比对测试。npx tsx scripts/verify-packs.ts1671/1671 项逐字节完全匹配。✅ 已修复并合并至 main (
e64e9a9)以 Diablo II v1.13c
D2Common.dll(MD5ee1238806ef6d6d9801d12a09d128fe1) 为黄金标准,对齐DRLGMAZE_Place*Stuff系列核心迷宫专用布局例程。实现内容
1. LvlPrest Def ID 精准替换机制
MAZE_DOOR_WEST=1 / EAST=2 / SOUTH=4 / NORTH=8,以及mazeDoorMask(room)与mazePresetDefIdForDoorMask(baseDefId, room)(原版公式baseDefId + doorMask - 1)。LvlPrest.txt规范DefID 常量:625、Kaa629、Tainted Sun X633585–588、Drain589、Chest5931018、Waypoint1026、River A/B1030/1031、Pool A/B1032/10331044、Final Room1059、Nihlathak 侧翼 base1060LVLPREST_MAZE_DEF_REGISTRY与replaceRoomByPresetDefId(),替换结果以lvlPrestDef=<id> (<name>)形式写入stats.notes,便于逐关卡验证。2. 各 Act 专用布局例程对齐
placeAct2TombStuff:新增levelId 61(爪蛇神庙 2)分支,固定放置太阳祭坛 Def633。placeAct3SewerStuff:levelId 92放置四角入口房585–588,Drain/Chest 按门洞方向偏移。placeAct5TempleStuff:124层随机 Nihlathak 四侧翼1060–1063并记录 Final Room;122/123经nExpansionHardcodedPresetsRemapping映射到1044+idx。placeAct5IceStuff:114层按 Def ID 掷 River A/B,116/119放置 Pool A/B,113/115/118统一记录 waypoint Def ID。顺带修复的两处潜在保真度缺陷
验证
新增
tests/maze-113c.test.ts(5 个用例):门洞掩码运算、爪蛇神庙 2 Def633、下水道角房与 Drain、冰河 A/B 跨 12 seed 分布与水池、神殿 remapping 与侧翼掷骰。npm run typechecknpx vitest runnpx tsx scripts/verify-packs.ts