Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls to "update" spradically freeze and cause jittery animation #692

Open
synergie7 opened this issue Dec 16, 2012 · 1 comment
Open

Calls to "update" spradically freeze and cause jittery animation #692

synergie7 opened this issue Dec 16, 2012 · 1 comment

Comments

@synergie7
Copy link

Animations appear to be jittery when using "update" to handle the animation.

It appears that occasionally the frame rate drops to very low values e,g, 5 fps for an instant.

I've tried animating movement using MoveTo but it also has the same issue.

I've tested this on Firefox 17 OSX and Safari OSX and also on iPad 2, and all these platforms have this issue.

The issue can be seen in the Hello World example, if you look carefully at the text animated movement, however its very clear in this simple game I've been working on

http://www.rogerclark.net/demos/html_traffic_control/

Note. The background is a LazyLayer (but it doesnt seem to matter whether its a LazyLayer of not).

images of the "cars" are PNG24 with transparency, and are multiple of 2 pixels in size - I'm not sure if multiples of 2 or factors of 2 make any difference to web performance.

EDIT.

I've run some tests and the rate at which update is called varies quite a lot.

When running in normally, I get values if "dt" (delta time) as low as 0.001 sec with frame rate set to 60 FPS. But dt=0.001 is 1000 FPS, and as high as 0.13 which is approx 13 FPS.

This would probably explain the jitter in the animations.

I guess I'll need to put debug in the core of cocos2dHTML to see why this is occurring :0(

@Wu-Hao
Copy link
Contributor

Wu-Hao commented Feb 25, 2013

I think this is a limitation of Javascript html5, as its timer is never accurate, its garbage collector comes at random interval, and can cause spikes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants