GLBasic forum

Main forum => GLBasic - en => Topic started by: Crivens on 2011-Oct-07

Title: What frame rate does the retina iOS devices run at?
Post by: Crivens on 2011-Oct-07
I'm just checking some smoothness issues with my game and I noticed something interesting on my iPod touch (latest gen not counting what's been announced a couple of days ago). Basically I'm limiting the FPS to 60 and with my game there should be no issue in this. It's not exactly Quake 4 or anything.

Anyway I realised my score would not work between games that have different frame rates as I'm not increasing it to do with timings (like movement which I do use). Because of the simplicity of my game then so far all devices are the same score if you let the player die (score keeps going up at a set rate and if you don't touch anything you will die at the same time every time). Obviously this means everything is maxing out at 60FPS (didn't originally set it to 60 but it obviously internally does this as setting to 60 keeps the same score when you die) with no slowdown (seriously is hardly anything to actually slow it down). This is all my devices. A PC running the retina resolution, iPod Touch 2nd Gen and a Pre2 and 3GS (all running quarter overall retina), and a TP running iPad resolution (forget Android tablet as haven't had time to update it).

While I was looking for methods to make sure the score always increases according to the time I noticed something strange. My iPod touch (Retina model) has always looked a little jittery running the game (It works fine if I force non-retina mode though), which I put down to the increased resolution (even though the CPU and GPU are far superior). But the score is exactly half of the other devices. Every time. Hmm. This suggests it is being forced to 30FPS maximum. It cannot be overworked as this score would surely be quite random. So I set all my other devices to" LIMITFPS 30". And they got the same results as the retina iPod. And of course were jittery in exactly the same way.

So that leads me to the conclusion that retina mode for the latest iPod Touch (and I assume iPhone 4) is hardcoded to a maximum of 30 frames per second. Is this correct or am I missing something? Surely this would be obvious in the smoothness of other HD games so I can only assume GLB is limiting it for some reason (hopefully mistakenly rather than intentionally). I seriously want to get my retina devices as smooth as the non-retina ones and I can't see how to do it without reducing the resolution for retina (defeats the point of coding it for retina really).

Gernot? Can you shed some light or at least point out where I'm being a bit of an idiot?

Cheers
Title: Re: What frame rate does the retina iOS devices run at?
Post by: Crivens on 2011-Oct-07
Interesting. I was wrong about the 2G iPod Touch. It is running (after a few tests and doing the maths) at exactly 45FPS. Perhaps this one is a bit taxed with what it is doing but I doubt it as looks pretty fine though even when later things get ramped up a bit with a lot more 3D objects. All of which you can collide with. Possibly another device that sets it's own max FPS limit? It would be interesting to see if the 2G iPhone and iPhone4 do the same thing...

Cheers
Title: Re: What frame rate does the retina iOS devices run at?
Post by: spacefractal on 2011-Oct-07
SCORING, do you meant POINT system for the game?

Do not reley SCORING on the LIMITFPS, but intead use GETTIMERALL()...

This due LIMITFPS does not use any FRAMESKIP checks, and then all its does is, its just slowdown the game if there  is too much graphics/code and then its would  effect the scoring.

I use something like this (FPSGPX is the framerate I use for LIMITFPS):
Code (glbasic) Select

FUNCTION  update_Delay: displayUpdateFreq=0
STATIC _FPS
STATIC Timer#=GETTIMERALL()

LOCAL frames#, currentTimer#
IF displayUpdateFreq=0 THEN displayUpdateFreq=_FPS
_FPS=displayUpdateFreq
    LOCAL maxDelay# = 1000 / displayUpdateFreq
    currentTimer#=GETTIMERALL()
    frames=(currentTimer#-Timer#)/maxDelay#-0.05
    IF frames<1 AND frames>0.9 THEN RETURN 1
Timer=currentTimer
IF FRAMEPERSECOND>FPSGPX-3 THEN RETURN 1
    RETURN INTEGER(frames)
ENDFUNCTION  // UPDATE_DELAY


If FPS fall few a frames, then its would frameskip and invoke UPDATE() more than once time. but since there could been some round error, one framedrop would not been detected.
Title: Re: What frame rate does the retina iOS devices run at?
Post by: Crivens on 2011-Oct-07
Just a counter every time the screen updates. Assuming the hardware is not taxed (which it isn't) then the counter should be exactly the same on a set FPS after the same time. My LIMITFPS is set to 60 and all the devices have the same counter value after the same amount of time regardless of resolution or device spec. Ie they must all be running full pelt at 60fps. No surprise as even adding a load of new 3G objects with collisions every screen update changes nothing.

However the touch 4g in retina mode holds steady at half the counter. Ie 30FPS (which is matched by all other devices if I LIMITFPS 30). The touch 2g holds steady at 45FPS.

Cheers
Title: Re: What frame rate does the retina iOS devices run at?
Post by: Qube on 2011-Oct-07
All iOS devices are 60FPS.

Are you doing 3D? - I say this as I've found the iPhone 4 (960x640 mode) and iPad 1 are not the zippiest of devices when doing 3D with GLB. My latest game, which is 3D and to be announced soon (it's well cool :P) uses LIMITFPS -1 and timer code to keep the movement at 60FPS even if it can't physically draw 60FPS.

However, doing 3D on the iPad 2 via GLB storms along and I'm very happy with it's performance.
Title: Re: What frame rate does the retina iOS devices run at?
Post by: Crivens on 2011-Oct-07
Yes it is 3D. But that's just it. I don't believe it is set to 60FPS. My game is definitely not maxing out as I can up the object count massively and it is uneffected and stays smooth. Both the iPods are indicating everything is running fine but at 30FPS for 4G and 45FPS for 2G.

Cheers
Title: Re: What frame rate does the retina iOS devices run at?
Post by: Dabz on 2011-Oct-10
You havent say, left debug on in xCode have you?

I noticed my new game was a bit jiddery (I aim for 30FPS on mobiles), worked great on other devices, so, couldnt understand why the iOS version was acting up, though and behold, flicking from debug to release in xCode made it run as smooth as silk.

Just an idea.

Dabz