BetterCharacterControl in the works

Home Forum Development Engine Development Discussion BetterCharacterControl in the works

This topic contains 48 replies, has 21 voices, and was last updated by  nomnom 5 months ago.

Viewing 15 posts - 1 through 15 (of 49 total)
  • Author
    Posts
  • #203980
    +14

    Normen Hansen
    2797p
    Keymaster

    Hey,

    as many people get desperate over the internal bullet character, which is just a simple implementation and doesn’t really work like the rest of the bullet physics I started creating a new “BetterCharacterControl” to counter some of the issues people have. This is something that can already be implemented but many people seem to struggle to do so hence I’ll implement it and also make it easily extensible.

    Features:
    – Capsule based character like the current character (no rotation per se)
    – Based on a real RigidBody with actual normal gravity
    – RigidBody is not affected by angular forces
    – Uses a RayTest to check if its on the ground
    – Can duck
    – Uses ray test to see if it can unduck
    – External physics forces get applied as normal with a selectable damping value for forces that are not in the gravity direction
    – Has no strange settings like stepHeight, fallSpeed or any such nonsense ;)
    – If you combine this character with a RagDollControl you can have a character that will push away stuff with the rag doll and its animations but sill behave like a character and bounce into walls, fall etc. due to the capsule.
    – Adapts to the gravity direction automatically and realigns itself (!)
    This is actually impossible due to math :D The character will keep a local coordinate system and “z-forward” so you can gradually change the gravity and it will adapt its coordinate system and the player keeps sensible control over the character. As you see in the second video I can run around the planet while keeping the normal left/right/strafe controls all the time.

    It’ll still take me some time to clean this up, add serialization etc. and make it available but as the character questions keep popping up (though they all have been answered already) I guess I thought I let you know whats cooking Available now in svn ;)

    [video]http://www.youtube.com/watch?v=uysBBmMoPOo[/video]
    Note: The jerky movement in the second video is due to the recording
    [video]http://www.youtube.com/watch?v=DXCQrU9akDk[/video]

    Cheers,
    Normen

    #203986

    nihal
    48p
    Participant

    @normen said:
    Features:
    – Capsule based character like the current character (no rotation per se)

    Hey @normen I chanced upon your post. I am currently needing a Capsule vs Mesh collision model ( for haptic manipulation ). I thought there was no capsule collision model implemented in jME? Is the model you are using new? Or is it already implemented in jME or bullet?

    Cheers!

    NiHal

    #203988

    Normen Hansen
    2797p
    Keymaster

    @nihal said:
    Hey @normen I chanced upon your post. I am currently needing a Capsule vs Mesh collision model ( for haptic manipulation ). I thought there was no capsule collision model implemented in jME? Is the model you are using new? Or is it already implemented in jME or bullet?

    Cheers!

    NiHal

    As said in the post, all of this is possible with the current API.
    The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless theres emotes that hint otherwise or theres an increased use of exclamation marks and all-capital words.

    #203989

    nihal
    48p
    Participant

    @normen said:
    As said in the post, all of this is possible with the current API.
    The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless theres emotes that hint otherwise or theres an increased use of exclamation marks and all-capital words.

    Hehe, I guess I must have come off as sensitive earlier. Anyways, any hints on which class handles the capsule collision?

    The reason I didn’t think capsules were working was because I normally use the BIHTree, rays and bounding volumes for collisions. For which capsules are not implemented, from what I know

    I guess what you have used is the CapsuleCollisionShape. I take a look at bullet and see if it has what I need.

    #203990

    aaronperkins
    76p
    Participant

    Very cool!

    I need this for jmeplanet. I just added physics support to the planets with gravity but have no way for actually walking on the surface. This solution should do nicely. When can I have it?! ;-)

    #204030

    Erlend Sogge Heggen
    510p
    Keymaster

    This is fantastic. Glad you found it already @aaronperkins , I knew this would fit your project perfectly :D Switch out the ogre with Jaime and make MonkeyGalaxy already!

    #204071
    +2

    Normen Hansen
    2797p
    Keymaster

    I committed a first version that basically has all features implemented but still lacks damping of physics forces in the local x/z plane, the current code for that is still a bit dodgy.. It still has some debug vectors enabled at all times to underline the WIP state :) Apart from that its actually quite clean already, I added plenty of javadoc and code comments as well. Check out TestBetterCharacter to try around with whats there.

    #204969

    Normen Hansen
    2797p
    Keymaster

    I added damping of the local x/z plane forces to the BetterCharacterControl and removed the debug stuffs, it should basically be complete and usable now :)

    #205037

    Normen Hansen
    2797p
    Keymaster

    I found that the damping works pretty intuitively. One can almost make “hovercrafts” and other things with the character too by lowering the damping value. Anyone interested could do a “space ship” with arcade physics (max speed etc) pretty easily the same way the character was done.

    #205066

    Erlend Sogge Heggen
    510p
    Keymaster

    I’m just waiting for @aaronperkins demo update now :D

    #205067

    aaronperkins
    76p
    Participant

    LOL, I get the hint. I’ll see what i can whip up over the weekend. ;-)

    #205068

    Dodikles
    67p
    Participant

    Oh wow, what a treat! Thanks a lot, normen!

    #205414

    mcbeth
    22p
    Participant

    this is nice, is the variable gravity example in svn couldn’t find it………..might help solve some body orientation needs in my game and I would like to take a look

    #205416

    Normen Hansen
    2797p
    Keymaster

    Hideously hidden under jme3test.bullet.TestBetterCharacter :P

    #205426

    mcbeth
    22p
    Participant

    @normen said:
    Hideously hidden under jme3test.bullet.TestBetterCharacter :P

    looked round a couple times in the test “ran it” never saw the damn sphere………………….somehow :-? my bad sorry

Viewing 15 posts - 1 through 15 (of 49 total)

You must be logged in to reply to this topic.