Is AI really brain dead?

I agree that the AI do some strange choices sometimes, however it is also more intelligent at times compared to civ5. I have been attacker quite well several times with units of good level.

I feel that there is potential in the AI, it feels just like they did not have spent enough time on it. I am thinking in why... I think it is because it is hard to create a good AI for an unfinished game, and the game was just finished a few months ago. I think that Firfaxis decided to release the game with an AI that has yet to be refined. So now they have hundreds of report of how the AI could be better, it is now easier to implement improvements in future patches.

We'll see, I'm guessing there was no wiggle room on the release date.
 
Well, this is what I found to be the sad truth until about 3 years ago.

I am a programmer and in my job I work at something... boring. I really like 4x games but all of the ones I knew had incompetent AI.
I tried before with modding and could get some significant improvements out of Civ III and Endless Space-AIs that way. However, what could be achieved was limited.

Then I got Pandora: First Contact. I really liked the well-thought-out game-mechanics. But much to my dismay: bad AI once again.
So what I did was the following: I contacted the (Indy) developers, if I could get access to the code and work on it in my spare-time.

Signed an NDA, got my system set up and then started.
I worked on it for like 1 1/2 years during my spare-time.

Result is: AI is now better than that of any other 4x-game I ever played before.

The average player needs about 20-40 hours of experience with the game to have a shot at competing on the level where the AI has no boni.
We have renamed and rebalanced (toned down) boni on difficulty-levels twice. Even the highest one now only has a moderate advantage.
I can usually compete and win on the second highest about 50% of the time but on the highest I lost 7 games in a row with the latestes builds. With my 1500+ hours of experience in the game that is.

I contacted several big 4x-Youtubers if they'd showcase the game again with my final patch 1.6.7 (most have done so only on release... when the AI still was terrible) no response mostly.

Right now I'm working on a new 4x game, Dominus Galaxia. Once again an unpaid free-time-job.
The game has easier mechanics than Pandora and we are currently in Alpha about to release the first playable versions to a wider audience this month.
I've been working exclusively on the AI.
I have about 33% win-ratio against it on the fair level. AI development goes hand-in-hand with game-design here. For example we had to change how retreating from tactical combat worked because the AI was exploiting the ability to instantly retreat by trying to harass the player all over the place and you could not do anything to punish that.

It is really disheartening to read a thread like that and see how AAA-studios get away with utterly terrible AI.
But when I look at the feedback I've gotten for my AI-improvements for Pandora, I see why that is. The reviews got way more two-sided. On the one hand players who really like to finally have a challenging game with competent AI and on the other hand players who moan about how unfair the game is, beating them on Easy the third time in a row accusing it of having "ridiculous boni" even there.

Don't really know how to handle it. Personally I'm glad that I have at least these two games to play when I want a challenging 4x-experience and so it was still worth it somehow.
But it completely spoiled any other 4x for me. Not being able to tinker with the AI and make it play good is just too much of a disadvantage that no kind of cool game-mechanics can get me over with.

That being said: Doing a good or even great 4x-AI is possible. It's not a question of money, it's a question of dedication, intelligence and especially time.
Not doing a completely ****ty one, that does mistakes so bad that it's immersion-breaking, on the other hand, is really inexcusible. 50% of the playing-strenght-improvement for pandora-AI came out of the first 2 weeks i worked on it, fixing the most glaring issues and using some-band-aid-placeholder-algorithms before making really sophisticated ones.
An interesting post. Will have to check out Pandora. As you seem to have a lot of experience: what do you think about the mantra I read here frequently that it's not possible to have good AI with 1UPT?
 
How is it objectively better if it's objectively worse? The AI can't handle it, that's a fact.

Edit: No one who ever defends 1UPT ever actually defends it. They just say it's better, use caps and/or a snarky response and stick their fingers in their ears
Now, now. We all know opinions become objective facts if you assert them strongly enough. :)

1UPT is a great idea that requires a great AI. Stacking is an unambitious idea, but asks little of an AI in tactical terms.

The Civ VI AI still doesn't have much sense of spatial awareness. Still gets upset about units being near their border even if the other side of the border happens to be your land. Which in and of itself wouldn't be so bad (it still should be a legitimate concern for them, to be fair), but even with declarations of friendship and open borders agreements, they still demand withdrawl.

And conversely, it still does the Border Dance around player civilizations while smiling and being genial. Still no way to confront the AI in the same fashion as the AI can confront the player. Not much of a poker hand there when you have a dozen troops shifting about my capital.

