Game Development Community

is it possible exec levels datablocks when load the game first?

by Jebaraj Daniel · in iTorque 2D · 10/01/2011 (12:43 am) · 2 replies

in my game every level has 100 & more images and animations, level datablocks take lot of time to execute one single level... so i want to exec all level datablocks when i loading tha game is it possible?

pls give some idea

#1
10/01/2011 (11:06 am)
I am not sure about iT2D but there was a resource for this from TGE/TGEA.
you could possibly use it as a reference to do what you are after.
www.garagegames.com/community/resources/view/15427
#2
10/01/2011 (12:58 pm)
Thats a very bad idea unless you need them all all the time.

iT2D originally didn't have level datablocks and the problem with that was and still is that the data related to level data blocks is all loaded into RAM and VRAM along the exec too, which will require a lot of RAM very fast.

For pre-3GS that commonly means a straight crash, but with a high quality art game targeted on retina and ipad that can happen even there for 3GS and iTouch4 which only have 100-120mb of RAM + VRAM at hand normally either.

The out of my view by far most relevant question is: are you using level datablocks optimally or are you using them the bruteforce way?
The bruteforce way would be that you unload the datablocks completely at the end of each frame, thats a very bad idea and exactly the reason why iT2D does not unload them itself, to give you full control.
The good and right way to do it is to check "what do I have in this level" and "what do I need in the next level" and then only unloading those datablocks that you no longer need. Because if now the level datablocks are executed only the missing datablocks are executed and only their data loaded.