spawningtool
spawningtool copied to clipboard
Note when things are canceled
http://spawningtool.com/6805/
The first extractor wasn't completed. It was just the extractor trick, but that is currently indistinguishable in the output
@graylinkim: does sc2reader explicitly keep track of whether a building is canceled or not? I briefly searched the unitinitevent and unit and searched for "cancel", but I didn't see anything that looked like it tracked this. Is that available, and if not, is that either 1) something you have some inkling of how to track and 2) worth contributing to the sc2reader core?
AFAIK you can grab a cancel in something like CommandEvent
, BasicCommandEvent
or DataCommandEvent
(I can't remember which one). It reads something like "CancelAbl". However you cannot (or at least I couldn't) have directly the target of the cancel. You may test with the selection tracker to get te selected building at this moment. Careful though, I tested that with the cancel of an upgrade, I don't know if the cancel of a building is working the same way.
Alternative approach: notice when buildings don't complete at the expected time (or in the case of the extractor trick, never complete), and mark those as delayed/cancelled.
@EHadoux is right. You can combine the selection and Cancel events to detect when certain things get cancelled. This is easy with the extractor trick and hard when its a player that has 9 production facilities selected and building stuff. In the later situation you'd need some way of tracking the production queue state for each of the facilities to determine which production in which unit's queue gets cancelled.
Also, I don't know if Cancel commands can be spammed (e.g. Canceled when there is nothing to cancel). I'd suspect that they can't be spammed but if they can then that might be confusing depending on how you are using them.
I didn't want to open a new issue but, concerning the timing (as displayed in the wiki in diving into the data) is this the timing of the event or the timing of completion - the duration? I have no time to dive into the code at the moment but this came to my mind when I saw the modifications in the wiki.
It is supposed to be the time started since that is more consistent with how build orders are written.
I openly admit that it can be quite misleading: with supply blocks, contaminate, and chronoboost, it can be dicey to do the math backwards on units. With buildings, there's the issue above about canceling. Yeah, it's messy
Just took a look at this one, and it does appear to be a pain.
The primary case I'm interested in is canceled buildings. The relevant event is in replay.game_events
and is a BasicCommandEvent
with event.ability.name == 'CancelBuilding'
.
As best as I can tell, the event itself doesn't have any identifying information about what the actual selection target is, so @EHadoux was right that it would need to be used in conjunction with the selectiontracker.
At that point, it seems like this perhaps shouldn't be a spawningtool feature because the selectiontracker parses the replay live, whereas spawningtool parses it completed. Instead, maybe I should write a sc2reader plugin that marks things as canceled if they're canceled. Then, I could extract that value directly with spawningtool.
Worth it, or has someone else already tackled this problem?
I did not try to solve this problem yet but if/when I would/will, it will be with the ending time of the building as nothing can change the building time (CB, contamination and stuffs like that do not affect building). Actually, there is one thing that can mess the calculus up: calling the SCV back before the end of the building and putting it back later to finish. I cannot think of something else (and this is pretty uncommon, except for the second supply depot that can be started a bit earlier to wall without finishing it and EBay block).
I carry on following the advancement of this project as I have in mind to eventually merge all the stuffs together, alongside sc2reader analyzing and David's DorkShrine.
Ugh, yeah, it gets really messy with SCVs building. It is maybe slightly more common because of worker harassment and having to pull workers on and off.
I would like to be more accurate, but I wonder where the line is between extracting and modeling data to actually simulating the game itself. I think I keep determining that it isn't worth the work, then forget that, then look at it again, and so forth.
If I do implement this, it will be a sc2reader plugin. No ETA on that