Zero-K icon indicating copy to clipboard operation
Zero-K copied to clipboard

AI is somehow aware of enemy terra orders and tries to nuke leftover ones

Open Cat-Lady opened this issue 7 years ago • 4 comments

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).

Cat-Lady avatar Jun 23 '19 22:06 Cat-Lady

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.

Cat-Lady avatar Jul 01 '19 09:07 Cat-Lady

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:

  1. 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.
  2. "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?

rlcevg avatar Jul 01 '19 16:07 rlcevg

  1. "LOS cheating" wasn't enabled, or at least was turned off in AI configs (so, if it was active, it would be different bug).

  2. 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".

Cat-Lady avatar Jul 02 '19 08:07 Cat-Lady

Closing as part of housecleaning.

Cat-Lady avatar Apr 23 '21 03:04 Cat-Lady