Dota Parser

CDP – CTS Dota Parser

Dota 6.74 Map data: (download) (CDP 1.4.4 ships with 6.73 data)

Update 1.4.4 (6.1.2012) : 6.73 data and images
Update 1.4.3 (14.5.2011) : 6.71 & 6.72 data and images
Update 1.4.2 (26.12.2010) : 6.70 data and images
Update 1.4.1 (11.11.2010) : 6.69 data and images
Update 1.4 (16.8.2010) : 6.68, Switch & Debugging
Update 1.3.1 (1.4.2010) : 6.67 and 6.66 data and images
Update 1.3 (7.1.2010) : 6.65, SP & Debugging
Update 1.2.2 (27.10.2009) : Debugging skilling & 6.64
Update 1.2.1 (8.10.2009) : Handling morphers
Update 1.2 (5.10.2009) : Hero – Player – Skill handling
Update 1.1.3 (10.9.2009) : Ban / Pick duplication bug.
Update 1.1.2 (7.7.2009) : 64 Bit memory / 6.61
Update 1.1.1 (19.6.2009) : Decompression tweak.
Update 1.1 (12.6.2009) : Added 6.60 support.

Discussion at Play Dota Forums.

Download: CDP Latest (Zipped / 1.4.4)
Sample: Sample Parsed Replay

Patches


Patch 1.1.1 to 1.1.2
Patch 1.1.2 to 1.1.3
Patch 1.1.3 to 1.2
Patch 1.2 to 1.2.1 ( 16 kb )
Patch 1.2.1 to 1.2.2 ( 74 kb )
Patch 1.2.2 to 1.3 ( 469 kb )
Patch 1.3 to 1.3.1 ( 195 kb )
Patch 1.3 to 1.4 ( 274 kb )
Patch 1.4 to 1.4.1 ( 182 kb )
Patch 1.4.1 to 1.4.2 ( 407 kb )
Patch 1.4.2 to 1.4.3 ( 116 kb )
Patch 1.4.3 to 1.4.4 ( 263 kb )

About

CDP CTS Dota Parser is an open source Dota Replay parser written in PHP,
meant to be used with WC3 DoTA replays of version 6.59 and higher.

Quick Feature List
  • Supports CM mode and properly lists bans and picks
  • Supports swapping
  • Supports switching
  • Supports shuffle player mode
  • Displays end game statistics that include
    - Hero Kills / Deaths / Assists
    - Creep Kills / Denies
    - Neutrals killed
    – End game gold
    - End game Inventory
    - POTM Arrow Accuracy
    - Pudge Hook Accuracy
  • Tries to automatically determine the winning side
  • Categorizes player’s actions and calculates his APM excluding picking time.
  • Generates time ordered lists of player’s obtained items and learned skills.
  • Displays colored chat
  • XML database of Items, Skills and Heroes.
  • Easy storing and restoring of parsed replay data with php serialization
