core icon indicating copy to clipboard operation
core copied to clipboard

"Big Plays" detection

Open teuneboon opened this issue 10 years ago • 17 comments

I have a feature idea I'd like to work on, I already worked on something similar for a school project once, but that project concentrated a bit more on the server architecture due to lack of time back then.

A detection system for "Big Plays". What this entails is that in the parser you detect stuff like (near-)max range mirana arrow kills, 5 man black holes/rps into teamwipes, max range powershot kills, sunstrike multikills and x hooks hit in a row with max. x seconds of non-cooldown time. I think it would be cool to be able to see when I or my friends made big plays. Back in my school project I even worked on something that'd automatically load in the replay, record it(aka: hope directed camera had it) and then make a gif out of it(very hacky with stuff like autohotkey). Disadvantages are that it's a lot of manual coding of what "defines" a "big play" and a lot of hero specific code in the parser, also some more load on the parser side. On the other side if this is implemented well it would be relatively easy to add new "plays" and it would give yasp another cool feature no other stats site provides.

Tell me what you think or if you have some ideas to add to this plan.

teuneboon avatar Oct 29 '15 13:10 teuneboon

Yeah, I've thought about this but never tried due to the amount of specific code that has to be added. If you like you can start coming up with a list of "big plays" and detection criteria. That could be useful for a later project even if it doesn't end up getting implemented here.

Then you could write an additional "processing" function in sql branch's workParser.js, (see the existing processors) which operate on the event stream returned from the parser. It would be similar to how the "teamfights" are currently generated/detected.

I suppose we would add a new JSON field to matches (array) to store "big plays" and put a new tab on the match page.

howardchung avatar Oct 29 '15 16:10 howardchung

An aside, there's a bot project that does something very similar: https://www.reddit.com/r/DotA2/comments/30k3ne/we_made_dota_droid_a_dota_2_video_generator/

It parses replays looking for scenarios and conditions. Then it uploads replays to Youtube.

Iparke avatar Oct 29 '15 20:10 Iparke

yeah, I saw that. Unfortunately it doesn't seem to be open source.

howardchung avatar Oct 30 '15 02:10 howardchung

Alright, I'm offline for a week now, but after that I'm gonna come up with a list of plays and some ideas on how to implement it

On Fri, Oct 30, 2015, 03:17 Howard Chung [email protected] wrote:

yeah, I saw that. Unfortunately it doesn't seem to be open source.

— Reply to this email directly or view it on GitHub https://github.com/yasp-dota/yasp/issues/727#issuecomment-152392069.

teuneboon avatar Oct 30 '15 04:10 teuneboon

Started working on a list of ideas: https://github.com/teuneboon/yasp/blob/big-plays/PlayIdeas.md , Still a lot to add to it, I'm just going to add stuff when something pops up in my head or when I feel like working on the list :)

teuneboon avatar Nov 07 '15 10:11 teuneboon

You'll also need to translate these to actual replay events that you can detect. I might be able to help out with that.

The lack of concrete coupling between events may be challenging. For example, it can tell you a player got a triple kill, but you'll have to do some guesswork to know what the player killed with. Similarly, "5 man black hole" will require some guessing based on damage instances.

howardchung avatar Nov 07 '15 10:11 howardchung

Other things (like detecting max range arrow/tornado) will be very difficult to do (might have to involve looking up entity data for the arrow, or something like that). Basically I've got no idea how to do it and it could be computationally expensive.

howardchung avatar Nov 07 '15 10:11 howardchung

My idea for "max range" stuff was to do it based on player location(data I believe is available? at least it was kind of last time I looked at the replay data), and for stuff like Mirana arrow you can "cheat" and look at the stun duration to see if it was max range or not. And the 5 man black hole/rp requires guessing based on damage instances yes. I'm not sure yet which of these will be viable to implement or not, just making the list first then dropping impossible/hard stuff later

teuneboon avatar Nov 07 '15 10:11 teuneboon

