Game AI & net based machine learning

There are quite a few issues with this idea. Like how many different play styles and variants on maps, civs, and even numbers of players. All these variants offer a wide array of decision trees needed, not that it is impossible, but it can't be cheap. Then what is "good" is it an AI that plays different every time or plays optimal every time? Optimal play is something I doubt many would actually want. AI that can win a 'perfect' game such as chess and go are very different things, but even those are only interesting to the absolute greatest players in the world that have dedicated their lives to it. Would a novice enjoy learning chess against Deep Blue? And what made those interesting were that the master human players could possibly play optimally but look at all the combinations of moves there are in something as 'simple' as chess, there are 400 different combinations after only 2 moves. Can you imagine the number of combinations of moves there are after 2 turns in Civ? If you are requiring a human to preform an optimal move in every turn for as long as a Civ game can last, that is just far beyond what any person would be capable. An AI that makes perfect plays in every situation would wipe the floor with any and all human players. But then of course, how does an optimal AI do vs another optimal AI, or 7?
 
Is there an Attacker/Defender system in the game (Question is for modders)? When I wrote my first AI for my strategy game there was a severe problem that if it goes out with an army to attack a location and fail, the player could easily strike back on its unguarded cities. I then flagged the units as Attacker/Defender (1/3 - 2/3 of all available units) where defenders did not leave their position too far. This made a huge difference.
 
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.

I could say the same thing in response.

It doesn't matter what the AI wants. There is a serious problem with the game if trying to win implies materially different actions from "interacting with and enjoying the game". In a well-designed game, trying to win it should be fun.

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.

It is not valid to equate doom imp AI with AI that act as competitors with the same rules that bind the player. They are not the same thing. It's like saying ants and humans are the same thing because they're both types of animals.

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.

You seem to have an odd idea about what I want.

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 ?"

But you're basically saying the AI should do this, which isn't an internally consistent argument.

The rules define valid actions and victory conditions, and you're necessarily implying that the AI should play something other than what the game sets up.

No I can't RP in an immersion breaking environment.

Of course you can. You can RP in any environment in principle. There is no objective source of "immersion" and thus claiming an "immersion breaking environment" is non-sequitur. I counter-claim that the AI not playing Civ 6 breaks the immersion of Civ 6.

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

I'm not saying it to be mean. There's just a logical reasoning flaw with taking the stance as I described it. At some point, either you're operating in the constraints of the rules and trying to meet the game's objective or you're not. Not doing so, then arguing against the consequences of that choice, does not and can't make a coherent case.

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

Rather than being difficult to understand, I reject it as a proposition because it isn't coherent. You want it to "try", but not so hard that it interferes with your (arbitrary) sensibility of what grants vs detracts from "immersion".

Those "arbitrary game states" you reference are win conditions, as defined by the rules of the game. The most "arbitrary" aspect of this discussion is the alleged boundaries of "immersion" and "role play".
 
Spoiler :
But you're basically saying the AI should do this, which isn't an internally consistent argument.

The rules define valid actions and victory conditions, and you're necessarily implying that the AI should play something other than what the game sets up.
I'm not implying it, I'm saying it: the game is set up for me, not for the AI.

The AI should follows its rules (cities placed 3 tile appart, same diplomatic choices, same units strength, same tech tree, ...) but not "play" it. That's my part. It's part is to provide my fun while I am playing.

I'm fine for its emancipation if it reaches consciousness, but so far I'm the one paying the electricity bills allowing it to run its code on my computer, so it better work for me and stop thinking of playing.

Of course you can. You can RP in any environment in principle. There is no objective source of "immersion" and thus claiming an "immersion breaking environment" is non-sequitur. I counter-claim that the AI not playing Civ 6 breaks the immersion of Civ 6.
Ho, yes, of course I can RP in any environment. Even in the environment created by your vision of the AI. Yeah, sure, I can. But I won't. Try to explain me, why would I want to play in it when it's designed to force me to play differently than what I've done for 28 years ?

