AI Advantages

^ Yeah I agree, except that I think a "perfect" Civ AI would be much harder to do than in chess; after all there's a relatively limited amount of moves you can make in chess, whereas the possibilities in Civ are much more diverse. A bag of tricks can always be outplayed and I don't think a truly smart AI can be made. Maybe with machine learning and tons (and I do mean TONS, tens of thousands maybe) of sample games. But even given the data and computation power it wouldn't be easy to do.

I don't understand when people bash the AI so much, especially the higher level players. I mean, what do you expect? Even if the programmers could have done a perfect AI (from their POV), the best players here would still tear that apart, simply because the programmers aren't as good as players.
 
Yeah, I didn't mention those. :blush:

But bottom line, on Noble, the player has no advantages over the AI but the AI as well has no advantage, correct? The human player and AIs are equal.

Nope. The AI has an advantage on noble: unit upgrade costs.

And does the AI also play smarter on higher difficulties?

No, but because the bonuses open situations that are not seen at lower difficulties, occasionally it will do things that surprise you because the bonuses allow it to meet certain conditions, such as a 1500 BC deity DoW. The AI won't do that on noble even though the code is the same, because it won't have the necessary unit types, massing, and war roles in time.

I mean, the best way would be to not have any advantages in any difficulty, just making it play smarter. Like in a chess game. WHen you raise the difficulty on a chess game, the cpu doesn't get any "bonus", it just plays better.

Writing an AI like this is incredibly difficult, and I say this w/o even being a programmer. I have made XML tweaks on the AI that make it a lot harder to deal with, albeit a little unfair (hiked unitprob, far less diplo limiters on trade or its willing-ness to declare war, and far more prep before it's willing to declare).

Within constraints, I'm very good at setting up screw-jobs for human players in the AI, I also made a custom script in warcraft III that hit people hard with defended footmen. If I abused the insane resource bonuses and made it go triple rax almost nobody on bnet could beat it unless they found it early and harassed well, and even then that needed them to be orc generally.

But making an AI with no holes for humans to exploit is borderline impossible. You're pitting one or several people with incomplete information against masses of gamers that adapt dynamically. It's a ridiculous recipe. A very good gamer who also programs well might be able to make a decision tree for the AI so that it micros very well and generally plays solidly, but in order for it to be hard for the human to counter, it would also have to pick between meaningful alternatives arbitrarily, such that the human couldn't rely on behavior patterns even if he learned the AI's decision trees (or couldn't easily identify which patterns the AI is using).

But making such a tree without experience playing the game and seeing how everyone else handles situations isn't feasible. It makes plenty of sense that the BTS AI was far better - it was adapted based on play of humans. The betterAI project continues the work to this day, and AFAIK it's gotten better, but you're not going to get an AI that's 100% free of abuse without monumental time and skill investments. It is much easier for programmers to hand them some bonuses if the goal is to add challenge. Good games find a balance between a great AI and the bonuses that is reasonable, or just trivialize single player and design around multiplayer (not a good model for civ, but worked great in starcraft where the AI was woeful but MP very strong).
 
Well , it is far easier to say where the others fail than do ourselves the right thing ;)

The main diference is between the way that good players think and the way that the AI in Civ IV is coded, as Dirk said. The AI in this game is, to put it bluntly, a collection of recipes with a dice choosing between them. A person that spends some hundrends of hours in this game will easily recognize the patterns of those recipes and will act accordingly even without code knowledge, a thing that a the AI has no chance on doing. And obviously the roleplay part of the AI probably doesn't help them in terms of performance most of the times ( otherwise even Noble would be extremely chalenging... )
 
I think the Civ AI could only ever be a bag of tricks. Chess is quite simple from a "programming AI" perspective - there are only a maximum of 16 pieces, each turn involves only one move of one piece, there are only 6 types of pieces, and the result is that programmes simply crunch vast numbers of "trial and error"-type algorithms as the basis of their work. This is why it took supercomputers to defeat Kasparov - brutal crunching of billions of possible moves in real time to find the best one. Even then it's a subtle art as well - you still have to write code to determine what is a good move and what is a bad move!

Doing the same for Civ wouldn't work - hundreds of units, thousands of movement options, and all interconnected? Unthinkably many alternative turns to consider. So the Civ AI has to rely on simple rules to guide it... unfortunately as already noted here - these rules are simple by necessity, and so even though they might work in principle, they can be out-thought by the next level of consideration. So building a stack is better than having a load of individual units. But just building a stack makes your whole army vulnerable to siege. So then you need secondary code to protect against that risk... but already it's becoming complicated. In general, the only thing computers can do better than us is do a lot of calculations in a short time. They can't decide what are the smart calculations to do before they've done them :)

