User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Need help to optimize Framerate

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleXNA Export Module
    Dobermann's Avatar
    Join Date
    Feb 2009
    Location
    France
    Posts
    1,095
    Mentioned
    38 Post(s)
    Tagged
    0 Thread(s)

    Need help to optimize Framerate

    Hello guys,

    I'm trying to optimize my android game and i would like to know if there is some settings to use to save memory on Android.
    For example, active objects have parameters like "save background" but i don't know if i should set it to On or OFF to optimize my game.

    Also, i would like to know what can help to improve a game framerate in term of graphical resources.

    The thing that seems to use the most of resources for events are the samples (but we have no solution for this issue) and the enemies collisions (i use Move Safely 2 object for pixel perfect collisions).

    I've read things about overlapping objects conditions, but i'm not sure about what i should do, how to test a collision without that kind of condition?

    Android is a pain to optimize, because each time a sound is played you loose almost 50% of framerate, no matter what the max framerate is...

    Thank you for your help.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    VBEinc's Avatar
    Join Date
    Oct 2015
    Posts
    984
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dobermann View Post
    Hello guys,

    I'm trying to optimize my android game and i would like to know if there is some settings to use to save memory on Android.
    For example, active objects have parameters like "save background" but i don't know if i should set it to On or OFF to optimize my game.

    Also, i would like to know what can help to improve a game framerate in term of graphical resources.

    The thing that seems to use the most of resources for events are the samples (but we have no solution for this issue) and the enemies collisions (i use Move Safely 2 object for pixel perfect collisions).

    I've read things about overlapping objects conditions, but i'm not sure about what i should do, how to test a collision without that kind of condition?

    Android is a pain to optimize, because each time a sound is played you loose almost 50% of framerate, no matter what the max framerate is...

    Thank you for your help.
    Honestly, I ran into this issue recently with a Game I am Working on for Android. However, it wasn't the sound lagging down my device. It was the Always Events.
    I use .ogg sounds for every sound in my apps. Never had any lag issues with .ogg. Any other sound format, YES! Massive Lag! Sometimes, the audio wouldn't even play.
    So, I purchased WAVEPAD just to convert files to .ogg and to reduce the volume of the files as well. While it might sound super quiet on your laptop during development.
    Playing the same sound on ANDROID typically is 4X Louder and even the volume causes issues for some odd reason. Samsung devices, definitely does not like the loud
    audio files.

    What has helped me has been .ogg and 25% Volume of a File that started at Max volume.
    I have over 100 apps out on Google Play over the years and many of them have numerous audio files longer then an hour in them.
    All running at the same time no less and switching between all of the files at a User controlled rate of (100,1000) of a second. No Lag!

    Now as far as LAG and Frame rate drop on Android. Things I have noticed that just kill Android are the following...
    1.) Always Events
    2.) Large GIF Imported files
    3.) Audio Files other then .ogg

    Literally, one large Imported .GIF versus 500 smaller animated actives is a crazy difference on android.
    You'd think 500 animated actives would be worse, but for whatever reason. You could have 1,000 and that one big GIF will just kill the apps framerate.


    Hope this helps you some.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleXNA Export Module
    Dobermann's Avatar
    Join Date
    Feb 2009
    Location
    France
    Posts
    1,095
    Mentioned
    38 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by VBEinc View Post
    Honestly, I ran into this issue recently with a Game I am Working on for Android. However, it wasn't the sound lagging down my device. It was the Always Events.
    I use .ogg sounds for every sound in my apps. Never had any lag issues with .ogg. Any other sound format, YES! Massive Lag! Sometimes, the audio wouldn't even play.
    So, I purchased WAVEPAD just to convert files to .ogg and to reduce the volume of the files as well. While it might sound super quiet on your laptop during development.
    Playing the same sound on ANDROID typically is 4X Louder and even the volume causes issues for some odd reason. Samsung devices, definitely does not like the loud
    audio files.

    What has helped me has been .ogg and 25% Volume of a File that started at Max volume.
    I have over 100 apps out on Google Play over the years and many of them have numerous audio files longer then an hour in them.
    All running at the same time no less and switching between all of the files at a User controlled rate of (100,1000) of a second. No Lag!

    Now as far as LAG and Frame rate drop on Android. Things I have noticed that just kill Android are the following...
    1.) Always Events
    2.) Large GIF Imported files
    3.) Audio Files other then .ogg

    Literally, one large Imported .GIF versus 500 smaller animated actives is a crazy difference on android.
    You'd think 500 animated actives would be worse, but for whatever reason. You could have 1,000 and that one big GIF will just kill the apps framerate.


    Hope this helps you some.
    Thanks, i'll try to lower the volume of the samples, i already tried ogg format in the past and it made no difference (using audacity or built-in fusion tool). Maybe the volume will change something.

    Also speaking of gif (even if i don't use any) i was wondering if using 10 actives with one frame is better than using 1 active with 10 animations with 1 frame each (for example, when i create different bullets in my case)
    I really don't know how fusion handle graphics, what is better to use, etc...

    Do you know anything about the "save background" option?

    I've tested the volume thing, for me it's the other way, on PC the sound is 4X louder than on my mobile devices...

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    VBEinc's Avatar
    Join Date
    Oct 2015
    Posts
    984
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dobermann View Post
    Thanks, i'll try to lower the volume of the samples, i already tried ogg format in the past and it made no difference (using audacity or built-in fusion tool). Maybe the volume will change something.

    Also speaking of gif (even if i don't use any) i was wondering if using 10 actives with one frame is better than using 1 active with 10 animations with 1 frame each (for example, when i create different bullets in my case)
    I really don't know how fusion handle graphics, what is better to use, etc...

    Do you know anything about the "save background" option?

    I've tested the volume thing, for me it's the other way, on PC the sound is 4X louder than on my mobile devices...
    As far as actives go. I have no issues with a ton of them as long as the animation is small in size. Number of animation frames does not seem to matter with fusion. However, when you make a big sized Animation. Watch out, the lag is coming!
    Save background, doesn't seem to do much difference then leaving and active sit. I prefer to leave the active sit as it can become an obstacle with no extra code. I.E. Vehicle is destroyed. Instead of actually destroying it. I make a new Animation called dead. So when the animation is forced to dead. The vehicle stays on the screen as an Obstacle.

    I am not sure what it could be then with the sounds as for me. Changing to .OGG was the solution.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    VBEinc's Avatar
    Join Date
    Oct 2015
    Posts
    984
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dobermann View Post
    Thanks, i'll try to lower the volume of the samples, i already tried ogg format in the past and it made no difference (using audacity or built-in fusion tool). Maybe the volume will change something.

    Also speaking of gif (even if i don't use any) i was wondering if using 10 actives with one frame is better than using 1 active with 10 animations with 1 frame each (for example, when i create different bullets in my case)
    I really don't know how fusion handle graphics, what is better to use, etc...

    Do you know anything about the "save background" option?

    I've tested the volume thing, for me it's the other way, on PC the sound is 4X louder than on my mobile devices...
    Here is an example of size that 1 .GIF caused.
    Now the weird part is I can literally make 1,000 more actives and still be nowhere near this size, Even though the one active was this .gif imported.
    Size of .gif in image below! Gif had 10 frames.

    FUSIONHATESGIFIMAGES.jpg

  6. #6
    Clicker Fusion 2.5Fusion 2.5+ DLCAndroid Export Module

    Join Date
    Jan 2018
    Posts
    578
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    j'ai tellement testé de choses pour optimiser sous android!!


    le nombre d'actifs ou de decors a l'écran est important surtout sur des telephones pas trop recents.

    voila les 2 seules methodes qui marchent vraiment tres bien pour moi
    fps.mfa

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Jun 2014
    Posts
    129
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Active object count can have an effect on mobile. I think it may have been Fernando who once said on here (correct me if I'm mistaken) that all on-screen images, whether they are actives or backdrops, are effectively treated as active objects by the Android runtime & contribute to the total count. I've certainly experienced performance issues on Android when generating levels out of 32x32 tiled backdrops, which potentially is many objects on screen at once being treated as actives.

    By making my background tiles much larger, I think I went from 32x32 sized tiles to 768x256, which meant I only needed 4-5 large tiles to cover the screen as opposed to about 200 32x32 tiles, I got a massive performance boost.

    On "always" events, you must bare in mind that an always event is the same as saying "run this event 60 times a second". There are some things you probably do want to run 60 times a second like collision checking against the player character or bullets etc, but for other things that are less essential, like maybe updating a string text, that would be a waste of computational time.

    A good trick I learned off these forums was to use an always event to increment a counter (or alterable value) which will effectively act as a frame counter, and use the value of the counter to trigger actions. For example, if you wanted to run something every other frame, you could do..

    + counter/value mod 2 = 0
    - perform action

    The action would run at 30 frames a second instead of 60 with a plain always event. The event below does exactly the same thing except it uses a bitwise operator, which is usually slightly faster than using "mod" in java, especially on non-power-of-2 numbers.

    + counter/value and 1 = 0
    - perform action

    This event...

    + counter/value mod 16 = 0 (or use "and 15" instead of mod)
    - perform action

    Would perform the action every 15th frame, and so on..

    Fusion attempts to read every non-immediate condition in your event list 60 times a second, it is therefore logical to assume that the more conditions & actions its trying to execute during this time, the more likely you will run into performance issues. Spreading some actions across frames is admittedly a very granular approach, but in the long run will greatly benefit your performance on mobile runtime.

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleXNA Export Module
    Dobermann's Avatar
    Join Date
    Feb 2009
    Location
    France
    Posts
    1,095
    Mentioned
    38 Post(s)
    Tagged
    0 Thread(s)
    Thanks for sharing your methods, i've tried a lot of them but most of my issues comes from the sounds played each time a player shoot. If i deactivate sounds, no more frame drops...

    I already use delta time so it is not unplayable but i would prefer to get a better framerate than drops from 60 to 20 FPS.
    I've tried everything for the sounds and nothing work on low spec devices but settings the sounds off.

    Also, my game has a level editor, and users can share and play on those user created maps. So if android set every objects as active, even backdrops, i understand why my game is slower on user created maps on android devices...
    I already use big tiles to avoid the issue of using too much object (256*256 backdrops) but for a level editor it's impossible to use pre-made tiles as it will reduce possibilities and creativity.

    I was wondering if it would be possible to change the way the map is created instead, i use "add backdrop" for each background element, but could it be possible to merge all objects into one?

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    VBEinc's Avatar
    Join Date
    Oct 2015
    Posts
    984
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dobermann View Post
    Thanks for sharing your methods, i've tried a lot of them but most of my issues comes from the sounds played each time a player shoot. If i deactivate sounds, no more frame drops...
    I was wondering if it would be possible to change the way the map is created instead, i use "add backdrop" for each background element, but could it be possible to merge all objects into one?
    You're Welcome...

    I have yet to see this in action, but that would be amazing. I have seen fake versions of objects combining but that seems to cause more lag then not. The fake version had layers of two objects. So technically, it was still just as many objects but looked like the objects combined. To bad there wasn't a way to incorporate the Motive in the Quick Backdrop object to load your map graphics. Like have it load the map graphics to only the area they where placed so that it is one object instead of tiles. That would be awesome!

    As far as sounds go. I have no clue why your sounds lag your app so much. The game I am working on right now has sounds playing like crazy and tons of objects on the screen. So far, no lag at all.
    I am even running this game on my Oldest Phone with no Sound Issues or Lag.
    Only Lag I get from time to time is recording the game with a screen recorder on my old Phone.

  10. #10
    Clicker Fusion 2.5Fusion 2.5+ DLCAndroid Export Module

    Join Date
    Jan 2018
    Posts
    578
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    try to swap fire sound with another than you know without problem.
    i think it's possible to add actives in one with surface object (blitting)

    peraps it could help you

    capture scene et sauve.mfa

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Trying to optimize a frame in my game
    By TheHandwovenBox in forum Fusion 2.5
    Replies: 7
    Last Post: 23rd June 2021, 02:45 PM
  2. 2.5+ Optimize Events Strangeness
    By piscesdreams in forum Fusion 2.5
    Replies: 4
    Last Post: 13th August 2019, 01:06 AM
  3. How to better optimize running?
    By schip in forum Fusion 2.5
    Replies: 5
    Last Post: 20th January 2019, 06:52 PM
  4. My mfa is 322 mb! Please help me optimize!
    By Aloan in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 15th June 2010, 04:33 AM
  5. Trying to optimize a rotation shader
    By Pixelthief in forum Hardware Accelerated Runtime
    Replies: 11
    Last Post: 5th November 2009, 10:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •