Bullet Character Controller Tutorial or Demo

Gargob
Posts: 1
Joined: Sat Jun 01, 2013 11:44 pm

Bullet Character Controller Tutorial or Demo

Post by Gargob »

Hi guys,

I'm trying to implement a kinematic character controller. However, all the tutorials I find use Ogre in some way or another, and I don't plan on using Ogre.

I was wondering if you guys could provide some tutorials to help me figure out how to set up a kinematic character controller.

One of the problems I have understanding it is how you attach it to mesh. I know you pass in a ghost object, but is that ghost object overlayed over the mesh you want to control?
STTrife
Posts: 109
Joined: Tue May 01, 2012 10:42 am

Re: Bullet Character Controller Tutorial or Demo

Post by STTrife »

Not sure if I understand the last part of your question, but the way most people do it (as it is intented), is to use the world transform (contains rotation and position) of the character to update the position of your mesh in your rendering system every step. Not sure about kinetic object, but with normal objects that are simulated you would use motion states (see tutorials/manual).

p.s. I also have made a non-kinematic (simulated rigid body) character controller that can walk up stairs etc. using controlled forces and ghost detectors. So that is also a possibility.
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: Bullet Character Controller Tutorial or Demo

Post by MaxDZ8 »

Gargob wrote:I was wondering if you guys could provide some tutorials to help me figure out how to set up a kinematic character controller.
Have you looked at the included CharacterDemo? It makes a player-controlled capsule walk a map pulled out of a .bsp file.
Gargob wrote:One of the problems I have understanding it is how you attach it to mesh. I know you pass in a ghost object, but is that ghost object overlayed over the mesh you want to control?
Yes. You don't really attach it to the mesh but rather use collision manifolds reported by the ghost object to drive some logic which moves the "real" mesh around.

As a side note, I don't suggest using dynamic objects for player-controlled entities (unless the player understands he only submits forces). You might make it work or not (I couldn't) but worse of all, kinematic objects need a degree of control which (engine, gameplay and state-specific) which dynamics cannot provide.
So, use kinematic objects.
STTrife
Posts: 109
Joined: Tue May 01, 2012 10:42 am

Re: Bullet Character Controller Tutorial or Demo

Post by STTrife »

With rigid body characters, you do have access to the current speed of the character so you can basically make it do whatever you want by applying the right forces.
I'm still worried about those 'outstanding' issues about the kinetic character controller that are noted in the manual. So I'm still going with my rigid body character, so far it works great...
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: Bullet Character Controller Tutorial or Demo

Post by MaxDZ8 »

STTrife wrote:With rigid body characters, you do have access to the current speed of the character so you can basically make it do whatever you want by applying the right forces
Sure, if you know what those forces mean. Have you ever tried explaining that to an artist? How do you provide warping? What about objects that get hit while subject to the one-tick force?

Sad truth is that some characters are really more dynamic while others must really be fully kinematic.
For my platformer, dynamic didn't cut it.
STTrife
Posts: 109
Joined: Tue May 01, 2012 10:42 am

Re: Bullet Character Controller Tutorial or Demo

Post by STTrife »

Yeah I suppose the type of game certainly influences the choice and the number of problems you might run into with either the rigid body or kinematic controllers. But I'm not sure about those problems you mention. (also why would I need to explain the forces to an artist?)
You mean warping as in changing the position of the character? As far as I know you can move rigid bodies by updating their world transform between ticks (and activating them if they were inactive).
As for getting hit, that is exactly what i want. In my game there is no reason to have an immovable object as a the main character, it just has a mass that is typical for humans, it always tries to stop moving when it's resting on the floor (applying counter forces to stop motion, equal to what you might expect from a man). But if something heavy pushes it, then indeed the character will be pushed. But I have to admit that it's still a work in progress, so I might not have encountered the problems that you have, and change my mind when I get further in the development. :)
kalesony
Posts: 33
Joined: Tue Sep 25, 2012 12:16 pm
Location: Poland

Re: Bullet Character Controller Tutorial or Demo

Post by kalesony »

@STTrife: Could you show a movie with your physics-driven character animation? I would really like to see what quality of motion you have managed to achieve :) Have you had much earlier experience with this kind of animation?

Thanks,
kalesony
STTrife
Posts: 109
Joined: Tue May 01, 2012 10:42 am

Re: Bullet Character Controller Tutorial or Demo

Post by STTrife »

At this moment I only have the camera attached to a single player object to walk around in the world. I'm not sure if that is enough give you an idea if it works well enough (I do find it feels very normal to walk around now, but not sure if that shows in a video, and there are no other objects in the world yet, but I could add some). if so let me know and I'll post a video of me walking around a bit.
STTrife
Posts: 109
Joined: Tue May 01, 2012 10:42 am

Re: Bullet Character Controller Tutorial or Demo

Post by STTrife »

I'll just post a video of what I have now. I used fraps but the framerate drops to half of what it should be, so it looks like slow motion. It is smooth normally though.
As you can see I have an empty world now, but it can climb the stairs fine.
https://www.youtube.com/watch?v=Rz3FPYC68Bc
kalesony
Posts: 33
Joined: Tue Sep 25, 2012 12:16 pm
Location: Poland

Re: Bullet Character Controller Tutorial or Demo

Post by kalesony »

STTrife - sorry for my extremely poor response time, have been madly busy recently.

Back to the subject: thanks a lot for the vid and your effort to prepare it, but I guess I misunderstood your original post - I thought you meant a dynamic full-body character controller like e.g. http://www.dgp.toronto.edu/~mdelasa/feature/index.html :).

Nevertheless - congratulations on your dynamic camera-controller implementation and thanks again for taking the time to reply to my question.

Cheers,
kalesony
STTrife
Posts: 109
Joined: Tue May 01, 2012 10:42 am

Re: Bullet Character Controller Tutorial or Demo

Post by STTrife »

That was not really what we were talking about... at least not me :)
btw it's not a 'camera controller' it's just a character controller that I attached a camera to. It's a capsule shaped one to be exact.