We have triggers designed to make workers behave like they did in brood war for the arcade map starbow. There’s explanation in the video if you’re interested.
However, the triggers get in the way of the built in melee ai transferring workers as well as spreading them out across expansions. When the main base is mined out workers will remain next to the depleted patches.
Also, when the trigger is removed they behave as expected. Spreading out across bases and transferring as minerals become depleted.
I was wondering if someone more familiar with triggers and ai might offer some insight to how we might fix this problem. The triggers can be downloaded in the mod file ‘StarbowBeta’ and the trigger that controls worker behaviour is called ‘SBOWTriggers/Mineral Harvesting’.
Would it be possible if you could post the specific trigger causing the problem here? Not everyone might have access to the editor or the ability to log in and get the mod.
The AI will mess up worker distribution like described if the workers are removed from the AI control (possible if they are ordered implicitly with triggers?) or if the spread between bases AI behaviour flag is disabled (I think Campaign AI has this off by default).
Sure, I can attach the syntax for those who can't access the editor or log in.
Attached are the triggers in a .txt file. I would have posted it here but the post loses the syntax spacing. I've left in only the pieces associated with SCVs to cut down on the amount of code shown but it's the same logic repeated for drones and probes anywhere were SCV is referenced.
Edit: The workers are indeed ordered to bounce when there's an available mineral field otherwise they wait. Any thoughts on how to get them back into their normal cycle?
Unit - Order (Triggering unit) to (SCV - Gather targeting (Random Any unit from (Units in (Mineral Field units in (Region((Position of (Triggering unit)), 10.0)) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) with custom value 0 equal to 0.0))) (Replace Existing Orders)
This is likely the problem for reasons I already mentioned. When you explicitly order a unit with triggers it probably removes it from AI control so as not to interfere with your order (otherwise the AI might immediately order it to do something else). Instead suggest the SCV to perform an order using the appropriate AI action. The AI will try its best to perform the order (APM constraints apply) however you might need to check later if it actually was executed.
Good news: the trigger does not break the AI. I can use it in HotS just fine, but in StarBow it breaks.
Unfortunately, that means that I've no real clue what is causing the problem other than: something else in the mod.
I suspect that the AI somewhere attempts to build a unit or structure that is not available to it or something like that and blocks itself somehow. But unfortunately, I don't know enough about the AI to be certain.
Does anyone have an idea or a method to find out?
Hi Ahli and ImperialGood, thanks for your help with this so far. It's greatly appreciated.
Ahli, I’m trying to reproduce the behavior you describe when you tested the mineral harvesting trigger in an sc2 map but have not been able to.
I took an sc2 map (Ohana) and added in the SBOWTriggers. Played a game against the ai (zerg) and the workers did not transfer. Nor did the ai mine gas and thus not build gas units.
I then modified the map so the only new triggers in there are ‘Mineral Harvesting’ and I get the same result. Workers don’t transfer, gas doesn’t mine, etc.
Finally, I added in the SBOWTriggers and I disabled the triggers in the subfolder ‘Mineral Harvesting’ and the ai behaves appropriately. It spreads workers out across bases, mines gas, and builds gas units such as roaches, hydras, infestors, vipers etc.
I attached the replays with the corresponding file names.
If you’d like to check the latest map I describe, the one with all the starbow triggers available except the mineral harvesting being disabled you can find it in the map called ‘Ohana_Test_20150410’.
Unless I’m missing something, this leads me to believe that the triggers within ‘Mineral Harvesting’ are causing the ai to not transfer workers, mine gas, etc.
The campaign AI will not build anything. It is a minimalistic template AI. If you want it to build stuff you need to instruct it with other trigger actions (like how the Melee AI works under the hood).
Having watched the youtube of what you want to do I am now even more confused. As far as I can tell SC2 harvesters still do the same distribution mechanics as they did in SC1. They automatically optimize harvesting with nearby mineral fields so as to minimize idle time. In Standard melee (WoL at least) you can grab 12 workers and order them onto 6 mineral fields and after a few seconds they will be distributed 2 each. Throw in another 6 workers and they will distribute 3 each (however there is a lot of idle time so might have some movement around). Add another 3 mineral fields and they will go back to 2 each automatically.
The explicit orders are likely removing the harvesters from AI control which is why they break.
We have a band-aid solution where we add in a condition so the AI doesn't use the Mineral Harvesting Triggers. This results in the AI mining minerals evenly across bases as well as mining gas while active human players keep BW econ.
If you could explain what "BW econ" is we might be able to help you...
If worst comes to worst you could eat at the AI APM by trying to order it to do it through the appropriate AI native (suggest order) which will give you end results similar to what humans have and what you have currently. You may need to raise APM to compensate for the lost APM from it however.
Another approach would be to try and add the units back to AI control after the orders. This would be the best solution as the AI will then continue using the worker properly even with the current implementation.
I've fixed the problem via ordering the workers via effects. I've created an effect that issues the gather order to the caster unit to the target unit.
Hi all,
We have triggers designed to make workers behave like they did in brood war for the arcade map starbow. There’s explanation in the video if you’re interested.
However, the triggers get in the way of the built in melee ai transferring workers as well as spreading them out across expansions. When the main base is mined out workers will remain next to the depleted patches.
Also, when the trigger is removed they behave as expected. Spreading out across bases and transferring as minerals become depleted.
I was wondering if someone more familiar with triggers and ai might offer some insight to how we might fix this problem. The triggers can be downloaded in the mod file ‘StarbowBeta’ and the trigger that controls worker behaviour is called ‘SBOWTriggers/Mineral Harvesting’.
Would it be possible if you could post the specific trigger causing the problem here? Not everyone might have access to the editor or the ability to log in and get the mod.
The AI will mess up worker distribution like described if the workers are removed from the AI control (possible if they are ordered implicitly with triggers?) or if the spread between bases AI behaviour flag is disabled (I think Campaign AI has this off by default).
Here is a map with only these triggers:
https://www.dropbox.com/s/gu3h25mxbcje2iv/Only%20mining%20triggers.SC2Map?dl=0
Sure, I can attach the syntax for those who can't access the editor or log in.
Attached are the triggers in a .txt file. I would have posted it here but the post loses the syntax spacing. I've left in only the pieces associated with SCVs to cut down on the amount of code shown but it's the same logic repeated for drones and probes anywhere were SCV is referenced.
Edit: The workers are indeed ordered to bounce when there's an available mineral field otherwise they wait. Any thoughts on how to get them back into their normal cycle?
This is likely the problem for reasons I already mentioned. When you explicitly order a unit with triggers it probably removes it from AI control so as not to interfere with your order (otherwise the AI might immediately order it to do something else). Instead suggest the SCV to perform an order using the appropriate AI action. The AI will try its best to perform the order (APM constraints apply) however you might need to check later if it actually was executed.
Good news: the trigger does not break the AI. I can use it in HotS just fine, but in StarBow it breaks.
Unfortunately, that means that I've no real clue what is causing the problem other than: something else in the mod.
I suspect that the AI somewhere attempts to build a unit or structure that is not available to it or something like that and blocks itself somehow. But unfortunately, I don't know enough about the AI to be certain.
Does anyone have an idea or a method to find out?
Hi Ahli and ImperialGood, thanks for your help with this so far. It's greatly appreciated.
Ahli, I’m trying to reproduce the behavior you describe when you tested the mineral harvesting trigger in an sc2 map but have not been able to.
I took an sc2 map (Ohana) and added in the SBOWTriggers. Played a game against the ai (zerg) and the workers did not transfer. Nor did the ai mine gas and thus not build gas units.
I then modified the map so the only new triggers in there are ‘Mineral Harvesting’ and I get the same result. Workers don’t transfer, gas doesn’t mine, etc.
Finally, I added in the SBOWTriggers and I disabled the triggers in the subfolder ‘Mineral Harvesting’ and the ai behaves appropriately. It spreads workers out across bases, mines gas, and builds gas units such as roaches, hydras, infestors, vipers etc.
I attached the replays with the corresponding file names.
If you’d like to check the latest map I describe, the one with all the starbow triggers available except the mineral harvesting being disabled you can find it in the map called ‘Ohana_Test_20150410’.
Unless I’m missing something, this leads me to believe that the triggers within ‘Mineral Harvesting’ are causing the ai to not transfer workers, mine gas, etc.
The campaign AI will not build anything. It is a minimalistic template AI. If you want it to build stuff you need to instruct it with other trigger actions (like how the Melee AI works under the hood).
Having watched the youtube of what you want to do I am now even more confused. As far as I can tell SC2 harvesters still do the same distribution mechanics as they did in SC1. They automatically optimize harvesting with nearby mineral fields so as to minimize idle time. In Standard melee (WoL at least) you can grab 12 workers and order them onto 6 mineral fields and after a few seconds they will be distributed 2 each. Throw in another 6 workers and they will distribute 3 each (however there is a lot of idle time so might have some movement around). Add another 3 mineral fields and they will go back to 2 each automatically.
The explicit orders are likely removing the harvesters from AI control which is why they break.
We have a band-aid solution where we add in a condition so the AI doesn't use the Mineral Harvesting Triggers. This results in the AI mining minerals evenly across bases as well as mining gas while active human players keep BW econ.
If you could explain what "BW econ" is we might be able to help you...
If worst comes to worst you could eat at the AI APM by trying to order it to do it through the appropriate AI native (suggest order) which will give you end results similar to what humans have and what you have currently. You may need to raise APM to compensate for the lost APM from it however.
Another approach would be to try and add the units back to AI control after the orders. This would be the best solution as the AI will then continue using the worker properly even with the current implementation.
I've fixed the problem via ordering the workers via effects. I've created an effect that issues the gather order to the caster unit to the target unit.
http://hastebin.com/hecocebudu.xml
The problem seems to be created due to trigger-orders while effect-orders seem to work fine.