Installation
  1. Extract the files.
  2. Ensure the structure is as follows:
  3. ./*.php *.css - All the php / css files
    ./maps/*.xml - All the XML data files
    ./images - All the icons
    ./replays - Folder for storing replays and replay info

  4. Make sure the ./replays folder is writable.
Usage

Use the ./upload_reply.php file to upload replays or
write your own interface, using the included
upload_replay.php file as a guide.

All the replays are parsed upon the first view and a
serialized representation of the replay is stored as
a REPLAY_ID.txt file. Upon further viewing the replay
data is only obtained from the serialized object.

All the replays are saved as unix_timestamp.w3g files
while conserving their original name in the $replay->extra
variable, making it possible to let the user download
the replay with the uploader’s original filename.

Credits
  • Julas – Original wc3 php parser
  • rush4hire – Dota port of Jula’s parser
  • esby – 6.56 XML Structure / Data
  • Tedi Rachmadi – Reshine

Old versions:

Changelog:

  1. 1.4.4 – 6.1.2012
    • Features:

      • Added 6.73 data and images.
  2. 1.4.3 – 14.5.2011
    • Features:

      • Added 6.71 & 6.72 data and images.
  3. 1.4.2 – 26.12.2010
    • Features:

      • Added 6.70 data and images.
  4. 1.4.1 – 10.11.2010
    • Features:

      • Added 6.69c data and images.
  5. 1.4 – 16.8.2010
    • Features:

      • 6.68 images / map data
      • Handles new CM mode 3/2 split
      • Added support for Switch
      • Added an AUTO mode for determening the winner, check
        view_replay.php and upload_replay.php to get the idea
        on how to implement it. It works most of the time, only
        fails when the saver leaves unexpectedly or prematurely.
      • Added POTM Arrow Accuracy data (see “Show more” in a replay with potm)
      • Added Pudge Hook Accuracy data (see “Show more” in a replay with pudge)
      • Added Player Leaving information (see “Show more” in a replay)
    • Various:

      • Tweaked leveling and skill level accuracy for duplicated actions non-owned stats skilling.
    • Bugs:

      • Fixed a bug with skilling non-owned or SP mode owned morphing heroes (ie. Batrider, KOTL)
      • Fixed certain wrong skill IDs in 6.67, 6.68 XML files for Panda, Tiny, Leoric, Gorgon, Lanaya, Ursa, Enigma and Doom Bringer
      • Some other minor bugs.
  6. 1.3.1 – 1.4.2010
    • Features:

      • Added 6.67c and 6.66 data and images.
  7. 1.3 – 7.1.2010
    • Features:

      • 6.65 images / map data.
      • Now properly remaps names in SP mode.
    • Various:

      • Added some base code for handling various drafting modes such as CD and CM, but not finished yet due to 6.65′s buggy replay data serving.
    • Bugs:

      • Fixed an issue with SD mode picks before 15sec.
      • Changed all “Batrider (firefly)” names to “Batrider” in 6.60 to 6.65 xml files.
      • Changed all “Flesh Golem” names to “Undying” in 6.59 to 6.65 xml files.
      • Fixed an issue with failed handling of random hero picks in CM mode.
  8. 1.2.2 – 27.10.2009
    • Bugs:

      • Added delayed skilling for handling first skills.
      • Fixed an error caused by 6.64 & skills.
  9. 1.2.1 – 8.10.2009
    • Bugs:

      • Fixed a problem with ‘morphing’ heroes.
  10. 1.2 – 6.10.2009
    • Features:

      • 6.63 images / map data.
    • Various:

      • Recoded the way Hero – Player – Skills are related.
    • Bugs:

      • Fixed various skill assignment bugs.
  11. 1.1.3 – 10.9.2009
    • Bugs:

      • Fixed an issue with duplicated ban / pick packets.
  12. 1.1.2 – 7.7.2009
    • Features:

      • The script now tries to detect the map version and uses the appropriate .xml file from the maps/ folder.
      • Added some config options to tools.php regarding version handling
      • 6.61 – Weaver’s remade ability
    • Various:

      • Disabled download logging by default. (Channged LOG_DOWNLOADS to false in download.php)
    • Cosmetics:

      • Unified player colors.
    • Bugs:

      • Increased memory_limit to work with 64 bit *nix systems.
      • Added some extra level 25 limit detection.
  13. 1.1.1 – 19.6.2009
    • Bugs:

      • Tweaked zlib decompressing to allow parsing of modified replays
  14. 1.1 – 12.6.2009
    • Features:

      • Added 6.60 XML data to the /maps folder
    • Various:

      • Tweaked the JS / HTML display
    • Bugs:

      • Proper parsing for Batrider’s two hero ID internals
      • Fixed Invoker leveling / skills
      • Fixed XML Parser oddities
  15. 1.0 – 27.2.2009
    • Clean up
  • SomeOne
    #51 written by SomeOne 1 year ago

    AWSOME Seven!! I wish I could really handle .php as good as you :(
    I really want to learn about it… But I can’t find someone who could tutor me… learning from mr.gogo doesn’t result very well ^^;
    Thanks anyway seven, you’re the best! :D

  • Fatal error
    #52 written by Fatal error 1 year ago

    Fatal error: Call to a member function getName() on a non-object in c:\home\localhost\www\rp\reshine.php on line 720

    $heroName = $GLOBALS['xml_data']->HashMap[$heroId]->getName();

    replace

    if(isset($heroId))
    $heroName = $GLOBALS['xml_data']->HashMap[$heroId]->getName();

  • SomeOne
    #53 written by SomeOne 1 year ago

    okay, the player switched… but the hero stay o.O
    any idea to fix this??

  • SomeOne
    #54 written by SomeOne 1 year ago

    wait, no… the player’s wat not switched @.@
    it’s stuck at the same place…
    not moving anywhere… but the hero switched…

  • SomeOne
    #55 written by SomeOne 1 year ago

    never mind @.@ just fixed it…

  • Excellent
    #56 written by Excellent 1 year ago

    Hey, i got some problems here…
    Your codes

    // For handling SWITCH and leave time / result / items and actions
    $this->players[$wc3pid]['time'] = $wc3idToTime[$renamedWC3PlayerID];
    $this->players[$wc3pid]['leave_result'] = $wc3idToLeaveResult[$renamedWC3PlayerID];
    $this->players[$wc3pid]['items'] = $wc3idToItems[$renamedWC3PlayerID];
    $this->players[$wc3pid]['actions_details'] = $wc3idToActionsDetails[$renamedWC3PlayerID];
    $this->players[$wc3pid]['actions'] = $wc3idToActions[$renamedWC3PlayerID];

    This code make the player stuck on the same place when they’re switching…
    So I make it to these

    // For handling SWITCH and leave time / result / items and actions
    $this->player[$wc3pid]['time'] = $wc3idToTime[$renamedWC3PlayerID];
    $this->player[$wc3pid]['leave_result'] = $wc3idToLeaveResult[$renamedWC3PlayerID];
    $this->player[$wc3pid]['items'] = $wc3idToItems[$renamedWC3PlayerID];
    $this->player[$wc3pid]['actions_details'] = $wc3idToActionsDetails[$renamedWC3PlayerID];
    $this->player[$wc3pid]['actions'] = $wc3idToActions[$renamedWC3PlayerID];

    By erasing the S from Players it worked for switching, but ruining the whole SP system… Can you help me on how to fix this??

  • SomeOne
    #57 written by SomeOne 1 year ago

    Warning: Invalid argument supplied for foreach() in /home/a7858869/public_html/view_replay.php on line 357

  • VioleN
    #58 written by VioleN 1 year ago

    Can you make the replays commentable?

  • Seven
    #59 written by Seven 1 year ago


    SomeOne:

    Warning: Invalid argument supplied for foreach() in /home/a7858869/public_html/view_replay.php on line 357

    Can you upload or send the replay please.

    @VioleN:
    Sorry but no, I’m focusing on the core parser, while the front-end is up to individual implementations.

  • Excellent
    #60 written by Excellent 1 year ago

    @Seven
    Sorry, I think it was a false alarm… it only happens when the hero pick no skill at all… Anyway, how to fix excellent problem?? I was wandering about it also…

  • Excellent
    #61 written by Excellent 1 year ago

    “okay, the player switched… but the hero stay o.O
    any idea to fix this??”

    i got a dead end T.T

  • Excellent
    #62 written by Excellent 1 year ago

    when the player switched place, the hero also need to be switch, any idea how to fix this?

  • Farman Ahmed
    #63 written by Farman Ahmed 1 year ago

    how can i make an html page of the parser plz give me any tutorial

  • Farman Ahmed
    #64 written by Farman Ahmed 1 year ago

    hey how to merge it with the html file i want to add some google ads and my template

  • hello
    #65 written by hello 1 year ago

    hello

    i come from china

    can you make a index that preview all the uploaded replays?

    i think the upload_replay.php is not fit for index.

    add a search function on the index will help so much.

    thank you for your work

  • Excellent
    #66 written by Excellent 1 year ago

    @Hello:
    Just copy paste your upload_replay.php and rename it to index, keep your upload_replay.php file in the folder though… It will do…

  • hello
    #67 written by hello 1 year ago

    i meant that can you give a page to view all uploaded replays?

  • hello
    #68 written by hello 1 year ago
  • Flayra
    #69 written by Flayra 1 year ago

    I was wondering where you get the XML data from. I know you can export it through various tools from the map, but do you maintain the .xml files included with CDP yourself or get them somewhere else?

  • Help me
    #70 written by Help me 1 year ago

    MY Parser no Upload in MODE -cm

  • hello
    #71 written by hello 1 year ago

    i think use mysql as database will enhance this program.

    only file (.txt) will cause problem.

    some advice.

  • Excellent
    #72 written by Excellent 1 year ago

    it took years for me to open your link…
    toying around with this part might help…
    <?php
    if( $print_info ) {
    echo ('

    Compact replay info

    ‘);
    $replay->print_team_heroes(0);

    echo (‘
    extra['original_filename'].’” style=”display: inline;”> »   Download «
    » More Info «
    ‘);
    $replay->print_team_heroes(1);
    echo (‘

    ‘);
    }
    ?>

    if you could modify it to show all the replays you have in your folder i think it’ll work o.O
    (I’m only a newbie, can’t give an advanced tips, and my advice is not guaranteed >.<)

  • Excellent
    #73 written by Excellent 1 year ago

    Seven, can you e-mail me? Someone would like to use your parser for a pretty big gaming community… but, with extra features…

  • Excellent
    #74 written by Excellent 1 year ago
  • SolariiS
    #75 written by SolariiS 1 year ago

    Exist a bug on -CM mode, no parse this on 68c

    fix this :D

    good work

  • Farman Ahmed
    #76 written by Farman Ahmed 1 year ago

    Hey there, Excellent
    I am really confused to see my replays in their orignal name…
    And the folder of replays where they are saved, i wanted to see as one list of replay folder with their orignal names.

    can u send me the file to my email address
    farman_ahmed2007@hotmail.com

  • ivan
    #77 written by ivan 1 year ago

    Hello,
    Simple question:
    is there any chance to parse units coordinates?

    Thanks.

  • Xan
    #78 written by Xan 1 year ago

    Can anyone update items, heros and images for 6.69 please?

  • Seven
    #79 written by Seven 1 year ago

    I updated the main post with the version 1.4.1, which is just an update for 6.69c, albeit a tad late.

    @ivan: There is a way to parse coordinates, but I haven’t researched it enough and at the moment the only changes I’m making are critical bugs and version updates, sorry.

    @hello: agreed, you should use store results you obtain with the parser in a database on a production site.

    @Flayra: I maintain the .xml data myself and update it via game testing / extraction by using the DEBUG options in CDParser and looking for Unknown ID’s on new versions of Dota mostly.

    As far as indexing goes, you should implement it yourself… I did release some quick and dirty version some time ago, you can see it in this comment on this very page.

  • uuwar.com
    #80 written by uuwar.com 1 year ago

    have some question

    some Features can you add?
    1. add the message when hero dead or build Destroyed
    for example
    12:13 A hero killed B hero
    13:22 Sentinel’s bulid Destroyed

    2. add the hero lane
    TOP LANE
    MIDDLE LANE
    BOTTOM LANE
    GANK/GUNGLE

  • Odd
    #81 written by Odd 1 year ago

    hello, i implemented this project on a webserver and when i upload a replay it stays on the same page and the upload is already done but the page is full of tags and texts i understood it was supposed to be a summary of the uploaded replay, any ideas?

    I have some PHP experience, tried skimming through the code and i could not understand much, i want to make some way of DB indexing using MYSQL and php, would you please give some notes or ideas about the names of the variables that contain the game information and if its possible, where would you suggest to put that code( i know that the replay would be parsed after its first view, so maybe it should be placed in view_replay.php?)

    Regards,
    ODD

  • Odd
    #82 written by Odd 1 year ago

    the tags are tags and there is texts between them.

  • Xan
    #83 written by Xan 1 year ago

    New DotA 6.70 Released, new heros + items.

  • Seven
    #84 written by Seven 1 year ago

    @Odd: Sorry for the late reply and lack of documentation, but if you know PHP your best bet is to look at the included view_replay.php which is intended as an example / primer. Other than that you can look at xml_parser.php and tools.php to see the Class definitions and do a formatted var_dump on the $replay data.

    I updated the main post with version 1.4.2 which adds 6.70 data and images. There’s a patch available as well, it’s just images and an .xml file.

  • Users
    #85 written by Users 1 year ago

    Detecting Game Log(Events… Like kill & gold trade)
    And fixs the switch system would be nice seven… Sometime when we switch the hero icon does not switched…

  • Xan
    #86 written by Xan 1 year ago

    Another DotA Release: 6.71b!

  • Seven
    #87 written by Seven 1 year ago

    Here’s the 6.71 map data: dota.allstars.v6.71.xml.zip

    It’s just Furion’s new Sprout and Lesharc’s new Nova Pulse.

  • Xan
    #88 written by Xan 1 year ago

    Thank’s!

  • Forbiddenz
    #89 written by Forbiddenz 1 year ago

    Hi seven… I’ve tested a replay on your parser & host it…
    However i found a bug, look at this page
    http://www.dotaparsers.com/view_replay.php?file=1297138676.w3g
    the PoTM Arrow Accuracy was displayed in the Yunero’s Details, not mirana’s…
    How to fix this?

  • Forbiddenz
    #90 written by Forbiddenz 1 year ago

    http://www.dotaparsers.com/view_replay.php?file=1297141017.w3g
    That one also, Pudge’s hook accuracy was shown in Tuskar’s Details page…

  • joyqi
    #91 written by joyqi 1 year ago

    Hi, I’m using your parser for my site 。
    I find a bug that sometimes it can’t get the player’s inventory and some data for palyer (eg. creep kills, hero kills and more).

    failed replay:
    http://dota.fm/gwDFl
    http://dota.fm/AN396

    success replay:
    http://dota.fm/Kn1m2
    http://dota.fm/b8Yf05

    Can you make some help? Thanks a lot.

  • Xan
    #92 written by Xan 1 year ago

    How can I extract the gamename from a replay ?

  • Xan
    #93 written by Xan 1 year ago

    Wow, new dota release 6.72…. it has a lot of changes.

  • feng
    #94 written by feng 1 year ago

    What time update new dota release 6.72……

  • Seven
    #95 written by Seven 1 year ago

    Sorry for the late reply, but here’s the latest version!

    Updated the page with version 1.4.3, which includes updated .xml data for 6.71 and 6.72(b), with images.

    @Xan: Sorry for not being faster about it, but hope you managed to find where the game name is stored. The game field in the replay object has an array entry ['name']

    For instance in the included view_replay.php you’d access it like:

    1
    $replay->game['name']

    @Forbiddenz:
    I do appreciate the report and am aware of the issue. When I get around to it, I’ll look into it, should be a Dota-Wc3 mapping issue.

    @joyqi:
    This happens when the replay saver leaves too early (at least 2 or 3 other players should leave before or wait until final scores are sent) or the game ends abruptly.

  • Xan
    #96 written by Xan 1 year ago

    I can not describe how grateful I am, ty.

  • Lugia
    #97 written by Lugia 11 months ago

    Sorry for bad English language. (I Russian)
    I am new to php, wanted to make a list of replays like http://dota.replays.net/dotalist.aspx.
    but I lack the experience in php, could you help me?

  • Adam
    #98 written by Adam 9 months ago

    Hey,
    In your updates do you keep updating these files?
    upload_replay
    view_replay
    style-x.css
    I wanted to change a few things but not sure if every update you change them, if you do then it would be tedious for me to keep updating all the time.

    Thank you

  • Adam
    #99 written by Adam 9 months ago

    How much bandwidth does it take ?

  • Seven
    #100 written by Seven 9 months ago

    Hey Adam,

    as far as bandwidth usage is concerned, most traffic is due to replay file downloads, the image files and a bit due to replay uploads as well. Your best approach to optimizing your bandwidth consumption is by compressing / web optimizing the image files in the /images folder with some batch script.

    The upload_replay, view_replay and style-x.css files are included primarily due to a lack of proper documentation and as a primer on using the parser. I tend to stay away from updating those, unless there’re some core functionality changes I wish to display in the upload / view_replay source files, such as reading legacy parsed replay data, which was only relevant for users updating from old versions.

    So feel free to use and modify the aforementioned files. As a rule future updates shouldn’t break any functionality as the only planned changes are intended to facilitate new versions of Dota for now.

  • You may use these HTML tags: <a> <abbr> <acronym> <b> <blockquote> <cite> <code> <del> <em> <i> <q> <strike> <strong>

  • Comment Feed for this Post
Go to Top