*** i do not know coding, but having watched video on how some games do their AI, here is my guess.


Do not think its complex, AI is often skimped out on by games because making proper Ai requires millions of dollars. If i had to guess how Larian does there Ai, it is the following.

1) check for player in PC cone of vision, once that happens set =1

2) roll a 1d20 for initiative, set movement order

3) enemy: roll variable: a,b,c,d [each pc]: move to hostile

4) roll a hit: 1/ all enemy abilities

5) roll a variable: e,f,g [shove, disengage, or bonus action]

6) turn done.

It would explain why the AI only targets the player it sees first, and any pc that attack from stealth will always roll a d1 for enemies and will never get targeted by enemies that already rolled an initiative roll. If my guess is correct, larian could fix this, by forcing a re-roll of initiative once a new PC joins combat instead of doing it as it is now.

Maybe also give Ai a perception roll after every stage 2, and change standing abilities [cloud of daggers, surfaces etc] as environment damage so that the AI can detect it with a perception check and avoid it.