Hi!
I've implemented my own version of btKinematicCharacterController (it uses the StepForwardAndStrafe but use raytests to get the floor height for the character).
We have enemies detecting collisions with each other and with walls (a btBvhTriangleMesh). The problem is that the performance hit is considerable. The following are the Milliseconds per frame of the UpdateAction function:
Only main character: 0.2ms
Main character + 10 enemies: 8ms
The frame rate of our game gets down to 60fps without rendering too much geometry, and I have a high-end computer. Half the frame time is taken by the collisions.
With only a few characters the performance is incredibly bad. How do commercial games like FPS or RTS (in which there are many enemies at the same time) solve this issue? With my system I play all commercial games far above 60fps, and they are far more complicated than ours.
Help please,
Thanks a lot!
Multiple character collisions in a game (help please)
-
- Posts: 4
- Joined: Mon Apr 26, 2010 11:08 pm
-
- Posts: 4
- Joined: Mon Feb 15, 2010 1:29 am
Re: Multiple character collisions in a game (help please)
Yeah, the performance of the btKinematicCharacterController object is currently bad. Im experimenting with an FPS game myself, and with 50 bots, the physics time will drag your FPS down to single digits. What ive done is create a controller class wrapper that implements either the btKinematicCharacterController or btCapsuleShape (moving a rigid body with forces). By setting the class to use the capsule shape, the performance is fine.
So you can either use a capsule shape for many players (and suffer the limitations of going the rigid body route, like mentioned in (http://bulletphysics.org/Bullet/phpBB3/ ... 39&start=0) or improve the performance in btKinematicCharacterController. I havent gotten around to improving the btKinematicCharacterController myself, but when i take a look ill be sure to share my experiences for dealing with large number of players. Anyone else looked into this ?
So you can either use a capsule shape for many players (and suffer the limitations of going the rigid body route, like mentioned in (http://bulletphysics.org/Bullet/phpBB3/ ... 39&start=0) or improve the performance in btKinematicCharacterController. I havent gotten around to improving the btKinematicCharacterController myself, but when i take a look ill be sure to share my experiences for dealing with large number of players. Anyone else looked into this ?
-
- Posts: 91
- Joined: Wed Jun 10, 2009 4:01 am
Re: Multiple character collisions in a game (help please)
Hi dear all:
I am also a bit worry about the controller's performance, But I don't know the main consume of this class,is it overwhelmed by the collision detection? As I know this class perform a convex cast which is more consumable than the static collision detection. Also the BVtriangle's braod phase collision detection also consume time .So have you ever statistic whether the cd pass take the major part of time consumer or the controlle itself?
I am also a bit worry about the controller's performance, But I don't know the main consume of this class,is it overwhelmed by the collision detection? As I know this class perform a convex cast which is more consumable than the static collision detection. Also the BVtriangle's braod phase collision detection also consume time .So have you ever statistic whether the cd pass take the major part of time consumer or the controlle itself?