• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Why AI is so weak?

akots

Poet
Joined
Aug 5, 2003
Messages
3,981
Location
Moscow-Houston, Russia-USA
I have looked through all the posts and did not notice a board which would focus on analyzing the question why a tiny human brain can battle the AI very efficiently and even win on a deity level without major problems assuming minimal qualification as a Civ3 player. You know very well that taking chess for an example, recently world known chess grandmasters are desperately trying to make a draw with AI. Five or six years ago, sophisticated chess programs required to battle versus world champion had to use the multiprocessor giants. However, now, even a normal 2 GHz PC run by some Fritz software (version 8, for example) can easily defeat virtually any grandmaster apart from those who are very experienced at playing versus the PC or who are in the top ten players in the world. In general, one can argue that Civ3 is more complex than chess though apparently this is not true. I have played a lot both games and sure many other people did. Civ3 has more rules which are not that clear but certainly the game is not extremely complicated. The problem is that the AI is weak. So, I think this topic of AI weaknesses should be more interesting to Firaxis and Sid Meyer but many normal players can benefit from a number of AI weaknesses in a normal game even on lower than deity levels. I would focus primarily on several major weaknesses of the following groups:

1. Micromanagement.
2. Military.
3. Diplomacy.
4. Trade.
5. AI worker inefficiency.
6. City placement.

Point zero and major problem of the AI. The AI behaves absolutely identically on all difficulty levels. So, the AI does not improve with increased difficulty. It just grows faster and builds easier on the deity level than on chieftain, has less corruption and has great starting bonus which is by the way crucial. All other things are the same and do not improve. So, the AI uses the same criteria for making the key decisions on any difficulty level. To my mind, this is major drawback and the big reason for failure of the AI to battle efficiently on higher levels.

1. Micromanagement.

Well, there is nothing to discuss here because the AI has no micromanagement. It does not change location of working tiles. Once the tile is being worked by a city it will never be relocated to another city only in case of some disaster and only accidentally. The choice is indeed tricky. Sometimes you need growth, sometimes production, sometimes trade, sometimes just wait for a couple of turns with both. The AI knows nothing of a settler factory or optimal city placement or FP placement or wonder prebuild. One can argue this is cheating. However, AI knows very well how to attack and break RoP which should not be allowed. Well, this is real cheating.

2. Military.

In general, depending on situation and availability of certain units, AI manages war rather satisfactory. Always counterattack, protect cities well, protects resources, focuses on a weak point. However, each war has a certain goal. Once the goal is achieved, the war should end. Or if the war cannot be continued, it should also end. It looks like AI has no idea about these goals. AI prefers to attack only weak targets and lacks flexibility. Certainly, the AI does not know about leader farming or use of artillery for attacking cities. Not upgrading obsolete ancient units either even if it has Leonardo’s.

3. Diplomacy (and spies).

Just one sentence. The AI puts a way too much trust in the opponents. And virtually never uses spies efficiently. And again, never changes point of view. Military alliance strategy is also beyond any critique. It is quite possible to trade for an alliance with some remote civ against the similar remote civ a valuable technology and never see the rival within 20 or 30 turns.

4. Trade.

In general, trade is more or less OK. However, the AI puts too much value is things which are indeed not so valuable. For example, certain technologies or resources, like nationalism-steam power after discovery of economics or saltpeter in modern era which is hardly at all necessary. And trade prices very weakly correlate (if at all) with AI attitude. I mean, that if AI likes you, certain discount should be possible. And trading military units (or production or food not only gold, lux, and tech) would be very nice.

5. Workers.

AI terribly manages the workers. It moves them there and back. Never automate your worker, but this is known to everyone.

6. City placement.

Beyond any critique is the AI algorithm for city placement. May be, it benefits a little bit in the industrial era, may be, it slightly decreases corruption, though this I doubt. In general, the land is used extremely inefficiently.

In conclusion, a strong point of the AI is budgeting and happiness management. I personally always use a governor during anarchy with more that 10 cities to prevent civil disorder just to save time wondering around and micromanaging each city. Also, governor is very helpful in newly captured resisting cities. Certainly, it is possible to starve it to 1 citizen but what is the point in capturing a city if you are starving the population? Besides, it is “cruel oppression”.

