Game Development Community

Game running SLOW after build

by Mads Laumann · in Torque Game Builder · 12/09/2006 (9:35 am) · 5 replies

Hi.

I am trying to make a simple Parachute game with TGB, and i am looking at the script for the TankBuster game, that was released (http://www.greatgamesexperiment.com/group/tgbGameExamples), to get an idea of how to design (codewise) a game with TGB.
And up until recently it has been a nice easy task. But some hours ago i discovered something.

Then im running the game inside TGB, while i develop the game, it runs smooth.
Then i build the game, to send to my friends to show it, it runs VERY slow, half the speed i would guess.

I just dont get why... anyone had the same problem?

And if anyone else had looked at the code for TankBuster, is this the "best" way to design a game? Because up until i started looking at the TankBuster code, i used the timer() to trigger a update method. The TankBuster code, use the onSceneUpdated() method on the SceneGraph object.

My current code can be downloaded from here: www.laumania.net/downloads/gameScripts.zip

It is not very nice code, i am all new to this scripting language, so give me a change :D

Hope someone can help me :)

#1
12/09/2006 (11:56 am)
Yes, someone has had the exact same problem recently. I think it turned out they had an onUpdateScene callback running on the namespace of t2dScenegraph instead of a namespace for their instance of the scenegraph. Try a search and see if you can turn up the thread.
#2
12/09/2006 (12:22 pm)
As Ben said others have run into a similar problem. There problem stemmed from having something like this:

funciton t2dSceneGraph::onUpdateScene

A callback attached to the entire t2dSceneGraph class and not a specific sceneGraph class or name. When TGB is packaged it actually has two sceneGraphs (hopefully this will be remedied in the future, though in and of itself doesn't cause a problem) so that means onUpdateScene is actually being called twice every update which doubles the load on the pc...

however, I noticed you have

function ParachuteSceneGraph::onUpdateScene

so it looks like you are in fact attaching the onUpdateScene to a class or a name, so unless you load two of the levels and it is running two, it should be fine =/ So I'm just further confused at what the problem is.
#3
12/09/2006 (1:19 pm)
In case you want to look at the other thread, you can find it here.
#4
12/09/2006 (4:37 pm)
@Matthew : Yeah i throught that it had something to do with this my self... but as you say, I actually do it as it "should" be. (But stills there's something wrong...)


@Clint : I have read the thread, and it seems that my problem is different...sadly :(

But tomorrow i will try look thru the code, and clean it up a little, and see what i have added that could make this happen. THe biggest problem is that i don't know how long it has been there, because i haven't actually build my project so much before...and the problem is ONLY in the build version of the game.

But if someone can see the bug, PLEASE tell me so i dont have to spend hours on a stupid bug :)

Edit:
Here is the hole project, which you should be able to load into TGB and try it from inside the TGB, and then build it, and see it running slow. www.laumania.net/downloads/Parachute.zip
#5
12/10/2006 (5:12 am)
Hmm very weird.... this morning i copyed my Parachute project to my laptop.

In TGB it runnes smooth, and when i build it, it STILL runs smooth....? I dont get it!