Don't like current DIFFICULTY SCALING;AI is cheating

Abegweit said:
x^1000 is a big honkin' number no matter what x is.
No. You're still making the same mistake. 1000 is the base, while the exponent is the number of moves we look ahead. We're looking at 1000^x combinations, not x^1000.
 
Brain said:
No. You're still making the same mistake. 1000 is the base
Wrong. thousands is both the base and the exponent.

The exponent is the number of moves we look ahead. We're looking at 1000^x combinations, not x^1000.
Wrong. The exponent is the rate at which the combinations increase. In Chess, Bridge, Backgammon and GO the rate and the number of moves is the same. This is because each player makes exactly one move on each turn.

This is not true of Civ.
 
Abegweit said:
Wrong. thousands is both the base and the exponent.
No it's not. The rate of growth of a recursive tree search is W^D where W is the "width" or the average number of possible combinations at each level in the tree, and D is the "depth" or the number of levels that we consider. In this case we're talking about ~1000 possible combinations in one move. So W is 1000. But D is just the number of moves we want to look ahead. So we have 1000^n for looking n moves ahead.

This is logical. Just look at a roll of a die. Every roll has 6 possibilities. For two rolls we have 6 possibilities for the first roll and 6 for the second. That's 6 x 6 = 36 possibilities. For three rolls we have 6 x 6 x 6, and so forth. One roll = 6^1, two rolls = 6^2, three rolls = 6^3, n rolls = 6^n.
 
Civ has never and will never use a tree search/chess-like/whatever-its-called AI. However, if you say 'I want better AI' on the boards many people instantly think you must mean tree search AI. Humans don't play civ by looking at evaluation trees. I think it is possible to improve the civ AI by a difficulty level or two via refinement of the current style AI, and with the new modding tools coming for civ4 we might actually see this happen.
 
Search trees may be meaningful, but only for a very limited scope.
So, if the scope would be to defend a given city (or to take it) at a given point in time, using search tree algorithms could be useful, although they still would require an incredible amount of cpu time (and memory, btw).

Nevertheless, the problem would be to estimate at which point you would have to switch from rules to search trees.

About the sheer number of possibilities, just compare the first move in Chess to the first move in Civ.
For Chess, there are 20 different combinations times 2 players = 400 combinations in total. 20^2.
For Civ, there are max 2*8=16 combinations per player (under the assumption, that no sea tile is blocking your way).
16*8 players = 16^8 combinations with standard settings.

As has been pointed out before, no random results are taken into account. Now, think of calculating the different outcomes of a battle between 2 units with 4 hitpoints each = 8 combinations for each battle (A wins with 4,3,2,1 hitpoints left OR B wins with 4,3,2,1 hitpoints left). And this was just one move. So, for any unit being adjacent to another (enemy) unit, there are at least 15 combinations,as it could attack or move to one of the 7 other tiles it is adjacent to (not taking into account that it could have been a fast-moving unit with retreat capability, nor taking into account enslavement, nor taking into account fortifying instead of moving).
 
Commander Bello said:
About the sheer number of possibilities, just compare the first move in Chess to the first move in Civ.
For Chess, there are 20 different combinations times 2 players = 400 combinations in total. 20^2.
For Civ, there are max 2*8=16 combinations per player (under the assumption, that no sea tile is blocking your way).
16*8 players = 16^8 combinations with standard settings.
Isn't the number of possible moves for Civ much larger than 16 per player? Assuming you start with one worker and one settler, the worker has more than 10 possible moves (8 directions to move, or stay/mine/irrigate/build road/disband). At the same time, the settler can move in 8 directions, stay or build a city. The combination of this will be ~10 * 9 (if you only consider move or build for the settler) = 90 combinations. Now multiply the 10 combinations where the city was built with the 8 or so possible different reasearch options, and 5 or so different build options and you have passed 400 combinations without even regarding the slider settings.

Now you end up with 400^8 combinations for the first turn, which will probably make it impossible to do a saerch tree for even the first turn alone...
 
@TheNiceOne:
You are right. :goodjob:

1) My example was based on the assumption that you would move your units.
2) I didn't take the combinations into account, but just added the movements

Thanks for pointing that out, as it perfectly illustrates that the workload to calculate the outcome of just one turn is much higher in Civ than it would be in Chess.
 
