Python library to decode Heroes of the Storm replay protocols
Python
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
mpyq Initial commit Dec 15, 2015
.gitattributes Initial commit Dec 15, 2015
.gitignore Initial commit Dec 15, 2015
LICENSE Automated upload of generated Heroes Replay Protocol. (2.33.1.65617) Jun 6, 2018
README.md Automated upload of generated Heroes Replay Protocol. (2.33.1.65617) Jun 6, 2018
__init__.py Initial commit Dec 15, 2015
decoders.py Automated upload of generated Heroes Replay Protocol. (2.33.1.65617) Jun 6, 2018
heroprotocol.py Automated upload of generated Heroes Replay Protocol. (2.33.1.65617) Jun 6, 2018
protocol29406.py Initial commit Dec 15, 2015
protocol30414.py Added additional protocols Feb 2, 2016
protocol30509.py Added additional protocols Feb 2, 2016
protocol30829.py Added additional protocols Feb 2, 2016
protocol30948.py Added additional protocols Feb 2, 2016
protocol31090.py Added additional protocols Feb 2, 2016
protocol31360.py Added additional protocols Feb 2, 2016
protocol31566.py Added additional protocols Feb 2, 2016
protocol31726.py Added additional protocols Feb 2, 2016
protocol31948.py Added additional protocols Feb 2, 2016
protocol32120.py Added additional protocols Feb 2, 2016
protocol32253.py Added additional protocols Feb 2, 2016
protocol32455.py Initial commit Dec 15, 2015
protocol32524.py Initial commit Dec 15, 2015
protocol33182.py Added missing protocols 33182, 33353, 33684, 37795 Feb 1, 2016
protocol33353.py Added missing protocols 33182, 33353, 33684, 37795 Feb 1, 2016
protocol33684.py Added missing protocols 33182, 33353, 33684, 37795 Feb 1, 2016
protocol34053.py Initial commit Dec 15, 2015
protocol34190.py Initial commit Dec 15, 2015
protocol34659.py Initial commit Dec 15, 2015
protocol34846.py Initial commit Dec 15, 2015
protocol35360.py Initial commit Dec 15, 2015
protocol35529.py Initial commit Dec 15, 2015
protocol35634.py Initial commit Dec 15, 2015
protocol35702.py Initial commit Dec 15, 2015
protocol36144.py Initial commit Dec 15, 2015
protocol36280.py Added additional protocols Feb 2, 2016
protocol36359.py Initial commit Dec 15, 2015
protocol36536.py Initial commit Dec 15, 2015
protocol36693.py Initial commit Dec 15, 2015
protocol37069.py Initial commit Dec 15, 2015
protocol37117.py Initial commit Dec 15, 2015
protocol37274.py Added protocol37274.py protocol39595.py Feb 1, 2016
protocol37351.py Initial commit Dec 15, 2015
protocol37569.py Initial commit Dec 15, 2015
protocol37795.py Added missing protocols 33182, 33353, 33684, 37795 Feb 1, 2016
protocol38236.py Initial commit Dec 15, 2015
protocol38500.py Initial commit Dec 15, 2015
protocol38593.py Initial commit Dec 15, 2015
protocol38793.py Initial commit Dec 15, 2015
protocol39015.py Added additional protocols Feb 2, 2016
protocol39153.py Initial commit Dec 15, 2015
protocol39271.py Initial commit Dec 15, 2015
protocol39445.py Initial commit Dec 15, 2015
protocol39595.py Added protocol37274.py protocol39595.py Feb 1, 2016
protocol39709.py Added protocol39709.py Jan 15, 2016
protocol39951.py Added protocol39951.py Jan 15, 2016
protocol40087.py Added protocol40087.py Jan 24, 2016
protocol40322.py Added protocol40322.py Jan 27, 2016
protocol40336.py Added protocol40336.py Jan 26, 2016
protocol40431.py Added protocol40431.py Feb 3, 2016
protocol40697.py Added protocol40697.py Feb 11, 2016
protocol40798.py Added protocol40798.py Feb 17, 2016
protocol41150.py Added protocol41150.py Mar 1, 2016
protocol41393.py Added protocol41393.py Mar 9, 2016
protocol41504.py Added protocol41504.py Mar 16, 2016
protocol41609.py Added protocol41609.py Mar 21, 2016
protocol41707.py Automated upload of generated Heroes Replay Protocol. (17.1.42178) Apr 13, 2016
protocol41764.py Automated upload of generated Heroes Replay Protocol. (17.1.42178) Apr 13, 2016
protocol41810.py Added protocol41810.py Mar 29, 2016
protocol42178.py Automated upload of generated Heroes Replay Protocol. (17.1.42178) Apr 13, 2016
protocol42273.py Automated upload of generated Heroes Replay Protocol. (17.2.42273) Apr 19, 2016
protocol42406.py Automated upload of generated Heroes Replay Protocol. (17.3.42406) Apr 21, 2016
protocol42506.py Automated upload of generated Heroes Replay Protocol. (17.4.42506) Apr 27, 2016
protocol42590.py Automated upload of generated Heroes Replay Protocol. (17.5.42590) May 4, 2016
protocol42742.py Automated upload of generated Heroes Replay Protocol. (18.3.42742) May 26, 2016
protocol42958.py Automated upload of generated Heroes Replay Protocol. (18.0.42958) May 18, 2016
protocol43051.py Automated upload of generated Heroes Replay Protocol. (18.1.43051) May 20, 2016
protocol43170.py Automated upload of generated Heroes Replay Protocol. (18.2.43170) May 25, 2016
protocol43259.py Automated upload of generated Heroes Replay Protocol. (18.3.43259) Jun 2, 2016
protocol43481.py Automated upload of generated Heroes Replay Protocol. (18.4.43481) Jun 7, 2016
protocol43527.py Automated upload of generated Heroes Replay Protocol. (18.4.43527) Jun 8, 2016
protocol43571.py Automated upload of generated Heroes Replay Protocol. (18.4.43571) Jun 14, 2016
protocol43905.py Automated upload of generated Heroes Replay Protocol. (18.5.43905) Jun 21, 2016
protocol44124.py Automated upload of generated Heroes Replay Protocol. (18.6.44124) Jun 29, 2016
protocol44256.py Automated upload of generated Heroes Replay Protocol. (19.0.44256) Jul 6, 2016
protocol44468.py Automated upload of generated Heroes Replay Protocol. (19.0.44468) Jul 12, 2016
protocol44737.py Automated upload of generated Heroes Replay Protocol. (19.1.44737) Jul 20, 2016
protocol44797.py Automated upload of generated Heroes Replay Protocol. (19.2.44797) Jul 21, 2016
protocol44941.py Automated upload of generated Heroes Replay Protocol. (19.3.44941) Jul 27, 2016
protocol45024.py Automated upload of generated Heroes Replay Protocol. (19.4.45024) Aug 1, 2016
protocol45228.py Automated upload of generated Heroes Replay Protocol. (19.5.45228) Aug 10, 2016
protocol45635.py Automated upload of generated Heroes Replay Protocol. (19.5.45635) Aug 24, 2016
protocol45815.py Automated upload of generated Heroes Replay Protocol. (20.0.45815) Sep 14, 2016
protocol45889.py Automated upload of generated Heroes Replay Protocol. (20.0.45889) Sep 1, 2016
protocol45949.py Automated upload of generated Heroes Replay Protocol. (20.1.45949) Sep 14, 2016
protocol46158.py Automated upload of generated Heroes Replay Protocol. (20.0.46158) Sep 12, 2016
protocol46416.py Automated upload of generated Heroes Replay Protocol. (20.2.46416) Sep 27, 2016
protocol46446.py Automated upload of generated Heroes Replay Protocol. (20.1.46446) Sep 21, 2016
protocol46690.py Automated upload of generated Heroes Replay Protocol. (20.2.46690) Sep 27, 2016
protocol46787.py Automated upload of generated Heroes Replay Protocol. (20.3.46787) Sep 30, 2016
protocol46869.py Automated upload of generated Heroes Replay Protocol. (20.5.46869) Oct 1, 2016
protocol46889.py Automated upload of generated Heroes Replay Protocol. (20.5.46889) Oct 5, 2016
protocol47024.py Automated upload of generated Heroes Replay Protocol. (21.0.47024) Oct 14, 2016
protocol47133.py Automated upload of generated Heroes Replay Protocol. (20.6.47133) Oct 12, 2016
protocol47219.py Automated upload of generated Heroes Replay Protocol. (21.0.47219) Oct 18, 2016
protocol47479.py Automated upload of generated Heroes Replay Protocol. (21.1.47479) Oct 26, 2016
protocol47801.py Automated upload of generated Heroes Replay Protocol. (22.0.47801) Nov 8, 2016
protocol47903.py Automated upload of generated Heroes Replay Protocol. (21.2.47903) Nov 10, 2016
protocol47944.py Automated upload of generated Heroes Replay Protocol. (22.0.47944) Nov 10, 2016
protocol48027.py Automated upload of generated Heroes Replay Protocol. (22.0.48027) Nov 15, 2016
protocol48297.py Automated upload of generated Heroes Replay Protocol. (22.1.48297) Nov 22, 2016
protocol48548.py Automated upload of generated Heroes Replay Protocol. (22.2.48548) Dec 6, 2016
protocol48583.py Automated upload of generated Heroes Replay Protocol. (22.3.48583) Dec 6, 2016
protocol48760.py Automated upload of generated Heroes Replay Protocol. (22.3.48760) Dec 14, 2016
protocol49008.py Automated upload of generated Heroes Replay Protocol. (22.4.49008) Dec 20, 2016
protocol49076.py Automated upload of generated Heroes Replay Protocol. (22.5.49076) Jan 4, 2017
protocol49278.py Automated upload of generated Heroes Replay Protocol. (22.6.49278) Jan 6, 2017
protocol49495.py Automated upload of generated Heroes Replay Protocol. (22.7.49495) Jan 12, 2017
protocol49582.py Automated upload of generated Heroes Replay Protocol. (23.0.49582) Jan 18, 2017
protocol49747.py Automated upload of generated Heroes Replay Protocol. (23.0.49747) Jan 24, 2017
protocol49838.py Automated upload of generated Heroes Replay Protocol. (22.7.49838) Feb 2, 2017
protocol49907.py Automated upload of generated Heroes Replay Protocol. (23.1.49907) Jan 27, 2017
protocol50286.py Automated upload of generated Heroes Replay Protocol. (23.2.50286) Feb 8, 2017
protocol50424.py Automated upload of generated Heroes Replay Protocol. (23.2.50424) Feb 15, 2017
protocol50441.py Automated upload of generated Heroes Replay Protocol. (23.3.50441) Feb 14, 2017
protocol50673.py Automated upload of generated Heroes Replay Protocol. (23.4.50673) Feb 17, 2017
protocol50950.py Automated upload of generated Heroes Replay Protocol. (23.5.50950) Feb 28, 2017
protocol51150.py Automated upload of generated Heroes Replay Protocol. (24.0.51150) Mar 6, 2017
protocol51375.py Automated upload of generated Heroes Replay Protocol. (24.0.51375) Mar 14, 2017
protocol51609.py Automated upload of generated Heroes Replay Protocol. (24.1.51779) Mar 22, 2017
protocol51779.py Automated upload of generated Heroes Replay Protocol. (24.1.51779) Mar 22, 2017
protocol51923.py Automated upload of generated Heroes Replay Protocol. (24.2.51923) Mar 28, 2017
protocol51978.py Automated upload of generated Heroes Replay Protocol. (2.25.0.51978) Mar 29, 2017
protocol52008.py Automated upload of generated Heroes Replay Protocol. (24.3.52008) Mar 30, 2017
protocol52124.py Automated upload of generated Heroes Replay Protocol. (24.4.52124) Apr 4, 2017
protocol52214.py Automated upload of generated Heroes Replay Protocol. (2.25.0.52214) Apr 5, 2017
protocol52351.py Automated upload of generated Heroes Replay Protocol. (24.5.52351) Apr 12, 2017
protocol52381.py Automated upload of generated Heroes Replay Protocol. (2.25.0.52381) Apr 12, 2017
protocol52561.py Automated upload of generated Heroes Replay Protocol. (2.25.0.52561) Apr 17, 2017
protocol52647.py Automated upload of generated Heroes Replay Protocol. (24.6.52647) Apr 20, 2017
protocol52860.py Automated upload of generated Heroes Replay Protocol. (2.25.0.52860) Apr 26, 2017
protocol52986.py Automated upload of generated Heroes Replay Protocol. (2.25.1.52986) Apr 28, 2017
protocol53174.py Automated upload of generated Heroes Replay Protocol. (2.25.2.53174) May 4, 2017
protocol53270.py Automated upload of generated Heroes Replay Protocol. (2.25.3.53270) May 8, 2017
protocol53275.py Automated upload of generated Heroes Replay Protocol. (2.25.3.53275) May 10, 2017
protocol53548.py Automated upload of generated Heroes Replay Protocol. (2.25.4.53548) May 16, 2017
protocol53965.py Automated upload of generated Heroes Replay Protocol. (2.25.5.53965) May 31, 2017
protocol54098.py Automated upload of generated Heroes Replay Protocol. (2.26.0.54098) Jun 5, 2017
protocol54339.py Automated upload of generated Heroes Replay Protocol. (2.26.0.54339) Jun 13, 2017
protocol54968.py Automated upload of generated Heroes Replay Protocol. (2.26.2.55010) Jun 28, 2017
protocol55010.py Automated upload of generated Heroes Replay Protocol. (2.26.2.55010) Jun 28, 2017
protocol55058.py Automated upload of generated Heroes Replay Protocol. (2.26.3.55058) Jul 3, 2017
protocol55288.py Automated upload of generated Heroes Replay Protocol. (2.26.3.55288) Jul 11, 2017
protocol55844.py Automated upload of generated Heroes Replay Protocol. (2.26.4.55844) Jul 26, 2017
protocol55929.py Automated upload of generated Heroes Replay Protocol. (2.27.0.55929) Jul 31, 2017
protocol56175.py Automated upload of generated Heroes Replay Protocol. (2.27.0.56175) Aug 8, 2017
protocol56361.py Automated upload of generated Heroes Replay Protocol. (2.27.1.56361) Aug 12, 2017
protocol56705.py Automated upload of generated Heroes Replay Protocol. (2.27.2.56705) Aug 23, 2017
protocol56784.py Automated upload of generated Heroes Replay Protocol. (2.27.4.57286) Sep 8, 2017
protocol56859.py Automated upload of generated Heroes Replay Protocol. (2.27.3.56859) Aug 28, 2017
protocol57062.py Automated upload of generated Heroes Replay Protocol. (2.27.3.57062) Sep 5, 2017
protocol57286.py Automated upload of generated Heroes Replay Protocol. (2.27.4.57286) Sep 8, 2017
protocol57547.py Automated upload of generated Heroes Replay Protocol. (2.28.0.57547) Sep 18, 2017
protocol57589.py Automated upload of generated Heroes Replay Protocol. (2.27.5.57589) Sep 20, 2017
protocol57797.py Automated upload of generated Heroes Replay Protocol. (2.28.0.57797) Sep 26, 2017
protocol58209.py Automated upload of generated Heroes Replay Protocol. (2.28.1.58209) Oct 3, 2017
protocol58344.py Automated upload of generated Heroes Replay Protocol. (2.28.3.58344) Oct 9, 2017
protocol58482.py Automated upload of generated Heroes Replay Protocol. (2.28.2.58482) Oct 11, 2017
protocol58623.py Automated upload of generated Heroes Replay Protocol. (2.28.3.58623) Oct 17, 2017
protocol58795.py Automated upload of generated Heroes Replay Protocol. (2.28.4.58795) Oct 25, 2017
protocol59239.py Automated upload of generated Heroes Replay Protocol. (2.28.5.59239) Nov 1, 2017
protocol59279.py Automated upload of generated Heroes Replay Protocol. (2.29.0.59279) Nov 6, 2017
protocol59657.py Automated upload of generated Heroes Replay Protocol. (2.29.0.59657) Nov 14, 2017
protocol59799.py Automated upload of generated Heroes Replay Protocol. (2.29.1.59799) Nov 22, 2017
protocol59837.py Automated upload of generated Heroes Replay Protocol. (2.29.1.59988) Nov 29, 2017
protocol59944.py Automated upload of generated Heroes Replay Protocol. (2.29.3.59944) Nov 27, 2017
protocol59988.py Automated upload of generated Heroes Replay Protocol. (2.29.1.59988) Nov 29, 2017
protocol60228.py Automated upload of generated Heroes Replay Protocol. (2.29.3.60228) Dec 5, 2017
protocol60265.py Automated upload of generated Heroes Replay Protocol. (2.29.3.60399) Dec 12, 2017
protocol60399.py Automated upload of generated Heroes Replay Protocol. (2.29.3.60399) Dec 12, 2017
protocol60522.py Automated upload of generated Heroes Replay Protocol. (2.29.3.60522) Dec 13, 2017
protocol60567.py Automated upload of generated Heroes Replay Protocol. (2.29.4.60567) Jan 2, 2018
protocol60632.py Automated upload of generated Heroes Replay Protocol. (2.29.3.60632) Dec 20, 2017
protocol60821.py Automated upload of generated Heroes Replay Protocol. (2.29.3.60821) Dec 22, 2017
protocol61129.py Automated upload of generated Heroes Replay Protocol. (2.29.4.61129) Jan 9, 2018
protocol61361.py Automated upload of generated Heroes Replay Protocol. (2.29.4.61361) Jan 16, 2018
protocol61552.py Automated upload of generated Heroes Replay Protocol. (2.29.4.61552) Jan 24, 2018
protocol61718.py Automated upload of generated Heroes Replay Protocol. (2.30.0.61872) Feb 3, 2018
protocol61872.py Automated upload of generated Heroes Replay Protocol. (2.30.0.61872) Feb 3, 2018
protocol61952.py Automated upload of generated Heroes Replay Protocol. (2.30.0.61952) Feb 6, 2018
protocol62119.py Automated upload of generated Heroes Replay Protocol. (2.30.1.62119) Feb 9, 2018
protocol62212.py Automated upload of generated Heroes Replay Protocol. (2.30.2.62212) Feb 14, 2018
protocol62424.py Automated upload of generated Heroes Replay Protocol. (2.30.3.62424) Feb 21, 2018
protocol62548.py Automated upload of generated Heroes Replay Protocol. (2.30.4.62833) Mar 7, 2018
protocol62833.py Automated upload of generated Heroes Replay Protocol. (2.30.4.62833) Mar 7, 2018
protocol63070.py Automated upload of generated Heroes Replay Protocol. (2.30.5.63070) Mar 10, 2018
protocol63203.py Automated upload of generated Heroes Replay Protocol. (2.31.0.63203) Mar 19, 2018
protocol63402.py Automated upload of generated Heroes Replay Protocol. (2.30.6.63402) Mar 21, 2018
protocol63507.py Automated upload of generated Heroes Replay Protocol. (2.31.0.63507) Mar 27, 2018
protocol63635.py Automated upload of generated Heroes Replay Protocol. (2.31.1.63635) Mar 30, 2018
protocol64100.py Automated upload of generated Heroes Replay Protocol. (2.31.2.64100) Apr 12, 2018
protocol64129.py Automated upload of generated Heroes Replay Protocol. (2.31.3.64129) Apr 13, 2018
protocol64255.py Automated upload of generated Heroes Replay Protocol. (2.32.0.64255) Apr 16, 2018
protocol64331.py Automated upload of generated Heroes Replay Protocol. (2.32.0.64331) Apr 19, 2018
protocol64455.py Automated upload of generated Heroes Replay Protocol. (2.32.0.64455) Apr 24, 2018
protocol64657.py Automated upload of generated Heroes Replay Protocol. (2.32.1.64657) May 1, 2018
protocol64863.py Automated upload of generated Heroes Replay Protocol. (2.32.2.64863) May 9, 2018
protocol65006.py Automated upload of generated Heroes Replay Protocol. (2.32.3.65006) May 10, 2018
protocol65054.py Automated upload of generated Heroes Replay Protocol. (2.33.0.65054) May 14, 2018
protocol65285.py Automated upload of generated Heroes Replay Protocol. (2.33.0.65285) May 22, 2018
protocol65579.py Automated upload of generated Heroes Replay Protocol. (2.34.0.65579) Jun 4, 2018
protocol65617.py Automated upload of generated Heroes Replay Protocol. (2.33.1.65617) Jun 6, 2018
protocol65654.py Automated upload of generated Heroes Replay Protocol. (2.33.1.65654) Jun 9, 2018
protocol65655.py Automated upload of generated Heroes Replay Protocol. (2.33.1.65617) Jun 6, 2018
protocol65751.py Automated upload of generated Heroes Replay Protocol. (2.34.0.65751) Jun 12, 2018
protocol65846.py Automated upload of generated Heroes Replay Protocol. (2.34.1.65846) Jun 13, 2018
protocol65943.py Automated upload of generated Heroes Replay Protocol. (2.34.2.65943) Jun 15, 2018
protocol66182.py Automated upload of generated Heroes Replay Protocol. (2.34.3.66182) Jun 27, 2018
protocol66292.py Automated upload of generated Heroes Replay Protocol. (2.35.0.66292) Jul 2, 2018
protocol66488.py Automated upload of generated Heroes Replay Protocol. (2.35.0.66488) Jul 10, 2018

