Damage alterations at different range.

Guten tag!

In a FPS like Halo I believe that damage from projectiles are altered over range. Allow me to explain. At point blank range let us say a certain gun damages 50 health point out of a 100 health points every shot. But when the player is further away(let us say) 25 meter the damage done drops significantly now to around 15 health point ever shot.

So how can one achieve damage alterations over range? Is measuring distance a good way? In terms of performance it would properly have an effect on frame rate.

No, distance is a perfect solution. The bullet can record its position of origin, and once it collides with the target, the calculation is performed once. The other tasks of a typical game drowns out distance measurements: you can perform several each frame and still be limited by rendering. One calculation every so often won’t make the least bit of difference to your frame rate.