eg577 said:
Civ has never and will never use a tree search/chess-like/whatever-its-called AI. However, if you say 'I want better AI' on the boards many people instantly think you must mean tree search AI. Humans don't play civ by looking at evaluation trees. I think it is possible to improve the civ AI by a difficulty level or two via refinement of the current style AI, and with the new modding tools coming for civ4 we might actually see this happen.
You'll never get it to plan ahead like a human does. I just want to see better basics. Some of the things the AI does which can, and should, be fixed.

Irrigating grasslands in despotism
Building regular units
Not making enough workers
Roading one square and irrigating the next
Building a settler in a size one city due in 3 turns
Never using the luxury slider
Never upgrading units

This kinda of stuff is not hard to program.
 
Yeah, but if we program AI to have more workers we also should tell the AI not to sell those workers... :) Buying AI workers is just one of the "exploits" now in Civ 3
 
V. Soma said:
Yeah, but if we program AI to have more workers we also should tell the AI not to sell those workers... :) Buying AI workers is just one of the "exploits" now in Civ 3
If it would make a decent number, this wouldn't matter and it wouldn't be an exploit. The AI should realize that it needs to replace replace the unit. I occasionally sell workers to the AI. Why not?
 
I don't know what you all people are discussing about.
An AI will never be as complex and unpredictable as a human in taking any decision, and therefor it will never be as "intelligent" in a game like Civ, or poker. Civ is not Chess, in chess you know everything that is happening on the board, in Civ you don't (or at least you're not supposed to). There can be bluffing and more going on. The AI does not take any decision but only execute instructions. And those instructions are a set of rules programmed by a human. Because of this, an AI will always be predictable. A human being can do an action because "why not ?" or because he/she thought the (human) opponent would not think that he/she thought to do so. An AI cannot do it because it does not think. It only execute instructions and perform calculations. At least this is how it works now. And frankly I hope it stays this way.
 
It will never plan hundreds of moves in advance, but it can (and should) play the game better. Somewhere between Monarch and Emporer is quite attainable. Currently it plays regent.

I fully expect the Civ4 AI to be much better. There's a reason why they are re-writting it, after all.
 
Abegweit said:
1) Irrigating grasslands in despotism
2) Building regular units
3) Not making enough workers
4) Roading one square and irrigating the next
5) Building a settler in a size one city due in 3 turns
6) Never using the luxury slider
7) Never upgrading units
Some of these are simple to fix:
1) If government=despotism, then never irrigate grasslands :mischief:.

2) Maybe AI should be programmed to try to build units in cities who have barracks, when more units are needed, then build barracks in some cities who don't have yet, as well some regular units.

3) Maybe creating a proportion of workers per city will fix it. Something like 1~1,5 workers per city will surely help. More: cities near jungles and marshes must have more units working, maybe built in another city who could build them faster.

4) Sometimes AI brings irrigation from somewhere and could do this. I think you wish to not build a road first and then bring irrigation, right?

5) I saw it so many times. AI should build settlers in cities at least size 2 and which growth is expected before the settler is built. Cities sized 3 or above are free to build settlers when they want.

6) Well, AI should do the same as we do: when people becomes unhappy and riot, then increase the amount for luxury 1 per turn until people stop riots. Obviously, if there's a deficit, then reduce the amount for science. Also: build more cultural improvements, as temples and try to get luxury resources.

7) This is one of the worst things I saw in Civ3. Even an AI with Leonardo's Workshop don't usually (never?) upgrades their units. Why to keep dozen of spearmen in modern ages if they won't resist more than two or three TOWs? AI should try to get money, building marketplaces, banks, stock exchange and commercial docks when they are avaiable (not in all cities at the same time, but try to make some as soon as possible), or reducing luxury and science slider to get some money and upgrade some units, beginning with less expensives to upgrade. Another alternative is disbanding very obsolete units to build modern units faster. Keeping obsolete units keeps the amount of units too high, usually much higher than government can support, making AI spent a lot of money to keep useless units.

There's more thing AI should do:
- When the city is built, a worker must search better tile to improve, like tiles with cattle or wheat. Then search for subsequent good tiles to improve, leaving the worst useful to the end of queue.
- Try to build cities in better places. AI has the bad habit of doing cities with only one rule: get resources. AI build a lot of cities near existing ones, usually getting a lot of squares of another city. It should only happen when there's no other way of building a city in a better place. Also, try to build a city to use a river/lake, not one or two squares away from rivers (forcing to build an aquaduct later) and trying to avoid water tiles when the city is not coastal.
- AI should never see any resource that isn't discovered yet. When I see AI building a city far away, or trying to pass may territory to make a city where I didn't build (even having a lot of territory to expand near), I know there's a resource in that place and I hurry my production to build there. Most times it was saltpeter.
 
