Game Development Community

General Physics Questions

by JohnBoy · in Technical Issues · 04/17/2008 (7:06 am) · 9 replies

I have been skeptical on the purchase of a Torque Engine because I don't know the limitations of the physics. I have seen golf games created, however I don't know how the golf ball actually acts.

Are you able to implement Angular Velocity, (these next ones may be a dumb question) altitude and/or speed onto an object in realtime?

I have seen projectiles shoot straight; Are you able to bend motion paths determined on user input?
Say if I wanted something to be taget seeking (like heat seeking) or curve in an "S" fashion based on spin/angular velocity.



Are these possibilities? Please let me know I would appreciate it!

Thanks!

#1
04/17/2008 (9:42 am)
The stock projectile class has a flag that can be set to have it integrated with gravity.

You can expand it (or subclass it) to add aerodynamic models for drag and lift.
#2
04/17/2008 (9:55 am)
There isn't really a physics engine, ie no ragdoll or rigid body stuff. Just "basic" collisions. The biggest lacking area in TGE/TGEA in my opinion (being the lack of a good physics engine). Though there were some (old) attempts at getting PhysX working, and I believe ODE and another physics engine were implemented as resources. I haven't tried implementing these yet, but I can assume that since these projects have since pattered out, it would take a bit of work to get them working with current versions of both the Torque engines, and the physics engines as well.
#3
04/17/2008 (10:15 am)
In response to Matt's reply:

So you mean I can extend the class of the stock projectile class to create something like:

perfect example:

A game idea I'm thinking of is like Xena Warrior prince-man-beast-cess (never really could tell if that lady was a real lady...lol)

I digress.....

If you are remotely familiar with Xena Warrior Princess, she had this kool weapon that was like a frisbee with blades that she could throw and it would curve in an "S" fashion, left, right etc etc if she threw it the right way...
I want to make a FPS kinda like that. Depending on angle/power and other variables that the user inputs, they can "s" the weapon around trees at enemies, or curve it hard right/left or whatever to target opponents.

Again I'm not talking about pathfinding, but I'm talking about dynamic motion based on user input.

=======================

In response to Nate's reply:

Thank you for that input. could you Elaborate on what you meant by "believe ODE and another physics engine were implemented as resources." ?

Thanks guys!
#4
04/17/2008 (10:23 am)
You would have to implement something specific for what you're attempting with that weapon. Perhaps something similar to Shelled (but with more complex pathing (yes, I know you didn't want pathing) so that the player can see their weapon's movement before they throw it. I know I'd be irritated trying to throw something in a complex motion without some sort of guide.

ODE resource on TDN
PhysX resource

I wish more games actually did something with physics that had something to do with gameplay. The vast majority just like to have them listed on the box.
#5
04/17/2008 (1:27 pm)
Of course that makes sense to have some sort of guide, but the question remains if it is possible with the TGEA engine?

Judging by the links presented here I'm assuming I would have to implement an external physics engine to make this work properly?

Please elaborate what you meant by having to "implement something specific for what you're attempting with that weapon"

thanks :)
#6
04/17/2008 (1:36 pm)
You're the one who is defining the weapon's behavior; I can't really define it according to the terms you are asking. You will have to implement it either in code or in script. Depending on the complexity of it and the pathing nature, it might be more effective in code. As to how complex it would be, I do not know.

I posted the links because they exist if it can not work in stock Torque and requires an external physics engine. That's why external physics engines exist.
#7
04/17/2008 (2:05 pm)
Right, I figured that this would have to be done on via scripting/coding.

Based on the spin of the weapon, the angle the user released, and the velocity of the weapon, will the weapon react as it should per the environment? (or vice versa: the environment makes the weapon react a certain way)

It seems possible if you can give an object these properties and give that object a weight, and let gravity and friction do their job, to lead to an eventual halt in motion of the weapon?

I may be repeating myself? But the more I think about it, this engine surely must give you friction, gravity and allow for input like I listed above?

I may be repeating myself here..haha..

Thanks for the replies
#8
04/20/2008 (9:03 pm)
Just recently having played Dark Sector and also watched Xena before, I know exactly what you are aiming for. Well maybe not exactly, but enough to get the general idea. Dark Sector's throwing weapon worked nicely in a manner (for those that haven't played it) where you throw it, then the camera follows the weapon as you steer it. Similar to Max Payne's "bullet cam" when you sniped someone, except you get to control the bullet!

Obviously there are several approaches to doing this, but perhaps a more complete system is what your after, so that multiple weapons with this feature can be created. So maybe something of a simple "vehicle" would be one way of doing it?
#9
04/20/2008 (9:36 pm)
There is a Rigid class which is used by some ShapeBase classes such as RigidShape and flyingVehicle to help update their positions based on forces acting on the object.

Rigid keeps track of the object's:
Linear velocity
Current position
Linear momentum
Angular velocity
Current rotation
Angular momentum

Moment of inertia
Inverse moment of inertia
Inverse moment of inertia in world space

Center of mass in object space
CofM in world space
Rigid body mass
1 / mass
Collision restitution
Friction coefficient

Rigid's main method is integrate, which changes linear and anglular position over time.