Game Development Community

Datablocks & Networking

by Jeremy Swigart · in Torque Game Engine · 02/26/2006 (10:38 am) · 3 replies

So I've learned that the server sends all datablocks to the clients as they join. I was wondering about the efficiency of this when it comes to sending them.

Suppose you have a datablock

datablock PlayerData(SomeDatablock1)
{
// tons of stuff in here
}

and you inherit like this

datablock PlayerData(SomeDatablock2 : SomeDatablock1)
{
// a few changes
}

When the server goes to send these datablocks, is it sending the datablocks as they exist after the copies are made? Meaning the client gets a SomeDatablock 2 that is just as large as SomeDatablock1, or does the server transfer the datablocks as effeciently as they are defined, and only transfer SomeDatablock2 with the copy information that the client would then use to generate the full.

Thanks
J

#1
02/26/2006 (11:43 am)
I don't know the exact answer to your question, but my hunch is that it will receive full copies of each datablock, and here's why:

The : operator is not inheriting anything (misnomer)--it is concatenating information from the prior datablock into the newly created one.
#2
02/26/2006 (11:44 am)
That's kinda what I thought too, since it's just copying the parent and changing stuff. At work we do similar with lua, clone the table and then add to it as a fake 'inheritance'.

Thanks
#3
02/26/2006 (1:12 pm)
It will indeed send the information twice for the reason Stephen describes (though I'd use the word copying and not concatenating). Theres not really any way around that without fairly major architectural changes. However, since datablocks are only sent once at mission load, the performance effects of it are not really that noticeable.

T.