User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: While object for MMF/Flash?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    While object for MMF/Flash?

    I've been trying to use fastloops with Flash, but they behave odd compared to an exe. They tend to slow down things the more fastloops and conditions you use. Are there any plans to fix this?

    Also, I use fastloops to simulate a while block but it kinda feels unnatural. So, again, any plans to create a "While" object for flash?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Re: While object for MMF/Flash?

    Flash IS slower than C++, you can use fastloop but you must restrict the number of loops to a minimum.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Posts
    1,027
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: While object for MMF/Flash?

    Use the Flash version of the for each object instead spread value/loop. It's considerably faster.

  4. #4
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    AndyH's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,445
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: While object for MMF/Flash?

    The ForEach object (even with the patch) still has a bug in the Flash version where objects are deleted it can crash your flash file. I've sent the details to Francois so hopefully it will get fixed. But why would the ForEach object be faster than a fastloop? It's doing the same thing, it's just quicker to set up in MMF?
    Andy H @ ovine.net
    Awful Jokes - a new cartoon every day: http://awful.ovine.net/
    Ovine's games: http://www.ovine.net

  5. #5
    Forum Moderator Multimedia Fusion 2 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    DizzyDoo's Avatar
    Join Date
    Oct 2006
    Location
    South England
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: While object for MMF/Flash?

    AndyH, didn't Jamie write an unofficial bug fix for that error?
    Cranktrain - Currently finishing a new game called The Cat Machine!
    @MattLuard on Twitter.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: While object for MMF/Flash?

    For each is not that much faster than fastloop actually. It looks to me that it is pretty much the same.

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: While object for MMF/Flash?

    It depends how many loops you're doing. If you do the classic spread value/loop thing, it actually has to loop through all of the objects up to the loop index every loop to compare the alterable value.

    Here's an example of what MMF has to do when looping through 5 actives. What happens internally is coloured in red.

    Without the For Each object

    [size:8pt]Spread value 0 in Alterable Value A of Active
    (Active 1) : Set Alterable Value A to 0
    (Active 2) : Set Alterable Value A to 1
    (Active 3) : Set Alterable Value A to 2
    (Active 4) : Set Alterable Value A to 3
    (Active 5) : Set Alterable Value A to 4


    Start loop "foo" NObjects("Active") times

    (first loop) On loop "foo"
    + Alterable Value A("Active") = LoopIndex("foo")


    (Active 1) : Is Alterable Value A equal to 0?
    (Yes - object is now selected)

    (Active 2) : Is Alterable Value A equal to 0?
    (No)

    (Active 3) : Is Alterable Value A equal to 0?
    (No)

    (Active 4) : Is Alterable Value A equal to 0?
    (No)

    (Active 5) : Is Alterable Value A equal to 0?
    (No)

    (Actions run here)


    (second loop) On loop "foo"
    + Alterable Value A("Active") = LoopIndex("foo")


    (Active 1) : Is Alterable Value A equal to 1?
    (No)

    (Active 2) : Is Alterable Value A equal to 1?
    (Yes - object is now selected)

    (Active 3) : Is Alterable Value A equal to 1?
    (No)

    (Active 4) : Is Alterable Value A equal to 1?
    (No)

    (Active 5) : Is Alterable Value A equal to 1?
    (No)

    (Actions run here)


    (third loop) On loop "foo"
    + Alterable Value A("Active") = LoopIndex("foo")


    (Active 1) : Is Alterable Value A equal to 2?
    (No)

    (Active 2) : Is Alterable Value A equal to 2?
    (No)

    (Active 3) : Is Alterable Value A equal to 2?
    (Yes - object is now selected)

    (Active 4) : Is Alterable Value A equal to 2?
    (No)

    (Active 5) : Is Alterable Value A equal to 2?
    (No)

    (Actions run here)


    (fourth loop) On loop "foo"
    + Alterable Value A("Active") = LoopIndex("foo")


    (Active 1) : Is Alterable Value A equal to 3?
    (No)

    (Active 2) : Is Alterable Value A equal to 3?
    (No)

    (Active 3) : Is Alterable Value A equal to 3?
    (No)

    (Active 4) : Is Alterable Value A equal to 3?
    (Yes - object is now selected)

    (Active 5) : Is Alterable Value A equal to 3?
    (No)

    (Actions run here)


    (fifth loop) On loop "foo"
    + Alterable Value A("Active") = LoopIndex("foo")


    (Active 1) : Is Alterable Value A equal to 4?
    (No)

    (Active 2) : Is Alterable Value A equal to 4?
    (No)

    (Active 3) : Is Alterable Value A equal to 4?
    (No)

    (Active 4) : Is Alterable Value A equal to 4?
    (No)

    (Active 5) : Is Alterable Value A equal to 4?
    (Yes - object is now selected)

    (Actions run here)

    [/size]

    With the For Each object

    [size:8pt]Start For Each loop "foo" for "Active"
    (Loops through all the actives ONCE, selecting each and triggering the "On For Each Loop" condition)

    On For Each loop "foo" for "Active"
    (Actions run here)[/size]

    As you can see, the difference is huge. With 5 actives MMF has to compare the alterable value of an active 25 times to loop through them once, vs 0 times with the For Each object. You wouldn't notice that, but imagine when you have 500 actives? That would be 250000 comparisons, vs 0 with the For Each object.

    Comparing an alterable value is nothing like comparing a value in C or pure ActionScript - it has all the overhead of calling a condition, the object selection routines, the MMF types - because the C runtime is C, this overhead is compensated for because processors are fast. In ActionScript, the overhead really matters, because you basically have the processor running Flash Player interpreting ActionScript bytecode interpreting MMF bytecode.

    I did a small board game a while ago which had to loop through about 300 objects, and this took 2 seconds without the For Each object (in Flash) and was instant with the For Each object.

  8. #8
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    AndyH's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,445
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: While object for MMF/Flash?

    Interesting to know Jamie. DizzyDoo I have that fix (the updated DAT file) but the problem, or similar problem, still exists.

    I've only sent the file to Francois last week, where everything was working in my SWF file until I made a change, then when running the SWF only three things were working, other instances and all other events were not working. Francois identified something in the ForEach object was crashing and mentioned something about destroying objects and memory. I tried downloading that fix again, just to be sure (I was sure I had already installed it) but there was no change. Replacing the ForEach object for Fastloops and my SWF worked again. Hopefully the problem can be located and fixed soon, especially as there is an advantage of using this object.
    Andy H @ ovine.net
    Awful Jokes - a new cartoon every day: http://awful.ovine.net/
    Ovine's games: http://www.ovine.net

  9. #9
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    AndyH's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,445
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: While object for MMF/Flash?

    For info, this is what Francois found: "It crashes right in the middle of the selectOneObjectForCondition routine.". This post is where I got the latest DAT file:

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=186462#Post1864 62
    Andy H @ ovine.net
    Awful Jokes - a new cartoon every day: http://awful.ovine.net/
    Ovine's games: http://www.ovine.net

  10. #10
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: While object for MMF/Flash?

    Good to know all this info.

    The thing is that I need a "while" sentence where I can fast loop through a set of sentences or repeat them as long a condition is met, and even though I can mimic that with FastLoop and ForEach is cumbersome. Any plans for a "While" object (I mean, with a similar fast execution)?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Flash Files and flash replacements for the unfinished surface object
    By Ethan in forum SWF/Flash Export Module Version 2.0
    Replies: 2
    Last Post: 17th June 2013, 09:34 PM
  2. Flash Player Object - Open Url: Only works with buttons on flash portals
    By Matriax in forum SWF/Flash Export Module Version 2.0
    Replies: 9
    Last Post: 6th January 2013, 08:51 AM
  3. Differences between Flash Player / Flash Url object and button options
    By Matriax in forum SWF/Flash Export Module Version 2.0
    Replies: 2
    Last Post: 2nd January 2013, 10:09 PM
  4. Flash Object
    By Mikey in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 22nd May 2010, 12:43 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
  •