Anybody thought about getting advanced physics into Torque?
by Stefan Beffy Moises · in Torque Game Engine · 09/06/2002 (2:23 am) · 21 replies
Hi all,
I was just looking at some UT2003 and DX2 videos and realized what great physics these games will have...
players falling down hills, rolling barrels, exploding objects, etc. and I was wondering if anybody tried to integrate some 3rd party physics engine into Torque yet?
There are some open source engines available, one of the most promising being ODE (Open Dynamics Library, q12.org/ode), but I'm not quite sure how they would fit into Torque and what would be necessary to e.g. improve player or vehicle physics with such a physics engine...
Any thoughts?
I was just looking at some UT2003 and DX2 videos and realized what great physics these games will have...
players falling down hills, rolling barrels, exploding objects, etc. and I was wondering if anybody tried to integrate some 3rd party physics engine into Torque yet?
There are some open source engines available, one of the most promising being ODE (Open Dynamics Library, q12.org/ode), but I'm not quite sure how they would fit into Torque and what would be necessary to e.g. improve player or vehicle physics with such a physics engine...
Any thoughts?
About the author
#2
09/07/2002 (11:59 am)
i'm definately not a physic junkie here- but that sure would kick ass.
#3
As far as I know, such physics as that (rag doll physics) require bone animation. Now, that is possible in the Torque engine, but I do not get the impression that it is as utilized as keyframe animation. Also, you need to do some heavy math even once you have the bone layout.
Without looking into it, I would say that it is infeasible for the gain in gameplay it represents. Of course, it has a huge cool factor, though.
09/07/2002 (12:15 pm)
Quote:Any thoughts?As with programmable shaders, this would be nice to have, although I doubt it will come available for the likes of us soon.
As far as I know, such physics as that (rag doll physics) require bone animation. Now, that is possible in the Torque engine, but I do not get the impression that it is as utilized as keyframe animation. Also, you need to do some heavy math even once you have the bone layout.
Without looking into it, I would say that it is infeasible for the gain in gameplay it represents. Of course, it has a huge cool factor, though.
#4
Without a good physics system you are relegated to a very small set of actions, or a long implementation time for a million special cases. Working within a robust system gets you around this.
Vic-D
09/09/2002 (6:20 pm)
Peter, I have to disagree. I think Deus Ex 2 is going to blow more than a few minds with its physics system. Warren Spector and crew tend to make systems that allow players a wide range of choices in interacting with the world, and I am sure they are taking full advantage of having a great physics engine at their disposal. Without a good physics system you are relegated to a very small set of actions, or a long implementation time for a million special cases. Working within a robust system gets you around this.
Vic-D
#5
However, I wouldn't mind seeing a torque based pool simulation, hehe.
Anyone who played DX might remember the semi-working pool tables? I really liked that touch.
09/09/2002 (6:37 pm)
Well the detail on physics should be determined by the detail of the game, of course. If you have a super fast paced action game in which everything spontaeously explodes or a flight sim, you don't need rolling barrels.However, I wouldn't mind seeing a torque based pool simulation, hehe.
Anyone who played DX might remember the semi-working pool tables? I really liked that touch.
#6
09/09/2002 (6:40 pm)
I think the problem with adding better physics to torque is that everyone needs different bits of physics. Sure, there is some generally applicable stuff, but not too much that isnt already in there. Also, it takes additional processing for that stuff, so not everyone wants that in their engine.
#7
A plug-in style thing would be perfect. That way you could select parts that would most benefit your game.
09/09/2002 (6:46 pm)
Exactly.A plug-in style thing would be perfect. That way you could select parts that would most benefit your game.
#8
Obviously there is already an excellent physics system in place but it could be so much better with ragdoll like physics e.t.c
Having every object in a world be affected by physics is just awesome stuff. Particularly for an action game.
And i have a ton of imaginative game ideas that could take place with such physics in game.
Melv once your done with the Particle System how bout some physics ? :P *cracks whip*
09/09/2002 (7:42 pm)
I think to keep in touch with all these new games coming out , Physics is one area which could benefit.Obviously there is already an excellent physics system in place but it could be so much better with ragdoll like physics e.t.c
Having every object in a world be affected by physics is just awesome stuff. Particularly for an action game.
And i have a ton of imaginative game ideas that could take place with such physics in game.
Melv once your done with the Particle System how bout some physics ? :P *cracks whip*
#9
or....
we could do many code snippits of physics applications to the engine and use it like a resource bank for those who have the engine. then everyone who want the certain stuff could pluck what they want.
i like the latter more now that i think about it....
whaddya say?
09/09/2002 (9:18 pm)
I dis-agree with max and josh. even though everyone needs certain physics, how could too many real life physics hurt. although some may want to alter them, maybe we could place them in special folders to make them recognizable as the physics folder, then people could down grade the engine as they see fit.or....
we could do many code snippits of physics applications to the engine and use it like a resource bank for those who have the engine. then everyone who want the certain stuff could pluck what they want.
i like the latter more now that i think about it....
whaddya say?
#10
I agree with both sides on this issue. Every game is going to need their own physics engine specific to their game. However, it's possible that games may be able to use similar physics engines with values modified to fit their game. That's what OOP is all about: re-usable classes. If anyone comes up with some good physics classes not yet implemented in the TGE it's possible that it may be integrated into the TGE for other developers to use.
09/10/2002 (7:02 am)
Physics "directories", not "folders". :-)I agree with both sides on this issue. Every game is going to need their own physics engine specific to their game. However, it's possible that games may be able to use similar physics engines with values modified to fit their game. That's what OOP is all about: re-usable classes. If anyone comes up with some good physics classes not yet implemented in the TGE it's possible that it may be integrated into the TGE for other developers to use.
#11
09/10/2002 (7:55 am)
Getting ODE or some other package in to deal with single-player physics would not be too difficult, but having the physics behave well multi-player is a real challenge, something that no one has solved well far as I know. In the past, the focus of the Torque engine has been multi-player, so physics has taken a back seat. Having a physics engine to play with would be cool though, even if it was single player only.
#12
Basically Tim is right, sycronizing advanced phyics across the server and the clients is very expensive.
In fact most advanced physics in general is expensive.
For example those physics pools of water in Unreal2 are super frame rate killers. It can bring a 2.4 ghz machine to its knees in no time.
So the problem is two fold, good physics are expensive, and replicating that information to multiple players through the server is a serious problem.
One possibility was to send a special block of information to each client with a timestamp, each client would simulate the same event given this seed.(at least havoc claims) but that only works if all the machines and os's are the same, so linux vs windows vs mac would all generate different results even if you used havoc's idea.
Plus you would still have to do all the physics on the server to make sure things end up in the right place.
An alternative is a compromise. Just do simple physics for things but then on the clients you can do some extra phyics for things that arent really relevant. So say a building can be knocked down, pretty simple phyics for the building, but when it gets hit and falls all this cool debris flys around, rolling and bouncing off of nearby stuff(client only), because the stuff just fades away after a little while and is not relevant to game play it doesnt impact the server or bandwidth.
You sort of get the best of both worlds without the expense.
Same could go for the physics pool of water, if it really isnt relevant to gameplay you could just do the effect on the client and leave the server out of it.
well, just a thought. But no one, so far, has a solid multi-player solution for complex physics that isnt a bandwidth or cpu hog. at least not yet :)
09/10/2002 (10:11 am)
I have been thinking about this for awhile. I even spoke with Havoc extensively about mutli-player physics and possible solutions.Basically Tim is right, sycronizing advanced phyics across the server and the clients is very expensive.
In fact most advanced physics in general is expensive.
For example those physics pools of water in Unreal2 are super frame rate killers. It can bring a 2.4 ghz machine to its knees in no time.
So the problem is two fold, good physics are expensive, and replicating that information to multiple players through the server is a serious problem.
One possibility was to send a special block of information to each client with a timestamp, each client would simulate the same event given this seed.(at least havoc claims) but that only works if all the machines and os's are the same, so linux vs windows vs mac would all generate different results even if you used havoc's idea.
Plus you would still have to do all the physics on the server to make sure things end up in the right place.
An alternative is a compromise. Just do simple physics for things but then on the clients you can do some extra phyics for things that arent really relevant. So say a building can be knocked down, pretty simple phyics for the building, but when it gets hit and falls all this cool debris flys around, rolling and bouncing off of nearby stuff(client only), because the stuff just fades away after a little while and is not relevant to game play it doesnt impact the server or bandwidth.
You sort of get the best of both worlds without the expense.
Same could go for the physics pool of water, if it really isnt relevant to gameplay you could just do the effect on the client and leave the server out of it.
well, just a thought. But no one, so far, has a solid multi-player solution for complex physics that isnt a bandwidth or cpu hog. at least not yet :)
#13
09/10/2002 (11:05 am)
Multi-player physics brings up an interesting problem. I'd hate for someone to change packets sent from their machine to the server to make their player/ball/whatever do something wild. :-)
#14
Regardless for a complex and important physics calculation a seed simply wouldn't do the job, it is trusted too much to the client, which is, inherently bad, as it could be abused by hackers to cheat. Afterall who cares really where that body ends on up each machine, the player is dead, it really doesn't matter, as long as it is in about the right place it shouldn't be that big a deal, however whether that car flips or is too important to trust the action to a seed and relying faithful client reproduction, puts too much faith on the client. As for an alternative I have no idea, but since my ideas are currently for single player games I don't need to look too closely at that bridge yet.
Owen
11/06/2003 (7:54 pm)
TheMartian - The comment about Havok using a seed which then dictates how physics were handled on individual machines is a suprisingly good idea, however your comment concerning how Linux,Macs and Windows would handle these differently is a little flawed, I see no reason why, if you built the algorithm that handles the seed, why the exact same effects could not be produced, obviously if you were relying on say, a random number generator, the individual architecture, compiler, or simply header files on the a machine would make a big difference, however if the code is 100% custom for that particular purpose the results would be the same everytime. Frankly this seems to be the most efficient method that I have seen, so far, of reproducing semi-important physics on different client machines, without the overhead of physically sending all those calculations down the pipe.Regardless for a complex and important physics calculation a seed simply wouldn't do the job, it is trusted too much to the client, which is, inherently bad, as it could be abused by hackers to cheat. Afterall who cares really where that body ends on up each machine, the player is dead, it really doesn't matter, as long as it is in about the right place it shouldn't be that big a deal, however whether that car flips or is too important to trust the action to a seed and relying faithful client reproduction, puts too much faith on the client. As for an alternative I have no idea, but since my ideas are currently for single player games I don't need to look too closely at that bridge yet.
Owen
#15
11/06/2003 (9:10 pm)
I've done some work into getting ragdoll working in-game. I had a ragdoll implementation working, but particle based... so it wasn't very good. Doing an ODE implementation now, done... someday.
#16
In both cases, it works very well, and was not that difficult to implement. Tim Gift helped them with a little background support.
-Jeff Tunnell GG
11/07/2003 (7:59 am)
Pinoli Software, the Tube Twist guys, are using ODE integrated with Torque. We are under non-disclosure, but there is another group that has ODE integrated with Torque as well. In both cases, it works very well, and was not that difficult to implement. Tim Gift helped them with a little background support.
-Jeff Tunnell GG
#18
-Jeff Tunnell GG
11/07/2003 (11:25 am)
It won't be. We didn't do the work, so they own it. You need to talk to those companies if you want them to contribute.-Jeff Tunnell GG
#19
11/07/2003 (12:57 pm)
Stefan, I sent an e-mail to your public e-mail account imquiring about the work you did on AI, pauldana said it'd be a good idea to mail you, did you get my message?
#20
11/13/2003 (12:03 pm)
After seeing all of the physics displayed in the half life 2 movies I was immediately curious about how that would work in a multiplayer scenario. Unfortunately I won't get to see until end of March now?
Associate Stefan Beffy Moises