This is my first post so don’t judge me too much. Hopefully it can start an interesting discussion.
 
Akots, welcome to CFC! You bring up many excellent points in your well-written article. The lack of increase in AI complexity on the rising scale of difficulty is something that has always been readily apparent to me, as well. I think it really comes down to time and money: it would cost far too much for the programmers to dramatically improve the AI for the game at large, and even moreso for each difficulty level. Therefore, in order to compensate, more advantages are given to the AI at the higher levels. Although this isn't optimal, it does prove to be effective, especially for those new to the Civ franchise. As far as the complexity of chess vs. Civ 3 goes, I have often internally debated this. My first impulse has been to say that Civ 3, due to its vastly larger playing "board," is more difficult; however, the rules of Chess negate that somewhat. I am interested in seeing others opinions on this issue, especially from some of our astrophysicists, engineers, mathematicians, and other brilliant physical scientists that are on this board. You see, although I am not mathematically/spatially impaired, my profession lies in the humanities, so I just marvel at the analytical power with which some members on this board have been endowed. Again, welcome to CFC, and I enjoyed your post! :)
 
The term AI is very misleading, as it's not an attempt at Artificial Intelligence but instead a batch of programming. I don't truly believe however that it acts the same on all levels, as the various bonuses it gets with each level affects AI decisions.

Minimal qualifications to beat Deity? There's many out there who would disagree.

An improved AI is probably everyone's biggest wish for improvement in the game, but at the same time, it can't suck that bad because there's millions of us hooked!

Welcome to CFC!
 
I think that all of this is known to Firaxis (after all, they programmed the AI).

BTW, akots, how often have you beaten Diety?
 
Originally posted by superslug
The term AI is very misleading, as it's not an attempt at Artificial Intelligence but instead a batch of programming. I don't truly believe however that it acts the same on all levels, as the various bonuses it gets with each level affects AI decisions.

Minimal qualifications to beat Deity? There's many out there who would disagree.

An improved AI is probably everyone's biggest wish for improvement in the game, but at the same time, it can't suck that bad because there's millions of us hooked!


Regarding the AI first. All AIs are simple program codes. What makes a program AI? To tell the truth, it is hard to say. I personally think that AI is some piece of software which tries to compete with human or tries to help human as much as it can in some complex decision-making project. For example, calculator beats human but cannot be considered as AI because it lacks decision making. Certainly, Civ3 engine is a good example of an AI.

Then, to millions. This is the reason for different skill levels. Out of 150 thousands who ever bought Civ3, probably all started on Chieftain. Then, most advanced to higher levels. Eventually, a statistical summary of all players, like, how many played on what level and percentage of wins and losses should be of great interest. And certainly, Civ3 is a game of chance sometimes, especially of tiny, small, and even sometimes standard maps. That is why enforcement of gotm rules is very important. As for me, I started to play by gotm rules only 3 months ago. It is necessary to learn to master the game. And best way of learning is reading the excellent articles in the Academy and reloading after some mistakes and trying different approach. However, my idea was not to discuss how to beat the AI but to understand why it is losing. For example, I played also Heroes oMM III and Heroes IV. I remember reading somewhere that the first versions of the HoMM III AI were so strong that no human player was able to beat it. That is why the AI was downgraded to that it can be battled. It might be well a similar thing for Civ3 though it seems unlikely. And by saying about this minimal qualification to beat deity I was implying the ability to learn to make the right decisions. Some deity games are exceptionally difficult to beat even after reload but not because the AI is so smart. There is a huge handicap (60% AI rate). If you make it 25% or 10% for AI rate, the game would be impossible to beat. It would be very interesting to see an AI which would be difficult to beat at 100% rate similar to multiplayer (which I never tried because I don’t have PTW). Just imagine these days playing chess with a PC which has extra rook and queen over you at the beginning and then for a single move you make the AI makes two moves. And still it is possible to win! Well, basically this means that Civ3 AI is far too weak; far beyond what you expect these days. Again what I’m asking is why it is so weak. One can argue that creating a good AI is just a matter of investing a good money in game development. May be, this is true. However, Civ3 is too similar to the actual state of the things in the world. I’m sure that many people would prefer their lives and worlds to be managed better that it is now. Thus, I’m sure that Civ3 is a pretty good model much better than Civ1 or Civ2. And managing the world is not an easy task. However, it is exceptionally interesting to understand (even on a level of a game) a universal algorithm which emerged by itself from the batch strings of the code of Civ3 AI.

