I’m about to have to generalize loading of resources for my 2D sidescroller (both a regular PC-game and an applet-version). I am fortunate enough to have 2 artists making backgrounds and animations for me, and this will result in many images. I’ve done some calculating, and for the basic game with a few different tilesets and about 60 monsters, I’ll be hitting 50-60mb of image-data. I’m wondering which would be the least irritating way of loading these images, while still having a sane memory-footprint, and I was thinking of doing one of 3 things:
-
Load everything into objects at launch (easy way out)
Pros: No loading times at all once you’ve started it up
Cons: High memory usage -
Load just the menus at start-up, and then loading level-specific images when starting the level (semi-easy way out)
Pros: Lower memory usage
Cons: Load times each time you enter a level -
Procedural loading, which loads images in a separate thread, while you’re progressing through the level (hard way)
Pros: Very low memory usage, and no (visible) load-times
Cons: Hard to implement; prone for errors; what if the image takes longer to load than we want it to (player is shot through a cannon or something, and moves so fast through the level, that the loading of new things can’t keep up
From a gamer’s viewpoint, obviously the first one would be preferable, and 50-60mb isn’t really that much, but with game-objects and sounds and everything, it might end up being 200mb of memory usage. Is this acceptable?