[HL2MP] Make blood server-side only
An issue in HL2DM is that the blood impact effects are client-sided. This creates false data for players at time because the impact effects can be shown to the player shooting their gun but no damage will be registered by the server. An example of the issue can be found here: https://www.youtube.com/watch?v=-ivOugLRGZM
When players are in movement, this issue tends to happen a lot more frequently.
What about SpawnBlood or UTIL_BloodDrips?
have you tested this? i think blood effects dont get networked to the attacker by default, so wouldn't this just make blood effects never visible for the attacker?
have you tested this? i think blood effects dont get networked to the attacker by default, so wouldn't this just make blood effects never visible for the attacker?
DispatchEffect creates the temp ent for blood effects so this should be fine?
have you tested this? i think blood effects dont get networked to the attacker by default, so wouldn't this just make blood effects never visible for the attacker?
In the competitive scene at least, most if not all would tell you this would not be an issue i.e. they would rather have no blood impact than false data. In fact, some play with low violence on just to get rid of the blood impact client-side. Some servers will use hit sounds to confirm hits. In the above video, hit sounds are actually on but they do not play because no hits are registered by the server.
This absolutely needs to be fixed in such a way that the blood impact effects are moved server-side.
turning off blood impact effects for our own attacks sounds weird, there would be no feedback for attacks that hit, this pr doesnt feel like it was tested
effects that are predicted/replicated by the client like blood impacts, bullet sparks, bullet decals, etc are not networked to the attacker that causes those effects
instead of just deleting the client's own blood effects altogether, it should also be networked to them
this is what tf2 does, blood impact effects are serverside and spawn on the exact hitpos of the attack (blood decals on players are still clientside, funnily enough)
just tested this pr and it does just straight up remove the blood impact particle effect, not ideal
Any chance you have code to propose to better fulfill the overall objective?
like i said, tf2 already does it, the code is right here in the same repo
CBaseEntity::TraceBleed is what's used to do the blood effects (blood impact particle effects, blood decals sprayed on the walls, etc)
https://github.com/ValveSoftware/source-sdk-2013/blob/0759e2e8e179d5352d81d0d4aaded72c1704b7a9/src/game/shared/baseentity_shared.cpp#L2270
inside CBaseEntity::TraceAttack is where it gets called for bullet hits, both on the server and client:
https://github.com/ValveSoftware/source-sdk-2013/blob/0759e2e8e179d5352d81d0d4aaded72c1704b7a9/src/game/shared/baseentity_shared.cpp#L2145
to disable the clientside blood effects in hl2mp, then just comment out this line from the C_HL2MP_Player::TraceAttack method:
https://github.com/ValveSoftware/source-sdk-2013/blob/0759e2e8e179d5352d81d0d4aaded72c1704b7a9/src/game/client/hl2mp/c_hl2mp_player.cpp#L191
and here's how tf2 networks the serverside blood effects to the attacker (who normally will be filtered from receiving such effects because they're expected to replicate those effects clientside)
by using CDisablePredictionFiltering before calling TraceBleed in the CTFPlayer::TraceAttack method:
https://github.com/ValveSoftware/source-sdk-2013/blob/0759e2e8e179d5352d81d0d4aaded72c1704b7a9/src/game/server/tf/tf_player.cpp#L8424-L8428
I don't work with TF2, only with HL2DM.
The issue is that I don't work with a mod, I and other folks like @weaponcubemap modify server behavior and can only do that. The question is now to know how you would still get rid of the client side blood impact effect without involving client modifications. I have had some progress here and there, but it comes with side effects I don't like. I'm open to suggestions.
you can network the accurate serverside blood effects with a modded server
you cannot get rid of the predicted clientside blood effects without a modded client