Game Development Community

Slow FPS

by Esteban Piera · in Torque X 2D · 06/26/2009 (5:11 pm) · 7 replies

Something weird is happening. With the builder and the visual studio open if I debug the game all is working perfect. If I close the bulder (with the game stills open) the fps turns a quarter or a half down. If I open the builder again the game returns to the normal rate(without closing the game). I'm not able to play the game without the builder open. I tried to made the changes recommended in some threads (the UseInterpolation one, and the UseFixedTimeStep) but nothing seems to work.
I forget to mention I'm using the platform starter kit. Thanks in advance guys.

#1
06/27/2009 (9:11 am)
Often times with a slow frame rate, it has helped people to set SimulateFences to true in TorqueSettings.xml. Something to do with the video card it is running on.
#2
06/28/2009 (11:46 am)
That improved the fps slightly, as well as making sure UseInterpolation is set to true on my netbook, but still it only gets around 20 and is still noticeably slow.

Many thanks for the tip though, will pay attention to the settings a bit more often :)
#3
06/28/2009 (12:17 pm)
Just out of curiousity, if you build a release version (by choosing Release from the drop-down in the standard toolbar and building), then run the executable directly (from Game\bin\x86\Release), is it still affected by having Builder open or not? I'm wondering if this is only happening with the debug version when run through VS.
#4
06/28/2009 (12:34 pm)
Nope, still slow fps. I also tried a direct publish to my desktop and installed it. It ran in slow motion..

The wonders of a programmers nightmare :)
#5
06/28/2009 (9:42 pm)
Something I haven't messed around with much, yet, but may be helpful is the Torque Profiler, and specifically the class ProfileGUI, both in Profiler.cs in the Torque Util folder.

I have found there are many places in the Torque code where it uses the profiler for timing of different methods.

If you use the line
ProfileGUI.Instance.Visible = true;
(along with using GarageGames.Torque.Util;)
AFTER creating the GUISceneview and making it the GUICanvas' ContentControl, you will see an overlay that will show timing statistics.

***EDIT** I just realized you can press F1 to toggle the profiler overlay, at least when running in debug mode, so you don't have to toggle manually in the code.
***

Pressing F2 repeatedly will perform a new profile and refresh the stats since the last time it was pressed. You can then look at the % of time different things are taking and maybe see where the bottleneck is.

Looks like the %NSTime is the time for only things immediately in the function and does not include the time for any child calls, so that is the most meaningful number, I think. The items are first listed sorted by that column, then another listing sorted by stack trace total time, where the names are indented to show the stack trace.

For me, usually the first item was GUIMLText.OnRender(), which I think is probably just for the overlay itself.

It is very handy if you have a XBOX controller plugged in:
  • Up/Down on the left thumbstick scrolls the text
  • Left/Right on the D-pad changes to different profiles
  • Start saves the profile currently being viewed to a file named for the current profile number. The file will be in the same folder as the debug executable.

Hope that helps.
#6
06/29/2009 (1:16 am)
Thanks for that tip!

Another thing I have realised that works wonders is to publish the game to the C: root and then it is very smooth on other computers, providing they are rocking a 32bit OS only (my netbook and a PC at work), both me and my friend use 64bit and it runs about 1/2 frame per second..
#7
06/29/2009 (9:41 am)
64-bit, eh? I never thought of that. Yeah, you have to wonder if the Torque code takes that into account.