Thinking about defender quantity

WuphonsReach

Prince
Joined
Nov 6, 2005
Messages
426
Looking at my latest huge/marathon/chieftain game with 18 civs... and thinking about how I decide how many defenders to allocate to each city. Also an attempt to uncover how you determine how many defenders is "enough"? What things do you think about? What can we teach the AI to think about?

1110 AD - 9 cities - not at war

3 tiny cities (1-2 pop) up north on a separate land mass, bordering on a friendly civ. Two cities are coastal. One is next to horses (strategic). Defense should be 1-2 in each city (I have 4 at the moment). I probably should've increased it to 5 defenders, but the cities are isolated and are building other things.

2 cities at the north tip (cultural capitals, the top 20% of my cities ranked by culture). Also the top 2 population cities. Both are coastal, neither are near strategic resources. They can make do with 3 defenders each.

2 cities in my core. One near copper. Both on coast. These can get away with 1-2 defenders. Maybe 2-3 because they're coastal. (Let's say 3 for now).

2 cities near Mehmed who is annoyed with me and of a different religion (2 strikes). His power is half of mine and I'm slightly ahead in tech. So 3 defenders in those 2 cities since we're still at peace. The city near iron should've probably had a 4th defender. Since these are in the upper 3rd of my population, I should allocate another defender to each city. Maybe even another one since both cities are coastal (5+6).

Total: 25 defenders across 9 cities. Plus as many as needed to keep happiness up (Hereditary Rule). The count is a bit higher because I have so many coastal cities and I'm not friendly with neighbors near my southern 2 cities.

As I work towards war, any units above and beyond the count get put towards my invasion force. My invasion force count needs to take into account the # of units required to take a city plus the # of units needed to hold each city.

If I was at war, I would probably add more units to defense. The quantity would be based on the size and tech level of the enemy. Going up against Ghandhi, who is 1/3 my power and behind in tech means I won't change my defensive posture. Going up against Mehmed in a war and I'd add 1 more unit to each city near him. If he was even with tech, then 2 units to each city near him. If he was ahead, 4 units to each city.

On harder difficulty levels, I'd probably add 1-2 units to border cities with unfriendly civs just on general principles. Or if the neighbor is aggressive / belligerent.

...

1354 AD - 14 cities (I took 5 from Ghandi), prepping for war with Hatshepsut

3 north cities now have 5 defenders (still friendly with that neighbor and the cities are small, 2 coast, 1 strategic). If he wasn't so friendly, I'd have added 1 defender to each.

2 cultural capitals on the north tip now have 5 defenders each (plus whatever is needed for happiness).

2 core cities - one is now a cultural capital (I now have 3). So they now have 2 defenders in each.

2 cities near Mehmed. 5+6 defenders are still enough since I'm not at war with him. But I added 1 more to the city closest to Hat (so 6+6).

5 cities that I took from Ghandi. 4 are coastal. 1 can work Iron, 1 can work horses. 2 are near Mehmed, 1 is near Hat. 1 city is pop 10. So 5 base defenders, plus 4 for coastal locations plus 2 with strategic resources plus 2 near Mehmed (would be 2 each if he was equal) plus 1 for population plus 1 near Hat. Which is 15 defenders.

Total: 41 defenders for 14 cities

...

Of course, the # of defenders doesn't tell the whole story. My best defender right now is a Crossbowman which is STR6 w/ CG3 (+75%). I don't count the fortify bonus.

They're the core of my defense, with at least 1 per city with as many CG promotions as I can get. The second unit is either a balanced samurai (STR8 w/ anti-melee and anti-arrows) or anti-mounted. The third unit is typically a medic (often a bowman w/ medic + CG). After that I usually add a horse archer or more bowmen.

I try to vary my defenders a bit. Some I'll randomly give anti-melee or STR or anti-mounted promotions to. So for at least 1/4 of them, I take the 2nd best or 3rd best promotion choice. Which would ensure that they get more options for the next promotion.
 
Musing some more...

So if I'm the AI, how do I decide the overall quantity of units needed, then allocate them to the cities?

- Aggressive civs (warmongers) can get away with lower defense counts and put more towards their attack forces.

- Pacifist / builders should probably build more defenders and fewer attackers. Even though they aren't going to war frequently, they need to build enough of a force to dissuade invasion.

- If everyone is happy with me, I need fewer defenders.

- If someone is cautious with me, I should increase defenses based on the size of the other civ. More so if they have cities close to one of mine.

- If someone is annoyed with me and is near to me, I need to prepare for defending myself.

- If I'm behind in tech, I need more defenders.

Possible values and weights. These weights can be looked at as unit counts desired for each location. But the overall quantity should be controlled by what the civilization can afford (or feels is needed).

+5 per city (base score)
+2 coastal city
+1 per strategic resource inside fat cross
+1 for the top 1/3 of cities sorted by population
+1 for the top 1/5 of cities sorted by population (add'l)
+3 for the top 5 cities sorted by culture (if culture victory being pursued)
+1 for the top 1/3 cities sorted by production
+1 for the top 1/5 of cities sorted by production (add'l)
+2 for the top 1/4 cities sorted by science (if space race is being pursued)
+1 per wonder or project in a city
+1 for cities with military instructors
+1 for cities with military academies
+1 to +2 based on border (+1 for any influence, +2 for heavy influence from another culture)
+2 for being near a cautious neighbor or +5 for annoyed neighbor
+1 for each luxury for food resource (max of 2)

Add a random value of 0..10 to each city on Chieftan going down to a randomization of 0..2 to each city's score on the hardest level.

Now for the weights regarding enemy forces (double these values if we're at war or the other civ is annoyed):

+3 per stack within sight of a city, +5 if the stack is next to a city (max of 10 points)

+1 per enemy unit within range 3 of a city (going up to +2 for being next to a city)

Which should ensure a shift of defenders towards vulnerable cities as the enemy approaches. By looking at both # of stacks and the total # of units in the stack, we shouldn't see any choices that are too stupid. As a large stack gets closer to a city, the score should shoot up so that defenders come to the defense. If the enemy is bringing a stack of 50 units, almost every spare military unit on the map should be headed in that direction.

So... how many units? Well, every city should have a minimum of 1 defender. The weights are merely used to distribute any defenders beyond the base.

That's a bit vague... how many units above the base # of defenders do we need for defense? Therein lies the hard part. You have to look at other AI power, guess at how many civs are going to come after you at the same time, guess at their tech level, guess as to their level of aggressiveness and then calculate your risk factor. Which is also modified by how aggressive you are as a player (best defense is a good offense). If you're going to attack, you need fewer defenders.
 
Back
Top Bottom