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

Game AI & net based machine learning

Discussion in 'Civ6 - General Discussions' started by Deggial, Jan 31, 2018.

  1. The googles do nothing

    The googles do nothing Prince

    Joined:
    Feb 5, 2017
    Messages:
    329
    Gender:
    Male
    Location:
    Minneapolis, MN
    Would a AI maximizer look like a what good human player looks like? The really good MP player streams i've watched the strategy is to wait for a time where they have an advantage over the other civs.
     
  2. Sknubbinateur

    Sknubbinateur Chieftain

    Joined:
    Aug 16, 2019
    Messages:
    37
    Gender:
    Male
    I just really don't buy into the argument that the AI should be suboptimal on purpose so that the game stays fun. AIs should be programmed towards the goal of a game as defined by its rules which is to win, and it's perfectly possible to design a game where several winning strategies are viable and fun (if they are not, they should be adjusted). Of course if you want to roleplay or play on casual-mode you can still do that with handicaps etc.

    Also the relevant comparison should probably not be Civ vs Go but vs Starcraft or something. Yes, it has only one victory condition, but with Starcraft already requiring way more decisions than abstract board games, it seemed unbelievable too until it happened. We always think that something is too complicated for AI and not possible to beat humans at, and then it turns out to be possible after all. Also with other games that have imperfect information like Civ (poker).

    See also: "AI experts thought a computer couldn't beat a human at Go until the year 2100" - http://www.businessinsider.fr/us/ai-experts-were-way-off-on-when-a-computer-could-win-go-2016-3
     
  3. oSiyeza

    oSiyeza Warlord

    Joined:
    Sep 27, 2013
    Messages:
    141
    Gender:
    Male
    Location:
    Spain
    You should buy the suboptimal approach, since literally there is no such a thing as an optimal AI in a game. Literally every AI in every modern game cheats in order to be suboptimal. From fhe new Doom to Starcraft.
    Yes, there is a AI that plays go very well, and an AI that plays chess very well has been there for decades, and there is an AI that plays Starcraft. You simply dont want to play against them, cause you cant. Nobody does, and nobody designs an optimal AI in any game. This is for a reason, you will have no game. And nobody will play it.
     
  4. Sknubbinateur

    Sknubbinateur Chieftain

    Joined:
    Aug 16, 2019
    Messages:
    37
    Gender:
    Male
    Why not?

    Imagine: AI plays optimally. Civ is balanced so that optimal play involves all aspects of the game which makes it thematic. The optimal strategy is different depending on the situation, map, what opponents do etc, and gets adapted constantly as the game goes on. Human player gets +X% boost to everything, as much is necessary to let it compete with the AI.

    The different AI civs still play the game differently since their varying civ bonuses make it that different strategies are optimal to them.

    Seems fine to me
     
  5. oSiyeza

    oSiyeza Warlord

    Joined:
    Sep 27, 2013
    Messages:
    141
    Gender:
    Male
    Location:
    Spain
    Well, you are wrong.

    Let me explain you what an optimal AI is.

    Lets say you are Korea, and you want a science victory. Your main goal is to have the highest science output.

    As an AI you solve the numerical problem, what can I do in the next action that gives me a biggest chance of Victory.

    This means for example you have trained with a database of millions of games, and you know that you that a geometrical expansion of cities, spaming campus, building the science wonders and going for science city states, will lead you to a science victory in the turn 150-175 with a confidence interval of 95% if you do it in a certain way.

    Every decission you take is based on statistical information that will increase your chances of victory in the long run. You will not waste a single turn, or build anything that will not lead you to the maximun increase in chances of winning. Of course you will not waste production on emergencies, trading or attacking, builing a religion or any religious buildings or units. Care about grievances, culture archeology or anything that deminish your chances. You will act in a way totally alien for a player, and your actions will look random and unpredictable.

    A current AI can win a science victory on a turn 300 if not disrupted. An optimal AI will be able to win on turn 100. And it will be imposible for a human player to do it faster.
     
    Last edited: Aug 29, 2019
  6. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,682
    Location:
    France
    Let's suppose you can make an optimal AI for the sake of the argument. I won't see it in my lifetime, but, ok.

    I would not want to play against it as it won't allow me to role play, unless you give me so much bonuses that I basically won't play the same game (similar to the opposite situation we have today where at deity a human don't play the same game as the AI), and the AI itself, to be optimal, will not role play, making it a boring opponent which has only one objective: winning.

    in short, I don't wan't an AI that play to win a board game, I want one that makes logical decisions to lead an Empire through the test of time.
     
    King Rad likes this.
  7. kryat

    kryat Prince

    Joined:
    Dec 12, 2017
    Messages:
    534
    Gender:
    Male
    There’s a catch to that though: military action. Civ is more complex than Go or Starcraft because (in addition to other reasons) there are multiple ways to win. The AI might not waste production heading for a science victory on military power, leaving it vulnerable to attack.

    What I think would be more likely is that the AI would get an early lead on tech (maybe early medieval tech by the time most deity players are in late classical) and then come slaughter them militarily by overwhelming numbers. This is because it turns out the fastest way to a science victory is not through optimal settling but by stealing the production of your neighbors, especially the weak human players, not other AI players.

    That’s not what we’d want.
     
  8. oSiyeza

    oSiyeza Warlord

    Joined:
    Sep 27, 2013
    Messages:
    141
    Gender:
    Male
    Location:
    Spain
    I did probably express myself poorly. An AI done this way will defend their cities if defending their cities increases their chances of victory. And it will defend their cities in the way it increases its chances of victory the most.

    Also the perception of Civ being more complex than go is probably a misconception. The point here, is not how many moves you can make, but how difficult is to estimate the outcome of a decision, and how meaningful a decision is. In other words, you dont need to simulate a diferent game for each technology you can research if there is an optimal technology progression regarless the rest of the game. Im afraid, CIV systems are mostly independent from each other to the point a human player can reliably win on deity without altering his original plan significantly.
     
  9. Sknubbinateur

    Sknubbinateur Chieftain

    Joined:
    Aug 16, 2019
    Messages:
    37
    Gender:
    Male
    Of course I know what optimalisation means. But the game would have to be properly balanced so that participating in trade, emergencies etc increases winning chances, and so that the best way of achieving a science victory is integrating religion, culture etc into your strategy as well. If the game is designed well enough, playing with the objective of winning will naturally mean you're playing in a way somewhat similar to role playing. For the rest, consciously preferring to play suboptimally and playing against an opponent that plays suboptimally makes the game strategically less interesting and should not be a design goal. Plus, if you're in it for the role playing, the bonuses you would get to be able to keep up with the AI shouldn't matter for this.
     
  10. oSiyeza

    oSiyeza Warlord

    Joined:
    Sep 27, 2013
    Messages:
    141
    Gender:
    Male
    Location:
    Spain
    At this point you are not arguing for a better AI, you are saying that the entire game should be discarded and rebuilt in order for an AI to work like a player would. Which is probably imposible, and is also arguably not the way any game is designed or a civ game should be. To bring this discussion to this level is pointless.

    I am telling you that there is not such a thing as a game where the AI plays the same game the player does in an optimal way. Of course this is when talking about a game where a regular human has a chance of wining.
     
    Last edited: Aug 29, 2019
  11. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,181
    If you ever get an AI this good you can just resort to handicapping it or giving players bonuses :p. It would be a top-tier training tool for PvP too.

    I doubt this would still be true, however, if the AI were optimal or even kind-of close to optimal. Humans put up pretty drastically different times/outputs on the same start(s), compared to other humans. This suggests that there are mistakes being made routinely, and an opponent who makes significantly fewer will pull ahead quickly.
     
  12. oSiyeza

    oSiyeza Warlord

    Joined:
    Sep 27, 2013
    Messages:
    141
    Gender:
    Male
    Location:
    Spain
    It is a bit more complicated than that. One of the reasons Machine Learning is rarely used for games is that is unpredictable. These systems work basically exploring a solution space to reach a goal by taking amy path they see fit but one the designer has no control over. Giving them restrictions or subgoals is posible but usually is not a good idea.

    For example, you have no control on what units or buildings they will buy or not, they may decide that moving units is not their thing, build only a type of units, do not sign ever any alliance, they may decide to never set cities coast, or that they will never research some techs, or only try to build the same one or two wonders and found the same religion in every game. They will have to relearn the game for any rule change and so on. In the end it is still posible to use these systems. But to warranty that they behave in the way a player expects the AI to work, so many restrictions have to be imposed that the effort is not worth it.

    Also these methods are very expensive to build, and they may still make some weird decissions that cannot be corrected with a patch, but may require to retrain the AI for months.

    However the most obvious reason to not use them is because experience shows that players dont want them.

    The most advanced AI systems ever used on official games are present in the Total War series, and their AI is seen as insanely bad in many iterations of the game. A very good AI can utterly fail, due to being unable to handle apparently very easy tasks. And when it works properly it can be a bigger dissaster cause it can be so good that the player isprevented to play the way he wants. So in almost all games perceived as having a very strong AI, the AI does not actually try to win the game, but instead tries to cheat to be perceived as competent while in reality is programmed to make the player have fun.

    Lets see how a game with a great AI works. Lets start with a simple case like Doom 2016, enemies just have to try to kill the player and they seem to be very good at that. Seems simple, right?. Well it is not, the game cheats in insane ways to ensure the player has fun with the game. The enemies need to ask for permision to each other before attacking the player, in order to attack only one or two at a time, the enemies will aim worse if the player is moving, they are prevented to damage the player when he is in vulnerable positions ... and so on.

    Usually games have a game director, that allows or dennies events from happening in order to not frustrate the player. In X-Com, the game cheats so if the enemy crits the player, their next shots will fail, or is ensured the player does a warrantee hit after missing high chance shots. Is spec Ops: The line, the enemies in addition to attend to a game director, are required to expose themselves out of cover, are prevented to be too accurate with grenades, and fake running low on anmunition. Ally NPCs in many games are often warranteed to kill and fake their attacks sending petitions on the enemy to die instead. In Starcraft II, the non official Deep Learning AI handicapps itself by using a smaller field of view than the player and limiting the number of actions per minute it can take, in Fear the game enemies cheat by speaking to the player to reveal their positions, in RTS games the AI often follows a script that is warranteed to give the players a chance, in turn based games the AI is often forced to make mistakes by taking ramdom actions, or has forbidden behabiors such as surrounding the player....

    All in all, designing an AI for a game is difficult, and the goal is never to create an opponent that wants to win the game in the most efficient way possible. The goal is a much more difficult one, to create an opponent that creates commitment and challenge, but ultimately is designed to be beated.

    Granted, the AI in civ is not good, but the problem is not what you think it is. To create an AI in civ that will beat the crap out of a player is not so hard. But if you think you want that, you are likely very mistaken. The devs have the task to create an AI that builds an empire, uses the game systems and acts like a human leader would act. That is a much harder task than making an AI that wins.
     
    Last edited: Aug 29, 2019
    King Rad, Avatan and Gedemon like this.
  13. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,181
    It's the other way around. If an optimal AI does/doesn't do things like this and the intention is that it would do the opposite, there's something wrong with the design of the mechanics. Developers that make the AI play poorly just to use mechanics that are otherwise consistently suboptimal are engaging in an intentional cop-out. In any particular instance one does this they are admitting their failure in designing the mechanic in question.

    We already see this in practice, given that SP vs MP competition look extremely different in approach + what mechanics are actually viable. It's actually an advantage of a ML AI that it would make it possible for devs (who are frequently not very good at the games they make) to recognize weak/poorly implemented mechanics even before beta testers tear the mechanic to shreds and otherwise get ignored despite identifying obvious problems that are completely independent of AI.

    A legitimate reason not to use them, at least for now.

    If the decisions made do not lead to victory, this is a problem with the AI. If they do lead to victory but are still "weird", it is a problem with the design.

    This is not a viable comparison, while Total War AI is viable to compare. The reason is that AI for enemies in Doom are not in the same position/bound by the same rules/taking the role of a player. They are obstacles by design, rather than competitors taking a slot that is otherwise occupied by a human player.

    One of the significant failings in the Civ franchise is an attempt to make the AI somehow be both, which is literally impossible to attain. I suspect this might also be true in the Total War franchise, though I've not played it.

    I think the AI in Civ isn't good because Civ AI is designed to play something other than Civ. Its design is internally inconsistent. This is exacerbated by its overly weak-tuned optimization for winning, but the core issue is that it alleges one thing but does 2-3 other things w/o doing what it alleges. It is straight up designed to behave inconsistently and dishonestly to its presentation. An AI in such an environment can *never* be good, no matter how talented the person programming it is.
     
  14. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,682
    Location:
    France
    I'm amazed at how Civ manage to attract players with gaming style so different that it's giving me the impression that even if we both write in English, in fact we don't have the same langage.

    That phrase here is an alien concept to me, as I've never played civ1-2-3-4-5 and now 6 with "the objective of winning".

    Yes, I want the AI to be able to use the game's mechanisms in a way that will provide enough challenge until the game reaches the state of "last turn reached", but I don't want to be forced to play only with a set of rules in which it can reach a state of "player X has won"

    And I can't even begin to imagine how one could possibly manage to design a set of rules in which an optimal AI will be able to roleplay just by being slowed down by penalties, because an optimized AI will always display an artificial behavior.

    The moment an AI is perfect for a task in a game, you must introduce limitations if you still want it to be able to provide fun for the human player. See racing simulations for example.

    And that it's main goal in any game, entertaining the player, not trying to win without any consideration for his feelings.
     
  15. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,682
    Location:
    France
    this here is the core of the misunderstanding between RP and competitive players.

    Competitive player want that, I understand. But you can't make that kind of AI "taking the role of a competitive player" into an one that is made "to ensure the player has fun with the game" by simply tuning it down.

    You need either to code one AI that does both (and will surely fail at both as you pointed), or code two different AI for the same game.
     
    kryat likes this.
  16. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,181
    Do you care if you lose? I don't know about you personally, but it's fairly typical to see players claim they don't play to win or like to roleplay, but nevertheless don't like it when the AI tries to win and/or does so. If you legitimately don't care you're in a minority in that regard, from what I can tell (obviously I don't have substantive statistical data and there might be million+ people out there who never post a word on the forum and are all perfectly happy just playing and losing games over and over while doing what they want out there. I don't anticipate that but can't rule it out).

    But you can just ignore those rules. In fact, doing so is what distinguishes role play from strictly playing to win.

    Distinguish "artificial behavior". I don't think you can do it. So far in Civ, human players have been far better with optimizations, to the point where they get accused of "cheese", which is presumably what "artificial behavior" is when executed by a human rather than the AI.

    You can role play no matter what the AI does or how effectively it does it, especially if you introduce handicaps. You can not compete with the AI no matter what the AI does, because if it doesn't play the game it isn't competition.

    If you care that the AI beats you while roleplaying, you are being incoherent, dishonest, or both.
     
  17. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,682
    Location:
    France
    Spoiler :
    I care to not lose. In a game without winning condition, it means surviving up to turn 500. And my goal is to have fun playing the game between turn 1 up to turn 500.


    I can't ignore them if the AI is rushing for one of those states. I mean I can continue role-playing as if I have not lost the game until turn 500, but while it's rushing for those winning state, the AI is unable to provide any immersive empire interaction. You can't put me in a city driving simulator and tell me "hey have fun with your role play driving in a city, you don't mind if have put racing AI in all the other cars ?"


    That's exactly why I don't play competitive MP.


    No I can't RP in an immersion breaking environment. Yet, I appreciate the intention of trying to understand the PoV of the other side...

    ... but don't go this way please.

    what's difficult in understanding that I want the AI to provide the background on which I can build my role play ?

    it means that yes, I want it to provide some form of challenge, but I don't want it to compete with itself to reach some artificially defined game states I'm ignoring myself.
     
    Last edited: Aug 30, 2019
  18. oSiyeza

    oSiyeza Warlord

    Joined:
    Sep 27, 2013
    Messages:
    141
    Gender:
    Male
    Location:
    Spain
    I wonder if i am expressing myself so poorly or we actually live in diferent worlds.

    As i tried to explain you, the AI you want does not care about enjoying or interacting with the game. It is not a fault of the game to be designed to be played by a human.

    Any AI in a game, in any game, is not intended to be simply an oponent for the player, AIs are designed to play with the player and to give the player the experience the designers want for the game. They are characters that follow a script, to create a world the player inhabits while playing. And they succed or fail not because they win the or lose against the player, but by giving the player a sense of joy.

    This is how every computer game is made for a reason. What you suggest has been tested and does not work. It will not solve the problems of the game, it will create bigger ones.

    And if all these reasons still not fly with you, here is the simpliest one. What you want is impossible, and will not be done for this game.

    And that is a good thing.
     
    Last edited: Aug 29, 2019
  19. oSiyeza

    oSiyeza Warlord

    Joined:
    Sep 27, 2013
    Messages:
    141
    Gender:
    Male
    Location:
    Spain
    Well, you cant. Unless the role of the player is do an analytical task like in chess or perform an hability task like in a race. The only thing an AI of this kind can do is find the most efficicient way possible to reach a goal.

    But complains aside, the AI in civ is not nearly as bad as the opinions here suggest. It has problems, and those can be fixed with enough resources if the developers want to. And It will no be as complicated as you think.

    How to fix the current AI in civ 6, according to my opinion.
    - Commit more to increase the challenge of the game, and care a bit less about player frustration.
    - Solve the small bugs the hame has now such as the inhability to use catapults for defense.
    - For aggresive civs, decrease the importance given to grievances, and allow them to be a bit more aggresive in middle and late game, starting more wars, and trying from time to time to go for a domination victory or a more aggresive expansion.
    - Implement a couple more of combat strategies, specially for using groups of units, and supporting land forces with air units.
    - Improve city planning and pathfinding.
    - Increase the long term commitment for their planned goal. And increase the hability to try to disrupt other civs plans.
    - Add the neccesary behabior to be able to deal with climate change, and to repair damaged structures or improvemts.
    - Dedicate less resources to aid requests.

    Thats it, is not a long list and can be easily done if firaxis wants to. I really think that improving the AI a bit, and deepening some game systems such as challenging dark ages, a diplomacy where civs care more or less about you messing with other civs according to their relationships with them, or with a WC where civs with the highest diplomatic score host the WC and propose a resolution, and some crazy funny spy missions or resolutions. This game would be much better.
     
  20. tanktop4158

    tanktop4158 Chieftain

    Joined:
    Jul 20, 2012
    Messages:
    47
    anything would bet the piece of gARBAGE CIV 6 is using IMO
     

Share This Page