User Tag List

Results 1 to 8 of 8

Thread: saving memory in loading objects

  1. #1
    Clicker Fusion 2.5 (Steam)

    Join Date
    Sep 2017
    Posts
    3
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    saving memory in loading objects

    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?

    2019-02-27_17h51_02.jpg

  2. #2
    Clicker Fusion 2.5 Mac
    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)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    167
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    That is a very big frame - how big are the images you're using in your map?

  3. #3
    Clicker Fusion 2.5 (Steam)

    Join Date
    Sep 2017
    Posts
    3
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Most of them are 1024x1024

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    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.

  5. #5
    Clicker Fusion 2.5 (Steam)

    Join Date
    Sep 2017
    Posts
    3
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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?

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    523
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michau View Post
    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.

  7. #7
    Clickteam Clickteam
    Simon's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    2,642
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    @Michau 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.

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    523
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michau View Post
    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?

    2019-02-27_17h51_02.jpg
    Like @Simon 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.

Similar Threads

  1. Creating objects and saving memory
    By MrJustan in forum Fusion 2.5
    Replies: 10
    Last Post: 27th April 2018, 02:00 AM
  2. Example: Saving and Loading objects with ini++
    By Almightyzentaco in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 18th November 2016, 08:11 PM
  3. I need help saving/loading objects
    By rotciv01 in forum Fusion 2.5
    Replies: 5
    Last Post: 28th July 2016, 08:03 AM
  4. Replies: 6
    Last Post: 11th December 2015, 10:43 PM
  5. Saving on Memory - Cutting Up Objects
    By Corlen in forum Android Export Module Version 2.0
    Replies: 4
    Last Post: 24th April 2013, 05:55 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
  •