Game Development Community

Crash when connecting to MultiPlayer server

by Robert Seeman · in Torque Game Engine · 12/17/2005 (11:26 pm) · 7 replies

The following is the last thing to appear in the client's console.log.

Entering clientCmdMissionStartPhase3(1, control/data/maps/book_ch4.mis)
Client Replication Startup has Happened!
fxFoliageReplicator - Client Foliage Replication Startup is complete.
*** Phase 3: Mission Lighting
Successfully loaded mission lighting file: 'control/data/maps/book_ch4_248966ea.ml'
Entering sceneLightingComplete()
Mission lighting done
Leaving sceneLightingComplete() - return
Leaving clientCmdMissionStartPhase3() - return

Can anyone explain what function runs right after clientCmdMissionStartPhase3()? If I can isolate what is happening at that point I can probably eliminate the crashes.

Thanks.

-Robert

#1
12/17/2005 (11:32 pm)
Probably no script. Have you tried running under a debugger?
#2
12/18/2005 (8:43 am)
According to the debugger, it's happening in ShapeBase::unpackUpdate at the following line:

mDamage = mClampF(stream->readFloat(DamageLevelBits) * mDataBlock->maxDamage, 0.f, mDataBlock->maxDamage);

Does that make any sense to you, Ben?
#3
12/18/2005 (10:18 am)
The error is definitely happening in function GameConnection::CreatePlayer(%this, %spawnPoint), which is when the server passes control to the client:

function GameConnection::CreatePlayer(%this, %spawnPoint)
//----------------------------------------------------------------------------
// Create the player's avatar object, set it up, and give the player control
// of it.
//----------------------------------------------------------------------------
{
if (%this.player > 0)//The player should NOT already have an avatar object.
{ // if he does, that's a Bad Thing.
Error( "Attempting to create an angus ghost!" );
}

// Create the player object
%player = new Player() {
dataBlock = MaleAvatar; // defined in player.cs
client = %this; // the avatar will have a pointer to its
}; // owner's connection

// Player setup...
%player.setTransform(%spawnPoint); // where to put it

// Give the client control of the player
%this.player = %player;
%this.setControlObject(%player);
}

If I comment out the setControlObject call, the client does not crash. Along with the debugger message, would you think this is a bad datablock for the MaleAvatar?

It's strange because this does not occur when running the server in SinglePlayer mode.

Thanks for the help.

-Robert
#4
12/18/2005 (11:41 am)
Don't know if this helps but my script seems to have a few more lines. It's 6am where i am and i'm really really tired i might add.

Anyhow, don't you need...

MissionCleanup.add(%player);
&
%player.setShapeName(%this.name);
&
%this.camera.setTransform(%player.getEyeTransform());

...in there somewhere?
#5
12/18/2005 (12:17 pm)
First one is nice to have (not needed anymore), second - I don't think so, maybe; depends on code, and the third is not needed.
#6
12/18/2005 (3:41 pm)
Is this & mDataBlock valid in those cases? What about the bitstream and connection? Have you turned debug_guards on in the memory manager to see if you're overwriting memory? How about calling Memory::validate() before and after that call?
#7
12/19/2005 (9:39 am)
Check to make sure that your model has an eye and a cam node. Without the eye in particular, Torque will crash trying to set the camera properly, and not warn well (it's been submitted!).

I know that your output checking doesn't seem to point this route, but it's an easy check/fix, and might just surprise you!