Add deaths_log with gold lost and time dead per death - #88
Open
geracosta wants to merge 1 commit into
Open
Conversation
Per-player log of deaths as {time, key, gold_lost, time_dead}, where
key is the killing unit. Gold lost comes from the hero-death gold
reason in the combat log; time dead from life_state transitions in the
interval entries (absent if the match ends before the respawn). Both
are collected in a pre-scan keyed by event time since the combat log
and interval entries around a death are not strictly ordered in the
stream. Deaths follow the killed_by filters except self-kills, which
are real scoreboard deaths (e.g. Techies suicide) even though no kill
is credited.
Requested in odota/core#1465.
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the
deaths_loghalf of odota/core#1465: a per-player log of deaths with{time, key, gold_lost, time_dead}, wherekeyis the killing unit (hero, tower, creep — or the player's own hero for suicides). Also covers odota/core#2294 and odota/core#1780, which ask for the same log.gold_lostcomes from the combat log gold entries with the hero-death reason. It matchesgold_reasons["1"]exactly per player on the reference replay; on current patches it's 0 since the game removed death gold loss, but historical replays populate it.time_deadcomes fromlife_statetransitions in the interval entries (death to respawn, so buybacks shorten it). If the match ends before the respawn, the field is absent rather than guessing. Per player it sums to the dead seconds in the existinglife_statemap.killed_by(real heroes, no illusions, aegis deaths excluded) except self-kills, which are real deaths (they count on the scoreboard and lose gold) even though no kill is credited — e.g. Techies suicides.Verified on two replays (the 1781962623 test file and a current-patch match) against the blob's own aggregates and the scoreboard:
deaths_loglength equals scoreboard deaths for all 20 players (including a Techies game: 10 deaths = 7 kills by enemies + 3 suicides),gold_lostsums equalgold_reasons["1"]for all players, and the rest of the blob is byte-identical to master's output.On the
assists_loghalf of #1465:CDOTAUserMsg_ChatEventdoes carry the assisters inplayerid_3..6for hero kill events, butParse.javacurrently only readsplayerid_1/2— so it's feasible as a follow-up and I kept it out of this PR to keep the diff small.Companion core PR: odota/core#2973.