Endurance

Apr 17, 2009, 8:32 am
#1
Joined: Dec 15, 2008
Posts: 100
Little question...

Does anyone know how HP is calculated exactly using the endurance stat (or is it using more stats?), and how it is distributed among the bodyparts?

EDIT: So far I have found this:

Quote
bodypart::CalculateMaxHP(ulong Flags)

{

int HPDelta = MaxHP - HP;
MaxHP = 0;

if(Master)

{

if(!UseMaterialAttributes())

{
long Endurance = Master->GetAttribute(ENDURANCE);

MaxHP = GetBodyPartVolume() * Endurance * Endurance / 200000;

}

else

{

long SV = GetMainMaterial()->GetStrengthValue();

MaxHP = (GetBodyPartVolume() * SV >> 4) * SV / 250000;

}


if(MaxHP < 1)

MaxHP = 1;


if(Flags & MAY_CHANGE_HPS)

HP = Max(MaxHP - HPDelta, 1);


if(Flags & CHECK_USABILITY)
SignalPossibleUsabilityChange();

}

}

Which implies that HP is determined by Endurance, and body part volume. Then I went looking for the GetBodyPartVolume() function, and I found this:

Quote
long humanoid::GetBodyPartVolume(int I) const

{

switch(I)

{

case HEAD_INDEX: return 4000;

case TORSO_INDEX: return (GetTotalVolume() - 4000) * 13 / 30;

case RIGHT_ARM_INDEX:
case LEFT_ARM_INDEX: return (GetTotalVolume() - 4000) / 10;
case GROIN_INDEX: return (GetTotalVolume() - 4000) / 10;

case RIGHT_LEG_INDEX:

case LEFT_LEG_INDEX: return ((GetTotalVolume() - 4000) << 1) / 15;

}

ABORT("Illegal humanoid bodypart volume request!");

return 0;

}


Which implies that the head volume doesn't change, for one, and the rest of the volume is divided under the remaining body parts (note that it isn't properly divided, a portion of the number of gettotalvolume is unused for some reason?). But now I can't find that GetTotalVolume() function... So I still don't know exactly how everything works.

EDIT2:

I reverse-used the calculations, and found out that the main player has a total volume of 76. Does anyone know if the devs just gave all humans a volume of 76 (which will probably correspond to 76 kg, a bit around the average weight of a human), or is there more to it? (I'm kinda thinking right now about how a bloated player has increased hp on his torso, but reduced agility/dexterity )
Apr 18, 2009, 3:01 am
#2
Joined: Dec 3, 2007
Occupation: Chaos Weaver
Location: Standing between all life and death
Posts: 2,891
Ahoy Serefan! Still working on IVANOV? I'm of no help but good luck all the same.
Uchuudonge wrote
creating stable chaos
making patterns where there should be none
sewing order into the chaos
you spit in the face of random numbers, of chaos
Apr 18, 2009, 5:06 am
#3
Joined: Dec 15, 2008
Posts: 100
chaostrom wrote
Ahoy Serefan! Still working on IVANOV? I'm of no help but good luck all the same.

Not still working, I quit around new year, 'cause of some personal problems & stuff, and I've restarted just this week, with some major refactoring and I must tell you I'm really proud that everything is still running smoothly, and it's being completed piece by piece.

It won't be like the original IVAN. I knew that from the beginning (some small changes I already made: scrollbar at the messages screen, player is always in the middle of the screen). The hardest part will be getting the calculations for everything, or at least get some with the same game balance.
Jump to