PDA

View Full Version : Creative Assembly Investigation of Battle Odds



therother
11-12-2004, 01:06
Placeholder

Morat
11-24-2004, 09:32
I wonder if someone could research the factors that determine the strategy map battle odds? I imagine things like number and quality of men, upgrades, commander, and so on.

This seems to be important for getting traits, whether the AI will fight, etc.

zhuge
12-17-2004, 06:55
Ok, while waiting for some more data mining on the XP problem, here's some rough data to give some idea of the odds ratio to answer Morat's question above.
Played on VH/VH as Greeks, normal unit size and unless mentioned otherwise, all troops are at full number of men, have no XP, no upgrades and no general leading them.



Enemy Self Odds (enemy:self)
1 Peasant 1 Peasant 1:1
2 Peasant 1:2
3 Peasant 2:7 ???
4 Peasant 2:9 ???
5 Peasant 1:5
6 Peasant 1:5 (rounding down?)
7 Peasant 1:10 (rounding up?)
8 Peasant 1:10

1 Peasant 1 Mil.Hop 1:5
1 Mil.Hop, 1 Peltast 1:15
1 Mil.Hop, 2 Peltast 1:20

1 Peltast 1:10
1 Peltast, 1 Peasant 1:10
2 Peltast, 1 Peasant 1:15

1 Hoplite 1:15
1 Hoplite, 1 Mil.Hop 1:25
1 Hoplite, 1 Peltast 1:25
1 Hoplite, 1 Peltast, 1 Mil.Hop 1:30
1 Hoplite, 1 Peltast, 1 Mil.Cav 1:30
1 Hoplite, 1 Peltast, 2 Mil.Hop 1:40

1 ArmorHop 1:35
1 ArmorHop, 1 Peltast 1:40
1 ArmorHop, 2 Peltast 1:50
1 ArmorHop, 2 Peltast, 1 Mil.Hop 1:50
1 ArmorHop, 1 Hoplite 1:50

1 Mil.Cav 1:10
1 Mil.Cav, 1 Mil.Hop 1:15
1 Mil.Cav, 1 Peltast 1:15
1 Mil.Cav, 1 Mil.Hop, 1 Peltast 1:20

1 Town Militia 1 Peasant 5:1
2 Peasant 5:2
1 Mil.Hop 1:1
1 Mil.Cav 1:2
1 Mil.Cav, 1 Peasant 1:2
1 Hoplite 1:3

1 Peasant (+weapon upg) 5:2
1 Peasant (+weapon upg), 2 Peasant 5:4
1 Hoplite (+weapon upg) 1:4
2 Hoplite (+weapon upg) 1:7
3 Hoplite (+weapon upg) 1:10
1 Mil.Hop (+weapon upg) 1:1

2 Peltast + 1 Peasant 25:1
1 Heavy Peltast 1 Peltast, 1 Peasant 5:2
2 Peltast 5:3
2 Peltast, 1 Mil.Cav 5:4
3 Peltast 5:4
3 Peltast, 1 Peasant 1:1
2 Peltast, 1 Mil.Cav, 1 Peasant 1:1
3 Peltast, 1 Mil.Cav, 1 Peasant 6:5


As you can see, rounding fractions here is extremely quirky. :dizzy2:
If there's anyone who wants to have a crack at data interpretation you are more than welcome to try. And if we feel that it is worth opening up a new thread on it, go right ahead. Thanks.

Oaty
02-03-2005, 11:23
It was always my assumption that the odds were figured out by the recruitment costs of what they would cost in a custom battle. Also not all peasants are the same some cost 100 while others cost 120 or 150.

So if you have 5 plain Roman peasants wich would cost 500 total in custom battle and went up against a unit of hastati that cost 500 with it's upgrade the odds would be 1 to 1. Of course even if the A.I was using the peasants, it would probably win due to sheer numbers even though the odds are 1 to 1.

Shadar
03-02-2005, 06:43
Oaty: Peasants are an absolutely horrible example. They got poor morale so all bigger numbers does is increase the chain-routing effect.

Kraxis
03-03-2005, 00:14
I was suprised to see Peasants are equaled to Militia Hoplites... MH will beat them like a stick beating a rug... Easily. ~:confused:

I don't think the odds are perfect, or even close to it. But it does take into account experience of troops and the commander. That is most obvious in naval battles where I have had odds go in my favour with a single understrength Trireme (three star admiral) going up against three full Triremes (and I won clearly).

