2

Currently I am developing a simple game. I have few png textures (20 MB in memory) and few mp3 sounds and mp3 track as a 5 minutes soundtrack (50 MB in memory). Of course, when I'm trying to load this content, I got memory warning (but I cant release anything since I'm using it) and few seconds later my game is terminated.

I'm wondering how modern high-budget games are written? There is a lot of high-poly models, textures, soundtracks and sounds used in the same time!. I'm sure, that all this content is much more than 150 MB in memory. So how those games are working?

I know that I can make some optimizations, like using PVC textures etc. But music? OpenAL handles only raw PCM music data and even simple and short sounds are really big in memory! How does it work?

Alex
  • 9,313
  • 1
  • 39
  • 44
majakthecoder
  • 177
  • 3
  • 14

1 Answers1

1

This post and this post should help. Games can take a lot of memory. This means that your game will need to be downloaded over wifi and not 3G if that matters to you. Hopefully your 150 mb estimation is of the completed game.

In terms of what you can do, @Till's suggestion of "instead of loading the entire sound, use local streaming from the filesystem" should help.

Compress your PNGs, and if you aren't already, only load them into the view when they are necessary.

Community
  • 1
  • 1
dgund
  • 3,459
  • 4
  • 39
  • 64
  • 1
    I would agree with that. AudioQueue will save you a large room of memory and speaking about textures - you know what they call a bad, not optimized game engine for PC games, but as you are sure you can handle graphics optimization, your game'll be fine. Here's a pretty good example i started with learning iOS audio: audiostreamer-meta.googlecode.com/ – A-Live Jan 09 '12 at 00:08