SimpleCharacterControl Contribution

Hi guys!

I want to contribute my simple CharacterControl.

Here is the class SimpleCharacterControl.java with the test example:
http://code.google.com/p/jme-simple-examples/source/browse/#hg%2FJMESimpleExamples%2Fsrc%2Fcom%2FsimpleCharacterControl

Here is the video test:
[video]http://www.youtube.com/watch?v=MwXnm3bVzpg&feature=youtu.be[/video]

Features:

  • Used RigidBody
  • Physical object sleeps
  • simple
  • Slope Angle limitation.
  • Control can be used on big polygons. No any flickering.

Enjoy. Thanks.

7 Likes

This model was used for the test. http://jme-simple-examples.googlecode.com/hg/JMESimpleExamples/assets/Models/test/testScene.j3o

I wanted that model to go up those stairs so bad! XD

Good work anyway. :wink:

Ok, i work on character controls for a while and here are my conclusion about your approach (i just looked at your code, i didn’t test it).

  1. You don’t address the main issue, the reason why the bettercharactercontrol was made in the first place : the possibility to change the gravity and to apply forces to the player. For that, the charactercontrol of ut2004 (for forces) is still better than us :’(
    You don’t have it because you define the speed of your control every step, with the setLinearSpeed.
  2. You don’t have a “stepheight” thing i.e. you cannot go upstairs and you’ll block on each and every small brick on the ground (or push them away).
  3. You can’t sneak, but this is not that terrible.
  4. when your character slide, you add a central force but this force doens’t take in account the weight of the player.
  5. because you define the speed every tick, you’ll easily go through wall if you walk right them and keep walking in this same direction (perpendicular to the wall).
  6. because you define the speed every tick, you’ll get stuck to the wall when you jump and walk in its direction.
  7. because you define the speed every tick, you’ll be able to push even heaviest truck. Yeah, badass :slight_smile:
  8. when you get the closest collision, you actually get the furthest collision (can be solved with a “break”).

And, remember that a character control is not something simple by essence (and i am not the only one who says that). It’s terribly hard to do because human can do a lot of things with their body (oh yeahh), and things that are very hard to explain and simulate in physic. And on the top of that, we add things that a human can’t do but that the player want to be able to do, like air control.
For exemple, humans doens’t have momentum when they climb a slope, cause they use their legs to dampen it. And nobody runs fast enough to leave the ground when he goes down a slope. But in game, it happens.

So, as character controls are, by essence, not easy, you approach is, by essence, wrong. But thanks for trying :slight_smile:

@bubuche said: Ok, i work on character controls for a while and here are my conclusion about your approach (i just looked at your code, i didn't test it).
  1. You don’t address the main issue, the reason why the bettercharactercontrol was made in the first place : the possibility to change the gravity and to apply forces to the player. For that, the charactercontrol of ut2004 (for forces) is still better than us :cry:
    You don’t have it because you define the speed of your control every step, with the setLinearSpeed.
  2. You don’t have a “stepheight” thing i.e. you cannot go upstairs and you’ll block on each and every small brick on the ground (or push them away).
  3. You can’t sneak, but this is not that terrible.
  4. when your character slide, you add a central force but this force doens’t take in account the weight of the player.
  5. because you define the speed every tick, you’ll easily go through wall if you walk right them and keep walking in this same direction (perpendicular to the wall).
  6. because you define the speed every tick, you’ll get stuck to the wall when you jump and walk in its direction.
  7. because you define the speed every tick, you’ll be able to push even heaviest truck. Yeah, badass :slight_smile:
  8. when you get the closest collision, you actually get the furthest collision (can be solved with a “break”).

And, remember that a character control is not something simple by essence (and i am not the only one who says that). It’s terribly hard to do because human can do a lot of things with their body (oh yeahh), and things that are very hard to explain and simulate in physic. And on the top of that, we add things that a human can’t do but that the player want to be able to do, like air control.
For exemple, humans doens’t have momentum when they climb a slope, cause they use their legs to dampen it. And nobody runs fast enough to leave the ground when he goes down a slope. But in game, it happens.

So, as character controls are, by essence, not easy, you approach is, by essence, wrong. But thanks for trying :slight_smile:

  1. this is not betterCharacter replacement. This is just another approach.
    2)you can move upstairs. Try to walk to the door of my test house.
  2. cenralforce is only for slope angles. You can set your custom value there. just check its multiplier.
  3. possibly but i did not go through the wall. I tried for many times… Basically, if you set good friction and good damping - you will never go through the wall. In my experience…
  4. no
  5. no. You need to set mass for the Truck>1. Check my test with the mass=10000:

[video]http://www.youtube.com/watch?v=0nsabdYVGek&feature=youtu.be[/video]

  1. i take the closest. I’ll check it.
1 Like

I did some improvements to the control.
I also added small boxes so that you can play with this. :slight_smile:
Links are the same.

[video]http://www.youtube.com/watch?v=9rdXP2mW-6w&feature=youtu.be[/video]

Great job. I like this control, and I have problems with BetterCharacterControl too. Flickering and bouncing.

But I tested CharacterControl and noticed the character slides down small slopes also. Like that first roof you jump onto in the video. It’s good he slides down the big slopes (the second roof), but not natural that he slides down smaller slopes (slowly but still).

Thats the only problem I could find, and would be my only stopper for using it instead of BetterCharacterControl.

1 Like
@finnjohnsen said: Great job. I like this control, and I have problems with BetterCharacterControl too. Flickering and bouncing.

But I tested CharacterControl and noticed the character slides down small slopes also. Like that first roof you jump onto in the video. It’s good he slides down the big slopes (the second roof), but not natural that he slides down smaller slopes (slowly but still).

Thats the only problem I could find, and would be my only stopper for using it instead of BetterCharacterControl.

Hi, thanks for good words. The control can be improved. But i have no time to fix all stuff now.

@finnjohnsen said: Great job. I like this control, and I have problems with BetterCharacterControl too. Flickering and bouncing.

But I tested CharacterControl and noticed the character slides down small slopes also. Like that first roof you jump onto in the video. It’s good he slides down the big slopes (the second roof), but not natural that he slides down smaller slopes (slowly but still).

Thats the only problem I could find, and would be my only stopper for using it instead of BetterCharacterControl.

I improved slopes. But it’s a bit hardcoded to Character’s Friction.
[video]http://youtu.be/u1LQ-mpIRQw[/video]

Here is my commit: Google Code Archive - Long-term storage for Google Code Project Hosting.
If you want you can test it again and say your opinion.

Edited: Another commit with fixes Google Code Archive - Long-term storage for Google Code Project Hosting.

2 Likes