1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

How weak is the AI?

Discussion in 'Civ6 - General Discussions' started by Lynxx, Oct 10, 2016.

  1. Gort

    Gort Emperor

    Joined:
    Nov 7, 2010
    Messages:
    1,518
    The Vox Populi mod for Civ 5 fixes the "AI is miles ahead at the start but then you catch up and win" problem by spacing out AI bonuses throughout the eras.

    So what you could do for Civ 6 to improve on Civ 5 would be to replace a bonus like "The AI starts with five free techs" with a bonus like "The AI gets one free tech each time it reaches a new era".

    -----

    I do have some hopes for Civ 6's AI though. Just by removing the +1 range and +1 attack per turn promotions on ranged units they've done a huge amount to make warfare more difficult for a player.
     
  2. KrikkitTwo

    KrikkitTwo Immortal

    Joined:
    Apr 3, 2004
    Messages:
    12,334
    They still have those promotions
    (You cant get both, but
    Archers can get the 2 attacks
    Siege and naval range can get the +1 range


    I do agree a flat constant bonus would be the first thing to try (instead of free techs/civics/units to start, all techs cost 50% as much, units cost 40% as much, civics cost 45% as much)
     
    Last edited: Oct 15, 2016
  3. StittsvileJamie

    StittsvileJamie Chieftain

    Joined:
    May 11, 2016
    Messages:
    41
    Location:
    Ottawa, ON
    I think they went the right direction with having the bonuses be to production and food and stuff, which spaces the bonuses out equally across each turn of the game.
     
  4. Xur

    Xur Prince

    Joined:
    Sep 13, 2016
    Messages:
    426
    I'll be happy if it is on par with civ5 - but some improvement in the diplomacy. But honestly, the streamers has shown some horrible AI, so I expect it to suck and I'm sort of ok with that - it will probably be fixed down the road like previous games. Don't expect much and you wont get disappointed.
     
  5. juanpavo

    juanpavo Warlord

    Joined:
    Nov 23, 2010
    Messages:
    131
    Location:
    Silicon Valley
    Yes, this is the key question. If the devs can fix the obviously stupid behavior (at all levels), then having bonuses at higher levels is fine (and expected).
     
  6. isau

    isau Deity

    Joined:
    Jan 15, 2007
    Messages:
    3,068
    I'm always a bit skeptical of "rubber band makes good play not worth it" arguments. I mean, it can be true in some games, but the way it works in the civ series is IMO fine. The basic principle is that the world itself is connected, and by pulling technology forward you bring it forward for everyone. If you are really a master player, you anticipate the spies and deal with them. Fail to do that and you are not as masterful as you claim.
     
  7. NerdByFate

    NerdByFate Chieftain

    Joined:
    Oct 7, 2016
    Messages:
    90
    Location:
    United States
    *Chieftain
     
  8. ThisNameIsTooLo

    ThisNameIsTooLo Emotion Lord

    Joined:
    Sep 14, 2012
    Messages:
    213
    *Unnecessary.
     
    burleigh and rreebb like this.
  9. DSveno

    DSveno Chieftain

    Joined:
    Oct 4, 2013
    Messages:
    30
    I don't think that's the rubber band they were talking about. It was mostly about increasing AI bonus if the player getting ahead, which as mentioned, introduces a problem of not rewarding good play.
     
  10. Gort

    Gort Emperor

    Joined:
    Nov 7, 2010
    Messages:
    1,518
    There's a difference between having rubber-band mechanics at all and having extremely strong rubber-band mechanics. Very strong rubber-band mechanics might make it pointless to get into a leading position since everyone else will keep up, but I don't think anyone here is advocating very strong rubber-band mechanics.

    Where do they get these? I don't see them in the Well of Souls promotion list.
     
  11. Siesta Guru

    Siesta Guru Prince

    Joined:
    Dec 2, 2007
    Messages:
    498
    Location:
    The Netherlands
    Coming from a more technical background and having done some modding on this game, I understand why they cannot improve as much as we want them to, so I'm not particularly disappointing that they can't improve it all the way up to deity level players. And without that deity level player, you will need some form of handicap to make the game interesting for the best. So you might as well have that handicap in place for the entire spectrum of skill. I don't expect that this will change at any point.

    On top of AI just being extremely hard to do for any strategy game, civ has some additional difficulty factors when it comes to how civs build their empires. The main one is that the AI developers, will not know what the game actually ends up looking like. During the development process, the costs, effects, requirements, etc of all the little building blocks they have (buildings, units, techs, etc) will change. And worse (for the dev), they will change with new expansions and player mods. So the system they chose is one that has to still work if completely new buildings pop up, effects change, costs change, requirements change, etc. Humans can and will adapt to new or changed stuff, and the AI will also have to.
    It makes far more sense for the company to build such a 'flexible' AI alongside the development process, rather than wait for every single balance change etc to be done before even beginning to build an AI that would then still fall on its face if content is added/changed. We're not talking about the AI just being bad at choosing when to build new stuff, they probably just wouldn't ever build it all if it wasn't accounted for.

    Additionally, the CIV team has put a big stake in the different leaders having noticeably different personalities. All civs have their own unique, subtly different playstyles, and that is really noticeable, flavorful and fun. A more 'competitive' based AI likely wouldn't have a lot of freedom there, itd be very hard to notice differences.
    And the last factor is that they make their AIs not just as competitive machines, but are made more to emulate what we kind of expect from real world empires. If the AI were truly competitive based, then the correct strategy to win would most likely be to just all instantly band together and DOW the real player.

    So, I think the 'flavor' based system they picked for the AI is actually a decent choice, although it has its failings. For those unfamiliar, the empire building AI part of CIV 5 is based around flavors. Every building, tech, civic and unit has certain flavor values applied to it, say a granary has a food flavor attached. Every leader has its own preferences for these 'flavors' and will prioritize buildings accordingly, on top of that, there are 'strategies', which are triggered under certain conditions and will change the desires for certain flavors, these are things like: 'My land has few improvements' -> increase the 'worker' flavor. 'I'm doing the space victory' -> increase the desires for 'science' and 'spaceship'.
    This allows great flexibility, because adding a building just requires setting the flavor values of this building appropriately, and the AI will handle it like any other. And on top of that, it is an efficient usage of performance (the bulk of the ai turn times actually goes into pathfinding, hence the slowdown near the end of game).

    Essentially all the AI does, is look at its current options, look at its desires, and pick whatever building option best matches it desires. It works pretty well, but does have some huge flaws, which I hope will be addressed directly, or which will become moddable.
    The worst is that the AI cannot do planning. At all. Even on the simplest things, it just doesn't. You might say the AI is always surprised at what it encounters, if an AI builds a wonder that gives it a great person, it is not because the AI decided it needed a great person at this particular moment, with say a tech or building to rush in mind. Nope, that wonder just had a 'great person' flavor attached to it, and this personality likes great persons. And after building it, the AI is basically surprised that a great person pops up. It cannot predict that it will come, theres no plan, and then the ai just does whatever its shortterm based mind tells it do.
    This means that the AI is extremely limited in its ability. It can never match a humans ability to craft strategies, because all it does is pick whatever sounds nice. Some humans do basically do the same, so luckily, it does still manage to keep up relatively well with inexperienced players. It might at least have a bit better of an ability to decide what 'sounds nice'.

    The other major problem, which can be blamed on the developers. Is that the flavor system is unfortunately extremely halfassed. The flavor values that have been picked for buildings/techs/units/civics look like someone just kind of thought of a number, not really realizing how it plays into the game. Give the library a science flavor of 35, sure, why not, what does 35 even mean anyway? A market gets 50 in the gold flavor? Why not? A factory does a lot of production, why not 100 in production? 100 sounds like a lot.
    Honestly the only reason why players can keep up in deity at all is because of these halfassed values. The library is probably the biggest offender. While players realize the library is probably the most important building to build for just about any strategy, partially because of how strong it is, partially because of it leading to the national college; AIs dont really care for it. Its total sum of flavor values is one of the lowest in that era, so any leader who does not have science as his top priority will not build it untill it literally runs out of other options to build. Because of that, there is almost always at least one city that doesn't have it yet, so the AI never builds national college. Even if magically it does gain access, it will likely build in whatever city happens to be the first to see it pop up on the list of available options. I've looked at a lot of AI games, national colleges pop up in maybe about 1% of AI capitals below deity, and that's usually sometime after renaissance. In deity it exhausts the options much faster, so in small empires it does get build sometimes, but even then usually pretty late. Since the AI gets no science bonuses, it's no wonder that good players can catch up.
    Changing a single value, library science flavor 35->100, probably puts peaceful deity victories out of reach for 75% of players who can currently manage.

    So the college thing demonstrates that the flavor system does not account for things being requirements for other things, which is very noticeable in other areas. If there's a civic that is amazing for gold, but its locked behind another civic that has no influence on gold, then unless someone decided to attach a small gold flavor to the requirement, the AI will never get there if its just basing its decisions on gold. Some of the civic tree openers have terrible flavors, so some trees barely ever get picked.
    It also ignores some things humans think of. We realize that happiness is good for growth, and growth is good for science, so at some points a Colosseum may be the best option for science. The AI will not realize this. While some minor attempts have been made to correct this (a granary does have a small science value attached), it really lacks in this area for a lot of buildings.

    Are you seeing your AI spam way too many anti aircraft guns? Its simply because the flavor/desire system ends up delivering that result. Are you seeing hundreds of aircraft carriers? Well, its because it has a decently high overall total spread out over the flavors 'offense', 'defense', 'naval' and 'aircraft'. Is the AI being attacked? Ok, we need defense and we lack air power, lets build some carriers. The AI isn't even looking at the amount of aircraft it has, it just looks at flavors and some random factors. The randomness is pretty high too, to a degree where it outweighs strategic and flavor aspects, so that all AIs build units of all types in all situations.
    Why is the AI building more cavalry than riflemen? Because the total sum of flavors for cavalry is 23 (10 offense, 6 defense, 7 mobile), and for riflemen its 20 (10 offense, 10 defense). So unless the AI highly prefers defense over mobile, it'll make more cavalry. Catapults (offense:3, defense:3, ranged:8) will be build more than composites (offense: 3, defense:3, ranged: 6), the AI doesn't care that they have different functions or that composites tend to be better overall. The list goes on and on.

    It'd be really nice if the devs gave their flavors some additional passes, with actual testing etc. The AI would end up way more powerful.
    And as a modder I would love it if they gave the option of creating our own types of flavors for more specific behavior (like, give certain leaders huge boosts to certain techs so they'll do bee-lining)


    So that ended up being way longer than I anticipated, I hope it was educational at least!

    tl;dr:
    The AI in civ 6 can't be much better than civ 5 assuming they use a similar AI system, which they probably will. But, there's a good amount of room for improvement even within that system. Perhaps as much as 1 or even 2 difficulty levels worth.
     
    Last edited: Oct 17, 2016
  12. boghog

    boghog Warlord

    Joined:
    May 13, 2013
    Messages:
    249
    Location:
    Germany
    At the same time you probably also wouldn't enjoy playing against 8 or 15 competent chess players in a tournament where you only win if you beat them all.
    People who say they want Deity level AI forget that that would mean that they'd be very unlikely to win most games. It would be more like MP gaming: You wouldn't expect to win more than a tiny share of games all else being equal.
    Some players might really enjoy the challenge, but I'd bet most (more casual) gamers expect to pretty reliably win a game after a little learning phase.
     
  13. skyclad

    skyclad Prince

    Joined:
    Nov 2, 2006
    Messages:
    488
    Very informative post Siesta Guru!
    Love to learn about these AI quirks. I really really hope they put a lot of effort into it and keep fine tuning it after release. Your example with library/national college especially is a great example of what can go wrong here.
    I think we all realize the AI need bonuses to compete at higher levels. But that is no excuse to not make it as good as possible! We cant have a great human level AI, but that doesn't mean we have to settle for something completely dumb either.
    Like in civ5 the AI could not even move and shoot at the same turn. I also suspect that unless an enemy was nearby causing them to fortify, the had no option to simply keep a unit still. The AI is always moving its units around every turn back and forth for no reason.
     
  14. Siesta Guru

    Siesta Guru Prince

    Joined:
    Dec 2, 2007
    Messages:
    498
    Location:
    The Netherlands
    Funnily enough the problem you mention is also kind of related to the value based quirks I mentioned and actually is one of the worst parts of the game. It's not that the AI cannot keep its units still (although there is indeed no fortify), it's that it has these priorities:

    AI_HOMELAND_MOVE_PRIORITY_EXPLORE 35
    AI_HOMELAND_MOVE_PRIORITY_SENTRY 20
    AI_HOMELAND_MOVE_PRIORITY_GARRISON 10
    AI_HOMELAND_MOVE_PRIORITY_PATROL 0

    Explore, sentry and patrol all cause movement, while garrison moves them to a city or a tile next to it, and then keeps it still. Every unit switches between one of these rather frequently (doesn't seem to be every turn), with a chance based on these priority values.
    Because the combined priority of explore and sentry is 55, compared to garrison 10. And because even garrison causes them to move if they're not next to a city, you'll see units in perpetual motion. (Afaik sentry is actually the main issue, as there's some kind of limiter on the explore mode)
    I've changed these values before so that garrison is higher than the other ones, and the result is that you'll instead see the AIs keep small blobs of units standing next to their cities, with just a couple moving around.

    Sadly enough, while it does look more 'lively' the original way, it's actually a gigantic negative influence on player enjoyment of the game. Probably even more so than the AI being bad. Strategically, it would even be more sound to keep them around the city, so invading armies cant pick units off, but more horribly:
    Whenever a unit is in sentry or explore mode, it does not just pick one of the 6 tiles around it at random, it chooses a far tile to move to, then calculates what the fastest way of getting there is. There's a pathfinding algorithm in place for this, which also happens to be rather inefficient. The result is, that in all the time you see the AI thinking, a significant part of it is dedicated to just moving units around pointlessly. I'd estimate that somewhere between 40%-70% of the time you're waiting, you're just waiting for the AI to do these random sentry motions. Worker motion, and actually important combat motions take up a big part of the remainder.
    A simple change of sentry 20->10 and garrison 10->20, would've likely saved the combined civ player base hundreds of thousands of hours and made the lategame significantly more enjoyable (the wait gets so much worse lategame because there are so many more units that are sentrying around).
     
    Melofeign, Atlas627 and Cobalt_Blue like this.
  15. VainApocalypse

    VainApocalypse Warlord

    Joined:
    Aug 10, 2010
    Messages:
    245
    We may get a better impression when they showcase the AI battle royale. That will be a more recent build, and we'll see essentially nothing but AI behavior.
     
    Lyoncet likes this.
  16. Siesta Guru

    Siesta Guru Prince

    Joined:
    Dec 2, 2007
    Messages:
    498
    Location:
    The Netherlands
    A few more civ 5 AI quirks people may find interesting:

    Why is the AI so bad at gold? It usually has way too much or way too little
    - Most of AI gold management is done through FLAVOR_GOLD. Unfortunately it seems the team didn't really fully decide what FLAVOR_GOLD should actually mean. Does it mean we have almost no gold and are in urgent need? Does it mean we have a lot and want to expend it? Does it mean we are in a city that focuses on gold? It ends up being a bit of a weird mix of it. You get an empire wide boost to the desire for FLAVOR_GOLD if you have little gold, yet a civic like mercenary army, which allows purchasing landsknechts has a FLAVOR_GOLD value attached to it. A policy which only makes sense if you have too much gold gets picked more if they are in dire need of gold.
    - The AI doesn't care about maintenance in its choice of buildings/units. If the maintenance gets too high, it'll get a boost in desire for flavor_gold, but since there's nothing on the actual buildings/units saying it should be avoided if low on gold, it means very little. (this is why some civs go deep into red)
    - Most of the gold buildings have rather high gold flavor values, meaning they're often picked as the default option, regardless of the amount of gold or the location of the building. "Let's build a bank in a city of size 3 while were already +500 gpt" - Civ AI.

    Why are the AIs so bad at pursuing victory?
    - The main way AIs pursue certain victory condition, is through a 'grand strategy'. A single strategy picked based on flavors, which then boosts the desire for flavors. Unfortunately, the random factor in picking the grand strategy is pretty high, and they reevaluate which strategy to pick a lot. The result is that they swap between their grand plan every couple of turns.
    - The grand strategies are picked badly. The choice is a result of flavor desires and current yields. That the spaceship victory is determined by flavor_spaceship makes intuitive sense, but almost nothing boosts the desire for flavor_spaceship, unlike flavor_culture. So the cultural grand strategy gets picked way more often. Some of them don't really make intuitive sense either, the chance for a culture grand strategy is increased by production and gold yields. Why? The culture grand strategy ends up getting picked up the most, and is essentially the default.
    - These grand strategies don't necessarily boost the correct values. Say if magically the science grand strategy is kept throughout the entire game (it wont be). It will boost 'spaceship','production','science' and 'expansion' and reduces 'religion'. Expansion is a terrible pick, and growth would've been significantly better while religion isnt half bad in a science game. The culture one boosts 'growth', while production would've actually made a little more sense here.
    - They only boost these values by a little. Its still not going to pick a library over a market even within the spaceship grand strategy, because the flavor_gold of 50 on the market is just so much higher than the flavor_science of 35 on the library.
    - They don't always actually boost the desire to do the things actually needed to win as far as I can tell. While the diplomacy strategy does boost the desire for gold, it doesn't change the desire to buy city states. While culture does boost culture, it doesn't have anything for tourism in particular. At least the conquest one does increase war declaration chances, but only minimally.

    Why does the AI always rush civil service, but skips out on universities?
    Civil Service: growth: 20, defense: 10, science: 10, wonder: 2
    Theology: culture: 5, great people: 3, wonder:4
    Education: science: 12, wonder:4
    Philosophy: culture:6, science:3, great people 2, wonder:2
    Drama: culture: 6, great people 3
    Guilds: gold: 20, wonder:2
    Metal casting: offense: 4, mobile: 8, defense: 4, citydefense: 3
    Basically, all of drama (total flavor: 9)/philosophy (13)/theology (12) and education (16) have rather low flavor totals compared to such giants as civil service (42 total wtf) and guilds (22), and other competitors such as metal casting (19). So only intense specialization would be able to beat those higher totals. But no specialization gets you there either. Civs that want science never get drama/theology so never reach education. Civs that want culture get the prereqs of education, but then wont get education itself.
    This also answers why civs never get frigates until way late, even on water maps. Civs dont really get to education. And those few that do are culture/science based, not naval or naval_recon, which are the prime flavors on astronomy/navigation. Basically every single civ prefers the bottom half of the tree here.

    Why is the AI so bad at choosing where to settle?
    Because:
    CITY_RING_1_MULTIPLIER 6
    CITY_RING_2_MULTIPLIER 3
    CITY_RING_3_MULTIPLIER 2
    SETTLER_FOOD_MULTIPLIER 15
    SETTLER_PRODUCTION_MULTIPLIER 3
    SETTLER_BUILD_ON_COAST_PERCENT 40
    BUILD_ON_RIVER_PERCENT 50
    SETTLER_EVALUATION_DISTANCE 24

    It considers a tile next to the city 3 times as important as a tile 3 tiles away. And it considers food 5 times as important as production. A single point of extra food next to the settle location is 15 times as important as a point of production further away. And worse, the total bonus of a new luxury resource appears to be about ~30ish. With the multipliers a single food yield 1 tile away gets 90 points, a luxury 3 tiles away gets 60 points.
    On top of that, it will boost the value by 40% if the city is on a coast and by 50% if its on a river.
    A grassland spot next to a single piece of coast (11 food points) on a river is going to handily beat 6 plains salts on the third ring in terms of importance. Even despite it counting the happiness impact of the salt six times.
    Coast grassland: 11*6*15*1.4*1.5 = 2079
    Salts: 30*2*6 (happiness/resource impacts) + 6*2*15*2 (food values) + 6*1*3*2 (prod) + 6*1*3*2 (gold) = 792
    Look around in your games and check how many of the AI cities,and how many of recommendations are placed on river-coast spots with lots of grass around.


    It's also going to look as far as 24 tiles away from wherever the settler is currently located. And I think that if through some problem the settler ends up reevaluating (it was recaptured, it cant find a path, maybe if a unit is blocking their spot) the settler will happily run another 24 tiles from wherever it is currently standing. Causing these weird 'imma settle right on that piece of grass on the other side of the continent' issues. And since there's a hard limit of 24, it'll also never end up deciding to settle an island more than 24 tiles away. And since its a plain 24 tiles, and not 24 turns, it will happily run their settlers along very long coastlines or mountain ranges if their spot is on the other side.
     
    Last edited: Oct 17, 2016
    Trullari, Melofeign, Atlas627 and 5 others like this.
  17. stealth_nsk

    stealth_nsk Deity

    Joined:
    Nov 28, 2005
    Messages:
    5,513
    Gender:
    Male
    Location:
    Novosibirsk, Russia
    Just to note - that's for Civ5. For Civ6 we don't know its algorithms and priority settings.
     
    Lyoncet likes this.
  18. Disgustipated

    Disgustipated Deity

    Joined:
    Nov 14, 2006
    Messages:
    11,346
    Location:
    Las Vegas
    From the Let's Plays some things look good to me, but several things still look bad.

    One thing I'm concerned about is I have a feeling the AI won't override existing terrain improvements to build a useful wonder or district. Time will tell how the ai prioritizes its tiles, but I have a feeling they won't build late game districts and wonders. But to be optimistic, this doesn't seem to be a hard fix, and there may be some weighted value that can be attached to certain wonders and districts to tell the AI to override existing terrain improvements. I'd also like to see if the AI bothers to chop before placing wonders and districts.
     
  19. KrikkitTwo

    KrikkitTwo Immortal

    Joined:
    Apr 3, 2004
    Messages:
    12,334
    True...but that shows the idea (as well as showing that there is a lot of room for improvement)
     
  20. ExemplarVoss

    ExemplarVoss Prince

    Joined:
    Oct 4, 2016
    Messages:
    349
    The problem is one instance is really vulnerable to random factors. If <strong civ> gets barbarian hordes and loses a settler and builder or two and <weak civ> gets no barbarians and expands early, we learn nothing except that barbarians are really random and must be protected against.

    The hidden agendas also really complicate things. I've seen paranoid come up in a couple games, and it really twists interactions, as relationships go south for essentially no reason.

    And unfortunately, a lot is going to depend on how they show it off. If they just jump around the a map freed from fog of war, we're going to miss stuff, and not know what the factors are that contributed to a decision or result. I have a feeling that the community is going to come to a lot of contradictory biased conclusions about what they think is going on, without much evidence.

    What will be interesting to see is how they spend money, if they buy tiles, if they upgrade units, what they overbuild (I've seen scythia with 6 scouts on an island map and a15 tile starting island, before gaining any naval tech to embark those scouts), and how many times civilians wander off unescorted to die. Also timing: If many civs start building districts around turn XX, and what they prioritize for first and second districts.
     

Share This Page