Every time there's lag in Willard, it’s often because CPs are shooting antlions, and their ragdolls cause the entire server to stutter. Admins are then forced to toolgun remove all the ragdolls to fix the issue. Ragdolls in GMod are notoriously problematic because of how demanding they are on the physics engine, especially when they’re trampled, stack on top of each other, or clip into buggy surfaces, causing constant collisions.
Regarding ragdoll carrying, it’s also not ideal. We often grab a body and run at full speed, dragging it to cover or away from a scene
While not everything can be fixed and or done, I believe the following changes would improve the system:
The lag doesn't entirely come from the physics engine, or at least not entirely. Drag around a bunch of ragdolls in SP and things are fine.
Willard's ragdoll lag comes from network prediction. Moving ragdolls require a lot of data to be processed and networked to every player per tick from the server to replicate them clientside. The server only has <50ms to simulate the world per tick to maintain 20 ticks. If it takes longer than that the server tickrate can fall into the teens or single digits which only the problem worse as delta time between ticks increases. Your game runs at a much higher tickrate so it has to predict where the ragdoll is
going to be between updates from the server. It's during that prediction that strange collisions can happen which can cause lag from havok or from engine partical/sound effects.
1. Fix the offset
make ragdolls follow the crosshair properly, allowing us to lift bodies onto ledges or throw them off said ledges (funny cp throw lesbian off window). Currently, they get stuck near the player’s feet, making it nearly impossible to interact with small obstacles, sometimes killing the person we're carrying on stairs and even hurting ourselves. Furthermore colliding with the entire floor causing more lag.
Helix forces the ragdoll to the floor for a
reason. You're
dragging the body along the ground, as your typical human is incapable of deadlifting a limp body any higher than their waist.
If you want to throw someone off a ledge, you'll just need to get help or RP it with rolls and have an admin physgun the ragdoll.
There is a minor issue at L#157 in
/entities/weapons/ix_hands : This shouldn't be doing a flat -32 as the shoot position is not always +32 units from the floor. It needs to calculate your distance to floor with a trace then set the z to a few units above that to prevent the entity from being pushed under the floor (by this code) and pushed back out (by havo) every tick.
2. Remove Collisions:
Disable collisions between ragdolls and players or other ragdolls to prevent pileups, tripping, and our ankles being broken.
I don't think that it's wise to set the collision group to something which would prevent a ragdoll to interact with the world. It's not exactly realistic. Most of the problems come from when you
hold the ragdoll, but that issue is a bit more nuanced than it seems on the surface.
L#247-277 in /entities/weapons/ix_hands : When you pick something up you don't actually pick up that
thing. The game spawns a new entity at the center of the AABB of whatever it is you're picking up, sets it's model (and therefore it's collider) to a bugbait. It sets it as nodraw (so it's invisible and doesn't get networked to anyone), nonsolid, mass to 2048, no gravity or collisions, and collision group debris (collides with nothing but world and static props). It then
welds this entity to whatever it is you're holding. If that thing is a ragdoll, it welds it to whatever bone is closest to wherever you're looking at the time. Every tick it uses a shadow controller to move this bugbait towards a space exactly 64 units in front of you (or 32 if you're holding a ragdoll).
Its during the compute of this shadow control that a tremendous amount of collisions can happen as the ragdoll is welded to this entity and is dragged along with it through whatever shit may be in the way at the time. This can probably be updated such that the collisions for the ragdoll are set to group 20 so that the ragdoll will not collide with players or props
whenever it is held instead of the current collision group 11 (does not collide with players or vehicles).
3. Add a Grab Timer:
Introduce a timer where we must hold down mouse 2, for one second before the body is grabbed, adding intent and reducing rapid grabs.
4. Apply a Movement Penalty:
Slow down players carrying a ragdoll to make it more realistic and discourage sprinting with bodies.
APPROVED