Skip to content

Fix missed treasures and chests (golden chest variants, Athena ability grants, buried chests, numbered map chests, reset chests, chests seen too early) - #6

Merged
LED-N merged 3 commits into
LED-N:mainfrom
koiseka:fix/treasure-edge-cases
Nov 9, 2026
Merged

LED-N merged 3 commits into
LED-N:mainfrom
koiseka:fix/treasure-edge-cases

Conversation

@koiseka

@koiseka koiseka commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Six fixes for treasures and chests that ChestCounter misses today. Found by comparing ChestCounter's output with
what the replays contain on a set of ~100 recent replays (game version ++Fortnite+Release-43.00), and checked in
the Fortnite replay viewer.

Compared with v1.3.0 on that set:

Change
Chests opened +126 (about +4.5%): +114 from fix 5, +9 from fix 4, +3 from fix 6
Treasures +5 (about +20%)
Treasures with their prize id +1
Ammo boxes / other containers unchanged

Nothing that was counted before is removed. Each fix was also run on its own (the others off); every change comes
from exactly one fix, listed below.

ReplayAnalyzer.CurrentVersion goes from 10 to 13 (one bump per commit) so replays still on disk are analyzed again.

1. Golden chest variants (ReplayAnalyzer.cs)

Problem: TreasureHuntChest only matches BGA_DelilahTreasureHuntAnimatedChest_C. A rare chest in a vault
spawns BGA_DelilahTreasureHuntAnimatedChest_Rare_C (blue animation), which has the same fields
(PrizeTemplateId, OpeningPawn, SourceContainer, bSuccess). The AliasResolver sees "Chest" in the name
and maps it to GenericContainer, so the prize id is lost and the treasure falls back to "Treasure gizmo".

Fix: AliasResolver maps every BGA_DelilahTreasureHuntAnimatedChest* blueprint to TreasureHuntChest.

Effect: the treasure keeps its prize id (DelilahPrize:dpid_itemN) and the exact time of the golden chest
instead of "Treasure gizmo"; the count is unchanged. Checked in the replay viewer: the blue chest animation plays
on the opened rare chest.

2. Treasure grants on FortAbilitySystemComponentAthena players (ReplayReader.cs, ReplayAnalyzer.cs)

Problem: the grant reader (ReadAbilityGrants) only receives *AbilitySystemComponent_ClassNetCache fields
with no name. In many replays the player state's component is FortAbilitySystemComponentAthena, whose
ActivatableAbilities field is named and mapped (AbilitySystemCache → GrantedAbility). The library then
decodes it with the generic NetDelta reader (garbage element indices, everything "deleted") and the raw payload
never reaches RawProbe. In about two thirds of the matches where a treasure handler appeared, 0 grants were read
and the analysis fell back to "first export of the handler class" (at most one treasure per match).

Fix:

  • ReplayReader.cs: when RawProbe matches a ClassNetCache custom delta property, hand it the raw payload instead
    of the generic decoding (patch 13 in PATCHES.md).
  • ReplayAnalyzer.cs: the sink accepts *AbilitySystemComponent*_ClassNetCache with field ? or
    ActivatableAbilities.

Effect: +4 treasures. Every new grant:

  • is a new element id in the FastArray (a new ability, not a re-send of an earlier one);
  • references the exact network id of the GA_TreasureHandler_Generic_C class;
  • lands within 0.1s of a chest opened (or destroyed) by the recording player.

Two of them are the second treasure of a match, which the old fallback could never count.

3. Buried chests (ReplayAnalyzer.cs)

Problem: a buried chest grants the treasure when the digging completes. The chest only reports
bAlreadySearched ~2.4s later, outside the −3s/+2s window, so the treasure is dropped.

Fix: the window goes up to +4s for searches classified as buried chests only (other containers keep +2s).

Effect: +1 treasure. Sequence in the replay: grant → buried chest actor appears (dug out) ~0.8s later →
bAlreadySearched by the player ~2.4s after the grant. No other chest was opened by anyone within ±3s and no
teammate was nearby. Checked in the replay viewer: the grant matches the moment the digging finishes, the chest is
opened about two seconds later. Based on one example; +4s keeps ~1.6s of margin over the 2.4s seen.

4. Map chests with numbered names (NetGuidCache.cs)

Problem: level-placed actors have no archetype, so their export group is found from the actor name. Most
contain the class (Tiered_Chest_Athena_C_UAID_...), but some don't: Tiered_Chest_Athena47_UAID_...,
Tiered_Chest_Athena5_<16 hex>_<n>, Tiered_Chest_Athena2_.... These hit "Failed group" and are never decoded,
so opening them is not counted.

Fix: after the existing lookups fail, strip the _UAID_... / _<16 hex>_<n> suffix and the trailing number,
and accept only an exact <name>_C group (Tiered_Chest_Athena_C). No match → fails as before, so a wrong layout
is never used (patch 12 in PATCHES.md).

Effect: +9 chests. Decoded values are consistent with a normal chest (Health 500/500, bAlreadySearched,
SearchAnimationCount, SearchingPawn). Checked in the replay viewer on several of them, including one destroyed
together with the roof it stood on (counted like the existing "destroyed by the player" case).

5. Chests that are reset and opened again (BaseContainer.cs, ReplayAnalyzer.cs)

Problem: during a match a searched chest can go back to bAlreadySearched=false and be opened again, by
anyone. ChestCounter adds each chest key to _searched once and never removes it, so the second opening is
dropped. Typical case: a teammate opens a chest, it resets, the player opens it later: not counted.

