Jump to content
Game-Labs Forum

Firearms and Accuracy Formula


Wandering1

Recommended Posts

A thought that might be quickly answered by someone whose been around longer than me: do Firearms and Accuracy combine for a final accuracy total of an infantry volley? Or average?

The reason why the idle thought has come up is the question of how the 2* bonuses actually work out, whether the Accuracy boost or penalty is additive or multiplicative. If it's additive, then the 10 accuracy guns going up to 20 would basically double your ammo efficiency if Firearms and Accuracy average to a final accuracy result. Problem with this is that said 10 accuracy guns would go to 0 accuracy if you take the reload bonus, which incurs a -10 accuracy. If it is multiplicative, then 10% accuracy on a 10 accuracy gun is basically nothing. Even for the higher accuracy guns, it only adds maybe 4-6 additional accuracy, which is a drop in the water compared to -10% reload.

 

  • Like 1
Link to comment
Share on other sites

I, too, would love to see some formula behind how these work (and also as to whether Firearms affects Reloading as well as Accuracy). Also consider that a Reload penalty on slow guns would be lesser than someone using a Henry. An alternate interpretation is that the accuracy/reload penalties from those skills could actually apply to the final combined accuracy/reload number from Firearms+gun stat.

Link to comment
Share on other sites

Also, since infantry brigade ranges are normalized, range factors into this too - presumably weapons with longer range get some kind of accuracy bonus. I suspect that Firearms does not affect reloading speed, but Efficiency affects both based on the tooltip.

  • Like 1
Link to comment
Share on other sites

37 minutes ago, Aetius said:

Also, since infantry brigade ranges are normalized, range factors into this too - presumably weapons with longer range get some kind of accuracy bonus. I suspect that Firearms does not affect reloading speed, but Efficiency affects both based on the tooltip.

Presumably, I tend to think that rather, weapons with longer range incur drop-off penalties farther out than the weapons with shorter range. What that drop-off penalty is, and if it is linear or not, is a different question.

Link to comment
Share on other sites

10 hours ago, Wandering1 said:

There is a flip side to the faster reload: you'll generally take fewer casualties if the enemy routs quicker, because the enemy is allowed fewer barrages.

You're trading ammo efficiency for fewer casualties and getting the same job done is less time, basically.

You're not factoring in the +accuracy, it's not straightforward. You have to simulate out whether +accuracy let you accomplish it in less volleys and save you a volley and was worth more/less vs getting another volley out faster over the course of the combat.

Link to comment
Share on other sites

 

13 hours ago, Hitorishizuka said:

You're not factoring in the +accuracy, it's not straightforward. You have to simulate out whether +accuracy let you accomplish it in less volleys and save you a volley and was worth more/less vs getting another volley out faster over the course of the combat.

Well, let's put it this way, doing a few simplifications:

