Game loop randomly slowing down for one iteration ?
Posted: Tue Mar 11, 2014 5:25 pm
Hello
I am using the game loop from game academy for "yet an other game" on iOS
http://forums.runrev.com/viewtopic.php? ... 037#p79876
Works well except for random performance issue.
While my game runs I have usually a 60 milliseconds duration for one loop (not a fast action game, but still, and I don't need less)
When the game runs on an actual device, sometimes, randomly, this goes to 200 milliseconds and then comes back to normal, at the next iteration.
This can be seen on the screen because sprites are slowing down abnormally then going to normal again.
It is independent of any action from the player and happens even if nothing is touched.
Where can it come from and how to prevent it ?
Is it background processing on the iPhone/iPad that I can't control (from iOS or some sort of garbage collection) ?
It seems for example that it happens more often if I have wifi on (my game does not use it).
It seems also to be more frequent with iOS 7.
Of course I can't and I don't want to control the user's environment.
Any ideas ?
Thanks
I am using the game loop from game academy for "yet an other game" on iOS
http://forums.runrev.com/viewtopic.php? ... 037#p79876
Works well except for random performance issue.
While my game runs I have usually a 60 milliseconds duration for one loop (not a fast action game, but still, and I don't need less)
When the game runs on an actual device, sometimes, randomly, this goes to 200 milliseconds and then comes back to normal, at the next iteration.
This can be seen on the screen because sprites are slowing down abnormally then going to normal again.
It is independent of any action from the player and happens even if nothing is touched.
Where can it come from and how to prevent it ?
Is it background processing on the iPhone/iPad that I can't control (from iOS or some sort of garbage collection) ?
It seems for example that it happens more often if I have wifi on (my game does not use it).
It seems also to be more frequent with iOS 7.
Of course I can't and I don't want to control the user's environment.
Any ideas ?
Thanks