Author Topic: How to optimize music usage in gamemaker?  (Read 925 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline gpremier

How to optimize music usage in gamemaker?
« on: April 12, 2012, 06:51:29 pm »
Hi!

I'm working on a game of my own, and currently i use gamemaker pro 7. However, i just added 3 mp3, and then the loading time became VERY long. I know that in mkf, ogg files were used to solve that problem. I tried that myself, but gamemaker 7 doesn't seem to be able to read ogg files.

Can someone give me any advices about it? I heard about extension for enabling ogg files, but none have worked so far. Once the game work, there is no problem with mp3, but the long loading time make it a pain to debug since it save and reload at each try.

Thanks in advance!

Offline lordcyber

Re: How to optimize music usage in gamemaker?
« Reply #1 on: April 12, 2012, 07:40:36 pm »
Debugging can be a pain when the game gets bigger with music and sprites and the game turns a little more ambitious.
The best way,in my opinion, is using FMOD dll.He can load ogg files,and do nice stuff, like defining the start and the end of a looping.The only problem is that has a lot of script functions(and to pratical and simple way,you will only less than 10% of them,so you can delete a lot of then).
I used it from the code made and organized by Captain Cook, when I was programmer in KRPG(In a better life state,maybe I return and use my experience from Ninjular.....)
Anyway, I could give you a simple game file that help you to learn the basics of the FMOD.You will need give credit to Captain Cook(don't need credit me for nothing,really).
I just don't remember that has some compatibilites issues with GM7PRO (or not).
So wait a bit from my help,unless if someone can help you faster than me.

PS:Maybe you will have another problem in the future:long loading time due the excess of the rooms or room's content.So I advice you read my post that deals with this.So you will need travel in the proggramer's hell less times than me.

Offline gpremier

Re: How to optimize music usage in gamemaker?
« Reply #2 on: April 13, 2012, 05:06:32 am »
Thanks! But you don't need to send me an example file, i'll do my research about the FMOD.dll you just mentioned. If it doesn't work with Gamemaker 7, then maybe it's time to me to buy the next version.

I will also look at your post about rooms, i'm trying to get all the trick i can get to do a game that feels professionals before working more seriously on my current project. The music problem just caught me by surprise!

Online Wetwoo

  • Defeating a sandwich only makes it tastier.
  • *
  • Posts: 1,024
  • 197899 Credits
  • View Inventory
  • Send Money To Wetwoo
  • Reputation: +17/-0
  • My strategies will guide us to victory.
  • Awards Has behaved for a whole year! (<20% warn, >0 rep, min. 400 posts) IRC Channel Operator Makes a lot of Fusion Fangaming videos (excluding WIP/Showcases). I AM A GOD OF CODING AND I DEMAND YOU WORSHIP ME Contributed a few sprites to any Fusion Fangaming project(s). Created an Engine that allowed some Fusion Fangaming project(s) to be. Contributed 12 or more levels to any Fusion Fangaming project(s).
    • Awards
Re: How to optimize music usage in gamemaker?
« Reply #3 on: April 13, 2012, 08:04:06 am »
I highly recommend using OGGs for your music for these reasons:

1. Provided the source file (MP3, whatever) is of high quality to begin with, converting to quality 0.0 OGG Vorbis format results in very little to almost no degradation in sound quality.
2. A Quality 0.0 OGG Vorbis file is between 75% to 80% smaller than the same file in 16-bit stereo 44100Hz 320kbps MP3. The difference between the two sonically is almost nil. The original MP3 (in 16-bit stereo 44100Hz 320kbps) for SMFR's Athletic theme, We Have Lee But You Don't Have, is 5,916KB in size. The same file converted to Quality 0.0 OGG Vorbis is a mere 1,287KB in size, 78% smaller with almost no loss in sound quality.

This means you can have high quality external music that does not add too much to your game's total filesize. SMFR v0.3, including all OGG music, is just 55MB in total.


Founder of Mushroom Kingdom Fusion, Super Mario Fusion: Revival, and Xeno Fighters R

"Legion is the one who made MKF.Legion=Judge Spear." --Theonesuperx

Online Gibbering Mouther

Re: How to optimize music usage in gamemaker?
« Reply #4 on: April 13, 2012, 09:20:56 am »
Don't include music files in the executable if you don't have to (and there's just about no reason why you'd have to).

Given that you're using PRO, that should be possible. Also, I'd recommend using the GMFMODSimple DLL instead of Game Maker's built-in sound system--it can play OGG files.
"For a just man falleth seven times, and riseth up again: but the wicked shall fall into mischief." --Proverbs 24:16






Offline gpremier

Re: How to optimize music usage in gamemaker?
« Reply #5 on: April 13, 2012, 03:54:04 pm »
I tried the GMFMODSimple DLL, and it worked like a charm! I just have to lose the reflex of using the gui and instead use actual code to load the music.

Thanks again everyone for all the tips!

Offline Lars Luron

Re: How to optimize music usage in gamemaker?
« Reply #6 on: April 14, 2012, 03:12:58 am »
As a bonus, .OGG files are perfect for setting up proper looping. You can also set up looping in .MP3 files, but due to the way they're set up, there's a short moment of silence at the beginning of every .MP3 track that's impossible to remove, and can be fairly noticeable in a lot of tracks. .OGGs don't have this issue.

Go forth, and read from the Book of Gord. Bask in the wisdom and glory that is The Gord.

Offline TrinitroMan

Re: How to optimize music usage in gamemaker?
« Reply #7 on: April 14, 2012, 04:33:16 am »
As a bonus, .OGG files are perfect for setting up proper looping. You can also set up looping in .MP3 files, but due to the way they're set up, there's a short moment of silence at the beginning of every .MP3 track that's impossible to remove, and can be fairly noticeable in a lot of tracks. .OGGs don't have this issue.
About the looping, the size difference and quality, I have to agree with Urdnot Grunt (AKA JudgeSpear) and LarsLuron, though with good computers, the moment of silence in MP3 files is minimal...I also had got lots of problems, when I tried to integrate OGG files into a game...

My games:
-Super Marisa World FUSION (now with poll): http://fusionfangaming.spriters-resource.com/index.php/topic,848.0.html
-Super Mario Cave Story (on hold): *no link*

Weapons: Nitro Blast, Nitro Shower
Good Point: Gets the job done.
Bad Point: Unstable.
Likes: Explosions.
Dislikes: Hyperactive People.
Quote:  “Have a blast, MegaMan!”
(click to show/hide)
What I also support:
(click to show/hide)

 

Alternate Earth Visitors


The fangames featured on Fusion Fangaming are non-profit fan-based works.

All commercial games represented, including character likenesses, graphic resources, sound effects, musical compositions, and level designs, are properties of their respective owners, companies, and other entities.

Please support the official games.

Hosted by The Spriters Resource.