M5: Alternate stats views (stored runs, lifetime, pooled) #9

Closed
opened 2026-04-19 17:00:16 -07:00 by nelsong6 · 1 comment
nelsong6 commented 2026-04-19 17:00:16 -07:00 (Migrated from github.com)

Goal

Expand Card Utility Stats beyond the default live per-instance view.

This issue now covers three related view modes:

  • viewing Card Utility Stats for a specific past run from the game's Run History screen
  • aggregating stored runs into a broader lifetime / cross-run stats view
  • pooling multiple in-run card instances into a single card-type view (for example, all Strikes together)

This issue supersedes #2 and #11 so alternate stats views live in one place.

Shared foundation

These features all depend on the same general capability: rendering stats from something other than the default live per-instance aggregate.

Common needs:

  • stable persisted per-run data where applicable
  • UI affordances for switching views cleanly
  • lookup/aggregation paths that can target instance, card type, single stored run, or lifetime corpus

Scope A: Run History integration

When browsing a past run in the game's Run History screen, show Card Utility Stats for that specific run.

Implementation sketch

  1. Find the Run History screen in decompiled code (likely NRunHistoryScreen or similar).
  2. Harmony-patch its card/deck view to add our checkbox or entry point.
  3. Resolve the currently viewed run's ID from the screen's state.
  4. Load the matching stored run file.
  5. Render stats from that file.

Risk: run ID correlation

The game's internal run ID may not match our generated UUIDs. Possible fixes:

  • store the game's run ID in RunData at run start if accessible
  • add secondary correlation fields such as character, seed, and timestamp
  • choose a filename/index scheme that supports lookup without brittle assumptions

Scope B: Lifetime / cross-run aggregation

Add a lifetime mode that aggregates per-card attribution across all stored runs, for example: "Strike averages 3.1 effective damage / 8% overkill across 47 runs."

Requirements

  • storage schema/versioning must be stable enough for backward-compatible reads
  • UI surface for lifetime stats, likely in a generic Compendium-style screen or another stored-data browser
  • filter support such as character, ascension, and date range

Scope C: Pooled by card type

v0.x tracks stats per instance, so each physical card in the deck has its own aggregates. Add a pooled mode that sums across copies of the same card definition, so hovering any Strike can show stats for all Strikes together.

Possible shapes

  • a second checkbox or toggle near View Stats, such as Pooled
  • a second section within the tooltip: This card vs. All copies
  • a config setting for the default mode

Data layer

Pooled lookup should be cheap to compute on the fly by summing matching card-definition aggregates. This mode should not require a schema change.

Suggested rollout

  • First: make sure the view-switching model is sound for instance vs. pooled display
  • Then: make specific past-run viewing work from stored data
  • Then: build lifetime aggregation on top of the same stored run corpus and filters

Dependencies

  • M4 (the View Stats checkbox or equivalent entry point)
  • schema versioning / stabilization for persisted run data
  • investigation into the game's Run History screen and run identity fields

Definition of done

  • UI can clearly distinguish at least per-instance vs. pooled-by-card-type views
  • Stored run files can be matched back to a run the player is viewing
  • Card stats render for a selected historical run
  • Lifetime aggregation can scan stored runs safely across schema versions
  • Filters exist for at least character and date range
  • UI clearly distinguishes single-run, lifetime, and pooled views
## Goal Expand Card Utility Stats beyond the default live per-instance view. This issue now covers three related view modes: - viewing Card Utility Stats for a specific past run from the game's Run History screen - aggregating stored runs into a broader lifetime / cross-run stats view - pooling multiple in-run card instances into a single card-type view (for example, all Strikes together) This issue supersedes #2 and #11 so alternate stats views live in one place. ## Shared foundation These features all depend on the same general capability: rendering stats from something other than the default live per-instance aggregate. Common needs: - stable persisted per-run data where applicable - UI affordances for switching views cleanly - lookup/aggregation paths that can target instance, card type, single stored run, or lifetime corpus ## Scope A: Run History integration When browsing a past run in the game's Run History screen, show Card Utility Stats for that specific run. ### Implementation sketch 1. Find the Run History screen in decompiled code (likely `NRunHistoryScreen` or similar). 2. Harmony-patch its card/deck view to add our checkbox or entry point. 3. Resolve the currently viewed run's ID from the screen's state. 4. Load the matching stored run file. 5. Render stats from that file. ### Risk: run ID correlation The game's internal run ID may not match our generated UUIDs. Possible fixes: - store the game's run ID in `RunData` at run start if accessible - add secondary correlation fields such as character, seed, and timestamp - choose a filename/index scheme that supports lookup without brittle assumptions ## Scope B: Lifetime / cross-run aggregation Add a lifetime mode that aggregates per-card attribution across all stored runs, for example: "Strike averages 3.1 effective damage / 8% overkill across 47 runs." ### Requirements - storage schema/versioning must be stable enough for backward-compatible reads - UI surface for lifetime stats, likely in a generic Compendium-style screen or another stored-data browser - filter support such as character, ascension, and date range ## Scope C: Pooled by card type v0.x tracks stats per instance, so each physical card in the deck has its own aggregates. Add a pooled mode that sums across copies of the same card definition, so hovering any Strike can show stats for all Strikes together. ### Possible shapes - a second checkbox or toggle near `View Stats`, such as `Pooled` - a second section within the tooltip: `This card` vs. `All copies` - a config setting for the default mode ### Data layer Pooled lookup should be cheap to compute on the fly by summing matching card-definition aggregates. This mode should not require a schema change. ## Suggested rollout - First: make sure the view-switching model is sound for instance vs. pooled display - Then: make specific past-run viewing work from stored data - Then: build lifetime aggregation on top of the same stored run corpus and filters ## Dependencies - M4 (the `View Stats` checkbox or equivalent entry point) - schema versioning / stabilization for persisted run data - investigation into the game's Run History screen and run identity fields ## Definition of done - [ ] UI can clearly distinguish at least per-instance vs. pooled-by-card-type views - [ ] Stored run files can be matched back to a run the player is viewing - [ ] Card stats render for a selected historical run - [ ] Lifetime aggregation can scan stored runs safely across schema versions - [ ] Filters exist for at least character and date range - [ ] UI clearly distinguishes single-run, lifetime, and pooled views
nelsong6 commented 2026-07-05 15:46:07 -07:00 (Migrated from github.com)

Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.

Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
romaine-life/spirelens#9
No description provided.