Monday, September 15, 2008

Caching Data

hi, this time i added new script file that will contain all the data that needed to be cached before the game start.
the engine designed to load data on demand so when i'm checking things i don't need to wait until all map data will be loaded, so if for example you are not shooting at all, then the sounds and effects for the shooting wont be loaded (it will be loaded and cached when you shot at the first time)
this is very nice and good when you are testing things but when you want to play the game this is very annoying as the game will freeze a little when you do some actions (firing/jumping etc)
the script is very simple, it contains data to be loaded and cached per category: sounds/effects/animations.
example for sounds category:
SoundShaders =
this we cached only the "pickup_weapon" sound shader before the game start.
for now i'm using only one cache file, but it will be extended to support few cache files - one for each map so every map will have its own data that needed to be cached before playing it.

No comments: