Docs: regression checklist for Greater Rift minion life (verification matrix proposed by the reporter of #23)
Co-authored-by: Joe Hu <12777592+hubeiqiao@users.noreply.github.com>
This commit is contained in:
@@ -302,6 +302,7 @@ The cleaner arrangement is to move these defaults into per-game configuration an
|
||||
| [docs/MAC.md](docs/MAC.md) | Playing on a Mac: building the macOS App, key mapping, known gaps |
|
||||
| [docs/LEGACY_DEVICES.md](docs/LEGACY_DEVICES.md) | Older devices (A16 and earlier): making the texture pack and putting it on the phone |
|
||||
| [docs/OLDER_SYSTEMS.md](docs/OLDER_SYSTEMS.md) | Older systems (iOS 18 – 25, macOS 15 – 25): building the older-API version and combining it with the Legacy Device Pack |
|
||||
| [docs/qa-rift-pet-life.md](docs/qa-rift-pet-life.md) | Regression checklist for minion life in Greater Rifts (what has been run and what has not; additions welcome) |
|
||||
| [docs/DERIVED.md](docs/DERIVED.md) | Game-related material in this repository: what is here, what is not, and why |
|
||||
|
||||
## Legal
|
||||
|
||||
@@ -302,6 +302,7 @@ DM_MAC_M3=1 dm/tools/mac_app.sh # macOS 15 – 25:产出 D2R Mobile M3.ap
|
||||
| [docs/MAC.zh-CN.md](docs/MAC.zh-CN.md) | 在 Mac 上玩:构建 macOS App、键位、已知不足 |
|
||||
| [docs/LEGACY_DEVICES.zh-CN.md](docs/LEGACY_DEVICES.zh-CN.md) | 老机型(A16 及更早):怎么做贴图包、怎么放进手机 |
|
||||
| [docs/OLDER_SYSTEMS.zh-CN.md](docs/OLDER_SYSTEMS.zh-CN.md) | 老系统(iOS 18 – 25、macOS 15 – 25):老接口版怎么出、和老机型贴图包怎么组合 |
|
||||
| [docs/qa-rift-pet-life.zh-CN.md](docs/qa-rift-pet-life.zh-CN.md) | 大秘境随从生命的回归清单(哪些跑过、哪些还没人跑,欢迎补) |
|
||||
| [docs/DERIVED.zh-CN.md](docs/DERIVED.zh-CN.md) | 仓库里与游戏有关的东西:有什么、没有什么、为什么 |
|
||||
|
||||
## 声明
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# Rift minion life: regression checklist
|
||||
|
||||
**English** | [简体中文](qa-rift-pet-life.zh-CN.md)
|
||||
|
||||
|
||||
The verification matrix here was proposed by the reporter of [#23](https://github.com/jhaizhou-ops/d2r-mobile/issues/23). It has been checked against the fixed behaviour and rewritten as a regression checklist. "Verified" rows were actually run and read by the maintainers; "not run" rows have not been run by anyone yet — contributions welcome.
|
||||
|
||||
## Root cause and fix (merged)
|
||||
|
||||
- The original game's get-stat function returns the **total** for units like minions (base plus skill / aura bonuses, with percentage bonuses already applied), while the set-stat function writes the **base**. The old code read the total, multiplied it by the Rift multiplier and wrote it back as the base.
|
||||
- When a minion has "+N% maximum life" (in the data tables only Battle Orders and Oak Sage give this stat to minions), the game multiplies our written value by (1 + N%) again; the next read differs from the last write and was taken as a new base. Life grew by (1 + N%) every 10 ticks.
|
||||
- At the stat cap (8,388,607 life) the total overflows to a negative number and the get-stat function returns the minimum, 1 — the "back to 1 after the cap" seen in logs. At that moment the minion really has only a few points of life.
|
||||
- Fix: base, comparison and the sidecar file all use the base stat; the game applies the bonus itself. The clamp leaves headroom so that the total stays within the stat cap. Abandoning restores the base on the same tick (as completion does). A bound demon whose base exceeds the original cap formula (left in saves by the old code) is reset to the cap on load.
|
||||
|
||||
## Reading the numbers
|
||||
|
||||
- `DM_RIFT_TEST_PETDUMP=1`: every 125 ticks a line with, per minion, pet type, class, id, level, total maximum life, base, and current life.
|
||||
- One line per adjustment, showing base a → b (cached base, tier, multiplier) and total c → d. **Normally: one line on entering, one on leaving (completion / abandon), none in between.**
|
||||
- One line when the one-time repair triggers: the character's bound demon base X exceeded the cap and was reset to Y.
|
||||
- Test switches: `DM_RIFT_TEST_PETPCT=<percent>` (adds +N% maximum life to every minion), `DM_RIFT_TEST_START=<tick>:<tier>`, `DM_RIFT_TEST_ABANDON=<tick>`, `DM_RIFT_TEST_SAVE=<tick>` (asks the game to save).
|
||||
- Expected values by hand: boosted base = base × tier multiplier; total = boosted base × (1 + N%). Example: base 27000, tier 77 ×3.891, +77% → base 105057, total 185950.
|
||||
|
||||
## Regression matrix
|
||||
|
||||
| # | Scenario | Expected | Status |
|
||||
|---|---|---|---|
|
||||
| 1a | Minion with +N% enters a Rift at tier 10 or above | 1 adjustment line; readings stay constant | Verified (bound demon, +77% via test switch; tiers 27 and 77) |
|
||||
| 1b | Same, without a bonus | 1 line; total = base | Verified |
|
||||
| 1c | Staying in town (with bonus) | 0 lines | Verified |
|
||||
| 1d | Battle Orders applied / expiring, entering / leaving Oak Sage range inside a Rift | base unchanged, total follows the bonus; 0 lines | **Not run** (real skills never exercised) |
|
||||
| 1e | Weapon swap, skill level-up, resummon | a resummoned unit is boosted once from its new base; otherwise no lines | **Not run** |
|
||||
| 1f | Two minions of the same class (the reporter's case: two Defilers) | one line each, independent | **Not run** |
|
||||
| 3 | Very large base whose boosted total would exceed the stat cap | clamped so the total stays within the cap; never drops to 1 | Unit test only (such a base cannot be produced in a real game) |
|
||||
| 4a | Abandon | base restored on the same tick (1 line), before the pause | Verified |
|
||||
| 4b | Completion in time / over time | base restored on the completion tick | By code reading; that line was not read separately |
|
||||
| 4c | Town and back, next tier, minion death and resummon, quitting to a new game | no extra lines; a new game starts from a clean base | **Not run** |
|
||||
| 5a | Save while boosted, then reload | a "base taken from sidecar" line, then 1 restore line | Verified |
|
||||
| 5b | Save left by the old code (bound demon base above the original cap) | 1 "exceeded the cap, reset" line on load; 0 after saving and reloading | Verified (one demon type, one cap tier) |
|
||||
| 5c | Same, but written to a very small value | cannot be told apart from a legitimate value; left alone — re-bind the demon | Known limitation |
|
||||
| 5d | Several same-class minions boosted at save time; a save overlapping the restore | each returns to its own base after reload | **Not run** |
|
||||
|
||||
## What was not adopted
|
||||
|
||||
The diagnostic patch submitted with this checklist (a detailed, rate-limited record per adjustment) was not merged: after the fix a normal run has only one or two adjustments, and records designed around the total no longer discriminate. The minion dump line described above already carries total, base and current life, which is enough to check this table.
|
||||
@@ -0,0 +1,44 @@
|
||||
# 大秘境随从生命:回归清单
|
||||
|
||||
[English](qa-rift-pet-life.md) | **简体中文**
|
||||
|
||||
|
||||
本清单的验证矩阵由 [#23](https://github.com/jhaizhou-ops/d2r-mobile/issues/23) 的报告人提出,这里按修正后的行为逐条核对、改写成回归清单。标「已验」的是维护者实际跑过并读到数的;标「未验」的还没有人跑过,欢迎补。
|
||||
|
||||
## 根因与修正(已合入)
|
||||
|
||||
- 读生命上限用的原版取属性函数,在随从这类单位上给的是**合计**(基础项 + 技能 / 光环的加成,百分比加成已乘进去);写用的设属性函数写的是**基础项**。原先的代码读合计、乘上秘境倍率、写回基础项。
|
||||
- 随从带「生命上限 +N%」(数据表里只有战斗体制 Battle Orders 和橡木智者光环 Oak Sage 会给随从这条属性)时,游戏在我们写的值上再乘一遍 (1 + N%);下一轮读回的值不等于上次写入,又被当成新基数。每 10 拍涨 (1 + N%) 倍。
|
||||
- 涨到属性上限(8388607 点)后,合计溢出成负数,取属性函数按最小值返回 1 点——这就是日志里「封顶后回到 1」。那一刻随从实际只剩几点生命。
|
||||
- 修正:基数、比较、侧文件一律按基础项;加成由游戏自己乘。封顶按「合计不超过属性上限」留余量。放弃当拍就设回基数(同结算)。束缚恶魔的基数若高过原版封顶公式的现算值(修正前留在存档里的),读档时设回封顶。
|
||||
|
||||
## 怎么读数
|
||||
|
||||
- `DM_RIFT_TEST_PETDUMP=1`:每 125 拍一行 `秘境:随从读数 …[类型 T 类号 C id I 等级 L 生命上限 合计(基础 基础项)当前 当前生命]`。
|
||||
- 每次调整一行:`秘境:随从 id I(宠物类型 T,类号 C)生命上限基础项 a → b(基数 x,第 N 层 ×m);合计 c → d`。**正常情况下进层 1 行、离开(结算 / 放弃)1 行,中间没有。**
|
||||
- 一次性修正触发时一行:`秘境:<角色> 的束缚恶魔(类号 C)生命基础 X 超过上限,已设回 Y`。
|
||||
- 造现场的测试开关:`DM_RIFT_TEST_PETPCT=<百分数>`(给每只随从加生命上限 +N%)、`DM_RIFT_TEST_START=<拍>:<层>`(直接开某层)、`DM_RIFT_TEST_ABANDON=<拍>`、`DM_RIFT_TEST_SAVE=<拍>`(到拍请游戏存盘)。
|
||||
- 期望值手算:放大后基础项 = 基数 × 本层倍率;合计 = 基础项 × (1 + N%)。例:基数 27000、第 77 层 ×3.891、+77% → 基础项 105057、合计 185950。
|
||||
|
||||
## 回归矩阵
|
||||
|
||||
| # | 场景 | 期望 | 状态 |
|
||||
|---|---|---|---|
|
||||
| 1a | 带 +N% 的随从进 10 层以上的秘境 | 调整 1 行;之后读数不变 | 已验(束缚恶魔,+77% 用测试开关加;第 27、77 层) |
|
||||
| 1b | 同上,不带加成 | 调整 1 行;合计 = 基础项 | 已验 |
|
||||
| 1c | 只待在城里(带加成) | 调整 0 行 | 已验 |
|
||||
| 1d | 秘境里战斗体制施加 / 到期、进出橡木智者光环范围 | 基础项不变,合计随加成变;调整 0 行 | **未验**(真实技能没跑过) |
|
||||
| 1e | 换武器、升技能、重新召唤 | 重召的新单位按新基数放大 1 次;其余不出调整行 | **未验** |
|
||||
| 1f | 两只同类号的召唤物(报告人的现场:两只污染者) | 各自 1 行,互不影响 | **未验** |
|
||||
| 3 | 基数很大、放大后合计会过属性上限 | 截在「合计不过上限」,不回到 1 | 只有单元测试(真局造不出这么大的基数) |
|
||||
| 4a | 放弃 | 当拍设回基数(1 行),出现在暂停之前 | 已验 |
|
||||
| 4b | 限时内通关 / 超时通关 | 结算当拍设回基数 | 读码如此;没有单独读过这一行 |
|
||||
| 4c | 回城再回来、换层继续、随从死亡后重召、退出换一局 | 不出现多余的调整行;新局从干净基数起 | **未验** |
|
||||
| 5a | 放大着的时候存盘,再读档 | 读档行 `基数按侧文件取 x`,随后 1 行设回 | 已验 |
|
||||
| 5b | 修正前留下的存档(束缚恶魔基础项高过原版封顶) | 读档 1 行「超过上限,已设回」,存盘后再读 0 行 | 已验(一种恶魔、一档封顶) |
|
||||
| 5c | 同上,但被写成了很小的数 | 程序分不出来,不改;需重新束缚 | 已知限制 |
|
||||
| 5d | 同类号多只都放大着时存盘;存盘与设回基数重叠 | 读档后各自回到自己的基数 | **未验** |
|
||||
|
||||
## 没有采纳的部分
|
||||
|
||||
报告人随清单提交的诊断补丁(每次调整记一条详细记录并限流)没有合入:修正后正常一场只有一两次调整,那套按「合计」口径设计的记录不再有区分力。上面「怎么读数」里的随从读数行已带上合计、基础项、当前生命三个数,够用来核这张表。
|
||||
Reference in New Issue
Block a user