Game Development Community

Memory issue with TGB

by Sean Yeomans · in Technical Issues · 09/09/2008 (1:53 pm) · 0 replies

Hi Guys,

I have posted previously but am continuing to have a memory issue. I am developing a 2d game using TGB.

As you may know when you use the builder/level editor, upon adding your assets, it creates data blocks in

the managed section of script. I currently have four levels completed but my major issue is memory. The

images I am using are relatively large and the levels themselves are large. Loading one level, and all my

assets, the game uses up roughly 250 - 300 mb of memory which I am fine with. The problem however is as

I add more assets for other levels, my memory is increasing upon game startup. Currently with all levels

completed, the game is using up a great amount of memory. I am not preloading any images and also have

allow unloaded enabled on all my assets. The problem seems to reside in the datablocks. Every object in my

game has been created in its own .cs file other than background art and the tilemap. I have even tried to

take the datablocks for each level and place them in their own .cs files but the only way to get them to work

correct is to execute them when I initialize the project. I understand the logic on the way torques memory

management is supposed to work. Load level 1 - assign block of memory(300 megs), unload level1. Load

level 2 - use memory which has been cleared from level 1. If greater than 300 megs ask the OS for more

memory. The major problem I believe has to do with the data blocks. Is there a way to execute a .cs file

upon loading each level or is there an alternative solution to my problem.

Any help would be greatly appreciated.