AI is somehow aware of enemy terra orders and tries to nuke leftover ones
http://zero-k.info/Battles/Detail/738142
during this battle, AI repeatedly tried to nuke leftover terraform order "unit" from players (nuking part of own territory in the process).
lamer from #AI channel: @GoogleFrog , Is FAKEUNIT category can be added to terraunit? I'd like to add code to ignore any (own or enemy) unit with specific hardcoded category (like FAKEUNIT for example) and TERRAFORM category doesn't sound generic.
Was "LOS cheating" enabled in OP's battle (AIOptions.lua)? If not then there must be a bug in gadget/engine. In normal mode terraunit is not visible to ai, doesn't generate ai events (for enemy) and OOAICallback::GetEnemyUnits from API doesn't return terraunits, unless LOS-cheating is enabled, which i consider viable cheap replacement for scouting. It should be turned off by default though. With LOS-cheating AI has to know what units it should ignore, for example because they are not actual units but only a workaround for specific mechanics (like fakeunit or terraform). Options i consider:
- UnitDef's FAKEUNIT category. But it has a flaw when LOS-cheating is disabled but enemy unit is inside radar but not los, then AI won't be able to read UnitDef until unit gets into LOS.
- "ignoredByAI" public UnitRulesParam. It is already used for campaign i think (neutral units), and AI doesn't register enemies with ignoredByAI flag. I want to extend it so ally/own units won't be registered with ignoredByAI too. But then lua has to set public URP ignoredByAI for each such unit; and i'm not sure, can lua set it before UnitCreated/UnitFinished event?
-
"LOS cheating" wasn't enabled, or at least was turned off in AI configs (so, if it was active, it would be different bug).
-
While the fix by GF is appreciated, at the time of trying to nuke terra orders, AI was not having numerical advantage, so I don't believe that the issue should be really "closed".
Closing as part of housecleaning.