Simetrical
03-03-2005, 04:42
Militia hoplites aren't equalled to peasants. They're considered five times as powerful.

Anyway, what we really need to do is modify stats to see if they affect the odds. Just comparing units isn't a good idea, because you're basically changing a whole bunch of variables at once.

-Simetrical

Kraxis
03-03-2005, 05:19
Ahh now I see... I was hugely confused by the setup. Couldn't understand how the same units had different odds at times, yet I couldn't see the difference. It lies in the subtle little spaces and kommas.

Oaty
03-13-2005, 06:56
Battle odds also factors in fatigue. plenty of times while on the march and no casualties I'll see the battle odds keep dropping.

But I take it this is for the prebattle odds ration.

yogol
07-24-2005, 14:28
Does anyone has more information on this ?

JeromeGrasdyke
08-17-2005, 12:32
The battle odds are based on the AI's strength calculation for the armies involved. Essentially this is a number derived per unit via a complex formula which takes into account the number of soldiers, attack, defense, experience, upgrades, morale, and almost everything else which gets fed into the game from the export_descr_unit.txt file. This number is also used in many, many other places, although on the battlefield it is replaced with a more sophisticated calculation which matches unit vs unit.

The battle odds are then rounded to something vaguely readable... the system is not perfect (the factors involved in the battlefield mean that it's only ever going to be an approximation) but it gives you an impression of the AI's best guess as to how the armies match up, which you can use as a guide. Ultimately though, the only "accurate" way is to spy on the enemy army to find out its exact composition and make your own judgement about how it measures up against your forces....

dismal
10-24-2005, 16:24
This may be a stupid question, but where is it possible to see the battle odds directly?

I presume the comments "Defeat is a distinct possibility", etc. reflect a certain range of Battle Odds, but it would be useful to observe the raw number.

Red Harvest
10-25-2005, 05:40
This may be a stupid question, but where is it possible to see the battle odds directly?

I presume the comments "Defeat is a distinct possibility", etc. reflect a certain range of Battle Odds, but it would be useful to observe the raw number.

If you hover over the "strength bar" before the battle, you will see the odds in a small display.

dismal
10-25-2005, 17:58
If you hover over the "strength bar" before the battle, you will see the odds in a small display.

Thanks. Any idea how "strength" translates to BattleOdds?

For example, to win "Son of Chinglu" you need BattleOdds of <= 1.5. Presumably this is a reward for winning against long odds.

Does the 1.5 simply translate to a going-in "strength" of 2:3 or worse?

(Keeping in mind that it appears 2:3 may actually be 1.46 with rounding.)

Simetrical
10-27-2005, 03:11
2:3 = 2/3 ≈ 0.67, surely? That's the normal meaning of a colon in this kind of context, to indicate a ratio.

Yukon Cornelius
10-27-2005, 15:11
A 2:3 ratio suggests that the opponent has 3 "combat strength points" for every 2 of yours, so he has 1.5 times your "combat strength." So if you attack someone with a 10:1 ratio, you're 10 times as strong as your opponent. That's how I read it anyway.

Kraxis
10-27-2005, 15:23
Well, if your enemy is having 1.5 times your strength it is equal to you having 2/3 (~0.67) of his...

dismal
10-27-2005, 21:04
2:3 = 2/3 ≈ 0.67, surely? That's the normal meaning of a colon in this kind of context, to indicate a ratio.

Yes, that would seem to make sense, but that would mean you could win the "Son of Chinglu" by winning a battle where the odds were in your favor. Since it's a 100% chance, you'd be winning it all the time.

However, the BattleOdds test was <1.5, so my theory is clearly busted. If 2:3 = 1.5, then 2:4 = 2.0 which is obviously more desperate odds but going in the wrong direction for a "less than test".

I am beginning to come to the conclusion that BattleOdds variable in the VnV tests and the Strength Ratio on the red-blue slider are not the same thing.

I have been carefully noting the stength ratios and initial "possibilities" going into my general/rebel battles and have seen a 1:1 strength ratio translate into any of "defeat is a distinct possibility", "the forces are evenly matched", and "victory is a distinct possibility". This seems to indicate more than rounding is at work.

My theory is that the probability assessment takes into account more factors than the strength ratio. Who is on offense, the terrain, the weather, specific bonuses such as spears v. cav, etc.

Atilius
10-29-2005, 02:43
It's true that 2:3, would indicate that the ratio of your strength to your opponent's strength (0.67), but for the chance of victory you would want something like the ratio of your strength to the total strength of both armies.

If forces are equal (1:1) you have 1/(1+1) = .5 (50%) chance of victory.
For the 2:3 case you have 2/(2+3) = 0.40 (40%)
For the 2:4 case 2/(2+4) = 0.33 (33%).
9:1 = 90%

You get the picture.

Having said that - I doubt it means much. I could make a case that it would be better to use the squares of the numbers above - I'll bet you'd win more than 90% of the battles you fought if your strength was 9 times that of your opponent's. So maybe 2:3 -> 4/(4+9) = 31%. In addition, it's never appeared to me that this ratio took any account of terrain effects which make a big difference in the outcome of a battle.

So, it's probably best not to try to translate this strength ratio directly to the chance for victory - its not clear how to do it exactly and there are qualitative factors to take into account.

dismal
10-31-2005, 23:14
Atilius, just to avoid confusion, let me make it clear that I'm talking about at least 2, maybe 3 different things.

1) The "battle strength" indicator, which appears as a number in "Vegas odds" form (e.g., 1:1, 2:3) when you hold your cursor over the red-blue slider on the scroll before the battle map is entered

