aliens

Author Topic: [Feedback] Power bonus should be applied after the damage roll  (Read 3930 times)

Offline DeltaEpsilon

  • Captain
  • ***
  • Posts: 86
    • View Profile
Using Meridian's own words: weapon power => +power bonus => roll => damage

Note: it's assumed that the weapon here is a firearm
1. It makes no logical sense to say "weapon power". The weapon itself does not affect bullet's lethality.
2. It doesn't matter if you shoot a 5.56mm NATO with an M16 or a FAMAS, the bullet's parameters remain the same.
2+. Well, not completely, there are some things the weapon itself affects, but for the sake of simplicity let's assume that they're insignificant enough to be ignored.

So it's not "weapon power", it's "bullet power".

But then we have power bonus.
And I think it's bullshit.

See, the issue here is that bullet power is bullet's own value, independent of the shooter or the weapon.
But power bonus actually makes a weird scenario where the bullet's lethality is somehow affected by the shooter.
I don't think X-Com soldiers wield such arcane magic to magically affect the bullet mid-flight.

Think of it: how's being more accurate or reactive should give you any way to increase the damage you inflict?

Let's talk about the roll.
The way I see it is probably the same as Julian envisioned: it's a way to simulate uncertainty of the hit.
Maybe you hit a hat or something.
It's okay. While I still think it's BS that you may get 0 damage roll despite HITTING, at least I can see the logic behind this.

So where to apply power bonus then?
I think it should be applied to the roll itself.
Why?
Easy: bias.

Power bonus is definitely a weapon's own value. It must indicate something about the weapon itself.
Now, my assumption as to how it would affect end damage is ergonomics.

For the sake of clarity, I will call power bonus "ergo bonus" because it's no longer a power bonus.


Possible explanations for stats and ergo bonus:
Accuracy is probably done by adding some kind of stabilizers and stuff to the weapon. It's not as useful for rookies as it is for specialists.
Reaction ergo bonus is probably something like how the weapon fits nicely in the hand and can be used while moving easier.
Bravery makes no sense, but whatever.

Basically all of those stats indicate how a soldier is used to this kind of weapon which allows him to use it easier.

Where does the extra damage come from then? It doesn't.
It does NOT increase bullet's lethality, but it allows the soldier to be, on average, more consistent and effective at hitting the target in vurnerable spots.

The soldier has at least some control over where the target will be hit, but it's still random.

Basically the distribution is shifted, that is, there is bias.

As such, making power bonus apply after the roll will bring a weird transition state between 0%-200% and 50%-150%. However, for this case the range is dependent on the soldier themselves.

As such, ergo bonus represents a probability that the low-end of the distribution will be shifted into the high-end.
That means that if you roll less than 100% of damage, you have a chance that is equal to ergo bonus to add 100% to this roll.
This is represented with the following histograms:
Spoiler:



They should be easy to read, but in brief: 10000 simulated rolls, x axis - roll value, y axis - amount of rolls with this value, red line is local mean of window size of 10 (that is, +-4 units from this point)


Therefore ergo bonus does the same thing as power bonus: increasing average damage (represented by red vertical line here), but not increasing the actual max and min damage.


However, it must be noted that power bonus actually makes sense for melee weapons.
You're holding a melee weapon in your hand and how it performs is significantly affected by your own stats.
« Last Edit: July 17, 2018, 02:01:10 pm by Meridian »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
First off, I like the idea behind this suggestion, using the distribution of the random dice roll for power is a great way to leverage some of the limits of our simulation of bullet damage as a feature.  However, I have one big problem with doing gymnastics with probability distributions in a game like this:  it is nearly impossible to convey to the player what's going on except in the most broad, general terms unless the player has a background in statistical modeling.  If we set that aside or just hand-wave it away by just telling the player "better firing accuracy means better chances of getting a high damage roll," then I have a few more minor comments about what constitutes a "hit" in our engine and tweaks to your bias/shift paradigm.

I see the 0-200% roll as a concession in the original engine for the fact that our unit models are cylinders, and I think it's brilliant for the limitations of a simpler simulation.  A "hit" is a bullet entering the unit's cylinder; this cylinder is a good first approximation of a humanoid shape, but it doesn't take into account movement or the fact that passing through a cylinder drawn around a humanoid shape might be going over the target's shoulder.  It also doesn't take into account hitting in the head versus hitting the torso versus hitting the foot, just that we hit in a vague area around the target.  That's where the random roll comes in - we approximate more complex damage modeling as falling somewhere on the distribution between doing nothing to the target and getting that perfect headshot.  This is why I like your idea of biasing the distribution, a soldier who is a better marksman or more comfortable with their weapon should be more consistent at getting their bullets to vital points on the target, and the bias simulates this without having to go down the rabbit hole of "exactly where on that alien did we hit?".  However, I don't think it should remove the 0% damage roll completely, as even the best of marksmen have an off day, or a sudden change in wind speed/direction makes that perfect cross-map headshot whiff.  So rather than transitioning a 0-200% roll to a 50-150% or even 50-200%, I think it should remain 0-200%, but the probability of rolling higher just gets better.

This could be done by changing from a flat probability distribution to a linearly increasing one, or if we follow Yankes' paradigm, anything that could be modeled by a 3rd degree polynomial.  If you want to prototype this without making an engine change, you can use Yankes' scripts to take the power from a 0-200% as an input to a function that maps that onto a slanted distribution.  Just a fair warning though, communicating the content of scripts to the player is even more difficult than engine code, and there's still that problem to solve before this is any more than a thought experiment.

