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 / [SOLVED] My projects won't run at 60 fps anymore.

Author
Message
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 3rd Jul 2019 18:31
Hi.

I suspect this is a problem with my Windows 10 PC and not AppGameKit but I don't know where to start troubleshooting.
Yesterday all my projects worked just fine but today they all started to run at around 50 fps although the sync rate is set to 60.
I tried a blank project and SetSyncRate(60,0) and get 50 fps.
I use SetSyncRate(0,0) and I get around 2000 fps! What's going on?
I have restarted my pc several times but still the fps is wrong.
I get the same problem on both AppGameKit Classic and AppGameKit Studio.

Does anyone have a suggestion on what the problem can be?

The author of this post has marked a post as an answer.

Go to answer

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Jul 2019 19:05
Have you tried setting vsync off ?
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 3rd Jul 2019 19:14
Yes, I've tried vsync both on and off. Still just 50 fps.

I just remembered that my PC is setup as a dualboot with Windows Vista and it turns out everything works fine there (at least with an older version of AppGameKit Classic).
So it seems it's a problem with Windows 10.
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 3rd Jul 2019 21:42
I had something similar a while back. Complete head scratcher until someone mentioned that some windows updates can take a while to fully complete and while they are still being done it can affect performance. My game went back to being normal a few days later! Long shot but thought I’d mention it.
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 3rd Jul 2019 21:57
Yeah, I had an idea that windows update could be the problem so I checked if Windows was up to date and it wasn't. I'm updating it now but it's really slow. I hope everything is back to normal when it's done.
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 3rd Jul 2019 23:21
Nope. Windows update all done and still 50 fps when sync rate is set to 60.
It's not like it can't go faster since if I set sync rate to 0 i get around 2000 fps (still on Vista I get almost 4000 fps).
Weird...
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 4th Jul 2019 06:51
2000 fps? Wow, I can only get 800 with a fresh project

SetVSync(1) rem Makes my current project float around at around 50.0
SetSyncRate(0, 0) rem Gives me about 110.0
SetSyncRate(60, 0) rem But this one gives me 60.0
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 4th Jul 2019 13:46
Quote: "Have you tried SetSyncRate(60,1) ?"

Yes, I get better results that way but not perfect.

Last night the problem seemed to not happen all the time. I ran a project and it was fine and the next time it was not.
Today it seems to always be there though.
Here's a simple test project i created today:


The results using the following test (only one at a time):
Windows 10, AppGameKit Studio v0.95
SetSyncRate(60, 0) - results in around 50 fps
SetSyncRate(60, 1) - results in around 59 fps
SetSyncRate(30, 0 - results in around 25 fps
SetSyncRate(30, 1) - will slowly go up to 29.999 fps
SetSyncRate(0, 0) - results in around 2000 fps
SetSyncRate(0, 1) - results in around 2000 fps
SetVSync(0) - results in around 50 fps
SetVSync(1) - results in around 50 fps

Still weird...
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 4th Jul 2019 14:37
I noticed the problem sometimes went away again. And that it was related to opening and closing other programs while the AppGameKit project was running.
I've been able to reproduce the issue with the following steps:

1. Have only the AppGameKit IDE running (doesn't matter if it's Classic or Studio) with the following code:

2. Compile and run the project. I get 50 FPS.
3. Open Spotify. (it opens over the running project)
4. Click on the running project in the taskbar. I get 60 FPS.
5. Close Spotify. I get 50 FPS.

What the ????
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 6th Jul 2019 00:03
If your setting 60fps, and getting 59.xxxx ..... I think that's the best you'll get. I've never had a perfect 60 fps, but that's so marginal it would never be noticed in a game. A good practice is to start setting all movement and activity to fps based, then your covered regardless.
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 6th Jul 2019 04:58
Yeah, but if your projects ran at 60 fps yesterday and suddenly only ran at 50 fps today, you start thinking something's gone wrong somewhere...
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 14th Jul 2019 09:00
@Ranietz

I tried my games on the OUYA and had 60 FPS, and also the last builds without changing the geometry or other heavy things, I suddenly only have ~ 50 FPS.

I don't know, if the mipmaps or antialiasing has changed, if they fizzled arround with the "engine". Maybe something NTSC and PAL. But maybe I introduced something, that is very unoptimised. I try to solve the inputs with strings. Maybe they are very slow.
Maybe it slows down the system, if asking for some answers. I noticed the frame dropdown, after I tried to optimise my game between Windows and Android and for that, I used the command GetDeviceBaseName()="android" and I ask for that every frame about 8 controllers and over all buttons, maybe about 4096 times per frame. Maybe I don't need to know it as often.

Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 14th Jul 2019 14:13
I have pretty much given up on fixing the problem at the moment. I guess it's a problem with my pc or windows 10 and not AppGameKit itself.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 14th Jul 2019 17:12
Quote: " I used the command GetDeviceBaseName()="android" and I ask for that every frame about 8 controllers and over all buttons, maybe about 4096 times per frame. Maybe I don't need to know it as often."

i know this is just an example but why would you need to know it more than once? it won't change, store the result in a local and check that instead
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 15th Jul 2019 02:01 Edited at: 15th Jul 2019 02:03
Quote: "If your setting 60fps, and getting 59.xxxx ..... I think that's the best you'll get. I've never had a perfect 60 fps, but that's so marginal it would never be noticed in a game. A good practice is to start setting all movement and activity to fps based, then your covered regardless."


How do you go about this? Do you just use ScreenFPS() and then normalize the value? Or is there a better command to use(likeGetFrameTime)? This is something I have been wanting to do, but I have never really got into it.
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 15th Jul 2019 19:31
What GPU are you using?
The latest AMD Adrenalin Drivers (19.7.1) are causing some weird performance issues on all GCN Cards., but they're fine for the RX 5700 / 600-Series running RDNA.
Could be the issue., try rolling back your Graphics Drivers if this is the case.
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 15th Jul 2019 23:08
I have an AMD Radeon HD 6870 (Yes, my PC is old). The latest drivers for it is 15.7.1. I guess it doesn't support the newest drivers.
However, it seems the problem has gone away for the moment as everything is running at 60 FPS as it should. I'll give it a couple of days before I call it solved. Fingers crossed.
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 16th Jul 2019 09:21
Do you have a version control system so you can go back to a version that you know worked at a steady 60fps? If you can go back to one that works you can either build bank from that or prove that it is a system change rather than code change.
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 16th Jul 2019 11:33
Most monitors have 60 or 50hz modes. It's possible there's a setting in your latest driver config to allow you to switch between the two.
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 16th Jul 2019 13:12
This post has been marked by the post author as the answer.
Finally! I found the source of the problem.
My PC was originally built for music production and use an external sound card connected through firewire. A couple of weeks ago I switched from the external card back to the internal on-board card and forgot about it. When I switched back to the external card again everything works fine.
Since my PC is quite old there might be som driver issues or other problems using two sound cards so I disabled the internal card in BIOS and just use the external card from now on.
Thanks to everyone who tried to help on this problem. It's now finally solved.

Login to post a reply

Server time is: 2024-11-22 21:36:10
Your offset time is: 2024-11-22 21:36:10