Jump to content

Tactical Firing Accuracy Formula


Zeno

Recommended Posts

This information comes courtesy of NKF, via his response on another topic.

 

Anyway the raw accuracy percentage is calculated as follows:

 

Firing accuracy * health% * gun's firing accuracy% (based on firing mode) * kneeling modifier% * handedness modifier%

 

They're all in percentages (though you can leave the soldier's firing accuracy as it rather than use it as a percentage).

 

The first bit, Firing accuacy * health% determines your current firing accuracy. For example, with 80 accuracy and 100% health, accuracy is 80. But at 50% health, current accuracy is 40, etc. This is also how you determine current throwing accuracy, but that's a different matter entirely.

 

The kneeling modifier's 1.15 when kneeling, 1.0 when standing. Whether or not you're flying is irrelevant.

 

The handedness modifier is 0.76 when you try to fire a two-handed weapon while carrying something else in the other hand. Else, it's 1.0 for one-handed weapons and when properly using two-handed weapons.

 

Multiply the lot and the answer will be your raw accuracy score, which I'm sure determines the amount of drift a bullet has when its travelling from your gun to its target.

 

For example, a soldier with 84 accuracy, with 60/64 health, firing a snapshot from a pistol (60%) while kneeling:

 

84 * 60/64 * 0.6 * 1.15 = 54.3

 

So that's roughly a 54% accurate shot.

 

The formula's true, but the rest of what I have to say in this post is just a wild guess.

 

When fired, the bullet will have three velocities. x, y (for lateral movement) and z (for height), which are first determined with a few trignometry functions and then update the position of the bullet every game frame. Your firing accuracy determines how much drift the bullet will have.

 

i.e.

 

100% > = no drift in bullet trajectory.

< 100% = increased drift in bullet trajectory.

 

So the further away the target, the worse the bullet will drift. The height of a unit just makes it a larger or smaller target to hit.

 

But why does a bullet sometimes miss even at 100% accuracy? Well, I guess it's because of the 'optimisations' that the computer does to speed up its number crunching. Such as the rounding down of integer values, which can introduce some unwanted drift in the bullet velocities.

 

Note that this happens a lot with the Blaster bombs, hence why they sometimes clip a wall when they shouldn't. I watched one moving in slow-motion at one time, and it often went off at a slightly wild trajectory and miss the next waypoint by one tile, but it would then miraculously appear at its proper position (at the waypoint) and then fly off to the next. I guess the blaster bombs can only travel along a limited number of tiles before it disappears in a puff of logic and reappears at its next waypoint.

 

- NKF

 

 

