Secretchronicles / TSC

An open source two-dimensional platform game.
https://secretchronicles.org/
GNU General Public License v3.0
204 stars 50 forks source link

Improve Image Caching Strategy... #191

Open datahead8888 opened 10 years ago

datahead8888 commented 10 years ago

I was thinking it might be good if someone analyzed the image caching we have now and tried to find ways to improve it:

Bugsbane commented 9 years ago

I was thinking about this myself. It's not particularly fun sitting and watching a loading bar, the first time you open the game, and it would be a very rare person who could get all the way through to entering the first level before it finished.

If we're going to do it smart, then it's probably worth doing in stages too. Menu screen first. Then overworld. Then level 1 etc. Would be nice if this incorporated #212

datahead8888 commented 9 years ago

The basic idea here is to start the game ASAP while having another thread (line of execution) on the processor working at getting stuff loaded in advance. We can never guarantee a player will never have to wait for image loading but can make it improbable (or minimized). The other goal is to reduce memory usage if not all the images have to be loaded at once.

I imagine we will want to add the logic from #212 to the image caching, but @Quintus will have to confirm because I have not yet worked with the caching system.