• 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
Nicholas Kong

Why do frame rate drop in games?

8 posts in this topic

Does it necessarily depend on the platform(console, pc, handheld), the optimizing algorithm is not efficient enough or just the amount of object currently on the screen is too much for the platform too handle? 

 

Just wanted to ask in case, I worked with a different language with a new api where I might run into this issue.

 

How do I improve frame rate in a game? How many factors is taken into consideration to improve the frame rate.

Edited by warnexus
0

Share this post


Link to post
Share on other sites

In general, it is either because:

 

1. You're doing too much work (rendering or other work) each time around the rendering / or logic loop

 

OR

 

2. There are single "slow" actions which are causing one-off slow frames which makes the game jitter in an unpleasant way.

 

Fixing 1) normally means doing less stuff, i.e. either reducing the complexity of the game, doing better culling, using more efficient drawing (e.g. objects with fewer primitives) or some other optimisation.

 

Fixing 2) can mean doing some "clever" macro-optimisations such as preloading resources, or doing complex tasks in "chunks" and splitting them between several ticks, to avoid slowing down your main processing.

Interesting answer. Thanks for the heads-up, markr!

0

Share this post


Link to post
Share on other sites


Does it necessarily depend on the platform(console, pc, handheld), the optimizing algorithm is not efficient enough or just the amount of object currently on the screen is too much for the platform too handle? 

 

as mentioned above the game can just do too much for the hardware (run slow all the time),or you can have momentary slowdowns during a slow operation, such as paging a resource off disk.

 

both of these can happen on any platform with any language and any tools. its all caused by you telling the computer to do more than it can do in the time allotted.

 

momentary slow operations can be split up over multiple frames (think streaming terrain chunks off disk) to spread out the work load over time to avoid the momentary stall.

 

although its possible to do simulation that slows things down, its usually trying to draw too much on the screen that's the culprit. in some cases it both: graphics plus some contribution from AI that's eating up all your processing power.

 

the key to improving frame rate, is to do less.

 

this can be done by:

1. optimization: doing things more efficiently.

2. pre-processing: doing things ahead of time (before release, at load time, etc).

3. splitting slow tasks over multiple frames (streaming terrain chunks, using multiple frames to calculate long A* paths, etc).

4. actually doing less. for example, in a FPS title, design levels so there's never too many bad guys active at once to draw on the screen at 60 fps. if your game engine can only draw 10 bad guys at 60fps, you design the levels so there's never more than say eight active at once. that way you guarantee you're never over-taxing the hardware.

 


How many factors is taken into consideration to improve the frame rate.

 

while there are multiple causes (slow CPU, slow hard drive, slow GPU, slow code), the only thing you really care about is elapsed time.

 

so the first tool in any code optimizer's bag of tricks, after simply inspecting the code for obvious inefficiencies, is a high resolution timer to measure the elapsed time of a section of code in milliseconds, microseconds, or frequency counter ticks.

 

slow hardware is a challenge to be worked around.

 

slow code is a problem that needs to be fixed.

 

simply trying to do to much is a design flaw that should have been identified by means of a rapid prototype to test the scope and requirements of the game vs the target platform's capabilities.

 

here's a good approach to use for optimization:

 

1. start with straight forward algos, unless you KNOW it'll be too slow.

2. if you think an algo may be too slow, test it first (rapid prototype). this can be as simple as a little test routine you add to the game to try out this or that to see if it runs fast enough. 

3. always think in terms of efficiency (code that runs fast) when coding. try to avoid slow code in time critical areas. if you code with speed in mind, you tend to write more efficient code from the get-go and require less optimization later.

4. when the frame rate drops, break out the timers (or a profiler), and use a divide and conquer strategy to identify bottlenecks. with a profiler, you can time pretty much everything at once and instantly see where all your clock cycles go.

5. once you've identified bottlenecks, optimize that code. the goal is to reduce the time required, both to execute the code, and to move it and the data into and out of the CPU/GPU/RAM/hard drive. this is where things like "cache freindly code" come into play. As a highly specialized type of engineer, gamedevs, like any good engineer, will go to great lengths to attempt to find an engineering solution to the challenge of too much game and too little hardware. at the high end, optimizations can become rather complex, and can required a fair amount of R&D (research and development) work. if you can find it, Michael Abrash's lecture on the optimization of the quake engine at CGDC '96 is quite interesting - all the things they tried.

0

Share this post


Link to post
Share on other sites

Because games are or can be very dynamic and event driven. Some events could trigger a compute intensive task.

Experience game devs could take a CPU cycle budged and avoid these extreems. LOD it down as a compromise and optimize it so far they can in time given.

Or some go for a fixed FPS rate. And tweak there game for it. avoid to extreme events.

 

Example a event a explosion yield some GFX and particle and sound. But if destruction is involved it could scale up depending on generic finegrain physics computing task to teraflops.

 

You could go from lightweight 200fPS or on fixed 60fps more idle situation. To a slide show.

 

That's why destruction in games was limited but with each nextgen of games they do it a limited steps each gen a bit more of it.

0

Share this post


Link to post
Share on other sites


Because games are or can be very dynamic and event driven. Some events could trigger a compute intensive task.

 

this is actually the most common cause of slowdowns seen by the end user.

 

the game only runs slow when things get REALLY busy. so you design the game so things never get too busy for too long.

0

Share this post


Link to post
Share on other sites
How do I improve frame rate in a game? How many factors is taken into consideration to improve the frame rate.

 

 

There is a huge amount of factors that can slow down your performance in a game and it is very hard to catch all of them in a large sized project.

 

I liked something that the authors of "Game Engine Architecture" said on this subject. "Optimizing 10 percent of your code can give you a boost of 90 percent performance" or something like that (Can't remember the exact thing they said on the subject ;p). Basically what they were saying is if you optimize whatever code is taking the most time to run in your game you can increase your games performance by a huge factor.

 

So the best way in my mind to find out what you should optimize is to use a good profiler on your game and determine what functions or whatever are taking the most performance. Then start that the bottom (Whatever is clogging down your performance the most) and work your way upwards until you hit your desired performance. Just doing this on t he bottom 10% of your code can have a drastic improvement on your performance.

 

In my opinion there really is no use trying to optimize all your code to the maximum(Not to be read as you can do things inefficiently) because that would just increase the dev time way to much. Instead just use a profiler and determine where the worst offenders are and optimize them until you get your desired performance.

0

Share this post


Link to post
Share on other sites
Well I've read some frases like that. But it also in what contex.
10% how do you choose. I think they also would mention code within the critical path. Also they won't guess but profile so they start with code that is resposible for taking to much time.
It is also in the contex of often dev do not have the time to fully optimise. So they get as much doable within that time.

On frase sounds like this. The fasted code is code that isn't executed.

So after optimizing. If you want to have a steady FPS you make your dynamical load as light to fit in your FPS target. This means that you avoid features in scale that make your proscesing unit to busy.

Wich means if you develop a twitchy FPS shooter gamers don't wont to dip below 60fps in the heat of close combat but even prefere a 3D monitor 120 or 144FPS not using the 3D but the 120 or 144 FPS and trim the settings down to achieve this frame rate without deep dips. More arena sized maps. Coridor games.

Those games wont stand out in the latest GFX and very deep interaction. But they run easier a solid fps target.

While most games with fancy GFX huge worlds deep feature set lot of interaction tend to dip.

Dev can make choice of how dynamical the game computing load can be. Depends on the type of game they are making.
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