Turn off RAF mode and adjust framerate

Hello. What I want to ask is that some new animations are playing very fast.
createjs.Ticker.timingMode = createjs.Ticker.RAF;
I set the timing mode as RAF as above.

I want it to work with 60 fps on all devices. It works with 120 fps especially on new devices.

If I turn off the timing mode above and set this code
( createjs.Ticker.framerate=60) it works with 60 fps.

What I really want to ask is, will turning off RAF mode cause performance problems on old devices?

The ZIM Ticker() is used for animations, drags, etc. and runs at 60fps with a requestAnimationFrame... it can be set with Ticker.setFPS(mobile, pc); You can read about all the settings including setting the timing mode, doing a raw setting, etc. here: DOCS - ZIM JavaScript Canvas Framework - Documentation.

We did find that old devices... like iPod 6, etc. worked better at 30fps but that is quite old and about 5 years ago we switched to 60fps standard. I am not totally sure what plays animations faster... they seem to play roughly the same speed for me - but I do not test on many newer devices. Just try and see - and perhaps others have some comments.

I recently bought the Samsung A25 model. In this brand, events can sometimes reach 120 fps on the phone. Although this seems good, it makes events and games unplayable because it is so fast. I think this is caused by the RAF. Has anyone here experienced such a problem and found a solution?

I found this page on the internet: Standardize your JavaScript games' framerate for different monitors

I'll try it out and let you know if it works.

There is a concept of a delta - that I think is the time between frame calls - this can be used somehow to even out animations, etc. If it is a problem, we can most likely adjust it in ZIM so you do not have to worry. I know you can get the delta in CreateJS and in ZIM Ticker. But it would be better, if we throttle in the Ticker to make sure it stays at 60fps.

2 Likes

I solved the 120 fps problem to a great extent. In time related situations I use requestAnimationFrame. I knew that it works at 60 fps as standard. I made all my adjustments for 60 fps. I saw that it works at 120 fps on my new phone with a screen refresh rate of 120hz. I realized that this problem is not related to ZIM. I solved my problem.

I solved it by using this address in case there are people who have problems in the future.

1 Like

@Ferudun and @abstract This issue also affects physics engines. Where I had to do some timing trickery for my 120hz+ monitor at home compared to my 60hz laptop monitor. Uggghhhh is all I can say.

1 Like

Ya - I figured it would. If there is anything you think we can do, let me know. We do provide a timeStep property for physics which should slow down or speed up the engine. Then base it on some test for framerate or whatever.

1 Like