What would be interesting is if the AI could "learn" the way the human player plays (e.g. by saving details of attacks the player makes, or techs he beelines, or the make-up of his armies) and use this accumulated knowledge for the next game... I'm surprised this doesn't already happen - this way the AI would develop along with the player and the player would be required to modify his tactics as time goes by.
 
What would be interesting is if the AI could "learn" the way the human player plays (e.g. by saving details of attacks the player makes, or techs he beelines, or the make-up of his armies) and use this accumulated knowledge for the next game... I'm surprised this doesn't already happen - this way the AI would develop along with the player and the player would be required to modify his tactics as time goes by.

Well you bypass the obvious problem - who can say when the human sucks and when not? I'd guess maybe half of the people playing this game play "better" than the AI (the people on these forums - obviously a larger portion) - would this very complicated learning algorithm only benefit those? Wouldn't be much good if the computer tries hard to learn how to play badly.
 
It doesn't have to be a complicated learning algorithm, just simple rules. Things like: "Player attacks with X% of his units in a stack" where it learns what X is through experience. The AI could use this to organise its defence, as well as to make tactical manoeuvres (suppose X = 90%, then a counter-attack into the human's territory could be very effective). Or (a non-learning example) "Player has X instances of the Horses resource" - if X=1 then it's worth making a strong effort to pillage the Horse; if X>1 then probably not worth it. The rules themselves would be hard-coded (so predetermined by the developer) but the "learning process" would involve finding the numbers to fit the rules. For the AI to learn on a more advanced level would require something like heuristic algorithms where the AI would write its own rules through trial and error. I don't know how practical that would be!
 
I don't like the AI differences in diplo. If an AI is in WHEOOHRN mode, it cannot be bribed to war - yet when I'm in a war, the AI can ask me to help them in a war and if not I get a diplo penalty. The AI never gets that diplo penalty "you refused to help us during war time" because they can red text. I wish I could red text the AI and say something like, "We just don't like you enough" or " We couldn't betray our close friends!". I get lots of penalties for not helping others during wartime particularly because I play with aggressive Ai and there are lots of wars.
 
They finally succeeded in chess, i believe the strongest chess programs are a bit better than the world champion (still not much). It has probably cost millions of thinking/programming hours. And still there occur games where the ai is outplayed in a ridiculous manner. Most chessplayers will have enjoyed the way Kasparov outclassed the comp in that game where he closed the position completely with white, the comp didn't find a reasonable plan subsequently and got smashed off the board.

The Kasparov vs Deep Blue was the turning point in the Deus ex Machina moment (men vs machine, literally translated god against the machine).

After this the computer wins on a regular basis against the best of the best chess players.
Recently Hydra (a 16 processor monster) won against Kramnik (the former world champion).
The reason this actually can happen is raw dedicated computing power and a very big opening library + research and a dedicated team.
Try to imagine playing civilization on your own computer against a computer with 16 processors on lan, with a scala of 10000 different opening possibilities that go 100 turns ahead, calculating all the possible scenario's 20-30 turns deep with absolutely no remorse.

You start with hunting against an AI who is 8 turns away from you? You loose.

Would that be fun?

Would it be fun to face an opponent who can calculate he beats you in building the great library 60 turns in advance by calculating all the possibilities and buildorders you can make?
 