The Java parser currently emits position data for each player every second. Hopefully that's enough for your needs.

While you could go into the Java parser and add logic for greater granularity I would prefer not to change it if possible (stick with logic in workParser.js)

howardchung avatar Nov 07 '15 10:11 howardchung

Location data every second should be enough for most detection, if error-rate of a certain detection is too high it can just be disabled/adjusted in a way that doesn't need to change the Java parser.

teuneboon avatar Nov 07 '15 10:11 teuneboon

@teuneboon Are you doing that ? That feature talks to me, so I can work on it

WTFKr0 avatar Dec 31 '15 14:12 WTFKr0

@WTFKr0 currently too busy to work on it, if you want you can take over. Only thing I've worked on so far is this list: https://github.com/teuneboon/yasp/blob/big-plays/PlayIdeas.md

teuneboon avatar Dec 31 '15 16:12 teuneboon

I start something. I place my code in runParse.js like the teamfight function, to get events and create a new array of "notable events" My idea is to have a list of "Init" Event (like many ults) If the event is in this list, we create a entry in the new array. Then for each kill/damage/... events following, we store data (by counting deaths/damage for example).

Finally we filtered the array to keep only the biggest events (with rules).

For example, this is an event for a sandking ult (here we can see 3 deaths in 5 sec and nearly 5k damage)

How many event of this size can we add per match (to not overload the existing data) ?

[ { time: 1597, type: DOTA_COMBATLOG_ABILITY, value: 1, attackername: npc_dota_hero_sand_king, attackerhero: true, targethero: false, attackerillusion: false, targetillusion: false, inflictor: sandking_epicenter, gold_reason: 0, xp_reason: 0, unit: npc_dota_hero_sand_king, key: sandking_epicenter, slot: 0, player_slot: 0, in_1_sec: { teamdeaths: 0, ennemydeaths: 0, damage_by_hero: 262, damage_by_ennemy: 133, damage_by_team: 262 }, in_2_sec: { teamdeaths: 0, ennemydeaths: 0, damage_by_hero: 262, damage_by_ennemy: 388, damage_by_team: 262 }, in_3_sec: { teamdeaths: 0, ennemydeaths: 0, damage_by_hero: 1152, damage_by_ennemy: 525, damage_by_team: 1152 }, in_5_sec: { teamdeaths: 0, ennemydeaths: 3, damage_by_hero: 4846, damage_by_ennemy: 618, damage_by_team: 4846 }, in_10_sec: { teamdeaths: 0, ennemydeaths: 3, damage_by_hero: 4846, damage_by_ennemy: 723, damage_by_team: 4968 } } ]

WTFKr0 avatar Jan 07 '16 16:01 WTFKr0

Hard to say without knowing how many of these we might add per match. I wouldn't want to add more than 50kb or so to each match (and we have to be careful with even that since we're parsing over 30k replays a day now).

howardchung avatar Jan 07 '16 17:01 howardchung

Ok no pb I will set a limit to know how many data max this feature add

WTFKr0 avatar Jan 07 '16 19:01 WTFKr0

I've code something, showing some examples here (at bottom) : http://yasp.kr0.fr/matches/2057619300/combat http://yasp.kr0.fr/matches/2059876026/combat http://yasp.kr0.fr/matches/2064785225/combat http://yasp.kr0.fr/matches/2070048917/combat

The conf file for detecting a big play is like that : https://github.com/WTFKr0/yasp/blob/master/json/bigplays.json

The full changes are here : https://github.com/WTFKr0/yasp/compare/6e79999b04fecde3aa99a0b1a64fd73fd21607a7...a41ec7f825b3191b87203847c28fc13b085c0c0b

Need to work more on that, but don't have much time :/

WTFKr0 avatar Jan 20 '16 12:01 WTFKr0

seems kind of similar to @albertcui 's #663 .

howardchung avatar Jan 20 '16 15:01 howardchung