When's Melty on Steam?
ahaha that's no--wait, what?

Author Topic: Calculating Damage: Rounding?  (Read 5828 times)

0 Members and 1 Guest are viewing this topic.

Offline Id_asz

  • Spellcaster
  • ***
  • Posts: 161
  • Magic Circuits: 9
  • DP > Whatever you're doing
    • View Profile
Calculating Damage: Rounding?
« on: December 27, 2011, 08:33:32 AM »
I have a question for anybody who has actually worked on calculating damage, prorations and data.

How does rounding work? For example, if I've calculated the damage to be 599.8 does it round up or round down?

I know it's not as clear cut as that, because the damage displayed on screen may not be 100% accurate, but I just want some light shed on the subject.

I'm working on figuring out damage for normals from an arcade board, and I'm getting a few odd numbers among a few exact numbers. For example, I'll get that one move does exactly 1000.0 damage, while another would do 299.3. I'm assuming the numbers are supposed to be exact (i.e. 2A does 300.0 dmg, 5A does 350.0 dmg, etc.) but if I change it and edit prorations accordingly, it doesn't equal out with the on-screen damage.
« Last Edit: December 27, 2011, 08:36:19 AM by Id_asz »
Family Fun Arcade
10363 Balboa Blvd.
Granada Hills, CA USA;
(818) 360-0419 BB:Carl; MB:Ciel; AH:Akane; GG:Baiken

Offline ehrik

  • Magus
  • *****
  • Posts: 1555
  • Magic Circuits: 144
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #1 on: December 27, 2011, 09:09:09 AM »
have you taken into account how defense changes as you go through 1/4ths of char's hp too? also rebeat proration could come into play...


other than that i dunno
<Graven> When you are Ciel, don't try to win, don't even try to do anything. The more you do, the stupider and bigger faggot you become because you're using Ciel.
<WyvernLord> roku is faking his disappearance so melty bread can come out and try to convince him of his value to the community

Offline TheMaster_Rahl

  • Spellcaster
  • ***
  • Posts: 641
  • Magic Circuits: 41
  • NC Texas Tim
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #2 on: December 27, 2011, 09:34:09 AM »
It's prolly complicated by things like, how exactly defence modifies damage, and in what order the game calculates damage reduction (ie defence then protarion ect. vs proration then defence ect.). It's prolly best to just look at the raw damage of individual moves, and them the final damage as reported in training mode for each char, and then total combo damage as reported in training mode for each char.

My guess is that it rounds up, based solely on the fact that I've watched dummy recordings of PS2 Archetype doing infinites and never seen a move do 0 damage, only 1. Then again, I've only watched till it capped at the 999 combo counter before shutting it off.

-TexasTim-

Offline Id_asz

  • Spellcaster
  • ***
  • Posts: 161
  • Magic Circuits: 9
  • DP > Whatever you're doing
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #3 on: December 27, 2011, 04:11:56 PM »
Well, I didn't explain my problem very well  :psyduck:

I'm getting Powerd Ciel normal damage data from an arcade board. The arcade mode won't tell you what one hit does, you have to do two hits in order for you to see damage. So, in order to figure out normal damage, I have to reverse engineer it.

I am calculating damage by doing two-hit combos against Aoko during the first 25% of her health (which has a defense rating of 1.00x). There is no damage reduction or criticals included in the data. Also, I make sure to do no combos with Reverse Beats.

So, if I am to find out what 5A is, I would figure it out like so:

X + (31/32)BX = 594 (on-screen damage)
X + (31/32)BX + (30/32)BX = 830 (on-screen damage)

Where X is the damage done by 5A, and B is the proration done by 5A.

With two variables and two unknowns, I can conclude that:
X (5A) = 350.1 damage
B (5A) = .719 proration


That's what I've already done and posted on the H-PCiel thread for all her normals. The problem I have with this is any rounding the game might do with the final damage. What if the total should have been 594.4, but it rounded the on-screen damage to 594? If this were the case it would screw up my results. I can still get really close numbers, but not exact numbers. In most of the fighting games where I've had to calculate damage (which isn't all that many), they round everything down, but I don't know if that's the case with Melty Blood.

One thing I can do is take out my PS2 and run MBAA then do calculations for a control character, but I was hoping someone who knows could just tell me so I wouldn't have to go through all that work.
« Last Edit: December 30, 2011, 07:51:10 AM by Id_asz »
Family Fun Arcade
10363 Balboa Blvd.
Granada Hills, CA USA;
(818) 360-0419 BB:Carl; MB:Ciel; AH:Akane; GG:Baiken

Offline Mengjun

  • Jr. Spellcaster
  • **
  • Posts: 20
  • Magic Circuits: 0
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #4 on: December 31, 2011, 08:59:35 AM »
In most of the fighting games where I've had to calculate damage (which isn't all that many), they round everything down, but I don't know if that's the case with Melty Blood.
It seems to be the case for Melty as well, I think.

Offline Id_asz

  • Spellcaster
  • ***
  • Posts: 161
  • Magic Circuits: 9
  • DP > Whatever you're doing
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #5 on: December 31, 2011, 10:09:15 AM »
My PS2 is acting up, and I haven't gotten my PC version of CC yet.

Can somebody just go into practice mode and tell me how much damage H-PCiel's 2A does? If I know that I can figure everything else out.
Family Fun Arcade
10363 Balboa Blvd.
Granada Hills, CA USA;
(818) 360-0419 BB:Carl; MB:Ciel; AH:Akane; GG:Baiken

Offline Mengjun

  • Jr. Spellcaster
  • **
  • Posts: 20
  • Magic Circuits: 0
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #6 on: December 31, 2011, 10:24:09 AM »
350, 72% fixed

Most damage numbers seem to be pretty round numbers in general, so that might help you figure out the values too.

Offline Id_asz

  • Spellcaster
  • ***
  • Posts: 161
  • Magic Circuits: 9
  • DP > Whatever you're doing
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #7 on: December 31, 2011, 10:33:59 AM »
Can you tell me what 2A is? That seems like it would fix everything for me if I just know that number.

It's either 300 or 299. If I know for sure which that is, I can use it to solve this. My calculations make it seem like 300 won't work, but I need to be sure.
« Last Edit: December 31, 2011, 10:40:52 AM by Id_asz »
Family Fun Arcade
10363 Balboa Blvd.
Granada Hills, CA USA;
(818) 360-0419 BB:Carl; MB:Ciel; AH:Akane; GG:Baiken

Offline Mengjun

  • Jr. Spellcaster
  • **
  • Posts: 20
  • Magic Circuits: 0
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #8 on: December 31, 2011, 11:52:45 AM »
2A's 300, 72% fixed.

Offline Id_asz

  • Spellcaster
  • ***
  • Posts: 161
  • Magic Circuits: 9
  • DP > Whatever you're doing
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #9 on: December 31, 2011, 01:43:25 PM »
And that fits into the problem I'm having. Those numbers just don't jive.

2A2A deals 508 damage (against x1 defense at 100% health).

according to the training mode, 2A deals 300 with .72 proration

So...

X + (31/32)BX = 508
300 + (31/32)(.72)(300) = 508
509.25 = 508


Why would it show 508 damage instead of 509 damage? Is there something I'm missing?

What I had originally calculated was 299.3 dmg at .720 proration, yielding:

X + (31/32)BX = 508
299.3 + (31/32)(.720)(299.3) = 508
508.06 = 508

299 makes more sense when I put it in the equation where 5A2A = 558 among others. Is the training mode just being lazy and not showing 299 (or 299.3) or something?
« Last Edit: December 31, 2011, 01:51:13 PM by Id_asz »
Family Fun Arcade
10363 Balboa Blvd.
Granada Hills, CA USA;
(818) 360-0419 BB:Carl; MB:Ciel; AH:Akane; GG:Baiken

Offline Mengjun

  • Jr. Spellcaster
  • **
  • Posts: 20
  • Magic Circuits: 0
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #10 on: December 31, 2011, 01:53:33 PM »
There's some multiple rounding down in the damage calculation of the second 2A that causes this.

300 * (31/32) = 290.625 -> 290
290 * (0.72) = 208.8 -> 208

explaining the 508 that you get, rather than the 509 you'd expect.




Offline Id_asz

  • Spellcaster
  • ***
  • Posts: 161
  • Magic Circuits: 9
  • DP > Whatever you're doing
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #11 on: December 31, 2011, 02:05:27 PM »
That explains it!

Each individual multiplier is rounded, then they are all added together.

So, we have multiple multipliers, and they're all rounded in a specific order:

  • Damage
  • (33-total number/32)
  • defense rating
  • proration
  • reverse beat
  • critical hit

Not necessarily in that order.

Damage * (#/32) definitely comes before proration, though.

I'm curious what the full order is, maybe I'll work on that soon.

Thanks a lot for your help, Mengjun!
Family Fun Arcade
10363 Balboa Blvd.
Granada Hills, CA USA;
(818) 360-0419 BB:Carl; MB:Ciel; AH:Akane; GG:Baiken

Offline Mengjun

  • Jr. Spellcaster
  • **
  • Posts: 20
  • Magic Circuits: 0
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #12 on: December 31, 2011, 02:25:24 PM »
No problem ^^;

There seems to be some weird multipliers too, like a factor 0.88 against aerial opponents (after the combo count scaling), and a factor 1.035 for Hisui&Kohaku only. (Which seems to go before the combo count scaling)

So it's likely to be an enormous pain to determine the exact order in which the numbers are multiplied.

Offline Id_asz

  • Spellcaster
  • ***
  • Posts: 161
  • Magic Circuits: 9
  • DP > Whatever you're doing
    • View Profile
Re: Calculating Damage: Rounding?
« Reply #13 on: December 31, 2011, 02:42:56 PM »
There seems to be some weird multipliers too, like a factor 0.88 against aerial opponents (after the combo count scaling), and a factor 1.035 for Hisui&Kohaku only. (Which seems to go before the combo count scaling)

The .88 was a problem I just ran into right now when dealing with air combo damage. Thanks again.

It shouldn't be too hard to figure out the right orders on all of these, it'll just take a lot of time. I'm really interested in this now. I'll post here when I get more info.
« Last Edit: December 31, 2011, 02:44:32 PM by Id_asz »
Family Fun Arcade
10363 Balboa Blvd.
Granada Hills, CA USA;
(818) 360-0419 BB:Carl; MB:Ciel; AH:Akane; GG:Baiken