Game Development Community

TGE 1.3 errors...

by Lane Anderson · in Torque Game Engine · 09/18/2004 (3:25 pm) · 54 replies

When i run the racing demo in torque 1.3 i get quite a bit of these errors in the command prompt window:

Fatal: error, a gamebase object isnt proberly out of the bins!


?????
Page «Previous 1 2 3 Last »
#1
09/21/2004 (12:56 pm)
Anyone know what the deal is :D?
#2
09/22/2004 (11:00 am)
Lane, are you using the demo downloaded from the site, or one you built with the SDK? How exactly do you reproduce this error? Let us know and we can try to help figure out what's going on.
#3
09/22/2004 (11:18 am)
Hey Josh, thanks for responding. i am using the demo built from the SDK. ok, heres what i do:

open up command prompt.
type " cd C:\torque\example [enter] TorqueDemo_DEBUG.exe -game starter.fps "
i play for a bit, and when i close the demo, i get about 4-6 of the aforementioned errors in the command prompt window.
#4
09/22/2004 (12:01 pm)
I recently found a bug in explosion.cc that may be responsible for this.

On line 1030 there's a particle emitter created which is never cleaned up.

This emitter is only created if the "particleEmitter" value of the explosion is set. Looking at it, it seems that you can also use the "emitter" array in the explosion datablock to define particle emitters for explosions. Those are cleand up properly, but the single emitter defined by "particleEmitter" is not. How there came to be two ways to assign a particle emitter to an explosion, I couldn't say. Regardless, if explosions that use the "particleEmitter" property are created in a game, they won't be removed and you'll get the error "A GameBase (#) isn't properly out of the bins". I don't know for sure if that's happening in the demo, but it seems likely.

FIX: on or about line 1036, after emitter->registerObject() and emitter->emitParticles() add the line "emitter->deleteWhenEmpty();". As far as I can tell, this is the only place where the emitter is instructed to emit particles. This emitter isn't included in Explosion::updateEmitters, so there's no harm in setting deleteWhenEmpty right away.
#5
09/22/2004 (12:41 pm)
Hmm.. I can't reproduce the behavior here Lane. Have you changed any of the engine code or scripts in the copy you're running?

Scott, thanks for that. I'll ping Ben on this thread and he can check whether to update the codebase.
#6
09/22/2004 (1:01 pm)
I'm confused. You wrote that the problems were in the racing demo, but then further down wrote that you started it with the command: "TorqueDemo_DEBUG.exe -game starter.fps" which would actually run the FPS demo.

Is the problem in the racing demo (starter.racing), the FPS demo (starter.fps), or both? Does it also affect the tutorial base (tutorial.base)?
#7
09/22/2004 (1:47 pm)
Ok, heres i've done some more testing and heres what i found out(i have done zero engine modifications):

starter.fps (unmodified)' i receive errors.
starter.racing (unmodified); i receive no errors.
starter racing with deathcar mod(scripts modified, of course); i receive errors.

Wysardry: sorry about that, the 3rd time i posted i had the mod running so i tested the fps demo.
#8
09/22/2004 (3:06 pm)
That would seem to support my theory. The racing demo afaik uses no explosions, but the fps demo does, and I would assume the deathcar does as well.

Ok, here's what I did. I replaced this:

if (mDataBlock->particleEmitter) {
      ParticleEmitter* emitter = new ParticleEmitter;
      emitter->setDataBlock(mDataBlock->particleEmitter);
      emitter->registerObject();

      emitter->emitParticles(getPosition(), mInitialNormal, mDataBlock->particleRadius,
                             Point3F(0, 0, 0), U32(mDataBlock->particleDensity * mFade));
   }

with this:

if (mDataBlock->particleEmitter) {
      ParticleEmitter* emitter = new ParticleEmitter;
      emitter->setDataBlock(mDataBlock->particleEmitter);
      // sr: Adding the if else block and the deleteWhenEmpty, since this emitter isn't properly 
      // cleand up in onRemove
      if (emitter->registerObject()) {
	      emitter->emitParticles(getPosition(), mInitialNormal, mDataBlock->particleRadius,
	                             Point3F(0, 0, 0), U32(mDataBlock->particleDensity * mFade));
	      emitter->deleteWhenEmpty();
		} else {
         Con::warnf( ConsoleLogEntry::General, "Could not register emitter for particle of class: %s", mDataBlock->getName() );
		}
   }

That fixed the "GameBase isn't out of bins" errors that I was seeing in my game, and I suspect it will fix the errors you're seeing too.