The simple number of possible start scenarios in civ IV ( t0 ) far exceeds all the known openings in chess until the 18th play.... the library + crunching number aproach is simply too weak against a problem like this ( maybe it is a NP problem :D ... even if it isn't, it definitely looks like one )

P.S Now that I think on it, it is far worse than a NP, because it contains a NP inside: the trade route money calculation, that is clearly a NP problem :D
 
The Kasparov vs Deep Blue was the turning point in the Deus ex Machina moment (men vs machine, literally translated god against the machine).

After this the computer wins on a regular basis against the best of the best chess players.
Recently Hydra (a 16 processor monster) won against Kramnik (the former world champion).
The reason this actually can happen is raw dedicated computing power and a very big opening library + research and a dedicated team.
Try to imagine playing civilization on your own computer against a computer with 16 processors on lan, with a scala of 10000 different opening possibilities that go 100 turns ahead, calculating all the possible scenario's 20-30 turns deep with absolutely no remorse.
Well, to be fair, don't the chess grandmasters also have large teams helping them prepare for their games? And I'm sure they have thousands of openings and fixed plays memorized, also.
 
I wish I could red text the AI and say something like, "We just don't like you enough" or " We couldn't betray our close friends!". I get lots of penalties for not helping others during wartime particularly because I play with aggressive Ai and there are lots of wars.

You are wrong, that is a penalty to the AI, not a bonus. I mean, if you want to ask them to attack somebody and they refuse, well they would get a negative diplomacy modifier on you towards them. Always, if you were an AI. So after a few of those, you wouldnt want to trade with them anymore.

Well, you can do that if you want. But you can also suck it up, and keep trading with them. But if you were an AI you couldnt, because you would hate them for not helping you.

Sounds wierd, but I hope you understand what I mean :)
 
This is a very interestting thread and I really appreciate to read some opinions of "professionals" on the topic of AI. My only programming skills are from undergraduate courses (using JAVA...) at the university, some years ago. But I am really interested in this.

Of course the older gamers - and maybe some curious newer gamers (like me) - will remember this milestone report from Sirian on his experiences with the CIV4 AI. It is especially interesting as he was involved developing it:

http://www.warpcore.org/~sirian/civ4/epic-four/epic4-z.html

In this context, his comment on the budget and AI development in modern games is especially noteworthy.

However, I would really like to know what would be his opinion of the CIV AI today. Of course it has been improved in BTS (and is further with BBAi, for example), but I really think, the CIV AI is "as good as it can get" in computer gaming. I fully agree with the statement that on these forums, the AI has a hard time. The average Civfanatic is way beyond the average HI, I assume (at least concerning strategy games :) )

Does anybody know, if Sirian is still working with Firaxis? I really enjoyed reading his reports, especially the legendary "Island Hopping" succession game with Sulla.
 
You are wrong, that is a penalty to the AI, not a bonus. I mean, if you want to ask them to attack somebody and they refuse, well they would get a negative diplomacy modifier on you towards them. Always, if you were an AI. So after a few of those, you wouldnt want to trade with them anymore.

Well, you can do that if you want. But you can also suck it up, and keep trading with them. But if you were an AI you couldnt, because you would hate them for not helping you.

Sounds wierd, but I hope you understand what I mean :)
I understand what you mean, but I still think the AI has the advantage wrt what I was talking about. Diplo relations among AI will be better than versus the human because the AI cannot be demanded certain things by other AI.

However, you are right that the AI is forced to close trade relations with "worst enemies". The human is not. But often the human is forced to close trading relations with others simply due to requests.

For example, say I am pleased/friendly with Ragnar and Shaka. Shaka asks me to declare war on Ragnar. I can refuse and get a negative diplo penalty with Shaka or declare and get a negative diplo penalty with Ragnar. Ragnar will ask me to declare on Shaka, and the same penalties apply. Say the war is long (its on marathon) and both ask me two times to help. I want to stay out of it. I now have -2 with both Shaka and Ragnar simply for doing nothing. All the other AI who did nothing get no penalties wrt this war.

However, if I was allowed to do what the AI is allowed to do - I would just say "We couldn't betray our close friends!". Now I get no diplo penalty at all. It would make winning a diplo victory easier.
 
An issue with a CIV AI is you'd need to make it as ruthless as a human player and you might be able to argue that may make the game either not fun or unplayable.

How do most humans play?
Since the original Civ, it has been common practice that you meet a neighbor and then attack so you can peacefully expand to a point where you decide, I have enough core cities to win without further expansion or I'm going to conquer the world.

