Datablock loading question
by Guimo · in Torque Game Engine · 11/02/2007 (9:03 am) · 4 replies
Hi all,
Does somebody knows if a datablock for a new creature I want to add to a mission can be loaded after the game has started? Say, the game is going on, players killing each other but suddenly I want to summon a goblin into play but the goblin datablock is not loaded (I have my reasons not to load it at mission loading time). If I exec the file with the datablock in the server, how do I transmit that info to the clients so that its correctly coordinated between client and server?
Other question that may help. Say I have a lot of monsters in a monster database (say 5000 monsters). When are those monsters resources loaded, when the datablock is defined or when an instance is created?
Any help with any of these questions will be greatly appreciated.
Luck!
Guimo
Does somebody knows if a datablock for a new creature I want to add to a mission can be loaded after the game has started? Say, the game is going on, players killing each other but suddenly I want to summon a goblin into play but the goblin datablock is not loaded (I have my reasons not to load it at mission loading time). If I exec the file with the datablock in the server, how do I transmit that info to the clients so that its correctly coordinated between client and server?
Other question that may help. Say I have a lot of monsters in a monster database (say 5000 monsters). When are those monsters resources loaded, when the datablock is defined or when an instance is created?
Any help with any of these questions will be greatly appreciated.
Luck!
Guimo
About the author
#2
So, you mean, when I need to spawn a monster, the server should load the datablock and inform the clients that a new datablock has been loaded, so they call the transmitDatablocks method and when all the clients informs back to the server that a datablock has been loaded (is it a sincronous or an asincronous method?) then the server can create a monster... is this correct?
When I asked about the resource loading, I was hoping only the file references were loaded but not the information. In my old engine I kept a catalog of models (consider each model like a datablock). Each model had its list of textures, meshes, particles, along with their properties but resources werent loaded. Only when the model was required the resources were loaded and less used resourced were freed. It was also possible to preload objects and even lock them in memory so they never were unloaded. I wanted to know how Torque worked with resources.
Thank you very much!
Guimo
11/07/2007 (8:29 am)
Hi Nick!So, you mean, when I need to spawn a monster, the server should load the datablock and inform the clients that a new datablock has been loaded, so they call the transmitDatablocks method and when all the clients informs back to the server that a datablock has been loaded (is it a sincronous or an asincronous method?) then the server can create a monster... is this correct?
When I asked about the resource loading, I was hoping only the file references were loaded but not the information. In my old engine I kept a catalog of models (consider each model like a datablock). Each model had its list of textures, meshes, particles, along with their properties but resources werent loaded. Only when the model was required the resources were loaded and less used resourced were freed. It was also possible to preload objects and even lock them in memory so they never were unloaded. I wanted to know how Torque worked with resources.
Thank you very much!
Guimo
#3
11/22/2007 (5:21 am)
I was wandering about the same thing... my game is taking 500mb from memory already, and i think part of it is because it is loading a great amount of datablocks, so im trying to find a way to only load the datablocks that i need, and a way of reloading datablocks, models and textures would be great for the art team.
#4
Datablocks were invented to simplify the modding of Tribes2... so, it was easy to change some attributes around and not have to redistribute files. They aren't intended to be used as a general purpose database->server->client replication system. If you see the "Loading Datablocks" phase taking a long time in a TGE derived game... it probably means that datablocks are being misused. You should definitely not have 5000 datablocks...
I solved many of these datablock issues for our game Minions of Mirth. This includes speeding up datablock loading by executing the static ones on client/server, creating a dynamic datablock system which can be used to create and selectively send new datablocks from the server (works in single player too), etc. The source to this is available to TGE + ArcaneFX owners. Check out MMOWorkshop.com for details on getting it.
11/22/2007 (6:20 am)
If your game is taking up a lot of RAM, you may want to check how much of that is interior lightmaps.Datablocks were invented to simplify the modding of Tribes2... so, it was easy to change some attributes around and not have to redistribute files. They aren't intended to be used as a general purpose database->server->client replication system. If you see the "Loading Datablocks" phase taking a long time in a TGE derived game... it probably means that datablocks are being misused. You should definitely not have 5000 datablocks...
I solved many of these datablock issues for our game Minions of Mirth. This includes speeding up datablock loading by executing the static ones on client/server, creating a dynamic datablock system which can be used to create and selectively send new datablocks from the server (works in single player too), etc. The source to this is available to TGE + ArcaneFX owners. Check out MMOWorkshop.com for details on getting it.
Torque Owner Nick Matthews
The monster's resources are loaded when the datablock is defined, although i don't know exactly what you mean.