Still doesn't seem to tell the difference between land and water, making it easy to wipe out invasions with a single ship.

Still makes assaults against the most fortified cites when less well-defended cities are available.

Still attacks with masses of obsolete units as if they could match a modern army defending a city with its own modernized defenses, then go running for the water closet when the inevitable slaughter occurs.
 
2. don´t bring the gamer to cry in his first couple games by starting a two fronts war and smashing him. That would make human consumer angry.

Maybe they switch this two rules easily off with the next patch when the gamers have more frustration limit.
If only. In my second game, I was sandwiched between two civs that both had the agenda to hate civs with small armies. They denounced and attacked me in turn. Due to their utter incompetence, I was able to repel every attack, but a two fronts war to smash me was exactly what the AI attempted. Repeatedly. So I was made angry for the exact reason you state they want to avoid, while also being angry at how poor the AI was.
 
Just as bad as the performance of the military/production/etc elements are lurks the horror of the diplomacy. It can't even stay consistent between AIs... just randomly flips between war and peace literally every other turn, with way too many Surprise Attacks from supposed allies. The only silver lining is that because the tactical movements are so horrible (you can see them piling up units), it frequently doesn't matter. It is really just so hard to get going outside of military actions.
 
I do wonder how I always discover a new continent when the game is 2 turns old and i have not even found the sea or any other civ as yet, smh

The game can have weird continent borders. Not sure if this is intentional or not. Sometimes a land mass that's separated from my own continent by water counts as the same continent and sometimes a continent-border is smack in the middle of a huge landmass. Kinda like if we defined, say, South Africa as being on a different continent from Congo or Zimbabwe. OTOH, Asia and Europe are basically part of the same landmass and yet we consider them different continents in the real world. So maybe this is intentional after all.

S.
 
The game can have weird continent borders. Not sure if this is intentional or not. Sometimes a land mass that's separated from my own continent by water counts as the same continent and sometimes a continent-border is smack in the middle of a huge landmass. Kinda like if we defined, say, South Africa as being on a different continent from Congo or Zimbabwe. OTOH, Asia and Europe are basically part of the same landmass and yet we consider them different continents in the real world. So maybe this is intentional after all.

While the borders can be weird, the idea of having different continents on the same landmass was done on purpose because of the civs that have continent specific bonuses. Otherwise a pangea map would only have 1 continent and that would not work for civs with continent linked bonuses.
 
Still doesn't seem to tell the difference between land and water, making it easy to wipe out invasions with a single ship.

Still makes assaults against the most fortified cites when less well-defended cities are available.

Still attacks with masses of obsolete units as if they could match a modern army defending a city with its own modernized defenses, then go running for the water closet when the inevitable slaughter occurs.

So true that it is sad...
 
A positive AI experience (King difficulty): In my current game Teddy took a city state early which already annoyed me, then he declared on me after a while and sent a band of warriors. These I could easily repel, but he then sent a bunch of heavy chariots to a different city which I only kept because I had wisely started ancient walls a couple turns earlier. After backing off he sent even more warriors/chariots that I could now easily defeat having trained some spearmen. We made peace. 30 or so turns later he showed up at my borders again, this time with a well balanced force that included catapults and a battering ram. He proceeded to attack a city state behind my territory and would have overwhelmed it had I not "besieged" it myself in order to protect it.

The Ai was looking pretty well here. Certainly the best effort I've seen so far.

Of course there still were some glaring issues, especially Teddy's refusal to pillage anything. He could have really slowed me down.

The more I play the more I think the AI is not stupid, but just completely random.
 
Well, this is what I found to be the sad truth until about 3 years ago.

I am a programmer and in my job I work at something... boring. I really like 4x games but all of the ones I knew had incompetent AI.
I tried before with modding and could get some significant improvements out of Civ III and Endless Space-AIs that way. However, what could be achieved was limited.

Then I got Pandora: First Contact. I really liked the well-thought-out game-mechanics. But much to my dismay: bad AI once again.
So what I did was the following: I contacted the (Indy) developers, if I could get access to the code and work on it in my spare-time.

Signed an NDA, got my system set up and then started.
I worked on it for like 1 1/2 years during my spare-time.

Result is: AI is now better than that of any other 4x-game I ever played before.

The average player needs about 20-40 hours of experience with the game to have a shot at competing on the level where the AI has no boni.
We have renamed and rebalanced (toned down) boni on difficulty-levels twice. Even the highest one now only has a moderate advantage.
I can usually compete and win on the second highest about 50% of the time but on the highest I lost 7 games in a row with the latestes builds. With my 1500+ hours of experience in the game that is.

