AI can't find other player's gates, which leads to fool behavior when facing gate

Game Version:

  • Build: 37650
  • Platform: Steam
  • Operating System: Windows 10
  • Gamertag: Newtonerdai

Issue:

  1. AI scripts “up-find-remote c: XX c: 40” can’t find any Gates of other players, no matter what the “XX” is “939(gate-class)” or “-1” or “64(gate closed)” or “78(gate opened)” or such direct UnitID.
    But it does work when up-find-remote with sn-focus-player-number set to my-player-number (find the gates of AI itself)

  2. Relatedly, AI will regard the gate of other players as an indestructible object, at least when TSA(set
    town-size to a large value to urge units to attack any enemy objects sighted). Actually it works normally in Userpatch 1.5.
    .

Reproduction Steps:

.
I: AI can’t find other player’s gates, but can find those of itself.

  1. Paste these code in .per for test:
    (defconst gl-local-total 100)
    (defconst gl-local-last 101)
    (defconst gl-remote-total 102)
    (defconst gl-remote-last 103)
    ;
    (defrule
    (game-time > 0)
    =>
    (up-full-reset-search)
    (up-find-local c: 939 c: 10) ;939 = gate-class
    (up-chat-data-to-all “Local-total : %d” g: gl-local-total)
    ;---- find P1’s gates ----
    (set-strategic-number sn-focus-player-number 1)
    (up-find-remote c: 939 c: 10)
    (up-get-search-state gl-local-total)
    (up-chat-data-to-all “Remote-total-other : %d” g: gl-remote-total)
    ;---- find self’s gates ----
    (set-strategic-number sn-focus-player-number my-player-number)
    (up-find-remote c: 939 c: 10)
    (up-get-search-state gl-local-total)
    (up-chat-data-to-all “Remote-total-self : %d” g: gl-remote-total)
    )

  2. Create a new scenario in editor, specify AI for P2, place some gates on the map like this picture↓
    .

  3. Test the scenario. AI will return right value of [Local-total] and [Remote-total-self], but return 0 of [Remote-total-other]. Or you can replace “939” by “-1” or direct gate UnitId like “64(gate closed)”, the result of [Remote-total-other] will be the same.

II: AI regard other player’s gate as an indestructible object.

  1. Paste these code in .per for test:
    (defrule
    (true)
    =>
    (set-strategic-number sn-maximum-town-size 100)
    (disable-self)
    )

  2. Create a new scenario in editor, specify AI for P2, place some gates, units, TC and enclosing cliffs on the map like this picture↓
    .

  3. Test the scenario.
    You will find that when gate is closed, AI’s soldiers don’t attack the gate, and would rather try finding another way to attack your units behind the gate.
    .
    (In Userpatch 1.5 case, they will attack closed gates of enclosing fortifications like this↓)
    ai attack gate instead of being in a daze in UP1.5
    .
    Then when gate opens, AI’s soldiers rush in immediately, like the picture following↓.
    .

III. Maybe we can conclude that AI in DE will ignore closed gates of other players. Or it is caused by certain bug in target finding system.
This bug should be paid attention to, as far as I think, because this will cause AI’s low intelligence once facing fortifications constituted with gates and terrain blocks.

Have those issues been fixed? @TriRem