Replies: 1 comment 1 reply
-
I think you described the issue pretty well! I don't have a solution for you, but will just go as far to say that it indeed is hard to simulate the circumstances that may affect production. While I was trying to generate build orders, I was getting tripped up by the fact that Contaminate affects the build time of a unit. I ended up just throwing in the towel on that and pretending like it didn't happen, but I'm sure that chronoboosts, supply blocks, etc. can all mess with it too. I just told myself that the point of generating build orders was to simplify and not to end up replicating the entire logic of a game and the SC2 client =P |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, I'm trying to reproduce the state of the production queue at all times throughout the replay, but having quite a bit of difficult capturing Train/Cancel events from buildings.
It's fairly simple to capture Zerg events, because the unit always enters the production queue exactly at the time of the
Morph<Unit>
event, and capturingCancel
events is not necessary, since the production unit can be associated with an larva uid. If the morph is cancelled or the egg is killed there is aUnitDied
event associated with that uid.But for queens and Terran and Protoss units, the
Train<Unit>
command puts the unit in a building's queue, and there is no event when the unit actually starts production. To make things more complicated, even though it's possible to see what buildings are currently selected using theSelectionTracker
plugin, there is no direct information about which one of those buildings theTrain<Unit>
command gets issued to. To resolve the priority of those buildings, you need to know:It's even more complicated than that though, because even though Marauders can be built at barracks, they can't be built at all barracks... only those landed next to Tech Labs, and similarly, marines will be preferentially be built at barracks with reactors before they are built at barracks without addons, and preferentially at barracks without addons before barracks with tech labs.
The problem of simulating structure queues seems fairly workable to know which building has the shortest queue by time. I don't have any ideas about how to easily check the current state of the command card e.g. "can we build Marauders with this barracks or not". It does appear there is some information in the
sc2reader/data/command_lookup.csv
, which, for example associatesBarracksTrain
withTrainMarine
,TrainReaper
,TrainMarauder
, etc, but it doesn't have a direct link to the barracks unit, nor does it account for any state information like whether or not the Barracks is landed next to a tech lab, flying, or whatever.Any ideas about what the right way to track this might be? I'm kinda thinking some additional linking information between units/buildings and command/abilities might be in order, plus queue state tracking, plus some special functions e.g.
hasTechLab()
to check things that aren't tracked by UnitTypeChangeEvent. I don't really want to add anything to the unit data structures though, I think it should all be done through lookups.Beta Was this translation helpful? Give feedback.
All reactions