Why is AI still so dumb

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. :)

The AI is completely stupid and is competitive only through blatant cheating. MP is unstable. These points are fact not opinion.
 
I guess it depends on whether you expect the AI to play exactly like a human being or if you're okay with it receiving advantages to offset the fact that you are way smarter, more flexible, and can change your approaches over time. I get it though - it seems like the bonuses the AI receives really bug some players. I just view it as competitive balance and let it go. I don't wonder where the missionaries or impis come from. I just kill them.
 
I guess it depends on whether you expect the AI to play exactly like a human being or if you're okay with it receiving advantages to offset the fact that you are way smarter, more flexible, and can change your approaches over time. I get it though - it seems like the bonuses the AI receives really bug some players. I just view it as competitive balance and let it go. I don't wonder where the missionaries or impis come from. I just kill them.

The AI does not have to be perfect, but this AI has no common sense at all. It makes such laughable mistakes over and over again. This becomes annoying over time. At least some of the AI mods help with respect to 'move and shoot', which makes combat more bearable. One thing I noticed in the mod I use. The AI fires its artillery and uses its aircraft more effectively. It took one capital city from the Mongols which was between two mountains. To me for this AI, that was quite impressive.

Try it out. http://forums.civfanatics.com/showthread.php?t=545442
 
I guess it depends on whether you expect the AI to play exactly like a human being or if you're okay with it receiving advantages to offset the fact that you are way smarter, more flexible, and can change your approaches over time. I get it though - it seems like the bonuses the AI receives really bug some players. I just view it as competitive balance and let it go. I don't wonder where the missionaries or impis come from. I just kill them.

Giving the AI advantages is a bad way to make the game harder because it creates completely unrealistic play. I would rather have an AI which follows the rules so it would be more akin to playing a real game with a human that is difficult to beat.

What is effective vs a diety AI may be completely terrible vs a good human player and what's good vs a good human player may not be good vs a diety AI due to game mechanics/rules being completely bent or broken.

It's about taking advantage of the AI's stupidity rather than realistic and good strategies that are actually effective.
 
Bear in mind that I know next to nothing about computer programing, but I've been thinking recently about how exactly one would program an AI that didn't rely on advantages. Take, for instance, the concept of "don't move your ranged/siege units ahead of your melee units." Would you write the code for that and then give Deity AI a 100% chance to follow it, Immortal a 90% chance, Emperor an 80% chance, down to 30% at Settler (70% chance to act suboptimally)? How else do you get one AI level to be slightly harder than the next AI level without using advantages like bonus techs, bonus Happiness, extra Workers/Settles/Units? I don't mean this as a criticism; I sincerely want to know because, as I've said, I don't know much about this line of work.
 
Bear in mind that I know next to nothing about computer programing, but I've been thinking recently about how exactly one would program an AI that didn't rely on advantages. Take, for instance, the concept of "don't move your ranged/siege units ahead of your melee units." Would you write the code for that and then give Deity AI a 100% chance to follow it, Immortal a 90% chance, Emperor an 80% chance, down to 30% at Settler (70% chance to act suboptimally)? How else do you get one AI level to be slightly harder than the next AI level without using advantages like bonus techs, bonus Happiness, extra Workers/Settles/Units? I don't mean this as a criticism; I sincerely want to know because, as I've said, I don't know much about this line of work.

One of the easier ways to program in AI difficulty levels that don't rely on stat-based advantages is to rely on knowledge cheats and handicaps. Basically, the AI would always follow the same algorithms on all difficulty levels, but it would have access to the same information as a human player on Prince, have access to more information on higher difficulty levels, and artificially have less access to information on lower difficulty levels. For example, Chieftain AI might "accidentally" ignore one of your military units when running its algorithms: all of its algorithms will execute perfectly, but since the AI acted on incorrect information, it will make subpar decisions. Likewise, Immortal AI might have complete knowledge of what wonders you are building, what social policies you have, where your spies are, and where your military units are, so it can factor all of these things into its decisions while the human player is left in the dark. Deity AI would be able to know the results of random rolls ahead of time and act accordingly (this is possible because Civ5 uses a PRNG system, so the AI could pre-calculate what the results of the next random roll would be and act accordingly): fitting, really, considering the "Deity" name.
 
