ImageMap DynamicImageLoader and preload
by Argiris Bendilas · in Torque Game Builder · 07/18/2007 (9:58 am) · 7 replies
Hello,
I use dynamicImageLoader resource so i can easily load and unload images, but every imageMap has preload = true always loads faster. I have preloaders for the images but when my scene uses some textures with preload true, it always loads faster. That is not very logical, the imageMap is already in memory. So what is the difference?
George Kravas for Total - Eclipse
I use dynamicImageLoader resource so i can easily load and unload images, but every imageMap has preload = true always loads faster. I have preloaders for the images but when my scene uses some textures with preload true, it always loads faster. That is not very logical, the imageMap is already in memory. So what is the difference?
George Kravas for Total - Eclipse
About the author
#2
George Kravas for Total Eclipse
07/19/2007 (12:15 am)
I load the imageMaps which only i need in memory, before load the scene(using dynamicImageLoader resource). If some of them have preload = true then the scene loads faster, but as i said before i load them before the scene is created. Theoretically there is no difference, the images in both scenarios are in memory at scene creation.George Kravas for Total Eclipse
#3
This is why they are "faster"--not because it takes less time, but because it's already done.
07/19/2007 (8:32 am)
You are misunderstanding what "preload = true" means. Any imageMap that had preload set to true is going to load in to memory before your game even starts (during startup phase).This is why they are "faster"--not because it takes less time, but because it's already done.
#4
07/19/2007 (9:51 am)
Stephen, do you mean to say that we can't use "preload=true" for images that we want to load while showing the game's splash screen?
#5
When i load the scene in both scenarios, my imageMaps are already in memory. So why preload = true, is make them faster?
George Kravas for Total Eclipse
07/20/2007 (1:58 am)
Stephen,When i load the scene in both scenarios, my imageMaps are already in memory. So why preload = true, is make them faster?
George Kravas for Total Eclipse
#6
07/20/2007 (8:15 am)
I honestly couldn't tell you (I can't see your code). You may want to use the profiler and try to track down any timing differences, or echo out timestamps and see what changes between your two runs.
#7
I think what Argiris is getting at is that he is using my dynamicImageLoader resource and setting all his images to preload=false. Then he is calling my resource to pre-load just the set of images he wants for the scene/level/etc.
He is saying that if he uses preload=true instead of my resource the images load faster. I'm not sure where his problem is though. He might just not have been seeing the load time of all the images at app start with preload=true. Now that he is using my resource, the load time is shifted to whenever he wants it, with the benefit that only the images needed get loaded.
As Stephen suggested, the profiler/timestamp approach will help you figure out where the problem is coming from.
On a side note, are you compiling in my engine addition that comes along with the resource or just using the pure script approach?
07/24/2007 (1:28 pm)
Stephen,I think what Argiris is getting at is that he is using my dynamicImageLoader resource and setting all his images to preload=false. Then he is calling my resource to pre-load just the set of images he wants for the scene/level/etc.
He is saying that if he uses preload=true instead of my resource the images load faster. I'm not sure where his problem is though. He might just not have been seeing the load time of all the images at app start with preload=true. Now that he is using my resource, the load time is shifted to whenever he wants it, with the benefit that only the images needed get loaded.
As Stephen suggested, the profiler/timestamp approach will help you figure out where the problem is coming from.
On a side note, are you compiling in my engine addition that comes along with the resource or just using the pure script approach?
Torque 3D Owner Stephen Zepp
you are saying that you don't understand why the scenes that use preloaded textures are loading faster than the ones that do not use pre-loaded textures?
If your textures are pre-loaded, when the scene is loading it doesn't have to load the textures themselves (they are pre-loaded), therefore it will be faster...that's how it works :)