Better AI Latest Version

The branching factors and unknown information in civilization are far larger than chess. They are possibly far larger than go.

With 50 units, each can move in one of 8 different directions, or do 2 or so actions not-moving. That is on the order of 10^50 possible "next moves".

If you order the movement of the units canonically (which removes some useful strategic options), every turn the first unit movement of units still generates a branching factor of 500: still far larger than chess. (and most units can move more than 1 unit of distance)

So the game has to have lots of heuristics to decide what kinds of moves one should do.

And one can often not determine what the results of a set of actions are: you don't know where the enemy troops are, if the enemy will produce more units, or how the enemy will react to your movements.

Hence heuristic strategies. The AI makes a plan based off of heuristic rules and develops it based off heuristic rules.

To test these rules, you put them up against human and AI players, and see how the AI performs. Does the AI act like you want a nation to act? Is it an effective challenge?

Hahah, been awhile since I took Probability and Statistics!!

Aye, the number of possibilities is certainly prohibitive. But I can't help but think there's not a way to break it down into simpler models. Perhaps on a local battlefront using just the units present, and making an educated guess about what units might be just out of sight based on the enemy's tech levels, production levels, etc. Also, instead of iterating based on 50 specific units, use small stacks based on types, such as spearmen, archer, mounted, axemen, siege weapons.

Another possibility is to creat a cut-off for how many units the Ai may calculate iterations for. Many skirmishes occur with perhaps a handful of units, and the AI often blunders woefully. I see no reason in these situations that iterations couldn't be used instead of strict heuristics. I suspect there has to be a way to make at least some better use of the computing power available. Instead of iterating all the specific units and specific move combinations, perhaps find a way to iterate outcomes with various 'power assignments' such as occupying a forrested hill with access to a nearby road, or a nearby contested town or resource.

Bigben34
 
That's combinatorics, not probability/statistics. :)

Crunch-based AI is seriously limited in a high-branching factor game. The hard part is the heuristics, not the combinatorics.

That is why, if you read the design docs, they talk about strategies and tactics, not the searching of game trees.

Knowing that a location is more strategically important isn't a matter of CPU time. It is a matter of formulas that tell you it is more important.

As it happens, the fact that "stack of death" is a really effective civ4 strategy makes the problem simpler for the AI. Most of the AI's units are in a handful of large stacks, the rest of the "offence" (pillaging teams) are small and designed to be more costly to kill than they cost to build. Defence (be they fortified units, or counter-attack units) is more "respond to attack by shifting enough resources to defend against the attack and/or take out the units". Running a simulation on "can that stack take that city" isn't CPU intensive, and "what will be the expected harm and costs of attacking that stack" isn't CPU intensive.

...

Does cesear have trade connections with other empires? At least the default AI refuses to trade away technology that nobody else has.
 
Hi all,

I've just decided to have a look at Better BTS AI. But I am interested in the source code to add my own mods to it. I can't seem to find the source code on Source Forge. The posted download seems to have a zip file with the compiled DLL but no source code. Where can I get the source code? Am I missing something? I may not be familiar enough with sourceforge.

Thanks.
 
Note that that is a delta against the Civ4 BTS latest patch source, not a complete set of source. (It contains only the files that changed vs the standard source)

Civ4 ships with the standard source, and patches upgrade it.
 
Back
Top Bottom