And thanks for wellcome.
 
Originally posted by warpstorm
I think that all of this is known to Firaxis (after all, they programmed the AI).

BTW, akots, how often have you beaten Diety?

Regarding your comments, I have no relationship to Firaxis and co. Therefore, I did not know what they know and how they programmed the AI. What is frustrating to me with this AI issue is that it does not improve depending on the difficulty level.

And regarding the deity games, I played two dozen of them. Sometimes, it is exceptionally difficult and sometimes goes very easily. Mostly, it depends on the starting location resources and bonuses. It is pretty much hopeless to beat the AI on deity without starting near to a river with bonus grassland and cattle or wheat (settler factory) and iron and at least one luxury within a reach away from AI. If I have this, I can win always. If I don’t have, it is hopeless for me.
 
There are some points I want to throw out. First, chess has a very limited number of pieces and choices. Pawns can advance bishops can move diagonally and there is a pretty long list of openings and counter openings. Second, chess programs have been around for a while and they have had many improvements over the YEARS.

Civ3, has been around for a year? I think it has more limited resources than those that first worked on the chess algorithims but the benefit of better techonolgy. That said, If the AI got smarter as it got to higher levels, I think you would see your computer bog down or crash.

That said, I am not happy with the way civ 3 plays. If you can get 5 or so cities around your capitol on Diety before the middle ages, you can probably win. It might be expensive and you might be running modern armor around but you can probably win the space race.
 
I believe Civ3 had one programmer for AI among his other programming tasks.
 
You're right, warpstorm. I'm sure Soren had more on his "to do" list than just the AI. ;)

As for comparing Civ3 to chess ... Chess is an incredibly easy game to program. There is no terrain to worry about, the game board is a fixed size, there are only six pieces to code for (King, Queen, Bishop, Knight, Rook, Pawn), etc. And it has taken years to get a strong chess AI that will run on a common PC.

Civ3 is much more complex than chess, when considered from a programmable ruleset point of view. And the programmer only had a few months to design and code an AI that would run on *low-end* machines. If you want to invest several years of high-cost programmer time in getting a better AI, go for it! Game companies don't have that kind of money.
 
I'm tired of seeing people scoff at chess all over this board. The reason it has survived for years is because of its complexity, not in spite it. There is a huge difference between rules complexity and strategy complexity.

That being said, civ has high rules complexity. Yes, this makes it extremely difficult to program the AI to take all this into account. However, it has fairly simple strategy, which is why such an AI is even possible. Chess has simple rules complexity, which makes it easy to learn. However, it has magnitudes more strategical issues than civ. It takes a modern supercomputer thinking for hours straight to beat a grandmaster. People don't make the distinction between rules and strategy, they lump it together and say Civ has more rules so it's a more complicated game, but I beg to differ. I could talk for hours on this topic but I'll spare you and hope you've seen my view at the very least.
 
Originally posted by akots
The AI behaves absolutely identically on all difficulty levels. So, the AI does not improve with increased difficulty.
For this to be untrue, they would have to program at deity and dumb it down for lower levels. It's hard enough to make AI for chieftan. I don't want it worse than its best.
 
Actually, SolarFlare, I basically agree with you. I didn't put it very clearly in my earlier post, though. Like you said, Chess has "simple rules". That makes it relatively easy to program. The *rules* for Civ3 are more complex, making it much harder to program a good AI.

As for strategy, yes, Civ is relatively simple.
 
Originally posted by Padma
Civ3 is much more complex than chess, when considered from a programmable ruleset point of view. And the programmer only had a few months to design and code an AI that would run on *low-end* machines. If you want to invest several years of high-cost programmer time in getting a better AI, go for it! Game companies don't have that kind of money.

