User Tag List

Results 1 to 6 of 6

Thread: Optimization: Multiple objects VS multiple frames

  1. #1
    Clicker Fusion 2.5Android Export ModuleiOS Export Module
    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
    Dec 2013
    Posts
    85
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Optimization: Multiple objects VS multiple frames

    Forgive me if this has been asked / answered before but I couldn't find an answer that deals specifically with what I'm asking.

    I've been designing an app alongside my wife that's quite image-heavy. Basically it's a character creator of sorts, allowing you to choose hair, clothes etc.

    The way I designed it was a bit primative. Each "hair" for example is stored on a different direction of an animation, so each time you choose a new hair, it just points the object to a different direction. So 32 directions X around 6 different animations would mean 192 directions each with an image on it on a single object. It seemed like a good idea at the time but now i'm not so sure!

    Problem is, the sheer amount of directions per object is causing a bit of slowdown when exported to android.

    Would it have been a better idea to have had hundreds of hair objects separately and simply load each one in when the button for it has been pressed rather than a single object with hundreds of directions?

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    642
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Use a separate active object for each piece of clothing/hair/etc. So you have the "hair" active, the "shirt" active, and so on.

    Give each of these actives an alterable value, named "what number" or something similar. Instead of using different directions, you'll be using animation frames in a single direction, with each animation frame being a different style. You can have 100+ animation frames in a single direction! Make sure to set the animation speed to 0 (so it won't change frames unless you tell it to) and set the animation to loop.

    Now all you need to do is make one 'Always' event in the event editor that forces your actives to display correctly:

    Always:
    - Active -> Animation -> Change -> Animation Frame -> set to 'What Number("Active")'

    Now you can change "What Number" and cycle through all of your stored images. Remember that animation frames are 0-based in the event editor even though they're 1-based in the picture editor.

    This method uses barely any memory unless you are using massive images, but I doubt you'll need to worry too much even if you are unless they're REALLY big. Something to keep in mind with big actives is to uncheck "use Fine Detection" in their runtime properties unless you actually need it. This makes them much less expensive since they will use box collision instead of generating a complex mask.

  3. #3
    Clicker Fusion 2.5Android Export ModuleiOS Export Module
    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
    Dec 2013
    Posts
    85
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I get what you're saying and it makes sense from a coding point of view.

    So hundreds of animation frames spread across a single animation would be more optimization friendly than hundreds of single animation frames spread across 32 directions in multiple animations?

  4. #4
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    642
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Yeah I assume so. Would need someone more knowledgeable than me to confirm this if you want to be absolutely 100% sure, though.

    IMO I don't think either are expensive enough that you would really need to worry about performance in the first place. My method is mainly simpler for quality of life and ease of editing your styles, lol.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,278
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Pretty sure that either approach is going to yield the same cpu hit. The big advantage is going to be using frames will give you more options for hairs, eyes, etc. Using directions is limited to 32 total images but you can have each object animate if you want.

    The real hit on device will be RAM if you have lot of images. Do NOT make each part a unique active (i.e. Each hair, each eye, etc) as that will have a lot more overhead and will incur a bigger load initially. But keep in mind that the mobile exporters export image frames as unique image files so there will always be a big hit at runtime if you are making graphic intensive apps. Hopefully clickteam will optimize this to spritesheets in the future to help minimize the load.

  6. #6
    Clicker Fusion 2.5Android Export ModuleiOS Export Module
    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
    Dec 2013
    Posts
    85
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Using 32 directions wasn't really too big a problem, if I ran out of directions I just created a second animation, so "Hair Set 1" - "Hair Set 2" etc. I can definitely see the benefit of using frames instead from a coding standpoint and for being able to add more stuff easier later on. Switching to frames, I am noticing a very slight reduction in the MFA filesize (50kb so far, woo?) but not really any difference in the speed of the app. Loading time is definitely an issue, I'm going to add a fake "loading" screen so at least people know it hasn't frozen on them.

    I might need to make some optimizations elsewhere I think. It IS a very image heavy app and I'm already using box collision instead of fine detection.

Similar Threads

  1. Active Objects in Multiple Frames Copied?
    By BeowulfKaine in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd December 2009, 09:30 AM
  2. Importing multiple animations as multiple frames
    By Shawn in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 25th November 2008, 09:36 PM
  3. Multiple PMOs for multiple Objects
    By Blood_Wist in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 31st May 2008, 01:49 AM
  4. Multiple PMOs for multiple Objects example
    By Blood_Wist in forum File Archive
    Replies: 1
    Last Post: 31st May 2008, 01:48 AM
  5. Sum (multiple alt values, multiple objects)
    By Melvin in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th April 2007, 02:00 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
  •