In fact, there are several reasons for this behavior, and this is not just cocos2d, but the effect observed in any game engine in vertical synchronization environments (VSYNC). On iOS, VSYNC is always on; on a PC, you usually have the option to turn it off to improve the frame rate if they are consistently lower than the speed of the monitor due to a screen break . Typically, LCDs such as iOS devices update their display at 60 Hz, providing a maximum of 60 frames per second.
Cocos2D 1.x by default uses the CADisplayLink class to update, Cocos2D 2.x uses exclusively CADisplayLink. CADisplayLink forces updates to synchronize with the refresh rate of the screen. A notification value is sent when the screen has finished drawing its contents.
When you get 60 frames per second, everything is fine. But if the game fails to display the frame on time to display 60 frames per second, it will receive the next update only after completing the next screen update. This effectively reduces the frame rate as soon as the frame rate drops below 60 frames per second - or, in other words, as soon as the refresh and rendering cycle takes more than 16.666 milliseconds. This means that you can only have discrete frames of 60, 30, 20 and 15 frames per second (60 divided by 1, 2, 3 and 4) on iOS with CADisplayLink updates.
The effect is quite noticeable, because the frame rate, which varies between 60, 30, 20 and 15 frames per second (even for a split second), does not feel smooth, mainly because it is so unstable - instability is what we notice like "not smooth." If your game is affected by this, you may find that limiting the frame rate to 30 frames per second will actually make the game smoother. You also have more time to update and render material between frames.
This constancy of the frame rate of 24 frames per second, which is conceived as "smooth", but the directors also learned to avoid scenes where the limited frame rate becomes too obvious. For example, they avoid, as hell, that games are done very often: sideways scrolling, i.e. sideways camera movements or sideways objects moving past the camera.
You will be surprised how smoother movies are possible when you watch "The Hobbit" - this is the first blockbuster movie to run at 48 frames per second. You will immediately notice how many more βrealβ and βrealisticβ characters are in the film. Check out this unofficial 48 fps Hobbit trailer to get an impression.
What cocos2d shows as fps is not an exact representation of the switch from 60 to 30 to 20 and 15 frames per second, but the average frame rate is several frames. Therefore, when cocos2d prints β45 frames per second,β that means half the time when the game showed 30 frames per second and the other half 60 frames per second compared to previous frames.