Why is AI so poorly written?

planetfall

Emperor
Joined
Jan 18, 2002
Messages
1,351
Location
California
Still investigating features of vanilla civ6. I just ran an experimental setup as I suspected the programming for AI domination victory was worst than any other releases of civ. Yep, it's really bad. I think the designers got so caught up in cake decorations they forgot they need a base of a great cake. Pfft.

Here was the test setup:
-- huge map
-- only domination victory
-- vanilla
-- no city states/barbs/huts
-- only 3 AI civs

Expected play to show
-- race for strat resources
-- AI's would take advantage of all the unclaimed tiles and be creative in empire building
-- AI's would also go after weak civs
-- military build up would be important

Nope, by turn 200+.
AI city counts were 6, 7, and 9.
AI militaries were weak
AI techs were behind

Civ versions IV and V had their issues, but not with AI on domination victory. Very disappointing.
 
"

Why is AI so poorly written?" because it is not marketing power. Marketing power is, for example - no. of civs, graphics, terrain changes (volcanoes, floods). AI, whatever you write on a box, people do not take it anyway.​

 
Don't think the difficulty matters. It was prince, so neutral for player and AI. Higher difficulty just adds AI bonuses to make tech climb and military output faster so will attack sooner. That's just a sledge hammer approach rather than a well thought out strategy.

Saboteur, regardless of marketing, this is a franchise why throw away the code base from IV and V for strategy?
 
Don't think the difficulty matters. It was prince, so neutral for player and AI. Higher difficulty just adds AI bonuses to make tech climb and military output faster so will attack sooner. That's just a sledge hammer approach rather than a well thought out strategy.

Saboteur, regardless of marketing, this is a franchise why throw away the code base from IV and V for strategy?
The code base from V and IV wouldn’t work - VI is much more complex and micromanaging than those other iteration
 
@planetfall , please give some more details about your test. Had the AI been attacking each other? Did the AI civ with 9 cities have fertile land, so a growing population? How many wonders had the AI built?
You wrote that the AI techs were behind; were they behind you (the human player), or were they behind each other?