I contacted several big 4x-Youtubers if they'd showcase the game again with my final patch 1.6.7 (most have done so only on release... when the AI still was terrible) no response mostly.

Right now I'm working on a new 4x game, Dominus Galaxia. Once again an unpaid free-time-job.
The game has easier mechanics than Pandora and we are currently in Alpha about to release the first playable versions to a wider audience this month.
I've been working exclusively on the AI.
I have about 33% win-ratio against it on the fair level. AI development goes hand-in-hand with game-design here. For example we had to change how retreating from tactical combat worked because the AI was exploiting the ability to instantly retreat by trying to harass the player all over the place and you could not do anything to punish that.

It is really disheartening to read a thread like that and see how AAA-studios get away with utterly terrible AI.
But when I look at the feedback I've gotten for my AI-improvements for Pandora, I see why that is. The reviews got way more two-sided. On the one hand players who really like to finally have a challenging game with competent AI and on the other hand players who moan about how unfair the game is, beating them on Easy the third time in a row accusing it of having "ridiculous boni" even there.

Don't really know how to handle it. Personally I'm glad that I have at least these two games to play when I want a challenging 4x-experience and so it was still worth it somehow.
But it completely spoiled any other 4x for me. Not being able to tinker with the AI and make it play good is just too much of a disadvantage that no kind of cool game-mechanics can get me over with.

That being said: Doing a good or even great 4x-AI is possible. It's not a question of money, it's a question of dedication, intelligence and especially time.
Not doing a completely ****ty one, that does mistakes so bad that it's immersion-breaking, on the other hand, is really inexcusible. 50% of the playing-strenght-improvement for pandora-AI came out of the first 2 weeks i worked on it, fixing the most glaring issues and using some-band-aid-placeholder-algorithms before making really sophisticated ones.
impressive, and very interesting
I think I will check these games out
in any case I say the future of single player 4x lies with people like you
companies today especially the bigger ones unfortunately seem to be all about business first and foremost and lack the dedicated gamer perspective or repeatedly fail to satisfy high expectations for innovation and progress, with few exceptions
 
One unit per tile limit puts serious pressure on AI pathfinding, when combined with other obstacles -- enemy units, terrain restrictions, choke points. I'm not surprised this, like in Civ V, remains weak.

I have a wargame called D-Day at Omaha Beach which restricts you to 2 units of any type. You can temporarily have more but not end a turn with more on a hex. That is hugely more flexible on movement while creating some interesting situations. I reckon it'd benefit the AI and be more fun.

Maybe in Civ VII :/
 
Worst AI moment:
Playing pangaea, but it basically generates two landmasses connected by a narrow landbridge. I gradually realize that I am the only player on the western landmass, and that I have ALL the city states. I find the land bridge, skirting a barbarian camp below the western edge... and run straight into a horseman from that camp battering the Aztecs capital, and it has taken a settler. The settler flees from me, back into Aztec territory. I finish off the badly wounded horseman and stare at the Aztec territory, and the 'barbarian' settler inside. No aztec units come out to claim it. I bribe them to open their borders, wander in, take the settler, and leave, taking it back home to settle on the edge of my empire.

Their ex-settler was literally in the tile next to their capital, and the AI did not recapture it.

No aztec (or any other civ) crosses the land bridge at any point in the game. I am sole influencer of city states for the entire game, because no AI unit ever left their landmass until roughly 1800, at which point I'm launching crap into space. In fact, they never built coastal cities or harbors on the sea between us, nor crossed the inner seas above or below the landbridge. The Aztecs pretty much blocked it off with border spread, and after that disaster with the horseman, were apparently too terrified to venture west.
By the time I can see the map, Gandhi has Hinduized everyone (else), and he and the Aztecs have 2 whole cities each, Russia has 3, and the Greeks have 5, because Pericles ate the two Roman cities around turn 90. I felt bad about winning, because I was multiple eras ahead, and didn't even interact with anyone until 1800 or so. And at that point I sold a couple spare luxuries and continued to ignore them. But I was already into space, and decided to just finish it off.
 
Not saying we need Civ IV SODs but should have gone to 3-5 UPT based on a support calculation.
Indeed, favoring mixed composition, with some mechanism to prevent any one civ from building too many concurrent stacks.

Sounds like they also need to remove strategic resource restrictions from units, and instead provide a bonus to those units if you have the appropriate resource. I was toying around with something like this over in the newest Total War game, and it worked very well to improve the AIs unit selection.