2) The "initial probability assessment", which is a phrase like "defeat is a distinct possibility" or "the balance of forces is evenly matched" when you gold your cursor over the red-blue slider during the troop deployment stage.

3) The "BattleOdds" variable, which can be observed in various scripts as a trigger for gaininfg retinues


Trigger trigger_office_son_of_chinglu1
WhenToTest PostBattle
Condition WasAttacker
and IsGeneral
and WonBattle
and BattleSuccess >= clear
and I_ConflictType Normal
and BattleOdds < 1.5
and CultureType hun
and PercentageEnemyKilled >= 51
and not IsFactionLeader
and not IsFactionHeir
and not FactionwideAncillaryExists office_son_of_chinglu1
and Attribute Command >= 4

AcquireAncillary office_son_of_chinglu1 chance 100

After observing various diverging examples of #1 and #2 for the same battle (that is, 1:1 can be anything from "defeat is a distinct possibility" to "vistory is a distinct possibility), I'm convinced that they are separate but related calculations - with #2 likely taking into account more factors related to the specific battle besides raw troop strength.

Exactly what #3 is remains a bit of a mystery. But it seems to be more related to #2 than #1. It wouldn't surprise me if the game calculates "BattleOdds" then translates it to a saying something like "defeat is a distinct possibility" within a certain range.

The one time I won "Son of Chinglu", I started with "Defeat is almost a certainty" and won.

Atilius
11-01-2005, 05:19
dismal,

OK, I guess my comments apply only to the "battle strength" indicator. Got carried away.

The number 1.5 would seem to be favorable to you, as you noted earlier. Did your general have a command value of at least 4 when you failed to win SOC?

dismal
11-01-2005, 19:56
dismal,

The number 1.5 would seem to be favorable to you, as you noted earlier. Did your general have a command value of at least 4 when you failed to win SOC?

I think he probably did at some point. The context of all this was that I was trying to make observations of different variables in my rebel v. general battles to see what made a victory "heroic", so I wasn't paying that much attention to command stars. But a couple of my generals worked up to 8 or so stars during this campaign, so I imagine they had more than a few battles above 4 stars. See thread:

https://forums.totalwar.org/vb/showthread.php?t=55824

Atilius
11-02-2005, 05:56
Here's an entry from the Events, Conditions, and Commands thread by Blitz576 in the Scriptorium (https://forums.totalwar.org/vb/showthread.php?t=43121):

---------------------------------------------------
Identifier: BattleOdds
Trigger requirements: character_record
Parameters: logic token, test value
Sample use: BattleOdds > 5
Description: Test the odds to win i.e. 5 (5:1)
Battle or Strat: Either
Class: BATTLE_ODDS_TEST
Implemented: Yes
Author: Lee
---------------------------------------------------

Which connects the BattleOdds identifier to a ratio - it looks like the larger the number the greater your chance of victory.


Also: from export_desc_character_traits.txt:

;------------------------------------------
Trigger V0090_Standard_Battle_Any_Victory_VnV_Trigger
WhenToTest PostBattle

Condition IsGeneral
and WonBattle
and BattleOdds < 2.25

Affects GoodCommander 1 Chance 100

;------------------------------------------

This indicates that your general has a command trait increase if he wins a battle in which the odds are not too heavily in his favor.

