How should a character structure be? Let's share some ideas

[Not sure if this should or not be in Physics section]

What are you all ideas on how should a character be made?

as far as i have seen, there is only one:

Good size: Works.

Bad size: Won't work with models larger than taller. The ball would be taller than the model and there would be no Capsule(or Cylinder)

seens good to me, but here is the question: Why?

My idea of the structure is simpler[edit: and won't work on most games T.T], it's a Capsule(or Cylinder, whichever you preffer) that will contain the model, they both have the same size, and you won't spin it, you just :

        speed.x = 0;
        speed.y = character.getSphere().getLinearVelocity(null).y;
        speed.z = 0;
        Vector3f temp;
        if (keyboard.isValidCommand("MoveRun")) {
            temp = cam.getLeft().mult(50);
        } else {
            temp = cam.getLeft().mult(25);
        if (keyboard.isValidCommand("MoveFoward") &&
                !keyboard.isValidCommand("MoveBackward")) {
            speed.x -= temp.z;
            speed.z += temp.x;
        if (keyboard.isValidCommand("MoveBackward") &&
                !keyboard.isValidCommand("MoveFoward")) {
            speed.x += temp.z / 2;
            speed.z -= temp.x / 2;
        if (keyboard.isValidCommand("MoveLeftBall")) {
            speed.x += temp.x;
            speed.z += temp.z;
        if (keyboard.isValidCommand("MoveRightBall")) {
            speed.x -= temp.x;
            speed.z -= temp.z;

with this it will have instant acceleration and break, not good for most vehicle games, and you can move it on the air (simply fixable with "if(onGround) you can move;") but it's great for FPS and MMO's where your character don't realy need to slide in the terrain. neither it will rolldown ramps if you don't want it to ;D
(observe that you still have to fix the Capsule rotation, or it will fall just like OgreOde's one)

show me your ideas and compare with both or just one of those ideas i just shown now.

After some testing, found out that a square(or cylinder) that is forced to move will keep "jumping" as it go, and that i can't change the form of neither a sphere or capsule, it will always have the bigger X or Z as the radius and ignore the other value, so my system would not fit to models that are not as tall as large also. (unless of course, i make a square with whells)

After some more testing, if you jump and walk against a wall in the air you won't fall with my system.. and: no one else have any ideas?


I think it's hard to say, because every game probably needs a different structure (or better: the more complex a game is, the more complex the structure of the player).

I used something quite similar to the Ogre-Tutorial. My player has (and every future enemy will have) three important nodes:

  1. Node directionNode
  2. DynamicPhysicsNode feetNode
  3. DynamicPhysicsNode displayNode

    So,the directionNode is only a Node that is linked to the chasercamera I use. From it I get the rotation I need to know to determine the orientation of my player. The directionNode has no geometry and is not attached to the rootNode. This is because my player can be a ball and determining the orientation of a ball only produces rubbish.

    The other two nodes are quite similar to the Ogre-Tutorial. My feetNode is a ball, that rolls over the ground, while the displayNode holds the player-model. So I don't use a capsule or anything like that but doint the physics with the model itself (but not vertex-precisely, that caused too much trouble).

    I also don't use any joints to attach the ball to the model, because that sucked. I use the hardcore-don't-do-this-method of setting the translation of my DynamicPhysicsNode to the translation of the ball… I haven't encountered severe problems that I couldn't solve somehow, yet. The first thing objects in the world collide mostly is the ball in my game, because the player collects things, so…

    The only problem I encountered is the balance between friction, mass and speed. I think I will become mad in the next days, because if the friction is too high, the player falls to the ground too slowly, if it is too low, it behaves like a ball, if it is off (because he jumps - and he can move in the air, because it's a jump'n'run) he becomes a lear-jet…

    So, your approach looks interesting, Guedez. I think I'll try it out. Only problem for me is: I have a big structure of different behavior-settings sitting under my player, because he can change his appereance from human to ball to tank to spider. So I need very different approaches for moving him. And I fear four different control-structures… I hope I can do it in one without threethousand "if player is a spider"-codelines…

Very nice, I would like to try this as well.  :slight_smile:

im still working on the "do not behave as a ********** ***** **** bouncy ball" feet ball problem, it's almost optimizated, just need some twiks and testings, it will also not let the player "jump" if he "rolls" too fast in a ramp, i bet most MMO/RPG/RTS/FPS characters MUST NOT use the ground as ramps unless they are in a vehicle ;D

i shall post the control class as i finish it