Occasional Crash [ Solved]
by Harry Durnan · in Technical Issues · 08/06/2011 (9:59 am) · 10 replies
Hi,
I bought the Torque 2D engine a couple months ago, and I've been working away on a game... but I've run into an odd issue. It occasionaly crashes when trying to launch the game (about 70% of the time it runs fine). The crash always occurs on launch, never while playing, so I don't -think- it's anything in my portion code.
I'm running it on a Windows 7 machine, and I can see Errors in the event log, but I have no idea how to read them. Anyone else run into this issue, or have any suggestions on how to go about debugging it?
I bought the Torque 2D engine a couple months ago, and I've been working away on a game... but I've run into an odd issue. It occasionaly crashes when trying to launch the game (about 70% of the time it runs fine). The crash always occurs on launch, never while playing, so I don't -think- it's anything in my portion code.
I'm running it on a Windows 7 machine, and I can see Errors in the event log, but I have no idea how to read them. Anyone else run into this issue, or have any suggestions on how to go about debugging it?
About the author
Author of It's A Wipe! (http://www.iawgame.com :)
#2
08/06/2011 (11:48 am)
You *should* find the errors in the console.log file in the root directory of the game. That information will be needed by others that can help you.
#3
This is what was logged for the windows error:
"
Faulting application name: TGBGame.exe, version: 1.5.0.0, time stamp: 0x4bdb48a6
Faulting module name: TGBGame.exe, version: 1.5.0.0, time stamp: 0x4bdb48a6
Exception code: 0xc0000005
Fault offset: 0x000bf22f
Faulting process id: 0xc58
Faulting application start time: 0x01cc54788683e29b
Faulting application path: C:Program Files (x86)TorqueTorque Game Builder 1.7.5 ProtgbgameDataT2DProjectTGBGame.exe
Faulting module path: C:Program Files (x86)TorqueTorque Game Builder 1.7.5 ProtgbgameDataT2DProjectTGBGame.exe
Report Id: c5c294b7-c06b-11e0-92a3-a4badbf9733e
"
with details of:
"
- EventData
TGBGame.exe
1.5.0.0
4bdb48a6
TGBGame.exe
1.5.0.0
4bdb48a6
c0000005
000bf22f
c58
01cc54788683e29b
C:Program Files (x86)TorqueTorque Game Builder 1.7.5 ProtgbgameDataT2DProjectTGBGame.exe
C:Program Files (x86)TorqueTorque Game Builder 1.7.5 ProtgbgameDataT2DProjectTGBGame.exe
c5c294b7-c06b-11e0-92a3-a4badbf9733e
"
The console log puts it a bit over the max post size. Will add that in a second reply.
08/06/2011 (1:46 pm)
Interesting, didn't know about the console.log.This is what was logged for the windows error:
"
Faulting application name: TGBGame.exe, version: 1.5.0.0, time stamp: 0x4bdb48a6
Faulting module name: TGBGame.exe, version: 1.5.0.0, time stamp: 0x4bdb48a6
Exception code: 0xc0000005
Fault offset: 0x000bf22f
Faulting process id: 0xc58
Faulting application start time: 0x01cc54788683e29b
Faulting application path: C:Program Files (x86)TorqueTorque Game Builder 1.7.5 ProtgbgameDataT2DProjectTGBGame.exe
Faulting module path: C:Program Files (x86)TorqueTorque Game Builder 1.7.5 ProtgbgameDataT2DProjectTGBGame.exe
Report Id: c5c294b7-c06b-11e0-92a3-a4badbf9733e
"
with details of:
"
- EventData
TGBGame.exe
1.5.0.0
4bdb48a6
TGBGame.exe
1.5.0.0
4bdb48a6
c0000005
000bf22f
c58
01cc54788683e29b
C:Program Files (x86)TorqueTorque Game Builder 1.7.5 ProtgbgameDataT2DProjectTGBGame.exe
C:Program Files (x86)TorqueTorque Game Builder 1.7.5 ProtgbgameDataT2DProjectTGBGame.exe
c5c294b7-c06b-11e0-92a3-a4badbf9733e
"
The console log puts it a bit over the max post size. Will add that in a second reply.
#4
..."
Loading compiled script C:/Users/Harry/Documents/MyGames/IAWDemo/game/data/levels/mainMenu.t2d.
SimSet::isMember: Tutorial is not an object.
SimSet::isMember: Evil Orc Army is not an object.
SimSet::isMember: Tutorial Boss is not an object.
SimSet::isMember: Ax Orc is not an object.
SimSet::isMember: Two Ax Orc is not an object.
SimSet::isMember: Two Ax Orcs is not an object.
SimSet::isMember: Orc Captain is not an object.
"
- Which looks like it's just getting into my start-up code where it creates a few sets of objects (if they don't exist). Not sure why it would sometimes crash at this point and sometimes work fine. I can break up the whole thing if that would help, but
08/06/2011 (1:48 pm)
The console.log is a bit too long for a single post. It didn't come back with any debug errors though.. The end of it is:..."
Loading compiled script C:/Users/Harry/Documents/MyGames/IAWDemo/game/data/levels/mainMenu.t2d.
SimSet::isMember: Tutorial is not an object.
SimSet::isMember: Evil Orc Army is not an object.
SimSet::isMember: Tutorial Boss is not an object.
SimSet::isMember: Ax Orc is not an object.
SimSet::isMember: Two Ax Orc is not an object.
SimSet::isMember: Two Ax Orcs is not an object.
SimSet::isMember: Orc Captain is not an object.
"
- Which looks like it's just getting into my start-up code where it creates a few sets of objects (if they don't exist). Not sure why it would sometimes crash at this point and sometimes work fine. I can break up the whole thing if that would help, but
#5
I just wanted to add that there are no errors in the console log. The only thing that seems odd is:
"
Initializing chunk mappings...
o 'TEXT' maps to TextChunk
o 'SCHK' maps to UnknownChunk
o 'SCHK' maps to SimChunk
"
But that's before it get anywhere near my code. It seems to be occasionally hanging up when at the start of the game, it creates a bunch of Simobjects and add them to Simsets. Is there any known issues where doing that sort of thing can cause problems?
08/08/2011 (6:10 pm)
@Michael I just wanted to add that there are no errors in the console log. The only thing that seems odd is:
"
Initializing chunk mappings...
o 'TEXT' maps to TextChunk
o 'SCHK' maps to UnknownChunk
o 'SCHK' maps to SimChunk
"
But that's before it get anywhere near my code. It seems to be occasionally hanging up when at the start of the game, it creates a bunch of Simobjects and add them to Simsets. Is there any known issues where doing that sort of thing can cause problems?
#6
08/09/2011 (6:16 am)
If it is related to SimSet, it might be a bad index. It's hard to tell without seeing your code, but I do believe it is a bad code problem. Is there any chance you can show it to me?
#7
(from game.cs)
"
The log is ending with:
"
SimSet::isMember: Two Ax Orcs is not an object.
SimSet::isMember: Orc Captain is not an object.
Loading compiled script C:/Users/Harry/Documents/MyGames/IAWDemo/game/data/levels/mainMenu.t2d.
"
when it crashes errors). So it's not hitting the echo when trying to load the scene. Previously I had the startup call after the scene loading.
Besides setting up some other global variables, the OnStartUp functon creates 4 Simsets and populates two of them:
The load functions currently have a pre-set list of objects that they create by passing values to another function. They're both basically the same sort of thing, but they look like:
One other thing that might be relevant is I'm trying to use Torsion to debug... so I'm not sure if that might be interactign with something to cause this occasional crash.
08/09/2011 (8:01 pm)
Well, I have been mucking around with it a bit. I moved all of my initialization stuff around a bit, and now it appears to be erroring out trying to load the level.(from game.cs)
function startGame(%level)
{
//Exec Bloc
exec("./onStartUp.cs");
exec("./mainMenuGui.cs");
exec("./Player.cs");
exec("./Raid.cs");
exec("./fights.cs");
exec("./monsters.cs");
exec("./sound.cs");
exec("./combatGui.cs");
exec("./combat.cs");
exec("./actions.cs");
exec("./announceGui.cs");
exec("./dailyMenuGui.cs");
exec("./viewGuildGui.cs");
exec("./recruitGuildGui.cs");
exec("./dailyChatGui.cs");
exec("./raidSelectGui.cs");
exec("./raidRoleSelectGui.cs");
Canvas.setContent(mainScreenGui);
Canvas.setCursor(DefaultCursor);
new ActionMap(moveMap);
moveMap.push();
$enableDirectInput = true;
activateDirectInput();
enableJoystick();
onStartUp();
%scenegraph = sceneWindow2D.loadLevel(%level);
echo("done loading level");
MainGuiInit(%scenegraph);..."
The log is ending with:
"
SimSet::isMember: Two Ax Orcs is not an object.
SimSet::isMember: Orc Captain is not an object.
Loading compiled script C:/Users/Harry/Documents/MyGames/IAWDemo/game/data/levels/mainMenu.t2d.
"
when it crashes errors). So it's not hitting the echo when trying to load the scene. Previously I had the startup call after the scene loading.
Besides setting up some other global variables, the OnStartUp functon creates 4 Simsets and populates two of them:
$allPlayers = new Simset(); $allRaids = new Simset(); $allFights = new Simset(); $allMobs = new Simset(); loadRaids(); loadFights();
The load functions currently have a pre-set list of objects that they create by passing values to another function. They're both basically the same sort of thing, but they look like:
function createFight(%name,%mobCount,%mob1,%mob1pos,%mob2,%mob2pos,%mob3,%mob3pos,%mob4,%mob4pos,%mob5,%mob5pos,%mob6,%mob6pos,%mob7,%mob7pos,%mob8,%mob8pos,%mob9,%mob9pos,%mob10,%mob10pos)
{
if(!$allFights.isMember(%name))
{
%fight = new SimObject(%name);
%fight.setFieldValue(class,"Fight");
%fight.setFieldValue(fightName,%name);
%fight.setFieldValue(mobCount,%mobCount);
%fight.setFieldValue(mob1,%mob1);
%fight.setFieldValue(mob2,%mob2);
%fight.setFieldValue(mob3,%mob3);
%fight.setFieldValue(mob4,%mob4);
%fight.setFieldValue(mob5,%mob5);
%fight.setFieldValue(mob6,%mob6);
%fight.setFieldValue(mob7,%mob7);
%fight.setFieldValue(mob8,%mob8);
%fight.setFieldValue(mob9,%mob9);
%fight.setFieldValue(mob10,%mob10);
%fight.setFieldValue(mob1pos,%mob1pos);
%fight.setFieldValue(mob2pos,%mob2pos);
%fight.setFieldValue(mob3pos,%mob3pos);
%fight.setFieldValue(mob4pos,%mob4pos);
%fight.setFieldValue(mob5pos,%mob5pos);
%fight.setFieldValue(mob6pos,%mob6pos);
%fight.setFieldValue(mob7pos,%mob7pos);
%fight.setFieldValue(mob8pos,%mob8pos);
%fight.setFieldValue(mob9pos,%mob9pos);
%fight.setFieldValue(mob10pos,%mob10pos);
$allFights.add(%fight);
}} One other thing that might be relevant is I'm trying to use Torsion to debug... so I'm not sure if that might be interactign with something to cause this occasional crash.
#8
08/12/2011 (5:34 am)
Well, I -think- I worked around this. From what little I can tell, the engine has problems allocating a bunch of sets and objects at the same time. I broke up the calls in the OnStartup function and moved some of them over to get loaded when the player hits Start New Game, as opposed to when the game initially loads up. It's not really a fix for the core problem, but my game seems to be starting up a lot more stable now.
#9
08/12/2011 (5:34 pm)
Well, not quite fixed. Now I sometimes get an actual error from the game (instead of just a Windows - your program has stopped responding crash) when it hits the point I moved some of the object creation code to. I get a pop-up: Torque Memory Error: Error Allocating Memory. Shutting down.
#10
12/06/2011 (8:01 am)
I did figure this out, though I forgot to update the thread. This was caused by passing 1 too many arguments to the function with one of the objects that were being created... so my own fault :p Surprised that it didn't throw an error in Torsion for that.
Employee Michael Perry
ZombieShortbus