Offline DeltaEpsilon

  • Captain
  • ***
  • Posts: 86
    • View Profile
Quote
it is nearly impossible to convey to the player what's going on except in the most broad, general terms unless the player has a background in statistical modeling

Something like this:
(Power changed to ergonomic since it's no longer about power)
Quote
ERGONOMIC bonus: represent how comfortable the shooter is with this weapon and allows to hit the target's vital parts more consistently (if hit occurred) which raises minimum possible damage inflicted to target by this value.
Or even
Quote
ERGONOMIC bonus: a flat increase of inflicted damage. Inflicted damage after increase may not be higher than maximum damage this weapon can inflict without this bonus.

I think those descriptions are easy to understand.

Quote
So rather than transitioning a 0-200% roll to a 50-150% or even 50-200%, I think it should remain 0-200%, but the probability of rolling higher just gets better.
Now that's much more difficult to reason about. I see where you are coming from, but you directly change the probabilities and you can't really describe what the bonus is doing without going into them if it's done this way. It's a better option, but much, MUCH more unpredictable and quite complex, unlike everything else about X-Com.

I simply made an analogy. In reality what is happening is just one more plus sign, not a very difficult to describe shift in probabilities.



Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
I understood at what you were getting at with changing where the bonus was applied, but I don't think it's right to remove the possibility of a 0% damage roll when it's pulling double-duty as representing both a hit that does 0 damage and missing the unit but still within the cylindrical hit box shape.  Rolling 0 damage is integral to the X-Com experience and doing away with it for bullets invalidates an important part of the simulation for me.  Personally I would find it hard to explain doing guaranteed damage with a bullet as an "ergonomic bonus".

Perhaps to simplify biasing the distribution it could be done as an extra dice roll - the more "ergonomic bonus" a soldier has when firing a weapon, you get a greater chance of turning a 0-100% hit to a 100-200% hit.  The math for that is pretty simple - if the original roll is less than the weapon's stated power, then make a roll based on "ergonomic bonus" - if it passes, then add the weapon's stated power to the original roll.  The result is that instead of a tilted probability distribution, we have a flat distribution with a step up in it.

Offline DeltaEpsilon

  • Captain
  • ***
  • Posts: 86
    • View Profile
 After talking about it over Discord, we've arrived to a less complicated system.

Offline Ethereal

  • Commander
  • *****
  • Posts: 625
    • View Profile
It seems to me that it will be very difficult to implement. In addition, several models of damage can be used in one mod, from 100% \ 100% to 25% \ 175% (as in my modification). It seems to me that the damage bonus should be added only when the projectile deals damage by breaking through the armor, and if the armor is not punched, then there is no bonus. And this can already be considered a critical blow to the vulnerable point.

Offline DeltaEpsilon

  • Captain
  • ***
  • Posts: 86
    • View Profile
I've updated OP post. It's a different system now.
« Last Edit: May 21, 2018, 07:50:59 pm by EditorRUS »

Offline Yankes

  • Commander
  • *****
  • Posts: 3207
    • View Profile
You can set flat 100% damage and then manually alter it to different distribution in scripts.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [Feedback] Power bonus should be applied after the damage roll
« Reply #8 on: July 27, 2018, 03:01:05 pm »
1. It makes no logical sense to say "weapon power". The weapon itself does not affect bullet's lethality.
2. It doesn't matter if you shoot a 5.56mm NATO with an M16 or a FAMAS, the bullet's parameters remain the same.
2+. Well, not completely, there are some things the weapon itself affects, but for the sake of simplicity let's assume that they're insignificant enough to be ignored.
The primary factors affecting the dynamics of the shot are the bullet and the barrel. Other factors are relatively insignificant, but the barrel is not. The FAMAS shoots very similarly to the M16A2 because the barrel is similar, however the FAMAS barrel is almost an inch shorter. That's why the M16A2 has a muzzle velocity of 960m/s while the FAMAS has a muzzle velocity of 930m/s. The M16A2 is also more accurate, leading to almost twice the effective range with the same ammo.

Yes, the weapon does affect the bullet's lethality. The above case shows a small difference, but sometimes there is a large difference, such as with a .50 BMG pistol vs. the actual M2 Browning Machine Gun that the round was designed for. You can certainly fire a .50 BMG from a handheld pistol, but there is a reason they prefer the hefty tripod-mounted behemoth and it isn't for a <10% performance increase.

Even in a rifle that is ideal for its rounds, various factors can still be increased in order to improve performance in certain areas. Long barrel rifles typically have a shorter barrel than what would yield the highest muzzle velocity, because they want it to be more wieldy. But if you had plenty of time to make your shot and were most concerned with punching through armor, then having a longer barrel might work better for you. And in many cases, the bullet can punch through armor better at a lower velocity, especially if it's specially designed to stop bullets.



I don't think X-Com soldiers wield such arcane magic to magically affect the bullet mid-flight.

Think of it: how's being more accurate or reactive should give you any way to increase the damage you inflict?

Easy. Being more accurate makes the soldier more likely to successfully hit weak points. Being more reactive makes the soldier more likely to take advantage of weaknesses in the target unit's position before the opportunity fades.