What to use for multiple people

Grom

21-01-2007 05:41:23

I apologize if this is a simple question.

I have an app written where I have 20 or so people moving around interacting with each other. Right now, they are merely represented by boxes, but eventually they will be character models with animations.

What is the best way to move them all around so that they push into and off of each other? Right now my boxes move around by means of body::addForce, and they tumble around as they move. Is that the right way to do it? I want the people to stand upright as they move around.

betajaen

21-01-2007 11:34:15

Character Controllers all the way; They won't fall over, and you won't apply forces; Just a direction of travel.

Grom

21-01-2007 19:01:53

Hmm, well I'm hesitant to use one of the character controllers because my 606 demo exhibits the "sinking through the floor" problem. Also, the movement is really jerky. Is there any other way to create something that doesn't tip over? Basically something that could yaw, but couldn't pitch or roll. BTW all my movement is going to be done on the floor, it doesn't have to walk up and down stairs or anything

Also, what exactly is a blueprint?

betajaen

21-01-2007 19:21:34

Then use a body with body::freezeRotation

Blueprints, are what their namesake is. Plans for a character, car, or body that contains common elements; sizes, meshes, collision models and so on. Then what the blueprint is of; can be created many many times without any additional code.

Grom

21-01-2007 21:58:30

Ah, I'm reading more and more and I think what I'm going to want to do is make a ragdoll (a bunch of bodies connected with joints that encapsulate the body parts and follow the mesh's animations)

It would seem the best way to do this would be to have the bodies attached to the bones of the skeleton. How would I do that?

Grom

22-01-2007 08:18:59

Actually after reading through lots of code I think I see how to do it. I will post an update when I have something cool to share.

Grom

23-01-2007 06:10:00

Alright I'm getting close, but I have some questions I need a little help with.

First of all the createBody function asks for a mesh file. I'm currently using capsule.50cmx1m.mesh as a placeholder. I want to create a body from existing vertices. I have the code that iterates through the skeleton and determines which verts are attached to each bone, and I've created a convexShape for each bone that reacts properly. However the capsule is still visible at the bone's location (which is currently useful for debugging, but ultimately I want the body invisible and not using any mesh)

Second what joint would you recommend for the links between bones? Right now I'm testing it with a fixed joint, but it seems to stiff (I do see some rotation between bones when they fall hard to the floor, but nothing good). I tried a spherical joint but it spun around disgustingly. I tried a revolute joint, but it didn't even seem to maintain a connection.

Third, and most importantly, I'm getting a crash on exit. The thing is, it only happens sometimes, so I can't get a pinpoint on what the cause is. Sometimes it exits normally. There's never anything informative in the logs. It started happening when I added the code to iterate through the bones and create a body per bone. When I was just doing two bones that I hardcoded the names of, it never happened. I look at the (iterated) mesh and it has capsules at all the correct bone locations. It just gives me a send/dontsend error on exit sometimes. The only thing I can think of is that I'm using a convexshape and maybe some bones of the ninja.mesh have vertices that don't form a convex shape? Would that cause an error only sometimes? Any suggestions?

NickM

23-01-2007 09:08:53


Second what joint would you recommend for the links between bones? Right now I'm testing it with a fixed joint, but it seems to stiff (I do see some rotation between bones when they fall hard to the floor, but nothing good). I tried a spherical joint but it spun around disgustingly. I tried a revolute joint, but it didn't even seem to maintain a connection.

Did you try adding joint limits to the spherical joint?