Speeding Up Game Loading

Have you ever downloaded what looks to be a great game, and then waited all day for it to load? It's one of the more frustrating experiences you can give to players, and it certainly makes players start your game less often.

So what can you do to reduce that pesky loading time? First and foremost, turn off preloading on almost everything. The only thing you might want to preload are sounds that are used immediately; you can use sound_restore to load the others into the audio memory shortly before you need them (like at the beginning of a room).

The second thing you can do is to use external resources. This is a bit more difficult and also raises security concerns. If you don't care about users having access to your game resources, you can just pack the files into the game's zip. Then, you can load sprites using sprite_add or sprite_replace and sounds with sound_add or sound_replace.

You should probably load your resources at the start of a room that uses them. If you want to be fancy you could make an animated “level loading” screen like the ones most professional games use. Also, to protect your best resources, you could keep the ones that you value (like character animations) internal.

If you are concerned about having any of your resources stolen, I would recommend using a resource loader like TARC that encrypts the files to prevent user tampering. A good resource loader compresses all of your external files into an archive and encrypts it. You then include the encrypted archive with the game, and then the loader can extract the resources as needed. Although it would slow down the loading a bit, you could also pack the file into the exe with the include file function. If you do this, you probably want to export the archive at game start and use the “Free memory after export” option.

These are the most effective methods for cutting down on the load time, but they do require that you manage your resources more carefully. However, it's well worth the effort and can even make games run faster. At the very least, you should turn off preloading on your sprites, which is harmless and can really give your game a boost.