choppy

Hi there,
I am almost there to finish a game. I used alchemy ( i use WCK classes, but not the components, as i use FDT)
For what i can see as a i final results, i am pretty happy.
The game is a platform scrolling game, as Cannabalt. constant run.
But, I have some random choppiness in the scrolling, and sometimes the game freeze for a time that can be 0.1 s and in some computer even more.
Frame rate is 60. the problem doesnt change if i bring down to 30.
I changed my timelines animation in spritesheet, and this made something. The platform is Tile based, in a really simple way. I scroll, and once the scroll is at his extreme right of the screen, i attach the next one. The Tile is a png, and on the top, reading data from an xml, i build the physics.
Any idea what i can do to prevent this jerky-random-choppiness?
Instead of using the alchemy-WCK approach, could i get a better result if i use a pure Box2d approach, or nothing change in term of performance?

Cheers

Rob
Are you rendering off of RENDER or ENTER_FRAME? I call stage.invalidate() in the beginning of ENTER_FRAME, and I also smooth throttle the stage's framerate depending upon the actual update milliseconds.

If you are seeing just stuttering (occasional), then it might be the garbage collector, and you'll need to pool objects to prevent excessive allocations.

If you are seeing real choppiness, and it doesnt matter exactly where you are in the level, then it might be that somehow your program is falling behind in rendering.

If you are seeing choppiness that changes depending upon where you are, then you should call rebalance on the b2World's b2ContactManager's b2BroadPhase's b2DynamicTree.
Hi there, thanks for your reply. here some questions
pTymN wrote:
Are you rendering off of RENDER or ENTER_FRAME? I call stage.invalidate() in the beginning of ENTER_FRAME
i actually use ENTER_FRAME for the world scrolling, and WORLD step, for the Hero movement.
So i should just call
Code:
stage.invalidate()

at the beginning of ENTER_FRAME , and Step?

pTymN wrote:
, and I also smooth throttle the stage's framerate depending upon the actual update milliseconds.
I don't get what you mean. you mean adjust runtime the framerate, depending on the update milliseconds? Not sure this is gonna help because i see the same choppiness even if i drop down the fps. If you can explain it a bit better it would be great.

pTymN wrote:
If you are seeing just stuttering (occasional), then it might be the garbage collector, and you'll need to pool objects to prevent excessive allocations.
This is already done, so it can't be the GC

pTymN wrote:
If you are seeing real choppiness, and it doesnt matter exactly where you are in the level, then it might be that somehow your program is falling behind in rendering.
yes it happens randomly, and it doesnt matter where i am . so? i don't understand what you mean

pTymN wrote:
If you are seeing choppiness that changes depending upon where you are, then you should call rebalance on the b2World's b2ContactManager's b2BroadPhase's b2DynamicTree.
That is not the case


Cheers

Original thread: https://box2d.org/forum/viewtopic.php?t=6434