Red Light Green Light- How I Learned to Love Loading Resources

Posted by Reek on Sept. 3, 2008, 12:44 a.m.

An important aspect of my game is the music. And even using ogg files many of the audio tracks come in at 1mb+, so when a player presses the 'm' key to change music while they're playing, EVERYTHING freezes for a couple of seconds.

So I just came across a dll called GMThreads:

http://gmc.yoyogames.com/index.php?showtopic=390517

This utility will launch a line of GML code in a separate thread while your game continues on its merry way. (how about using this with background_replace, sound_replace, etc.)

There is a test program that loads a 2mb jpg file while you control a block with the arrow keys, and it never stops or pauses.

Definitely worth a look if you are swapping large files in and out, or for other stuff too.

Comments

PY 16 years, 2 months ago

I saw that, I think OL pointed it to me.

Juju 16 years, 2 months ago

Interesting.

Reek 16 years, 2 months ago

After spending a couple of hours today trying to use this to load an ogg file in its own thread, I learned that it will not work with supersound or other external dlls. It is still a good app, it just doesn't let you call another dll from within it.

Bryan 16 years, 2 months ago

It does allow other dll calls (at least, I got one working). Its just buggy, often something works, and if you change your game it doesn't work anymore.

Its really wierd.

But it'd definatly work for loading :)

Reek 16 years, 2 months ago

Quote:
It does allow other dll calls (at least, I got one working)

That's good to know…I just wish I could get it to work with supersound.