Skip to content

Stats panel: FBR breakpoints, physical pierce, and a side panel with more player stats - #102

Open
errolgr wants to merge 1 commit into
Project-Diablo-2:mainfrom
errolgr:feature/stats-panel-rows
Open

errolgr wants to merge 1 commit into
Project-Diablo-2:mainfrom
errolgr:feature/stats-panel-rows

Conversation

@errolgr

@errolgr errolgr commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds rows players asked for to the advanced stats panel: physical pierce, an FBR breakpoint line with block frames, dodge/avoid/evade, off-weapon ED and ED vs demons/undead, active auras and oskills with their levels, base (hard-point) vs total attributes, and a +skills summary.

Problem

The panel shows FCR/FHR breakpoints but not FBR. It shows elemental pierce but not physical pierce (PD2 stat 425). It doesn't show several stats that are only visible on item tooltips: Dodge/Avoid/Evade (STAT_DODGE/AVOID/EVADE are defined in Constants.h but never drawn), off-weapon ED, ED vs demons/undead, auras, oskills, +skills, and hard points vs total attributes.

The main panel is already 558 px tall in a 600 px-high game, so it has room for only two more rows.

Changes

File Change
BH/Drawing/Stats/StatsDisplay.cpp Main panel: Physical Pierce row after Elemental Pierce; FBR line after FHR (player tab). Panel height +32 (590 px).
GetBlockBreakpoints: FBR thresholds and current block frames from the block (BL) AnimData record of the current class/form/weapon class. It uses the same ConvertMode + GetAnimDataRecord lookup as the IAS line, frames = ceil(256*F / floor(speed*(50+EFBR)/100)) - 1, with base 100 under Holy Shield. No hard-coded table.
DrawSidePanel (player tab only): a second box of the same width next to the main one (left of it with statsOnRight). Contents: attributes base/total; all/class skills and each class skill-tab bonus (game text from CharStats StrSkillTab1-3); running own aura and item auras with level; oskills with total level; dodge/avoid/evade; block frames; off-weapon ED; ED vs demons/undead. Clicking it closes the panel, like the main box.
BH/Drawing/Stats/StatsDisplay.h Declarations, side-panel rectangle for InRange.
  • Existing rows are unchanged. The merc tab draws neither the FBR line nor the side panel.
  • Off-weapon ED is the player's item_maxdamage_percent as is. In game, a weapon's own ED (ItemStatCost op 13) is applied to the weapon and doesn't show up in the player's stat 17: a 100% ED hand axe leaves it at 0, and 30% ED gloves make it 30.
  • Not included: auras cast on the player by other units (party, merc). The client has the aura state, but BH has no client-side value for the level of an aura cast by another unit.

Testing

In game (PD2 Season 13 client, single player, Paladin level 50): gear with known stats (cap and gloves, normal quality), Might on the right button, then Holy Shield cast. Every new row is compared to the stats put on the gear. FBR and block frames are compared to the harness's independent rates oracle, which matches the PD2 wiki/maxroll FBR tables.

Result
Before (current BH, and shipped PD2 BH) rows not present
After (this PR) 20/20 checks pass
Row Expected from Drawn
Strength 100 hard + 15 cap Strength: 100 / 115
Skills cap All Skills: +1, Class Skills: +1, +2 to Offensive Auras
Own aura Might 10 + 1 all + 1 class + 2 Offensive Auras Aura: Might (Level 14)
Item aura item_aura Aura: Holy Freeze (Level 5)
Oskill +2 + 1 all skills Oskill: Teleport (Level 3)
Physical pierce gloves Physical Pierce: 15%
Dodge / Avoid / Evade gloves 11% / 22% / 33%
Off-weapon ED / vs demons / vs undead gloves 30% / 40% / 55%
FBR 48, Short Sword + Buckler oracle FBR: 13 / 32 / 86 / 600, Block Frames: 3
FBR 48 with Holy Shield oracle FBR: 86, Block Frames: 2

Unit tests (native build of StatsDisplay.cpp against a fake engine):

  • FBR line and block frames match the oracle for every class × weapon class, Holy Shield, and wereforms (180 lines).
  • Unit tests also cover attributes, skills, auras/oskills, pierce/avoid and ED rows.

Runtime: 10/10 + 10/10 cold launches (PD2 and vanilla) with the branch build, no crashes. The other in-game scenarios have the same results as on main.

Screenshots

Before After
before after

After casting Holy Shield

after holy shield

Full evidence: PR-EVIDENCE.md

…ore player rows

Main panel:
- "Physical Pierce" row after "Elemental Pierce" (stat 425 passive_phys_pierce).
- "FBR" breakpoint line after FHR, computed from the block (BL) AnimData record the game plays
  for the current class/form/weapon class (same ConvertMode + GetAnimDataRecord lookup as the IAS
  line), with Holy Shield's faster base. Panel height +32 (590 px, fits a 600 px screen).

Side panel (player tab only, next to the main panel; the main panel has no room left):
- Attributes base (hard points, GetBaseStat) / total for Str/Dex/Vit/Ene.
- +All skills, +class skills, and each +skill tab bonus of the player's class (game text from
  CharStats StrSkillTab1-3).
- Auras: the right skill when it is a running aura (with total level) and item auras
  (item_aura, level); oskills (item_nonclassskill) with their total level.
- Dodge / Avoid / Evade chances, block frames at the current FBR.
- Off-weapon ED (the player's item_maxdamage_percent: a weapon's own ED is local to the weapon),
  ED vs demons, ED vs undead.
Clicking the side panel closes the stats panel, like the main one.
@errolgr
errolgr marked this pull request as ready for review October 5, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant