Game Development Community

2D Starter Game runs really slow

by Jonathan · in Torque X 2D · 03/12/2008 (3:19 am) · 5 replies

Hi there,

I just started to mess around with TorqueX Open beta and TXB and encountered some speed issue.

I created a 2D Starter Game and added a simple particle system to my test scene using TXB, in which it runs fine. When I compile and launch the game, the particles are moving really really slow (in Debug and Release alike) although the framerate is very high (~3000 fps). It behaves the same when I launch the game from inside or outside GSE.
I tried with the Tank Buster demo and it runs fine (Debug, Release, inside and outside GSE). So I took a look at the code and at the different XML files in the project tree but I didn't find what could be wrong.

Any clue ?

Jonathan

PS: I tried to search the forums but the results I get are all sections that I don't have access to.

#1
03/12/2008 (7:21 pm)
Is this running slower for you than before? In other words, is there some sort of performance drop - or - do the particles just have a low velocity? In the 2D Starter Game, does the player object move at a reasonable speed?

John K.
#2
03/13/2008 (12:48 am)
I can't really compare with before since it's the first time I try Torque X. And it doesn't seem to be a performance problem since the framerate is very high.

However, I tried to make a video capture using Fraps. When I launch it, the framerate locks at 30 fps (which is the capture framrate) and the game just goes faster and smoother (the particle system runs in the game at the same speed as in TXB and movements on the player object are fast and smooth too).
The TankBuster runs faster too when I launch a video capture.

Do you think it might have something to do with the v-sync? Is there a simple way to activate it?

I'll try my test game at work (quite the same software configuration but different hardware).
#3
03/13/2008 (2:22 am)
Tried my test game at work and it runs fine. My guess is it has something to do with the v-sync, it's not the first time I experience that kind of problems with games at home.

Is there a simple way to enable/disable the v-sync with TorqueX ou XNA ?
#4
03/13/2008 (9:10 am)
Torque X doesn't have a setting that manages the vsync, but XNA does and I believe it's enabled by default. You can try adding a line of code like this at the beginning of your BeginRun() method within the Game.cs file.

Game.Instance.GraphicsDeviceManager.SynchronizeWithVerticalRetrace = false;

This should disable the vertical trace sync when presenting the back buffer. Let's see if that does it.

John K.
#5
03/13/2008 (12:57 pm)
Argh! Enabling/disabling the v-sync doesn't seem to be very effective... The framerate stays in the same range, the particles are slow as they were, moving the player object too.
I checked the properties of the Microsoft.Xna.Framework reference in GSE and it says the 'runtime version' is v2.0.50727, although the 'version' is v1.0.0.0. Could that be a problem ?

Jonathan, shooting in the dark.

Edit:
I just installed the 2.0 demo, created a new game using Visual Studio 2005 and it runs properly. :)
Thanks very much for helping anyway.