Page 1 of 1
Implementing jumping: physics vs scripted
Posted: Mon Aug 24, 2009 8:18 am
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
Re: Implementing jumping: physics vs scripted
Posted: Mon Aug 24, 2009 6:33 pm
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.
Re: Implementing jumping: physics vs scripted
Posted: Mon Aug 24, 2009 7:04 pm
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
Re: Implementing jumping: physics vs scripted
Posted: Mon Aug 24, 2009 10:00 pm
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
Re: Implementing jumping: physics vs scripted
Posted: Tue Aug 25, 2009 1:00 am
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).
Re: Implementing jumping: physics vs scripted
Posted: Tue Aug 25, 2009 6:43 am
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.
Re: Implementing jumping: physics vs scripted
Posted: Tue Aug 25, 2009 7:38 am
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