akots
Poet
Originally posted by The Last Conformist
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.
By no means I am an expert in chess programming. I just have read some literature about it. There were several problems at the very beginning in the 1960s-70s.
First and major problem was how to evaluate a position. In another words, are you more close to the victory in a new position or not and how to measure this distance from a victory. In Civ3 this is solved pretty straightforward. How close you are to building a spaceship? Evident. How close you are to domination? Evident. How close you are to conquest? Evident. How close you are to cultural victory? Evident. How close you are to diplomatic victory? Evident. Everything is easily expressed in numbers. Thus, there is no problem of evaluation of position for AI. Everything is easily expressed in numbers. The more tiles you owe the closer you are to domination. The less military and cities your opponents have the closer your are to conquest. Etc. Thus, this problem is already solved.
Second problem was how to predict the moves of the opponent. In chess, there are not that many moves, thus, AI goes straightforward and analyzes all moves discarding those which will lose a lot of position point for the opponent as low probability possibility not worth analyzing. Well, with chess it is possible to lose by making one incorrect move. With Civ3 losing is more difficult. It takes several series of serious mistakes. And again, Civ3 AI is not that hopeless. It reacts to your moves trying to predict what you are going for. It is reacting somehow but not choosing the optimal pathway in most cases. Which cases, when, and how, that is what I wanted to understand.
Third, computing power. Certainly, it takes some time for AI to make a decision. How long? I can certainly wait for AI for 10-20 minutes to make a turn on a standard map. Now it takes less than 1 min on my 1.3 GHz Athlon with 128 Mb memory. Again, with chess programs, the problem was how to manage the virtual memory and clean it up efficiently after the decision is made. Without extensive virtual memory usage, this task is impossible. Civ3 AI however, as I noticed, never uses virtual memory. For example, to defeat the opponent who has 5 fortified spearmen defending a city AI has to build 10 swordsmen within next 5 turns. However, opponent can build roughly 3 spearmen during these 5 turns and thus, AI has to build and transport to that city lets say 16 swordsmen within next 8 turns to have reasonable chances of capturing the city. On the other hand the opponent can be researching Feudalism and has barracks in that city. After 8 turns, the swordsman might come to fight with 8 fortified pikemen instead of spearmen. Thus, it would be better not to build the swordsmen at all but build horsemen and then wait until Chivalry is discovered, upgrade horsemen to knights and then attack these pikemen. Certainly, some time is necessary to make this complicated decision. After the decision is made, write it down in virtual memory. Then, make another decision regarding so other issues like what to trade to whom and fro what price or what to build in which city and which tile to work depending on what is optimal for improving the situation. Then, analyze all individual decisions for contradictions, correct if necessary, make the budget, predict opponent strategy, analyze whether the situation would improve regarding the progress towards a win. If it does, good, write everything down. Then, try some other approach. For example, attack another city or make a peace or wage another war, etc. In each case record the key decisions. Then, compare progress towards victory in every case. Choose whatever is more efficient and go for it. Plain simple. With normal map should not take that long I assume. The software just has to manage the memory properly and clean it up which any accurately written bug-free software should be able to do reasonably well.
With chess, probability is also a big issue probably until 1000 GHz PC is around. There are just too many variations to calculate within a reasonable time to completely solve the game. And Deep Blue team consumed lots of resources because they used expensive hardware. BTW, they started about 10 years ago and at that time 100 PentiumPro 200 were really expensive. Well, it was a big and extremely inefficient Cray superpower. Which is now easily beaten by any normal PC.
All I wanted to say is that it is known how to make a good AI because strong chess AI is a good model for any strong AI. In RTS you have the time limit, whereas in turn-based strategy, time is of minor importance. Just take the chess AI model and adapt it for Civ3 rules and units and strategies. And again, DeepBlue and any other serious chess AI builders used grandmasters for help not only during testing but also during writing how the AI makes the key decisions. Because only a strong player knows which decisions should be optimal and how they can be reached. An algorithm of looking for a decision is very important.