Post Reply

If you were logged in you would gain 3 XP for posting a reply.

Please respect our terms of use when participating in Nibbits.

Preview
Comment
We will show a masked version of your IP address as well as your name.

You are replying to:

  • dcramerAs many have noticed, we are parsing SC2 replays here automatically on Nibbits. This is done via some tools we have written in Python, that tie directly into the site (being that it's built on Python). Being that I'm constantly asked how some of our tools work, we are beginning to open source some of the components.

    First off, let me start by saying all components are open sourced under the original BSD license (meaning you must give credit if you use our material). They can be obtained via at our repository on GitHub.

    The component I'm going to be talking about today is our SC2Replay parser. It's not 100% complete as we're working out a few of the last kinks, but it includes what is assumed to be the entire structure of the SC2Replay/replay.info file.

    Usage is fairly straightforward:

    Parses out SC2Replay files.

    >>> from common.parsers.replays import ReplayInfo
    >>> from common.bitstream import BitStream
    >>>
    >>> fp = BitStream(open('Path.SC2Replay', 'rb'))
    >>> parser = ReplayInfo()
    >>> data = parser.serialize(fp)
    >>> print "Map filename: ", data.GameInfo.MapInfo.CachePath

    You can also test w/ this file directly:

    python replays.py 

    Could you please write a few lines on how to set this up in ubuntu, for instance?

    Cheers!

    Registered User
    avatar

Support Nibbits by linking to us: