I’m going to try to keep this as brief as I can.
One of the most common complaints I see about strategy games is that the AI doesn’t play well. That is, in fact, a reality and there are a lot of reasons for it which I want to talk about in this blog.
The biggest factory today against good AI is the bell curve. If you can make the AI “good enough” to beat 90% of the players on a reasonably high difficulty, it gets very tough to justify the extra expense in making it better.
As much as people complain about AI in say, Civilization V, it is probably good enough to beat most people on Prince or higher. But that is little consolidation to those who find it easy to beat. The same is true on Fallen Enchantress and its expansion, Legendary Heroes. Once you make it good enough to beat “most people” it gets hard to justify spending money on more time on it.
A friend of mine in Firaxis used to beat Civilization V (or IV, I forget which) because he had figured out patterns in the random number generator. That’s a pretty tough threshold to top in terms of “knowing the game”.
But why isn’t AI just inherently better? After all, I’ve seen a lot of people talk about how good the AI in Galactic Civilizations II is. And that comes down to how AI is made today versus how it used to be made.
In Civilization IV (and in Galactic Civilizations II) the game designer also wrote the AI including the worker functions. This meant that the designer knew exactly what the AI would do in various circumstances. The problem with that is that as games have gotten bigger, it has gotten a lot tougher for the designer to have time to both manage the many parts of the game’s design and find time to write the AI.
In the original Elemental: War of Magic, I wrote mainly the high level algorithms. I didn’t have time to write the AI itself. For Fallen Enchantress, I wrote the high level tactical AI and the high level strategic AI. What that means is that I have the AI call various worker functions like “AIGetAreaThreat(radius)”.
In Civilization IV, Soren Johnson, the designer, wrote the both the high level AI and all of the worker functions too. That’s very hard core and extremely rare these days. I wrote the high level AI and the worker functions in Galactic Civilizations II: Dark Avatar and that was the last game I got to do that on (in Twilight, I relied on worker functions written by the team).
The problem with AI worker functions comes down to communication between developers. It takes so little for an AI to be stupid or to seem stupid. Let me give you an example of something I worked on this evening: When the AI decides whether or not a city is defended enough, it calls “AIGetAreaThreat()”. However, after wiping out the AI one too many times because its cities were poorly defended I decided to look at this function. It turns out, it wasn’t looking inside enemy cities (i.e. if a city was stationed in a city, it didn’t “see” it).
I know when I call AIGetAreaThreat() I want to know all the units, not just the units on the map. But that’s the thing, another developer might think you only mean units on the map (such as in this case). You add enough examples like that and suddenly you end up with non-ideal AI.
The problem with writing worker AI functions is that they are really…really time consuming. And AI developers tend to be expensive. Firaxis got lucky with Soren back in Civilization IV. But that’s an atypical situation (I think Soren also wrote the AI in Civilization III as well but I could be wrong).
Now, in the case of Fallen Enchantress: Legendary Heroes, I play the game post-release so I can, in my spare time, update the AI (which is what I’m doing at 9pm on a Monday). But that’s atypical and could never be economically justified by a studio because, as-is, the AI in these games is typically more than “good enough” for most people.
“Good enough”, of course, is a symptom of a different problem and that is how disposable modern games are and the changes that attitude has had on the industry and how games are made. 