Results 1 to 10 of 18

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

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

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

    tower_status_dire
    tower_status_radiant
    barracks_status_dire
    barracks_status_radiant

    These fields in the GetMatchDetails request contain an 11 bit or 6 bit integer that when represented in binary represents whether a building is dead or alive.
    1 = alive. 0 = dead.
    There are 11 towers, so there are 11 bits for the tower_status fields.


    For example, if barracks_status_dire is 1336, first we represent 1336 in binary, which is 10100111000.

    Now we take each individual 1 and 0, from left to right, and process them in the following order.

    Code:
    1	ANCIENT TOP
    2	ANCIENT BOTTOM
    3	TOP 3
    4	TOP 2
    5	TOP 1
    6	MIDDLE 3
    7	MIDDLE 2
    8	MIDDLE 1
    9	BOTTOM 3
    10	BOTTOM 2
    11	BOTTOM 1
    Credit to the interpret order goes to MuppetMaster42

    Let's use it on the 11 bit integer 1336, which is the binary value 10100111000

    Code:
    1	ANCIENT TOP	1	Alive
    2	ANCIENT BOTTOM	0
    3	TOP 3		1	Alive
    4	TOP 2		0
    5	TOP 1		0
    6	MIDDLE 3	1	Alive
    7	MIDDLE 2	1	Alive
    8	MIDDLE 1	1	Alive
    9	BOTTOM 3	0
    10	BOTTOM 2	0
    11	BOTTOM 1	0

    The TOP and BOTTOM positions are always the same, for Dire and Radiant.

    The barracks_status values are the same except there are only 6 barracks, so the bits are

    Code:
    1	TOP RANGED
    2	TOP MELEE
    3	MID RANGED
    4	MID MELEE
    5	BOT RANGED
    6	BOT MELEE
    Good luck!
    Last edited by walkingcarpet; 10-05-2012 at 10:23 AM. Reason: Fixed formatting, thanks Shinkai

Posting Permissions

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