Page 1 of 2
HitBoxes and multipul attributes Pickels we need your help.
Posted: Thu Nov 17, 2005 9:10 pm
by fps
i was looking through some of my professionaly made store bought games recently and noticed that many first preson shooters use a hit dectection system were foes have many different hit boxes on the different parts of their bodies, this system allows for features such as head shots, detecting being shot from behind, and wounding a foe by shooting them in the foot. it also uses different wounded animations corresponding to where the foe was hit.
HERES WHERE RF COMES INTO THE PICTURE.
I believe that this would be possible by turning the our foes bounding boxes off and creating pawns attached to said foes bones with bounding boxes that dectect damage and send an order to that pawns script telling it to animate and and recieve damage acordingly.
this would reduce the size of the areas that appear as empty space around the pawns that you can hit with bullets, thus making the game FEEL more lifelike. this also means that shooting the bounding boxes of extremities such as legs and arms could be made to detect damage but send a damage to the foe that is less, (a shot to the head might kill instantly but a shot to the lower leg area would just wound).
AND yet more can be done with this. if the foes feet have seperate bounding boxes attached to their bones then the pawns feet will be pulled to and stay level with the floor even if in the animations . this would be great for terrain areas
Posted: Thu Nov 17, 2005 9:15 pm
by AndyCR
good idea, though id do it with per-bone collision detection, which rf already has.
Posted: Thu Nov 17, 2005 10:36 pm
by Guest
PerBone collision detection?!?
we have that?
How does it work in reality factory?
how can I intergrate it into my pawns scripts?
Will it work as well as the plan discussed above should theoretically work?
I think if it works like the name makes it sound like it works it could really improve my game and others that other people are working on too.
Thank you,
fps
Posted: Thu Nov 17, 2005 10:42 pm
by AndyCR
here you go.
char* GetLastBoneHit();
Returns the name of the bone last hit.
Posted: Fri Nov 18, 2005 4:41 pm
by Guest
i still dont think i fully understand how to use this and i am not sure where this command would go in the script.
could you give me some more details?
Posted: Fri Nov 18, 2005 5:01 pm
by AndyCR
i believe you would use it like this: (warning psuedocode)
if(getLastBoneHit() == "head")
{
newOrder("dieHead");
} else {
newOrder("dieNormal");
}
for head hit detection in this case.
Posted: Fri Nov 18, 2005 10:40 pm
by fps
would this go in the first few lines of the "pain" order?
also would it work if i set it up like this?
(psudo code also)
(Hit Order)
if the value of an attribute(Shot) goes down but is still higher than zero
}
if(getLastBoneHit() == "head")
{
newOrder("DieHeadShot");
} else {
if(getLastBoneHit("torso") == "")
}
newOrder("PainTorsoShot");
} else {
newOrder("PainNormalShot");
}
{
if the value of an attribute(Punched) goes down but is still higher than zero
}
if(getLastBoneHit() == "head")
{
newOrder("PainKnockOutPunched");
} else {
if(getLastBoneHit("torso") == "")
}
newOrder("PainWindedPunched");
} else {
newOrder("PainNormalPunched");
}
Now lets say that the attributes are checked and the return a zero, in the top of the script the ShotDead order and the PunchedDead order will be called accordingly.
(ShotDead)
}
if(getLastBoneHit() == "head")
{
newOrder("DieHeadShot");
} else {
if(getLastBoneHit("torso") == "")
}
newOrder("DieTorsoShot");
} else {
newOrder("DieNormalShot");
}
(PunchedOrder)
}
if(getLastBoneHit() == "head")
{
newOrder("DiePunchedHead");
} else {
if(getLastBoneHit("torso") == "")
}
newOrder("DieTorsoPunched");
} else {
newOrder("DieNormalPunched");
}
Please read that through and tell me if it needs to be fixed.
Another thing as you may have noticed is that i am checking 2 different attrubutes in this script....the problem is is that i have never gotten it to work.
Do you know how to and how i would go about modifying and setting my pawns scripts to check multipul attributes?
and if so could you please walk me through it?
I could post my base script so you could see what we are working with if you need me to, should I?
I want to be able to check for the following attributes but not all need per bone collision detection, just the starred stuff:
Shot *
ShotSilenced*
Punched *
Knifed*
EletricalShock *
ArmorPeircing *
Explosive*
HighExplosive
LazerBurn*
Fire
DirectFire (hit by a flamethrower style weapon)
HighDirectImpact (hit directly by a mortar)
ExplosionShockwave*
FlashBanged
Smoke
Gassed
Thanks,
Fps
Posted: Fri Nov 18, 2005 10:50 pm
by AndyCR
I'm afraid I have not learned enough scripting to help you with that... Pickles, are you there? Pickles could help you immensely.
Posted: Sat Nov 19, 2005 12:26 am
by fps
i will try to get him to help me with this.
ummm...
How do i get him to help me with this?
Should i like change the name of the post to include "Pickles are you out there?" at the end or somthing?
God i ask a lot of questions

Posted: Sat Nov 19, 2005 12:40 am
by fps
hmmmm....
thats odd.
I don't see pickels name on the member list.
Or in the rest of the scripting fourm for that matter.
He was on the old fourms, is he still here?
Posted: Sat Nov 19, 2005 2:00 am
by AndyCR
He comes on under Guest. He might see it. There are also others more than knowledgeable enough to help you, if they see it and have time to do so.
Posted: Sat Nov 19, 2005 9:29 am
by Jay
I am not sure if RF072A already has it, but i've heard of an 'interface' for pawns that allows every pawn to access the variables of every other pawn. It works like this:
(PawnName).(FieldName) = (Value);
FieldName is one of those variables you make with those [] brackets. (Like DAMAGE[2] or IDLEANIMATION[Idle]) Look in the premade scripts and you will know what i mean.
in a scripted player that has already targeted an enemy it looks like this:
if(ACTION == "Attack")
{
if(WEAPON == "Knife")
{
self.target_name.KNIFED = self.target_name.KNIFED + DAMAGE;
}//WEAPONKNIFE
}//ACTIONATTACK
I don't know more, but i hope this helps.
Posted: Sat Nov 19, 2005 2:05 pm
by AndyCR
and just for the record, i believe in that case PawnName refers to the szEntityName set in the level editor.
Posted: Sat Nov 19, 2005 4:30 pm
by Jay
Yup that's right.
Posted: Sun Nov 20, 2005 5:03 pm
by Guest
i think you are talking about the foe detecting what kind of weapon the player had when it was killed, right.
ive toyed with this idea before but i decided against it because it would to limiting and it would not allow for the game to function correctly with allied pawns, it would not make sence if an allied tank caused flashbang damage beacause that was the weapon the player had selected at the time.
There has got to be a way for the script of a pawn to check for more than one damage attribute, Right?
I dont know for shure and all of my previous attempts have failed.
I would be willing to narrow the list of damages decteted if i needed to.
Sombody has got to know the answer.
I will change the name of the post and see if i can draw some more eyes this way.
So far this post has helped me immensly.
Thank you,
Fps