User Tag List

Results 1 to 7 of 7

Thread: Memory questions on loading (and unloading) objects

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Feb 2013
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Memory questions on loading (and unloading) objects

    Hello all. I'm getting toward the end of my game development and I'm really focusing on lowering the memory usage of my game (I'm down to around 350 mb from 1300 mb just a couple weeks ago). A big part of this is due to the load on call box. It's super useful. But some objects that i only want loaded occasionally- that I need to load during action intensive segments- can cause a hiccup. My first question is as follows...

    1. Is there a way to load an object into memory without actually creating the object?? A special projectile, for instance, may only be used during a frame very rarely, so it's smart to use load on call. But when I know the projectile will be used during the frame, I'd rather load it into memory before the action starts. Is this possible.

    Taking optimization further, I've got a second question as well.

    2. Is there a way to unload an object from memory during the same frame?? For instance, say a frame starts with a cut-scene and has a dialogue box object. After the cut-scene ends I know the dialogue box will be unnecessary for the rest of the frame. Is there a way to remove the dialogue box from memory at that point?

    Thanks for any responses and/or ideas.

  2. #2
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Forcing load on call for all objects is always a great optimisational tip (although useless in very unique situations) but overall your best optimisation tip. Believe it or not, creating the object is never really the issue. Your GPU could effectively create 1000 512x512 sprites a second without a hassle, it's the memory usage that is the drip (as you probably know). Unless you force load on call, it will be loaded into memory at the start of the frame.

    With regards to your second one, you can't unload an object from memory in the same frame yourself. I'm not 1000% sure entirely on how Fusion exactly handles this, but you can check the differences out yourself in the debugger when you create/destroy particular objects. With regards to the cutscene object, when you destroy it, it should relieve memory usage...

    There are a ton of other optimisations you could do too, but having a drop from 1300mb to 350mb = some great optimisation already. 350mb for a finalised, compiled game utilising the GPU (PC) is not bad at all. It will probably actually use less than this in your final build. Try building your app as an executable, run it and then open task manager and see how much memory it is using.

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Feb 2013
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply! After some testing it seems that destroying objects doesn't relieve much (if any) memory usage. But you are right about 350 mb being much better than 1300! It's good to hear that's a decent number for PC. For the record, its 350 as an executable. It's around 800 in the debugger. In my experience running it through fusion seems to add about 500 mb in the debugger.

  4. #4
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Sure, try a test build (executable) and as the game is running, check in task manager how much memory is actually in use. 350mb for your compiled executable will be the runtime and all your assets including sound files aswell as images, plus any binary files you may have put in.Again, give it a test as a compiled executable and let me know the memory result...

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module

    Join Date
    Feb 2014
    Posts
    1,055
    Mentioned
    29 Post(s)
    Tagged
    1 Thread(s)
    does the "load on call" command work on iOS? or is it just for PC?

  6. #6
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Across all runtimes SHINBAXTER

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module

    Join Date
    Feb 2014
    Posts
    1,055
    Mentioned
    29 Post(s)
    Tagged
    1 Thread(s)
    Cool. Cheers Dan

Similar Threads

  1. Replies: 2
    Last Post: 28th December 2015, 12:58 PM
  2. Memory Storage Questions
    By amaire13 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th February 2013, 09:02 AM
  3. 3 questions - Memory, collisions
    By Yikes in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 3rd April 2012, 06:09 PM
  4. Some memory questions
    By jregork in forum iOS Export Module Version 2.0
    Replies: 49
    Last Post: 19th January 2012, 05:57 PM
  5. loading/unloading extensions on opening MMF2?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 23rd October 2011, 06:54 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
  •