2D damagetext
Saves a bit of bandwidth by not sending the player's location since it can be determined client-side when the player is visible and probably should not be revealed when he's not.
Partially fixes #1716 (closed)
- Falling damage attributed to attacker should no longer reveal position
- Weapons with large radius doing damage through walls will no longer reveal precise position (just amount of damage and number of players hit)
- It seems burning players send their location to the client even when behind walls (maybe because they're a sound source?) so napalm nades will still leave a trail behind players
- The warpzone issue affects more 2d entities (e.g. waypoints) so should be considered separate.
A temporary fix could be using 2D damagetext when the 3D one would be out of view if there is interest
I am not completely happy with the visuals and could use some feedback - is it confusing that some damagetext is stationary relative to world and some is not?
I also added another field to entity (m_shrink_rate
) which is not strictly necessary. Is it possible to do the rate = 1 / lifetime
conversion in the menu code so I can get rid of it again?
EDIT:
Now also using 2d when the 3d damagetext would be out of view. Feels much more consistent because i don't have to think about what got culled where to look for damagetext - if I can see the enemy, it'll be at his position, if not it'll be in 2d next to crosshair.
Did some testing on WTWRP Overkill - no complaints - although in Overkill 2d damagetext is limited to nades, falling/environment damage and the occasional warpzone.
For now using AUTOCVAR
macro instead of AUTOCVAR_SAVE
because the latter would cause issues for 0.8.2 players if we decide to change the defaults. Before this MR is accepted, I'll switch to AUTOCVAR_SAVE
.