Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: adventure on October 23, 2008, 07:25:14 PM
-
Hi, I have another question again.
I have menu and in it's background is animated sprite, it has 70 frames. (each frames size is 1024*768)
Everything looks and works fine, but menu loading is much longer than without moving background.
What should I do to optimize loading. (Change picture format, compress something or do something else?) ::)
Thanks in advance. :)
-
70 1024x768 frames is a massive ammount of data to be decompressed from the package, decoded to raw data (for png, jpg etc) & loaded into memory. The only thing you can do is to convert those files to theora video and play that as a background.
-
Thanks, I will try that, but is it possible to put clickable buttons in front of that video?
-
yes. Play the theora in a scene entity and you can put it anywhere in the scene - z-order wise.
-
Here is what I would do, as I do something similar to this for "instant" loading of very large sprites that need to change often. I create a game entity and assign said large sprite to it. This should keep it in your main RAM if my understanding is correct.
When this entity needs to be visible assign it to the visible on screen entity. It should appear pretty much instantly with no load time since RAM is far faster than loading from a hard drive. when you want to unload it, unassign that entity. It should still be assigned to your global game entity for when you want to load it again.
I could be wrong that it works this way, but it seems to work perfectly in my own game. The video thing would be another way of doing it, the tradeoff for that one is high CPU utilization.
-
In any case, loading 70 frames 1024x768 big is total overkill and you shouldn't do it. It would take HUGE amounts of memory and you can easily bring the computer to its knees this way. If you REALLY need to animate the ENTIRE screen, use video.
-
I allready solved problem using Theora video. Wasn't that hard that I thought it will be. :)