impressive gas steal bug
Stealing gas is irritatingly complicated in Steamhammer. Today I discovered another bug: If the scout worker has been ordered to circle the enemy base forever, and while it’s doing that you decide (this late in the day) to steal gas, then the building manager goes haywire and moves the worker into a corner or some other useless location. Now what??? It worked when I told to it to scout once around the enemy base and interrupted the circle in the middle by deciding to steal gas, but circling more than once somehow breaks it... in a different module.
Of course everything works perfectly if you decide up front to steal gas, so the worker arrives at the enemy base knowing what to do. That’s the usual case. It sure would be nice to support late decisions, but there are interactions with the scouting command.
I think I should write a general purpose plan sequencer and reduce the gas steal to a plan represented as data, not code. It will be more complicated, but I only have to debug it once and it will have tons of uses.
Comments
krasi0 on :
Jay Scott on :
IMP on :
Another advantage of this design is you can just move any unit from any group to the scouter group. The scouter will realize a new unit has been added to its group and will determine how to make use of it effectively.
A unit is only a member of one group at a time.
krasi0 on :
Jay Scott on :
Dang on :
Jay Scott on :
Arrak on :
I think this would have made for easier implementation of kiting improvements, and pathfinding with nydus canals and mineral walking. I didn't manage to detach the worker controls from the building manager yet, though.
IMP on :
IMP on :
Jay Scott on :
IMP on :
The other is the concept of asynchronous state machines. My unit micro is implemented via a fiber framework modelling each unit as an independent actor with its individual asynchronous state machine. In such an implementation it is important not to switch from any state to any other state directly, because it might lead to a stack overflow. Instead the state transition pattern resembles a star, always returning to the "base state" (reducing the stack) before deciding where to transition next. This is the analogy of always giving control back to a central decision maker when changing from one task to another (e.g. scouting to gas steal). Hence no nested tasks.