The Garry's Mod VPhysics Replacement Project

This project is meant to replace Valve’s closed source physics system with bullet physics.
It was originally started by Jcw87 after Garry suggested a replacement in another thread.
The original thread

Vehicle demonstration:[/vid]
Physgun demonstration:
Player collision demonstration:
Lots of barrels:

**Things that have changed since the original:
**- Shadow controllers rotate props properly (that means the physgun is fixed)

  • You can interact with props such as pushing them.
  • Vehicles have been mostly implemented ([del]handling[/del] and airboats have not been implemented yet).
  • Concave props work correctly.
  • Some surface properties are implemented.
  • Multithreading (partially works, only in collision detection not constraint solving)
  • All constraints implemented (except for pulley constraint)
  • New collision shapes (cylinders/cones/spheres)
  • Too many things for me to remember.

**Things that still don’t work since the original:
**- Most physics event callbacks

Things we will be doing in the future:

  • Exposing new interfaces and functionality.

Note: Although Garry moved this thread to the Gamemodes & Addons subforum, this is NOT a lua module.

Precompiled Builds: Gran PC has set this up at (alternative link if this is down)

Note: This thread isn't meant to talk about GTA IV or anything off topic. The old topic was constantly being derailed, which put me off from making this thread.

The project is available at
Developers: No prerequisites! Just remember to setup the git submodules (explained in the readme).

Q: How do I install this?
A: Pretty simple! Copy vphysics.dll into the engine bin directory (for GMod this is steamapps/common/GarrysMod/bin).
If you’re in the right directory, there will already be one there which is valve’s vphysics. You can either overwrite this or back it up (I recommend backing it up) and copy the new one in.
gmsv_vphysics_win32.dll is a GMod-specific Lua module that exposes new features to Lua developers. To install, copy this to GarrysMod/garrysmod/lua/bin.

Q: Can I use vphysics on games other than Garry’s Mod?
A: Absolutely! VPhysics should work on any source engine game, but be advised: it’s only tested on Garry’s Mod.

Q: Is there a chance I could be VAC banned for having VPhysics installed while I play on a multiplayer game?
A: No. VPhysics will not trigger VAC (I’ve accidentally connected to servers with VPhysics installed more than once, and I haven’t been VAC’d yet.)

Q: Do clients also have to have vphysics installed?
A: Nope! Source engine clients don’t predict the motion of physics objects or other physics entities.
The only thing predicted is the interactions between players and physics objects, but it’s too minor of a difference to justify requiring clients to install VPhysics.
However, depending on how things go, in the future this may become a requirement due to new features I may or may not add.

Q: How can I take advantage of newer VPhysics features?
A: In Garry’s Mod, I’ve bundled a Lua module with VPhysics (gmsv_vphysics_win32.dll). There isn’t any documentation however, instead you’ll have to look at the source code.
For other source mods, VPhysics has an updated interface which is included. You can see GMVPhy for examples of usage.

holy shit this thing is alive!


Back from the dead I see.

Very impressive!

Update: Gran PC has provided us with automated builds at
Be sure to thank him.

Sorry to ask, but since I’m really interested in the outcome of this project and since no one posted here for 3 weeks, is there any updates?
I see builds from 20/02/2013 on Gran PC’s website, so I wondered…

Thank you for picking up the project, I wish I could help with it, but my programming skills are not that good…

There have been updates, I haven’t been updating this thread because it has become apparent to me that this isn’t receiving enough attention to deserve a thread. Instead, I’m posting updates in the WAYWO.

Just because people don’t post doesn’t mean they’re not interested, anyhow, keep up this amazing work!

In the next update I’ll try to add a way to load this without all the messing around.

Just put the .dll in the garrysmod/lua/bin to install?

Sorry, it’s not as simple as that.
It has to be copied to the engine’s modules directory and steam has to be configured not to overwrite it.

Oh alright, didn’t know. Not use to using modules so I wasn’t aware of that. Good thing I know now though. :slight_smile:


boolean convar phys_usethirdparty

Would that be good?

maybe a convar that specifies the name of the dll to use?

I doubt these will work due to the fact that vphysics is loaded when the game starts.
Maybe a command line parameter?

I really wanted to see this take off and be a viable alternative. vphysics on linux seriously sucks ass and valve even left it horribly broken for over 2 years at one point.

I’d like to see if it’s fixed in source 2.0 :smiley:

It’d be really nice if I could get some developers to hop on this project and help.
You don’t even have to ask me to add you to a list of collaborators, just fork the github project and use pull requests.

So garry, was this added with the 160 update?

Good news: Bullet 3.x is going to be out soon, apparently with new parallel solvers and dispatchers. Hopefully we can start using it ourselves, and maybe enable multithreading.