So this should be no secret, but if you built an AI this way, then every game you'd see the AI:
1) reasearch - Agr, AH, Mining, BW, Wheel
2) build 10-15 units
3) attack neighbor regardless of reputation
4) build core group of cities (8,10, 12+)
5a) meet new neighbor. How many cities does he have? How weak/strong?
5b) weak. repeat step 3.
5c) strong. look for new target or stand pat and build up.
6+) repeat step 5 until you are the only one left or until you meet 'the AI goal for optimum cities' for victory.

Think multiplayer games. That's how we play.
All AIs would probably make military techs their priority and I think the game may become one dimensional.

You'd have to throw diplomacy out the window, since most humans will exploit it. An AI that ignores it, is just annoying. It's why we always kill Shaka, Monty, etc. as soon as we see them.
They probably play most like humans and we eliminate them as soon as we can.

That being said, you could probably hard code some rules about city numbers and placement, tech paths, beaker amounts, and commerce to make it at least competitive (no cheats) but you'd have to hide the AI rules/goals from the players otherwise we'll exploit them.

For example if there was an Optimal Empire Set Up of say 3 science cities, 3 commerce, 3 production, 6 hybrids. You could code this into the AI so they have goal to work for, but we can't know it out of the gate, otherwise we'd never let an AI get to 15 cities.
 
One thing I noticed on the really easy levels is that the AI is very unaggressive. I know part of that is because they don't have as many units, but even going beyond that, it acts in a very unusual way. I recently played a game on Settler to see how quick I could lose by playing badly and ended up losing by score in 2050 because the AI would not attack me, even though I had one chariot in my only city the entire game.
 
What I don't understand is why the AI doesn't do the simple things to make it smarter:

1) Chopping trees for quick early production
2) Increased vigilance on others stacks (so that the fact that this huge stack that the player's been massing on the border does not surprise them) and also building appropriate counters
3) Recognize patterns in the human player and adjust accordingly (over series of games)
4) Adjust to map type, size, and game speed (e.g. on small or tiny map, there should be more emphasis on early rapid expansion)
5) Revolting cities prior to attacking
6) Better logic in DOW

I think that it's possible to make a smarter AI (maybe not as sophisticated as a human player), but to the point where it could calculate from the start the most effective city placement, build order, and tech paths like many people do.
 
Currently I am doing a university study of which one of the focuses is developing AI's.

One of the biggest flaws in AI design is the lack of "creativity". An AI in our current technological position can not posess any creativity or intuition what we humans have, and is limited by a set of rules, guidelines and a knowledge base.

The current key of developing a "Good" AI is predicting every possible scenario the AI will come across and write guidelines for it to react to those scenarios.

If you look at a complex game like Civ4, and the great variety the AI has in this game, you will see that the developers did a great job of predicting alot of different scenario's in this game.
Also the AI has flavour.

Though alot of people are not content with the actual capitulation, WFYABTA and vassal regulations, the amount of effort and variety the developers has put into it is staggering.

For example one of the difficulties as a coder you might face is the actual tech path of choice.
If you want to make it simple for yourself as a coder, you will insert 3-4 tech lines an AI picks randomly and then follows through with during the entire course of the game.
Make it a bit more interesting and you give certain leaders certain tech patterns dependant on their character.

If you want to make it more difficult you can throw in an algorythm that analyses the current needs of your empire and then chooses a tech accordingly.
In a way CIV already does that since the advisor "recommends" certain techs if you just finished one.
The problem with such algorythms is the vastness of variables you have to deal with, noone wants to wait ages for an AI turn either.

Another big dilemma for developing an AI is how far you can let an AI think. For example troop movements.
Do you take the fastest route, do you take the safest route, do you anticipate on future enemy troop movements, do you take a long route to a less defended but key city?

Also the biggest problem is, as a developer do you fully understand your own game, and are you aware of all the possible strategies and do you know the best choices in each given circumstance?
As long as we can not give an AI innovation, creativity and a learning process it is very hard to make a "perfect" AI, that meets up to the standards of a human being.
 
Back
Top Bottom