Fangames > Programming Questions

Loading external bgm before game starts

(1/1)

merkflank:
Can anyone teach me how to preload external music into my game? I wan't it to be like Kill the Maker and Kill the Kamilia 3 where it has a screen to load the music before the game actually starts. I really don't want the game to be frozen for like 2-5 seconds everytime the game loads some new external music file so any help is appreciated.  :atkCry:

Starz0r:
The game will be frozen either way. The way that Kill The Maker does it and Kamilia 3 just loads it slower, nothing you can really do about it because its just how SuperSound works. :/

klazen108:
Yep, the best you can do is to load one song file every step event - that should avoid the game giving the appearance of "locking up". This has the added benefit of allowing you to increment a progress bar during the step event for an accurate representation of loading. I've done this before, it works pretty well.

Unfortunately, there's no way to have parallel processes in GM, so you can't have the main game thread executing and then spawn off a separate process to load the music (at least as far as I know, you might be able to hack this functionality in with an external library, but I haven't seen it yet!). You've gotta break the task down into chunks that the game can run in its loop to give the appearance of multitasking.

merkflank:
Alright, well thanks for telling me! I'll just test out some stuff then  :atkHappy:

pieceofcheese87:
Yeah, when the game is loading the music, it runs at about 0.5fps so you can't have a loading animation or anything like that.

Navigation

[0] Message Index

Go to full version