Game Development Community

TGB: Classes / configDataBlocks

by Sir H. Appleby · in Technical Issues · 04/13/2008 (12:35 am) · 2 replies

Greetings all.

I have just started looking at TGB and have groked most of it but there is one thing that I am not sure about.

--> What exactly is the difference between classes and configDataBlocks? <--

I did c and c++ a long time ago and as far as I can see a configDataBlock is what I would have called a class back then.

What I want to do is create a large Class/configDataBlock hierarchy that I can assign objects to. I have searched around the documentation but cant find any hint of inheritance in configDataBlocks so I am assuming it must be done via the class and parent class stuff. But I am not sure how the two link together.

Many thanks

Sir H. Appleby

#1
04/13/2008 (12:37 am)
Ah think I found half my answer here:

http://www.garagegames.com/mg/forums/result.thread.php?qt=73868

So you can create a dataBlock hierarchy, right. So what does the class and parent class function fulfil?
#2
04/20/2008 (9:51 pm)
Think of a dataBlock as a part of a class that doesn't change.
This way, when an instance of your class is suddenly added to the game, it doesn't have to send all of it's information over the network, it only has to tell the client which dataBlock it owns. The client already knows all the dataBlocks, because they are transmitted to the client at the beginning of the game.
Your in game item can also switch dataBlocks. You would do this to give it a new set of predefined features, such as a new shapefile or set of sounds.