Easy to make an AI that can beat a typical player?

In the ToA info guide (https://forums.galciv2.com/310173) Draginol writes:
It’s easy to make computer AI that can beat the typical player. What is harder is making a computer AI that plays the game like another person would, and makes it enjoyable for the human.
End of quote


I have heard similar claims from other makers of strategy games, i.e. that it would be quite easy to create an AI that would beat a typical player but this would not be that enjoyable. This makes me wonder: what kind of advantage would the AI have and why it would not be enjoyable? Just curious. What do you think?
33,711 views 32 replies
Reply #1 Top
What they meant was that on higher difficulties on some popular games, they gave the AIs advantages like building units faster and more cheaply than the player. This allows the AI to rush hordes of units at the player over and over until the player beats the game or quits in disgust when unable to fight back.
Reply #2 Top
How would it be enjoyable?

The most important distinction between playing the AI and playing an opposing human is the concept that humans are fallible. They make mistakes. Why would you want an AI programmed that makes absolutely 0 mistakes, calculates thousands of turns ahead, and is always one step ahead of you? Having one that can slip up from time to time, and allow you the opportunity to recognize and capitalize on their mistake (i.e, playing a human) would be much more fun in my opinion.

What would be the point of playing an AI that can easily overcome you, hands down, no chance of you winning ever? Yes, it would be very easy to create an AI that could defeat a human opponent. Creating one with a personality (shown through decisions i.e, fleet types, diplomacy decisions, etc) and fallability, would be much more fun. It may not pick the exact correct statistically and numerically superior choice every single time, but... what human does? It gives you a chance to recognize flaws and take advantage of situations, just like against a human player.

Anyhow, not sure what you were asking, but I hope this answers your question.
Reply #3 Top
This makes me wonder: what kind of advantage would the AI have and why it would not be enjoyable? Just curious.
End of quote


While I have never programmed an AI, it seems to me the very first advantage an AI might have would be "knowing the map." If it knew where the exploitable resources are on turn 1, it could likely beat you to (most of) them every time, other things being equal. The "not having to scout the map" cheat is effective, and not very enjoyable for the human. Or, at least not to me. :-) Its not even a very sophisticated cheat.

It seems like it would be harder to write a scouting algorithm that scouts things imperfectly than to just tell the machine where everything is and assign an "exploitation probability" to it. The first option would "make the computer behave like a player" and would be fun to play against because it is operating under the same constraints as I. (You get to see scouts moving around the map. Scouts give you information, because they tell you about the identity and tech-level of the owner. It enhances the "immersion" quality of the game.) The second is merely forgivable in the sense that I am racing against a random number generator. Less fun, but still somewhat exciting because I have to play smart if I am going to win.

In either case, I have to choose the resources worth having to support my strategy. But, it seems to me the first is more fun because it makes the rules more "believable."
Reply #4 Top
What they meant was that on higher difficulties on some popular games, they gave the AIs advantages like building units faster and more cheaply than the player. This allows the AI to rush hordes of units at the player over and over until the player beats the game or quits in disgust when unable to fight back.
End of quote


Hmmm...I am not certain that Draginol meant massive bonuses to production, economy etc. It seems out of place to say that bonuses are part of AI, i.e part of algorithm that "makes" choices for computer controlled opponents. Rather, it seems to me that Draginol meant a somehow superior but less enjoyable AI, ie. algorithm providing more efficient choices. Maybe I misunderstood Draginol.

How would it be enjoyable?The most important distinction between playing the AI and playing an opposing human is the concept that humans are fallible. They make mistakes. Why would you want an AI programmed that makes absolutely 0 mistakes, calculates thousands of turns ahead, and is always one step ahead of you? /.../ Yes, it would be very easy to create an AI that could defeat a human opponent.
End of quote


I can easily understand why it would be frustrating to play against infallible opponent. However, I am under impression that such AI is far beyond the capabilities of coders in a complex game like GalCiv. In GalCiv AIs are relatively good but still make very basic mistakes. I do not understand how it would make the game less enjoyable if they made less mistakes at higher difficulties (instead of getting bonuses)

So the question stands: what would be an example of AI that the coders are able to create that would be superior to current AI but less enjoyable?
Reply #5 Top
While I have never programmed an AI, it seems to me the very first advantage an AI might have would be "knowing the map." If it knew where the exploitable resources are on turn 1, it could likely beat you to (most of) them every time, other things being equal.
End of quote


