Boosting Framerates?

3absh3absh Member Posts: 601

I'm interested in making my game perform as ideally as possible.
60fps with no hiccups and high frame rates even on low end devices.

I notice slight lag in performance when music changes in the game (a freeze for about 0.5 seconds) , so if I compress the music to half its size using the same ogg format will this eliminate that freeze?

Also, will using tables instead of standard attributes effect the performance in any way?

If you have suggestion to improve performance please share it here.

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited May 2016

    Compression music doesn't help performance, in fact it hurts performance as now the file needs to be decompressed at runtime. Tables can help if you have massive amounts of data to read or write. You may just not get strong performance on older devices. They have less powerful processors and just won't handle some large projects. They key to great performance is slim optimized code. There are no other real effective methods other than that.

    Most of the veteran coders here will confirm that. We can build high performing games becuase we know how to build slim, highly effective code. All my stuff runs a 60fps but I spend lots of time designing my logic. I might throw out ten working branches of code until I build the most efficient method. Most people just don't put in that kind of work.

  • SocksSocks London, UK.Member Posts: 12,822

    @Lost_Oasis_Games said:
    Compression music doesn't help performance, in fact it hurts performance as now the file needs to be decompressed at runtime.

    Agreed - the less compressed audio is the easier it is on the processor, so an 80MB uncompressed 24bit/44kHz AIFF will put less strain on a processor than a 1MB 32kHz MP3 for the reasons you say.

    @Lost_Oasis_Games said:
    They key to great performance is slim optimized code. There are no other real effective methods other than that.

    I'd say slim optimised code + maybe also organised image asset sizes (so 1024 rather than 1025).

  • 3absh3absh Member Posts: 601

    Agreed - the less compressed audio is the easier it is on the processor, so an 80MB uncompressed 24bit/44kHz AIFF will put less strain on a processor than a 1MB 32kHz MP3 for the reasons you say.

    But the freeze happens only when music changes, so maybe there is loading of the music?

    loading a 1MB file is i believe faster than loading a 5MB files with a higher bitrate

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2016

    @abuabed84 said:
    But the freeze happens only when music changes, so maybe there is loading of the music?

    loading a 1MB file is i believe faster than loading a 5MB files with a higher bitrate

    Music is not loaded into RAM, it's decompressed by the hardware on iOS devices.

    I suspect the decompression of a 1MB and a 5MB audio file happen at the same speed, although the more compressed file (1MB) will place a little more strain on the processor.

    It's not unlike image assets, everything on - for example - an iPad is held in 24/32bit colour space, so a 14MB uncompressed PNG will occupy 14MB of RAM, and a 1MB very compressed JPEG will also occupy 14MB of RAM, the only real difference being the JPEG needs to be decompressed.

  • SocksSocks London, UK.Member Posts: 12,822

    @abuabed84 said:
    But the freeze happens only when music changes, so maybe there is loading of the music?

    loading a 1MB file is i believe faster than loading a 5MB files with a higher bitrate

    Music is not loaded into RAM, it's decompressed by the hardware on iOS devices.

    I suspect the decompression of a 1MB audio file and a 5MB audio file happens at the same speed, although the more compressed file (1MB) will place a little more strain on the processor.

    It's not unlike image assets, everything on - for example - an iPad is held in 24/32bit colour space, so a 14MB uncompressed PNG will occupy 14MB of RAM, and a 1MB very compressed JPEG will also occupy 14MB of RAM, the only real difference being the JPEG needs to be decompressed.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @abuabed84 said:

    Agreed - the less compressed audio is the easier it is on the processor, so an 80MB uncompressed 24bit/44kHz AIFF will put less strain on a processor than a 1MB 32kHz MP3 for the reasons you say.

    But the freeze happens only when music changes, so maybe there is loading of the music?

    loading a 1MB file is i believe faster than loading a 5MB files with a higher bitrate

    Try a different music file and see if it freezes. I myself never use MP3 as the quality is terrible. Since gamesalad coverts them to OGG anyway, it's better to start with an MP4 or AIFF.

  • SocksSocks London, UK.Member Posts: 12,822

    @Lost_Oasis_Games said:
    Try a different music file and see if it freezes. I myself never use MP3 as the quality is terrible. Since gamesalad coverts them to OGG anyway, it's better to start with an MP4 or AIFF.

    MP3s actually get converted to m4a if imported as 'music', and, like you say, MP3s are converted to OGG if imported as 'sound'.

    I use this free little app for generating my OGG and m4a files, this gives you a lot more control over quality:

    MediaHuman Audio Converter
    http://www.mediahuman.com/audio-converter/

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Ah yes I meant m4a sorry. I always export in one of those higher formats.

Sign In or Register to comment.