Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18

Thread: This is how to interpret the barracks_status and tower_status results from the API

  1. #11
    Basic Member MuppetMaster42's Avatar
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    585
    Quote Originally Posted by Razumov View Post
    snip
    back when this was written the barracks_status fields were a broken copy of each other.
    It was hard to tell exactly what was what for what team....

    If I remember rightly - when it was deciphered (all that time ago.. I forget who did the barracks status field..) it was only working for the dire..
    (and deciphering it was made even harder by the fact that 9 times out of 10.. it was either all racks gone or none gone for dire... vary rarely was it certain combinations..)

    When it started working - we assumed that the two teams would work in the same way...
    but from what you're saying - apparently the radiant is reversed.
    i'll have a look when I get home from work and update things as necessary.

  2. #12
    Basic Member
    Join Date
    Oct 2011
    Posts
    72
    Getting conflicting results on the tower_status number too.

    Match ID: 162608771
    tower_status_radiant: 1846
    binary: 11100110110
    Watching replay: All tier 4 and tier 3 remaining. Tier 2 top and mid remaining.

    tower_status_dire: 256
    binary: 00100000000
    Watching replay: Tier 3 bot only one remaining

    This conflicts with the original post in the thread but is the same as what is on the API thread on the teamfortress wiki:

    Ancient Top
    Ancient Bottom
    Bottom Tier 3
    Bottom Tier 2
    Bottom Tier 1
    Middle Tier 3
    Middle Tier 2
    Middle Tier 1
    Top Tier 3
    Top Tier 2
    Top Tier 1
    datdota.com -- Dota 2 Stats for the Professional Scene

  3. #13
    Basic Member MuppetMaster42's Avatar
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    585
    interesting.. i thought that I got the towers correct when I worked it out all those months ago (9 months ago now)...
    you're the first one to have corrected it! lol

    if it's correct on the wiki, then you are correct on both counts..
    I clearly mixed it up when I did it!

    I have updated my faq sticky with links to the wiki.

  4. #14
    Basic Member
    Join Date
    Oct 2011
    Posts
    72
    Finally got around to implementing this. I'm using tables with images rather than than images on a map. Example: http://www.datdota.com/match.php?q=223010600&p=towers

    Here's the php code (assumes that $towerRadiant is the "radiant_tower_status" from the API etc):
    Code:
     $radTowerBin = sprintf('%011b', $towerRadiant );
            $direTowerBin = sprintf('%011b', $towerDire );
            $radRaxBin = sprintf('%08b', $raxRadiant );
            $direRaxBin = sprintf('%08b', $raxDire );
    
            if( $radWin == 1 ){
                $winnerArray[0] = "<img src=\"images/map/radiant_ancient.png\" alt=\"1\">";
                $winnerArray[1] = "<img src=\"images/map/big_x.png\" alt=\"1\">";
            } else {
                $winnerArray[0] = "<img src=\"images/map/big_x.png\" alt=\"1\">";
                $winnerArray[1] = "<img src=\"images/map/dire_ancient.png\" alt=\"1\">";
            }
            for( $i = 0; $i < 11; $i++ ){
                if( $radTowerBin[$i] == 1 ){
                    $radTowerArray[$i] = "<img src=\"images/map/radiant_tower.png\" alt=\"1\">";  
                } else {
                    $radTowerArray[$i] = "<img src=\"images/map/big_x.png\" alt=\"1\">";
                }
                if( $direTowerBin[$i] == 1 ){
                    $direTowerArray[$i] = "<img src=\"images/map/dire_tower.png\" alt=\"1\">";
                } else {
                    $direTowerArray[$i] = "<img src=\"images/map/big_x.png\" alt=\"1\">";
                }
            }
            for( $i = 2; $i < 8; $i++ ){
                if( $radRaxBin[$i] == 1 ){
                    $radRaxArray[$i-2] = "<img src=\"images/map/radiant_rax.png\" alt=\"1\">";  
                } else {
                    $radRaxArray[$i-2] = "<img src=\"images/map/big_x.png\" alt=\"1\">";
                }
                if( $direRaxBin[$i] == 1 ){
                    $direRaxArray[$i-2] = "<img src=\"images/map/dire_rax.png\" alt=\"1\">";
                } else {
                    $direRaxArray[$i-2] = "<img src=\"images/map/big_x.png\" alt=\"1\">";
                }
            }
            
            //rax, first 2 are not used, not using them in the array
            //bottom ranged, bottom melee, mid ranged, mid melee, top ranged, top melee
            ?>
    <h3>Towers</h3>
    <table class="table table-bordered table-condensed">
        <tr><th>Side</th><th>Tier 1 Top</th><th>Tier 1 Mid</th><th>Tier 1 Bot</th>
            <th>Tier 2 Top</th><th>Tier 2 Mid</th><th>Tier 2 Bot</th>
            <th>Tier 3 Top</th><th>Tier 3 Mid</th><th>Tier 3 Bot</th>
            <th>Tier 4 Top</th><th>Tier 4 Bot</th>
        </tr>
        <tr><td>Radiant</td><td><?php echo $radTowerArray[10]; ?></td><td><?php echo $radTowerArray[7]; ?></td><td><?php echo $radTowerArray[4]; ?></td>
            <td><?php echo $radTowerArray[9]; ?></td><td><?php echo $radTowerArray[6]; ?></td><td><?php echo $radTowerArray[3]; ?></td>
            <td><?php echo $radTowerArray[8]; ?></td><td><?php echo $radTowerArray[5]; ?></td><td><?php echo $radTowerArray[2]; ?></td>
            <td><?php echo $radTowerArray[0]; ?></td><td><?php echo $radTowerArray[1]; ?></td>
        </tr>
        <tr><td>Dire</td><td><?php echo $direTowerArray[10]; ?></td><td><?php echo $direTowerArray[7]; ?></td><td><?php echo $direTowerArray[4]; ?></td>
            <td><?php echo $direTowerArray[9]; ?></td><td><?php echo $direTowerArray[6]; ?></td><td><?php echo $direTowerArray[3]; ?></td>
            <td><?php echo $direTowerArray[8]; ?></td><td><?php echo $direTowerArray[5]; ?></td><td><?php echo $direTowerArray[2]; ?></td>
            <td><?php echo $direTowerArray[0]; ?></td><td><?php echo $direTowerArray[1]; ?></td>
        </tr>
    </table>
    <br>
    <h3>Barracks</h3>
    <table class="table table-bordered table-condensed">
        <tr><th>Side</th><th>Bot Ranged Rax</th><th>Bot Melee Rax</th>
            <th>Mid Ranged Rax</th><th>Mid Melee Rax</th>
            <th>Top Ranged Rax</th><th>Top Melee Rax</th>
        </tr>
        <tr><td>Radiant</td><td><?php echo $radRaxArray[0]; ?></td><td><?php echo $radRaxArray[1]; ?></td>
            <td><?php echo $radRaxArray[2]; ?></td><td><?php echo $radRaxArray[3] ?></td>
            <td><?php echo $radRaxArray[4]; ?></td><td><?php echo $radRaxArray[5]; ?></td>
        </tr>
        <tr><td>Dire</td><td><?php echo $direRaxArray[0]; ?></td><td><?php echo $direRaxArray[1]; ?></td>
            <td><?php echo $direRaxArray[2]; ?></td><td><?php echo $direRaxArray[3] ?></td>
            <td><?php echo $direRaxArray[4]; ?></td><td><?php echo $direRaxArray[5]; ?></td>
        </tr>
    </table>
    <br>
    <h3>Map</h3>
    <table class="table table-bordered table-condensed">
        <tr><td><?php echo $river; ?></td><td></td><td><?php echo $direTowerArray[10]; ?></td>     <td></td><td><?php echo $direTowerArray[9]; ?></td><td></td>     <td><?php echo $direTowerArray[8]; ?></td><td><?php echo $direRaxArray[4]; ?></td><td></td>     <td></td><td></td><td></td></tr>
        <tr><td></td><td><?php echo $river; ?></td><td></td>     <td></td><td></td><td></td>     <td></td><td><?php echo $direRaxArray[5]; ?></td><td></td>     <td><?php echo $direTowerArray[0]; ?></td><td><?php echo $winnerArray[1]; ?></td><td></td></tr>
        <tr><td><?php echo $radTowerArray[10]; ?></td><td></td><td><?php echo $river; ?></td>     <td></td><td></td><td></td>     <td></td><td></td><td><?php echo $direRaxArray[2]; ?></td>     <td></td><td><?php echo $direTowerArray[1]; ?></td><td></td></tr>
        
        <tr><td></td><td></td><td></td>     <td><?php echo $river; ?></td><td></td><td></td>     <td></td><td></td><td><?php echo $direTowerArray[5]; ?></td>     <td><?php echo $direRaxArray[3]; ?></td><td></td><td></td></tr>
        <tr><td><?php echo $radTowerArray[9]; ?></td><td></td><td></td>     <td></td><td><?php echo $river; ?></td><td></td>     <td></td><td><?php echo $direTowerArray[6]; ?></td><td></td>     <td></td><td><?php echo $direRaxArray[0]; ?></td><td><?php echo $direRaxArray[1]; ?></td></tr>
        <tr><td></td><td></td><td></td>     <td></td><td></td><td><?php echo $river; ?></td>     <td><?php echo $direTowerArray[7]; ?></td><td></td><td></td>     <td></td><td></td><td><?php echo $direTowerArray[2]; ?></td></tr>
        
        <tr><td><?php echo $radTowerArray[8]; ?></td><td></td><td></td>     <td></td><td></td><td><?php echo $radTowerArray[7]; ?></td>     <td><?php echo $river; ?></td><td></td><td></td>     <td></td><td></td><td></td></tr>
        <tr><td><?php echo $radRaxArray[4]; ?></td><td><?php echo $radRaxArray[5]; ?></td><td></td>     <td></td><td><?php echo $radTowerArray[6]; ?></td><td></td>     <td></td><td><?php echo $river; ?></td><td></td>     <td></td><td></td><td><?php echo $direTowerArray[3]; ?></td></tr>
        <tr><td></td><td></td><td><?php echo $radRaxArray[2]; ?></td>     <td><?php echo $radTowerArray[5]; ?></td><td></td><td></td>     <td></td><td></td><td><?php echo $river; ?></td>     <td></td><td></td><td></td></tr>
        
        <tr><td></td><td><?php echo $radTowerArray[0]; ?></td><td></td>     <td><?php echo $radRaxArray[3]; ?></td><td></td><td></td>     <td></td><td></td><td></td>     <td><?php echo $river; ?></td><td></td><td><?php echo $direTowerArray[4]; ?></td></tr>
        <tr><td></td><td><?php echo $winnerArray[0]; ?></td><td><?php echo $radTowerArray[1]; ?></td>     <td></td><td><?php echo $radRaxArray[0]; ?></td><td></td>     <td></td><td></td><td></td>     <td></td><td><?php echo $river; ?></td><td></td></tr>
        <tr><td></td><td></td><td></td>     <td></td><td><?php echo $radRaxArray[1]; ?></td><td><?php echo $radTowerArray[2]; ?></td>     <td></td><td><?php echo $radTowerArray[3]; ?></td><td></td>     <td><?php echo $radTowerArray[4]; ?></td><td></td><td><?php echo $river; ?></td></tr>
    </table>
    datdota.com -- Dota 2 Stats for the Professional Scene

  5. #15
    Basic Member scottrick's Avatar
    Join Date
    Dec 2011
    Location
    Minnesota, USA
    Posts
    138
    Just looking at this, and this order still isn't *quite* correct. The ancient top/bottom towers are swapped and should be:

    Ancient Bottom
    Ancient Top
    Bottom Tier 3
    Bottom Tier 2
    Bottom Tier 1
    Middle Tier 3
    Middle Tier 2
    Middle Tier 1
    Top Tier 3
    Top Tier 2
    Top Tier 1

    This makes it a little bit more aesthetically pleasing, with bottom always coming before top!

  6. #16
    Quote Originally Posted by scottrick View Post
    Just looking at this, and this order still isn't *quite* correct. The ancient top/bottom towers are swapped and should be:

    Ancient Bottom
    Ancient Top
    Bottom Tier 3
    Bottom Tier 2
    Bottom Tier 1
    Middle Tier 3
    Middle Tier 2
    Middle Tier 1
    Top Tier 3
    Top Tier 2
    Top Tier 1

    This makes it a little bit more aesthetically pleasing, with bottom always coming before top!
    Have you confirmed this experimentally? I trust you, so if you have, can you update the TF2 wiki here: https://wiki.teamfortress.com/wiki/W...s#Tower_Status. It claims that Top and Bottom are opposite of yours.

  7. #17
    Basic Member scottrick's Avatar
    Join Date
    Dec 2011
    Location
    Minnesota, USA
    Posts
    138
    Yeah I have; I based my original implementation on that wiki page, and I noticed the ancient towers were incorrect. To be sure, I found two different matches (one each for dire and radiant) with one ancient tower remaining and verified the tower status by watching the replay in the dota2 client. What I posted is correct, and also matches dotabuff as well.

    I updated the wiki page.
    Last edited by scottrick; 12-22-2015 at 07:10 AM.

  8. #18
    Basic Member
    Join Date
    Dec 2013
    Posts
    1
    How to interpret the building_state from /IDOTA2Match_570/GetTopLiveGame ?
    Code:
    "activate_time":1530222336,
    "deactivate_time":0,
    "server_steam_id":"90115488091499530",
    "lobby_id":"25671396156219670",
    "league_id":0,
    "lobby_type":7,
    "game_time":1921,
    "delay":120,
    "spectators":2338,
    "game_mode":22,
    "average_mmr":6924,
    "sort_score":9762,
    "last_update_time":1530224384,
    "radiant_lead":-6703,
    "radiant_score":42,
    "dire_score":42,
    "players":[...],
    "building_state":5374170

Posting Permissions

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