Sure enough. I also agree at your reasoning on AI scouting being more enjoyable. However, knowing the map is essentially a huge bonus to sensors. The AI is not better, it simply has information that the human player cannot access in any way. Besides, it is interesting that you chose this example because AFAIK GalCiv AIs know exactly where the resources are but do not harvest them very aggressively, i.e. some kind of "exploitation probability" is used. Scouting is just for the show (at least as far as resources are concerned).

Reply #6 Top
If they created the AI to use an absolutely optimized version of the top players strats, they could probably come up with something unbeatable. It wouldn't be enjoyable because the AI would be using that strat every game. Not sure if that's really possible for a game as diverse as GC2, but a less complex game maybe.
Reply #7 Top
If he's saying it's easy to create an AI that would beat the typical player *without cheating*, then I call BS. Galciv2s AI (on tough, where no bonuses exist) just barely manages that for people who've played a few games, I think, and it's reputed to be one of the strongest around. If it really is that easy, then please go ahead and do it! I don't see how that would make the game less enjoyable, unless you don't offer any *easier* levels with deliberately suboptimal play. As long as such levels exist, you can just scale down the difficulty 'til you hit a level at which you can consistently compete, just as you would with a good chess program, for example.

Personally, I find having an AI that requires huge bonuses to be competitive, which in the process breaks the design of the game somewhat, to be less enjoyable than one that has to be dumbed down before I can challenge it!
Reply #8 Top
I'm also a bit iffy on whether turn based strategy games can have AI that can beat human players without bonuses. The number of degrees of freedom far outdoes chess, so the AI can't brute force and figure out the best moves. It has a limited scope, so in a way, it's more tactical and less strategic. So it might win a battle, but it would lose the war.

I think you need to define typical player, perhaps? People who care enough about this game to post in these forums are probably not typical players.

Usually, you hear about computer AI beating the typical player for games that involve reflexes and twitch gameplay. This includes RTS and FPS genres. In Warcraft 3, for example, it's impossible for a human to micromanage every single unit, but a computer can do it. In FPS games, a computer can be made to never miss. That's 2 examples of computer AI that would be less enjoyable for a human to face.
Reply #9 Top
why it would not be enjoyable?
End of quote


I think others have touched-on the degree of complexity involved in a game like GC2, and how it is quite difficult to make an AI to play it. This is not a case where brute-force "calculating moves ahead" gains you anything.

What makes playing a game like this "enjoyable" (for me anyway) is the idea that I have chosen a goal (a victory condition) and I make strategic and tactical choices to move toward that goal. To the degree that the computer players appear to make the same sorts of choices (and tradeoffs) makes the game fun. In a game like this where there is no human-on-human play, it becomes even more important for there to be a computer player that appears to play by the same rules that we do. If the computer is allowed to cheat, then it cannot be too obvious or our innate sense of fairness is violated and the game suffers. As we get better at the game, we start to notice that the AI doesn't fight very well, or doesn't defend against a specific strategy, or doesn't adapt very well to a specific map. Then, we start to handicap the computer player by giving it more to work with.

This is no different than veteran golf players giving their less skillful friends a few strokes to "make the game interesting." The statement that it is easy to beat Tiger Woods as long as my handicap is high enough is a close analogy to the quote in the original post.

Personally, I play GC2 to relax. I like to build a fleet that is a technological terror and rampage around the galaxy. That is fun for me. By the same token, I don't want the computer to be a total pushover either. So, I usually play at "Tough." On "Suicidal," it is highly unlikely that I would hold a tech advantage for much of the game, so that level would not be very fun for me even if I knew how to win under those conditions. Some people really get off on the "David vs. Goliath" thing. I admire that. But, that's not why I play. So, I don't play that way. YMMV.
Reply #10 Top
Personally, I play GC2 to relax. I like to build a fleet that is a technological terror and rampage around the galaxy. That is fun for me. By the same token, I don't want the computer to be a total pushover either. So, I usually play at "Tough." On "Suicidal," it is highly unlikely that I would hold a tech advantage for much of the game, so that level would not be very fun for me even if I knew how to win under those conditions. Some people really get off on the "David vs. Goliath" thing. I admire that. But, that's not why I play. So, I don't play that way. YMMV.
End of quote


Suicidal isn't quite as hard as you think. You just can't approach it the same way you would play a Tough. You have to accept that you will always be behind and learn how to take advantage of 'flaws' in the AI to overcome the huge AI advantage. You mentioned tech advantage. Seriously, the only time I'm ever winning the tech race is at the end of the game when I basically stole all the tech from the AI through invasion or bullying.

