Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Sep 01, 2011 12:59 pm 
Offline

Joined: Sun Aug 14, 2011 11:23 am
Posts: 6
Hello I am making very simple space game, I am using btCollisionWorld and btCollisionObject, for movement I just use setWorldTransform(), as I thought it won´t be problem with high framerates, but my framerate is around 20fps, 30 in best cases. And I have small box shapes moving very fast (bullets), so they just jumps from one space to another. So what I need is an advice how to encrease my framerate(framerate drop is certainly caused by Bullet, without collision detection I have framerate about 100fps) or whether I should better switch to btDynamicsWorld. I am using btCollisionWorld , because I thought it would have better performance than btDynamicsWorld. So something more about my environment, there are about 125 quite big asteroids(convex hull shapes), all of them uses the same mesh, but are different scaled, then there will be spaceships(convex hull shapes too) and of course their bullets(box shapes) all I want to do is to get collisions info, I don´t really need rigid body simulation. I am currently using btCollisionWorld::ContactResultCallback for all spaceships and their bullets each frame. So if anyone could give me some tip how to improve my performance, it will be much appreciated, thanks.


Top
 Profile  
 
PostPosted: Fri Sep 02, 2011 6:19 am 
Offline

Joined: Fri Jun 24, 2011 8:53 am
Posts: 130
It would probably be more effective to do sweep tests on missiles instead, perhaps every n frames. If the warhead travels really fast, I'd do a ray cast instead.
To be completely honest, I'm interested in knowing more as well as I am in a similar situation.


Top
 Profile  
 
PostPosted: Fri Sep 02, 2011 8:51 pm 
Offline

Joined: Tue Jul 26, 2011 9:24 pm
Posts: 17
hey I'm making a space game too (rts) :)

But one thing with ODE that I noticed is that if you scale a collision object it's a huge performance hit. like at least half the speed or so. It might be the same with bullet too.

I fixed it in that project by scaling my model and then creating the collision model/element to that size. that way there wasn't any scaling done on the collision element and it sped things up quite a bit.

Another thing you could try is making objects further away from the camera(s) have less collision precision.


Top
 Profile  
 
PostPosted: Sat Sep 03, 2011 6:54 am 
Offline

Joined: Sun Aug 14, 2011 11:23 am
Posts: 6
Thanks a lot, when I disabled scaling it really improved the performance. I just wonder whether it is caused by some strange behaviour of scaling, or by some kind of sharing of collision shapes(without scaling all asteroids are the same) or by fact that without scaling the asteroids are a lot smaller, because for scaling I used random range 0.7 - 20 on each axis. So it helped me a lot, but I am not sure what exactly caused this improvement. So if anyone could give me an answer or another tip, I would be very glad.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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