Bear in mind that I know next to nothing about computer programing, but I've been thinking recently about how exactly one would program an AI that didn't rely on advantages. Take, for instance, the concept of "don't move your ranged/siege units ahead of your melee units." Would you write the code for that and then give Deity AI a 100% chance to follow it, Immortal a 90% chance, Emperor an 80% chance, down to 30% at Settler (70% chance to act suboptimally)? How else do you get one AI level to be slightly harder than the next AI level without using advantages like bonus techs, bonus Happiness, extra Workers/Settles/Units? I don't mean this as a criticism; I sincerely want to know because, as I've said, I don't know much about this line of work.

There's more to it than just 1UPT military tactics. General strategy and build order are very important. The cheater AI's don't have to take these things into account because they get free settlers, workers and build things with far less hammers than normal.

An AI that settles in defensive locations, plants a city forward right before going to war, knows how early to get a library, NC and works tiles which are most beneficial first.

This isn't that hard. They have AI's that can come up with amazing new recipes, beat humans at chess etc... Hell they could be super lazy and just buy IBM's Watson program and tailor it to Civ. That would probably cost less and be more effective than programming their own AI from scratch. That thing would eventually get better at civ than any human most likely.
 
One of the easier ways to program in AI difficulty levels that don't rely on stat-based advantages is to rely on knowledge cheats and handicaps. Basically, the AI would always follow the same algorithms on all difficulty levels, but it would have access to the same information as a human player on Prince, have access to more information on higher difficulty levels, and artificially have less access to information on lower difficulty levels. For example, Chieftain AI might "accidentally" ignore one of your military units when running its algorithms: all of its algorithms will execute perfectly, but since the AI acted on incorrect information, it will make subpar decisions. Likewise, Immortal AI might have complete knowledge of what wonders you are building, what social policies you have, where your spies are, and where your military units are, so it can factor all of these things into its decisions while the human player is left in the dark. Deity AI would be able to know the results of random rolls ahead of time and act accordingly (this is possible because Civ5 uses a PRNG system, so the AI could pre-calculate what the results of the next random roll would be and act accordingly): fitting, really, considering the "Deity" name.
Sadly, I feel this would still lead to complaints that "the AI cheats on higher levels" that we get all too often around here :(
There's more to it than just 1UPT military tactics. General strategy and build order are very important. The cheater AI's don't have to take these things into account because they get free settlers, workers and build things with far less hammers than normal.

An AI that settles in defensive locations, plants a city forward right before going to war, knows how early to get a library, NC and works tiles which are most beneficial first.

This isn't that hard. They have AI's that can come up with amazing new recipes, beat humans at chess etc... Hell they could be super lazy and just buy IBM's Watson program and tailor it to Civ. That would probably cost less and be more effective than programming their own AI from scratch. That thing would eventually get better at civ than any human most likely.

Getting scary flashbacks to Hal from 2001 or Joshua from War Games.
 
Sadly, I feel this would still lead to complaints that "the AI cheats on higher levels" that we get all too often around here :(
Maybe, but it's not the kind of cheating that would force players to throw out strategies that would work on human opponents. The AI would definitely have an upper hand, but it's nothing a sound strategy couldn't defeat. Having it know what wonders you are building would simply let it be able to not waste time on a wonder that it knows it will be beaten to and/or rush a wonder that it could get out before the human player. Having it know the result of random rolls before they happen would only allow it to optimize its luck, but it still wouldn't seem like the AI is getting the luckiest results possible, since even if they know the result of the goody hut they're about to pick up is not the best one, if they have no other random rolls to trigger (since the seed used to generate random numbers changes every time a random number is generated), they may be stuck with that result.

Getting scary flashbacks to Hal from 2001 or Joshua from War Games.
I don't think you guys realize how much "little" modifiers like terrain can throw a huge wrench into AI tactics. Chess AI's are extremely good because they rely on a few, very important fundamental properties of chess: both sides' starting setups are always symmetrical and always the same (ie. every game of chess has the same starting setup), both sides' pieces have identical properties, all tiles/squares act equal (with the exception of the last row for pawns, but that's a small enough exception for AIs to be able to handle it well), pieces cannot be added to the board, pieces do not change (with the sole exception of pawns again, but since they always become either queens or knights, it's an exception that isn't as complex as Civ5's promotions), and players can only move one piece per turn. Civ5 does not have any of these properties, so a result, "perfect" Civ5 AIs would need vastly greater complexity to even be on par with the best human players. Plus, Civ5 doesn't have over 400 years' worth of academic analysis to build off of.
There's a reason even an average Go player (roughly 6 months of experience) can beat the best Go AI: simply allowing for pieces to be added to the board generates so much more complexity that AIs cannot traverse trees of all possible options without running out of memory, let alone process those trees once they've been built. Heck, I'd wager that if you let players add new pieces to the board in chess, those grandmaster-level chess AIs would suddenly be worse than an adept human chess player.

People often see intricately designed AIs that are good at a very specific task, but don't realize how much even the slightest alteration can force them to fall flat on their face. This is because most intricately designed AIs work via a neural network design (essentially, they have a bunch of data thrown at them and slowly work out the ideal solutions via trial-and-error), but the downside to neural network design is that you not only have to repeat the training process with every alteration of either the AI's code or the problem they are trained to solve, but you have to create separate versions for each possible set of starting conditions.
Plus, you know, there are power considerations: supercomputer power consumption is usually in the megawatt range. The human brain, on the other hand, has a power consumption of roughly 22W at most (sources range from 12W to 22W). This means that even if you create an AI of equal processing power as the human brain for enough tasks, you could power about 50 000 human brains (all communicating with each other) with the energy that would be required to run one copy of that AI.
 
Maybe, but it's not the kind of cheating that would force players to throw out strategies that would work on human opponents. The AI would definitely have an upper hand, but it's nothing a sound strategy couldn't defeat. Having it know what wonders you are building would simply let it be able to not waste time on a wonder that it knows it will be beaten to and/or rush a wonder that it could get out before the human player. Having it know the result of random rolls before they happen would only allow it to optimize its luck, but it still wouldn't seem like the AI is getting the luckiest results possible, since even if they know the result of the goody hut they're about to pick up is not the best one, if they have no other random rolls to trigger (since the seed used to generate random numbers changes every time a random number is generated), they may be stuck with that result.


I don't think you guys realize how much "little" modifiers like terrain can throw a huge wrench into AI tactics. Chess AI's are extremely good because they rely on a few, very important fundamental properties of chess: both sides' starting setups are always symmetrical and always the same (ie. every game of chess has the same starting setup), both sides' pieces have identical properties, all tiles/squares act equal (with the exception of the last row for pawns, but that's a small enough exception for AIs to be able to handle it well), pieces cannot be added to the board, pieces do not change (with the sole exception of pawns again, but since they always become either queens or knights, it's an exception that isn't as complex as Civ5's promotions), and players can only move one piece per turn. Civ5 does not have any of these properties, so a result, "perfect" Civ5 AIs would need vastly greater complexity to even be on par with the best human players. Plus, Civ5 doesn't have over 400 years' worth of academic analysis to build off of.
There's a reason even an average Go player (roughly 6 months of experience) can beat the best Go AI: simply allowing for pieces to be added to the board generates so much more complexity that AIs cannot traverse trees of all possible options without running out of memory, let alone process those trees once they've been built. Heck, I'd wager that if you let players add new pieces to the board in chess, those grandmaster-level chess AIs would suddenly be worse than an adept human chess player.

People often see intricately designed AIs that are good at a very specific task, but don't realize how much even the slightest alteration can force them to fall flat on their face. This is because most intricately designed AIs work via a neural network design (essentially, they have a bunch of data thrown at them and slowly work out the ideal solutions via trial-and-error), but the downside to neural network design is that you not only have to repeat the training process with every alteration of either the AI's code or the problem they are trained to solve, but you have to create separate versions for each possible set of starting conditions.
Plus, you know, there are power considerations: supercomputer power consumption is usually in the megawatt range. The human brain, on the other hand, has a power consumption of roughly 22W at most (sources range from 12W to 22W). This means that even if you create an AI of equal processing power as the human brain for enough tasks, you could power about 50 000 human brains (all communicating with each other) with the energy that would be required to run one copy of that AI.

That's why we need a battle map. With a battle system set up more like Panzer General.
 
I would like the AI to throw units in water less.

how exactly one would program an AI that didn't rely on advantages

It is not a realistic expectation. Historically, the civs difficulty levels have always been a measure of how much extra advantages the AIs gets. It does seem to me that this bothers people more with V than it did with IV or its predecessors, but I am not sure why this would be. Have lots of players always complained about this handicapping approach? Is the V handicapping somehow much more blatant than it was with previous civ iterations?

Take, for instance, the concept of "don't move your ranged/siege units ahead of your melee units." Would you write the code for that and then give Deity AI a 100% chance to follow it, Immortal a 90% chance, Emperor an 80% chance, down to 30% at Settler (70% chance to act suboptimally)?

I see three problems. (1) It is a challenge to code good tactics, or at least too challenging for the Firaxis developers. (2) Using good tactics only part of the time would be a terrible way to adjust difficulty level. As explained, chess AI adjust the depth of their look-ahead search tree to adjust difficulty, but that kind of recursion approach is not feasible for civ. (3) Players will figure out how to exploit any rigid rule set, so a lot of work for something would eventually not achieve the objective of being able to do without handicapping.

A smarter AI will not mean doing away with AI bonuses. It could only ever lead to allowing the bonus to be less extreme.
 
Getting scary flashbacks to Hal from 2001 or Joshua from War Games.[/QUOTE]

HAHA yeah. But remember, we as humans have to know how to do a myriad of things such as eating, navigating social situations, playing basketball, driving etc.. All the AI needs to learn is Civ so eventually it should get better at that one thing than us.
 
I would like the AI to throw units in water less.
That can be arranged. Heck, I'm in the middle of arranging it in my mod (DangerPlots!), though it'll be a while before it's bug-free enough for me to release it in the next version.

A smarter AI will not mean doing away with AI bonuses. It could only ever lead to allowing the bonus to be less extreme.
I wish to add to this by saying that sometimes it's unavoidable for an AI to have bonuses, especially knowledge cheats.
For example, one AI knowledge cheat in Civ5 is that it always sees all air units, even ones in the fog of war; my mod actually adds to this by essentially allowing it to see all possible interceptors on a tile, even if it is in the fog of war. The reason for this is that it would be a lot more computationally expensive to have the AI try to figure out where everybody's air units were stationed and where possible interceptions could be than just to have it know from the start and work through its algorithms that way; the game would probably have to consume at least an extra 100MB of memory and turns would ten times as long if a sort of heat-map-crossed-with-intercept-seeker algorithm were implemented.
You can even see this in old RTS's, where the AI knew where all your buildings and units were: having them try to make accurate guesses and then attempt to verify those guesses through circumstantial analysis, all in real time as well, would have been exponentially more computationally expensive than to just simply have it know everything it needed and letting its failings through rigidity compensate for its advantage.
 
I wish to add to this by saying that sometimes it's unavoidable for an AI to have bonuses, especially knowledge cheats.

It's fine for the AI to have some knowledge cheats if it's to speed up the turns and results in reasonable game play.

I'm still unconvinced that an AI can be built that gives the feel of playing against a tough opponent with the 1 upt system.

Soren Johnson (Civ 4 designer and AI programmer) had a interesting talk on AI's
https://www.youtube.com/watch?v=IJcuQQ1eWWI&feature=sub

Sometimes you have to change the game to allow the AI to be effective. Soren talks about several changes made to Civ IV that enabled the AI to be effective. Apparently this was not done for Civ V
 
It's fine for the AI to have some knowledge cheats if it's to speed up the turns and results in reasonable game play.
Yup, and having it cheat through knowing more seems like a more reasonable proposition both in terms of player acceptance (having them know more to make up for their rigid algorithms is something I see people more willing to accept than having them receive stat-based bonuses that cause them to be flatout better off in any situation where their algorithms actually approach perfect behavior) and in terms of driving AI designers to make better AIs (if the AI knows everything it possibly can about the game and can still be beaten easily by the human, you have made an uncompetitive AI)

I'm still unconvinced that an AI can be built that gives the feel of playing against a tough opponent with the 1 upt system.
If it were consistent 1UPT (so air units wouldn't stack, and civilian units like Great Generals and embarked units could not occupy the same tiles as military units) and nothing else (so no melee-units-take-damage-on-attack-but-ranged-don't and no insta-heal promotion), it could definitely be possible, as proven by the AIs in various wargames people have brought up in this thread. Problems usually arise when the AI is supposed to build and send units over long distances with 1UPT: it's a problem even with unit stacking (since the AI needs to have a sense of where units are needed and what type are needed), but it becomes exponentially more difficult when units are made so valuable via Civ5's many additions (1UPT, unit resource usage, combat that doesn't always result in one of the participants dying or withdrawing, UU's that have promotions that carry over when upgrading). For example, having the AI create a Longbowman vs. a Crossbowman in Civ4 isn't that much of a problem because it'll be sitting in a stack of other units anyway and isn't a specialized unit like a siege weapon (Longbows in Civ5 were better on defense and had more first strikes, but Crossbows had slightly higher combat strength and had a bonus vs. melee units and were unlocked one or two techs after Longbows), but having it create a Swordsman vs. a Composite Bowman in Civ5 is a huge, huge difference, not just because of how CompBows can ranged attack and Swordsmen cannot, but also how Swordsmen cost 1 iron to maintain and must be adjacent to its attack target (whereas CompBows can fire over another, blocker unit).

Soren Johnson (Civ 4 designer and AI programmer) had a interesting talk on AI's
https://www.youtube.com/watch?v=IJcuQQ1eWWI&feature=sub

Sometimes you have to change the game to allow the AI to be effective. Soren talks about several changes made to Civ IV that enabled the AI to be effective. Apparently this was not done for Civ V
Thanks for linking that talk, I hadn't seen it before.

I respect Soren Johnson quite a lot, especially his work on Civ4 and his newest game, Offworld Trading Company (which I absolutely love).

However, he did make one very crucial, bad assumption in that talk: he assumed that in a game like Civ5, a player can only have fun if they win. If that were the case, then yes, an AI that plays to just barely lose compared to the player is the way to go if you want an AI that gives the player the best experience. However, I will argue that there are cases when the AI is too challenging for the player, but the player can still have fun; the biggest caveat is that all of these cases hinge on a good diplomacy AI who can be talked to and dealt with as easily as a human player. I'm not just talking about backstabbing and 2-on-1 gangups, but I'm also talking about large coalitions, being able to put differences aside to focus on a common [AI] enemy, waging a cold war... and more importantly, it needs to be able to bring the human player in on these things. Being a kingmaker can be fun, especially if AI personalities have some persistence (ie. if you helped Ghandi to win in the last game, he'll be more fond of you in the next game you play with him) and/or if future civ games allow for multiple victors. In FFA games, human players only stop having fun if they don't feel like they are doing anything important in the game, and a competitive AI that wipes the floor with the human player can still allow them to act as a kingmaker between an AI who backstabbed them and the underdog AI who is trying to beat the other AI by helping the human player (an enemy of their enemy) out. It can also make the human player feel like they've won a personal victory even if they do not win the actual game: examples include generating a huge profit by playing both sides of two, much stronger AIs engaged in a cold war, or annihilating the AI that almost destroyed them earlier even if their strong AI ally will still win a spaceship victory in the next 5 turns, or denying an "" AI World Congress hosting by voting for another AI.
So yeah, in an FFA game, an AI can play to win and still make the human player feel like they are having fun (as well as giving them a lot of interesting stories to tell about exploiting AI relations that feel like they're exploiting human players instead of poor AI coding). Things are much different when teams are static though.
 
Top Bottom