Results 1 to 5 of 5

Thread: 'ability_upgrades: time' isn't useful, workaround?

  1. #1
    Basic Member
    Join Date
    Mar 2015
    Posts
    3

    'ability_upgrades: time' isn't useful, workaround?

    Hi, so I'm teaching myself D3.js and using the dota web api as a tool for learning given that I like dota2. Right now I'm creating an experience difference over time graph as you see on a lot of dota data vis sites like Dotabuff, but I'm having trouble with the 'ability_upgrades: time' values. It seems that rather than tracking the ingame clock, like 'first_blood_time' and 'duration', the value actually tracks the replay time (includes picking phase and pauses), which isn't helpful at all. Obvious consequences are that my data tracks a period longer than the game time (unless the game is super long) and distorts my time axis when there are long pauses.

    The only reference to this problem I've found is this forum post: http://dev.dota2.com/showthread.php?t=105074

    I notice that Dotabuff's experience graph correctly tracks the ingame clock, whereas Dotaflame's does not. Compare this game, which is just 46min long, but has 15 minutes of pauses:
    DotaFlame: http://dotaflame.com/match/detail/330208592 (~60min experience graph - wrong)
    Dotabuff: http://www.dotabuff.com/matches/330208592 (46min experience graph - correct)

    So what is the workaround here? I'm completely stumped.
    Last edited by humean; 03-17-2015 at 11:48 AM.

  2. #2
    Basic Member MuppetMaster42's Avatar
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    585
    pro matches are a bad representation of how the two systems work.
    I'm pretty sure dotabuff parses replays for all professional matches, which means they'd accurately show the graph because they know exact times.

    Also, if you wanted, you could work out some form of kludge in order to make it look like it was correctly scaled.

    I.e.
    Code:
    var matchData = getData(); // do this however
    
    // figure out the ability time limits
    var skillTime = { max: 0, min: Number.MAX_VALUE }
    matchData.players.forEach(function(p) {
        p.ability_upgrades.forEach(function(a) {
            skillTime.max = Math.max(skillTime.max, a.time);
            skillTime.min = Math.min(skillTime.min, a.time);
        });
    });
    
    // calculate the rescale factor so that the ability times fit into the match duration
    var skillDuration = skillTime.max - skillTime.min;
    var kludge = matchData.duration / skillDuration;
    
    // rescale the ability times
    matchData.players.forEach(function(p) {
        p.ability_upgrades.forEach(function(a) {
            a.time -= skillTime.min; // make ability timer start at 0
            a.time *= kludge; // rescale
        });
    });

  3. #3
    Basic Member
    Join Date
    Mar 2015
    Posts
    3
    Yeah, I've been trying to work out a 'kludge' to workaround it, so that gives me some ideas (very new at this stuff); so thanks.

    I've had some big differences between my data and dotabuff with pub matches as well (I suspected dotabuff must parse the replays for pro matches, but I very much doubt they do it for non-subscribing pub players), with up to 8 minutes difference in one case between the latest level up and the actual game duration. I can't find my 8 minute example now, but here is one game with a 4 minute difference that dotabuff somehow gets right:

    http://www.dotabuff.com/matches/1314391886

    http://imgur.com/gallery/ekaK9/

    I'm beginning to think that dotabuff might have found an effective kludge to get around this, or just scaled the inaccurate data to the game duration hoping nobody will notice.
    Last edited by humean; 03-17-2015 at 05:32 PM.

  4. #4
    Basic Member
    Join Date
    Mar 2015
    Posts
    3
    yeah, I think dotabuff is cheating here. They simply cut-off the last few datapoints to make it fit the game duration. Their final exp advantage value is wrong as you can see the images I linked.

  5. #5
    Basic Member MuppetMaster42's Avatar
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    585
    that's actually hilarious.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •