Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / ScreenFPS() not always reliable on certain devices ?

Author
Message
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 22nd Jan 2013 13:07
I have encountered a problem with my Tweeninn process based on ScreenFPS() command. (only on galaxy tab 10.1 and 8.9 ... both equiped with a Tegra2).

I used a tween factor based on current FPS to have my 3D game running at the same "speed" whatever the framerate is.

I've tried to use ScreenFPS() command but it seems that it's not really reliable. ScreenFPS() give me 40fps .. so i have created another counter based on Time() and it shows me 30-32 fps ...

Can i have any info on how the ScreenFPS() command works ?

However it seems that on my samsung S3 and Nexus 10 it works well .. my own counter and ScreenFPS() command give me the same value.

Strange !
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Jan 2013 14:51
I tend to use getFrameTime() for timer based movement as it is very accurate (or seems to be). You can use it something like this to get your framerate:



this.mess = abs(sin(times#))
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 22nd Jan 2013 14:53 Edited at: 22nd Jan 2013 17:11
The ScreenFps command uses a moving average to stop the value moving around too much, it is mostly for display purposes only. GetFrameTime will give the exact number of seconds the last frame took, which can be used to calculate a frame rate for the last frame if desired.

Edit: Damn
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Jan 2013 14:54
Beat you Paul


this.mess = abs(sin(times#))
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 22nd Jan 2013 18:12
ok Thanks Bax & Paul ( i am alone with Cliff to work with AppGameKit 3D ? Lol or maybe i am the only one having problems and questions ...Lol )
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 22nd Jan 2013 19:36 Edited at: 22nd Jan 2013 19:37
Quote: "ok Thanks Bax & Paul ( i am alone with Cliff to work with AppGameKit 3D ? Lol or maybe i am the only one having problems and questions ...Lol ) "

I have used getframetime since the begining with agk and it works great
I usually have an global value called GFT# at the start of the loop where i grabb the frame time.
Then to always move at the same speed do i simply movespriteX 80.0*GFT# etc.
Quote: " You can use it something like this to get your framerate:"

I like that
I will use it in my future projects

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 22nd Jan 2013 20:26
Yes cliff, i already do that (and now with the more accurate value due to ScreenFPS() unreliability
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 22nd Jan 2013 20:39
but as Paul said, the framerate constantly changes and i will stabilize it smoothly (by interpolation) on a second to prevent a jerky display (more visible in a 3D game which needs to be smooth (my game needs that)

i have to see if interpolation takes too much time or not

Login to post a reply

Server time is: 2024-05-06 01:54:21
Your offset time is: 2024-05-06 01:54:21