PDA

View Full Version : Max HP in Ys II is 256? O_o



Chelli
03-24-2012, 06:04 PM
So I picked up Ys II for the first time since I beat it about a year ago because I've been on an Ys kick. I decided to grind some levels on the endgame enemies since there's not much else to do at the end of the game and I didn't feel like starting a new game just yet. Adol was level 50 or 51 in my file, and I got him up to level 55. Turns out 55 is the max level in Ys II, and when Adol got to level 55 his HP increased to 256.

Yeah, there's no real point to this topic. Just a little something I found. Although having his health going up to 256 seems like a waste of programming. I know almost nothing about programming, but I do know that 255 is some sort of max number you can have without having to add a ton of extra numbers above that.

Chaosblade
03-24-2012, 06:58 PM
256 is one byte (2 because bits are binary to the 8th power because 8 bits are in a byte, 2^8 = 256). You'd end up with 255 when counting 0.

So I'm not sure exactly what's happening there, but depending on how death is handled it might still be using 1 byte for health.

Wyrdwad
03-24-2012, 08:03 PM
Yeah, my guess is it's using one byte. Probably what's happening is, the lowest amount of health you can actually have is 1/256. When you get hit by an enemy, it likely just checks to see if the amount of damage you'll take is greater than or equal to your current HP. If it is, it doesn't even bother subtracting -- it just kills you on the spot. ;)

-Tom

Chaosblade
03-24-2012, 08:19 PM
I didn't remember if the health bar actually displays 0 when you die or not. Too lazy to check, honestly. But if it doesn't then that's probably how it works. Or even if it does display 0, it could be hardcoded and still use one byte, but that would be wasted effort.