rolling ball stop for half a second then moves on

Discuss any Chipmunk bugs here.
Post Reply
andrews
Posts: 16
Joined: Wed Apr 27, 2011 5:35 am
Contact:

rolling ball stop for half a second then moves on

Post by andrews »

I have an app like labyrinth.. in which the ball moves around as expected..
but once in a while it simply stops, so there is a lag before it starts moving again..
it is really short but noticeable, especially on ipad1. .5seconds or less.
should I look for issues in the engine setup? or this is completely unrelated to this?

Thanks!
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: rolling ball stop for half a second then moves on

Post by slembcke »

That doesn't sound like a Chipmunk issue. That sounds like a problem with you game loop or timers or something.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
andrews
Posts: 16
Joined: Wed Apr 27, 2011 5:35 am
Contact:

Re: rolling ball stop for half a second then moves on

Post by andrews »

Ok I see..

Can this be related to the way STEP is setup? Is that what you are referring to when you say "game loop or timers or something" ?

My steps is
cpFloat dt = 0.5/60.0;
[space step:dt];
[space step:dt];

The lag is really short now if it happens at all, but noticeable.

Can it be that there is a remaining time as the author talks about in the http://gafferongames.com/game-physics/f ... -timestep/ article?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: rolling ball stop for half a second then moves on

Post by slembcke »

No in that case your simulation rate is locked to your framerate. For a simple game that is fine. The article talks about a fancier method that you can use to decouple the two if you have a really high performance or fast action game.

What I meant is that if you game stops or is getting stuck every once in a while, it sounds like it's because your timer or loop is stuck waiting for something. In other words, whatever you are using to invoke your simulate/draw step each frame is skipping so your program sits and does nothing at all for that half second.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests