Game Development Community

Should I make my own datablocks?

by Rich Marinaccio · in Torque Game Builder · 08/12/2009 (9:16 am) · 1 replies

I understand that datablocks are an important part of torque, and that I need to know how they are used with objects provided by the engine. However, I'm wondering if there is a benefit to using them in my own data structures in torquescript.

From searching the forums, I gather that they are meant as an efficient way to send static data over the network to all clients. However, it seems to me that static data would already be known by the client. If a tank is this big and has a max speed of x, then it seems the client would have this information. If this info were to change from game to game, then it's not static data correct?

Right now, I'm thinking that for my own code, I simply don't need to design datablocks. Am I wrong in that assumption? I have no idea at this early point in my project what needs to be sent over the network, but most of it will be under the hood information rather than graphical info.

#1
09/07/2009 (12:10 pm)
Yes and no. Starting two copies of the same game and then running one as a server and one as a client, one would indeed think that since both copies have the same set of scripts, the same data would be available to both installations. One could do it this way but this is not how networking operates in Torque.

If you think about it, there is a lot of problems arising from giving clients so much say in what happens in a game. What if the client edits its local data to gain an advantage? How do you ensure that both sets of data *indeed* are identical?

Torque networking instead is based on fully authoritative servers with only some support logic in the client to help them dealing with lag. This means that all data (except resource data like textures, models, etc.) is downloaded to the client.

//Edit:
Ahemm... wrote the above being stupidly unaware that I'm answering a TGB-related question and not a general Torque question. However, I *think* this also mostly applies to TGB networking. AFAIK, the replication there is identical and it's just how the simulation and updates are handled that differs.