Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Thu Mar 22, 2012 3:42 pm 
Offline
User avatar

Joined: Thu Aug 11, 2011 6:42 pm
Posts: 25
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?


Attachments:
File comment: .

9 karts and 1/45 timestep

.

Capture251.PNG
Capture251.PNG [ 15.06 KiB | Viewed 874 times ]
File comment: .

1 kart and 1/90 timestep

.

Capture250.PNG
Capture250.PNG [ 15.36 KiB | Viewed 874 times ]
File comment: .

9 karts and 1/90 timestep

.

Capture249.PNG
Capture249.PNG [ 15.7 KiB | Viewed 874 times ]
Top
 Profile  
 
PostPosted: Thu Mar 22, 2012 3:43 pm 
Offline
User avatar

Joined: Thu Aug 11, 2011 6:42 pm
Posts: 25
also I'm using bulletsharp with mogre


Attachments:
File comment: .

1 kart and 1/45 timestep

.

Capture252.PNG
Capture252.PNG [ 14.41 KiB | Viewed 872 times ]
Top
 Profile  
 
PostPosted: Fri Mar 23, 2012 12:17 pm 
Offline

Joined: Fri Dec 10, 2010 3:39 am
Posts: 15
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?


Top
 Profile  
 
PostPosted: Fri Mar 23, 2012 6:06 pm 
Offline
User avatar

Joined: Thu Aug 11, 2011 6:42 pm
Posts: 25
9 karts with just a plane and no other level graphics:

Image

9 karts on the regular course with all of the other physics objects except the triangle meshes:

Image

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


Top
 Profile  
 
PostPosted: Sat Mar 24, 2012 12:52 am 
Offline
User avatar

Joined: Thu Aug 11, 2011 6:42 pm
Posts: 25
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:

Image

and with them:

Image


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?


Top
 Profile  
 
PostPosted: Tue Mar 27, 2012 1:49 am 
Offline
User avatar

Joined: Thu Aug 11, 2011 6:42 pm
Posts: 25
bump


Top
 Profile  
 
PostPosted: Wed Mar 28, 2012 9:12 pm 
Offline

Joined: Wed Feb 24, 2010 9:49 pm
Posts: 26
Try the new SP1 release, which fixes a performance regression.


Top
 Profile  
 
PostPosted: Thu Mar 29, 2012 12:33 am 
Offline
User avatar

Joined: Thu Aug 11, 2011 6:42 pm
Posts: 25
I think that fixed that problem, hooray!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group