Fix:

  • BaseContainer.bAlreadySearched is bool?: an update that does not carry the field is null, not "not
    searched" (patch 14 in PATCHES.md).
  • An explicit bAlreadySearched=false on a chest that is not destroyed removes it from _searched (and its last
    searcher), so the next opening is counted. Destroyed chests are unchanged.

Effect: +114 chests on the replay set; treasures, ammo boxes and other containers unchanged. Checks:

  • In the replay viewer: a chest opened by a teammate, reset ~40s later, then opened by the player ~70s after
    that. Before: not counted (the player's count for that match was one short of a manual count); after: counted,
    and the match total matches the manual count.
  • Every chest this fix adds in 5 matches (22 chests) throws out its own loot at that moment: 3–7 pickups with
    bTossedFromContainer and that chest as Owner within 1s. A chest that is not actually opened does not.

6. Actors sent before their export group (NetGuidCache.cs)

Problem: when a path finds no export group, GetNetFieldExportGroup adds it to _failedPaths and never
looks at it again. At the start of a match many chests come into relevancy at once; a chest whose class export
group has not been received yet (the first rare chest is fully sent a few seconds later) is cached as failed
for the rest of the replay, so its later updates, including being opened, are dropped ("Failed group").

Fix: AddToExportGroupMap clears _failedPaths when a new group is added, so those paths are tried again
(patch 15 in PATCHES.md).

Effect: +3 chests, all AlwaysSpawn_RareChest_C (in game they look like normal chests, behind a breakable
rock). Each one: in relevancy ~0:41–0:47, rare chest export group received ~0:43–0:59, opened by the player
later, with its own loot thrown out at that moment. All three checked in the replay viewer, loot matching.
Seen in the same replays: two other Tiered_Chest_Athena_C were affected the same way (opened by a teammate,
so no change to the player's count).

One limit: when the chest was opened while its first (failed) channel was still open, the "opened" state is
only read when the chest is sent again later, so the chest is counted but with a later time.

Testing

  • dotnet publish as in build.bat, then ChestCounter.exe --once --data <copy of the data folder> with v1.3.0
    and with this branch, and matches.csv compared: only the changes above.
  • Each fix enabled alone vs none (test build only) to attribute every change.
  • Moments checked in the Fortnite replay viewer.

Not in this PR

  • Grants with no chest search by the team nearby: most likely a teammate's chest outside the recording player's
    relevancy. Unchanged: not counted.
  • Display names for the prize ids not yet in DefaultPrizeNames.

🤖 Generated with Claude Code

koiseka and others added 2 commits November 8, 2026 16:55
- Golden chest variants (BGA_DelilahTreasureHuntAnimatedChest_*): read as
  TreasureHuntChest so the prize id is kept.
- Treasure grants on FortAbilitySystemComponentAthena: the reader hands the
  raw ActivatableAbilities payload to RawProbe instead of the generic NetDelta
  decoding, and the analyzer accepts that component.
- Buried chests: the grant comes when digging completes, ~2.4s before the
  chest reports searched; allow up to +4s for buried chests only.
- Map chests with numbered names (Tiered_Chest_Athena47_UAID_..., *_<hex>_<n>):
  matched to the exact <name>_C class instead of failing.
- Analyzer version 11 so replays on disk are analyzed again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A chest can go back to "not searched" during a match and be opened again,
by anyone. ChestCounter counted each chest key only once, so the second
opening (often the recording player's, after a teammate's) was dropped.

- BaseContainer.bAlreadySearched is bool?, so an update that does not carry
  it is no longer read as "not searched".
- An explicit bAlreadySearched=false on a chest that is not destroyed clears
  it from the counted set (and its last searcher), so the next opening counts.
- Analyzer version 12 so replays on disk are analyzed again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@koiseka koiseka changed the title Fix missed treasures and chests (golden chest variants, Athena ability grants, buried chests, numbered map chests) Fix missed treasures and chests (golden chest variants, Athena ability grants, buried chests, numbered map chests, reset chests) Nov 9, 2026
NetGuidCache remembered a path that found no export group as failed for the
whole replay. An actor sent a moment before its class's export group (in
practice: rare chests in view at the start of the match, before the first
rare chest is fully sent) was then never decoded, and every later update of
it, including being opened, was dropped.

- Adding a new export group clears the failed paths so they are tried again.
- Analyzer version 13 so replays on disk are analyzed again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@koiseka koiseka changed the title Fix missed treasures and chests (golden chest variants, Athena ability grants, buried chests, numbered map chests, reset chests) Fix missed treasures and chests (golden chest variants, Athena ability grants, buried chests, numbered map chests, reset chests, chests seen too early) Nov 9, 2026
@LED-N
LED-N merged commit fa36c92 into LED-N:main Nov 9, 2026
LED-N added a commit that referenced this pull request Nov 9, 2026
A chest spawned during the match (buried chest, relic chest) gets a new
GUID each time it becomes relevant again, and its full state (searched,
stale SearchingPawn) comes with the channel: every return near it was
counted as a new opening by the player. Its key is now its spawn
location, and a stale search with the same opener as the last recorded
one is that old search seen again.

Refilled chests are tracked per channel: an explicit "not searched"
re-arms the chest, so any later opening (or destruction) counts again,
also when it was refilled while out of relevancy. This replaces the
reset handling from #6. SearchAnimationCount is nullable as well.

On 98 replays vs #6: -103 buried and -26 relic phantom openings, +37
refilled chests reopened (all with their loot thrown out), ammo boxes
and treasures unchanged. Analyzer version 14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants