stoicloofah / spawningtool Goto Github PK
View Code? Open in Web Editor NEWTools for analyzing StarCraft 2 Replays
License: Other
Tools for analyzing StarCraft 2 Replays
License: Other
After taking a look through s2protocol and sc2reader, I think this project will ultimately be more sane if we use sc2reader. Both appear to parse all of the same data, but sc2reader is readable and has built structures around a lot of the data, whereas s2protocol is still pretty raw.
I think it makes sense to maintain the s2protocol implementation in a branch for anyone interested in working with that. master, however, will be using sc2reader
Thanks for making spawning tool. Somehow my spawning tool freezes suddenly like below,
I tried to reinstall spawning tool and overwolf but it doesn't restart spawning tool but shows same screen above.
Is there a place where spawning tool's settings or any environment is placed on Windows? If there are then I want to reset such environments. Or if any tips I would be happy to hear.
I get this error when I try to load a replay using the CLI.
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/stefan/Documents/ML/env/src/spawningtool/spawningtool/__main__.py", line 124, in <module>
main()
File "/home/stefan/Documents/ML/env/src/spawningtool/spawningtool/__main__.py", line 113, in main
include_map_details=bool(args.map_details))
File "/home/stefan/Documents/ML/env/src/spawningtool/spawningtool/parser.py", line 830, in parse_replay
return parser.get_parsed_data(cutoff_time, cache_dir, include_map_details)
File "/home/stefan/Documents/ML/env/src/spawningtool/spawningtool/parser.py", line 198, in get_parsed_data
self.load_replay()
File "/home/stefan/Documents/ML/env/src/spawningtool/spawningtool/parser.py", line 274, in load_replay
self.replay = sc2reader.load_replay(self.replay_file)
File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/factories/sc2factory.py", line 85, in load_replay
return self.load(Replay, source, options, **new_options)
File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/factories/sc2factory.py", line 137, in load
return self._load(cls, resource, filename=filename, options=options)
File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/factories/sc2factory.py", line 146, in _load
obj = cls(resource, filename=filename, factory=self, **options)
File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/resources.py", line 312, in __init__
engine.run(self)
File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/engine/engine.py", line 177, in run
for new_event in (event_handler(event, replay) or []):
File "/home/stefan/Documents/ML/env/lib/python3.6/site-packages/sc2reader/engine/plugins/context.py", line 57, in handleTargetUnitCommandEvent
self.last_target_ability_event[event.player.pid] = event
AttributeError: 'NoneType' object has no attribute 'pid'
I was trying to practice my build order, so I went back to 0:00 in a replay and resumed only to find that the spawning tool timer is significantly faster than the in-game timer after resuming from replay. Not really sure why, but it seemed fine when I played a regular vs AI right afterward. However, after that game, I tried resuming from replay again and it desynched again.
I saw this other issue and maybe the two are tied together in some way?
Not sure what's up, but I get time errors for Vikings
If a starcraft 2 replay has a MPQ\x1a header then spawning tool will crash due to a key error because the header object will not contain a 'user_data_header' key.
The problem is on line 76
contents = archive.header['user_data_header']['content']
http://us.battle.net/sc2/en/blog/21183638/starcraft-ii-40-patch-notes-11-14-2017
"Chrono Boost costs 50 energy and causes the target structure to operate 100% faster for 10 seconds."
So Chrono Boost is more like the HotS chronoboost than the LotV chronoboost, except it lasts for only 10 seconds (instead of 20 seconds) and does 20 seconds of work (instead of 30 seconds).
See http://spawningtool.com/1068/download/
Note that all Banelings have a Zergling 4 seconds before.
This appears to be happening because the UnitTypeChangeEvent happens when the morphing completes, but it still recognizes it as a Zergling. It comes in 4 seconds before because Zerglings take 24 seconds to make, while Banelings take 20.
A related issue is that there is no instance of a Brood Lord ever being created in any replay that I can find. Whoops.
But Overseers do work. I'll have to test this all more extensively
https://news.blizzard.com/en-us/starcraft2/23893118/starcraft-ii-5-0-11-patch-notes
Looks like a few build times changed
I guess this should be dated to 1/23/23
For units (not including warped units), we get the "born" time in trackerevents, which we subtract the build time from to get the start for the build order. Unfortunately, this doesn't always work because chronoboost speeds up that build time.
In the opposite direction, Contaminate also isn't considered. Supply blocks also aren't considered.
This is a long-standing problem that I haven't addressed.
http://spawningtool.com/16573/
This replay has a Nuke in it. I'm not sure if that's the beginning of building, the end of building, or the launching. In any case, we're not accounting for it.
I would just send everything along, but I kind of like that the output dumps cleanly. I should also add
The targetunitcommandevent actions didn't have the name or target properly marked, so it wasn't moving
spawningtool currently has no setup.py module and thus cannot be distributed easily beyond doing a git clone.
We should create an extra directory layer "spawningtool" on top of the main spawningtool dir and a setup.py module within the first directory
spawningtool
MANIFEST.in
README.md
setup.py
spawningtoolspawningtool.py
We should all the user to be able to specify a certain point in the game (by game time) that they do not want any more output to be shown. We can do this from the command line
spawningtool myreplay.SC2Replay --cutoff-time 10:00
Results will look like:
9 0:49 Pylon
12 1:34 Gateway
13 1:56 Assimilator
16 2:22 Pylon
...
52 9:50 Gateway
Any game events that occur after this time will not be shown. Do we care about flag naming? Suggestions?
With co-op support, we have a more detailed structure for BUILD_DATA
entries
spawningtool/spawningtool/coop_constants.py
Lines 209 to 216 in 9a963f6
Additionally, we also added building entries, which previously weren't necessary because we didn't need to adjust build times for them
I receive the error "FileNotFoundError: [Errno 2] No such file or directory: 'README.md'" when installing from pip using pip install spawningtool.
This is because the sdist does not include README.md and CHANGELOG.md, so it can't build when it's pulled from Pypi. This could be fixed in a few ways. You could build a bdist_wheel as well which should be preferred in newer versions of pip. You could also create a MANIFEST.in which includes the two files.
I filtered that out because I thought it was the for transformation, but I guess I was wrong. I need to go through this replay again and see what exactly happened
from StoicLoofah/spawningtool-site#6
"This will allow for an easy transition after the next patch once Burrow starts taking 5 seconds to research at Hatch tech."
From @tthieman
Just made this change on master since this is actually how the replays work. It always bugged me that the indexes started at 1.
Also, I brought over the 'is_human' flag from sc2reader.
Replays such as those from http://www.dutchstarcraftleague.nl/vods-replays-of-the-finals-online/ or proleague have in-game lobbies. This both creates spurious events in the game and also means that the game time as given by the replay frames is inaccurate.
Pretty soon I'll be pulling through the entire sc2reader object. In the meantime, this is tied to a request for measuring some macro and economy metrics alongside the build order
http://spawningtool.com/1068/download/
We're completely missing Banelings. I think I kludged the logic for finding the right thing to init.
Thank you so much for your support of the community!
I noticed that instead of Chronoboosts, spawningtool lists NexusMassRecall
in player.abilities
.
This problem seems also to affect http://sc2replaystats.com/
#56 identified many missing buildings and unit types in lotv_constants.py
that ideally should be added for consistency.
Most are properly ignored, but many buildings should appear in the data
The output should account for GameHeart. Specifically,
For example, http://spawningtool.com/1783/
I'm guessing that's supposed to be the Hellbat?
They're both wrong because I need to get into the game client to confirm game data
The first extractor wasn't completed. It was just the extractor trick, but that is currently indistinguishable in the output
Related to GraylinKim/sc2reader#185
Since Blizzard announced that they aren't shipping any more commanders, we should get complete coverage rather than leaving just one commander unparseable.
So in build orders, it's really helpful to have things marked as "Barracks Reactor" and "Starport Reactor", but in units lost, it's just "Reactor" or "Tech Lab". There's not a problem with this explicitly at the moment, and the data is all clear, but if the build order and the units lost ever get mashed up, we probably need to drop back to the units in sc2reader instead of labels in spawningtool.
It's still kinda off for replays even after 7a8e480
http://spawningtool.com/16875/
So both landing Orbital Commands and morphing them count as UnitTypeChangeEvents, which is unfortunate because we get extra entries for landing buildings. With the data given, I actually don't know how to disambiguate those 2 things at the moment, but I'll need to do some digging.
I wonder whether I'm actually handling landing builds properly at all. Ugh, this UnitTypeChangeEvent seems to be more complicated than I had anticipated...
I am trying to came back to SC2 and now using again the tool.
But I don't know why the time on the game and on the overlay is aways desynchronized. Even if I try to change the parameter of speed on the tool ... I've tried on fast and faster and had the same result.
I think this could be a local machine problem, but I've found this link and using a chronometer, I've notice that the time on the spawning tool is wrong. In faster, 60 seconds run in the same 60 seconds on my chronometer.
I will clone the repo to try fix this bug, but any way, if is already something that you guys have knowledge please let me know.
Currently, I'm using the playerstats to extract supply counts and then interpolating supplies between those data points. This method only has a resolution of 10 seconds, so I should check that continuously.
Python 3, Windows 10, SC2 version 5.0.9, likely trying to process an old replay version, but I don't know.
C:\Program Files (x86)\StarCraft II\Replays>python -m spawningtool replay1.SC2Replay
Traceback (most recent call last):
File "C:\Users\chalu\AppData\Roaming\Python\Python37\site-packages\spawningtool\__main__.py", line 113, in main
include_map_details=bool(args.map_details))
File "C:\Users\chalu\AppData\Roaming\Python\Python37\site-packages\spawningtool\parser.py", line 836, in parse_replay
return parser.get_parsed_data(cutoff_time, cache_dir, include_map_details)
File "C:\Users\chalu\AppData\Roaming\Python\Python37\site-packages\spawningtool\parser.py", line 218, in get_parsed_data
self.check_replay_version()
File "C:\Users\chalu\AppData\Roaming\Python\Python37\site-packages\spawningtool\parser.py", line 286, in check_replay_version
), self.parsed_data)
spawningtool.exception.ReplayFormatError: No tracker data could be found, despite this being the right version (55958). Sorry.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\chalu\AppData\Roaming\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\chalu\AppData\Roaming\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\chalu\AppData\Roaming\Python\Python37\site-packages\spawningtool\__main__.py", line 124, in <module>
main()
File "C:\Users\chalu\AppData\Roaming\Python\Python37\site-packages\spawningtool\__main__.py", line 117, in main
print(error.message)
AttributeError: 'ReplayFormatError' object has no attribute 'message'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.