Game Development Community

Slow frame rate mystery

by Scott Zarnke · in Torque X 2D · 06/28/2009 (12:31 pm) · 16 replies

I'm starting a new thread because there still seems to be many people (especially those new to Torque) encountering this.

A lot of people have been noticing that on some PCs, a Torque game seems to lag in framerate for no apparent reason. If you find this to be the case, try setting SimulateFences to true in TorqueSettings.xml, as:
<SimulateFences>true</SimulateFences>
This helps for some video cards. And if it does help, please go to the Simulate Fences Video Card Reference to log what card it helped on. You will need to log in. You can also find the reference from the front page of
http://tdn.garagegames.com and then navigating to TX Home -> TX Tutorials -> Other.

Even if your card doesn't seem to need that feature on, please feel free to add to the list.

We hope people will continue to add to the list so it can serve as a reference of which cards have been tested and which ones are improved by that setting.

Thank you.

#1
06/30/2009 (3:50 pm)
Nice Scott!
I take 2 days off of looking at the forums and this is here. We should ask to get this stickied due to number of times it comes up. Also, as an added side note, I'm kinda hoping to eventually use the reference to expand the autoenablefences code so it can be set automatically for cards that need it. Also, thanks to everyone who has updated the reference!

Brian
#2
07/17/2009 (6:16 pm)
Thanks! This was exactly my problem with my Nvidia 8600M GT. I added to the TDN resource.
#3
07/18/2009 (6:47 am)
Quote:Thanks! This was exactly my problem with my Nvidia 8600M GT. I added to the TDN resource.

I'm running the exact (well maybe not exact) card in my laptop but setting SimulateFences to true or false makes no difference on mine. Some more specific information on my GPU:

Name: NVIDIA GeForce 8600M GT
GPU: G84 M
Revision: A2
BIOS Version: 60.84.50.00.02
Memory Size: 256 MB
Memory Type: DD2
Driver Version: 7.15.11.8122 (ForceWare 181.22)

These are what I'm guessing may be different, of course there is a lot more information. My first guess would be drive version though, which version are you running?
#4
07/19/2009 (11:44 am)
I'm starting to wonder if anyone is seeing major detriment when you leave it on for cards that show no improvement. Nvidia stuff seems to either improve or not change when toggling. Has anyone seen a major framerate drop after enabling it? It might just be safer to always leave it on for PC distributions and only shut it off if necessary.

Brian
#5
07/19/2009 (12:07 pm)
That's a good point, Brian. I've thought about that, and I'm not really sure. I would think it'd have some overhead that you would not want if not necessary, but who knows?

Boy, it'd sure be nice if GG people would weigh in on this, given that it is their own feature, used in TorqueEngineComponent.EndDraw(). I've looked at the code that is performed when it is true. On a basic level, it's copying the back buffer to a texture called _fenceTexture, then that texture data is stored in an integer array. But, I don't really understand why it does what it's doing or how that improves rendering, much less whether it would be harmful to have it always true.
#6
09/01/2009 (7:10 pm)
Worked for me! :-) Thank you.
#7
09/27/2009 (3:05 pm)
Hello,

I recently install torque 3.1
before I used torque 2.0
I'am not sure that is the same problem. I explain my problem

When I create un new project just with the logo GG , If I test directly I can't move the logo with the keyboard
and when I click on windows move a little bit.
If I remove the move component and set a velocity, The logo move very jerky, move and stop,move little bit and stop again, every time like this

I tested to reinstall ALL many time = No change
I tested in fresh install of Win XP = No change
I tested on a laptop = Work fine (ati card)
I tested to change my video card nvidia 8800 GT to nvidia 7900 GS = No Change BUT !

In settings of video card there are 3 choice in 3D settings (I translate from french I don't know the reel name of the menu in english)
- leave the application choice
- use advanced settings
- use my settings to improve : (Quality,performance,..)
I set it to the Third and choose quality

and All animation works fine
but if I put my 8800GT that doesn't works again

and before post this, I read your thread and..

I tested the <SimulateFences>true</SimulateFences> Its works on 7900 GS
I just changed my video card to 8800GT, tested and its works on it too


thanks a lot
Elday
#8
10/08/2009 (4:33 pm)
Didn't work for me until I updated my Nvidia 9800 GTX driver. Once updated, setting SimulateFences to 'true' made everything work like it should. When set to 'false' the frame rate is 0.
Reference has been updated.
Thanks a ton!
#9
10/27/2009 (4:24 pm)
Fixed my issue (in the Platform Starter Game) using 8800 GTS.

Thanks!

Joshery
#10
10/29/2009 (8:10 pm)
Fixed the issue using Nvidia 8800 GTS
#11
01/10/2010 (12:57 pm)
Fixed my problem too, dual NVidia GeForce GTX 275's in SLi mode.
#12
05/12/2010 (4:05 pm)
I think i have a fix for this... please give it a try.

In TorqueCore\XNA\TorqueEngineComponent.cs in the function Update()...

public override void Update(GameTime gameTime)
{
   // do nothing if we not active
   if (!IsActive)
      return;

#if DEBUG
   Profiler.Instance.StartBlock("TorqueEngineComponent.Update");
#endif

   // The time since Update was called last
   elapsed = (float)gameTime.ElapsedGameTime.TotalMilliseconds; // CHANGED!

#if DEBUG

That solves it for all my test cases... no fences nessasary.
#13
05/12/2010 (4:56 pm)
Here is the second part of the above fix which corrects particles.

In Torque2D\T2D\T2DParticleEmitter.cs in function T2DParticleEmitter.AdvanceEmitterTime...

public void AdvanceEmitterTime(float dt)
{
   // Any emitter-data?
   if (CurrentEmitterData == null)
   {
      // No, so finish here.
      return;
   }

   // Has any time elapsed?
   if (dt <= Single.Epsilon) // CHANGED!
   {
      // No, so finish here.
      return;
   }

   // Reset Emitter Extents.
   _particleExtentTopLeft = _parentEffect.Position;
#14
05/20/2010 (1:19 pm)
Nice finding Tom, thanks for the great job you're doing!

Pino
#15
12/08/2010 (11:14 pm)
Where is the TorqueSettings.xml file located? I can't find it...
#16
12/10/2010 (4:29 am)
@Garrett:
The file should be in the "game" build folder where the Game.csproj and game.txproj files are.