Character Simulation

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
goruka
Posts: 27
Joined: Wed Nov 07, 2007 12:49 am

Character Simulation

Post by goruka » Fri Dec 07, 2007 3:41 pm

Hi! Here's something I've been thinking about.. I've been trying to put togeter a physics engine for a while, and i'd like to give it a try in games, so I was wondering..

How would one simulate a character? I can think how to do a ragdoll, or a vehicle.. but i suppose for a character walking around a world, as they usually do in games, and collide against stuff.. I'll definitely need to simulate it in some way. Simulating how a person walks or runs seems terribly complex to me, so I'm sure there must be some simplified way to simulate this...

I can imagine that the best way to simulate the character shape would be a pill or an ellipsoid , and have some sort of constrait to keep its foot aligned with the gravity vector applied to the object. I was also thinking that since it can't rotate in that axis, i should make it frictionless... Also, I was thinking that changing its direction simply means altering the linear velocity vector to face somewhere.... however I'm not sure if this is the best approach, what do you people think about this?

Also btw, I ported Erin Catto's Box2D Lite to 3D for learning myself.. would it be of use to anyone to learn? I could release it i guess if so.

Dirk Gregorius
Posts: 874
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Character Simulation

Post by Dirk Gregorius » Fri Dec 07, 2007 4:29 pm

Also btw, I ported Erin Catto's Box2D Lite to 3D for learning myself.. would it be of use to anyone to learn? I could release it i guess if so.
Maybe you ask this on Erin's forum, http://www.Box2D.org

User avatar
Erwin Coumans
Site Admin
Posts: 4198
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Character Simulation

Post by Erwin Coumans » Fri Dec 07, 2007 5:42 pm

Your 3D port of Box2D light might definately be useful for some people. It should also give you a better understanding of Bullet, as Box2D took a very similar approach. Can you attached the zipped version in this topic?

Yes, a character controller usually uses a simple shape, usually on a stick (ray test), popular choices are capsule (Ratchet and Clank), axis aligned bounding box (Quake etc). In most cases, the character controller is not a rigid body at all, but entirely moved by the user. It can still share the same collision detection routines.

For improved quality character controllers, you can use swept collision detection to detect the hit normals in the environment. For Bullet 2.65 I'm planning to add a basic demo showing such approach.

Thanks,
Erwin

goruka
Posts: 27
Joined: Wed Nov 07, 2007 12:49 am

Re: Character Simulation

Post by goruka » Tue Dec 18, 2007 2:22 am

Erwin Coumans wrote:
Yes, a character controller usually uses a simple shape, usually on a stick (ray test), popular choices are capsule (Ratchet and Clank), axis aligned bounding box (Quake etc). In most cases, the character controller is not a rigid body at all, but entirely moved by the user. It can still share the same collision detection routines.
I've tried a lot of approaches of creating a character controller using rigid bodies, but it's pretty pointless so far.. i can't deal with the inertia in any useful way.

Approaches I tried:

1) Make a rigid body without friction and simply control the linear velocity in a custom way
This woks great for bouncing into objects and walls, but doesn't work for stepping over moving objects.
2) Apply forces to the object to move it like a character.. this works great for evrything except the motion sucks, because you can clearly see the inertia when turning

If i can't find a way using rigid bodies, i'll have to resort to doing a completely separate type of controller ( not a rigid body ), But this is quite some work and not only i losel the advantages of rigid bodies and their constraits, plus applying impulses to other objects seems like a difficult thing.

Any Pointers?

Thanks

Pierre
Posts: 67
Joined: Mon Jul 25, 2005 8:56 am

Re: Character Simulation

Post by Pierre » Tue Dec 18, 2007 8:12 am

Any Pointers?
You could try the character controller from PhysX. The CCT's source code should be released in the next version (or maybe it has already been released, I'm not sure).

- Pierre

crashlander
Posts: 41
Joined: Sat Apr 08, 2006 11:20 am

Re: Character Simulation

Post by crashlander » Wed Dec 19, 2007 11:57 pm

Check the first paper here... not sure you could make it work for games but you may still find it interesging.

http://www.cs.ubc.ca/~van/papers/index.html

DMG
Posts: 1
Joined: Wed Jan 16, 2008 3:01 pm

Re: Character Simulation

Post by DMG » Wed Jan 16, 2008 3:06 pm

You could also check out http://www.fun-motion.com, especially this page for some interesting ideas, and a hilarious video.

Post Reply