Implementing jumping: physics vs scripted

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
Post Reply
User avatar
ekt
Gremlin
Posts: 150
Joined: Thu Apr 01, 2004 5:55 pm
x 5
Contact:

Implementing jumping: physics vs scripted

Post by ekt »

especially in a platform game, what do you think is the best way to implement jumping?

using physics is the easy option, nonetheless sometime can be a little non-deterministic
players wants to be sure how character will react and they don't care too much about physics-correctness
scripting the action solves, but you loose the magic of being physically driven - emergent behavior included
User avatar
Azgur
Goblin
Posts: 264
Joined: Thu Aug 21, 2008 4:48 pm

Re: Implementing jumping: physics vs scripted

Post by Azgur »

Personally, I'm all for scripting.
Physics may be realistic and accurate, but often just feel odd to the player.
Especially if you want to give the player tight control over the jump, you'll just end up bending the physics to your will with a result not too different from a scripted jump.
User avatar
ekt
Gremlin
Posts: 150
Joined: Thu Apr 01, 2004 5:55 pm
x 5
Contact:

Re: Implementing jumping: physics vs scripted

Post by ekt »

reading here and there it seems the common consensus as you say azgur
totally scripted means byebye to "character get blowed away by the bomb for free"
maybe "bending to your will" is the key. somewhat pushing body still through forces but keeping it tied to an "expected state curve" - doing some experiments... thanks for you advice

during the research i've found this
http://tvtropes.org/pmwiki/pmwiki.php/Main/JumpPhysics
in the end the whole site is very funny
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Re: Implementing jumping: physics vs scripted

Post by xadhoom »

Looking at the PhysX CharacterController class you can see that they use a fully kinematic actor for it. But to still take advantage of physical impact during jump they provide a callback for contacts, where you can decide how you want to deal with certain collisions. Thats IMHO quiet flexible...

xad
User avatar
Praetorian
Google Summer of Code Student
Google Summer of Code Student
Posts: 171
Joined: Fri Aug 10, 2007 10:37 pm
Location: WA - USA
x 5

Re: Implementing jumping: physics vs scripted

Post by Praetorian »

Looking at the PhysX CharacterController class you can see that they use a fully kinematic actor for it. But to still take advantage of physical impact during jump they provide a callback for contacts, where you can decide how you want to deal with certain collisions. Thats IMHO quiet flexible...
I agree, I really like how the PhysX controller is set up (I'm not actually using the included controller, but my custom controller took a lot of inspiration from it).
My Google summer of code 2011 topic: Unit Testing Framework
My Google summer of code thread
My Google summer of code wiki page
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: Implementing jumping: physics vs scripted

Post by nikki »

Depends on how your character himself works too. Is your character movement scripted? Or is the character a complete rigid body (like a rolling ball), and movements are made by forces? Questions like that can pop up.
User avatar
ekt
Gremlin
Posts: 150
Joined: Thu Apr 01, 2004 5:55 pm
x 5
Contact:

Re: Implementing jumping: physics vs scripted

Post by ekt »

first proof of concept was a rigid body controlled by force - not even rolling, just pushed - which is quickly showing its limits
ode (which i'm using) has kinematic objects support - i'll take a look at the physx sample, thanks a lot for the tip
Post Reply