I would dare to disagree with you, Padma. For example, look at http://www.apolyton.net/news/index.php?Category=Misc&Offset=17 and there you may find out that Inforgames made $109.4 million in the first quarter of fiscal 2003. BTW, these are our money. I don't think any single chess-programming software company can ever hope for such kind of money. So, compains about poor resourse-lacking Firaxis do not withstand any critique. Otherwise, you are right. What makes chess programming strong, it that the people who work there are thinking and analyzing what they get as a result by testing.

In general, the Civ3 AI is not that bad. But I'm sure it can be made much stronger and it would add more interest to the game-players. Just imagine the box which says something like THE STRONGEST AI EVER BUILT BY A HUMAN. THIS SOFTWARE CAN BE USED BY THE GOVERNMENT TO MAKE THE PEOPLE HAPPY. SATISFACTION GUARANTEED.

Thanks for the comment.
 
Originally posted by akots


I would dare to disagree with you, Padma. For example, look at http://www.apolyton.net/news/index.php?Category=Misc&Offset=17 and there you may find out that Inforgames made $109.4 million in the first quarter of fiscal 2003....
But I would beg to disagree on that issue, akots. The amount is revenue , not profit. In another related article, you find that...
(30 April 2003, 21:50 | Misc) Major debt problems are still looming for [IG] as well, and the company desperately needs a break-out hit to increase investor confidence and expand its options for dealing with its debts.
And from Atari's press release at the end of the fiscal year...
The Company reported net income for the fiscal year of $18.1 million, a significant improvement over a net loss of $10.2 million reported in the comparable year-earlier period.
Income is before taxes, interest, and amortization.

Good sales revenue doesn't necessarily translate into good profits, especially with tech companies. I think saying that Atari has limited resources stands to critique.
 
Us critiqueing the AI compared to fiscal gains is rediculous. Bottom line Firaxis HAS the money to design(by scratch if nessecary) a better AI. The problem is begining game(starting location, available terrain, lux,& recourses) is more crucial then then the difficulty level. I REALLY want to see an AI that isn't dependent on production bonuses/bunus MU & settlers to win at higher levels............... although a true AI is a bit far fetched. The human mind with its abilty to decide goals, and change strategies will alway win over a computer.

And I repeat NO ONE downplay chess. That is the ALL-TIME greatest strategy game! It's simplistic nature fools alot of people, but is insanly complex when you break it down. *Keep in mind it was invented hundreds of years ago*.

Civ is a minor battle, chess is war.
 
The company`s net profit of $731,000, or $.01 per share, for the 2003 first quarter marked a 32% increase over first quarter 2002 net profit of $552,000, or $.01 per share.

$0.01 per share! Seriously, I have to start worrying about them being able to still stay in business to create more good games.
 
Thats 1 cent increase in in profit per share every 3months. While thats not good(or even close) that is by NO means in risk of going bankrupt.
 
Originally posted by Gengis Khan
And I repeat NO ONE downplay chess. That is the ALL-TIME greatest strategy game! It's simplistic nature fools alot of people, but is insanly complex when you break it down. *Keep in mind it was invented hundreds of years ago*.
Yes, about 1500+ years ago.
 
There's also the issue of computing time. Top-end chess programmes think for hours about moving one piece. In Civ we complain if the AI takes five minutes to move hundreds of pieces. For people to play a game like Civ, it must run reasonably fast. A chess computer can analyze every possible move from a given situation, and explore many avenues of possible further moves quite a few rounds into the future. For the Civ AI, doing this would take essentially forever. On top of which Civ contains an element of de facto chance - while the RNG isn't technically random, the AI does not know what it's going to come up with any more than the human player. Given this, the infamously predictible scripted responses and the algorithmic identification of city locations are hardly to be avoided.

As for monetary resources, huge amounts of money have been spent on things like Deep Blue. Designing a chess AI, but not a Civ one, is seen as a mainstream AI research/compsci task.
 
Originally posted by tao
Yes, about 1500+ years ago.

LOL!! Well that would be hundreds wouldn't it??;)

I wanted to say a thousand, but I'm too lazy to look up the exact date(which probably isn't known). And I didn't want some smart-@ss coming back and saying it was invented 998 years ago not 1k;)
 
Back
Top Bottom