I'm not saying it to be mean. There's just a logical reasoning flaw with taking the stance as I described it. At some point, either you're operating in the constraints of the rules and trying to meet the game's objective or you're not. Not doing so, then arguing against the consequences of that choice, does not and can't make a coherent case.
Let me remind you what are the rules of my civilization games since 1991:
Spoiler :
Clipboard-1.jpg


And don't tell me it's not what the game is about. It is. It's the very foundation of the franchise, "build an Empire to stand the test of time", remember ?
Spoiler :
civilizationi-boxart.jpg



Rather than being difficult to understand, I reject it as a proposition because it isn't coherent. You want it to "try", but not so hard that it interferes with your (arbitrary) sensibility of what grants vs detracts from "immersion".
Reject if you want, but it's really a matter of not understanding something that is alien for you.

I don't want it "to try but not so hard", I want it do to its absolute best to entertain me.

Those "arbitrary game states" you reference are win conditions, as defined by the rules of the game.
Remember, my playing rules, for 28 years.
Spoiler :
Clipboard-1.jpg
 
Last edited:
The AI should follows its rules (cities placed 3 tile appart, same diplomatic choices, same units strength, same tech tree, ...) but not "play" it. That's my part. It's part is to provide my fun while I am playing.

Your fun is not the same as x player's fun. Neither is the same as Y player's fun. Continue for 10,000s of variable players.

The AI can't be made in a way that manages to provide "my arbitrary fun" to 10,000 - 100,000s of people. It can be made to play a game pursuant to its rules, however.

Ho, yes, of course I can RP in any environment. Even in the environment created by your vision of the AI. Yeah, sure, I can. But I won't. Try to explain me, why would I want to play in it when it's designed to force me to play differently than what I've done for 28 years ?

Why would I want to play a strategy game in which the most common competitors available to me don't play the game at all? What meaningful choices/strategy does this offer?

Let me remind you what are the rules of my civilization games since 1991:

If there's no way to win there's no particular basis for the AI to make any single choice. Random picks it is.

And don't tell me it's not what the game is about. It is. It's the very foundation of the franchise, "build an Empire to stand the test of time", remember ?

The game's rules define it, not its marketing slogans.

Reject if you want, but it's really a matter of not understanding something that is alien for you.

I reject because making hundreds of thousands of unique copies of civ for each arbitrary preference set isn't viable.

I don't want it "to try but not so hard", I want it do to its absolute best to entertain me.

That has no defined meaning. What's worse, for many players what "entertains them" isn't something they can even state in a coherent fashion.
 
Spoiler :
Your fun is not the same as x player's fun. Neither is the same as Y player's fun. Continue for 10,000s of variable players.

The AI can't be made in a way that manages to provide "my arbitrary fun" to 10,000 - 100,000s of people.
you're right it can't, that's why it's not perfect for anyone but still manage to bring millions of players together.

It can be made to play a game pursuant to its rules, however.
Sure, but then they'll be 2 people left playing with it.

That is until they'll realize it's not fun anymore after a few hundred turns.

Why would I want to play a strategy game in which the most common competitors available to me don't play the game at all? What meaningful choices/strategy does this offer?
Building an Empire that can survive for 6 thousands years of simulated history ?

No one ever done that by staying idle.

If there's no way to win there's no particular basis for the AI to make any single choice. Random picks it is.
Simulating 6 thousands years of history ? no AI ever done that by making random choices.

The game's rules define it, not its marketing slogans.
Wrong, those who're going to buy it defines it. I clearly won't buy yours, you clearly won't buy mine, but Firaxis still manage to make one they sell to both of us.

