I'm making a kart game. For a while I only had one kart with some stuff in the level I could smash about and everything was fine.
Recently I added a bunch of other karts with some simple waypoint AI. Now the speed has decreased a TON and it's really slow.
I used to use a fixed timestep of 1/90 with max substeps of 10 (which was accurate and smooth but after someone in #ogre3d suggested I lower it, it got faster) but now I changed that to 1/45 with max substeps of 45.
Changing the substeps helped with the speed somewhat but with 9 karts it's still really slow. The karts' chassis is a simple convex hull (around 60ish vertices), and the track is made of about 3 big BvhTriangleMeshShapes, each with around 2k polies.
What can I do to speed things up?
Poor performance with 9 raycast vehicles
Poor performance with 9 raycast vehicles
- Attachments
-
- .
9 karts and 1/45 timestep
. - Capture251.PNG (15.06 KiB) Viewed 9961 times
- .
-
- .
1 kart and 1/90 timestep
. - Capture250.PNG (15.36 KiB) Viewed 9961 times
- .
-
- .
9 karts and 1/90 timestep
. - Capture249.PNG (15.7 KiB) Viewed 9961 times
- .
Re: Poor performance with 9 raycast vehicles
also I'm using bulletsharp with mogre
- Attachments
-
- .
1 kart and 1/45 timestep
. - Capture252.PNG (14.41 KiB) Viewed 9959 times
- .
-
- Posts: 20
- Joined: Fri Dec 10, 2010 3:39 am
Re: Poor performance with 9 raycast vehicles
If I had to guess, it would be those 2000 poly triangle meshes. Those are the least efficient shape type, since they have to account for concavity. What happens if you just throw the 9 karts on a plane?
Re: Poor performance with 9 raycast vehicles
9 karts with just a plane and no other level graphics:
9 karts on the regular course with all of the other physics objects except the triangle meshes:
what do you suggest I use instead? I'm trying to get a heightmap working (and putting the overhangs in a trimesh) but they're pretty difficult to debug since turning on debug drawing pretty much slows rendering to a halt
9 karts on the regular course with all of the other physics objects except the triangle meshes:
what do you suggest I use instead? I'm trying to get a heightmap working (and putting the overhangs in a trimesh) but they're pretty difficult to debug since turning on debug drawing pretty much slows rendering to a halt
Re: Poor performance with 9 raycast vehicles
hmmm... I think another big source of slowdowns are these "trigger regions" I have, used for waypoints for the AI-controlled karts.
Apparently this is what it's like without these trigger regions:
and with them:
the problem looks like the trigger regions are preventing objects from being deactivated, meaning that it's constantly simulating far more objects than it needs to. (After one lap, I polled all of my objects and about half of them were active!) The trigger regions are only supposed to do anything with the karts and nothing else on the track. I've tried using GhostObjects and RigidBodies and neither seem to fix it -- am I doing something wrong or is there a better way to do this?
Apparently this is what it's like without these trigger regions:
and with them:
the problem looks like the trigger regions are preventing objects from being deactivated, meaning that it's constantly simulating far more objects than it needs to. (After one lap, I polled all of my objects and about half of them were active!) The trigger regions are only supposed to do anything with the karts and nothing else on the track. I've tried using GhostObjects and RigidBodies and neither seem to fix it -- am I doing something wrong or is there a better way to do this?
Re: Poor performance with 9 raycast vehicles
Try the new SP1 release, which fixes a performance regression.
Re: Poor performance with 9 raycast vehicles
I think that fixed that problem, hooray!