05-14-2012, 06:17 AM
(05-14-2012, 12:26 AM)Mr. Bougo Wrote: How do you determine that something "hit the player"? You say in your first post that only then do you scan each bone.
And what do you do about crouching which brings bones closer to eachother and therefore makes the player more vulnerable to splash damage?
The bounding box collision is still used to detect a player was hit, so we know what bones to check. The code would be written (or mutator hooked) from void Damage() which always runs for each entity that takes damage. This would work exactly like my damage effects which IIRC are in qcsrc\client\damage.qc if anyone wants to see the code.
And the crouching thing would be intentional. Because each body part is in another position, you would take damage over the current animation. I believe this makes things even more awesome.
For example, if someone is shooting you straight into the back while you're standing still: You might take more damage because your arms are positioned more closely to your side. But if you shoot someone from the same spot and orientation while they're firing, arms take less damage because you brought them more in front. If you were shooting the player in the face instead, the effect would be the opposite (arms would be closer to the blast spot with that animation).
Only thing I don't agree with is the idea that Xonotic is too fast-paced for such a feature. A good damage system doesn't go to waste because movement and firing are fast. No matter how fast, one will probably notice when a shot aimed toward the head takes more damage and one fired at the legs takes less.
On another note, I might also add bone culling. So the closest bone takes more damage, then the further the rest are the lower they are rated (as an addition to existing range checking). This will make it so that being shot in the right arm from the right side will cause your torso to take less damage, because your arm absorbed the shot and covered your torso.