Finally, from the same file:

;------------------------------------------
Trigger V0110_Standard_Risky_Battle_Attacker_Clear_Victory_VnV_Trigger
WhenToTest PostBattle

Condition WasAttacker
and IsGeneral
and WonBattle
and BattleSuccess = crushing
and I_ConflictType Normal
and BattleOdds < 0.5
and BattleOdds > 0.16

Affects GoodRiskyAttacker 1 Chance 100

;------------------------------------------
;------------------------------------------
Trigger V0150_Standard_Risky_Battle_Attacker_Crushing_Victory_VnV_Trigger
WhenToTest PostBattle

Condition WasAttacker
and IsGeneral
and WonBattle
and BattleSuccess = crushing
and I_ConflictType Normal
and BattleOdds <= 0.16

Affects GoodRiskyAttacker 2 Chance 100
Affects TacticalSkill 1 Chance 5

;------------------------------------------

Here your general gets rewarded if he wins a crushing victory in a "risky" battle, which evidently means battle odds of less than 1/2. Note that if the battle odds are less than 1/6, his reward is greater.

I conclude from this that if BattleOdds>1 you have an advantage, so you can win Son of Chinglu if the odds are in your favor. What has prevented you from winning it on the occasions you mentioned earlier, I can't say.

(I should mention that all these examples are from RTW 1.2, but I'd be surprised if they differed from BI.)

dismal
11-02-2005, 18:24
Interesting, if that is a comprehensive list (and it seems to be) of all the triggers, then there are only 2 related to your chances of winning a battle:

BattleOdds and this:


Identifier: I_BattlePlayerAllianceOddsInFavour
Trigger requirements:
Parameters: logic token
Sample use: I_BattlePlayerAllianceOddsInFavour > 5
Description: Odds in favour of the player i.e. 5 (5:1)
Battle or Strat: Battle
Class: BATTLE_PLAYER_ALLIANCE_ODDS_IN_FAVOUR
Implemented: Yes
Author: Scott

BattleOdds is both a strat map and battle map variable, whereas the one above is a battle map only variable.

Perhaps it's the I_BattlePlayerAllianceOddsInFavour variable that tracks the ebbs and flows in odds during the battle (and translates them to the red-blue slider in the battle map).

On the balance, I think you've made a decent case that the BattleOdds variable is driven by the strength rating you get before you enter battle, but I can't help but think it's not as simple as 3:2 = 1.5.

It just hasn't been my experience that you win those sorts of traits/ancillaries on even 1:1 battles, let alone those in your favor.

I think there is an issue of 1.2 versus BI we need to be careful about. I think the developers have acknowledged making it harder to get command stars.

I wonder if there is a hard-coded modifier to the pre-battle strength assessment that is applied before testing for traits and ancillaries. I wouldn't be surprised if this modifier is based in on your difficulty setting. (e.g., on VH it may take a 1:1 strength assessment and multiply it by 2 so you don't qualify on BattleOdds<1.5)

I'm going to have to watch out for a battle that has all the other necessary elements but misses what appears to be a 100% chance. Since I'm playing Saxons, warlord_saxons would make a nice test. If I just have a 4 star non-leader/heir general it will be easy to find a few rebels to beat at 1:1.

Atilius
11-03-2005, 05:47
Dismal,

Concerning differences between 1.2 and BI - I only meant that BattleOdds is unlikely to have changed meaning. Thresholds for awarding traits certainly may have.

You mention that winning traits and ancillaries isn't as easy as the triggers seem to indicate. I think that's because it gets harder to gain each additional Command point. Suppose that your general never loses battles and only fights battles at with BattleOdds < 2.25 so that the
"V0090_Standard_Battle_Any_Victory_VnV_Trigger" always fires. If he starts the game with Command=0, he needs 1 victory to get Command=1 and 2 victories to get Command=2, but 4, 8, and 16 to go to Command=3, 4, and 5.
(These are for RTW 1.2 & 1.3)

The number of battle stars also don't equate directly to Command, since ancillaries influence battle stars on both maps and traits like GoodAttacker and GoodDefender influence them on the battle map. So, getting back to Son of Chinglu, my guess is that the Command >= 4 test refers only to the general's unmodified Command value. In RTW 1.3 this would mean he'd need to have the Great Commander, Legendary Commander, Legendary Warlord, or Military Genius traits.

