• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
duskndreamz

Help in reducing FPS ?

8 posts in this topic

I am running my game engine with rendering and the game logic together on a single computer.
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..
-1

Share this post


Link to post
Share on other sites
What kind of hardware are you running on?
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.
0

Share this post


Link to post
Share on other sites
Sure, just have a timer return the time elapsed since previous frame. If it is below a certain threshold, call Sleep(1 ms). It should be enough.
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.
0

Share this post


Link to post
Share on other sites
[quote name='Krohm' timestamp='1305878988' post='4813379']If it is below a certain threshold, call Sleep(1 ms). It should be enough.[/quote]
This would [b]decrease[/b] the amount of computing power available for game logic, not increase it.

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.
0

Share this post


Link to post
Share on other sites
[quote name='marius1930' timestamp='1305890351' post='4813420']
[quote name='Krohm' timestamp='1305878988' post='4813379']If it is below a certain threshold, call Sleep(1 ms). It should be enough.[/quote]
This would [b]decrease[/b] the amount of computing power available for game logic, not increase it.[/quote]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.
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.
0

Share this post


Link to post
Share on other sites
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 [b]game[/b], 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.
0

Share this post


Link to post
Share on other sites
Thanks for all the replies.

Firstly more explanation is required on my part

[b]My Situation:[/b]
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 )

[b]My Game Engine[/b]
1. Running a car racing game
2. The game logic and Physics etc are running in a separate thread

[b]My Current Problem[/b]
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.
0

Share this post


Link to post
[quote name='freeworld' timestamp='1305922399' post='4813609']
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 [b]game[/b], 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.
[/quote]




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.
-1

Share this post


Link to post
Share on other sites
[quote]
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%
[/quote]

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.

[quote]
2. Now due to some considerations, merged the game logic and visual rendering together
[/quote]

What's the problem there?

[quote]
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.
[/quote]

If you're still getting ~60fps, you're probably looking the wrong place. I doubt the jittering is performance based, but rather code based.
0

Share this post


Link to post
Share on other sites
[quote name='duskndreamz' timestamp='1305963087' post='4813783']
Firstly more explanation is required on my part[/quote]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.
[list=1][*]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"?[/list]This is just to have a bigger picture of what's going on.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0