[P1][D09] /players N 接线:真实 gamePlayers / partyPlayers 驱动 NoDrop 缩放 #418

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

现状

src/game/engine.ts:878-879 硬编码:

gamePlayers: 1,
partyPlayers: 1,

treasure-engine.ts:140-168 的 computeScaledNoDrop 本身已通过审计(与 1.13c 一致:
effectivePlayers = p + trunc((g - p) / 2),r = NoDrop / (NoDrop + ProbSum),
NewNoDrop = int(ProbSum * r^N / (1 - r^N))),但输入永远是 1,等于该机制从未启用。

验收标准

  • 引入会话级 gamePlayers(含单机 /players N 指令,1–8)与 partyPlayers(附近组队人数)。
  • 两者由 engine 会话状态提供,多人模式下由 net 会话人数驱动(与 D18 协同)。
  • 实现 /players N 聊天指令并在 HUD 显示当前值。
  • vitest:Act 1 H2H A 在 players 1 / 3 / 5 / 8 下的 NoDrop 缩放值与 1.13c 手算值逐一相等。
  • 统计学验证:players 8 相对 players 1 的每怪期望掉落件数提升幅度符合原版。
## 现状 `src/game/engine.ts:878-879` 硬编码: ```ts gamePlayers: 1, partyPlayers: 1, ``` `treasure-engine.ts:140-168` 的 `computeScaledNoDrop` 本身已通过审计(与 1.13c 一致: `effectivePlayers = p + trunc((g - p) / 2)`,`r = NoDrop / (NoDrop + ProbSum)`, `NewNoDrop = int(ProbSum * r^N / (1 - r^N))`),但输入永远是 1,等于该机制从未启用。 ## 验收标准 - [ ] 引入会话级 `gamePlayers`(含单机 `/players N` 指令,1–8)与 `partyPlayers`(附近组队人数)。 - [ ] 两者由 `engine` 会话状态提供,多人模式下由 `net` 会话人数驱动(与 D18 协同)。 - [ ] 实现 `/players N` 聊天指令并在 HUD 显示当前值。 - [ ] vitest:`Act 1 H2H A` 在 players 1 / 3 / 5 / 8 下的 NoDrop 缩放值与 1.13c 手算值逐一相等。 - [ ] 统计学验证:players 8 相对 players 1 的每怪期望掉落件数提升幅度符合原版。
troytt added this to the [M18] 打怪掉落物品:怪物死亡掉落全链路 1.13c 还原 milestone 2026-09-24 03:25:58 +00:00
Author
Owner

Resolution Summary (Issue #418 — Commit 9022579)

  • Added gamePlayers / partyPlayers state and setPlayers(players, partyPlayers) to GameEngine (src/game/engine.ts) and wired /players N chat command in src/scene/act-scene.ts to drive 1.13c NoDrop exponential scaling.

  • 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 #418 — Commit `9022579`) - Added `gamePlayers` / `partyPlayers` state and `setPlayers(players, partyPlayers)` to `GameEngine` (`src/game/engine.ts`) and wired `/players N` chat command in `src/scene/act-scene.ts` to drive 1.13c NoDrop exponential scaling. - **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#418
No description provided.