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

Fixing AI should be Easy

Discussion in 'Civ6 - General Discussions' started by ShakaHulu, Jun 24, 2021.

Thread Status:
Not open for further replies.
  1. ShakaHulu

    ShakaHulu Chieftain

    Joined:
    Feb 25, 2018
    Messages:
    6
    Read an article today about how to fix the Civ AI:
    https://www.https://www.pcgamesn.com/civilization-vii/better-ai?

    This article talks about deep learning like in DOTA, but the truth is Civ combat is nowhere, nowhere, near that complex. The vast majority of Civ combat setups aren’t even as complicated as a chessboard.

    IMO, correcting the Civ combat AI should be remarkably simple. Run an algorithm that checks to see if you can:

    1. Kill any enemy units without losing any of your own

    2. Kill any enemy units while losing units of lesser value than the ones you kill

    That’s what I do whenever I’m at war, every single turn. Can I kill any units while minimizing my own losses. The AI simply fails to do that. After that rather simple calculation, add in some more complicated rules, like positioning and such.

    Frankly, a computer should be able to do that sort of calculation WAY better than a human. And maybe that right there is the problem - if Firaxis actually programmed the AI to kill enemy units without losing their own, they might just be unbeatable. Or they might be so good at it the game wouldn’t be fun.

    It’s just inexplicable to me how the AI fails time and again to finish off enemy units, when that is the cornerstone of any effective combat strategy. And furthermore I find it unbelievable that skilled AI programmers would be unable to program the computer to finish off units, in fact, the computer should be incredibly skilled at that.

    Is the problem that Firaxis can’t program a good combat AI, or is the problem that they can program exactly that, and that it would make the game less “accessible”?
     
    Cedbird77 likes this.
  2. blackbutterfly

    blackbutterfly Emperor

    Joined:
    May 9, 2016
    Messages:
    1,095
    Gender:
    Male
    Location:
    Leeds, UK
    Or play humans?!

    There is a thing called multiplayer. Civ VI is not a bad game for MP.
     
  3. Kaan Boztepe

    Kaan Boztepe Prince

    Joined:
    Mar 26, 2018
    Messages:
    361
    Gender:
    Male
    again it is a problem of scale. a chess board is 8*8 and dota or starcraft use small maps that have limited interactions possible. civ maps you can improve every tile with multiple different units and improvements. there is a whole diplomacy side that is simply not there for chess or dota . dont forget that the way openAI works is that they play out each and every possbile scenario against each other with each unit doing each possible move. good luck doing that for a civ map. it is certainly possible but 10000 years playing by itself would be maybe enough for just a small map.
     
    nzcamel, ShallowSeas and PiR like this.
  4. kaspergm

    kaspergm Deity

    Joined:
    Aug 19, 2012
    Messages:
    5,227
    Sorry, don't want to be offensive, but the level of ignorance in this statement is rather staggering imo.

    First of all, the problems and challenges with AI runs way outside just the scope of how units engaging in combat. Secondly, your statement completely fails to address the issue that meaningful play is not just about what can be done right in this turn, but also to plan events for upcoming turns.

    However, if we want to discuss a "simple fix" to how AI engages its units, I think your fix is the wrong one. I think the fix needed to make military AI more challenging is:
    1. Always attack any unit you can - if there are several options, choose the one that will end with least HP.
    End.

    One of the problems with current military AI is that it's too cautious. This makes it too easy for humans to defend, and makes the AI not use the production advantages it has to full extent.

    The rule suggested above is basically how barbs play in Civ6, and it's widely acknowledged that barbs is the major, if not even only, thread to the human player in the game. Basically, the AI civs need to play more like barbs, if they want to use their advantages fully.

    Whether such a change would make the game a better game is another question.
     
    Last edited: Jun 24, 2021
  5. Naokaukodem

    Naokaukodem Millenary King

    Joined:
    Aug 8, 2003
    Messages:
    3,308
    IMO it's terrible, especially with those early aggressive civs. If you want to survive, or even attack, you have to completely ignore districts early. And Scythia...

    The AI could create one or several small virtual maps that are in range of combat. Easier said that done though. (especially with humans exploiting that)
     
  6. blackbutterfly

    blackbutterfly Emperor

    Joined:
    May 9, 2016
    Messages:
    1,095
    Gender:
    Male
    Location:
    Leeds, UK
    It's not very balanced for MP. Civ Beyond Earth is actually a better MP game for balance.
    Rome is OP. Most frequently Roman player wins MP games.
     
    Naokaukodem likes this.
  7. Chefofrats

    Chefofrats Prince

    Joined:
    Mar 8, 2018
    Messages:
    382
    Location:
    The Cardboard Country
    There is also the problem that I would never play any game in which the AI would beat me every time. The AI can't be too good if we want the game to be enjoyable for most players, and most of players play only casually.
     
    Futumch likes this.
  8. Fluphen Azine

    Fluphen Azine What is Fluphen Azine?

    Joined:
    Jan 27, 2013
    Messages:
    1,477
    Location:
    Las Vegas
    Multiplayer is fun but it has its own set of numerous problems.
     
    Kjimmet and blackbutterfly like this.
  9. Kaan Boztepe

    Kaan Boztepe Prince

    Joined:
    Mar 26, 2018
    Messages:
    361
    Gender:
    Male
    I think you misunderstood the way openAI works. it plays the games first ,creates an optimum play database and uses that data to play. It doesnt dynamically change the way according to what happens on the map. openAI already played all variations and knows the optimum answer to all plays. As for CIV each map is nearly unique. even a simple decision to what pillage and in what order to buy or build what units/buildings has so many variations that openAI the way it works now could not handle it. some other AI that i am unaware of could of course but i just dont see any AI that could handle it at the moment. the fact that there are so many decisions over so many unique maps with diplomacy added in to decide if to go to war or to ally is simply too many decisions.
    so firaxis simply created a weigh in system where the program decides what actions are possible and how important those are and does all the actions according to that list. it is working out well enough , at least for a 2016 release game.
    Can they make the AI more aggressive , better at combat by calculating the maximum damage/pillage etc. sure. but that would make the gameplay a lot less enjoyable for the vast majority of players. Creating different AI rulesets for each difficulty would be a nightmare for bug fixes and even different game mods to work together too. The best to hope for would be that they release a SID difficulty mod.
     
  10. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,826
    Location:
    France
    From the article:
    How would that be possible ?

    There is already a good thread about the difficulties to use that kind of AI in a Civilization game:
    https://forums.civfanatics.com/threads/game-ai-net-based-machine-learning.627729/

    To summarize:
    - long path to reach a "winning condition"
    - randomness (maps, events, combat results)
    - incomplete information (fog of war, opponents unknown)
    - complexity (terrain/feature types, combat rules, number of possible choices per turn, order of those choices, ...)
    - evolving rules with each balance patches

    now you're talking about a behavior tree, which is different.

    AFAIK the AI already target the opponent's units it will deal the most damage against.
     
    pokiehl, bbbt, Avatan and 1 other person like this.
  11. iammaxhailme

    iammaxhailme Emperor

    Joined:
    Jun 4, 2015
    Messages:
    1,844
    Making all-around good AI is incredibly hard. But the civ AI has a few small tweaks (that should be fairly trivial to people with access to the source code) that, while not making it a super genius AI, would fix a lot of issues. For example, stop running ranged units into range and then retreating them without doing anything.
     
    PiR and Duke William of Normandy like this.
  12. frutiemax

    frutiemax Chieftain

    Joined:
    Jan 19, 2015
    Messages:
    99
    I would see the AI getting improved by making decisions based on probability models (some examples):
    • How likely I am going to be attacked?
    • How likely I can take X city?
    • How likely I can achieve domination, science, religion, culture or score victory?
    • How likely X player will achieve X victory if I do nothing
    The AI would then need to take decisions based on those probabilities, which right now, the AI is definitely not doing...
     
  13. aieeegrunt

    aieeegrunt King

    Joined:
    Jan 8, 2021
    Messages:
    655
    Gender:
    Male
    Civ6 AI is so terrible it does things like slam campuses to the point it runs out of money and has to disband it’s army

    It would be hard to make an AI worse than this one
     
    Cedbird77 and Aristos like this.
  14. PSG

    PSG Chieftain

    Joined:
    May 6, 2021
    Messages:
    31
    Gender:
    Male
    Something I have seen a lot lately is the Ai losing its cities to revolt in the mid to late game. I won't notice it and suddenly I see 3 or more of their cities turn red and my trade routes get chopped to pieces. The revolting cities are not even close to my borders most of the time. The Ai shouldn't have cities revolt unless the player is within 10 hexes. And another thing....free city units shouldn't pillage trade routes.
     
  15. Naokaukodem

    Naokaukodem Millenary King

    Joined:
    Aug 8, 2003
    Messages:
    3,308
    Your openAI seems to be an AI of the prehistoric age. Nothing new.
     
  16. Aristos

    Aristos Lightseeker

    Joined:
    Dec 11, 2001
    Messages:
    3,754
    Gender:
    Male
    Location:
    Deep inside...
    There was a time when THAT was the main driver for gamers... beating an "unbeatable" AI... oh well, times change. Generations change.

    Ha. Give them time. Civ 7 is coming.
     
    Smity2k1, Fluphen Azine, uhu and 4 others like this.
  17. Chefofrats

    Chefofrats Prince

    Joined:
    Mar 8, 2018
    Messages:
    382
    Location:
    The Cardboard Country
    I don't think it has anything to do with generations. I've been playing computer games for 35 years and I've never enjoyed an "unbeatable" challenge. Perhaps the proportion of casual gamers within the gamer population is growing with the rising accessibility of gaming platforms (there are many more devices that allow gaming, per capita, now than in the past), but without research we can only speculate about it.
     
    steelaway and kaspergm like this.
  18. Bactrian

    Bactrian Chieftain

    Joined:
    Apr 18, 2014
    Messages:
    37
    I wonder if Civ 6 being ported to the Nintendo Switch was the death knell for a strong AI in the franchise. I don't have a reference on hand, but I remember reading or hearing that one of the challenges that Firaxis has faced with the AI is late-game turn times. Players don't want to sit and wait for long AI turns, so the computational complexity that is required for good AI play has been sacrificed to keep turn times low. You can do both if you have enough processing power, but the Switch is not exactly a beast of a machine. If sales were strong on the Switch I don't think Firaxis would sacrifice that market for the sake of making a stronger AI.
     
  19. Socrates99

    Socrates99 Bottoms up!

    Joined:
    Oct 11, 2012
    Messages:
    2,351
    Gender:
    Male
    Location:
    Michigan
    Tweaks to build priorities would be the better way to make them more competitive. Civ Vs AI wasn't technically smarter but it was more threatening because it actively pursued a victory and used its production bonus to spam units. Yeah, it was dumb and I killed 3-5 units for every one I lost but it often kept up with that pace. Every late game war was a war of attrition. In VI you wipe a token force then it's a long boring siege.

    The combat AI is better if you add movement points to units. Ranged units will move and shoot and cavalry will pounce from the fog. VI's very restricted movement rules is probably the AI's biggest impediment. I use a mod that adds 1mp to all units and Gran Columbia AI is absolutely fantastic with that. Simon regularly wipes neighbors with that. Persia will too if hes aggressive. He wiped Georgia early in my last TSL game. Funny part is I thought V could use more movement to prevent 1upt units from tripping over each other. Imagine my surprise when VI released with even harsher movement restrictions. Not sure who thought that was the right direction.

    Maybe reduce unit maintenance and production costs for higher difficulty AI? Hell, I'd drop back to emperor if the AI built a halfway decent army. I get tired of how fast the early game goes on deity.
     
  20. BrotherInJah

    BrotherInJah 60% of the time works every time

    Joined:
    Aug 7, 2010
    Messages:
    431
    Location:
    Location, location, location..
    Really? Those two point are wide as they can possibly be, no specifics while specifisc are the whole ponit of bad AI. "Easy" calculations take time, and gameplay-wise maybe you're ok with "1 turn per day" style, but i'm out.
     
    PiR likes this.
Thread Status:
Not open for further replies.

Share This Page