SoD vs. SoD

Civ4Brains

imperfectus
Joined
Jan 18, 2011
Messages
109
Location
UK
I've found plenty of information regarding how the mechanics of combat work at the level of the individual unit ie. strength, modifiers, damage and the die roll etc. but I can't find anything explaining how the game decides which unit to assign as defender in a SoD when being attacked by a unit from another SoD.

Anywhere this is described? or perhaps someone could quickly list the deciding factors.

Might it involve just base strength or will it include modifiers such as promotions, fortification status, inherent abilities (if particularly suited to counter attacking unit - ie. Axemen vs. another melee unit) and so on.

In this regard is it safe to say that the defending stack generally has the advantage, assuming of course that it begins with a suitable mix of counters?

thx in advance.
 

jokulmorder

Chieftain
Joined
Nov 1, 2009
Messages
81
as far as i know, it picks the unit with the best odds for victory to fight (though there was a glitch a while back involving high drill promos or something that would cause this to not be the case).

defender will almost never have the advantage because gigantic stack combat in civ is decided by whoever has their collateral damage units attack first. this is why you optimally want to have as many stacks as possible without slowing down the speed at which you can conquer cities. it is also the reason the person defending the territory (not the defender in combat) has the advantage since you get the benefits or roads in your cultural boundaries and your opponent gets none.
 

Ataxerxes

Deity
Joined
Jul 29, 2009
Messages
3,073
as far as i know, it picks the unit with the best odds for victory to fight (though there was a glitch a while back involving high drill promos or something that would cause this to not be the case).

defender will almost never have the advantage because gigantic stack combat in civ is decided by whoever has their collateral damage units attack first. this is why you optimally want to have as many stacks as possible without slowing down the speed at which you can conquer cities. it is also the reason the person defending the territory (not the defender in combat) has the advantage since you get the benefits or roads in your cultural boundaries and your opponent gets none.

Mostly agree. However, a large number of small stacks can get picked off piecemeal. You could probably conquer some cities with a small stack but the AI would then pick off your stacks one at a time. At the start of a war it's good to have one large stack. After the enemy has been ground down you can then start to split your stacks to take more cities quickly.

A lot of players will declare war and then wait for the enemy stack to annihilate it where they have roads. Hopefully forests have been cut down. Also, if you have the Great Wall you get double GG points for doing this.

OP: I think there is an option for stack combat. DO NOT USE THIS! If you think automated workers are bad . . . Stack combat doesn't use siege initiative first.
 

Dhoomstriker

Girlie Builder
Joined
Aug 12, 2006
Messages
13,418
OP: I think there is an option for stack combat. DO NOT USE THIS! If you think automated workers are bad . . . Stack combat doesn't use siege initiative first.
My limited experience with Stack Attack gave me an opposite result in regards to siege units, but the result was equally disaterous:
I was fighting against Riflemen using Catapults, Macemen, War Elephants, etc (in Vanilla).

Using Stack Attack, all 18 or so of my Catapults were thrown away first... I'd mostly been using them to bombard defenses in a single turn and then would maybe throw a few of them at a City... what ended up happening was my war got stalled from losing so many Catapults and being faced with high defensive bonuses.

The whole POINT of enabling Stack Attack was so that I could finish my Game of the Month Domination Victory before an impending submission deadline... but the game ended up taking me longer due to the lost siege units!

Instead, I just sacrified an early finish date by queuing up a lot of units to be built in my Cities, setting up rally points, DISABLING Stack Attack, and Ending the Turn a lot until I got a big enough army back on the borders with my war target.


Regardless of how it sucks, Stack Attack sucks--don't use it! ;)
 

Civ4Brains

imperfectus
Joined
Jan 18, 2011
Messages
109
Location
UK
OP: I think there is an option for stack combat. DO NOT USE THIS! If you think automated workers are bad . . . Stack combat doesn't use siege initiative first.

First time i've heard of this stack combat option, but have heeded the advice - wont use it!

back to the specifics:

as far as i know, it picks the unit with the best odds for victory to fight

unit with best odds being the one that ends up with the highest modified strength value vs. the particular unit type attacking
 

Eerdna

Chieftain
Joined
Jan 25, 2010
Messages
77
Location
Costa Rica
just a small question... what happen when 2 diferent units have the same odds? for example an attack in open field when the defender is an unpromoted stack of horse archers and swords... who will defend first?
 

Farm Boy

syntax error
Joined
Sep 8, 2010
Messages
22,783
just a small question... what happen when 2 diferent units have the same odds? for example an attack in open field when the defender is an unpromoted stack of horse archers and swords... who will defend first?

Your game asplode.
 

Dhoomstriker

Girlie Builder
Joined
Aug 12, 2006
Messages
13,418
just a small question... what happen when 2 diferent units have the same odds? for example an attack in open field when the defender is an unpromoted stack of horse archers and swords... who will defend first?
If it's units of the same type, then the one with the most Experience Points (or perhaps Promotions) seems to come up as the defender. So, for example, a Swordsman with City Raider III and Combat I will defend before a Swordsman with Combat I will defend... which is rather counter-intuitive... you'd think that the least experienced unit with the same defensive bonuses would be the better defender (so that you don't lose your well-promoted unit).


As for your exact case, where you're comparingunit types of equal strength and equal defensive bonus (zero defensive bonus), I don't know the answer, but I would suspect that the same answer would apply... the unit with the most Promotions... so your Flanking II Horse Archer would probably defend before your unpromoted Swordsman would defend... but that's just a guess.
 

Windsor

Flawless
Joined
Feb 14, 2008
Messages
1,387
Location
Norway
OP: I think there is an option for stack combat. DO NOT USE THIS! If you think automated workers are bad . . . Stack combat doesn't use siege initiative first.

There's nothing wrong with the stack attack option if you use it wisely. Don't start by selecting the entire stack, start by only selecting a few siege(or mounted if you prefer that) units and attack. Then look at the situation again.

Stack attack really isn't a good option for small stacks, but it can save a lot of time when the stacks are big. And even with stack attack on you can always send in on at a time.

I always have stack attack on :)
 
