[DRLG-M4] 严格对齐 LvlSub.txt 试验次数与全排列候选位地块替换算法 #76
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#76
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.dllDRLGTILESUB_DoSubstitutions为黄金标准,重构src/game/wilderness.ts与src/game/maze.ts中的地块替换逻辑。缺陷与审计发现
Trials == -1时,引擎会遍历全部(Width - SubWidth) * (Height - SubHeight)个候选坐标,构建全排列随机洗牌数组,顺序测试第一个合法位置。当前 Web 引擎仅支持简单有上限的随机尝试,导致部分小概率关键预设替换失败或遗漏。sub_6FD8ACE0),同步覆盖 Floor、Wall(支持多层)、Roof 与 Shadow,并维护 Roof 计数。当前替换偏重于地面层,缺少对暗影与顶部遮罩的完整覆盖。验收条件
LvlSub.txt中的Prob0..4、Trials0..4与Max0..4。Trials == -1时的全局坐标 Fisher-Yates 随机洗牌扫描机制。npm run typecheck0 errors。npx vitest run全量通过并新增 LvlSub 替换测试。npx tsx scripts/verify-packs.ts1671/1671 项逐字节完全匹配。已完成原版 1.13c
LvlSub.txt试验次数与全排列候选位地块替换算法 (DRLGTILESUB_DoSubstitutions) 对齐并合入main(f36d1b4):Trials == -1时的全局候选位 Fisher-Yates 随机洗牌全排列扫描机制 (buildSubstitutionCandidatePermutation),消除固定左上扫描偏差并保证穷尽扫描。SubTheme0..4 索引的Prob0..4、Trials0..4、Max0..4与多变体随机抽样 (DRLGTILESUB_PickSubPreset)。stampSubstitutionPatch地表、墙体、屋顶 (type === 15)、暗影四层原子级同步覆盖。