(but hey guys, friendly reminder, if you don't release the DLL source code, that's the last one you've sold to me)

That has no defined meaning. What's worse, for many players what "entertains them" isn't something they can even state in a coherent fashion.
it's called dopamine.
 
Last edited:
Sure, but then they'll be 2 people left playing with it.

You have no more basis in saying that than you would with current setup.

That is until they'll realize it's not fun anymore after a few hundred turns.

?? This is one of the more common complaints about Civ games after Civ 4. Don't see what would change.

Building an Empire that can survive for 6 thousands years of simulated history ?

Meaningful choices/strategy.

No one ever done that by staying idle.

Actually, they have in the current Civ setup. It would be harder to do that if the AI tried though.

Wrong, those who're going to buy it defines it. I clearly won't buy yours, you clearly won't buy mine, but Firaxis still manage to make one they sell to both of us.

Firaxis defined rules then chose to make its AI not abide them. This is a weak form of dishonesty and not appreciated. It's one of the reasons I play Civ less and less since Civ 4, though not the primary reason (disregard for end user experience in terms of IRL time & controls is the #1 reason).

it's called dopamine.

You're one step closer to source in the human cognition process but are in the same place argumentatively. Something that happens interacting with the game causes that dopamine release. People still can't coherently define what causes it for them specifically in many cases.
 
Hi, I’ve been lurking in this forum for at least a few weeks, and I’ve been following this thread fairly closely as I find that the discussion has been quite interesting thus far. Well, I think it’s pretty clear that the discussion has somewhat gone off a cliff at some point. So I wanted to add some meta-commentary that might be a bit presumptive, but here goes:

Before the whole set of one-sentence jabs about the AI making random decisions, “arbitrary fun”, and dopamine, I think the most critical point about the philosophy of the AI design had already been made, by oSiyeza. No, of course the Doom AI isn’t the same as the Civ AI, the games are entirely different. But there’s an important point that was hand-waved away with that argument: that good game AI is designed for the purpose of optimizing the player’s enjoyment. Optimizing the performance of the AI towards success is secondary to optimizing the AI towards the enjoyment of the player. The first is a research problem; the latter is a game design problem. There must be agreement on this point first, or the discussion about what “should” or “shouldn’t “ be done with the AI goes nowhere. Of course, there is no reason why optimizing towards one can’t get us towards the other, which is what some of this thread is based on — or was. After all, this topic exists and is discussed, implicitly, because some people do NOT enjoy the way the AI currently functions.

Some of the side discussions are also really just other thoughts or frustrations with the game design. Arguing that an optimized AI shouldn’t be done because it wouldn’t play in certain ways or use certain mechanics, or arguing that it should because it would allow the devs to balance the game better, is really a proxy for how we feel about the existence of underpowered/sub-optimal mechanics in the game, and the state of game balance. Since it was established fairly early on that deep learning isn’t really viable for playing Civ, most of the thread is really just people sharing their frustrations and thoughts regarding the game in general (including many frustrations with the AI itself), except the whole thread is painted with an AI/ML theme, and here and there someone with ML/AI experience chimes in on a technical point. At least some people have managed to bring up some points about what exactly it is they find frustrating about the AI and/or how to improve on some of the issues that have been mentioned.
 
Yes, sorry about that, I should have realized immediately that I was caught in an infinite loop and switched to PM.
 
I also must add that everything I said, does not imply a good AI is not desirable or doable for Civ 6, or that the lack of challenge is not the problem. I think it is.

Also it is also untrue that there is no room for ML, or optimization algorithms in a game like Civ.

My point was, or should have been, that these techniques are not a magical solution. Trained machine learning models, can handle some aspects of the game. But even in that case you need to insert high level human like behaviour.

Also, probably here I was the most unfair, I misrepresented the fact that despite their flaws, the Total War saga, should be an example of how a company can care for AI. They have been doing an insane ammount on work on that, and they have pushed continuouslly the state of the art while caring for modders and players. I really cannot praise enough the work these guys have done.

I will use the example of Shogun, (from 20 years ago) to give these guys back the credit they deserve. In Shogun they had layers of AI. The resource management used genetic algorithms and more conventional techniques, so every faction could adapt distinctly. In the combat layer every unit was handled with a set of Neural Networks, each one would solve a specific task such as position, path estimation and others, and the general battle strategy used a logic system to calculate strategies and give orders to groups of units. In this logic they coded more than 200 rules from "The Art of War" of Sun Tzu, the war tactics book that was studied by the great generals of the time. How cool is that?

This was the first game on the franchise, and they have done an inmense work along the years to improve and rewrite their AI to be able to handle each new game in more realistic ways, Implementing more complex and flexible goal oriented strategies and building each game AI expanding on their previous one. And still, Firaxis, and most game companies, are light years away to what these guys did 20 years ago. (Though different games require different AIs, and Total War is likely the most complex problem an AI has ever faced in a game)

To tie back this with the previous points, note that these AIs are not global optimization tools. They tried to optimize small tasks while giving the system tools for pursuing long and short term goals, predict outcomes and resolve conflicts. But still governing the system with the simulated human behaviour and goals their wanted the AI to use.

In Summary. The AI problems with Total War, were often a consequence of being in the edge of technology and academic research. The problems with Civ 6, are the opposite: Lack of experience, lack of care, lack of resources.

We have been jumping all over the place, about technical stuff, missing completely the point. AI designers know what they do. Lacking AIs are most of the time the result of how the game is planned and managed by the people in charge. The solution is not a new technique, is a developer and a publisher that cares. Is about putting the money in the right places.

However, I think there is room for optimism.

I don't think the AI in civ is so bad. As Civ does not really require the complexity Total War does. I suggested in several posts how and where I think it should be improved. And I'm optimistic in the way Firaxis is showing they care for user concerns.

To conclude, I want to say that humans are very bad when analyzing the competency of an AI, (or anything). As for example, as Halo designers found some time ago, increasing the hit points of an enemy usually correlates with the player perception of their intelligence. (For fun, one of the things that correlates with our perception of the intelligence in other humans, is how attractive we think they are, and this correlates more with our perception than their actual intelligence).

We are very strongly biased to do flawed analysis that are based in biased perceptions of reality. And the way our brain works, and reliably makes mistakes is part of the reasons why is so hard to roleplay as a human for a machine. (And also one major reason for all the bad things humans do to each other).

To me the people that vehemently waves their hands and says that the current CiV AI is so incompetent that they cannot lose on Deity, or that this is the only problem the game has, may as well live in a different universe.

And this reasoning may also be caused for a problem in my perception.
 
Last edited:
Hello, everyone. You guys may not realize this, but you have created one of the most thought-provoking discussions about game design and the role of AI on the internet. I'd like to start by (1) apologizing for resurrecting an old thread, and (2) thanking each of the previous posters for their contribution. This has been quite a fascinating afternoon read and I greatly appreciate that.

My perspective is that of a lifelong competitive gamer, but a newcomer to the Civilization franchise. After playing Civ 6 for a week or so, I came to one major realization, and one major question. First, this game is incredible. I don't have the nostalgia of older iterations of the franchise to compare it to, because I've never played them. Perhaps that is a good thing, because I can appreciate Civ 6 for what it is, and not hate it for what it isn't. Again, I immediately realized I was playing an amazing game. My question, though, is why is the game so easy?

Before you judge me as another arrogant tryhard, I beg the casual players of this game to be honest with themselves. Deity is a joke. I am confident that even the most casual RP's out there could destroy Deity if they really wanted to, with a little attention to detail. This is precisely why the popular Civ YouTubers have to dream up crazy challenges like not founding a city until turn 20, just to make it competitive. And remember, from the perspective of a "hardcore" gamer, competitive equals fun. I don't know about you guys, but there is no greater dopamine release than BARELY winning a challenging game (any game) because you made all the right decisions, even though the margin for error was razor thin.

As soon as I played my first few rounds, it occured to me that, given adequate time and resources, Civ 6 would be extremely fertile territory for a company like OpenAI to explore. And a quick google search along those lines led me to this discussion.

I think this conversation really did a great job of underscoring the fundamental differences in mentality between competitive gamers and casual gamers. If I may, I'd like to spend the 2nd half of this post attempting the unlikely feat of finding some true common ground between us.

First and foremost, a lot of competitive gamers such as myself make the grave mistake of assuming we hold a majority/superiority in the gaming community. Mostly because we tend to only associate with one another. But most gamers are casual, period. And therefore most games will be targeted at that demographic, because game designers have to make a living at the end of the day. I spent a great deal of my youth hating developers for "selling out". However, as is the case with most things in life, anger only amplifies the problem.

One RP pointed out that a maximally efficient AI would be immersion breaking. That is quite true. Do you know what else is immersion breaking? Watching a Deity army march right past one of your fortified cities, eating tons of ranged shots along the way, just to get to another one of your cities that has been chosen as the "target" of the siege. There is no dopamine to be had from defeating that army. That would be like a professional tennis player rejoicing after beating an amateur. The professional, like the amateur, both compete for FUN, but the professional defines FUN as being pushed to his or her limit, and coming out victorious. After all, the point of 99% of all games is to win. That is why we keep score. And losing is not fun. But neither is winning against an inferior opponent. I cannot tell you how many times the Deity AI has had me on the brink of extinction in the early game, only to completely fall apart and do silly things like move 1 tile away without attacking my wounded unit. My casual friends, this is simply not fun.

It is also quite true that the act of winning against Deity is almost immersion breaking by its very nature. Deity is defeated by constantly exploiting the many flaws of the AI's behavior. The AI will pay you gold to join an ongoing war that YOU propose, they will pay you far more than what luxuries are worth, and they will pay ridiculous amounts of gold per turn (except Gorgo) just to end a war if you kill a few of their important units. The list goes on.

You might ask, why not just play multiplayer? I'm going to give an answer because I think it's a fair question. First of all, the gap between Deity AI and an average human in MP is astronomical. A "smarter" AI would provide a much smoother transition into such a daunting realm. And second, I am getting older, and I simply don't have the time and energy to grind it out in the online arena anymore. I learned how to play chess by playing against chess programs. It was great because I could play any time I wanted. The computer was like a coach, conforming to my schedule. This is exactly what competitive gamers are asking for in Civ.

I guess what I'm trying to say is... we both want the same thing, FUN, it's just that we have different definitions of what a FUN experience feels like. So what's the solution?

Well, I would argue that we are actually creating a problem that doesn't even exist by framing the debate in such a way. Remember, the OP of this thread never said anything replacing the existing AI. This was supposed to be a thought experiment. And to me there is absolutely no question that competitive gamers would benefit from better AI. To answer OP's question directly: yes, I see no reason why machine learning cannot assist in that endeavor. More importantly, it can do so without impacting the game in a negative way for casual gamers. Without casual gamers, there are no games, so every competitive gamer reading this should swallow their pride and realize that we need to have a vested interest in keeping them happy.

BUT that doesn't mean we tryhards don't have a right to seek out new and creative ways to stimulate our competitive nature. Thanks again for a great conversation.

(edited to remove some grammatical errors)
 
I used to think a much better AI should have been a priority for Civ6. Now, I think differently. I think the AI is alright as it is right now. This is for two main reasons:

The first is that if I want a cutt-throat AI that will do absolutely everything it can do to win, it's already available to me. They're called humans that have practiced playing the game and are good at it. Personally, I don't enjoy playing the game this way most of the time. It's too much micro-management, nothing makes sense from a historical POV, and I'm basically constantly at war. On the other hand, "diplomacy" is a lot more open-ended and interesting whenever it does happen (which isn't often).

