DeckerdJames
Warlord
- Joined
- Nov 1, 2019
- Messages
- 277
Civ isn't chess though. These are fundamentally different games. Chess is a game where every piece can capture a whole piece in 1 turn. Civilization is a game where pieces do HP damage. The game doesn't need to know how many ways or in how many different move orders the 6 horsemen can reach a particular hex. It just needs to know which pieces can be attacked and how much damage they can do.Yes. It does. And quite a bit more than that.
A single 4-speed horseman unit standing on flat grassland in all directions can move to 61 tiles (this includes not moving at all). Six of these horsemen can move in 61^6 = 51 billion configurations. So we're not looking at a standard map, but rather just three cities worth of land (assuming there's some overlap between cities, otherwise it's just two).
Meanwhile, a chess engine that looks forward 8 ply has 20^8 = 25 billion possible configurations. Note that 20 is an approximation of the average number of legal moves in a given chess position - the precise number may vary.
And that's just a game aspect that can easily be quantified in terms of possibilities! How about 'when to declare war', 'what of these 8 units, 8 buildings, 6 districts and 6 wonders to build next' (28 options per city, at 8 cities this by itself beats 8 ply as well), 'where to settle next', and so on?
The only way to build a 4X AI is by generalizing things like this so that you never even consider the options you don't take. Simply considering and discarding bad options like chess engines do just doesn't work, it's too slow.
You could even go so far as to say that by simply evaluating the maximum amount of damage the 6 horsemen can do within their range is a good place to start. Now the damage might vary depending on the strength levels of the opposing pieces. For example, a horseman attacking a warrior might do much damage and take little in return, but it might also mean that the warrior poses less threat to the horseman during the coming counterattacks.
So, without sitting down to design the system here and now, in general I would say that a threat assessment should be done to determine which pieces poses the greatest threat during the coming counterattacks, and what are the optimal attacks to make to reduce the damage that will be sustained from the counterattacks. Now that is only one step. Of course, the horsemen can attack their optimal targets from multiple hexes if they have the movement points. Another assessment could be made to determine which hexes are the optimal hexes to occupy. In civ, the defense modifiers are a simple mathematical factor, but if the AI was ending their turns in the best defensive positions, the AI would be doing ok. However, they might also want to slow down the advancement of enemy units. Strategic concerns like this are evaluations made on the geography and infrastructure, like roads, but also water which just a medium for travel. The point is, that good spots on the map can be identified and the computer can play positionally.
In a game like Civilization, with such a large board, if it plays positionally it will already be playing a much smarter game even if didn't look 1 ply ahead. It is the same in chess. Once upon a time in chess history, positional chess was new.
So, what is important? Defensive modifiers, movement speed of terrain, therefore roads and water, water movement changes based on technological advancements, resources, districts, improvements that can be pillaged, proximity to enemy units can affect the evaluation of a tile, proximity to a strategic goal such as a city center district, and the list goes on. You could evaluate the board for good positions and already the AI is much better to take those positions and to move across the board from good position to good position rather than as quick as possible. (unless strategic concerns make speed more important, but that results from evaluations of a higher order than brute force searching)
Also, the close formation of units with the military tradition civic allows the defensive bonuses to increase, but these can also be added to the bonuses from the geography. For example, the computer can easily evaluate that a patch of hilly terrain is better defensively than flat grassland but slower to move across without roads. However, when multiple units are grouped together, the defense rating goes even higher, so even a pack of warriors in wooded hills can pose quite an obstacle to a stronger man-at-arms unit. So, the AI can be programmed to evaluate positionally for a group of units rather than just for each unit individually.
Suppose that the AI wants to siege a city with siege units. It can choose the best positions for those siege units long before they arrive and group them with support units. Even if they were warriors surrounding it, they would lend +12 to its defense and if there was a good, wooded hill, it would +18 over normal against the city's defensive bombardment. Of course, adding six support units to the siege unit is an ideal number for the siege unit's defense. A good AI has to be able to identify the important units. This is simpler than chess. A pawn is generally worth less than a queen, but a pawn can deliver checkmate. In Civ a warrior is worth far less than a tank. The strength numbers make it easier. Among units that are relatively close in strength there is some consideration to be had based on the overall objective.
The point is a game like Civ is far more ideal for positional play that brute strength. Brute strength is still going to be a part of it, but it doesn't need to run through 50 billion moves.
thoughts?
Last edited: