🔒 Locked
Typical Game Loop Time?
Advertisement
Original Post
Hi All, I have just profiled my game, and after a few performance improvements I find my game loop split as follows. Please bear in mind this is on a machine without shaders. Update animation controllers - 42% Actual rendering - 18% Physics and collision detection - 23% Misc housekeeping/scene graph management - 17% Not crashing - priceless (j/k!) I was wondering how this compares to other people's code. Also, I was wondering if people used some techniques whereby they can tune the amount of time spent in the various components at the expense of accuracy. Thanks! Rael
I use screen refresh vsycnhed to 60hz.
about 85-90% of the time is spent with waiting for vsynch and rendering.
the remaining 10-15% for all the gameplay stuff
Turning off vsynch naturally makes the gameplay computations go as fast as possible and take up nearly 100% of time, so in that case, perhaps milliseconds spent per update cycle would be a better means of measuring performance. (I dont know how those were at the moment)
about 85-90% of the time is spent with waiting for vsynch and rendering.
the remaining 10-15% for all the gameplay stuff
Turning off vsynch naturally makes the gameplay computations go as fast as possible and take up nearly 100% of time, so in that case, perhaps milliseconds spent per update cycle would be a better means of measuring performance. (I dont know how those were at the moment)
I did this a little while ago for the beginnings of my little test app:
Other is initialization overhead, thread switching [no gameplay in the thread which was profiled], input handling and some other stuff that fell out of common loop tasks.
[edit: to answer below:
For these tests I used C#/.NET's diagnostic stopwatch class, since the CLRprofiler is the only C# profiler I'm familiar with and wholy overkill for timing tests over a period of time.]
[Edited by - Telastyn on May 16, 2006 8:24:41 PM]
RenderLoop 73%SoundProcessing 1%NetworkProcessing 14%Other 12%avg loop time: 3.3msOther is initialization overhead, thread switching [no gameplay in the thread which was profiled], input handling and some other stuff that fell out of common loop tasks.
[edit: to answer below:
For these tests I used C#/.NET's diagnostic stopwatch class, since the CLRprofiler is the only C# profiler I'm familiar with and wholy overkill for timing tests over a period of time.]
[Edited by - Telastyn on May 16, 2006 8:24:41 PM]
Quote:
Original post by jdaniel
I'm curious as to what tools you used to profile your code. Did you place timer calls in the source code to sample the time spent in each section of your code or did you use some sort of profiling software?
Thanks.
I used the profiler build into Visual Studio 2005 Team Suite.
Quote:
Original post by haphazardlynamed
I use screen refresh vsycnhed to 60hz.
about 85-90% of the time is spent with waiting for vsynch and rendering.
the remaining 10-15% for all the gameplay stuff
Turning off vsynch naturally makes the gameplay computations go as fast as possible and take up nearly 100% of time, so in that case, perhaps milliseconds spent per update cycle would be a better means of measuring performance. (I dont know how those were at the moment)
Actually, this should be ideal, since you want to free up the CPU for your background tasks anyway. I always hate playing a game that is updating at 1000fps second. A 1000fps game is only ideal if you have a dual core processor (your other processor can then handle all the other processes like virus protection, resource management, (and don't forget about stuff like cpu availability for garbage collection for java/c#),etc. Besides, as long as the game runs at the monitor's refresh rate (without ever missing a frame), the user should see no difference.
Quote:
Original post by haphazardlynamed
I use screen refresh vsycnhed to 60hz.
about 85-90% of the time is spent with waiting for vsynch and rendering.
the remaining 10-15% for all the gameplay stuff
Turning off vsynch naturally makes the gameplay computations go as fast as possible and take up nearly 100% of time, so in that case, perhaps milliseconds spent per update cycle would be a better means of measuring performance. (I dont know how those were at the moment)
Wow. I can only assume you must be using shaders for your skinned mesh animations?
Quote:
Original post by VladR Quote:He might not see it, but in FPS game he`ll definitely feel the difference due to smoother controls (rotation/aiming).
Original post by dtaylorjr
Besides, as long as the game runs at the monitor's refresh rate (without ever missing a frame), the user should see no difference.
Can't the physics loop run faster than the render loop?
Quote:
Original post by Raeldor Quote:
Original post by jdaniel
I'm curious as to what tools you used to profile your code. Did you place timer calls in the source code to sample the time spent in each section of your code or did you use some sort of profiling software?
Thanks.
I used the profiler build into Visual Studio 2005 Team Suite.
can this be found in .NET Pro 2003? am looking for it right now at work, although i only have ,NET Standard instead of Pro here..
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement