FF8 correct HP formula?

  • Thread starter Thread starter Sebanisu
  • Start date Start date
Status
Not open for further replies.
S

Sebanisu

Guest
I put in the formula for max hp from doomtrain and i'm getting a different number than the one in game.

Squall has 529 max hp. At level 8 with no junctions.

Code: [Select]
Code:
            public int HP(byte lvl, byte magic_J_val=0,byte magic_count=0, byte stat_bonus=0, byte percent_mod=100)            {                return (int)((magic_J_val * magic_count + stat_bonus + lvl * _HP[0] - (10 * lvl ^ 2) / _HP[1] + _HP[2]) * percent_mod) / 100;            }
the formula gives me 531

I used the formula that pops up if you click the button.

I have the 3 hp vars in an array. Well there are four but I think the fourth is always zero.

Anyone have an idea?
 
Last edited:
well changing percent_mod to a double and 99.62335216572505 got the right answer but unsure if that's correct. :P

Code: [Select]
Code:
            public int HP(byte lvl, byte magic_J_val=0,byte magic_count=0, byte stat_bonus=0, double percent_mod= 99.62335216572505)            {                return (int)((magic_J_val * magic_count + stat_bonus + lvl * _HP[0] - (10 * lvl ^ 2) / _HP[1] + _HP[2]) * percent_mod) / 100;            }
probably not right as it only worked for squall and unsure if it'd continue to work because all my saves are him at lvl 8 pretty much heh.
 
Last edited:
That post will help a lot. Ty. Alot of those formulas in one place I gotta make them into functions.

Sent from my Pixel XL using Tapatalk
 
Seems fine to me.
Code: [Select]
Code:
default for Squall:_HP[0] = 44_HP[1] = 255_HP[2] = 179((magic_J_val * magic_count + stat_bonus + lvl * _HP[0] - (10 * lvl ^ 2) / _HP[1] + _HP[2]) * percent_mod) / 100;part1 = magic_J_val * magic_count + stat_bonus = 0part2 = lvl * _HP[0] = 8 * 44 = 352part3 = (10 * lvl ^ 2) / _HP[1] = (10 * 64)/255 = 640/255 = 2 (truncated because of integer arithmetic)percent_mod = 100((0 + 352 - 2 + 179)*100)/100 = 529
 
Odd. I must have something wrong. Thanks for checking.

-- update --

I thought lvl^2 was squaring lvl. I'm not sure what it's doing but lvl^2 = 10; I had to use (int)Math.Pow(lvl,2) or lvl*lvl

A quick google I guess the ^ is an xor operator in c# lol
https://www.dotnetperls.com/xor
 
Last edited:
Status
Not open for further replies.
Back
Top