Help in reducing FPS ?
#1 Members - Reputation: 138
Posted 20 May 2011 - 01:32 AM
My CPU usage is going at approx 95-100% while running the game, but the FPS is 65 with VSync on.
Is there a way to reduce the CPU being used by the visual rendering, by reducing the FPS rate to say 40, providing more CPU time to the Game logic.
Any help would be great..
#2 Members - Reputation: 281
Posted 20 May 2011 - 02:07 AM
Sounds like there could be some kind of bottleneck in the code.
Rendering is done by the GPU, since your logic and rendering is on one thread you cant really
do much to slow just the rendering down.
Profile your code and make sure you dont have any potential code that causes slow downs.
#3 GDNet+ - Reputation: 1745
Posted 20 May 2011 - 02:09 AM
However, 95% CPU is still a lot. Perhaps the driver is busy-waiting for the Vsync. I'd first try getting the rid of it. Vsync is bad when developing, it introduces considerable deviation for measurements.
#4 Members - Reputation: 103
Posted 20 May 2011 - 05:19 AM
This would decrease the amount of computing power available for game logic, not increase it.If it is below a certain threshold, call Sleep(1 ms). It should be enough.
Anyhow, a 95% CPU usage doesn't really mean you're using a whole lot of computing power, as the aforementioned sleep(1) would show.
Are you actually short on computing power for game logic? or is this an attempt at preemptive optimization?
Unless you're doing the logic in a separate thread, the calculations should always finish before presenting a new frame, and such as such not result in any problems -- certainly not if you're still managing 65 FPS.
#5 GDNet+ - Reputation: 1745
Posted 20 May 2011 - 06:42 AM
No it would not. If the driver is busy looping on vsync then this effectively skips a sync. I bet that profiling will show the application spends most of the time in the drive.This would decrease the amount of computing power available for game logic, not increase it.If it is below a certain threshold, call Sleep(1 ms). It should be enough.
Moreover, if the driver is allowed to cache up to N frames and the CPU is so fast to actually always fill the buffer (very likely) the runtime will stall to allow GPU to catch up.
In this case, sleep(1) would free CPU% as well with little to no noticeable difference.
In both cases, CPU% would be freed for computation - since FPS is locked at (say) 60, this would reflect in less CPU% being used.
#6 Members - Reputation: 302
Posted 20 May 2011 - 02:13 PM
The reason your CPU is using that much to run your game is because it has that much to run your game... open several other apps while playing your game if you want to slow your computer down... otherwise don't fret. The only time you should actually want to slow down a game, is when it is being run on a battery dependent device. Such as a phone.
Also if you're using windows task manager to get these values, look it up on msdn. The values aren't always accurate and might be reporting something different then you might think.
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.
#7 Members - Reputation: 138
Posted 21 May 2011 - 01:31 AM
First explain why you want to do this?
The reason your CPU is using that much to run your game is because it has that much to run your game... open several other apps while playing your game if you want to slow your computer down... otherwise don't fret. The only time you should actually want to slow down a game, is when it is being run on a battery dependent device. Such as a phone.
Also if you're using windows task manager to get these values, look it up on msdn. The values aren't always accurate and might be reporting something different then you might think.
Thanks for all the replies.
Firstly more explanation is required on my part
My Situation:
Hardware:
1. Core 2 duo 2.93 Ghz
2. 4 GB DDR 3 Ram
3. ATI XFX 5770 Graphics card running in eyefinity mode : Resolution: 3 x 1600 x 900 ( across 3 monitors )
My Game Engine
1. Running a car racing game
2. The game logic and Physics etc are running in a separate thread
My Current Problem
1. Earlier the game logic was running on a separate PC and Visual rendering on a seperate one, and no issues where there, the FPS was 60 and CPU usage on visual was around 45%
2. Now due to some considerations, merged the game logic and visual rendering together
3. Now when running the entire thing together, the car drives a bit jerky , appearing as if the visual is getting stuck occasionally in between, the FPS is still around 60.
I am not the experienced with profiling the code, so haven't bee able to exactly pinpoint the problem.
#8 Members - Reputation: 302
Posted 21 May 2011 - 09:31 PM
My Current Problem
1. Earlier the game logic was running on a separate PC and Visual rendering on a seperate one, and no issues where there, the FPS was 60 and CPU usage on visual was around 45%
Like a server? or do you mean you processed logic on one core and rendering data on another? If the later, then you're doing your threading wrong. You shouldn't be splitting your subsystems into separate threads, but instead splitting your tasks up into separate threads.
2. Now due to some considerations, merged the game logic and visual rendering together
What's the problem there?
3. Now when running the entire thing together, the car drives a bit jerky , appearing as if the visual is getting stuck occasionally in between, the FPS is still around 60.
If you're still getting ~60fps, you're probably looking the wrong place. I doubt the jittering is performance based, but rather code based.
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.
#9 GDNet+ - Reputation: 1745
Posted 23 May 2011 - 01:09 AM
Yes, absolutely. I have a very clear idea of what might be going on but if you don't mind I'd like you to elaborate on the following.Firstly more explanation is required on my part
- How did you sync'd the threads? How many buffers? How many locks? Are you creating the data from scratch each time? Using atomics? Critical Sections? Events?
- Describe your workload. How many batches? How many vertices per batch? Are the shaders "complex" or "simple"?






