Performance question
Posted: Tue Sep 11, 2012 10:11 am
Hi,
Just trying to do a bit of optimisation on xbox because I seem to be getting quite a lot of slow downs coming from Space.Update(). If I can describe my simulation. I'm using the v1.2 source compiled for release.
There is one character controller.
There are 8 other characters. Each character has 3 'hit zones' which are kinematic spheres (so about 27 spheres inc another set on the charactercontroller guy). Each sphere has CollisionInformation.CollisionRules.Personal = CollisionRule.NoBroadPhase; because all I need them for is to raycast against. Which the weapons do using Space.RayCast(ray, range, rayCastResults); The positions of these 'hit zones' are manually updated by setting their Position each frame.
When a character dies they ragdoll using 9 boxes and a sphere for the head. These don't collide with the character controller only the map mesh (by using a CollisionGroupPair with the CharacterController body cylinder).
The main map collision mesh is 956 polys, it's indoors so this includes a roof. It's fed to Bepu using TriangleMesh.GetVerticesAndIndicesFromModel and added to the Space.
So when level is being played and characters are occasionally ragdolling and there's some weapon raycasts going off I'm seeing around 50 active objects and 60 collision pairs and roughly a Space.Update time of ~10ms (seems to vary a lot between 4ms and 20ms). When the collision pairs reaches ~100 I occasionally see the Space.Update time take upwards of 100ms! And the whole game slows down massively. The spike is weird and doesn't always happen.
I've tried adding 3 or 4 threads to the thread manager but it didn't make much difference.
I tried the ConfigurationHelper stuff but it made my ragdoll look bad (which is broken at the moment anyway so it's hard to know exactly the effect).
I tried passing in 0.016667f to Space.Update() so that it never needs to catch up but it still spiked to ~100ms when there were 70-100 collision pairs.
Don't think it's garbage related since I monitor that already and there's no correlation between that and slow downs.
Does that sound as expected or should it be faster? Ideally I'd like to smooth out the spikes and reduce the overall time if possible.
Just trying to do a bit of optimisation on xbox because I seem to be getting quite a lot of slow downs coming from Space.Update(). If I can describe my simulation. I'm using the v1.2 source compiled for release.
There is one character controller.
There are 8 other characters. Each character has 3 'hit zones' which are kinematic spheres (so about 27 spheres inc another set on the charactercontroller guy). Each sphere has CollisionInformation.CollisionRules.Personal = CollisionRule.NoBroadPhase; because all I need them for is to raycast against. Which the weapons do using Space.RayCast(ray, range, rayCastResults); The positions of these 'hit zones' are manually updated by setting their Position each frame.
When a character dies they ragdoll using 9 boxes and a sphere for the head. These don't collide with the character controller only the map mesh (by using a CollisionGroupPair with the CharacterController body cylinder).
The main map collision mesh is 956 polys, it's indoors so this includes a roof. It's fed to Bepu using TriangleMesh.GetVerticesAndIndicesFromModel and added to the Space.
So when level is being played and characters are occasionally ragdolling and there's some weapon raycasts going off I'm seeing around 50 active objects and 60 collision pairs and roughly a Space.Update time of ~10ms (seems to vary a lot between 4ms and 20ms). When the collision pairs reaches ~100 I occasionally see the Space.Update time take upwards of 100ms! And the whole game slows down massively. The spike is weird and doesn't always happen.
I've tried adding 3 or 4 threads to the thread manager but it didn't make much difference.
I tried the ConfigurationHelper stuff but it made my ragdoll look bad (which is broken at the moment anyway so it's hard to know exactly the effect).
I tried passing in 0.016667f to Space.Update() so that it never needs to catch up but it still spiked to ~100ms when there were 70-100 collision pairs.
Don't think it's garbage related since I monitor that already and there's no correlation between that and slow downs.
Does that sound as expected or should it be faster? Ideally I'd like to smooth out the spikes and reduce the overall time if possible.