500 Morale Damage (barring any morale regeneration, because that's really just a constant factor over time)

w/o Bonuses from the Rank 2 Perks

100 Morale Damage, Standard Reload, Standard Accuracy, so 5 volleys.

w/ Marksman

110 Morale Damage, 1.1 Reload Time, 1.1 Accuracy. Still 5 volleys, at 5.5 reloads.

w/ Firearms

90 Morale Damage, 0.9 Reload Time, 0.9 Accuracy. 6 Volleys (total 540 damage), at 5.4 reloads.

The benefit of both regardless is that you have buffer room for the morale regeneration, whereas without the perk if the multiple is not exact, you have to go into the 6th volley. This does basically assume that the reload and accuracy buff are multiplicative, I'm just using the accuracy to adjust the amount of morale damage you're doing (not actual casualties, because Morale damage is what you care about for causing routs).

  • Like 2
Link to comment
Share on other sites

Nice math, Wandering: 

Personally, because ammo is a factor, i think marksmanship is the way to go. 

The X factor, to me, is how many more dead guys are laying on the ground after 5 volleys with Marksmanship? Surely that would impact morale, no? Would for the dead guys. 

But, a sixth volley in the span of five volleys? Shades of the Thin Red Line. That'll break units too. 

Personally, I use two types of elite unit builds. About 60% follow the morale/marksmanship path, about 40% follow the Stamina/Melee path. And I build elite brigades with a bit o' both and try to micro my infantry lines where each unit is put in position its best suited.  But, push come to shove, I want Morale and Marksmanship. 

 

Edited by Andre Bolkonsky
  • Like 1
Link to comment
Share on other sites

10 minutes ago, Andre Bolkonsky said:

Nice math, Wandering: 

Personally, because ammo is a factor, i think marksmanship is the way to go. 

The X factor, to me, is how many more dead guys are laying on the ground after 5 volleys? Surely that would impact morale, no? Would for the dead guys. 

 

If you're stuck in long engagements without any chance of resupply, it is a factor in the decision making, which is why I said you're exchanging ammo efficiency for time. This becomes far more noticeable in terms of time benefits as you increase the amount of time in combat. E.g. for 11 volleys with marksman, which comes out to about 12.1 reloads and 1210 morale damage in the example above, the same amount of time roughly you would either get 13 volleys or 14 volleys (11.7 or 12.6, using the methodology above) for the reload bonus, for a total of 1170 or 1260. The benefit of smaller damage volleys, in this case, is that you possibly can get less wastage if you already routed one squad and need to start shooting the next squad (whereas the longer reload means you cannot switch targets as quickly or as efficiently).

As far as kills, I imagine that factors into the total amount of morale damage at the end. Killing 300 guys in a 1000 man squad is a lot more damaging to morale than 300 guys of a 2500-3000 man squad. That was one of the simplifications I made to make sure we aren't going on odds and ends over corner cases on unit sizes.

Edit: Also as another little corner case thing if we really want to get down to it, more volleys means more incidental kills if you're shooting into a huge blob of units/artillery. From personal experience, incidental kills usually come about to 1-2 guys per squad close by, which doesn't change too much in the grand scheme of things, but something to consider when you got a huge blob of infantry blocking your shots to the artillery that's canistering you behind them.

Edited by Wandering1
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I would like to know how the range of different weapons factors in to the calculations and the hit percentage? A big part of this game is purchasing weapon upgrades either with rep or gold and with all ranges for infantry normalised what is the effective difference between a unit armed with Fayetteville rifles versus equipping them with farmers. Ok Fayetteville's have much higher accuracy but farmers have higher damage. Also what difference does the damage rating make, does this make a difference to scoring kills against units in cover or fortifications? I have just so many questions about the mechanics behind the scenes.

Edited by waldopbarnstormer
Spelling
Link to comment
Share on other sites

I suspect it works something like this:

Damage = (number of hits) * (weapon damage) * (cover/terrain factors?) * (range factors?)

number of hits = (number of shooters) * (firearms skill factor) * (range factor) * (accuracy factor) * (efficiency factor?) * (cover/terrain factors?) * (condition/morale factors?) * (some element of luck)

So while the Farmers may do 18 damage, they get far fewer hits due to their steeper range drop-off and low accuracy. We don't know how much damage it takes to get one kill, or even if the damage is distributed directly against the unit hit point pool (18 damage * 100 hits = -1800 hit points, at 20 damage per kill that would 90 kills) or if the damage is applied on a per-man basis (if it take 20 damage for one kill, one hit does 18 damage and the second hit does the last 2 damage, with the other 16 damage wasted).

  • Like 1
Link to comment
Share on other sites

26 minutes ago, Aetius said:

I suspect it works something like this:

Damage = (number of hits) * (weapon damage) * (cover/terrain factors?) * (range factors?)

number of hits = (number of shooters) * (firearms skill factor) * (range factor) * (accuracy factor) * (efficiency factor?) * (cover/terrain factors?) * (condition/morale factors?) * (some element of luck)

So while the Farmers may do 18 damage, they get far fewer hits due to their steeper range drop-off and low accuracy. We don't know how much damage it takes to get one kill, or even if the damage is distributed directly against the unit hit point pool (18 damage * 100 hits = -1800 hit points, at 20 damage per kill that would 90 kills) or if the damage is applied on a per-man basis (if it take 20 damage for one kill, one hit does 18 damage and the second hit does the last 2 damage, with the other 16 damage wasted).

Very well reasoned. If only Darth would chime in with the real algorithm. 

  • Like 1
Link to comment
Share on other sites

19 minutes ago, Andre Bolkonsky said:

Can't blame him for not wanting to share state secrets. 

Well. He might not want to share state secrets, but apparently log files are still getting written out into the steam folder.

This doesn't quite point to the exact formulas that we're looking for, but here's an example of something that might interest everyone:

North Adapt historical size Howard HP:1250 ->785.5307
North Howard c: 0.6692242 =aiAverage/playerAverage*aiArmyBonus 785/(782*1.5) Cdiff:1.181818 aiTotal/playerTotal: 13/11 kindDiff: 1 aiKindTotal/playerKindTotal: 7/7
North Update Howard HP:1250 adapted:785.5307 to 1446.624 coeff:0.7097833 diff:1.25 crossEffect:0 rand:0.05712795 Clamp01(average*(countDiff+kindDiff*2)/3): 0.6692242*(1.181818+1*2)/3=0.7097833
North Update Howard initial eff:20.5 st:26.9584 mo:25.19649 me:31.79353 f:26.88509
North Update Howard attributes coeff:1 bonus:1.813138 eff:37.16933 st:48.87931 mo:45.68472 me:57.64606 f:48.74639
North Weapon update Howard musket_US_1842_69_SB|11 new:musket_1842_Palmetto_SB|13 coeff:0.9090909

This is for data on my legendary run at Newport News. So you can see they nearly have double stats from normal.

  • Like 2
Link to comment
Share on other sites

 

7 hours ago, Wandering1 said:

Well. He might not want to share state secrets, but apparently log files are still getting written out into the steam folder.

This doesn't quite point to the exact formulas that we're looking for, but here's an example of something that might interest everyone:

North Adapt historical size Howard HP:1250 ->785.5307
North Howard c: 0.6692242 =aiAverage/playerAverage*aiArmyBonus 785/(782*1.5) Cdiff:1.181818 aiTotal/playerTotal: 13/11 kindDiff: 1 aiKindTotal/playerKindTotal: 7/7
North Update Howard HP:1250 adapted:785.5307 to 1446.624 coeff:0.7097833 diff:1.25 crossEffect:0 rand:0.05712795 Clamp01(average*(countDiff+kindDiff*2)/3): 0.6692242*(1.181818+1*2)/3=0.7097833
North Update Howard initial eff:20.5 st:26.9584 mo:25.19649 me:31.79353 f:26.88509
North Update Howard attributes coeff:1 bonus:1.813138 eff:37.16933 st:48.87931 mo:45.68472 me:57.64606 f:48.74639
North Weapon update Howard musket_US_1842_69_SB|11 new:musket_1842_Palmetto_SB|13 coeff:0.9090909

This is for data on my legendary run at Newport News. So you can see they nearly have double stats from normal.

I don't read code but in plain English I see:

Efficiency 20.5 becomes 37.17

Strength 26.96 becomes 48.88

Morale 25.20 becomes 45.68

Melee 31.79 becomes 57.64

Firearms 26.89 becomes 48.75

It's multiplying everything by a 1.81 coefficient on legendary. Thank you for this, Wandering1! This is interesting and it would be nice to adjust this coefficient at will. What's the coefficient on Major General mode? I wonder why they chose such a seemingly random value. 

I started a campaign on Legendary for Union and it's not very fun. 600 rebels in a fortification can easily repel a 2500 man charge at 1st Bull Run. It's beyond implausible and only the most obsessive player will achieve desirable results. 

  • Like 2
Link to comment
Share on other sites

23 minutes ago, GeneralPITA said:

 

I don't read code but in plain English I see:

Efficiency 20.5 becomes 37.17

Strength 26.96 becomes 48.88

Morale 25.20 becomes 45.68

Melee 31.79 becomes 57.64

Firearms 26.89 becomes 48.75

It's multiplying everything by a 1.81 coefficient on legendary. Thank you for this, Wandering1! This is interesting and it would be nice to adjust this coefficient at will. What's the coefficient on Major General mode? I wonder why they chose such a seemingly random value. 

I started a campaign on Legendary for Union and it's not very fun. 600 rebels in a fortification can easily repel a 2500 man charge at 1st Bull Run. It's beyond implausible and only the most obsessive player will achieve desirable results. 

There's more to the options in the log output. I just didn't post it here, as I tend to think that crosses into 'likely to get censored if the dev doesn't want us to know all the little secrets in the open'.

In particular for the 1.81 coefficient, this is tied to a scenario level difficulty setting, to my interpretation of the log file.

One little thing in particular that bugged me, but I only noticed this when the computer has 100 melee skirmishers: it is better for morale damage if you have 2 1000 man squads rather than 1 2500 man squad. The second squad is considered to be 'flanking' the first squad being melee'd, and morale drops like a rock. I saw this used on me when the computer had 2 500 man 3* skirmisher squads with JF Browns charging my one full-strength melee cav squad that was 2*. The melee cav squad lost.

Edit: St is stamina, by the way.

Edited by Wandering1
Link to comment
Share on other sites

4 minutes ago, Wandering1 said:

Edit: St is stamina, by the way.

Derp...oh yea.

Your discretion is probably wise. Thanks for the glimpse.

I've spammed a charge with 50 skirmishers at Malvern Hill and it's pretty darn effective. What you say is true about charging with smaller brigades. 

Link to comment
Share on other sites

Just now, GeneralPITA said:

I noticed there's no accuracy statistic above. How does it factor in?

The log output that this particular snippet is taken from does not have any accuracy mentions. This is unit data that is generated upon loading a scenario.

As the actual piece of code that has the equation we're looking for is buried in a dll file, which I probably can find a way to decompile, but 1. that's too much work for something that's probably going to get me in trouble and 2. going from human-readable log files will still probably get us within the 80-90 percentile of what we're looking for.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...