Total War: ATTILA

Total War: ATTILA

246 ratings
The Obscure mechanics of Attila.
By WalrusJones
This guide is a rough infodump of the reletively obscure/unknown mechanics of Attila Total War, and how you can change them.
2
3
   
Award
Favorite
Favorited
Unfavorite
Melee Accuracy and Charges
The Base accuracy of all attacks is 40%. Melee attack, Bonus Versus, and charge bonus add one percentage point to this value. Melee defense subtracts one to this value. (Charge bonus also adds to the units melee damage.)

Attack accuracy cannot go below 15%, or above 85%.
In KV rules, these values are Melee_hit_chance_base, Melee_hit_chance_min, and Melee_hit_chance_max.

Melee hit chance is entirely based in arithmetic with a few caps added on. In the vanilla game, the charge bonus of most units can be expected to cap accuracy in nearly every engagement.

Charges:
Charges boost the units weapon damage, and accuracy, as stated above.
They last for 15 seconds in the base game, as determined by Charge_cool_down_time, in KV_rules.

The timer for Charge_cool_down_time starts ticking when the unit enters an animation state called "Charge_Adopt_Pose" which can be set in battle_entities_table. The further away you have a unit adopt their charge pose, the more likely they will successfully deliver a charge when intercepted or caught, but this gives the unit less time to deal charge bonus in an ideal charge scenario.
Armor
Armor blocks a random amount of damage, from 0, to the armors value. On average, you can assume armor will block a third of its value (For some reason.)
  • AP damage ALWAYS bypasses armor, and generally should be set to values where you never expect armor scores to actually trigger AP damage, however, due to the RNG nature of the game, armor may randomly decide to block 100% of the enemies damage for 83% or the battle when you set AP to 0. Having no AP makes battles get wildly unpredictable when armor scores are even remotely close to being as high as the enemies damage score.

  • Bonus VS Infantry or Cavalry also bypasses armor when the bonus is applicable.

Armor_piercing_divisor, and armor_penetrating_divisor, KV_rules values, are used to divide the enemies armor score when enabled on a melee_weapon. This is not used int the base game.

When regarding missiles, it seems whether the Missile_Armor_Penetrating_Coefficent, or Missile_Armor_Piercing_Coefficient (KV_Rules) is used as a multiplier is actually determined by the Unit_armor_Types. By default, the Missile_Armor_Piercing_Coefficient is used against most armors. If bonus versus missiles is checked on the Unit_armor_type entity, the full armor value is used, if weakness versus missiles is checked, missile_armor_penetrating_coefficient is used.

  • This is used to offset certain KV_Rules values that cause missiles to experience damage falloff. There is a lot of them, and I haven't tested them all.
  • One governs shots that hit targets past the missiles maximum range, as determined by the missile table. Arrows that hit past 150 meters (Or 200 for the longbow,) should do 1/5th less damage.

Shield armor is always half as effective against missiles, to counterbalance missile block chance. This can be changed with the variable "Missile_Shield_Piercing_Coefficient." A KV_Rules value.
Missile Weapon Accuracy
Missile Weapon Accuracy is determined by several factors: Velocity (Faster shots hit more often,) An unseen "Base Spread" value, Accuracy Skill+Weapon Accuracy Skill Bonus (Reduces the Base spread,) and by introducing some fixed spread.

  • In baseline Attila, the high velocity of Slings and Crossbows make them the most accurate missile weapons. The faster the projectile flies, the easier time your men will have in hitting the enemy unit.
  • All accuracy scores are 0 (Unit Accuracy Skill,) + 5 (Weapon Accuracy Bonus.)
  • Unit Accuracy Skill is on the Land_Units_Table, Weapon_Accuracy_Bonus (PFM marks it as a "marksmanship_bonus,") can be found on Projectiles_table.
  • Accuracy Scores of above 100 do not seem to become more accurate then 100%.
  • The Spread score found on Projectiles_table creates some inaccuracy that the unit cannot bring down through its accuracy skill. Seems to be the base dispersion in meters. (More testing needed.)
  • Accuracy skill takes a 20% penalty when firing on targets in cover. This is determined by missile_target_in_cover_penalty in KV_Rules
  • There are accuracy multipliers for all weather effects.
  • Shockwave radius can be used to make missiles stagger or knockdown enemy units. This can be found in the Projectiles_Table. A value of 0.05 will reliably stagger medium infantry, so be careful!
  • Missile_saving_bonus is the base chance that a missile that hits a target will miss. This is to account for the chance of a shot passing between someones legs, or past their head. Its a KV_Rules value, and it is set to 20 in the base game.
  • Missile units will choose to aim at a random point within a 2 meter radius of the center of the enemies unit. This is based on "Projectile_Target_Calibration_area," in KV rules.
Where you can find unit Movement Values.
Units Base speeds (Charge, Walk, Run, "Crawl") are all found in the Battle_Entities_table.
It is also home to the values regarding the base health, mass, and charge distances of units.

The KV_Rules value "Pike_Move_Speed_modifier" is used to multiply the walk speed of units that are in any mobile infantry formation, be it shield wall, pike phalanx, or mobile testudo.

The Battle_entites value "Tracking_Threshold" determines how cohesive units within a certain weight class will try to be when making movements on the battle field. This is disabled when a unit is charging it seems.
Impact damage
Impact damage:

The formula for impact damage is (((((BracingX(Mass/100))XSpeed))-((BracingX(EnemiesMass/100))XSpeed))^Collison_Damage_Normalizer)*Collison_Damage_Multiplier+Collison_Damage_Default

(Big formula, right?)

