Why is AI still so dumb

ThunderLizard2

Warlord
Joined
Oct 6, 2010
Messages
269
I haven't played Civ5 for a few years and just tried a game with BNW. I would have thought the AI would have improved substantially over the years but it's still totally incapable of mounting a serious attack. I have Huns and Netherlands both attack at least 5 times and they aren't able to get anywhere near one of my cities. I only have a handful of units and the AI seems unable to advance their units in a sensible way.

Are there any mods planned that could improve the AI?
 
You could always take a quick peek in the C&C sub-forums.... plenty of great material to choose from.

Try this one by Delnar_Ersike (he's done a great job on it IMO).

I like the way they often sue for peace as soon as another army comes to join their attack. :rolleyes:

I like the way you can have 4 units defending and see 10-15 same tech units approaching and thinking "is that all you got?"

I like they way they will sometimes retire even though they outnumber your defenders almost 2:1. :lol:

Pikeman are often wiped out by one arty salvo. So what do they do? That's right, send in more Pikemen!!

These aren't complaints, I actually never get tired of beating up on the AI.

Denounce this!!
 
AI is not that dumb when it comes to military. If you use Deity difficulty, you will see how bad AI is at attacking and unit spamming. Higher difficulty AI isn't that smart but may have enough of what it has to be victorious over you if you don't know what to do or manage and what not.
 
quote If you use Deity difficulty, you will see how bad AI is at attacking and unit spamming.

Having an AI that just spams tons of units is no solution. It makes it rather dull and tedious.

I'll give the mod version a try.
 
I love kicking the AI's butt, if they make the AI too smart in Civ 6 that pleasure will be taken away from me, so thanks, but no thanks.
A little bit smarter AI when it comes to military strategy is a welcome sight, a very intelligent militarily AI and we get our s. handed to us and nobody wants to play a game with little to no chance of winning.
Besides, AI gets all kinds of unfair bonuses on higher difficulty levels.
The trick for the developers is to make AI smart enough to not need these bonuses (perhaps only slight bonuses) but make them think like a human player.
 
The trick for the developers is to make AI smart enough to not need these bonuses (perhaps only slight bonuses) but make them think like a human player.

Yes, much better to be challenged by a AI that out thinks you then one that just has stacked growth advantages.

I am sure that programming challenge is probably daunting. But there are some simple things that could be done.

Have the AIs gang up on the human player when he is emerging as the leader.
Have the AIs stop fighting each other when they are falling behind.
Have the AIs DOW the human player shortly after he DOWs another AI. A human player would know that you have probably left your flank unguarded.
 
The trick for the developers is to make AI smart enough to not need these bonuses (perhaps only slight bonuses) but make them think like a human player.

It's not that Firaxis doesn't "know" how to create a functional AI - it is simply that they do not wish to invest more than the bare minimum amount of resources (a.k.a. money, and also time allocated for testing) in the creation of the AI.

They just do not see the need to do so, and if there is not an absolute need to do so, why narrow the profit margins by hiring more programmers, or giving the project a couple more months of dev time?
 
There's also the question of turn timers. In the late game 12 Civ games on high difficulties have turn transitions of 1 min+. Imagine if the AI actually had to calculate the best move for all their military units.

I have a suspicion that this is in fact the biggest reason for the stupid combat AI.
 
There's also the question of turn timers. In the late game 12 Civ games on high difficulties have turn transitions of 1 min+. Imagine if the AI actually had to calculate the best move for all their military units.

I have a suspicion that this is in fact the biggest reason for the stupid combat AI.
You are correct for the most part: besides Great Works swapping, almost all algorithms that I know of that prolong AI turns are related to the pathfinder, and Great Works swapping is only slow because it is implemented extremely poorly, as in it contains rookie C++ mistakes (mistakes that you'd expect from a university student); it was probably programmed by someone who is more comfortable with Lua than with C++, hence the usage of stuff that's common in Lua but is unnecessarily complicated for C++.
The pathfinder is... well... it's slow because it is extremely thorough, very exact, and completely serial (ie. none of its algorithms can run in parallel, so the program is forced to go through all the steps one at a time using, usually using only one core). After all, you can't have the AI moving a unit in a way that a human player wouldn't be allowed to. Heck, just try switching to Strategic View (to avoid framerate slowdown caused by graphics), select a unit, hold down the right mouse button, and just move your mouse in giant circles on the screen: each time your mouse hovers over a different tile, the game's pathfinder needs to check what the shortest route is to that tile using the unit you selected. For me, the result is a drop from roughly 120 FPS to 100 FPS if I move my mouse quick enough, though this is with AuI's pathfinder performance improvements (a few of which were borrowed from the Community Patch Project); without them, I can easily drop down to 80 or 70 FPS. Since every AI, even the city states, needs to run possibly thousands of pathfinder checks each turn depending on how many units are in play, long turns are inevitable as the game progresses and the AI has to keep track of more and more units, allies and enemies alike.

Fixing it is not impossible, but it would be time consuming. Having worked with Civ5's pathfinder code a lot for my mod, I can safely say that not even Firaxis has a clear idea of how its pathfinder works, as proven by odd code bits of data being cached and then never used, or successive steps performing the same, expensive calculations again and again with only slight modifications each time. I've messed around with trying to allow for multithreading of the "what neighboring tiles can I move to?" code using OpenMP, but the game acted strangely each time, so I've shelved my plans for now. If anyone with the knowhow and/or the patience to implement C++ multithreading is interested though, I'll be happy to help them get acquainted with Civ5's pathfinder.
 
The AI mod from Delnar is an improvement. However, my conclusion is that there's something fundamentally flawed with Civ 5 that a mod can't correct. I still have the AI doing really stupid stuff early game and late game is a joke. The AI has no idea how to combine air/sea/ranged/melee units into a coherent offense or defense even though they have tons more units than I have.
 
Last game I was attacked with 2 melee units and 8 catapults. That cats must have been jacked up though, they were kind of hard to kill with swordsmen.
 
I haven't played Civ5 for a few years and just tried a game with BNW. I would have thought the AI would have improved substantially over the years but it's still totally incapable of mounting a serious attack. I have Huns and Netherlands both attack at least 5 times and they aren't able to get anywhere near one of my cities. I only have a handful of units and the AI seems unable to advance their units in a sensible way.

Are there any mods planned that could improve the AI?

Try this one. I am using it and China is quite impressive.

http://forums.civfanatics.com/showthread.php?t=545442
 
Best AI of any Civilization game is Civ4+Realism Invictus.

The reason why the AI in Civ5 is so poor is because the money allocated to it was spent on CivWorld, Sid's vanity project du jour.

Getting a tactical AI should have been easy, just borrow one from the plethora of Panzer General type games.
 
The reason why the AI in Civ5 is so poor is because the money allocated to it was spent on CivWorld, Sid's vanity project du jour.
Possible, but not necessarily probable. The biggest clue I can find to why Civ5's AI is so poor is that in Civ5's source code, AI routines that were made during Civ5's development are often implemented much more obtusely than the parts that appear to have been in the code since Civ4. I'd wager that Firaxis either had a lot fewer good C++ programmers working on Civ5 than on Civ4 or they moved their good C++ programmers to work on the engine side instead of the game side.

Getting a tactical AI should have been easy, just borrow one from the plethora of Panzer General type games.
The Panzer General series has had a lot of time to hone its tactical AI, just like how Civ5's citizen automation has had a lot of time to be tweaked and improved to the excellent system you see today. Really, the only bad bit of the citizen automation code that wasn't something added in Civ5 (specialist unhappiness modifier, specialist food consumption modifier, flat GPP points instead of contributions to GPP %) is a buggy production focus option when the city has at least one Engineer spot (the code will allocate unemployed citizens before filling up tiles that generate one hammer).
Keep in mind that Civ5's tactical system has a lot more "weird" options than the systems in Panzer General games: there are units that generate yields when they defeat an enemy unit, units that push enemy units around, units that can capture defeated enemy units, situations where a unit might be better off pillaging the tile it is on for the healing than attacking, etc.

It's not always necessarily about the tactical AI being bad, BTW: I have found that oftentimes it's the fact that it needs to be married with a 4X-style AI is what mucks things up. It doesn't matter how good Civ5's tactical AI is programmed if the AI that handles unit production makes 2 composite bowmen and 1 catapult while four swordsmen stand around city waiting for the units to finish (instead of farming barbarians or patrolling around), then sends those units out to attack a walled city without sending any backup.
 
Yes, much better to be challenged by a AI that out thinks you then one that just has stacked growth advantages.

I am sure that programming challenge is probably daunting. But there are some simple things that could be done.

Have the AIs gang up on the human player when he is emerging as the leader.
Have the AIs stop fighting each other when they are falling behind.
Have the AIs DOW the human player shortly after he DOWs another AI. A human player would know that you have probably left your flank unguarded.

This is the opposite of what i want to see!

I want the AI to act like humans, where taking a strong ally for protection can make sense, and long term allies work together.

I dont want them to play like computer opponents trying to 'win a game' that is a loss of immersion for me

The AI did used to gang up on you when you got a big lead, cant remember which civ game it was now.

I do get what you mean though.
 
The AI is so dumb for the same reason that the game is unstable in MP. A complete lack of resources being committed to the problem. Firaxis made their money on us when we bought the game. Their incentives for making the game better after that seem to be quite low.
 
I think that's unfair. Brave new world and its patches have made the game highly flexible and enjoyable, whether you finish in an early rush or play through the late game. I don't feel abandoned by the developers. There are good mods for minor tweaks if you want (Ryika and zhu zhu (sorry about the spelling) have some good simple mods that don't break the game). On the level of dumb AI, I have to say that I still get spanked in combat on deity. Immortal too if I get caught off guard. I like the combat system in V much better than the stacks of doom from previous versions. I think for a first attempt at 1upt, the devs did a decent job.

Of course, I'm hoping that if I post enough defenses of Firaxis, they will send me civ 6 beta and ask for my valuable input. :)
 
Top Bottom