For example, the simplest flaw to abuse is the fact that the AI takes a very generalist approach to teching. So you can tech directly to planetary invasion and attack the AI before it even has a single defensive ship. Once you kill one or two AI, the rest is easier to manage.

This is an example of how humans can lose a battle, but win the war through better strategy. But there is no reason why the developers can't program the AI to figure out how to minimize this weakness.

In fact, this is what the developers did to make the suicidal AI tougher. They asked the top players how they beat suicidal, and the developers improved/buffed the AI based on the feedback.
Reply #11 Top
Interesting read. To summarize, most seem to think that the statement of Draginol either refers to an AI that cheats or Draginol just got carried away and claimed something that is not quite true.
Reply #12 Top
In fact, this is what the developers did to make the suicidal AI tougher. They asked the top players how they beat suicidal, and the developers improved/buffed the AI based on the feedback.
End of quote


Yeah... I've read some "Suicidal" AARs and they seem to involve early Planetary Invasion as a common tactic. Hm. I wonder if the AI puts lots of its bonus points into Soldiering now to fend off the early rush... well... I won't know for a while. :-)

Just got finished mopping-up two minor races on a "Tough" Immense map in TA. Stars set to Rare. They actually went after my transport ships by launching small fleets. They should have launched everything, though, but they didn't. So, I still won. Now, I have two sweet class-15 planets in a single system with those *nice* civilization capitals. Little over two years in, and I've only made contact with one other civ. I've been thinking that "Suicidal" might be manageable on a map like this, where you pretty much have to blitz your nearest neighbors immediately. Just gotta hope you don't draw the Korath or Drengin.
Reply #13 Top
Interesting read. To summarize, most seem to think that the statement of Draginol either refers to an AI that cheats or Draginol just got carried away and claimed something that is not quite true.
End of quote


I doubt anyone thinks he lied or anything like that. I think there is a misunderstanding around the phrase 'typical player'. I don't have a problem with him saying that the AI can beat a typical player.

As for suicidals, I haven't played TA enough at all to say how much the AI improved. Perhaps everything I'm saying doesn't hold true anymore, heh.

For me, I have found that map settings make a real difference in whether or not I can win at suicidal. If the AI is too far away, you might not have time to reach them before they have a defensive fleet. But on bigger maps, most people usually play with more planets. The AI will take a long tangent and research extreme colonization techs, which take time. So while the AI is researching and still colony rushing, you have time to build transports.
Reply #14 Top
I am not complaining or accusing anyone of lying. This does not interest me at all. What interests me is the nature of this "more efficient but less enjoyable AI". How it is more efficient? Why it is not considered enjoyable?

Reply #15 Top
Well let's face it if the programmers made ALL the AI's grunt rush the human player turn 1 the human player wouldn't be around very long. They would all play by the same rules and not get any bonuses they would just either all ALLY or just all attack the human player from turn 1 and never sue for peace or grant the human player peace.

I played a LOT of Age of Empires to see this happen to me more than once when I'd have 3 AI opponents on the map. They'd all come after me an early and I'd get wiped out though I could hold 1 or 2 of them it was just impossible to hold all 3 when they are set to aggressive. Same with Civilization. Everyone can exploit the ole tiny map and one AI civilization on Diety difficulty and grunt rush it and beat it, BUT, can you beat 14 AI nations on Diety? huh? Can yah? No, didn't think so. haha

Humans can and do "cheat" and use "exploits" to defeat the AI's even on the highest difficulties this is the problem in most all games the AI never exploits the cheats or things the human player does. The human players looks for holes in the program and uses them instead of playing fairly and not using things the AI would never use. What developers are saying though is they CAN program these AI's to use those exploits and cheats just like the human player and defeat them, but, then you would hear much crying and gnawing and gnashing of teeth if the AI did what a human does to it. :) You already hear it from other gamers that "The AI CHEATS" lol it's ok if the human cheats and uses gamey tactics but oh noooooo not the AI that's just so unfair. lol
Reply #16 Top
I can imagine a number of edges the AI has over us poor carbons.
*"Infinite" patience, the ability to micromanage each and every colony adjust every slider, re-evaluate the strategy every turn.
*Cold calculations. It doesn't bare a grudge, if it is favourable for peace, it will make peace, if it is favourable for war, it will make war, it'll play the odd's better than all but the most experienced (or most intuitive) players.
*No distractions. It won't go have a comfort break, (wash it's hands), get a drink, come back and forget where it was, and what it's grand plan was.

