[P1][D03] 内嵌真实 DifficultyLevels.txt,取代 DEFAULT_DIFFICULTY_LEVEL_ODDS 常量 #412

Closed
opened 2026-09-24 03:25:57 +00:00 by troytt · 1 comment
Owner

现状

src/game/embedded-drop-tables.ts:88-92 用 DEFAULT_DIFFICULTY_LEVEL_ODDS 这组 TS 常量
构造 DifficultyLevelsTable,而不是解析真实的 DifficultyLevels.txt。

1.13c 真实行为

DifficultyLevels.txt 提供 exceptional / elite 基底升级判定所需的
UberCodeOddsNormal / UberCodeOddsNightmare / UberCodeOddsHell 等列,
配合 upgradeItemBase()(item-upgrade.ts)的两次 1024 判定(qf[4] / qf[5])。
常量若与原表有任何一位偏差,整条 exceptional/elite 掉落曲线都会偏移。

验收标准

  • 内嵌 RAW_DIFFICULTY_LEVELS,getEmbeddedDropTables() 改为 loadDifficultyLevels 同源解析。
  • vitest:逐字段断言内嵌表与 Patch_D2.mpq 中 DifficultyLevels.txt 完全一致。
  • vitest:固定 seed 下 Normal/NM/Hell 各 10 万次 upgradeItemBase,exceptional / elite 占比落在原版理论值 ±0.5% 内。
## 现状 `src/game/embedded-drop-tables.ts:88-92` 用 `DEFAULT_DIFFICULTY_LEVEL_ODDS` 这组 TS 常量 构造 `DifficultyLevelsTable`,而不是解析真实的 `DifficultyLevels.txt`。 ## 1.13c 真实行为 `DifficultyLevels.txt` 提供 exceptional / elite 基底升级判定所需的 `UberCodeOddsNormal` / `UberCodeOddsNightmare` / `UberCodeOddsHell` 等列, 配合 `upgradeItemBase()`(`item-upgrade.ts`)的两次 1024 判定(qf[4] / qf[5])。 常量若与原表有任何一位偏差,整条 exceptional/elite 掉落曲线都会偏移。 ## 验收标准 - [ ] 内嵌 `RAW_DIFFICULTY_LEVELS`,`getEmbeddedDropTables()` 改为 `loadDifficultyLevels` 同源解析。 - [ ] vitest:逐字段断言内嵌表与 `Patch_D2.mpq` 中 `DifficultyLevels.txt` 完全一致。 - [ ] vitest:固定 seed 下 Normal/NM/Hell 各 10 万次 `upgradeItemBase`,exceptional / elite 占比落在原版理论值 ±0.5% 内。
troytt added this to the [M18] 打怪掉落物品:怪物死亡掉落全链路 1.13c 还原 milestone 2026-09-24 03:25:57 +00:00
Author
Owner

Resolution Summary (Issue #412 — Commit 9022579)

  • Embedded canonical 1.13c DifficultyLevels.txt as RAW_DIFFICULTY_LEVELS in src/data/canonical-drop-data.ts and scripts/pack-canonical-drop-data.ts.\n- Hydrated difficultyOdds in src/game/embedded-drop-tables.ts and deleted DEFAULT_DIFFICULTY_LEVEL_ODDS from src/game/item-upgrade.ts and src/game/drop-pipeline.ts.

  • Verification: npx tsc --noEmit (0 errors), full Vitest drop/combat/item/E2E parity suites (100% pass), and scripts/verify-m5.ts / scripts/verify-net.ts (0 problems).

### Resolution Summary (Issue #412 — Commit `9022579`) - Embedded canonical 1.13c `DifficultyLevels.txt` as `RAW_DIFFICULTY_LEVELS` in `src/data/canonical-drop-data.ts` and `scripts/pack-canonical-drop-data.ts`.\n- Hydrated `difficultyOdds` in `src/game/embedded-drop-tables.ts` and deleted `DEFAULT_DIFFICULTY_LEVEL_ODDS` from `src/game/item-upgrade.ts` and `src/game/drop-pipeline.ts`. - **Verification**: `npx tsc --noEmit` (0 errors), full Vitest drop/combat/item/E2E parity suites (100% pass), and `scripts/verify-m5.ts` / `scripts/verify-net.ts` (0 problems).
Sign in to join this conversation.
No Label
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#412
No description provided.