You might test this by determining if these traits are still valid in BI, if they can apply to the Huns, and find out if there are BI-specific Command=4 traits. Then it's just a matter of checking if the general has the trait before battle.

Better yet, if you're comfortable with a slight mod, change one or more of your characters to have the trait (for example) GoodCommander 4 in desc_strat.txt. Then they will have the trait to start the game and you wouldn't have to check for it. I suppose they could lose it though.... Well, you get the point.

I'd be curious about what you find out.

dismal
11-03-2005, 17:00
Dismal,

Concerning differences between 1.2 and BI - I only meant that BattleOdds is unlikely to have changed meaning. Thresholds for awarding traits certainly may have.

You mention that winning traits and ancillaries isn't as easy as the triggers seem to indicate. I think that's because it gets harder to gain each additional Command point. Suppose that your general never loses battles and only fights battles at with BattleOdds < 2.25 so that the
"V0090_Standard_Battle_Any_Victory_VnV_Trigger" always fires. If he starts the game with Command=0, he needs 1 victory to get Command=1 and 2 victories to get Command=2, but 4, 8, and 16 to go to Command=3, 4, and 5.
(These are for RTW 1.2 & 1.3)

The number of battle stars also don't equate directly to Command, since ancillaries influence battle stars on both maps and traits like GoodAttacker and GoodDefender influence them on the battle map. So, getting back to Son of Chinglu, my guess is that the Command >= 4 test refers only to the general's unmodified Command value. In RTW 1.3 this would mean he'd need to have the Great Commander, Legendary Commander, Legendary Warlord, or Military Genius traits.

You might test this by determining if these traits are still valid in BI, if they can apply to the Huns, and find out if there are BI-specific Command=4 traits. Then it's just a matter of checking if the general has the trait before battle.

Better yet, if you're comfortable with a slight mod, change one or more of your characters to have the trait (for example) GoodCommander 4 in desc_strat.txt. Then they will have the trait to start the game and you wouldn't have to check for it. I suppose they could lose it though.... Well, you get the point.

I'd be curious about what you find out.

I think "natural" (meaning good commander line) 4 command generals are a thing of the past. I still get high star generals - even the occasional ten star - but they are usually from a combo of various ancillaries and other traits.

I'm pretty sure the guy I had who won "Son of Chinglu" was not any more than a Great Commander, if that. I don't believe I've ever made it to Legendary Commander in BI.

I'd also point out that the criteria test is ostensibly applied to the variable "Command", not the variable "GoodCommander".

I suppose you are right that someone with the skills and will could figure all this out by fighting a series of battles with a modded general plus an appropriate enemy, but I'm afraid that isn't me. Maybe when I finish my current campaign I will work on developing my modding skills.

Atilius
11-04-2005, 07:47
I'd also point out that the criteria test is ostensibly applied to the variable "Command", not the variable "GoodCommander".

At game start, this is how you would assign the Great Commander trait.


I suppose you are right that someone with the skills and will could figure all this out by fighting a series of battles with a modded general plus an appropriate enemy, but I'm afraid that isn't me. Maybe when I finish my current campaign I will work on developing my modding skills.

You have the right attitude - I've had RTW for almost a year but have only finished one full campaign: I keep getting irritated by something, doing a mod to change it, and starting over again. May never even get around to buying BI.

dismal
11-07-2005, 17:32
At game start, this is how you would assign the Great Commander trait.

You have the right attitude - I've had RTW for almost a year but have only finished one full campaign: I keep getting irritated by something, doing a mod to change it, and starting over again. May never even get around to buying BI.

Well, I finished my campaign and did a little research.

First, the methodology:

Looked through various factions at start of map trying to find someone I could mod to set up a few tests. Settled upon a character named "Diggiz", who at the start of the game already has 5 stars but is only a GoodCommander 3. Turns out there was no need to mod him after all. Huns make good testers since they have some money and there is no micromanagement to worry about. Just turned off FOW, turned off "watch AI moves", and hit the "new turn" button until an interesting matchup appeared. You can blend in mercs to try to get just the odds you're looking for. Easy enough to re-start the game of re-load from last turn to tweak the parameters some. All test battles were fought with Diggiz plus 0, 1 or 2 merc horse archers. All battles fought on VH/VH.