Note to anyone trying to reproduce this: These errors are not written to console.log. To see them, you'll need to launch the game from a command prompt.

edit: Hmm. I figured using the [ code ] blocks would make it neater and easier to read than just saying "add this line..". But in my browser at least, it seems to have inserted line breaks where it shouldn't have, making it look very messy indeed. :(
#9
09/23/2004 (7:42 am)
Ah, snazzy. I put that error checking in a while ago in hopes of tracking down this bug. I'll add this to my fix list. Thanks guys!
#10
10/13/2004 (2:00 pm)
Ok, I'm just getting around to fixing this(lol), but I can't seem to find "explosion.cc". Could some kind soul please alert me to its whereabouts :D?
#11
10/13/2004 (2:42 pm)
Searching is good. ;)

It's at [your_torque_dir]/engine/game/fx/explosion.cc
#12
10/13/2004 (2:49 pm)
Odd, I did a Win search for "explosion" in my torque dir, but nothing showed up..... Oh well. Thanks :D
#13
10/13/2004 (3:02 pm)
Ok, if copied and pasted scott's code, but i get the following errors in VC6:

Compiling...
explosion.cc
C:\torque\engine\game\fx\explosion.cc(1049) : error C2017: illegal escape sequence
C:\torque\engine\game\fx\explosion.cc(1049) : error C2017: illegal escape sequence
C:\torque\engine\game\fx\explosion.cc(1049) : error C2017: illegal escape sequence
C:\torque\engine\game\fx\explosion.cc(1049) : error C2001: newline in constant
C:\torque\engine\game\fx\explosion.cc(1051) : error C2143: syntax error : missing ')' before '}'
C:\torque\engine\game\fx\explosion.cc(1051) : error C2143: syntax error : missing ';' before '}'
Error executing cl.exe.

torqueDemo_DEBUG.exe - 6 error(s), 0 warning(s)
--------------------------------------------------------------------------------



and heres lines 29-41 in explosion.cc:

-------------------------------------------------------------------
if (mDataBlock->particleEmitter) {

ParticleEmitter* emitter = new ParticleEmitter;

emitter->setDataBlock(mDataBlock->particleEmitter);

// sr: Adding the if else block and the deleteWhenEmpty, since this emitter isn\\\'t

// cleand up in onRemove

if (emitter->registerObject()) {

emitter->emitParticles(getPosition(), mInitialNormal, mDataBlock->particleRadius,

Point3F(0, 0, 0), U32(mDataBlock->particleDensity * mFade));

emitter->deleteWhenEmpty();

} else {

Con::warnf( ConsoleLogEntry::General, \\\"Could not register emitter for particle of class: %s\\\", mDataBlock->getName() );

}

}
--------------------------------------------------------


i'm a n00b at C++, but it look fine to me. are there syntax errors im not noticing?
#14
10/13/2004 (4:21 pm)
I'm afraid the code I posted got a bit mangled. Let me see if I can get it to post correctly...

if (mDataBlock->particleEmitter) {
ParticleEmitter* emitter = new ParticleEmitter;
emitter->setDataBlock(mDataBlock->particleEmitter);
// sr: Adding the if else block and the deleteWhenEmpty, since this emitter isn't properly
// cleand up in onRemove
if (emitter->registerObject()) {
emitter->emitParticles(getPosition(), mInitialNormal, mDataBlock->particleRadius,
Point3F(0, 0, 0), U32(mDataBlock->particleDensity * mFade));
emitter->deleteWhenEmpty();
} else {
Con::warnf( ConsoleLogEntry::General, "Could not register emitter for particle of class: %s", mDataBlock->getName() );
}
}
#15
10/13/2004 (4:26 pm)
Since the code blocks don't seem to work properly for me (they're inserting line breaks where they shouldn't be), I'm afraid that's the best I can do. It's not indented properly, but it should compile.
#16
10/14/2004 (1:47 pm)
Yes, works great :D. Thanks so much, man!
#17
02/02/2005 (12:39 pm)
This problem still exists in TSE as well. The above fix works great!
#18
02/27/2005 (11:23 pm)
Thats a great fix, possibly GG should include this fix in future releases.
#19
04/15/2005 (3:07 pm)
Yes it works!
I guess It also prevented some lagging in my game.
#20
04/15/2005 (3:57 pm)
Hint - use the [code] tag for best effect when posting code snippets!
Page «Previous 1 2 3 Last »