Game Development Community

Purging packages from memory

by Morphonix LLC · in Torque Game Engine · 07/29/2005 (2:25 pm) · 6 replies

Is there a way to free up packages?

Seems that they shouldn't take up too much space, but I was wondering.

I am making a single player game, and I have a MissionAI ScriptObject that is created fresh with each level load. Methods on the MissionAI object are created in a package. When the level is exited, the package is deactivated.

As the Player plays through the game, the packages for every level that they have played in a runtime session stick around. (Albeit in a deactivated state)

package_name.delete(); doesn't work.

The only package management functions I've found are:
Is Package(package_name)
ActivatePackage(package_name)
DeactivatePackage(package_name)

#1
07/29/2005 (6:04 pm)
Packages take up space from the time that they are created; the space doesn't really increase/decrese if they're active or not.
#2
08/01/2005 (6:48 am)
Exactly.

Each level load in my single player game execs a script file that contains a package.

Deactivate does not dispose of this package's memory.

Is there a way that I can do this?
#3
08/01/2005 (10:15 am)
Have you noticed a memory overhead from these packages? The amount of memory we're talking about is almost certainly less than 32k - so even a very large number of levels won't have a significant memory impact. You could add a "delete my package" function but it would probably be pretty tricky to write.
#4
08/01/2005 (10:38 am)
I understand that they are small. It's more a matter of style.

From a console background, I get a little nervous about allocating anything that there is no way of freeing. (even if it is tiny)

Also, this means that package names cannot be re-used in my game (I wasn't planning on it, but good to know ;-))

BTW, are there any plans to port Torque to any consoles?
#5
08/01/2005 (12:25 pm)
Any plans? Torque already has ports to PS2, XBox 1, and XBox 360.

The package stuff is a fixed, small, and budgetable memory expense, so unless you have significant amounts of code, I doubt it'll be an issue. If all of your code in all of your packages even approaches the size of one texture, I'd be surprised and impressed. :)
#6
08/02/2005 (6:26 am)
Thanks :-)