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.

Windows / FPS low on Tier 2 C++ projects

Author
Message
Manjinder
6
Years of Service
User Offline
Joined: 10th Aug 2017
Location:
Posted: 30th Mar 2018 15:25
Hi,

I am coding in C++, but I have noticed (regardless of number of sprites on screen) that the FPS (ScreenFPS) mostly sits at max 53FPS. Once in a blue moon I get 59.99ish FPS. I've noticed this on my game and also on the Pong example game.

Being curious I fired up the Benchmarking (one with loads of balls) project in Tier 1, and lo and behold it runs at 60FPS, all the time.

I am running the latest 12/12/2017 libraries and have a MS Surface Pro 4 Windows 10 PC (integrated graphics) running Visual Studio 2017 Community edition.

My game is running off the VS2017 template project and the problem is in windowed or full-screen mode. Even running the application outside of VS2017 does not help. It is the same in Debug and Release mode. At the moment my game only has one sprite on the splash screen and I can't believe it maxes out at 51/52/53FPS?

If I can recall I did not have this problem some time back when I was working with an earlier version of AGK2, although that was on an Alienware X51 R2 gaming PC which has dedicated graphics, running on Windows 7 and also Windows 10.

Anybody else notice this?

Thanks,
M.
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 2nd Apr 2018 07:40 Edited at: 2nd Apr 2018 07:40
update GFX driver..
Manjinder
6
Years of Service
User Offline
Joined: 10th Aug 2017
Location:
Posted: 26th Aug 2018 15:06
I want to revisit this issue. It definitely seems like a problem with the C++ libraries. I have just bought a new Windows 10 all-in-one PC. It is a mid-range touchscreen PC with an AMD A9-9400 CPU and Radeon R5 integrated graphics. Now, with just AGK2 and Visual Studio 2017 Community installed, I am only hitting 50 FPS most times. This happens with the default Tier 2 template solutions, 32-bit or 64-bit. Like I said in my first post, when I had a fast gaming PC, I did not notice this, probably due to the fact that the PC masked the issue with it's speed.

If you notice when you fire up an AGK2 app, the FPS works up from 25-30 FPS to 60 FPS on the screen (actually this implies that the libraries do some heavy initialization because I expect a game to hit 60 FPS on the very moment it starts). This can be seen in the AppGameKit IDE when running the demos. Again, the Tier 1 project Benchmarking (with loads of sprites) always runs at 60 FPS.

So why is Tier 1 for me, working better than Tier 2?

I am running the latest AGK2 as of today.
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 27th Aug 2018 01:39
The sync timer is not very accurate by default. There is a more accurate timer,but more CPU intensive, that can be enabled by using SetSyncRate(60,1) second parameter to 1 uses the more accurate timer. On my machine, I get about 50 fps when using the default 0, perfect 60 fps when I use 1.
Maindric
14
Years of Service
User Offline
Joined: 22nd Jul 2009
Location:
Posted: 31st Aug 2018 04:24
I ran into this issue and I talked a fair bit to Dave on Discord about it. There is an issue where SetSyncRate(60,0) will usually (not always) cut 1/6th of the frame rate off of the total no matter what. You need to use SetSyncRate(60,1) to make it reliably work. I also had the issue of ever present video tearing no matter what the AppGameKit settings were until I set it to always force on in the Nvidia control panel of my GPU.
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 31st Aug 2018 16:51
Using SetSyncRate is not a great method at all - any artificial framerate limiting like that isnt going to be great.

Using SetVSync(1) works much better and avoids the tearing and stuttering.

From the documentation - "This (SetVSync) is the preferred method of limiting the frame rate as it will link the frame rate to the monitor refresh rate and avoid tearing or stuttering."
Maindric
14
Years of Service
User Offline
Joined: 22nd Jul 2009
Location:
Posted: 31st Aug 2018 17:11 Edited at: 31st Aug 2018 17:20
Quote: "Using SetVSync(1) works much better and avoids the tearing and stuttering."



When I used this, I would get wildly fluctuating frame times and bad screen tearing. The only way I got stable performance was, as I mentioned, SetSyncRate(60,1) and set vsync on in the Nvidia control panel. Ideally, you are right. However, in practice on some hardware, is not super clean.

Here is a video I took when I was investigating this with Dave on Discord:




It can be hard to see, but I resolved this exactly as I explained.

Login to post a reply

Server time is: 2024-03-29 13:31:07
Your offset time is: 2024-03-29 13:31:07