User Tag List

Results 1 to 9 of 9

Thread: Low framerate on my game I'm working on.

  1. #1
    Clicker Fusion 2.5Android Export ModuleiOS Export ModuleSWF Export Module
    leightonw87's Avatar
    Join Date
    Jan 2012
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Low framerate on my game I'm working on.

    Hi, I'm trying to make a game for android, nothing too complex with a few fast loops and the frame rate is abysmal when scrolling.

    I also find building the game does take a long time to what I'm used too.

    APK below.

    https://www.dropbox.com/t/eOolQQR6QapqJtdY

    MFA below:

    https://www.dropbox.com/t/4M6SKOaTottMj6og

    ( Can't seem to upload attachment using Opera GX )

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,135
    Mentioned
    197 Post(s)
    Tagged
    0 Thread(s)
    You have a lot of events firing off every half second, and then a few firing off in between that, and then all your loops are run in always events, so on a device that doesn't have much ram, Fusion is going to struggle to cope.

    What you can do is have a countdown value - it's going to countdown based on the frame rate, and when it reaches 30 trigger one event, 31 another event, 32 another event - they're all going to still happen in split seconds, but they will prevent Fusion from having to handle 3 or 4 events on the exact same split second as your timer commands now do.

    For example:

    Always - Add 1 to Global Value A
    Global Value A = 30 - Fire Event A
    Global Value A = 31 - Fire Event B
    Global Value A = 32 - Fire Event C
    Global Value A = 60 - set Global Value A back to 0 - so the events will re-trigger.

    Secondly, check your always loops - see if you can tie them into an event instead, i.e. has the player moved? If the player hasn't moved, they probably don't have to run always.

    Thirdly, the alpha-blending in Android apparently uses a lot of memory. Import a semi-transparent graphic instead and don't make Fusion have to set that every few seconds.


    It didn't take particularly long to build an apk from your .mfa on my pc - but when Fusion builds an .apk it uses 100% of the available CPU - so the more software you have open in the background, the longer it will take.

  3. #3
    Clicker Fusion 2.5Android Export ModuleiOS Export ModuleSWF Export Module
    leightonw87's Avatar
    Join Date
    Jan 2012
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I added the Fading active after I initially tested it on android and it didn't seem to impact the performance, I did think about that before adding it, I'll try and replace the fast loops with something else and take into account what you said about making a global timer.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,135
    Mentioned
    197 Post(s)
    Tagged
    0 Thread(s)
    Your game runs okay on my cell phone though, but my games that have a lot of timers coupled with movement, struggle on my tablets - they're entry level devices with very little ram - like 1 gig. It's the combination of the two that slows it down, having just timers and no movement i.e. static images, or movement with no timers is okay.

    I never tested if transparency matters, it's just something I read in the documentation, but your transparent navigation buttons are hard to see and on certain parts virtually disappear. The text on them is not readable. Perhaps just use arrows or make the text larger?

  5. #5
    Clicker Fusion 2.5Android Export ModuleiOS Export ModuleSWF Export Module
    leightonw87's Avatar
    Join Date
    Jan 2012
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I removed the transparency on nearly all object and did notice an improvement but I think what is causing the majority of the lag is the calculations.

    I'm really at a loss with this one and thinking of abandoning the project as I can't figure out the boulders and diamond physics without the for each loops.

    I also have calculations happening with the scrolling and that I feel might not be helping either...

    Oh well. I'll give it this weekend and if I can't figure it out I'll have to leave it go.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,135
    Mentioned
    197 Post(s)
    Tagged
    0 Thread(s)
    I don't understand the game i.e. I don't know why I die when I die - if it's a timer, or something fell on me, or I didn't move fast enough which makes it harder for me to check.

    But there are a few things I spotted:

    The OnScreen Section you must've had an "or" event in there that you removed, because you have a lot of duplicate commands in there you can remove.

    You change your timer every half second, could you perhaps change that to every second, and adjust the time accordingly?

    Lines 5 & 6 - you have timer is larger than a value - and that is a condition that remains true - so change that to: timer equals value or insert - run this event once.

    One of the ways I manage my games to work on slow devices is just to have everything in groups and to deactivate a group the second it's not necessary, and only activate it when it is necessary. This just makes Fusion run through the frame faster. I don't know if that trick is possible in your game.

    But rather than abandoning it, you could just put in a minimum system requirement of 2gig ram.

  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    janpier's Avatar
    Join Date
    Dec 2014
    Posts
    218
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I tried it on my Ufeel prime phone from Wiko and it seems to work fine, but I changed some settings having noticed "require GPU" disabled, debugging enabled and I activated V-Sync. however you have 5 heavy events, I'm not a programmer for this reason I have always avoided complex events and focused more on simple logic, from what I see if the green circle is under the diamond that follows it. instead of focusing on the loops I would make an object higher in the upper part on another underlying layer that follows the movement of the green object, so when the upper part of the object (which is not visible on the main level) collides with a diamond you activate another event . example: collision of green object with diamond, position Y higher = active group / value, value is equal to 1 = goes down etc.

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)

    Join Date
    Jul 2019
    Posts
    86
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    hey leightonw87.

    Exporting to Android makes your game slower. This is due to mobile limited processing resources and the exporter itself. It's impossible to export complexed projects to Android using the Clickteam Fusion 2.5 and have good performance, only simple ones.

    That said, your project is a simple one, and should be able to run well even with the inefficient Fusion Android exporter.

    Here are some examples:
    Instead of repositioning the top and bottom corner objects, you can simply put them in place and have them following the frame.
    Select objects > Run time options tab > follow the frame.
    You can do this with your counters, ui, basically - everything that is stationary on the screen.
    A better way would be to put all those stationary things on a layer of their own and set the layer scroll efficient to zero.

    This just eliminated a ton of events.

    Here's a nice test to do: have a counter on screen that resets to 0 on the start of your events list, and add 1 to that counter EVERY event. I have a game with 800 events, but this test shows at no time in my game, more then 60 events are fired, so a lot of my events are disabled / not true most of the time. If you have more then 30 events true at any time in such a simple game, you should lower that using events trickery. Get things more efficient.

    You can kill many of the "always" events. Unite them.
    Things like Always > set alpha blending to Alpha Level ("Group.buttons") is not needed. Set the blending directly to the object, you do not need parameters and eliminate this "always". You can say "IF alpha level("group.buttons") <> alpha blending ("group.buttons") - change the alpha blending coefficient. This will run ONLY when the alpha level is not as wanted and not always.

    All your objects are set to "inactive if far from frame - no". Is that needed? It's very inefficient. It seems like you can change that.
    You have a foreach loop for the boulders called "test", it's completely not needed AND RUNNING EVERY FRAME. Why setting the Parameter BOULDER ID to the fixed value of the border? Use the fixed value directly! It's running unneeded 30-40 events every frame, 60 times a second!

    There's a "pick objects with reference to their value" event in the "new" object that might make things easier for you.

    Why do you set your game to 60fps? It's not a platformer, not an action game...
    Set it to 30fps and reset the values of things repositioning accordingly. This will run much easier on Android.

    Overall, there's a lot of inefficiency in your events, try fixing that, gave you some examples to get started.

  9. #9
    Clicker Fusion 2.5Android Export ModuleiOS Export ModuleSWF Export Module
    leightonw87's Avatar
    Join Date
    Jan 2012
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've scrapped the original version as it it was too trouble some, I thought about trying another game engine and while I did try I just had to come back to fusion as it's easier for me to understand.

    One night I had a brainwave and using something that I learned from the other engine I've managed to make the game very lightweight, no collision detectors needed and all done using an array.

    It's not completely bug free but what I got now is a fully working prototype.

    I'll try to share the MFA later for anyone that is curious.

    Thanks for everyone that replied, your help was greatly appreciated.

Similar Threads

  1. Horrible framerate on very simple game?
    By PaulFoster in forum Android Export Module 2.5
    Replies: 9
    Last Post: 12th October 2016, 10:17 PM
  2. Framerate affects in-game events.
    By Smedis2 in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 14th April 2015, 11:43 PM
  3. Framerate cap not working on device since latest update
    By Diablohead in forum iOS Export Module Version 2.0
    Replies: 25
    Last Post: 15th February 2012, 12:00 PM
  4. Working on a puzzle game, and need help.....
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 15th December 2011, 05:49 PM
  5. Game suddenly not working!!!
    By Brandon in forum Multimedia Fusion 2 - Technical Support
    Replies: 21
    Last Post: 7th April 2007, 07:05 AM

Posting Permissions

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