Help me understand this.
by Nathan Huffman · in Torque Game Engine · 01/17/2007 (5:15 pm) · 3 replies
Say I drop all my environment datablocks in environment.cs, just as the tutorial suggests. Now remember, ALL of them are in here.
When I exec that script, it's going to load a lot of datablocks not needed for the current level (or possibly not needed at all for that time the user plays the game).
Seems way inefficent. Could be worse with other scripts.
Even if I broke them apart and only loaded what was neeed...
How do I unload?
Where am I missing a topic on better managing the scripts? Or am I thinking about this wrong?
When I exec that script, it's going to load a lot of datablocks not needed for the current level (or possibly not needed at all for that time the user plays the game).
Seems way inefficent. Could be worse with other scripts.
Even if I broke them apart and only loaded what was neeed...
How do I unload?
Where am I missing a topic on better managing the scripts? Or am I thinking about this wrong?
#2
To make Michael's "bad news" a little more palatable: TorqueScript supports packages, and this is just one technique to do exactly what he says: write code that only loads the specific datablocks and resources you need for that mission.
There are many other techniques.
01/19/2007 (1:57 pm)
Keep in mind that a tutorial is for getting started. We can't introduce every single concept related to developing a specific game in one tutorial, and suggest easy methods such as "put all your datablocks in one file", so that we can move on to the important information to get started.To make Michael's "bad news" a little more palatable: TorqueScript supports packages, and this is just one technique to do exactly what he says: write code that only loads the specific datablocks and resources you need for that mission.
There are many other techniques.
#3
01/19/2007 (1:59 pm)
Put each Price you want in its own .cs file...then , depending on what you need, have a function that only execs the .cs's you want.
Employee Michael Perry
ZombieShortbus
Bad News - To load only the datablocks and resources you need per mission, you'll have to write a custom routine that executes only the scripts and loads only the assets you need. Get to work =)
Good News - When disconnect() is called, all resources (assets, datablocks, ect) are purged. So unloading stuff between missions isn't difficult.