Game Development Community

MS4 Issues - Atlas2, commandToClient, dialog rendering crash

by Juan Aramburu · in Torque Game Engine Advanced · 09/27/2006 (8:26 pm) · 10 replies

Several issues with MS4:

1. Atlas2 terrain: getting random white patches on the terrain which seem to correspond with 'discarding cancelled chunk' console messages. Also getting various blue-green patches as well, similar to how the whole terrain used to look blue-green but which was fixed in this thread.
Note: we have four Atlas2Instances in one mission file...problem does not seem to happen with one instance in the mission at a time. It did occur with two instances.

2. commandToClient - for some reason I have some commandToClient function calls that have ceased to work after the upgrade (no relevant script changes). calling commandToClient(localclientconnection,'MyFunction',%var1,%var2) works in the console, however, when run in-script, it never seems to get to RemoteCommandEvent::process(); It is added inside of NetConnection::postNetEvent() [mSendingEvents is true], but it just doesn't find it's way to process() for some reason.

3. All of our custom dialogs crash the engine when calling popDialog(). These are really just 800x600 bitmap backgrounds with a couple of image-buttons. Have tried GuiControl as the parent, the background GuitBitmapCtrl as the parent, and GuiChunkedBitmapCtrl (what is was originally). Note this only happens in debug mode due to the doParanoideStateCheck() checks. Have also tried using Canvas.add(ourDialog) + Canvas.remove(ourDialog), Canvas.setContent(ourDialog) + Canvas.setContent(PlayGui).
- The crash occurs in the vc7 runtime library (dbgheap.c) inside of malloc():
void *res = _nh_malloc_dbg(nSize, _newmode, _NORMAL_BLOCK, NULL, 0);
//nSize = [b]3765269347[/b], _newmode = 0, _NORMAL_BLOCk = 1
//seems nSize is bad...trying to allocate 3.5gigs of memory?
- The relevant TSE code that caused it is in GFXD3DDevice::doParanoidStateCheck(), line 1877 (for me)
if(dynamic_cast<GFXD3DCubemap*>((GFXCubemap*)mCurrentTexture[i]))

Call Stack:
img244.imageshack.us/img244/632/sdffd3fcb7.jpg

#1
09/27/2006 (10:57 pm)
2) You should never be using "localClientConnection" in my opinion for sending information to any client, even a single player game.

Worst case, in GameConnection::onClientEnterGame() save off the GameConnection objectId in a global variable and use that. There are many better ways to handle single player, but again, in my opinion using localClientConnection isn't one of them.

It's possible that adjusting some subtle networking invalidated localClientConnection within your memory space.
#2
09/28/2006 (6:27 am)
2) We're really using a variable, I don't know why I typed LocalClientConnection this time. The process is as follows:
- client: commandToServer('Function',%var1,%var2);
- server: serverCmdFunction(%client,%var1,%var2) does some stuff, and inside of it, does:
- - commandToClient(%client,'ClientFunction',%var3,%var4), except this call never goes through
#3
09/28/2006 (7:04 am)
Juan,

This will sound very very funny. But try adding an echo after commandToClient () in your serverCmdFunction (). It does not matter what the input to it is, just make sure you print something.

Does this make a difference?
#4
09/28/2006 (8:05 am)
Better add one onto here:

4) Memory usage - for some reason TSE likes to consume ~120mb of memory, even though i only have fluffy, the orc base, and some water in a mission. A bit disproportionate if you ask me...
Anyone else noticed this?
#5
09/28/2006 (10:45 am)
Is that 120mb of the RAM from just system ram or just onboard video ram or a combo of them both?
#6
09/28/2006 (11:06 am)
2) We had exactly the same issue, until I tracked it down to the camera.cpp file having changed. When we entered orbit cam mode (on player death), the commandToServers stopped working.

Latest TSE update in CVS fixes that problem I believe.
#7
09/28/2006 (11:22 am)
@Jonathan:

120mb system ram - no shared video ram or anything crazy like that.
#8
09/28/2006 (12:18 pm)
Stefan, I even went as far as to doing some Con::printf's inside of RemoteEvent::process(), and also lots of echo's in server-side script & client-side script.

Thomas, that was it! I removed the camera.setMode("Corpse") script call and the commandToClients did proceed.
#9
09/28/2006 (1:54 pm)
@Juan - fix is here in the bottom if you want to apply manually:
http://www.garagegames.com/mg/forums/result.thread.php?qt=50875
#10
09/28/2006 (1:58 pm)
Aha, good fix!

Juan, I was referring to another bug which I thought had come up. Good to hear it wasnt it :)