Game Development Community

Platformer Character and physics

by Rich Wilson · in Torque X 2D · 02/12/2007 (4:20 pm) · 1 replies

I'm working on a 2d platforming engine and so far I've used a player object with a physics component embedded. I get a lot of weird physics effects that are undesirable, however. Some examples include shooting upwards at the angle of incidence when I hit a sloped collision shape while moving horizontally (stairs, for instance), continuing skyward after I exit the top of a ladder volume, and other rigid body kind of effects.

Would it be better to remove the physics component and manually change the character's position instead of modifying the velocity of the physics component? Will my collision be nullified if I take this route and is there a way around that? Is there a way to live harmoniously with platformer controls and physics?

#1
02/12/2007 (7:14 pm)
I strongly suggest against getting rid of the physics component. One reason is that, as you guessed, your collisions will no longer work. Another reason is that if you get rid of your physics component, you will no longer be able to render tween positions because you are explicitly setting the position each tick. In other words, the object is only ever exactly where you set it to be, rather than travelling smoothly along a path. The result is that your framerate will only effectively be as fast as your fixed tick rate.

I just spent over four months on Platformer physics, so believe me when I say this: getting platformer physics to be truly solid is no simple task. Just keep at it. You'll get it eventually.