(no title)
TapamN | 5 months ago
The collision shape used for a character in DX is a single cylinder. The game looks at where on the cylinder the collision point of the shot is, and tries to figure out if it's a head, body, or leg shot. It does this by checking how high the collision point is, with the lower X% being legs, top Y% being the head, and the middle being the body.
If a shot hits the head section, it runs some additional checks, and can sometimes still count as a body hit. There was some weird code that, after you stared at it long enough, looks like it ended up splitting the head area into compass aligned 1/8ths (so north, north-east, east, etc) and hits to the N-E-S-W octants would count as a head shot, and a hit to the NE-NW-SE-SW octants would count as body shots. (I couldn't tell if the angles rotate with the character, or are absolute relative to the world.) I think there was also a check for hits on the top cap of the cylinder, so that the hit would have to be close to the center of the cylinder to count as head hit, and near the outer rim would count as a body hit.
Hm, I should just make a diagram. Here: https://imgur.com/a/KG6MF1k
I guess what they were trying to do was make the actual head hitbox a smaller section of the head level, so that a shot that should go over the shoulder and miss would just count as a body shot and not a true headshot. And if you made a test map, with the player and a static test enemy placed in a line, this could work reliably from a fixed position. But when you actually play DX, and approach enemies from various angles, headshots inexplicably fail.
TapamN|5 months ago
https://pastebin.com/bwjaiDj7
It looks like I misremembered/misinterpreted some stuff. It looks like the top of the head behaves like the sides of the head, extending upward, forming a + shape.
Judging by how the arm/leg damage works, it the collision hit zones rotate with the enemy. Offset appears to be were the collision point is releative to the character's rotation, since it's also used to determine front/back and left/right collision. So for a hit to count as a headshot, it has to hit a cardinal octant of the collision cylinder.
Edit:
Updated diagram: https://imgur.com/a/Mec7HGm
reactordev|5 months ago
philistine|5 months ago
I still remember how happy I was when I finally had gotten rid of any sort of sway on my reticle. Yeah, I can play this game like Half-Life now!.
LarsDu88|5 months ago
Anvoker|5 months ago
If you first push yourself as close as you can get to the enemy model and attack the general area of their torso, it works every single time. But again, this is just me taking a guess as to what the problem you're referring to is!
westmeal|5 months ago
user____name|5 months ago
xen0|5 months ago
So torso hits from behind are the way to go.
NL807|5 months ago
user____name|5 months ago
anthk|5 months ago
mielioort|5 months ago
[deleted]