Re: the code base -- On a strategic level, Civ6 has some important differences from Civ4 and Civ5. The first one that springs to mind is that a Civ5 city does NOT equal a Civ6 city. In both Civ4 and Civ5, a city is a self-contained unit, with *all* the buildings (and wonders) as part of the city center. The Civ6 AI must decide when to place a district, rather than build a unit or another building. Neither the Civ4 nor the Civ5 code base would help with those decisions.
In another thread (found here https://forums.civfanatics.com/thre...-comparing-the-combat-of-civ-v-and-vi.683682/), @SirNovelty and others compare and contrast the military strategy differences between 5 and 6. Clearly, Civ4 had a very different military paradigm than 5 and 6; indeed the very definition of a conquest victory was different.

While I could see keeping some of the logic/code for assessing, "is this opponent a threat?" or "is this opponent a good target for me to declare war on?", much of the diplomacy is very, very different from 4 to 5 to 6. Deciding who is a friend, who is an enemy, is very different among the games. I'm not certain that any of the AI in 4, 5, or 6, are aware of the victory conditions that you enabled during game setup, so that they ignore the other victory types.
 
i dont think there is any AI in the game at all. just a bunch of numbers assigned to all actions and some other values ( i could speculate civilization power , distance , army positioning etc ) . the computer then checks the sum of said numbers and checks it against a table the devs have created to find what actions it has to take. that is not AI . there is no decision done by computer.
 
I am curious if an AI could ever win a domination victory on standard settings. Standard size/map/civs/citystates/etc. If anyone knows of a replay of this I would be interested in watching it.
 
I am curious if an AI could ever win a domination victory on standard settings. Standard size/map/civs/citystates/etc. If anyone knows of a replay of this I would be interested in watching it.
Great question! I've seen the AI pursue other victory conditions. I actually lost to an AI who achieved a diplomatic victory while I was not paying attention. I've seen AI build projects on the way to a science/space victory. I've seen AI spread their religion to every other civ and *try* to spread it to me. I've seen the AI build lots of wonders to rack up tourism.

Although I have seen aggressive AI take out a weaker neighbor, I have not seen them actually pursue a domination victory. I'd like to watch/read about this, too, if it exists.
 
I believe you could use machine learning to develop a competent AI. There are new techniques now like "imitation learning" and "reinforcement learning" that could be used to train a neural net to play civ. You would basically feed game data from say thousands of game to teach the AI how to play and have it play games on its own, learning best strategies with each new game, until it is able to win 99.99% of the time. But it would cost resources and time that could be better spent. And there is no upside. The fact is that most players don't want a strong AI. It would not be fun to play a game where you know that the AI will crush you 99.99% of the time.
 
I am curious if an AI could ever win a domination victory on standard settings. Standard size/map/civs/citystates/etc. If anyone knows of a replay of this I would be interested in watching it.
Never seen it even on a small map with walls and encampments disabled.
 
The answer to the question always: AI is hard. Harder than anyone on the outside gives it credit for. Even the people working with the game, or in past games, working with whatever DLL or the like, are building on what was created from scratch. It's a very different ballgame.

The additional answers are: video games are always made on a budget, and an infinite amount of things get prioritised and deprioritised according to the whatever is left in the budget.

Does this mean it's impossible to do better? Not in the slightest. And I hope the devs continue to refine the balance of implementation vs. design that allows them to deliver a better out-of-the-box AI in future Civ games.
 
The answer to the question always: AI is hard. Harder than anyone on the outside gives it credit for. Even the people working with the game, or in past games, working with whatever DLL or the like, are building on what was created from scratch. It's a very different ballgame.

The additional answers are: video games are always made on a budget, and an infinite amount of things get prioritised and deprioritised according to the whatever is left in the budget.

Does this mean it's impossible to do better? Not in the slightest. And I hope the devs continue to refine the balance of implementation vs. design that allows them to deliver a better out-of-the-box AI in future Civ games.
Excellent answer. This is the best response I've ever seen to the perennial "AI bad why??" posts.
 
Excellent answer. This is the best response I've ever seen to the perennial "AI bad why??" posts.
I am reminded of General von Moltke's comment about War:

"In War only the simplest things succeed: but even the simplest things are very complicated."

Substitute AI for War and it still applies . . .
 
I am curious if an AI could ever win a domination victory on standard settings. Standard size/map/civs/citystates/etc. If anyone knows of a replay of this I would be interested in watching it.

I doubt that's possible. Maybe on a duel map with only 2 civs.

As for the AI I believe it's intentionally bad to not frustrate new players. They really need to implement an AI that is tougher on higher difficulty levels, some RPG's do this like Baldur's Gate 3.
 
I doubt that's possible. Maybe on a duel map with only 2 civs.

As for the AI I believe it's intentionally bad to not frustrate new players. They really need to implement an AI that is tougher on higher difficulty levels, some RPG's do this like Baldur's Gate 3.
I believe for Civ 6 they went all the way into fun. I think the AI is hard coded to be bad at ruthlessly pursuing victory even on deity. I can’t tell you how many times ive beaten AI on science victories because they seem to be hard coded to pause at certain steps and rarely speed up their ship once its launched. Ive had several victories I was just beginning to launch moon landing, the AI completed the first two steps and has tech to launch the victory round and seems to wait 30-50 turns to launch and then doesn’t speed up its progress

In terms of war - the AI never possess a threat unless its an early rush or they massively out tech you.
 
I believe for Civ 6 they went all the way into fun. I think the AI is hard coded to be bad at ruthlessly pursuing victory even on deity. I can’t tell you how many times ive beaten AI on science victories because they seem to be hard coded to pause at certain steps and rarely speed up their ship once its launched. Ive had several victories I was just beginning to launch moon landing, the AI completed the first two steps and has tech to launch the victory round and seems to wait 30-50 turns to launch and then doesn’t speed up its progress

In terms of war - the AI never possess a threat unless its an early rush or they massively out tech you.
Even in the higher difficulties such as Immortal or Deity?
 
Even in the higher difficulties such as Immortal or Deity?
Yes, I play exclusively on deity. There is always a massive pause after the second phase of the science victory is completed even when they have the tech and capability to begin work on it immediately. A year or two ago - a modder messed around with the files and was able to get them to start building the laser stations to speed it up but that took editing the behavior file
 
@planetfall may I suggest this GDC talk where Sid Meier discusses psychology and AI in games. I've linked to the relevant section on AI. I believe it should give you some insight into WHY the Civ AI is always a particular way. :)

 
There as a couple of reasons:

1. Increased difficulty does not equal increases sales. The opposite is actually true. Yes there is a market for difficulty games although a large budget game isn’t looking for a market they are looking for mass appeal.

2. Budget. Everything costs money and time. They will spend the money/time on the things that sell the most copies. Visuals and performance.

3. They want to sell additional content which means they want the most number of players to enjoy their product. Even with the questionable ai the average player plays king or lower difficulty. The average player also struggles to win above king difficulty.

People generally enjoy winning over losing in a single player experience. So the ai is designed to appear as if it’s “winning” but not really win in a competitive sense. That’s why all victory conditions have a multi step “finish” so the ai can fail at it and give the player the rush of the comeback.

This makes the player enjoy the game more. This makes the player buy expansions.

4. The vast majority of players who want a stronger ai would not enjoy it.

Stronger ai means the game ends sooner. Better choices means you win faster. I play with the sole goal of finishing the game in as few turns as possible.
Standard speed:
No modes
180 or less turns for science is possible with every civ.
150 or less turns is possible with every civ.
With mistakes and minimal min maxing. Although every game is going to be extremely similar to the last one you played in strategy.

Do you want to play the strict required to win script?
Or do you want to be able to try different approaches or less then perfect strategies?

Bad ai makes it so players can use different approaches and be successful. People want to try different things and succeed.
 
Top Bottom