Add deaths_log with gold lost and time dead per death - #88
Conversation
| return (isIllusion != null && isIllusion ? "illusion_" : "") + input; | ||
| } | ||
|
|
||
| // EDOTA_ModifyGold_Reason: 1 = hero death (the negative bucket in gold_reasons) |
There was a problem hiding this comment.
Same question around the need to precompute/reorder. I don't think we are doing this for kills_log, so even if it's confusing in some ways it might be better to be consistent?
There was a problem hiding this comment.
It is consistent with kills_log where the two are comparable: the death entry itself ({time, key}) is emitted inline at the death event, same append-in-stream-order pattern as kills_log — no reordering there. The pre-scan only exists to fill the two extra fields, which can't be known at that point in the stream: time_dead is decided by the revive, seconds to minutes later, and gold_lost lives in a separate GOLD combat log record that isn't reliably ordered against the death record (it can land a second or two off by timestamp). kills_log never needs a join like that, so it never needed the maps.
If you'd rather not carry the lookaside maps, dropping gold_lost/time_dead would make this literally kills_log for deaths — but those two fields are the point of #1465 (measuring what the death cost).
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.
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.