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 / FPS is always 200 on windows

Author
Message
RifleRound
8
Years of Service
User Offline
Joined: 25th Jan 2016
Location:
Posted: 23rd Feb 2016 19:43

sooooo if i use:

SetSyncRate(60,1)

and

do
f#=ScreenFPS()
t#=GetFrameTime()
print("FPS: "+str(f#))
print("Seconds: "+str(t#))
sync()
loop

the FPS shown on desktop is always 200
the FPS shown on mobile is always 60

the reason i care:
this makes it nearly impossible for me to test the physics for mobile devices on windows because BOX2D changes the physics somehow when the fps changes.
also "setphysicsscale( 0.05)" doesnt help too.

soooooo

what am i doing wrong?
^^
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Feb 2016 21:03
SetSyncRate(60,anything) is a special case that tries to use VSync instead of sleeping or CPU cycling. I can't remember exactly why we did it this way but it was probably due to backward compatibility. If you use SetSyncRate(59.9,0) you can avoid this to use the normal methods of limiting the frame rate.

As for why it goes to 200, if VSync fails for some reason then the frame rate is limited to 200fps to prevent the frame rate going too high. You can use a frame rate of 0 to remove the limit altogether.

Mobile devices can't go higher than 60fps anyway so it looks like it is working on them.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Feb 2016 08:50
Quote: "BOX2D changes the physics somehow when the fps changes"

At lower frame rates , the physics is naturally more approximated. I don't know if it is implemented in AppGameKit, but you can set the internal number of cycles in Box2D to make sure it runs the same at all frame rates.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
RifleRound
8
Years of Service
User Offline
Joined: 25th Jan 2016
Location:
Posted: 24th Feb 2016 09:37
Thanks Paul!
At least ive got one issue solved!

but still my char jumps higher in andoid... even though the fps is the same.

i have no idea how to solve that.

BUT THANKS anyway

Quote: "
I don't know if it is implemented in AppGameKit, but you can set the internal number of cycles in Box2D to make sure it runs the same at all frame rates."


well if its possible:
it certainly would be nice to know how

if not possible:
it would be nice to implement
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Feb 2016 11:31
Take a look at chapter 2.4 here: http://box2d.org/manual.pdf

It might be that if your time step is smaller than 1 / FPS, the results will be inaccurate. This is speculation on my part, just trying to make sense of it.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-11-17 04:07:19
Your offset time is: 2024-11-17 04:07:19