Box2D Forums

It is currently Sat May 25, 2013 8:12 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Jul 24, 2012 1:44 am 
Offline

Joined: Tue Dec 27, 2011 5:34 am
Posts: 5
Hi,

In my game, I have some 40-60 box2D dynamic bodies arranged on a base polygon and gravity is applied on those bodies. When the simulation starts, game's frame rate is dropping from 60 to 18-28 range :o . Once all the bodies sleep, the frame rate comes back to 60. How can I improve the frame rate of the app? The problem is definitely coming from inside box2D, since, I tried switching off the simulation and the frame rate stays at 59-60fps.

Also, the frame rate drop comes only when bodies are awake. I'm stepping b2world with 0.024 time step, 8 velocity iteration and 3 position iterations.

The game is in iOS. The devices, I used were iPhone4, iPhone3GS and iPad.

UPDATE: The game is running in release mode and thumb support is disabled.

Can anybody please help me?

Regards,

Suraj


Top
 Profile  
 
PostPosted: Tue Jul 24, 2012 2:12 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1517
Location: Tokyo
How are the bodies positioned when they start? Performance can be bad if you start them all on top of each other.
Otherwise, this hardware should be fine with this number of bodies.


Top
 Profile  
 
PostPosted: Tue Jul 24, 2012 2:15 am 
Offline

Joined: Tue Dec 27, 2011 5:34 am
Posts: 5
Bodies are not overlapping, when they are placed in the game. But, they are stacked on top of others, as in the sideview of the game.


Top
 Profile  
 
PostPosted: Mon Jul 30, 2012 2:24 am 
Offline

Joined: Tue Dec 27, 2011 5:34 am
Posts: 5
:? bump :? Anybody know a solution for this???


Top
 Profile  
 
PostPosted: Mon Jul 30, 2012 8:51 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1517
Location: Tokyo
Are you using a large number of joints? Perhaps you could give some code to show how you are setting up the scene.


Top
 Profile  
 
PostPosted: Mon Jul 30, 2012 12:27 pm 
Offline

Joined: Tue Dec 27, 2011 5:34 am
Posts: 5
@irresistibleforce, I'm not using any joints in my code. Basically, I've setup a world and added box2d bodies to the screen. There are no more complex operations, except that some bodies have been split into triangles to overcome box2d limitations of concave shapes and number of vertices more than 8. Other than that, it's just basic body creation. I don't know what's wrong with it. When reducing number of bodies, the frame rate is improving really good, but it's making my level design too easy.


Top
 Profile  
 
PostPosted: Mon Jul 30, 2012 9:16 pm 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1517
Location: Tokyo
hmm.. interesting. So about how many fixtures are there in total?


Top
 Profile  
 
PostPosted: Tue Jul 31, 2012 5:56 am 
Offline

Joined: Tue Dec 27, 2011 5:34 am
Posts: 5
Around 110 fixtures are there in the extreme level. Other levels range from 70 to 100...


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users 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:
Powered by phpBB® Forum Software © phpBB Group