Kisak-Strike icon indicating copy to clipboard operation
Kisak-Strike copied to clipboard

Physics(Bullet3)

Open LWSS opened this issue 4 years ago • 1 comments

This issue is dedicated to the Open Source bullet physics.

First off, the appropriate people should be credited: https://github.com/DrChat/Gmod-vphysics/ https://github.com/dyanikoglu/source-sdk-bullet-physics

Known Issues

  • ~No Noises/Particles when bounced around on terrain( can't be done until the deactivation problem is fixed )~ Deactivation thresholds changed back to bullet stock settings. Noises/Particles got fixed by making the simulation more accurate -- this was done by changing the maxSubSteps in stepSimulation(). ( Basically allows for smaller resolution steps when collisions happen
  • ~Small things like pistols can go through the floor sometimes~ This was also fixed by changing maxSubSteps
  • ~Things seem to move for too long after coming to a standstill, sometimes forever~ Fixed by changing sleep thresholds back to bullet stock settings
  • ~GetSimulationTime() impl needed for the ragdoll sleep after x seconds convar.~
  • ~Getting stuck on the edges of various objects(boxes/crates/bricks)~ Fixed by changing raytrace TraceBox() thresholds
  • ~Objects are a bit above the terrain instead of appearing to rest directly on the terrain.~ Fixed by lowering collision margin in LedgeToConvex() on small objects.
  • Ragdolls are a little unstable. ~Sounds are currently disabled on them due to the massive amount of bone collisions.~ Ragdoll self-collisions have been disabled and sounds re-added CSGO also has a built-in hack to force them to sleep after 2 seconds. ( see convar ragdoll_sleepaftertime )
  • The friction sound is very lame, I changed it in csgo/scripts/game_sounds_physics.txt it takes some sort of .wav loop but it just sounds bad no matter what it's set to. I actually think the original one in csgo was broken(too quiet to hear)
  • Threading is experimental, tested a bit, seems that performance is better without it.

Physics overlay works.

Things like the swings on overpass kinda work ( unlike kisak-physics ).

Pros and Cons of BulletPhysics vs Kisak-Physics

Pros

  • Free license
  • Code is not from 1990s and has decent documentation, widespread usage, and is pretty clean.
  • Less crash-prone
  • More complex physics
  • Supports threads (although experimental)

Cons

  • Not the original CSGO physics engine
  • Performance can tank for a moment when changing rounds on maps with lots of props ( see mirage ) - This is mainly due to the position of all the physics props being reset and dropped to the ground via gravity. ( update: although recently I have noticed this occurs on retail csgo as well. )
  • Tunneling problem tradeoff vs performance ( see convar bt_max_world_substeps ). A value too low will allow pistols and small items to fly through walls at high speed, however a value too high will degrade performance when collisions occur.

Bullet Physics(old)

https://streamable.com/z5uf0f

Kisak Physics

https://streamable.com/8y2glq

LWSS avatar Jan 21 '21 16:01 LWSS

Well, can your bullet be used in source-2013?

klaxons1 avatar Sep 24 '21 19:09 klaxons1