In my experience poking around the Civ5 AI, I found it was far too cautious with its units, which often resulted in the shuffling syndrome, as the AI tried to move frontline units away because it would not dare risk a single unit only to make room for more units to move forward and repeat the cycle.

1UPT can work, but it sounds like Firaxis made zero effort to address this critical issue. I would just as soon see small stacks, without fluff mechanics such as the ranged bombardment attacks. And a creative mechanic for limiting the number of stacks.
 
Last edited:
A positive AI experience (King difficulty): In my current game Teddy took a city state early which already annoyed me, then he declared on me after a while and sent a band of warriors. (...)
The more I play the more I think the AI is not stupid, but just completely random.



So Roosevelt basically behaved in a way that he would denounce/hate other leaders for?

I've seen that from other leaders as well. Like Frederick who hates leaders who interact with city states - not those who try to compete with him for city states, mind you (at least that's how I understand his character trait). And in my current game he is suzerain of half of the CS I've met and keeps sending them envoys.

Which kinda seems to support your theory of the AI being random. But - at the very least - it also makes them look inconsistent, IMO. What's next? A warmongering Gandhi? ;)
And of course: When you have AI leaders that are supposed to have these complex personalities and specific likes/dislikes and then they turn out to behave randomly and to ignore their own preferences, it does make them look a bit stupid. Perhaps giving AI leaders these very specific traits/likes/dislikes wasn't such a great idea after all ...?


S.
 
Maybe the problem is conflicting agendas? I was thinking that Teddy might have a hidden agenda that makes him attack city states.

If that is the problem they could make the hidden agenda semi-random, i.e. assign a pool of possible agendas to each leader that fit their unique agenda.
 
An interesting post. Will have to check out Pandora. As you seem to have a lot of experience: what do you think about the mantra I read here frequently that it's not possible to have good AI with 1UPT?
In Pandora I did not have to deal with the problems of 1UPT.
Pandora has stacks but stacking is discouraged due to AoE-Damage and flanking-boni. So I still had to implemented ways to spread the units out. But it is obviously much easier when they can walk through each other to reach their destination.
I just thought a bit about how I would approach 1UPT.
What has to be done differently is to sort the units for "unoccupied neighbour-tiles" before you go through them.
This way you'd always move the ones with most "Freedom" first, which potentially frees up the others. Once you ran out of units with unoccupied tiles and movement left, you make the ordered list again to consider what has been changed since the other units have moved.
And among those there should be other considerations for move order aswell. Unoccupied-tiles, Movement-Speed, attack-range (but in backwards order: move units with lower attack range first).

Another thing I'd consider is unit-composition. Since you can surround a tile with no more than 6 melee-units, it seems to be rather pointless to have much more than that per target you want to attack at the same time in your army. Maybe some backup to replace losses.
Something along the lines of: If < 6 then 100% melee, for anything over 6 aim for a 1:5 melee:range-ratio.

So overall I'd say:
More algorithmically complex and processing-intense due to several cycles being required required? Definitely.
"Not possible"? definitely not! It's a task that I would consider myself totally capable of being able to do.

There's other games with 1UPT with excellent AI.
For example the Tactics-Game "Battleworld: Kronos" or the Abstract-Strategy-Game "Arimaa" (which has cracy complexity when it comes to unit-interaction).

But I personally did not like 1UPT in Civ 5 from a player-perspective either. It was just annoying when moving larger armies.
I consider Pandora's approach of having stacks but discouraging them with Splash-Damage and encouraging splitting with incentives like flanking to simply be better game design. It does not take away anything about how tactical combats are... I'd even say it adds something!
 
Last edited:


I finally got to load my Japan-save and explored Cleo's situation a bit more. And now that I've seen it, it makes the AI look even worse.

Island map.

As you can see, she's sitting on a tiny island (my own island is at least 10 times the size of hers), she settled away from the coast and has no obvious city spot in range - although she could settle on that one-tile island to the SW. Might not be a great move, but certainly more useful than filling up her own little island with useless scouts.

Granted: This looks like a bit of a worst case scenario, having founded the city off the coast and thus not being able to build ships early. IMO though, that starting position shouldn't be possible, especially since my island looks like Asia compared to the tiny landmass she's sitting on.

Oh, and BTW: This is "Prince" difficulty and turn 97. Which makes her huge army of scouts a bit suspicious to me, especially since she managed to complete Stonehenge, probably has a few more buildings in her city as well and doesn't have that many hammers near her town to begin with.


S.
 
Top Bottom