Thread: Replay parsing lib [S2R2]

Page 1 of 2 12 LastLast
Results 1 to 20 of 22
  1. #1

    Replay parsing lib [S2R2]

    S2R2 is a Python module to parse replay files
    It is NOT complete, NOT accurate, may do something incorrect, may be based on incorrect assumptions, etc

    What this library does is just parsing entity snapshots ... and thats it
    Some data like chats is just skipped for now since main concern was to parse entities
    parsing speed is pretty slow ...
    Interface is undocumented and pretty lowlevel ... you just have NextFrame() method to advance to next server frame and you have EntityPool property which is the Pool of all world entites and their states for current frame :-/

    i doubt someone will find this usefull but i had great time reverse engineering replay format
    and you already can make some stupid things like this heat map of TREES deaths (matchid: 6314909):


    or this player positions/movement map for madman (played by YoDa, matchid: 7066386)


    (i may have messed something with those maps though)
    this library (and maybe some example usage) will be/is worked on untill i completely lost interest in this


    Requirements:
    Python 2.6
    bitarray python module http://pypi.python.org/pypi/bitarray/
    example heatmap scripts require python module heatmap http://www.jjguy.com/heatmap/
    disclaimer:

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
    IN THE SOFTWARE.

    oh,and about legality of this: S2Ikkyo said one is 'free to figure on your own' about replaydata format ( http://forums.heroesofnewerth.com/sh....php?p=1140614 )

    Link : https://github.com/theli-ua/s2r2

    this is abandoned, left for research purposes only. you better learn how to get plain text game logs as that should contain most of information you want
    Last edited by theli; 05-31-2013 at 09:08 AM.

  2. #2
    I must say; awesome job, this can become a very good analyzing tool, in whatever way

  3. #3
    Offline
    Account Icon
    Chat Symbol
    Join Date
    Mar 2010
    Location
    South Africa
    Posts
    412
    Well done, that's impressive! The tree script took 15 minutes to complete (on a 11mb file with 51m40s of game play) but it seems to work nicely:


    Could you also share the map background? Couldn't find it in any of your files.

    [Silv3ri's Mods]
    Original version of signature image is by www,annestokes,com
    ui/ui_items.package, line 1519


  4. #4
    Quote Originally Posted by Silv3ri View Post
    Well done, that's impressive! The tree script took 15 minutes to complete (on a 11mb file with 51m40s of game play) but it seems to work nicely:


    Could you also share the map background? Couldn't find it in any of your files.
    yup, as i said its pretty slow ... it needs to process more than 62000 frames for your replay


    minimap:
    textures.s2z\00000000\maps\caldavar\minimap.dds

  5. #5
    awesome
    thanks for your great work

  6. #6
    Offline
    Account Icon
    Join Date
    Aug 2009
    Location
    Kentucky
    Posts
    3,946
    Nice work man!

  7. #7
    Great research, looking forward to more!

  8. #8
    I would have a tecnical question if someone can answer to me..

    Inside the struct used for the library, in the "Hero" struct, there are a lot of variable that define the entity hero. One in particolary is in my interest, 'm_yStatus' using to define the status of the hero... what's the difference from the value 0,1,2,3 of this field ?
    In your example is used this control:

    if x.EntityPool[id]['m_yStatus'] != 0

    why?

    tnx

  9. #9
    Offline
    Account Icon
    Chat Symbol
    Join Date
    Sep 2009
    Location
    Paris, France
    Posts
    47
    Your work is awesome a documentation about the replaydata structure will be very nice

  10. #10
    Offline
    Account Icon
    Join Date
    Nov 2009
    Location
    Russian Federation
    Posts
    118
    Please
    write detailed instructions

  11. #11
    Quote Originally Posted by oxman View Post
    Your work is awesome a documentation about the replaydata structure will be very nice
    Quote Originally Posted by vRage View Post
    Please
    write detailed instructions
    sorry, but i don't have time, desire or motivation to do any more work on that

    but, just out of curiosity - why do you need that anyway? most crucial data can be parsed out just from game logs only

  12. #12
    unpack_enabled is some pretty gnarly rerversing - nice! Are you still alive and kicking theli?

  13. #13
    nat that alive and active as i used to be, also, this particular one project is kinda abandoned since i can't think of a really good use case for this which is worth the efforts

  14. #14
    I tried sending you a private message, but was wondering if you'd care to chat over some other messaging service. I'm in the process of porting (and extending) your library to C# and had some questions of some of your reversing. As an avid (albeit newbie) reverse engineer, I've been enjoying comparing your work and to the disassembly and debugger. Let me know if you have any time or interest in sharing some of your experience. :]

  15. #15
    I do this in C#, but I do it as the game is running rather than parsing the replays by hooking the snapshot parsing functions. Is that ultimately what you're trying to do, devINVISIBLE?

  16. #16
    Quote Originally Posted by theli View Post
    sorry, but i don't have time, desire or motivation to do any more work on that

    but, just out of curiosity - why do you need that anyway? most crucial data can be parsed out just from game logs only

    Id like to mod this code a bit just to parse out the chat logs of the replay files.

  17. #17

  18. #18
    Quote Originally Posted by theli View Post
    chat logs are more accessable from game logs then from replays
    But since the S2 XML log parser is busted indefinitely our only choice is to parse them out of the replays them self right? I don't know of another way to access the game logs.

  19. #19
    Offline
    Account Icon
    Chat Symbol
    Join Date
    Mar 2010
    Location
    Leeds, United Kingdom
    Posts
    106
    I have something I wrote for parsing replay files. What exactly do you want to get out of the replay?


  20. #20
    Quote Originally Posted by Mazungu View Post
    But since the S2 XML log parser is busted indefinitely our only choice is to parse them out of the replays them self right? I don't know of another way to access the game logs.
    you can use http://hondiff.appspot.com/gamelog/matchid to easily download zipped text game logs

Posting Permissions

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