Second, the executive summary:
- I believe you were correct that the "Strength ratio" in the pre-battle map is equivalent to the variable "BattleOdds".
- The "Son of Chinglu" turns out to be rather easy to win. You can, in fact, win it with a 3:2 strength ratio in your favor. The relative rarity of it stems from needing a 4 star non faction leader/heir general.
- You do not need to have 4 stars from the "GoodCommander" line. Ancillaries and other traits count.
- It is not possible to win more than one "Son of Chinglu" for the huns. Though there is text for ancillaries "Son of Chinglu2" and "Son of Chinglu3", the code was either deliberately or inadvertently written so they can't be awarded when "Son of Chinglu1" is outstanding.

Raw data:

Battle 1
Sarmatians: 91 start, 80 killed
Diggiz: 125 start, 51 killed
Strength ratio: 1:1
Initial assement: Even match
Victory type: Clear
Won Chinglu: Yes
Conclusion: Don't need 4 star in Good Commander line to win Chinglu, can win it with even odds.

Battle 2
Rebels: 375 start, 370 killed
Diggiz: 135 start, 42 killed
Strength ratio: 3:5
Initial assement: Defeat distinct
Victory type: Heroic
Won Chinglu: Yes
Conclusion:

Battle 3
Rebels: 157 start, 157 killed
Diggiz: 135 start, 0 killed
Strength ratio: 10:3
Initial assement: Forgot to look
Victory type: Clear
Won Chinglu: No* (already had won it plus passed it off)
Conclusion: Proves a "perfect 100-0 victory" does not guarantee "Heroic" (relevant to another thread)

Battle 4
Rebels: 495 start, 479 killed
Diggiz: 135 start, 15 killed
Strength ratio: 3:4
Initial assement: Defeat distinct
Victory type: Heroic
Won Chinglu: No* (already had won it plus passed it off)
Conclusion: Can't win more than one Chinglu

Battle 5
Sassanids: 307 start, 257 killed
Diggiz: 135 start, 0 killed
Strength ratio: 2:1
Initial assement: Evenly matched
Victory type: Clear
Won Chinglu: No
Conclusion: Chinglu not won w/ Strength Ratio>1.5. Strength ratio = BattleOdds?

Battle 6
Sassanids: 307 start, 258 killed
Diggiz: 81 start, 2 killed
Strength ratio: 3:2
Initial assement: Evenly matched
Victory type: Clear
Won Chinglu: Yes
Conclusion: Chinglu can be won with strength ratio in your favor and as high as 1.5. More evidence that Strength = BattleOdds.

Atilius
11-09-2005, 01:54
dismal,

You've pretty comprehensively demonstrated the strength ratio/battleOdds connection, that a Heroic victory requires more that just killing all the enemy without any losses of your own, and the Son of Chinglu stuff.

The last item provides a nice illustration of how of the event triggers work.

Anyway, you've put paid to the discussion we've been having about these topics, so I went back to the first real post in this thread:


I wonder if someone could research the factors that determine the strategy map battle odds? I imagine things like number and quality of men, upgrades, commander, and so on.

This seems to be important for getting traits, whether the AI will fight, etc.

I'm planning to look at the effect of a commander's battle stars on battleOdds. Anyone's welcome to scoop me.

dismal
11-09-2005, 16:28
dismal,

You've pretty comprehensively demonstrated the strength ratio/battleOdds connection, that a Heroic victory requires more that just killing all the enemy without any losses of your own, and the Son of Chinglu stuff.

Yep, a lot of this started in my effort to figure out what generated a Heroic victory. The "chinglu" thing was a bit of a diversion, but at least its 100% chance factor helps give a little clarity into a few game variables.

I need to go back and revisit the "Heroic" victory question. I can't help but wonder if it's as simple as BattleOdds (= strength ratio) <1 combined with some minimum percentage of enemy killed and some maximum percentage of allies killed.


I'm planning to look at the effect of a commander's battle stars on battleOdds. Anyone's welcome to scoop me.

You could quickly generate some data using something like the approach I used above.

1) Start new campaign w/ fow and AI moves off
2) Take a general and move him within one turn of a battle.
3) Save game
4) Initiate battle, check odds
5) Quit and Reload saved game
6) Mod general's command up/down
7) Repeat beginning at step 4

The added benefit here is you don't actually have to fight the battles.

Atilius
11-15-2005, 08:40
OK,

I got around to looking at how a general's battle stars affect the strength ratio/battleOdds you see on the strength bar before combat. The results are not as I'd expected.

I'm running RTW 1.3. To start, I set up a couple of small armies (2 units of hastati, no experience, no upgrades) with a Roman general. The generals each have only the Confident commander trait and no ancillaries, so each has one star. The strength ratio is 1:1 - no surprise.