The second is that the AI we have now (or augmented with the Real Strategy or AI+ mods) is good enough for players that are looking for opponents that mostly behave as you might expect them to in a civilization simulator. They attack you early on if you're weak. The war-like historical leaders do their wars like you'd expect them to. This is on top of a much "chiller" gaming experience. You usually don't have to min-max everything unless you're on diety. War is usually not a surprise because you're either very weak, denounced, or you have a leader that you'd expect to surprise attack you.

Basically, there are already ways to get the gaming experience you want. Spending lots of time developing an AI for a game that came out 3? years ago when you can just toy-around with the current AI or go hardcore and play against real people seems like it's a waste of an opportunity.
 
The second is that the AI we have now (or augmented with the Real Strategy or AI+ mods) is good enough for players that are looking for opponents that mostly behave as you might expect them to in a civilization simulator. They attack you early on if you're weak. The war-like historical leaders do their wars like you'd expect them to. This is on top of a much "chiller" gaming experience. You usually don't have to min-max everything unless you're on diety. War is usually not a surprise because you're either very weak, denounced, or you have a leader that you'd expect to surprise attack you.
Well, not good enough as I'd like it to play, but for that part IMO it's more a global game design issue (and more specifically a diplomacy and trade design issue), and so more of a "behavior" issue than a pure AI issue (as in difficulty level, or lack of).

