Author Topic: Bug report, damageAlter: ToStun damage roll  (Read 4904 times)

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Bug report, damageAlter: ToStun damage roll
« on: August 28, 2016, 02:20:29 am »
Assuming this is a bug and not a feature:
In the current code (0.99B), the "damageAlter: ToStun" variable is not a multiplier but a damage roll. Yankes said this a while ago along with the intention to change it, so I'm not entirely sure what the current status is. Why I write this as a bug report is because when the stun baton and cattle prod (and maybe some similar other items) had their damage type changed from damage type stun (type 6) to damage type plasma (type 5) with corresponding "damageAlter: ToStun: 1.0", this effectively halved their average damage which I guess was not intended.
So the damage on on the stun baton right now should probably be
POWER*(0-200%)
while it actually is
POWER*(0-200%)*(0-100%)
The last (0-100%) because ToStun: 1.0 is actually a roll of 0 - 100% and not a multiplier.

I didn't look at the code to confirm this (sorry, I'm not a coder), I just did some damage testing and found the stun baton was way worse than expected.

To test if my observations are correct or not, you can either look at the code, use Meridians hitlog showing actual damage numbers, or try the following:
Change the stun baton from this:
Code: [Select]
damageType: 5
damageAlter:
      ToHealth: 0.0
      ToStun: 1.0
      ToArmor: 0.0
      ToWound: 0.0
      RandomWound: false

To this:
Code: [Select]
damageType: 6
damageAlter:
      RandomType: 1
      FixRadius: 0
      IgnoreDirection: false
      ArmorEffectiveness: 1.0
      ResistType: 5

If ToStun was a multiplier, these two stun baton versions should be the same (assuming I did not misunderstand item code). If ToStun is a linear distributed roll, you will get on average half the damage when using that stun baton version. As this is a statistical thing, it is a bit hard to get solid proof. Half average damage is still pretty noticable.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Bug report, damageAlter: ToStun damage roll
« Reply #1 on: August 28, 2016, 02:23:54 am »
Right. It was a courtesy Yankes did, and I forgot about that detail when changing damage type. I just need to add lines to change the stun damage to normal damage distribution roll (0...200%). Thanks a lot for catching this!

Offline Yankes

  • Commander
  • *****
  • Posts: 3206
    • View Profile
Re: Bug report, damageAlter: ToStun damage roll
« Reply #2 on: August 28, 2016, 11:33:08 am »
There was bug in Extended code that cause all damage types to have secondary roll on ToStun damage, where in original it was flat multiplier for stun damage type.
Before OXCE 3.2:
Code: [Select]
#defaults values for 6
damageAlter:
      ToHealth: 0.0
      ToStun: 1.0
      RandomStun: true
#defaults values for non 6
damageAlter:
      ToHealth: 1.0
      ToStun: 0.25
      RandomStun: true
After OXCE 3.2:
Code: [Select]
#defaults values for 6
damageAlter:
      ToHealth: 0.0
      ToStun: 1.0
      RandomStun: false #this is changed, now behave like in original
#defaults values for non 6
damageAlter:
      ToHealth: 1.0
      ToStun: 0.25
      RandomStun: true

Eddie currently your example will have different results, first will have another roll, second will have multiplier because of default values.

Dioxine didn't this work "correctly" now? IIRC you balanced stun weapons with bugged behavior and after OXCE 3.2 you change damage types to maintain balance and this secondary roll on ToStun?

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Bug report, damageAlter: ToStun damage roll
« Reply #3 on: August 28, 2016, 01:53:22 pm »
Dioxine didn't this work "correctly" now? IIRC you balanced stun weapons with bugged behavior and after OXCE 3.2 you change damage types to maintain balance and this secondary roll on ToStun?

The stun damage roll, caused by firearms, does indeed appear to be random (I had a soldier hit by a plasma pistol thrice, who had 6 hp left out of 90, but suffered only 5 stun, despite ToStun = 0.5). I guess the same goes for plasma-type weapons that cause no health or wound damage, but stun instead (using ToStun). Which is, as far as I'm concerned, the correct behaviour.

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: Bug report, damageAlter: ToStun damage roll
« Reply #4 on: August 28, 2016, 02:07:25 pm »
I want to point out another thing, concerning this:
Code: [Select]
#defaults values for non 6
damageAlter:
      ToHealth: 1.0
      ToStun: 0.25
      RandomStun: true