Collision_Damage_Normalizer, Collision_Damage_Multiplier, and Collision_Damage_Default are all KV rules value.
Collision_Damage_Normalizer=1.5 in the base game
Collision_Damage_Multiplier=2 in the base game
Collison_Damage_Default=20 in the base game.

This makes the base impact damage expodential damage that can easily reach into the thousands.
It cannot be blocked by anything except having enough bracing force to deflect the enemy charge.

Half of all collision damage is AP, by default.

Bracing is always 1 when the unit hasn't stood still for about 2 seconds. Bracing is never used when a unit is getting hit with a flanking charge.
The strength of bracing can be determined in KV_rules, which allows players to set at how many ranks does the unit get the most bracing per rank, what the maximum bracing per rank is, and what the maximum mass multiplier one can get from any number of bracing factors.

Charge reflectors get 4X mass from bracing when hit from the front, and standing still. (KV_Rules.)

Mass bonuses from unit abilities are all bracing, so stand still, and get hit from the front!

Cavalry is immune to impact damage in the base game. This can be changed in KV rules. (Collision_damage_exclude_large_entities.)

Proof regarding cavalries impact damage immunity.


Flanking mechanics
Individuals from a unit that are attacking the side of the enemy unit only have to deal with half their melee defense.
Individuals attacking the rear of an enemy unit face no melee defense.
This is determined by KV rules values "Melee_Defense_Coefficient_Flank/Rear."

Factor_Attack_Dir_Front/Left/Right/Rear (KV_rules,) Sets the percentage probability that an enemy attack will be ignored, and replaced with one of your attacks by individuals who are flanking. Roughly, the enemy will only attack 14% of the time when looking at individuals who have wrapped around to the rear of their own unit.

Effectively, one man who wraps around is 7.14 to 9.6 times as effective as one who slams into the front of an enemy unit. Having 3 men of wrap around is like having a unit size that is twenty men higher then that of the enemy.
The unused first strike mechanic
An unused innitiative value found in melee_weapons_table. Each point of it gives your unit what is roughly a strong chance to replace one of the enemies attacks with one of their own, in all scnearios.

In Rome II, this variable would supposedly shift the attack ratio by 1/25, in Atilla, my testing showed it had a greater effect, to the point that it was almost unusable.
71 Comments
Grimley Khan Sep 22, 2022 @ 11:34pm 
Yeah fair enough, it'd have to be something like that (a little spreadsheet I've done seems to make sense if it was 1 but that's without testing to back it up). And no worries either, you've done great work here and thanks for such a quick reply! Will continue making some tweaks to see what happens
WalrusJones  [author] Sep 22, 2022 @ 11:17pm 
Back then I generally assumed there had to be a floor to this formula (As otherwise we would see so many splatterkills even with weak charge formulas,) either that or the bracing modifier was being applied as "Speed".

Other groups have furthered knowledge of Attila's mechanics in recent years as well and its been a long time since i wrote this, so my experience with this information is much more faint then it was back then.

The big thing is that all my notes are gone since I have gone through several computers since then, so without any test data I can't exactly reread my best examples of working these things out (Even if I have made a few mods to exaggerate and properly demonstrate a few of these values.)
Grimley Khan Sep 22, 2022 @ 10:51pm 
Hi WalrusJones, thanks for the guide, been really helpful/interesting to look into some of these mechanics. Just looking at the impact damage formula, would the speed of a unit standing still be a value of 1? If it was zero, and if my maths is correct, then mass and bracing would have no effect? Unless this is where crawl speed enters the equation? (wild guess as I'm not sure what crawl speed is). Thanks for the help
WitcherHammer Sep 10, 2022 @ 5:43am 
I think that in latest TW titles there is also a problem with "cancelling" this effect:
https://forums.totalwar.com/discussion/266660/charge-defense
My units sometimes annihilated by charging cavalry from the front because of no bracing or ECDefense if my unit is already fighting in melee
WalrusJones  [author] Sep 9, 2022 @ 7:54am 
One is charge damage, one is charge mass.

Pikes and spears were slightly different, and this is part of why pikes could be oddly effective.
WitcherHammer Sep 9, 2022 @ 4:02am 
Hi thx for the guide. Is it possible to modify "expert charge defence" somehow? You said that "Charge reflectors get 4X mass from bracing when hit from the front, and standing still."
But ECDefense also should "reflect" damage....
BloodyViper Jun 22, 2022 @ 6:54pm 
That clears things up.

Thanks a lot! I will put the info to good use.
WalrusJones  [author] Jun 22, 2022 @ 6:38pm 
Technically you could shift the base damage too but that becomes a but why tho.
WalrusJones  [author] Jun 22, 2022 @ 6:37pm 
Two values affect the on impact, collision damage normalizer is a polynomial factor applied to the impact damage. Collision damage multiplier is a flat multiplier to the impact damage solution.

Both can be modified to alter the initial damage.

**However,** the base normalizer in attilla I remember being 2, which results in many instances impact damage being a one shot kill because mass differences between the units are treated as polynomial differences.
However, the unit numbers don't report accurate kill counts until the knock down animation finishes playing. So it appears that very few people die on the initial charge and then die in a giant burst over a few seeconds as their various knockdown animations play.


Basically, everyone died the first second, but it took 10 seconds for the kills to register from the unit animations wrapping up.
BloodyViper Jun 22, 2022 @ 6:27pm 
Excellent guide! And very infomative.
I'm a bit confused about the impact damage though. Say i want to make cav charges stronger on impact but weaker after impact, what values do i have to adjust? I did some testing with your Impact Damage Isolated mod and found out the cav keeps killing for a whole 10 seconds after they charged in.

One last thing I don't quite understand, what is a Normalizer?

I'm still new to modding so i would really appreciate the help!