[RESOLVED] Background Music Optimization - Let's be real :)
by Lowell Duke · in iTorque 2D · 07/07/2010 (5:57 am) · 7 replies
Hello everyone,
My name is Lynn Duke and I've been in the game industry for over a decade now working on every platform you can imagine. As this is my first post, I'd like to start off saying, iT2D is truly a great product. In 3 short days after purchasing the dev kit, reading forums and documentation, I've got a side scroller going from scratch with simple input. At this rate I hope to have the game done by end of July. Awesome.
Now to my reason for posting. I think I've read every thread on background music formats but haven't really seen a shipping solution. My question is, is anyone REALLY shipping with background music playing? I mean, I have a single scroller for the background, a single animated sprite with 4 frames of animation and some simple multi-touch logic in script. Oh and maybe 5 or 6 static sprites. When the music plays, the scrolling is noticeably jerky...when the music isn't playing it's smooth as butter. I am assuming the CPU decode of the MP3 audio stream is the culprit just from process of elimination. That's fine I get it, mobile platform and all. But converting to a wav is not feasible due to the size, although from other iPhone app development I've done I'm 100% sure this will lighten the load on the CPU.
So, I'm wondering, has anyone shipped with a nice 2-3 minute background audio track during game play AND achieved smooth scrolling? With MP3 format??
Thanks so much and I hope to be a contributing member of the forums for a long time to come.
-Lynn
Fossil Software
90 in 1 : APPZILLA!
My name is Lynn Duke and I've been in the game industry for over a decade now working on every platform you can imagine. As this is my first post, I'd like to start off saying, iT2D is truly a great product. In 3 short days after purchasing the dev kit, reading forums and documentation, I've got a side scroller going from scratch with simple input. At this rate I hope to have the game done by end of July. Awesome.
Now to my reason for posting. I think I've read every thread on background music formats but haven't really seen a shipping solution. My question is, is anyone REALLY shipping with background music playing? I mean, I have a single scroller for the background, a single animated sprite with 4 frames of animation and some simple multi-touch logic in script. Oh and maybe 5 or 6 static sprites. When the music plays, the scrolling is noticeably jerky...when the music isn't playing it's smooth as butter. I am assuming the CPU decode of the MP3 audio stream is the culprit just from process of elimination. That's fine I get it, mobile platform and all. But converting to a wav is not feasible due to the size, although from other iPhone app development I've done I'm 100% sure this will lighten the load on the CPU.
So, I'm wondering, has anyone shipped with a nice 2-3 minute background audio track during game play AND achieved smooth scrolling? With MP3 format??
Thanks so much and I hope to be a contributing member of the forums for a long time to come.
-Lynn
Fossil Software
90 in 1 : APPZILLA!
About the author
Game developer with experience on PSP,PS2,PS3,XBOX360,PC and iPhone.
#2
I'm hoping the wrong one. :)
Here's the code I use... not sure what example or forum post I found it on.
$backgroundMusic = startiPhoneAudioStream("~/data/audio/371112_demo_HardandHeavy.mp3",true);
Nice and easy. Although I have a feeling nice and easy = slowest performance. Ha.
Is there a better way to play my mp3? Also, this is the only audio I'm playing. I'm also in release with all relevant optimizations set (the ones listed in the getting started docs for iPhone).
Thanks!
-L
07/07/2010 (7:50 am)
Haha, hey Marc.I'm hoping the wrong one. :)
Here's the code I use... not sure what example or forum post I found it on.
$backgroundMusic = startiPhoneAudioStream("~/data/audio/371112_demo_HardandHeavy.mp3",true);
Nice and easy. Although I have a feeling nice and easy = slowest performance. Ha.
Is there a better way to play my mp3? Also, this is the only audio I'm playing. I'm also in release with all relevant optimizations set (the ones listed in the getting started docs for iPhone).
Thanks!
-L
#3
Are you on OS3 or OS4 with your device? I think we might need to check the session identifiers again to see if apple did with os4 what they did with os3 when they fucked up the flag for the hardware accalerated session
also I assume if os4 then its a 3GS+, not a 3G /2nd gen device
07/07/2010 (8:57 am)
naw the way actually would be the right one.Are you on OS3 or OS4 with your device? I think we might need to check the session identifiers again to see if apple did with os4 what they did with os3 when they fucked up the flag for the hardware accalerated session
also I assume if os4 then its a 3GS+, not a 3G /2nd gen device
#4
07/07/2010 (9:06 am)
3GS running OS4, but building torque for OS 3.2. Hmmm...
#5
you need to use the os4 sdk as base sdk and then I would recommend testing deployment target os 3.1.3 for example so it runs on os3 too
07/07/2010 (10:58 am)
building for 3.2 is only possible for ipad as 3.2 is ipad onlyyou need to use the os4 sdk as base sdk and then I would recommend testing deployment target os 3.1.3 for example so it runs on os3 too
#6
Thanks so much!!
-L
07/07/2010 (12:11 pm)
Well, I changed my base SDK to 4.0 and rebuilt. Believe it or not there's a 30-50% improvement in scrolling speed. I'm running release while not connected to the debugger fyi and for now this is a quite satisfactory performance level for what I'm doing...Thanks so much!!
-L
#7
I was able to recode the mp3 into a lower bit rate m4a. So between the lower bit rate m4a and the OS 4.0 change... all hitches are gone and I'm good to go.
Thanks again.
07/07/2010 (12:52 pm)
One more follow up.I was able to recode the mp3 into a lower bit rate m4a. So between the lower bit rate m4a and the OS 4.0 change... all hitches are gone and I'm good to go.
Thanks again.
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
I ask cause the iphone has a dedicated music decoder but that can only decode a single compressed sound at a time (thus normally used for the bgm), and it must be in m4a or mp3 format