This project has moved and is read-only. For the latest updates, please go here.

Character movement

Aug 4, 2009 at 6:59 AM
I'm creating a sort of platformer shooter game using farseer. However,
I'm having some trouble getting characters to move correctly.
Currently, my character consists as follows;

two balls (one feet ball and one torso ball) connected by a revolute
joint and an angle joint. When the player moves the thumbstick, torque
is added to the feet ball to make it move. The angle joint constantly
offsets the feet ball's rotation to keep the character upright. (now
that I think of it, doesn't the angle joint render the revolute joint

However, when I apply torque to the ball, it moves very sluggishly and
it is very hard to get up to a decent speed, even with an insane
amount of torque being applied (upwards of 50000) and when the torque
is that high it begins flinging itself into the air. If I remember
correctly, the feet's values right now are something like this;

-torque = 20000
-friction = 15
-mass = 50
-rotationaldragcoefficient = 0

Due to the nature of the game, I need the player to have a rather
significant amount of control over the player. The character needs to
accelerate pretty much instantly, and change directions without too
much trouble.

Any help here would be incredible.
Aug 5, 2009 at 9:33 PM

You could set the linear velocity or torque of the ball directly, insteads of using ApplyTorque() or ApplyForce(). Decreasing the mass or the friction would yield results, too.

Aug 6, 2009 at 2:59 AM

yeah, decreasing the mass helped a ton, but it appears as though torque is read only.

Aug 6, 2009 at 3:46 AM

scratch that, changing the angular velocity makes it awesome. thanks.

Aug 8, 2009 at 10:27 AM

Hi SlimeQ

In the patches section I uploaded a RevoluteJoint with a motor.

All you need to do is set the speed, and the max-torque to be applied to get to that speed, and itl keep rotating the objects at that speed. It might be a better approach than what you're doing now because you can control what sort  of strength is used, so your character doesnt go pushing 1-Ton boxes around :)

Aug 8, 2009 at 6:49 PM

i tried that actually, but i had some problems with it. the spinning would always cause the football to detach from the torsoball and go spinning violently, ultimately causing the player to fly out of the map... i gave up on it eventually.