Game Development Community

Running "Build Project" is slow and hangs systems

by Stanley D Chatman · in Torque Game Builder · 05/24/2007 (6:37 am) · 5 replies

I am trying to run a "Build Project" on my game but it keeps hanging my system. What happens is that after I click analyze game, It goes through about 10-12 files and then it always gets hung on the datablocks.cs file. What are some thing I can do to reduce/cleanup datablocks.cs file.

#1
06/09/2007 (2:31 pm)
Stanley, sorry to hear you're having issues with the Build process in 1.1.3. This has been fixed in TGB 1.5 so that no 'script analysis' is done, and it will copy over all relevant assets.

If you're trying to build a game that you've already produced to ship it, then you should be able to on 1.1.3 with the following manual steps.

Let's assume I am packaging my game, 'scrollerDemo' from the TGB sample games.

My directory layout looks like this
scrollerDemo/
   data/
   gameScripts/
   gui/  
TGB.exe
glu2d3d.dll
opengl2d3d.dll
OpenAL32.dll
unicows.dll
<other games>

First I will take and copy the scrollerDemo folder to a new location (I did it on my Windows Desktop) called MySideScrollerGame.

so the contents of the MySideScrollerGame now look like this
MySideScrollerGame/scrollerDemo/
MySideScrollerGame/scrollerDemo/data/
MySideScrollerGame/scrollerDemo/gameScripts/
MySideScrollerGame/scrollerDemo/gui/

Next I copy over the folder 'common' from my TGB path and end up with this

[b]MySideScrollerGame/common/[/b]
MySideScrollerGame/scrollerDemo/
MySideScrollerGame/scrollerDemo/data/
MySideScrollerGame/scrollerDemo/gameScripts/
MySideScrollerGame/scrollerDemo/gui/

Then I'll copy over the binaries needed to run the game and end up with this (Mac files denoted with *)

MySideScrollerGame/common/
MySideScrollerGame/scrollerDemo/
MySideScrollerGame/scrollerDemo/data/
MySideScrollerGame/scrollerDemo/gameScripts/
MySideScrollerGame/scrollerDemo/gui/
[b]          
MySideScrollerGame/TGB.exe
MySideScrollerGame/opengl2d3d.dll
MySideScrollerGame/glu2d3d.dll
MySideScrollerGame/OpenAL32.dll
MySideScrollerGame/unicows.dll
MySideScrollerGame/TGB.app*[/b]

Then I'll need to have a slightly modified main.cs to run the game. The easiest way to get a proper one for your game is to use the packaging utility, but it appears you're not having luck with that, so I've provided one you can modify.

main.cs - Place this in your MySideScrollerGame directory.

If you open it up, you'll see these lines at the top of the file.
//---------------------------------------------------------------------------------------------
// Set the mods to run.
// $runWithEditors specifies whether or not the tools mod should be loaded.
// $defaultGame is the main game that will be run at startup.
// Additional mods can be specified with the -mod <mod_name> command line switch.
//---------------------------------------------------------------------------------------------
$startupProject = "scrollerDemo";
$levelEditor::LastLevel[$startupProject] = "scrollerDemo/data/levels/backup.t2d";
$runWithEditors = false;

You'll want to modify the lines $startupProject, to reflect your 'scrollerDemo' folder name. Then you'll want to modify the next line to reflect the level file your game starts with (if relevant). Let's say your game is called 'SuperMonkeyLacrosse' and your startup level was called 'MonkeyAmateur.t2d', then you would modify those lines to look like this

//---------------------------------------------------------------------------------------------
// Set the mods to run.
// $runWithEditors specifies whether or not the tools mod should be loaded.
// $defaultGame is the main game that will be run at startup.
// Additional mods can be specified with the -mod <mod_name> command line switch.
//---------------------------------------------------------------------------------------------
$startupProject = "[b]SuperMonkeyLacrosse[/b]";
$levelEditor::LastLevel[$startupProject] = "[b]SuperMonkeyLacrosse[/b]/data/levels/[b]MonkeyAmateur.t2d[/b]";
$runWithEditors = false;

after you've done this, if you've not already, place this file in the directory of your new game.

You should end up with this
MySideScrollerGame/common/
MySideScrollerGame/scrollerDemo/
MySideScrollerGame/scrollerDemo/data/
MySideScrollerGame/scrollerDemo/gameScripts/
MySideScrollerGame/scrollerDemo/gui/                       
MySideScrollerGame/TGB.exe
MySideScrollerGame/opengl2d3d.dll
MySideScrollerGame/glu2d3d.dll
MySideScrollerGame/OpenAL32.dll
MySideScrollerGame/unicows.dll
MySideScrollerGame/TGB.app
[b]MySideScrollerGame/main.cs[/b]

After you've done this, you can now run the game, to make it compile all your scripts into DSO files.

*Assuming you want to remove the game code from being read by any users, at this point you'll want to go through and delete all .gui and .cs files in the 'game' folder.

After you've done this, you can run the game once more, to make sure it works, and you're done and ready to distribute your game!

All in all, it's a pretty simple process, and the automation in TGB 1.5 is much better for supporting this process. If you're not under any deadlines to get a game built and out the door, I'd suggest checking out 1.5 (the Beta link is available in your downloads page)

Hope this helps,
-Justin
#2
06/11/2007 (7:54 am)
I know what you mean Stanley, but in my experience, if you just give it some time it will work out eventually.
#3
06/12/2007 (10:49 am)
Stanley, are you sure the packaging utility is hanging? Because it takes an absurd amount of time so it might seem that it's stuck, but more likely isn't. Like Kevin said, if you just wait it will end eventually. So you can get an idea of how long you might have to wait, I worked 6 months on a TGB game and it took 3 hours to build the final version.

Also, if you switch to another window while it's building, it seems that its stuck because it just doesn't refresh the window anymore, but yeah, it's still working, I tested that :D

It's nice to know that you don't need the packaging utility to build the game, I'll try that.
#4
06/12/2007 (11:16 am)
I start it at say 8pm at night and then when I wake up at lets say 6am the next morning it is still where I left off. 3 hours seems like a loooong time for any build no matter how many resources the game comprises. In my world a build should be complete in under 30 minutes.


I wonder if in the above example you can compile your art and music assests also, else it appears they would be exposed.


Can you run both 1.1.3 and 1.5 on the same box without causing problems? I want to try 1.5 but if I have issues I would like to be able to easy switch back to 1.1.3
#5
06/12/2007 (2:07 pm)
Stanley, I did my game on 1.1.3 and then tried to run it on 1.5 and it just didn't worked. I spend like 2 hours fixing stuff and yet it still wasn't working properly so I gave up. I'm not sure how long it takes to port a game to the newer version, maybe a couple of days would be enough, but certainly it isn't a piece of cake. So from my experience I don't think it is very practical, or even likely, to have the same code working on the two versions at the same time.