0

I have separate manifest files for each level of my game. So when user is playing on Level #1, files for Level#2 are being preloaded at the same time using LoadQueue (PreloadJS).

I've noticed some strange behaviour. Stage FPS is set to 24. But FPS raises (it can be noticed visually) while its preloading next files. It comes to normal FPS when files are preloaded..

How do I fix it? FPS raises at least 1.5x times.

EDIT: I'm using Ticker (RAF activated) and its set to 24 frames per second. Also each sprite has its own 'framerate' property. In most cases its set to 24 as well, but sometimes it has 16 (every 3 frame has been cut and hence framerate set to 16).

EDIT2: Here is an example to check the issue. There are 2 manifest files (for Level1 and Level2). Level1 starts while level2 is being loaded in the background. You can notice that the sprite in Level1 played on higher FPS. It gets to normal FPS when Level2 loading is completed.

It's better to download it and test locally, otherwise FPS changes are less noticable when downloading speed is not as high as in local or on WiFi.

Link: http://www.filedropper.com/preloadjsfps

  • Preloading shouldn't be causing any FPS change (except maybe to slow it down if the browser is doing any sort of heavy processing). Are you doing any other logic with preloaded content that might cause extra stage draws or something? How are you measuring FPS, and what timing mode are you using (I assume you are using Ticker with EaselJS)? – Lanny Sep 01 '15 at 15:54
  • Yes, I'm using Ticker in RAF mode with EaselJS. I didn't measure actual FPS, its just noticable visually. My sprites are playing way faster while next level file are being preloded. – John Ashton Sep 02 '15 at 11:31
  • 1
    Are you using RAF_SYNCHED? If not, setting a framerate doesn't do anything with RAF mode. I'm not sure why you would be seeing the increase in FPS either way though. – gskinner Sep 09 '15 at 19:17
  • Yes, I'm using RAF_SYNCHED mode. Disabling this command does help though. There are 15 levels in the game. Game starts when 1st level is ready. So while we are playing 1st level it keeps loading levels 2,3,4,5,6...15. And I can see that all sprites are really accelerated (I can see that if I open Dev Tools in Chrome on desktop). I see in console that prealoder is in progress (XHR loaded messages keep going). Everything get normalized as soon as all files are loaded. – John Ashton Sep 10 '15 at 10:37
  • That issue is not solved yet.. Had many others tasks todo. Now it's time to resolve it finally. Will do some more tests to identify and fix that. Have no idea what can be a reson of that. – John Ashton Mar 02 '16 at 06:34
  • Added an example so you can check it and see. Thanks! – John Ashton Mar 30 '16 at 07:13

0 Answers0