The hammer for example has a bootypaedia description stating "special: stun x3". My understanding of this description would be the stun damage of the hammer is three times that of the default behaviour, which would translate to code as "ToStun: 0.75". Yet the actual code for the hammer is "ToStun: 1.5".

Of course my point is moot if Piratez uses different default ToStun values than what Yankes posted.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Bug report, damageAlter: ToStun damage roll
« Reply #5 on: August 28, 2016, 05:02:03 pm »
The default in Piratez is 0.5.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Bug report, damageAlter: ToStun damage roll
« Reply #6 on: August 28, 2016, 07:35:33 pm »
So.. just to make sure I understand what this ToSun means (and the stuff from the Pedia):

ToStun: X is a roll between 0 and X, provided that "RandomStun: false" isn't there.
ToStun: X is a flat multiplier of the X to the main damage roll.

So a (current) cattle prod:
- 70 Power -> 0-140, call the result X, Plasma damage, set to 0 by DamageAlter and also X*(0-1) from DamageAlter: ToStun: 1.0, leading to 0-X Stun damage and although it is possible to get 140 stun damage, it is unlikely.

By opposition, something that has damage type Stun will just roll once 0-200%.

On a sort of related note, how do you tell which incendiary weapon does the traditional 0-10 damage on hit ignoring armor, and which does actual damage (also ignoring armor?)? My best guess is the "RandomType: 2" setting.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Bug report, damageAlter: ToStun damage roll
« Reply #7 on: August 28, 2016, 10:43:47 pm »
Random type 2 is the TFTD 50-150% formula, type 4 is the vanilla incendiary 5-10 flat damage formula.  I think only the auto-cannon incendiary in piratez calls it for fire damage.  The poison gas weapons use it too, but do more damage by the 400% multiplier to choking.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Bug report, damageAlter: ToStun damage roll
« Reply #8 on: August 29, 2016, 03:53:22 pm »
50-150% fire weapons are marked by 'WP' or specially described.

Also, Arthanor, yes, that's how it all works.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Bug report, damageAlter: ToStun damage roll
« Reply #9 on: August 30, 2016, 10:56:49 pm »
Following this report, I looked at the Tesla Coil too. It lists "Stun: x6" in the pedia, but "ToStun: 3.0". Is that supposed to be "ToStun: 6.0"?

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Bug report, damageAlter: ToStun damage roll
« Reply #10 on: August 30, 2016, 10:58:02 pm »
No, since default stun in Piratez is 0.5. So 3.0 is "6x default".

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Bug report, damageAlter: ToStun damage roll
« Reply #11 on: August 30, 2016, 11:09:55 pm »
Right! As mentioned above. Damn that goldfish memory.

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: Bug report, damageAlter: ToStun damage roll
« Reply #12 on: September 20, 2016, 06:03:04 pm »
About the default stun in pirates... Sorry to bring this up again, but I'm kind of into numbers and their correctness and stuff (and currently have a cold so I have some free time).

As far as I have been able to find out, there is no global variable to set this default stun value. So it has to be defined for each weapon. When it is not specified for a weapon, the vanilla value of "random [0 - 0.25]" is used. I tested this by doing damage statistics with a cutlass. The maximum stun damage that I could observe was about 30% of health damage dealt. Damage can be rounded up, so that was probably a 25% roll rounded up.

Long story short, a lot of melee weapons have a stun damge of "random [0 - 0.25]" and not the default stated by Dioxin, which would be "random [0 - 0.5]". If this is as it should be, just ignore my post....

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Bug report, damageAlter: ToStun damage roll
« Reply #13 on: September 20, 2016, 06:06:18 pm »
Melee weapons are an exception to the rule. Cutting weapons generally inflict default stun damage only, which indeed isn't mentioned anywhere.