Face it, we're all toast! ;)
Reply #17 Top
I wonder how players would react if the AI could use Ctrl-N too...

I guess one of the reason why I can defeat the AI in most games (at Tough) is mainly because I restart when I get a crappy start, while the AI cannot do that.
Reply #18 Top
The human players looks for holes in the program and uses them instead of playing fairly and not using things the AI would never use. What developers are saying though is they CAN program these AI's to use those exploits and cheats just like the human player and defeat them, but, then you would hear much crying and gnawing and gnashing of teeth if the AI did what a human does to it.
End of quote


I do *partly* agree with you, but most of the "exploits" in Galciv2 involve taking advantage of holes in the AI, not abusing poorly designed game mechanics. The AI can't replicate those exploits because the human player won't make the same "silly" mistakes that allow them to work.
Reply #19 Top
The human players looks for holes in the program and uses them instead of playing fairly and not using things the AI would never use. What developers are saying though is they CAN program these AI's to use those exploits and cheats just like the human player and defeat them, but, then you would hear much crying and gnawing and gnashing of teeth if the AI did what a human does to it.I do *partly* agree with you, but most of the "exploits" in Galciv2 involve taking advantage of holes in the AI, not abusing poorly designed game mechanics. The AI can't replicate those exploits because the human player won't make the same "silly" mistakes that allow them to work.
End of quote


I'll give you a prime example of at least one exploit in the game mechanics in GalCiv2 and I mentioned it several times to the frog and he never fixed it. There is a tab called MISL in the reports screen that tells you what EACH race is TECHING up in and how many weeks to completion. Each turn you can watch this and on the final turn (1 week before completion) you can sell that tech to the AI for exhorbatant amounts of cash. Every race every time. You can wheel and deal and buy some techs from one race and then sell them to every other race when they reach that magical 1 week or 2 weeks from completion.

Another one is you can buy getting the AI's to goto war with one another soooooo easily. All they have to be is non friendly to one another and the cost is so small you can buy the whole map to war with itself and hardly have to fight anyone or only enter the wars when one race is whittled down to practically nothing.

The other is of course the tech trading itself. The AI is just too easy to fork over all of its techs except extreme military ones for little to nothing and with the first exploit the money you get from all the other races selling off just one tech will easily buy you any single tech from another race. I've seen baseball sim programs with better trading AI than in this game. This game they will trade you their star (haha pun intended) player for peanuts.

All anyone has to do to beat this game on practically any level is just tech up in DIPLOMACY. Diplomacy advantages are waaaayyyy overpowered and make it sooooo easy for the human player to get a huge jump in it.

The other thing is getting the ion drive I believe it is when you first start out and BUY your first THREE colony ships and you'll have four colonized planets before anyone else easily. Then powerup your economic thread and communications/diplomacy track and you're on your way to yet another easy victory in the land of OZ. ;)

Reply #20 Top
The big disadvantage the GC2 AI's have, and most other 4X AI's have as well, is diplomatic stupidity. No GC2 AI should *EVER* sign an alliance with you, no matter how much they like you, if all other races are allied to you. Not, at least, if they're programmed to try to beat you.

This ignores the difference between playing to win (which people want to see) and playing to beat the player (which is no fun at all). People don't want to see the Drengin Empire kamikaze against them every time to prevent them from developing adequately so the Altarians can get a big tech lead and win the game. People want to see the Drengin Empire working for the benefit of the Drengin Empire, not working for the downfall of the Drath Legion (or whoever the player happens to be). Programming the AI to make the player lose will almost always beat most players, but it's not any fun to play against. Instead, programmers develop an AI that is able to make at least a somewhat convincing pretense of playing to win, rather than playing to make the player lose.

You also overestimate the quality of the typical player. Most likely, the bulk of people who bought GalCiv2 have since moved on. They got it, played it a bunch, then went on to play something else. The highly skilled and dedicated metaverse players are not typical, unless GC2 is even more of an exception to the common rules of the gamer market segment than I'd imagined. Most people, at a guess, cap out somewhere between the difficulty level where the AI stops getting economy penalties and the difficulty level where the AI is able to use all of its prediction algorithms (don't have my manual handy to look these levels up, even assuming the data in the manual is still accurate on this issue). The typical player would probably have an anyeurism and die if faced with the challenge of the Suicidal level AI.
Reply #21 Top
Hi!
what kind of advantage would the AI have
End of quote

500%+ bonus to everything, or purely free stuff.

and why it would not be enjoyable?
End of quote

