Skip to content

Fix damagetext not stopping damage accumulation after enemy's death and optimize damagetext code when player is hit by multiple projectiles at the same time

terencehill requested to merge terencehill/damagetext_stuff into master
  • Fix damagetext not stopping damage accumulation after enemy's death
  • Optimize damagetext code by spawning only one damagetext entity when player is hit by multiple projectiles at the same time, e.g. shotgun. It reduces CPU usage, networked data and precision errors

Implementation details of the bug fix:

It's not possible to implement it client-side because players are culled when not visible, so the server has to somehow let know the client that a player died. Instead of sending a message right when a player dies I opted to send a stop-accumulation flag together with the damage text message on the next damage that the client deals to another player after respawn. This approach requires keeping track of all attackers for each player but saves a lot of bandwidth. Btw operations on this list (insert, list deletion and checks) should be pretty efficient thanks to the use of an intrusive list.

Edited by terencehill

Merge request reports