Next, I remove the the GoodCommander trait from the defending general. Odds are 1:1, but this could skewed by the presence of the opposing forces' bodyguard units, so I give each army 19 hastati to dilute the effect of the bodyguards. Odds are still 1:1.

I give the attacking general the Legendary Commander trait (5 stars), defending general still has no stars. Odds are 1:1.

I give the attacking general the Heroic Attacker trait too, so he has a total of 10 stars when attacking. Odds are 1:1.

Finally I give the defending general the Pathetic Commander (-5) and Pathetic Defender (-5) traits. I'm pretty sure that these only subtract from command stars that the general may have gotten from other traits or ancillaries, but I do it anyway. Odds are 1:1.

Also reversed the situation, giving the attacker penalties (Pathetic Commander, Pathetic Attacker) and the defender bonuses ( Legendary Commander, Heroic Defender), but odds are always 1:1.

So it's clear that the calculation of battleOdds takes no account of the opposing commanders' battle stars. I believe the main effect of battle stars is to raise the morale of the general's army, so Jerome's comment earlier in this thread:


The battle odds are based on the AI's strength calculation for the armies involved. Essentially this is a number derived per unit via a complex formula which takes into account the number of soldiers, attack, defense, experience, upgrades, morale, and almost everything else which gets fed into the game from the export_descr_unit.txt file.

must refer to the unit's un-modified (dismal, here I go with the un-modified thing again) morale value (from export_descr_unit.txt ) and not to any morale bonuses gained from the general's battle stars.

dismal
11-15-2005, 20:56
I guess I'm not completely surprised that command ranking doesn't affect battle odds.

Since you rasied the topic, I had noticed that clicking the "night battle" option (when available) didn't change the battle odds despite increasing the general's command stars.

Atilius
11-24-2005, 07:11
I spent some time investigating how unit experience influences battle odds.

I have two armies, each consisting of 20 units of hastati. At first I vary the experience of the attacker ( note exp 1 = 1 bronze chevron, exp 4 = 1 silver
chevron and so on):

Attacker Exp Defender Exp Battle Odds
0...................0 ............. 1:1
1...................0 ............. 6:5
2...................0 ............. 6:5
3...................0 ............. 6:5
4...................0 ............. 7:5
5...................0 ............. 7:5
6...................0 ............. 7:5
7...................0 ............. 8:5
8...................0 ............. 8:5
9...................0 ............. 9:5

Reverse the experience values just to make sure odds reverse also:

0...................9 ............. 5:9

It looks like we are getting some round off, but taking this into account it appears that a unit becomes ~10% more effective for each additional level of experience.

If this is the case then if one army has experience 8 and the other 4, we'd expect the odds to be 1.8:1.4 (9:7). If I try this I find the odds are actually 9:8. Rounding? If I try exp 9 and exp 4 I'd expect 1.9:1.4 (9.5:7), I actually get 9:7.

Anyway, this seems to indicate that the ~10% incease per experience level (perhaps slightly less) is approximately correct.

I did one other check on this: How many exp 9 units does it take to make an even match for 20 exp 0 units? If the above is correct, the answer should be 20/1.9 which is slightly closer to 11 than to 10. If I set up a battle with 11 exp 9 units against 20 exp 0 units, I get battle odds of 1:1.

So a good rule of thumb is that each level of experience increases the unit's effectiveness by 10% of the strength of a 0 experience unit.

Atilius
11-30-2005, 08:04
I was looking for something useful to do this evening, but decided instead to have a look at the effect of armor on battle odds.

Setup: RTW 1.3, two armies of 20 hastati each.

Possible armor values (AV) are:
0 (no shield),
1 (bronze shield),
2 (silver shield),
3 (gold shield)

Results:

Attacker AV Defender AV Battle Odds
0 ............... 0 .................... 1:1
1 ............... 0 .................... 6:5
2 ............... 0 .................... 7:5
3 ............... 0 .................... 8:5

I also reversed the AVs (attacker AV 0, defender AV 1,2,3 ) and got reversed odds as you'd expect.

These numbers indicate that each armor upgrade increases the effectiveness of the unit by about 20% of the effectiveness of an AV 0 unit - at least to the battle odds calculator.

I ran another test to check this conclusion. If the above statement is true then how many AV 3 units are required to balance 20 AV 0 units? The answer should be 20 * 1.0 / (1.0 + 3 * 0.2 ) = 20 /1.6 = 12.5.