I came up with the same formula, and verified it some time ago (who knows, maybe I verified it from one of NKF's previous posts?) If anyone has a different formula, this is the place to discuss it.

 

NKF's speculative description of "drift" is really what I was looking for. There must be some mathematical formula to determine true firing accuracy, taking all factors into account.

 

i.e.

firing accuracy * health% * weapon accuracy * kneeling modifier * handedness modifier = chance to hit target tile at range 1.

 

The chance to hit target alien within target tile = ? (This is probably a formula based on target's height.)

 

The chance to hit target tile at greater than range 1 = ? (There may not be a range modifier, as I suspect your "drift" description is correct. If there is no range modifier, then a mathematical formula to express maximum and probable degrees of inaccuracy must be possible.)

 

The modifier for inability to see the target (when using a scout/spotter) = ? (This is probably not a factor, as it is accounted for in the range formulae).

 

 

There are also two modifiers not mentioned in NKF's formula:

 

The modifier for darkness (and varying degrees of light level) = ?

 

The modifier for target in smoke = ? (This appears to be related to the number of smoke-filled tiles through which a round passes.)

 

 

 

So, the question is...does anyone know an all-inclusive mathematical expression to determine the chance to hit, or the degrees by which a missed shot is likely to miss?

 

Though it's not exactly the same topic, throwing accuracy information is welcome here.

Link to comment
Share on other sites

I don't think smoke or light come into the to-hit equation at all. They do influence unit visibility.

 

AI controlled units ignore the low light level penalties, and can only shoot at targets that they can see in their individual fields of vision. Hence, if they can't see you, they can't shoot you. Psionic attacks are, of course, a different matter entirely. I'm not sure how much this applies to AI units with blaster launchers...

 

The player's visibility range is affected by light, but as long as you've 'seen' an enemy unit and have a clear firing path, anyone can shoot the target from anywhere in the map.

 

Smoke doesn't reduce the ability of a unit to hit an enemy unit -- it just makes it harder for the unit to spot enemy targets in the smoke.

 

One thing I'd like to know: Does reaction fire offer any bonuses to your accuracy? I often get the feeling that my soldiers perform slightly better with opportunity fire than they do with manual snap-shots. Just a happy coincidence I guess. Reaction shots are indeed more exciting to look at. :(

 

- NKF

Link to comment
Share on other sites

I have an alternate wild guess to counter the drift theory.

 

Perhaps the to-hit calculation is performed, and if you miss, then a second calculation determines the degree by which the shot missed. I have seen extremely low-accuracy soldiers shoot 45 degrees off or more, while my high-accuracy soldiers usually miss (when the miss) by only a very slight margin.

 

This would make point-blank shots more accurate (if you are off by a few degrees, it is still likely to pass through the tile containing the alien, and therefore it is still possible to hit). However, if you are off only by 2 degrees, you would completely miss an alien on the opposite end of most maps (hitting an adjacent, empty tile).

 

If this is true, then the "to hit" formula not only determines your chance to hit, but also determines your maximum degree of error when you miss.

 

I think this is a logical theory, but I'm not sure if it's correct.

 

As for the smoke, I think it does affect the chance to hit. I use smoke extensively (until the particle count ends new smoke effects). Aliens tend to miss considerably more often, both on reaction shots and during-turn shots. I estimate about 33% reduction in accuracy, based solely on observation. Most aliens take between 1 and 3 shots to hit my soldiers in smoke. They take 1 or (rarely) 2 shots to hit my soldiers outside smoke.

 

I have also noticed that soldiers in smoke are more likely to receive fatal wounds, instead of instant death, when they are hit. In smoke, I estimate about a 10% chance to survive with fatal wounds when shot, while outside smoke, I estimate a 5% chance to survive with fatal wounds. Depending on the weapon, of course.

 

Smoke also affects visibility, as aliens will sometimes come in range (sometimes very close) and not shoot (but they have the time units, because they will take reaction shots on my turn). This happens very rarely, but it's the best defense you get when you're not wearing armour.

 

 

Just some observations. Maybe just dumb luck.

Link to comment
Share on other sites

Oh yes, smoke indeed influences visibility. I have an amusing (well, to me anyway) anecdote on it actually:

 

Imagine a snakeman battleship right next to a hill (south of it). I foolishly moved a trooper a little too far and ended up at the foot of the hill (you know, accidental clicks resulting in disasterous, if not hilarious, 'accidents'). The soldier was thoroughly exhausted. Right in front of the soldier was a snakeman with a heavy plasma (about a 10 - 20 tile gap between the two, well within visibility range). It was facing directly towards the soldier too. In most cases, this is instant death.

 

Since all my soldiers were directly to the east of the map, they couldn't provide any support fire since the Battleship legs were in the way. But I was able to move a bit and use the grenade relay to plant a standard grenade right in between the snakeman and my soldier (smoke grenades were out).

 

The grenade detonated at the end of the turn. It didn't hit anything but it did make a small patch of smoke between the two units in question. Once the aliens started moving, the snakeman just turned away and wandered about in the usual semi-random fashion. I never thought the low level of smoke from a grenade was enough to hide my soldier, but it did.

 

I think ended up mentally cursing the snakeman for its blunder. :(

 

- NKF

 

P. S: While I may seem to be babbling on and on in some of my replies, trust me, my eyes are almost always glazed over whenever discussing anything remotely technical. That or the caffein hasn't worn off yet.

 

P. P. S: Wear clean underwear

Link to comment
Share on other sites

If we were to speak hypothetically and I was to say give you two some new weapons for XCom... Do you reckon you could come up with some stats for them between the two of you? :(

The stats would depend on the purpose of the weapons, I would say.

 

There are several things concerning the game weapons: TU usage and accuracy for the different types of shot, level and type of damage inflicted. With a little imagination you could probably add some interesting new weapons designed for specific purposes.

 

As an example check the table below.

 

Heavy Laser 85 50% 33% 84% 75%

Heavy Laser II 120 75% 33% 110% 60%

Plasma Rifle 80 86% 30% 100% 60%

Heavy Plasma 115 75% 30% 110% 60%

 

The first column indicates the power, the 2nd and 3rd the snap shot accuracy and TU usage, and finally the 4th and 5th column the aimed shot accuracy and TU usage. The Heavy Laser II is the improved weapon that comes as an option on XComutil.

 

By itself the Heavy Laser pales compared with the other weapons. It gives a little more damage than the plasma rifle but the accuracy is simply frightening, with a chance of half that it will hit its target. For long range shooting any of the other three weapons work better and on the close fighting chapter the same situation applies, having no auto fire ability.

But the Heavy Laser II is quite an improvement. The increased power and accuracy brings it up to the same level of the heavy plasma on long range engagements. The Plasma Rifle is still more accurate in snap shots but it inflicts only two thirds of the damage. By changing the stats most of the shortcomings of the original Heavy Laser have been overcome and the new version is a more specialized weapon.

 

By thinking in terms of range/power/TU usage there's a number of possible combinations that can be tried.

-Heavy close assault weapon designed to take out aliens on corridors. It's overall accuracy would be very low, probably the stats of the Heavy Laser but the damage inflicted would be well on the heavy plasma field. Another difference would be on the TU usage which would be low, allowing for three auto bursts per turn (the Plasma only allows two).

-Grenade launcher. Capable of auto fire (2 per turn), the weapon would most likely be conventional Earth weaponry. The damage would be around 75 of the HE type. The accuracy would be moderate, with 70% maximum on snap shots. Of course it would be suicidal to use this weapon on close quarters. It would stand between the Heavy Cannon and the Rocket Launcher.

-Finally, a flame thrower. No auto shots and restricted range (up to 10-15 tile maps). The damage would be low (30-40 points) but it would set ablaze a large portion of the ground where it hit. It would also be a one shot weapon - once fired the soldier would have to reload a napalm pack into the weapon.

-

Link to comment
Share on other sites

I just gave those above as examples.... a short time ago I was thinking about how to change the weapons to add some more variety but increasing the difficulty at the same time. Some of the weapons used on UFO are simply too good/powerful - one example are the heavy plasmas, which can be used effectively even a rookie, another are the blaster launchers, which are simply too unbalancing.

 

Making up stats is not a problem....the question is defining the basic characteristics of the weapon while taking into account the different battlefield conditions (open fields/inside UFOs, Sectoids vs. Ethereals, etc.). Still tell more about those weapons and probably I can give you a hand on those.

 

 

EDIT: Just remembered one thing that must play a part on the accuracy formula: the height of the aliens. This stat isn't available on the soldier information but the data is on the game. Maybe that's why so many times my soldiers miss when firing at Sectoids at point blank range...

Link to comment
Share on other sites

Veteran: yes.

 

Hobbes, the weapons in XCOM have very odd characteristics when analyzed. If you take the soldier out of the equation (i.e. assume the soldiers have equivalent stats in all comparisons) you'll find that an aimed Laser Pistol does less damage over time than a Pistol, due to the laser pistol being both less accurate and slower (an aimed laser pistol is actually the least effective weapon in the game). However, a Laser Pistol does more damage over time than a Plasma Pistol if you use snap shots.

 

Other oddities:

-- An aimed pistol performs better than an either an aimed rifle or aimed autocannon.

-- A heavy cannon performs much better (more than 40% more effective) than an auto cannon for snapped and aimed shots.

-- Contrary to popular belief, an autocannon with high explosive ammo on full auto is not the most effective unresearched weapon in the game. An aimed rocket launcher with large rockets is the most effective weapon.

-- A laser rifle using snap shots performs slightly better than a laser pistol using auto shots.

-- A heavy laser using snap shots outperforms an autocannon on full auto. Barely.

-- A heavy plasma on full auto is the most effective weapon in the game, pushing out over 72% more damage over time than a blaster launcher.

 

 

But this comparison is severely flawed. The biggest are that I haven't taken reload time into account (which would make the rocket launcher less favourable), and I haven't taken "splash damage" into account (the chance to hit multiple targets, or to hit a target despite missing the direct hit, with explosive or incendiary ammo). I also have not calculated the effectiveness of incendiary ammo, which is partially dependent on whether a target catches on fire.

 

The non-calculable intrinsic values are what really make the difference. Lasers don't require ammo, thus taking much less valuable space from the 80-item limit. Incendiary ammo creates a light source during night missions, and can be used defensively to damage approaching aliens (who don't seem to avoid fire and will stop in the middle if they run out of time units). The ability to kick out lots of damage is less important if an alien drops in one hit--often, it is better to use 3 snap shots to drop 3 separate aliens, instead of 2 auto shots. Dual-wielding pistols looks cool. High explosives have a secondary (primary?) function of taking out terrain and buildings. The number of grenades you carry effects weapon choice. Low-accuracy and/or low-reaction soldiers have different needs from high-accuracy, high-reaction soldiers. And finally, there is always personal choice. In the game, the only mistake you can make is carrying only one type of weapon--and even then, you can usually overcome it with superior tactics.

 

Oh. You mentioned increasing difficulty. I recommend increasing the alien stats, rather than reducing the effectiveness of their weapons. I'm currently running a game with a generic 37% increase in all alien combat stats, including armour (this is to the base stats; Superhuman difficulty gives a further boost). In addition, they have a 200% increase in Psi Strength. Soldiers, Leaders, and Commanders have a 300% Psi Strength increase. (So much for soldier's psi skill ruining the tactical game). All Sectoids and alien Medics have Psi Skill. And finally, I have one or more selective increases for each alien type and rank.

 

But it's only difficult if you use XCOMUTIL to slow research time to 1/10, and remove the assistance from captured aliens. Otherwise, you still overcome the aliens in 2-3 months. I'm still working on the right balance between challenge/fun/frustration, but this game has been great so far.

 

------

 

I'm still looking for an overall tested-and-passed accuracy equation. It sounds like this requires a full in-game performance measurement test.

 

Is anyone up for shooting multiple weapons, many, many times, and recording the results? For the first test, I recommend using an edited map, with the aliens spawned and "contained" in a completely sealed area. Shoot at a nearly indestructible wall from different ranges, and record the number of tiles you miss it by (vary the accuracy of the soldier's firing skill, too).

 

The test to hit an alien depending on it's height requires a set of highly durable aliens (0 armor and 255 health), disarmed with no psi skill, versus a soldier armed with a pistol and a mind probe. Shoot alien, check it's stats to determine if you hit. This may require additional hex editing, to vary the alien height and/or increase the soldier's accuracy, depending on the results of the test.

 

The tests will require more complexity than this, but I don't want to go into a full testing methodology discussion here. Just wanted to give a brief statement, so you'll have an idea of what is required.

 

If no one is interested, I'll get around to it eventually...

Link to comment
Share on other sites

2xy + y = 10 (1)

x + y = 4 (2)

(2), y = 4 - x (3)

4 - x .

sub (3) in (1), 2x(4 - x) + (4 - x) = 10

\ 8x - 2x² + 4 - x - 10 = 0

\ 2x² - 7x + 6 = 0

\ (2x - 3)(x - 2) = 0

\ either 2x - 3 = 0 or x - 2 = 0

therefore x = 1.5 or 2 .

 

Substitute these x values into one of the original equations.

When x = 1.5, y = 2.5

when x = 2, y = 2

 

YAY!!!!!!!

Link to comment
Share on other sites

  • 6 months later...

I spent an hour collecting NKF-sensei's formulas into one spreadsheet. (Many Sectoids died to bring us this information...)

 

 

For the sake of rehashing:

 

Accuracy = (FA)*(Kneeling Bonus)*(WA)*(Wound Mod)*(Health Mod)*(Grip Mod)

This accuracy is pre-calculated and shows up in the battlescape weapon menu when you go to choose a firing action.

 

FA = Firing Accuracy, soldier's stat as a %

Kneeling Bonus = 115% if kneeling, 100% if standing

WA = Weapon Accuracy, dependent on weapon and aimed/snap/auto action, as in UFOPEDIA.

Wound Mod = 100% if unwounded, -10% for _each_ untreated critical wound.

Health Mod = (Current Health/Starting Health), soldier stat. Half dead = half accuracy.

Grip Mod = 78% for one-handed grip on two-handed weapon, 100% otherwise.

 

- This may seem like an inane observation but note that if your soldier is Standing, Aiming a Laser Rifle, with Both Hands, and is Uninjured in any way, all the bonuses and modifiers are 1 (100%) and the accuracy of your shots should be _exactly_ equal to your soldier's Firing Accuracy stat.

 

In all other cases, the accuracy calculation is more complicated.

 

- For Auto triple-shots, the chance of one hit out of three is AutoAccuracy = 1 - (1-Accuracy)^3. This is a condensed version of the formula Cyrus posted. (Take the base chance of a given shot hitting, convert it to the chance of missing, cube it, and convert it back to the chance of at least one shot hitting.) Accuracy through volume is often quite favorable - especially at close range.

 

Even though the formula ignores distance and visibility modifiers, the missed shots use a different formula again - and since they have to pass through some volume of space, if you are right next to your target, it's likely a missed shot will have to intercept part of your target anyway. We don't know this second formula but it probably involves a random factor for angle off the aim line.

 

If I look at the Laser Rifle again, Auto accuracy is 46%, Aimed is 100% bonus. I ran the numbers for a few different soldier accuracy stats and the chance of at least one hit in an Auto shot was _better_ than the Aimed shot, if the soldier FA was under 70. So auto fire is great, if you're not worried about collateral damage in your cone of fire! Blaze away!

 

Edit: forgot to mention the game does show you the result of the basic calculation.

Edited by JellyfishGreen
Link to comment
Share on other sites

I think Deus Ex did a fair job. The better the player's character was with a certain weapon, the more accurate the weapon was.

 

The way accuracy was implemented was as follows. When you point a gun at a target, you get a targeting reticule. It starts off wide, and if fired while the reticule is still wide, your shot has a much greater chance of missing (i.e. your snap-shot). If you stay still and wait long enough, the reticule tightens and the more accurate your shot gets (just like how aimed-shots in UFO/TFTD take more time units to fire).

 

The higher the player's skill with the weapon, the faster the reticule tightens (i.e. you aim much faster), thus dramatically reducing the 'drift' of a bullet.

 

I feel this would simulate accuracy rather well in an X-Com first person shooter.

 

- NKF

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...