It is hard, no doubt but You can't say that Panther shooting Tank Destroyer primary rather than AT gun is really difficult. It's just target priority.
I don't know that it is that simple.
Is it simply... "I am being shot by two entities, an m10 and a 57, which do I respond to...?"
Or is the algorithm: "There is an m10 in my mid range and a 57 in my far range. chance to hit the m10 x the chance to penetrate is X, chance to hit the 57 x chance to penetrate it is Y and I am programmed to take the shot with the greatest value." And that is the simple equation. As humans we play time after time so we learn to process and create heuristics to take into account things like:
- Which one is hitting you in the rear?
- can we back out and face armor to both?
- which is more damaged?
- is there infantry on the way to take care of the 57?
- do I have artillery?
- where are the shot blockers? Can I use them?
And that is just one engagement, one unit. We make the decision and then act on it.
What about the AI. How many of these does it make? Does the decision change based because you just made a different action that changes the outcome of the variables? (like the bouncing in and out of garrisoning a house. Each action probably triggered a response in the algorithm to do the OTHER thing.)
And until someone does a WHOLE LOT of testing and tweaking you aren't going to make it even somewhat good. AI in combat games is really really complicated. We don't realize how much we can process as humans that the computer can't until we try to program it. And even when we finally think we did a good job, the decisions the computer makes will still become redictable, and hence, beatable.
On top of that, all of this has to happen fast enough that it doesn't slow down the game.