README.md

heroprotocol.py

heroprotocol.py is a series of reference Python scripts and standalone tool to decode Heroes of the Storm replay files into Python data structures.

Currently heroprotocol can decode these structures and events:

  • Replay header
  • Game details
  • Replay init data
  • Game events
  • Message events
  • Tracker events

heroprotocol 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 heroprotocol 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

heroprotocol supports all Hereos of the Storm replay files that were written with retail versions of the game.

How to Use

A working installation of Python 2.x is required. From the folder where heroprotocol is located, type the following into the command line, assuming that the replay file was also copied into the same folder:

py heroprotocol.py --[tracker-event-option] "<replayFileName>" > output.txt

If you want the output shown directly in the terminal, leave out the > output.txt.

Example Usage

py heroprotocol.py --details "Blackheart's Bay.StormReplay" > output.txt

Command Line Arguments

-h, --help          Show the options that are available.

Tracker Events:
--gameevents        Print all game events including coordinates
--messageevents     Print message events such as ping events
--trackerevents     Print tracker events such as units killed, game stat events,
                    score result event
--attributeevents   Print attribute events, a table of attrid, namespace, and attribute values
--header            Print protocol header including build id and elapsedGameLoops
--details           Print protocol details, e.g. teamId, player names and chosen heroes,
                    player region, game result, observer status
--initdata          Print protocol initdata, e.g. interface settings for every player

Output Options:
--stats             Output stats about the active tracker event to the STDERR stream
--json              Use JSON syntax for output

Tracker Events

Some notes on tracker events:

  • 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.

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 of the s2protocol library that heroprotocol is based upon.

Thanks to Ben Barrett of HOTSLogs for feedback on and beta-testing of the heroprotocol library.

License

Copyright © 2018 Blizzard Entertainment

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