GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hanzojr/s2protocol: Python library to decode StarCraft II replay protocols

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

24 Commits
24 Commits

Folders and files

NameName
Last commit message
Last commit date
mpyq
mpyq
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
__init__.py
__init__.py
 
 
decoders.py
decoders.py
 
 
protocol15405.py
protocol15405.py
 
 
protocol16561.py
protocol16561.py
 
 
protocol16605.py
protocol16605.py
 
 
protocol16755.py
protocol16755.py
 
 
protocol16939.py
protocol16939.py
 
 
protocol17266.py
protocol17266.py
 
 
protocol17326.py
protocol17326.py
 
 
protocol18092.py
protocol18092.py
 
 
protocol18468.py
protocol18468.py
 
 
protocol18574.py
protocol18574.py
 
 
protocol19132.py
protocol19132.py
 
 
protocol19458.py
protocol19458.py
 
 
protocol19595.py
protocol19595.py
 
 
protocol19679.py
protocol19679.py
 
 
protocol21029.py
protocol21029.py
 
 
protocol21995.py
protocol21995.py
 
 
protocol22612.py
protocol22612.py
 
 
protocol23260.py
protocol23260.py
 
 
protocol24764.py
protocol24764.py
 
 
protocol24944.py
protocol24944.py
 
 
protocol26490.py
protocol26490.py
 
 
protocol27950.py
protocol27950.py
 
 
protocol28272.py
protocol28272.py
 
 
protocol28667.py
protocol28667.py
 
 
protocol32283.py
protocol32283.py
 
 
protocol34784.py
protocol34784.py
 
 
protocol34835.py
protocol34835.py
 
 
protocol36442.py
protocol36442.py
 
 
protocol38215.py
protocol38215.py
 
 
protocol38749.py
protocol38749.py
 
 
protocol38996.py
protocol38996.py
 
 
protocol39576.py
protocol39576.py
 
 
s2protocol.py
s2protocol.py
 
 

Repository files navigation

S2 Protocol

s2protocol is a reference Python library and standalone tool to decode StarCraft II replay files into Python data structures.

Currently s2protocol can decode these structures and events:

  • replay header
  • game details
  • replay init data
  • game events
  • message events
  • tracker events

s2protocol can be used as a base-build-specific library to decode binary blobs, or it can be run as a standalone tool to pretty print information from supported replay files.

Note that s2protocol does not expose game balance information or provide any kind of high level analysis of replays; it's meant to be just the first tool in the chain for your data mining application.

Supported Versions

s2protocol supports all StarCraft II replay files that were written with retail versions of the game. The current plan is to support all future publicly released versions, including public betas.

Tracker Events

Some notes on tracker events:

  • Tracker events are new in version 2.0.8, they do not exist in replays recorded with older versions of the game.
  • Convert unit tag index, recycle pairs into unit tags (as seen in game events) with protocol.unit_tag(index, recycle)
  • Interpret the NNet.Replay.Tracker.SUnitPositionsEvent events like this:
    unitIndex = event['m_firstUnitIndex']
    for i in xrange(0, len(event['m_items']), 3):
        unitIndex += event['m_items'][i + 0]
        x = event['m_items'][i + 1] * 4
        y = event['m_items'][i + 2] * 4
        # unit identified by unitIndex at the current event['_gameloop'] time is at approximate position (x, y)
  • Only units that have inflicted or taken damage are mentioned in unit position events, and they occur periodically with a limit of 256 units mentioned per event.
  • NNet.Replay.Tracker.SUnitInitEvent events appear for units under construction. When complete you'll see a NNet.Replay.Tracker.SUnitDoneEvent with the same unit tag.
  • NNet.Replay.Tracker.SUnitBornEvent events appear for units that are created fully constructed.
  • You may receive a NNet.Replay.Tracker.SUnitDiedEvent after either a UnitInit or UnitBorn event for the corresponding unit tag.
  • In NNet.Replay.Tracker.SPlayerStatsEvent, m_scoreValueFoodUsed and m_scoreValueFoodMade are in fixed point (divide by 4096 for integer values). All other values are in integers.
  • There's a known issue where revived units are not tracked, and placeholder units track death but not birth.

License

Copyright (c) 2013 Blizzard Entertainment

Open sourced under the MIT license. See the included LICENSE file for more information.

Acknowledgements

The standalone tool uses mpyq to read mopaq files.

Thanks to David Joerg and Graylin Kim of GGTracker for design feedback and beta-testing.

About

Python library to decode StarCraft II replay protocols

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.