For "real" AI issues for example, (that example being solved step by step with patches), even as a civilization "role-player", the AI not being able to properly use (or upgrade) some type of units to oppose yours should have been a priority, and the AI that wasn't even able to attack a city after massing some units around it was a very sad spectacle.
 
  • Like
Reactions: cvb
It is also quite true that the act of winning against Deity is almost immersion breaking by its very nature. Deity is defeated by constantly exploiting the many flaws of the AI's behavior. The AI will pay you gold to join an ongoing war that YOU propose, they will pay you far more than what luxuries are worth, and they will pay ridiculous amounts of gold per turn (except Gorgo) just to end a war if you kill a few of their important units. The list goes on.

I think what you describing is one of the difficulty of how AI should act for different 'difficulty' game settings. The AI acting in the way you describe is appropriate for low levels of difficulties - I would even say that the the AI is well programmed in those settings.
 
It's a necro, but I couldn't find a more recent, popular ML AI thread.

oSiezya is completely right here. You may think you want an ML AI in civ VI, but you don't. You really, really don't. It's going to go for the same optimal strategy every single game, and if you use the same strategies the "success" stories all use and try to do reinforcement learning on self trained data, it's just going to swordsman rush you every game. That's not a local minimum that the technique can get itself out of. Alphastar and whatever openAI calls their dota model does the same thing and is only so successful because they have inhuman mechanics in games that require significantly more mechanical skill than strategy. Even then they're not actually that good. Pro players still pretty thoroughly roll them once they get used to how the AI plays because it's very not human.