Let me describe you my experience. Long ago I've been playing Civ-2, where I've been struggling to build an important wonder, but Vikings beated me to that in just 6 or so turns. I reloaded, tried building faster, using Caravans from other cities..., all to no avail. Then I turned on cheating mode just to observe Vikings building a Wonder. In a city with 3 (three) free shields they had built about 50 shields of wonder each turn. I was so upset that I deleted the game from the disk and never returned to it.

BR, Iztok
Reply #22 Top
It is even easier to make an AI that simply makes the player quit in frustration!
Reply #23 Top
It is even easier to make an AI that simply makes the player quit in frustration!
End of quote


Well, that's pretty much happens when you get a game where the AI is programmed solely to beat the player. Programming the AI to beat the player breaks diplomacy, and breaks any "peaceful" victory condition like diplomacy in GC2, or getting elected in Master of Orion. The devs have to program the AI to try to win - to work for its own selfish goals, rather than collaborating to make the player lose - or the player will quit in frustration most of the time. They also have to insert AI holes that will cause the AI to collaborate in its own defeat if they want to see a diplomatic victory condition of any sort. Making an AI that follows these rules, and still poses any kind of a challenge to a human player who has come to a reasonable understanding of how the game works, is an enormous challenge for a game programmer - hats off to the guys at Stardock for managing it.
Reply #24 Top
I've dabbled with AIs a bit and I found out two things:

1. It's relatively easy to make an AI that can beat the player in many games that are far more complicated than chess.

2. It's hard as hell to make an AI that can beat the player in those same games with only the information the player has.

If the GalCiv2 AI knew exactly where you were, where every resource and anomaly in the game sat, could watch which direction you were teching and what sort of ships you had, and then used all of that? Humans are meat for the grinder. Are you going quick invasion? Fine, the AI goes heavy in the ships, slaps down your invasion fleet and then blockades you into your handful of planets. Human is settling down for the long game? Invade NOW with whatever you've got! And so on and so forth.
Reply #25 Top
So let’s take a look at this. In playing GalCiv2 (ToA) there is a lot of information that I, as a player, can glean from the board. I can see what each and every planetary structure on every visible planet is. I can see what the relative moral of that planet is, and its population. I can see what star ships are there, and what capabilities each one has. I can see what technologies have been researched in the trade screen, and get a fair guess at what technology paths are being taken. I can even see what trade routes exist and from what planets, and from there make a fairly accurate prediction on the income. I can see each planet’s population and, over time, deduce the growth rate. I can see where fleets are massing and what alliances exist and even what wars are brewing. In short, there is very little that I can’t tell about an empire, given the time.

Now the computer AI can do all of that, every single turn! And the computer AI can probably calculate much more accurately than I, or most (and here is a conceit) average players, as it knows, down to significant decimal places, what each factor affects what other factors. I can (probably) replicate this if I really wanted each game to run about 1 turn hour or more. The computer does it in milliseconds, and does it every single turn. Any change in strategy on my part, the computer can assess the impact of, and calculate the logical response too, Every Turn. As soon as my ships start showing lasers, they can start researching (or trading for) shields. As soon as I produce one transport the computer can know to research (or trade for) soldiering upgrades. And the list goes on.

And what is more, nothing is ever wasted. Never a turn goes by where a star port is full. Never a turn goes by where moral drops below 30%. Never does an influence star base go unnoticed or forgotten. Again, all of these things an average or good player can do as well. But the computer does it perfectly every time. This isn’t chess boys and girls. There are more than 32 pieces on the board, and about a billion more factors and strategies that can be deployed. And here is the thing. Above and beyond all of that, there are no real random factors. So, even a pretty basic computer would be able to easily out think even most advanced players.

In the media, we see movies like the Matrix and Terminator where humans are portrayed as this indomitable species that, due to illogic and insightful leaps, smash the computer tyrants who are plodding and linear thinking. This is not the case in real life. The main strength of a computer and the reason they are in such high use and demand today is that it can assess a wide array of variables much more quickly and more efficiently, and most importantly, more consistently than any human can. Kasparov may have beaten Deep Blue back in the 80s, but that was at a pretty basic game with only a couple of 100 or so variables. Gal Civ has hundreds of thousands.

So even without any “Cheat” advantages, creating an AI program that could utterly crush the “Average” player 99 times out of 100, would be child’s play for the good folks at Stardock. The real trick, as was expressed, was making an AI that doesn’t crush every player, every time. Creating one that plays and is challenging to the average player but isn’t too stupid on the one hand, or too hard on the other is a lot tougher.