ACF-Team / ACF-3

ACF
MIT License
67 stars 54 forks source link

Player Damage Overhaul #345

Closed LiddulBOFH closed 1 year ago

LiddulBOFH commented 1 year ago

Decent overhaul in how player damage occurs

Now, when an ACF bullet hits a player, a collection of hitboxes is checked with ray intersection to figure out what part of the body is hit, and then damage is calculated from there. If a player has any suit armor, 2 more hitboxes are checked (vest and helmet) and if they are hit first, then the bullet must "penetrate" them. This gives the player a possible chance to survive small caliber rounds.

The body hitboxes include the head, torso, and legs. Arms were left out for less overhead, and would have required further checking for overpen, as right now the system will stop at the first part hit. The vest covers front and back, but leaves the sides of the torso vulnerable, and the helmet covers the top 1/3rd of the head.

The reason for this change stemmed from me not being impressed with the damage that bullets with real statistics fired from SWEPs just didn't do the damage that they should have, and found that the squishy damage functions were only partly functional.

This system could also potentially pave the way for player hitboxes while in seats, but that requires work towards an "alias" entity that fits the playermodel that would get hit instead of the seat.

Due to the nature of actual player bone hitboxes, it was far less reliable to check for them with traces, but maybe work can be done to use those some day.