saving memory in loading objects

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 have a problem with memory usage in Clickteam Fusion. I've begun to creating a game and loaded elements of my map. In total there were about 90 diffrent objects and memory usage was about 700-800 mb. So i decided to load objects, when they're close to the player. At start of frame i stored information about them in array, destroyed all and begun to load only objects close to the player. But even with only 2 objects (player and array) memory usage is still about 735mb. I've checked "load on call" and unchecked "use fine detection", but memory usage is still the same. Is there anything what can i do to lower it?

    Please login to see this attachment.

  • Objects that are present on frame start will all be loaded into memory (RAM will be allocated to display them when needed). Checking "load on call" ensures Fusion only allocates memory for objects that have actually been created, but as all your objects are present on frame start this allocation will happen for all objects, no matter if you destroy them afterwards. I'm not sure how and if Fusion releases RAM for destroyed objects at all, that's a question that never has been clearly answered AFAIK. If you want to avoid this behaviour you have to work with a level editor and restart the frame when loading a new layout.

    Uncheching "fine detection" is a method to save CPU load on collision detection, but has nothing to do with RAM usage. I would not consider 800mb of RAM usage a problem at all (if you're aiming for PC as a target platform, of course). Your array-method on the other Hand ensures a low CPU load as Fusion only has to keep track of objects that are essentially needed, so I would just keep it like that.

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

    Edited 2 times, last by Julian82 (February 28, 2019 at 10:11 AM).

  • It's good idea, but when player will get close to every object and all of them will be loaded memory use will still be 800mb. So there is no option to "unload" the object from memory?

    This is what the "Destroy" function is for. Objects can automatically get destroyed when they're too far from the frame, but this can be a gamble sometimes, so it's best to have a function that will automatically check for an object's distance from the frame or from the player, and then run a destroy function when it gets too far away.

  • [MENTION=30261]Michau[/MENTION] if with only two objects on your frame you're hitting that level of memory use, your assets are definitely too big. A lot of people make this mistake and think Fusion should just handle it but best practice is still required to ensure you don't overly burden the computer running your game/app. You need to employ tricks like tiling imagery from smaller repeating images, making the repeats happen less than every frame width/height to hide the repeats from people's perception etc. and lots more besides.

  • I have a problem with memory usage in Clickteam Fusion. I've begun to creating a game and loaded elements of my map. In total there were about 90 diffrent objects and memory usage was about 700-800 mb. So i decided to load objects, when they're close to the player. At start of frame i stored information about them in array, destroyed all and begun to load only objects close to the player. But even with only 2 objects (player and array) memory usage is still about 735mb. I've checked "load on call" and unchecked "use fine detection", but memory usage is still the same. Is there anything what can i do to lower it?

    Please login to see this attachment.

    Like [MENTION=5109]Simon[/MENTION] said, you'll need to trim your image sizes way down and tile them. I'd recommend loading them in externally rather than baking them all into a single active object. Try cropping each 1024 down to 4 256's. Also make sure you've unchecked "Create at Start" on any object you don't need when the game begins, instead of running a separate command to Destroy these objects when the game starts. It's just more efficient. Also it won't make a huge RAM impact, but you can save a few kilobytes by unchecking Transparent if they're not transparent images.

Participate now!

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