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 / Using SetSyncRate(60,0) is dropping FPS to 40-50FPS from 120 FPS.

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 21st Jan 2019 03:11 Edited at: 21st Jan 2019 03:23
SetSyncRate(0,0) = 120FPS
SetSyncRate(60,0) = 40-50 FPS
VSync(1) = 60FPS

Anyone else have this problem? I liked using SetSyncRate(60,0) vs SetSyncRate(60,1), because it felt minimal drops(a drop to 59.5 felt like a huge lag) in FPS were far more noticeable in mode 1, whereas mode 0 it was not.

edit: wanted to add this is a recent bug. didn't notice until today. been busy with other stuff
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 21st Jan 2019 04:25 Edited at: 21st Jan 2019 04:27
golelorn,

i've seen that (40-50 FPS with SetSyncRate(60,0) ) in the not-too distant past but, IIRC, a reboot fixed it (along with closing other apps that were running). otherwise, i can't replicate what you're experiencing (including variances in your code example - with/without each other, etc.); everything is as expected/documented, EXCEPT that:

Quote: "SetVSync
Description
...
Using this command with mode 1 will override any currently set refresh rate from SetSyncRate, otherwise these two commands would fight each other for control of the frame rate, instead AppGameKit will use the VSync refresh rate which is typically 60 frames per second, but depends on the monitor."


i'm not getting this behavior, either, where SetVSync(1) does't truly override but does LIMIT to SetSyncRate (where i would expect SetSyncRate to be ignored?). Ie:

SetSyncRate( 30,0 )
SetVSync(1)
...

...will still cap at 30 FPS

SetSyncRate( 60,0 )
SetVSync(1)

...caps at 60FPS (my monitor refresh rate).

SetSyncRate( 0,0 )
SetVSync(1)

...caps at my monitor refresh rate.

Meanwhile:
Quote: "SetSyncRate
Description
...
Using SetSyncRate will automatically turn VSync off
... "

...yes, but only if called after SetVSync

Finally:

i see drops down to 59.4 with both SetSyncRate(60,0) & SetSyncRate(60,1), with similar frequency, here
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 21st Jan 2019 17:31
Thanks, Virtual Nomad.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 22nd Jan 2019 10:10
I've got issues with this too.

In my world there's about 200 objects, and unlocked it goes from about 130-200 fps. Soon as I set the sync rate to 60 it's sits at 50-51 for. It's almost as if AppGameKit internally isn't registering how long it takes to sort and send objects correctly. I would point out, this only started within about the last 3 placed objects.

There are times when large numbers of objects that are simple can be combined to a single mesh (roads, pavements, trees etc) but it doesn't work all the time.
haliop_New
User Banned
Posted: 25th Jan 2019 10:42
yeah, I am experiencing the same thing.
i just use SetSyncRate(##.#,1) to fix it.
and since I'm writing games for mobile I usually restrict it to 30 fps, even the lowest of phones should not have a problem with it.
with that said.

using setSyncRate(30,0)
gives me
25 fps on pc
and 29.999 on a very low-end mobile.

using setSyncRate(30,1)
gives me
29.999 fps on pc
and 29.999 on mobile
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 25th Jan 2019 11:16
SetVSync(1) is the "prefered" method of frame rate control on PC and makes more sense due to the multitude of monitor frame rates. Some monitors aren't running at 60fps.

If you do still want to use SetSyncRate(FPS,1)..... ensure the second argument is "1" so that accurate timing is used. Its described in the documentation and states to use 1 is accurate frame rate control is wanted.

On windows using SetSyncRate(FPS,0) makes your application call sleep() to delay until the next frame is due. This allows efficient multitasking and low power use but the sleep calls are inaccurate and typically on millisecond boundaries meaning that maintaining a specific 0.01666666 delay cant be met accurately so its often slightly slower due to rounding.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 25th Jan 2019 11:48
I think there's slightly more to it than that.....the reason being the issue I had vanished all by itself when I left the pc alone for a while. No shut downs or Anyhting, AppGameKit still running......but when I went back it was back to the regular 60fps.

It's highly possible windows decided to do something in the background, or the constant running and closing the app caused it somehow, but it did go back to normal by itself without touching any settings. That does suggest that there's something more to it, but unless it happens on a first run I guess for me it's no issue.
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 25th Jan 2019 12:01 Edited at: 25th Jan 2019 12:02
Your frame rate is still varying alot even when using SetSyncRate(FPS,1)??
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 25th Jan 2019 23:03
Yes, it;s always on setsyncrate(FPS,1) - but the issue is occasional for me, not every run so I can;t even say for sure it;s AGK.

Login to post a reply

Server time is: 2024-11-23 09:21:10
Your offset time is: 2024-11-23 09:21:10