Game Development Community

LoadDml for unpackUpdate right?

by James Laker (BurNinG) · in Torque Game Engine · 01/31/2007 (6:37 am) · 2 replies

Porting some stuff over to TGEA I've noticed the following in Sky.cpp:

void Sky::unpackUpdate(NetConnection *, BitStream *stream)
{
   if(stream->readFlag())
   {
      mMaterialListName = stream->readSTString();
      loadDml();
      ...

Now, I unfortunalety dont have all the skillz like some of the pros here... But is this correct? Why would the DML file be loaded every time the unPackUpdate is called? Won't this cause a drastic slowdown in framerate since it needs to read from the disk for every pack?

Maybe I'm just not understanding, but I would really like someone to explain it to, and tell me where I'm looking at this wrong, or even better (tell me how i can get FPS improved).

Regards
James

#1
01/31/2007 (6:58 am)
I do not have the code here, but that looks to be the initial update packet, hence the readFlag () check. Basically, as soon as the object is first ghosted, the initial packet is sent and the client does the loading.
#2
01/31/2007 (8:57 am)
Have a look at the packUpdate for Sky.cc:
Sky::packUpdate(NetConnection *, U32 mask, BitStream *stream)
{
   if(stream->writeFlag(mask & InitMask))
   {
      stream->writeString(mMaterialListName);
      //... rest of function
}

This happens only on initialization.