web icon indicating copy to clipboard operation
web copied to clipboard

Courier kills log/story are wrong

Open borsund opened this issue 4 years ago • 4 comments

Current Behavior If you check story or log tab the courier kills are wrong. Example: https://www.opendota.com/matches/5241497004/story

In that match I was playing as Earthshaker (Dire) and killed several enemy couriers (5 according to Farm tab). However, in the log and story tab it says "Dire's courier was killed", which is wrong.

Expected behavior/code It's "Radiant's courier was killed" at least. At most, courier killer should also be displayed

Additional context/Screenshots https://www.opendota.com/matches/5241497004

borsund avatar Feb 14 '20 12:02 borsund

Hmm, @mdiller might know why this is (although I could also probably figure it out). Maybe something changed about the team field on courier kill events?

howardchung avatar Feb 15 '20 08:02 howardchung

I took a look at what the code is looking for and at what the data is showing and I'm not sure what the team field on the courier kill events is supposed to represent. The code seems to be checking for just obj.team === 2 which would mean that it thinks team = 2 means it was radiant's courier. However, I checked the data and there are a lot of different values. In @borsund 's match, they all have a team value of 6, but in a recent match that I played where there were several courier kills on both sides, the values were all over the place: 0, 4, 0, and -1.

I checked in odota/core briefly and it's confusing there too. In the place where it computes scenarios, it has this line const isRadiant = condition.team === 3;. And in what looks like the place that processes and produces the chat events, it has this line: team: e.player1, which seems to imply that it's a player id instead of a teamid, but I don't know of any way to reference players that ends up with a -1.

@howardchung do you know how this system is supposed to work, or have any ideas of what the numbers mean? The only thing I can think of is maybe its 0-9 in a indexed version of a player_slot, and -1 means a hero didn't get the kill. It would be more useful to know who's courier was killed though, then even if a hero didn't get the last hit we could know which courier died. I could take another look later by analyzing more matches and seeing if I can find a relationship between who killed the courier and what the data says but it doesn't seem super straight forward.

mdiller avatar Feb 17 '20 20:02 mdiller

Yeah unfortunately it's not very consistent and team uses different values in different places. If possible I'd try to track down the courier events to see if there's a consistent team indicator.

I see a comment: // player1 = team that lost courier? (2/3)

If we dump e in that function maybe we can find a field for the team. . .

Which seems to suggest that at some point that field held the data on which team lost the courier, but possibly it was changed later to reflect the player who killed the courier.

howardchung avatar Feb 17 '20 20:02 howardchung

Yeah that might make sense. Especially since the chat event in dota now shows who killed it and who's was killed, maybe both pieces of information are available now. Would be nice to grab and pass on both.

mdiller avatar Feb 17 '20 20:02 mdiller

Closed via https://github.com/odota/web/commit/00e10a143be59c24319674d6d03f9aff86cbc4eb

builder-247 avatar Oct 01 '22 07:10 builder-247