User Tag List

Results 1 to 5 of 5

Thread: Do "ForEach Loops" and "Fast Loops" use more memory than new objects?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleMac Export Module
    Enchantainment's Avatar
    Join Date
    Sep 2012
    Location
    West Yorkshire
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Do "ForEach Loops" and "Fast Loops" use more memory than new objects?

    I've encountered an issue (that I've had MANY times before), with multiple instances not doing their own thing. Basicallu, I've got an object (dust cloud) that shoots out in a direction when you destroy an enemy. It works all well and good, apart from I need 4 instances of the object. Each one shooting in a different direction. Setting "Initial direction" will just make them go in one of the directions at random, and if I set each object a direction when they're created, they'll all set to the latest direction specified.

    The only workaround I've found for it, is to create 4 different dust clouds, each with their own direction. I'm wondering if perhaps using a "Fast Loop" or "ForEach Loop" for this type of thing, would be less strain on the engine? If so, how would I give them all a direction using one of those methods?

    Thanks!

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    679
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Regardless of which one uses more memory, in this situation you can go ahead and use any of those methods you want without seeing a performance drop. It takes a lot of loops to cause noticeable slowdown, running constantly. I believe i've had around 700 (the result of nesting on the x,y and z axis) running at once, checking from an array and creating/destroying tiles if necessary in my level editor before (but I wised up and starting rendering the edges only as it scrolled in the end ) and I was still only dropping from 60 to 40fps.

    As long as the loops aren't using intensive calculations, changing object scale or in general doing memory-heavy stuff, you can run thousands of them.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use a ForEach loop for this and it won't affect performance at all. As casleziro said, the loop itself won't cause any performance drops. What you do in those loop might, but changing direction is not resource heavy at all.

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export ModuleMac Export Module
    Enchantainment's Avatar
    Join Date
    Sep 2012
    Location
    West Yorkshire
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks for the information guys! I'll go ahead and see if I can use a "ForEach loop" for it.

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do it wothout loops, given their collective behaviour is symetrical/ semi-symetrical.

    After you create the clouds, give them each a unique ID and then set Dir based on this ID.
    ...Or, you could create a seperate Event for each instance that is created ( and apply specific properties to each or either one ).
    Attached files Attached files

Similar Threads

  1. Replies: 6
    Last Post: 18th August 2015, 02:23 AM
  2. Can someone explain "One action when event loops?"
    By Emerson3 in forum Fusion 2.5
    Replies: 7
    Last Post: 14th August 2015, 08:00 PM
  3. Active objects leaving a "blur" trail when moving fast
    By Storsorgen in forum Fusion 2.5
    Replies: 10
    Last Post: 10th December 2014, 06:35 AM
  4. "Only one action when event loops" question
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 5th December 2011, 01:49 PM
  5. Determine distance from objects ("A" to "B")
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 4th April 2010, 02:47 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
  •