# AV 3 units # AV 0 units Battle Odds
11 ............... 20 .................... 4:5
12 ............... 20 .................... 1:1
13 ............... 20 .................... 1:1
14 ............... 20 .................... 6:5

SO: each armor upgrade increases the effectiveness of the unit by about 20% of the effectiveness of an AV 0 unit.

magnum
12-01-2005, 20:55
Any chance that you could run the same test(s) with different attack/defensive values than the Hastiti does? Wondering if its 20% or if the calculation is actualling feeding in the numbers, in which case a lower defense the armor upgrade would be more than 20%, a higher defense the armor upgrade would be less than 20%.

Atilius
12-03-2005, 06:51
Magnum,

You are correct. The unit's effectiveness appears to be proportional to the armor modifier plus unit's raw armor value.

Here are the results for Hastati previously posted.

Attacker AV Defender AV Battle Odds
0 .................. 0 ....................... 1:1
1 .................. 0 ....................... 6:5
2 .................. 0 ....................... 7:5
3 .................. 0 ....................... 8:5

As I concluded before, these results are consistent with adding 20% effectiveness per armor upgrade:

1.2:1 = 6:5
1.4:1 = 7:5
1.6:1 = 8:5

However, the base armor value for hastati is 5, so these results are also consistent with adding 1 to the base armor value for each armor upgrade:

(5+1):5 = 6:5
(5+2):5 = 7:5
(5+3):5 = 8:5

So I experimented with armored hoplites, which have a much higher armor value (11):

Attacker AB Defender AB Battle Odds
0 .................. 0 ....................... 1:1
1 .................. 0 ....................... 1:1
2 .................. 0 ....................... 1:1
3 .................. 0 ....................... 1:1

where AB is the Armor Bonus due to upgrades

These results come nowhere near my earlier 20% per upgrade rule.

With +1 per level we would have expected:
(11+1):11 = 1.09:1
(11+2):11 = 1.18:1
(11+3):11 = 1.27:1

The raw numbers look strange, but I could tell that the units with the armor bonus were getting more effective by the kill ratios I got when I autoresolved the battles. It's simply that the base armor value is high enough that the +1 bonus for each upgrade doesn't have much of an effect (as you speculated).
Throw in the rounding that's necessary to get a ratio of integers and these results are reasonable.

Next I tried the finding the number of AB 3 units required to match 10 AB 0 units: this should be 10 * 11/(11+3) or roughly 7.8.

# AB 3 # AB 0 Battle Odds
6 .................. 10 ....................... 4:5
7 .................. 10 ....................... 1:1
8 .................. 10 ....................... 1:1
9 .................. 10 ....................... 7:6

Which is just about right. My 20% rule would have predicted 6.25 which is clearly wrong.

I also used Principes (base armor value 7) as an intermediate case.

Attacker AB Defender AB Battle Odds Expect(+1) Expect(+20%)
0 .................. 0 ....................... 1:1 ......... 1:1 .......... 1:1
1 .................. 0 ....................... 7:6 ......... 6.9:6 ......... 7.2:6
2 .................. 0 ....................... 4:3 ......... 3.9:3 ......... 4.2:3
3 .................. 0 ....................... 3:2 ......... 2.9:2 ......... 3.2:2

Both rules do a good job here, but the +1 rule is a bit better.

And finally, how many +3 Principes are needed to match 20 plain ones?
The +1 rule says 20 * 7/(7+3) = 14, the +20% rule predicts 20/1.6 = 12.5:

# AB 3 # AB 0 Battle Odds
12 .................. 20 ....................... 5:6
13 .................. 20 ....................... 1:1
14 .................. 20 ....................... 1:1
15 .................. 20 ....................... 7:6

The +1 rule wins again.

A note of caution:
I also tried this with mercenary bastarnae (armor value 2) and it didn't work at all. The upgrades hardly increased their battle odds at all. These guys are running around with metal helmets and almost nothing else, but are upgradable by a blacksmith. It may be that the battle odds calculator knows somehow that, while their heads are a bit safer, the rest of them isn't any better off.

But it seems that a good rule of thumb for the effectiveness of a unit with upgraded armor is proportional to the modified armor value (base value + bonus) divided by the base armor value.

This rule of thumb probably only applies to fairly well-armored units.

This was an excellent suggestion Magnum. I'll look into the weapon bonus issue with this same general approach in mind, and revisit the experience bonus in light of this.