@@ -3,7 +3,7 @@ What is sc2reader?
33
44sc2reader is a python library for extracting information from various different
55Starcraft II resources. These resources currently include Replays, Maps, and
6- Game Summaries; we will eventually include BNet profiles and possibly adapters
6+ Game Summaries; we may eventually include BNet profiles and possibly adapters
77to the more entrenched SCII sites like sc2ranks.
88
99Our goal is to give anyone and everyone the power to construct their own
@@ -15,13 +15,13 @@ under the open MIT license. Currently powering:
1515* Research: `Build Order Classification `
1616
1717Our secondary goal is to become a reference implementation for people looking
18- to implement parsers in other languages. There are currently implementations
19- under development in :
18+ to implement parsers in other languages. The following is a list of partial
19+ implementations in other languages :
2020
2121* C#: `sc2replay-csharp `_ (special thanks for v1.5 help)
2222* C++: `sc2pp `_
2323* Javascript: `comsat `_
24- * PHP: `phpsc2replay `_ (the original open implementation!)
24+ * PHP: `phpsc2replay `_
2525
2626If you'd like your tool, site, project, or implementation listed above, drop
2727us a line on our mailing list or stop by our #sc2reader IRC channel and say hi!
@@ -33,28 +33,29 @@ Current Status
3333sc2reader is currently capable of parsing varying levels of information out of
3434the three primary resource types listed below. For a more detailed and exact
3535description of the information that can be extracted please consult the
36- `documentation `_ hosted on Read the Docs and packaged with the source .
36+ `documentation `_ hosted on Read the Docs.
3737
3838
3939Replays
4040-------------
4141
42- Almost all the basic contextual information can be extracted from any post-beta
43- replays. This information includes:
42+ Replays can be parsed for the following general types of information:
4443
45- - Replay details (map, length, version, datetime, game type , game speed, ...)
44+ - Replay details (map, length, version, expansion, datetime , game type/ speed, ...)
4645- Player details (name, race, team, color, bnet url, win/loss, ...)
4746- Message details (text, time, player, target, pings, ...)
4847
4948Additional information can be parsed from ladder replays and replays from basic
5049unmodded private "custom" games. This information includes:
5150
52- - Unit Selection and Hotkey events.
53- - Resource Transfers and Requests (but not collection or unspent values !)
51+ - Unit Selection and Hotkey (Control Group) events.
52+ - Resource Transfers and Requests (but not collection rate or unspent totals !)
5453- Unfiltered Unit commands (attack, move, train, build, psi storm, etc)
5554- Camera Movements for all players and observers.
5655
57- In some cases, further information can be extracted from this raw information:
56+ In general, all player actions are recorded but game state information is not.
57+ In some cases, further game state information can be extracted from this raw
58+ information:
5859
5960- All unit selections and hotkey values for every frame of the game.
6061- APM/EPM and its untold variations.
@@ -87,21 +88,17 @@ Tons of data parsed. Thank you Prillan and others from `Team Liquid`_.
8788* URLs to map localization files and images
8889* Player build orders up to 64 (real) actions
8990
90- This isn't super reliable yet and s2gs files may fail during processing. We've
91- figured out the basic common structure and where the information is stored but
92- the data structure sometimes can't be processed with current techniques and it
93- seems as though different s2gs files can contain radically different amounts
94- of information based on some unknown factors.
95-
96- It is likely that s2gs file support will be improved in future releases.
91+ Parsing on these files is now production ready for those that can get them. See
92+ the `Team Liquid `_ thread for details on how to go about getting them.
9793
9894
9995Example Usage
10096=====================
10197
10298To demonstrate how you might use sc2reader in practice I've included some short
10399contrived scripts below. For more elaborate examples, checkout the docs and the
104- sc2reader.scripts package on Github.
100+ `sc2reader.scripts `_ package on Github or in the source.
101+
105102
106103Downloading Maps
107104--------------------
@@ -119,7 +116,7 @@ Save all the minimaps for all the games you've ever played::
119116 if not os.path.exists(minimap_path):
120117 with open(minimap_path, 'w') as file_out:
121118 file_out.write(replay.map.minimap)
122- print "Saved Map: {0} [{1}]".format(replay.map_name, replay.map_hash)
119+ print( "Saved Map: {0} [{1}]".format(replay.map_name, replay.map_hash) )
123120
124121
125122Organizing Replays
@@ -140,7 +137,7 @@ Organizing your 1v1 replays by race played and matchup and sortable by length::
140137 me = replay.player.name('ShadesofGray')
141138 you = team[(me.team.number+1)%2].players[0]
142139
143- matchup = "{}v{}".format(me.play_race[0], you.play_race[1])
140+ matchup = "{0 }v{1 }".format(me.play_race[0], you.play_race[1])
144141
145142 sorted_path = os.path.join(sorted_base,me.play_race[0],matchup)
146143 if not os.path.exists(sorted_path):
@@ -158,9 +155,29 @@ Organizing your 1v1 replays by race played and matchup and sortable by length::
158155Installation
159156================
160157
161- Installation from PyPi is not longer recommended because I am terrible at making releases.
162158
163- For now, just assume that I am keeping the master branch on Github stable. Sorry!
159+
160+ From PyPI (stable)
161+ ---------------------
162+
163+ Install from the latest release on PyPI with pip::
164+
165+ pip install sc2reader
166+
167+ or easy_install::
168+
169+ easy_install sc2reader
170+
171+ or with setuptools (specify a valid x.x.x)::
172+
173+ wget http://pypi.python.org/packages/source/s/sc2reader/sc2reader-x.x.x.tar.gz
174+ tar -xzf sc2reader-x.x.x.tar.gz
175+ cd sc2reader-x.x.x
176+ python setup.py install
177+
178+ Releases to PyPi can be very delayed, for the latest and greatest you are encouraged
179+ to install from Github master which is **usually ** kept quite stable.
180+
164181
165182From Github
166183--------------------------
@@ -197,7 +214,10 @@ too much work. It'll make everyone happier in the long run.
197214Testing
198215-------------------
199216
200- We use py.test for testing. You can install it via pip/easy_install.
217+ We use py.test for testing. You can install it via pip/easy_install::
218+
219+ pip install pytest
220+ easy_install pytest
201221
202222To run the tests just use::
203223
@@ -206,7 +226,12 @@ To run the tests just use::
206226 py.test test_s2gs # Only run tests on summary files
207227
208228When repeatedly running tests it can be very helpful to make sure you've
209- set a local cache directory to prevent long fetch times from battle.net.
229+ set a local cache directory to prevent long fetch times from battle.net::
230+
231+ mkdir local_cache
232+ export SC2READER_CACHE_DIR=local_cache
233+
234+ Good luck, have fun!
210235
211236
212237Community
@@ -237,14 +262,16 @@ and kept this project going. Special thanks to the people of the awesome
237262`phpsc2replay `_ project whose public documentation and source code made
238263starting this library possible and to sc2replay-csharp for setting us
239264straight on game events parsing and assisting with our v1.5 upgrade.
240-
241- I'd also like to thank ggtracker sponsoring furthered development and for
265+ I'd also like to thank ggtracker sponsoring further development and for
242266providing the thousands of test files used while adding s2gs and HotS Beta
243267support.
244268
269+
270+
245271.. _Build Order Classification : https://github.com/grahamjenson/sc2reader
246272.. _ggtracker.com : http://ggtracker.com
247273.. _gamereplays.org : http://www.gamereplays.org/starcraft2/
274+ .. _sc2reader.scripts : https://github.com/GraylinKim/sc2reader/tree/master/sc2reader/scripts
248275.. _The Core : http://www.teamliquid.net/forum/viewmessage.php?topic_id=341878
249276.. _PyPy : http://pypy.org/
250277.. _sc2pp : https://github.com/zsol/sc2pp
0 commit comments