Now, could you build one to figure out how to play better? Perhaps, but again, it's not obvious how you'd do it because reinforcement learning will just swordsman rush which isn't actually the optimal strategy for the game (probably). This is because the AI isn't smart and doesn't use heuristics the way a human does, so it only survives swordsmen rushes when it also tries to swordsmen rush which results in it finding the optimal swordsman rush because it has no semblance of what the goal of the early game should be in higher win rate, later game strategies. Such an AI would purely be a multiplayer training thing and not something you could use as the actual AI though because it will do the same strategy every time and that strategy will almost assuredly be some flavor of cheese.

Using it to improve how AI wages war is an interesting idea, but honestly, the AI just needs better pathfinding for that. Give it better path finding so it can actually be taught to rotate units and you're golden. The AI in Civ VI is really, really bad, but the general approach is also clearly correct. It's just very poorly executed. Civ IV had a very competent AI that used the exact same strategy. It just had a much bigger budget devoted to it and had more sensible diplomacy.

To the MeInTeam in particular, I think you are grossly overestimating how robust such an AI would be. It's not at all clear that whatever strategy it chooses will hold up to just adding handicaps/giving the player bonuses for the same reason it will just swordsman rush. Unless the game is way, way, way more balanced than I think it is, it's going to just do a degenerate strategy that may or may not work when you give the player +50% production and research because it's a degenerate strategy and not all around solid empire building. Kind of like how in Civ IV a warrior rush is busted at noble and is a complete and utter throw with non quechuas on deity. Beyond the fun argument (which is way more valid than you're admitting, and AI that tries to literally kill you from turn 1 would make the vast majority of the player base quit because they don't want to roleplay the Byzantine empire vs Attila every game), this is why the AI is a bunch of decision trees. Decision trees let it play relatively solid in all facets of the game which handles handicaps and bonuses gracefully because it's just trying to play solidly and not trying to press temporary advantages as hard as it can. The latter is clearly the more optimal strategy, but it's also way more fragile.

And this is coming from another spike. Probably not as good as you, but my idea of fun is also using the best strategies to win the most games I can while playing the best I can.
 
Back
Top Bottom