Box2D Forums

It is currently Tue May 21, 2013 1:44 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: TimeStep problem
PostPosted: Wed Apr 04, 2012 3:42 am 
Offline

Joined: Mon Mar 19, 2012 11:34 am
Posts: 7
Heya, we are a group that are creating a game using box2D, duh.
We have encountered a little (big) problem.

Out avatar can shoot a string out from its arm, with a set distance, just like a rope.
When we start the game everything runs at normal speed. But as fast as we shoot out our rope (60 bodies, every body is like 0.5f, 1.0f sized.) the framerate just drops. The chain that hangs from the ceeling starts to sway way slower and everything else that is in the game starts to act slowly. We are currently studying game programming at the university and we asked our teacher about it. He said that we shouldn't have to alter the timeStep and iterations. Should do that automatically. But something is wrong.

Anyone have any idea what it can be?

Cheers.


Top
 Profile  
 
 Post subject: Re: TimeStep problem
PostPosted: Wed Apr 04, 2012 3:46 am 
Offline

Joined: Mon Mar 19, 2012 11:34 am
Posts: 7
Just tried a release build, still slowing down a little bit (not much at all) but way way better.
Still need someone to tell me if it's necessary to alter the timeStep, iteration etc.

Like one of our programmer in our group need to have timeStep = 1.0f/15.0f to work at normal speed.


Top
 Profile  
 
 Post subject: Re: TimeStep problem
PostPosted: Wed Apr 04, 2012 8:18 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1515
Location: Tokyo
Does the speed recover after the rope has extended?
Do the bodies of the rope collide with each other? If they all start in the same place it could slow things down. You could set the filter for the rope segment fixtures so that they don't collide with each other.

If the speed does not recover after the initial firing period where the rope segments are overlapping, maybe there are just too many bodies in the rope.


Top
 Profile  
 
 Post subject: Re: TimeStep problem
PostPosted: Thu Apr 05, 2012 11:15 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
^^ turn off collision between the rope bodies. Use the collision filter bits.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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