Replicating Mechanics With The Source Engine

Blue552

L3: Member
Sep 16, 2009
137
18
Is it possible to replicate mechanical systems within the SDK?

I don't mean using func doors and dynamic props to simulate what a mechanical system might look like, but actually have a single power source which powers an entire system.

Some examples of what I want to do:

- Create a simple gearing system
- Converting rotational movment into directional movment (like the piston in a car engine but the other way round)

I've been having trouble finding the correct tools to enable this to work as there doesn't seem to be any axis constraints. Also assigning the moving brushes to suitable entities has been trial & error as func_physbox can misbehave when force is applied.

Have basic newtonian physics been implemented into the soucre engine? Even things as simple as applying a force?
 

Altaco

L420: High Member
Jul 3, 2008
484
120
Source has a pretty nice physics engine and this sort of thing is quite possible. Have you ever played garry's mod?
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,670
It's kinda funny you are asking these things, because they were a cornerstone of the whole advertising of HL2/Source back when it came out. :p

That said, it's not really the greatest idea to try doing it. It takes a tremendous amount of processing power and network traffic to do physics in multiplayer.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
If your goal is a physics simulator, I'd suggest looking into things like Blender which uses the "Bullet" physics package. (Mainly because you can easily see the results.)

You can also mess with the physics package alone (there's even a Java port, Jbullet) but AFAIK the stuff in TF2 is more geared towards things exploding and falling down in a theatrical way rather than an accurate one.

Disclaimer: I considered making a small set of rigid-body physics classes for a project, but only got as far as finishing the implementation of a Runge-Kutta integrator before I got bored. I should go back to it sometime.
 
Last edited: