DrChat / Gmod-vphysics

Replacement vphysics module for the Source engine (originally meant for Garry's Mod)
Other
92 stars 15 forks source link

Use case? #62

Open Ninjadude101 opened 3 years ago

Ninjadude101 commented 3 years ago

Sorry, I appreciate this isn't the right place but I couldn't find links to a discussion.

What is the use case of this module? Why does it exist, what brought it about? I'm curious as to what, specifically, of the many problems with Valve's vphysics it aims to solve.

Thanks.

NukemD commented 3 years ago

The Source engine uses an ancient version of the Havok physics engine. By playing any Source engine game, it's readily apparent how broken and limited it is. Quite a few physics effects are simulated as model animations (physics models breaking apart, long physics sequences like the bridge in HL2 Episode 2 being destroyed, etc.) because the ancient version of Havok used has no hope of ever doing anything remotely close to those effects.

Garry's Mod over time increasingly pushed the limits of both the Source engine and Havok. GMod versions 1-8 were rudimentary, basically taking advantage of existing engine functionality and letting players directly interact with them, like creating attachments, hinges and motors between physics objects and the world. GMod 9+ drastically changed that with the Lua programming system. Precision building systems became possible, which required more advanced physics simulation, which just wasn't available. So addons like Wiremod started to have to fake physics effects with animations that have the limitation of not being interactable with the world.

The Bullet physics engine changes all of that. It's a far more advanced physics system that allows orders of magnitude more physics simulation without falling flat on its face like Havok does. The two videos showing breens and headcrabs being blown up is a very good demonstration. If the same thing were done in Havok, the game would either crash, freeze or slow way down while the ragdoll physics was being calculated. Bullet has no problem simulating the same setup, and no slowdowns happen.

But despite how good of a Physics engine Bullet is, the project to integrate it into the Source engine is far from complete, and probably never will be. It originally started off as a proof of concept and never really moved much beyond that.

Ninjadude101 commented 3 years ago

Thank you very much for that comprehensive overview. With all that in mind, to utilise Bullet in a multiplayer environment, I assume both the server and the clients would all need to be running Bullet and not just the server itself? In other words, one can only ever truly take advantage of this in single player, or if it ever gets adopted into the source engine (which I appreciate at this stage is highly unlikely)?

Thanks again.

NukemD commented 3 years ago

Yes, both the server and client would need to have the same physics engine.