Tips for speeding up frame loading?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I'm trying to optimise the loading times for my game, and create a non-static loading bar for the loading that does happen. Currently, an average level takes about 10 seconds to load (though I'm on an SSD with a decent CPU - a slower PC would take longer). The 10 second loading time is roughly split in two:

    (A)the frame actually loading up after I "jump to frame" (no animated loading bar is possible at this stage - the previous frame completely freezes while the new frame loads)
    (B) the frame has loaded and has begun executing (all the start of frame events get executed, the level gets created from an array in a big fastloop etc.......a loading bar is possible during this period)

    To decrease A, I've selected "load on call" on many of my larger and/or animated objects (and deleted them from the frame editor, since "load on call" doesn't do anything otherwise - which is a quirk that I really dislike, but oh well).

    For B, I'm doing what someone suggested to me a while ago: I've removed almost all "start of frame" conditions and replaced them with a fastloop ("initialisation"). This will enable me to immediate create a moving loading bar on start of frame that will be displayed even while the rest of the code (level being loaded, gameplay being setup, etc.) is still being parsed. This is what I've got:

    Please login to see this picture.


    Does what I'm doing seem right? Is there anything else I can do to further decrease loading times?

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • The initialization routine is your best bet here. What I would do is this:
    Create the splash loading screen on the frame before-hand, after 5%, call the next frame. That's your first jump done. Preload your loading materials on the next frame ready, so the user doesn't see the transition. Start it off at 5%. Then, call your initialization loop to start loading the level.

    So pretty much what you got above, I think, from what I can see. I always create the same loading assets on the frame beforehand, so they are most definitely created before the load of the next frame and the user can see it is indeed loading. Fusion then loads the next frame where the transition can't be seen as it's preloaded them up. Then in the background you can work loading up your level with the loops etc. until completion.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Thanks Danny. Can you just clarify what you mean by this:

    Quote

    I always create the same loading assets on the frame beforehand, so they are most definitely created before the load of the next frame

    How can I create the assets in a previous frame? Do you just mean that I should use the same global objects for the loading materials, and that once they've been created once, they'll already be in RAM once the 2nd frame gets loaded?

    If so, then does that mean that once a global object is loaded, it is never purged from RAM, even if I load a frame that doesn't use it? If so, can using lots of global objects (I use many in my game) end up slowing down loading times and/or performance for this reason? (and if so, is there a way to manually purge the RAM)

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Yes, however, you don't need to set them global to be kept in memory. If the images are used in both frames, they will be kept in memory. This is a great advantage of the Fusion 2.5 runtime, you could preload all of your heavy graphics across previous frames or (a loading frame) before hand and they will all be kept in memory if they are to be used in the next frame.

    It's a very cool and handy thing to know, especially if you're looking to create a more seamless and realistic loading sequence.

    Also when it comes to purging ram, unfortunately it can't be done manually but the routines the runtime uses, garbage is automatically dealt with when not needed. This is to keep the game performance as optimised as possible.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

    Edited once, last by Danny (March 3, 2017 at 12:29 PM).

  • So practically i make a seperate frame where i load from my Array and create the objects i need. Switch to my game frame where it places Everything to X/Y positions?

    Please login to see this link.
    Please login to see this link.|Please login to see this link.|Please login to see this link.

  • Ok, so am I right to suppose that if an object is used in frame 1 and frame 2, it gets kept in memory. But if it only gets used in frame 1 and frame 3, then it'll automatically get purged at the beginning of frame 2, and then need to load again at frame 3?

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Ok, so am I right to suppose that if an object is used in frame 1 and frame 2, it gets kept in memory. But if it only gets used in frame 1 and frame 3, then it'll automatically get purged at the beginning of frame 2, and then need to load again at frame 3?

    That's correct. It's a cool thing to know, especially for creating loading frames prior to the actual game frame, giving you time to actually load the assets into memory.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • So practically i make a seperate frame where i load from my Array and create the objects i need. Switch to my game frame where it places Everything to X/Y positions?

    Sure you can do that. You will still need to reload them at the start of the game frame to ensure everything you needed to load is loaded but they will be memory-ready for when the next frame loads.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Cheers Danny. Good to know.

    Are there any other tips regarding minimising RAM usage? For example, does it make any difference whether you import 3-channel (RGB) or 4-channel (RGB+alpha) PNG files into your actives, or do all actives automatically have alpha channels created?

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Hey Volnaiskra,

    I wrote an article on it a few days back

    Please login to see this link.

    PNG will Alpha does take up a lot of memory. I only use PNG32 for characters and UI or objects that need good clarity. Everything else I use PNG24 for objects that the user will see but not pay attention to and PNG8 or JPG for anything that I can viably get away with...

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • I thought it didn't matter what you imported your images as? Besides the alpha channel being a memory hog, doesn't Fusion convert them to whatever internal format it uses? So it wouldn't matter if you saved your images as PNG, JPG or BMP.

    I mean, it would only really make a difference if the original image had less colors (less memory usage).

  • Fusion does save in its own format internally but PNG with alpha take up much more than a standard jpg/png24. Fusion still retains the alpha channel.

    Size matters. A 14kb jpg is going to be much more efficient than using a 264kb png with alpha. You probably wouldn't notice on small to medium sized games but you certainly would with large games, especially on mobile where gpu and memory are crucial.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • But will there be a difference between PNG24 and JPG? I would have thought that they would both be turned into some sort of lossless format (or even just into straight uncompressed BMP).

    Also, what about PNG8 vs PNG24? Would the 8bit, 256-colour nature of the PNG8 be kept, even as Fusion transforms the image into its native format? If so, then what about if you imported 99 animation frames of PNG8 files into active and 1 frame of a PNG24 - would Fusion keep 99% of the frames as 8 bit and switch to 24bit for that one frame?

    Thanks for linking your article by the way. Very useful. I've also started watching your video tute about optimisation

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Sorry about the late response Vol, I wanted to clarify 100% with Yves but Fusion 2.5 converts to 24-bit upon import (retaining an alpha channel if needed). So even though it may also seem redundant to export your images out of Photoshop/Fireworks at 8-bit, it is still warranted to keep the filesize down if you want to stick to keen optimization.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!