See. None of this is hard. It can and should be done. A computer should excel at micro-management. Yet it is awful at it. I should be able to leave the governors on and get a decent result.

Your list reminds me of another thing which astonishes me. WTH with putting cities on bonus food? I just razed a city in the latest GOTM with the intention of moving it over one square. Then I found cattle under it! If I hadn't razed the city, I would never have known.
 
Ramalhão said:
Some of these are simple to fix:
1) If government=despotism, then never irrigate grasslands :mischief:.

and why not ? it's sort of a prebuild IMO. And besides, extreme conditions like this are exactly what make the AI too much predictable.
 
Ramalhão said:
Some of these are simple to fix:
1) If government=despotism, then never irrigate grasslands :mischief:.
Your proposal exactly describes the way in which the AI is programmed up to now. It is pre-determined - and this is the problem.
What, if somebody modded the game, so that irrigation would have an effect even at despotism? With your proposal, this modding would have become pointless, thus reducing the modding potential of the game.
The AI should interpret the rules settings and then decide whether a certain tile improvement makes sense or not.

Ramalhão said:
2) Maybe AI should be programmed to try to build units in cities who have barracks, when more units are needed, then build barracks in some cities who don't have yet, as well some regular units.
Valid point.

Ramalhão said:
3) Maybe creating a proportion of workers per city will fix it. Something like 1~1,5 workers per city will surely help. More: cities near jungles and marshes must have more units working, maybe built in another city who could build them faster.
Again, the worker/city ratio shouldn't be done per city, but per nation. Workers should primarily be built in cities which already reached the maximum size or are close to it.
Making the optimiziation algorithm exact enough, you could even avoid to have to build certain city improvements in such a town, then.

Ramalhão said:
4) Sometimes AI brings irrigation from somewhere and could do this. I think you wish to not build a road first and then bring irrigation, right?
I would almost all time build the road first, as this will improve your wealth and will speed up all your units.

Ramalhão said:
5) I saw it so many times. AI should build settlers in cities at least size 2 and which growth is expected before the settler is built. Cities sized 3 or above are free to build settlers when they want.
Valid point.
Yet there should be an optimization run to identify for the cities which have to grow to the max, to be able to build wonders or cost-intensive improvements first.

Ramalhão said:
6) Well, AI should do the same as we do: when people becomes unhappy and riot, then increase the amount for luxury 1 per turn until people stop riots. Obviously, if there's a deficit, then reduce the amount for science. Also: build more cultural improvements, as temples and try to get luxury resources.
Forgive me, but this is crap.
The AI should check for luxuries (access internally or by trade), if there are enough military police units and then play around with the internal advisor.

Ramalhão said:
7) This is one of the worst things I saw in Civ3. Even an AI with Leonardo's Workshop don't usually (never?) upgrades their units. Why to keep dozen of spearmen in modern ages if they won't resist more than two or three TOWs?
Because a spear makes as much citizens happy as a modern armor.
So, there is no reason to upgrade an ancient unit, given that the town it is in is not located near a potential enemy or the shores.
Upgrading can be done if enough wealth is available (let's say the treasury is already above 5000 gold [figures just for display])

Ramalhão said:
AI should try to get money, building marketplaces, banks, stock exchange and commercial docks when they are avaiable (not in all cities at the same time, but try to make some as soon as possible), or reducing luxury and science slider to get some money and upgrade some units, beginning with less expensives to upgrade. Another alternative is disbanding very obsolete units to build modern units faster. Keeping obsolete units keeps the amount of units too high, usually much higher than government can support, making AI spent a lot of money to keep useless units.
Again, stated in the absolute way as in your posting, I cannot agree to this.
The answer is: optimization.
Upgrading almost always is a better way to get new units compared to disband old ones for the sake of the production of new ones.
There are obvious exceptions from this rule of thumb as "Hannibal ante portas", but except for this the disbanding most times is just pointless.

[...][/QUOTE]
 
If we were looking to improve the AI then we should not bother to try to have it 'interpret the rules' so it can play other mods. It is too hard to take everything you know about civ that can be hardcoded into an AI and then generalize it. For example, you might hardcode into the AI how many settlers to build in its first city before stopping based on your own trial and error with the game. Now how would you generalize that number so it is a function of settler shield cost and settler population cost? It just wouldn't work.
 
eg577 said:
Now how would you generalize that number so it is a function of settler shield cost and settler population cost? It just wouldn't work.

Except that this is exactly the problem that Soren needs to solve.
 
Back
Top Bottom