Joined
Sep 12, 2006
Messages
2,043
I never use stack attack but that's simply because combat is where I MM the most. I want the exact right unit for the job on the attack, taking into consideration not only strengths versus whatever the AI is defending with, but also how close units are to the magic 10 XP, how wounded they are, whether I'll need to use it to help garrison the city I'm taking, etc.
 

Dhoomstriker

Girlie Builder
Joined
Aug 12, 2006
Messages
13,418
There's nothing wrong with the stack attack option if you use it wisely. Don't start by selecting the entire stack, start by only selecting a few siege(or mounted if you prefer that) units and attack. Then look at the situation again.

Stack attack really isn't a good option for small stacks, but it can save a lot of time when the stacks are big. And even with stack attack on you can always send in on at a time.

I always have stack attack on :)
I can see where you are coming from. If you have overwhelming forces, then this approach can work. However, what would you do if you were to bring 8 Axemen against 3 Archers and an 4th Archer were whipped immediately? Say you decided to only select 4 Axemen, but all 4 of them died, with the results from the first 2 battles being that the Archers stayed at full health and the next 2 Archers did not die?

At that point, you probably have to call off the attack, while you have "wasted" 2 more Axeman than you probably would have done had you attacked with them 1-at-a-time.

In this situation, I might group-select 4 Axes as you would have done, then attacked 4 times with this "stack." As each unit attacks, I can watch the results of the fight and can decide whether or not to keep on with the attack or to cut my losses and return to fight another day.


I can see where Stack Attack could be beneficial if you have 8 Maces to his 4 Archers, where you're all but bound to win no matter which of your Maces attacks first or last.

However, I appreciate the convenience of being able to select many units at once, attack with that "stack," but only have the best attacker one-at-a-time attack, so that I can dynamically respond to the outcome of the battles, instead of finding out that my units senselessly threw themselves at the enemy long after the point that I would have had them call off the attack.
 

r_rolo1

King of myself
Joined
May 19, 2006
Messages
13,818
Location
Lisbon, Portugal
Note that it is not always better to use the siege units first. A typical situation where this happens is those typical pro civ cities with a heavy promoted defender and some other lesser defenders ... if you use siege first, that top defender will probably be not even stratched by it ( because they will be the oponents of the siege units, not taking collateral damage ) while if you use a sacrificial non-siege unit before or somewhere in the middle of the siege usage they can be weakened enough for not being top defender, getting in the line for collateral damage ;)

@Eerdna

Well in that case:

- units with more first strikes and/or first strike chances are seen as better defenders most of the times . Specifically and to use as a thumb rule, every first strike is seen by the best defender code as a increase in modified strength of 16% and a first strike chance half of that ( 8% ). This can get quite extreme: a drill IV ironclad will be picked as a better defender in front of a unpromoted destroyer and a 1 turn fortified Woodman III samurai in non forest terrain will defend in top of a unpromoted rifleman

- If there is still no diference, number of promotions . This is the cause of death of many GG-attached units, since they are assured to have atleast one more promo than the other units :D

- If there is still a tie, the circling order solves it :D
 

Dhoomstriker

Girlie Builder
Joined
Aug 12, 2006
Messages
13,418
- If there is still a tie, the circling order solves it :D
Do you mean the order in which units are listed on a square? If yes, would it be the first unit listed or the last unit listed that would come as the defender?
 

r_rolo1

King of myself
Joined
May 19, 2006
Messages
13,818
Location
Lisbon, Portugal
There is a lot of stuff floating around, just no consolidated thread with all the know how :p Basically it works like I posted above: first odds ( modified by first strikes ), then number of promos and last unit cicling order ( this one is shaky in my head ... long time no see regarding this particular part of the code )

The more consolidated discussion I know about this can be found in here ( better said, from that post on ... before , like the poster I linked said , don't know what they were talking about :devil: ). It's a good read and a lot is said in less than half a page ;)
 

Civ4Brains

imperfectus
Joined
Jan 18, 2011
Messages
109
Location
UK
There is a lot of stuff floating around, just no consolidated thread with all the know how :p Basically it works like I posted above: first odds ( modified by first strikes ), then number of promos and last unit cicling order ( this one is shaky in my head ... long time no see regarding this particular part of the code )

The more consolidated discussion I know about this can be found in here ( better said, from that post on ... before , like the poster I linked said , don't know what they were talking about :devil: ). It's a good read and a lot is said in less than half a page ;)

:goodjob: ur a :king:
 

ruff_hi

Live 4ever! Or die trying
Joined
Oct 24, 2005
Messages
9,123
Location
an Aussie in Boston
We need a code reader to translate 'best defender' code for us. I thought it was the defender with the highest adjusted strength and not the best defensive odds. They are slightly different and can result in your Drill X longbow defending against a first strike resistant unit.
 

nfw

King
Joined
Aug 31, 2010
Messages
733
There have been situations where I give an attacker an extra promotion (pinch I think), and the computer chose a different defender with better odds than before the promotion.
 
Top Bottom