User Tag List

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

Thread: Do longer group names take longer to activate and diactivate?

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,202
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Do longer group names take longer to activate and diactivate?

    I read that when you run a loop the system have to search for that loopname so it can be good for performance to have short loop names so the search goes quicker. I use just number now as loop names like "01" , "02" and so on.
    But is it the same with groups or does the name not matter? I am thinking a scenario where you open and close groups many times in every frame. Would it matter if the group name would be

    "01"
    or
    "asdasdjasdjasldkjalkjfk423467sjdlsjflskjdfalskjda lskjdaslkfhskjadfkljsdljudiupoi329420948103"

    in regard of performance?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Aeolian's Avatar
    Join Date
    Dec 2013
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't fully understand how fusion compiles games to various formats, but it sounds really farfetched to suggest naming has any impact on performance whatsoever. Groups, loops, or otherwise. In traditional programming (which I understand fusion is not) naming is for human readability sake only, and means nothing when it's inevitably machine code.

  3. #3
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,541
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well theres some logic to it, particularly where fast loops are concerned. If MMF2 wants to check a condition like "On loop "Fartypants"", then it has to run a string comparison of the active loop index(s) and the constant string. And that means reading character by character and checking if they match. Which would be 'slower' for longer names. But theres the question of how much overhead goes into the structure itself, which probably outweighs any concerns over loop name length by a factor of ten thousand compared to the actual string check for most applications.

    But for activating and deactivating groups, there should be no such concern, because you are using a direct group index parameter rather than the string name of the group at edittime. You choose the group from a drop down menu, and it doesn't matter what the groups name is, theres no string parameter being compared. Your group names should be as long as you want and it shouldn't impact performance in even a negligible way.

    In general, try to think through it- is anything actually going to read the string and compare to it? If theres no direct comparison to the string, its not functional.
    When you say "close group "Test Commands"", its not a string comparison any more than when you use "Jump to frame 4, "swamp level"".
    MMF2's just got an index for the groups and levels, and its smart enough to readjust these indexes every time you add or remove a group/level

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Aeolian's Avatar
    Join Date
    Dec 2013
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you certain that fusion will compare a string at runtime when executing a loop? Just because it looks like that on our end, doesn't mean that's how it is during runtime. Once again though, I must mention, I really don't know how clickteam converts everything. I'd like more insight into how things are handled, but I've only picked up tidbits here and there.

  5. #5
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,541
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I probably should have mentioned- as of the big fusion #2 update, one of the big changes in how loop structures work is that if all loops in your frame use static names, no calculations in the loop index, then they will be pre-indexed by the compiler and *not* use a string comparison, and indeed cut out a large overhead of sorting through all the 'on loop' events in your frame. Essentially same thing as a JMP statement. But this is disabled if you have even a single loop in your frame with a computed name, ie "on loop alterable string b" or something like that

    but still applicable to anything doing string comparisons in general

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    tompa's Avatar
    Join Date
    Nov 2011
    Location
    Uppsala, Sweden
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good to know, thanks a bunch Pixelthief.

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,202
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Oh, if this is changed then the old method of having a every loop inside an individual group that was activated - run loop - and then diactivated again is not needed anymore?

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    tompa's Avatar
    Join Date
    Nov 2011
    Location
    Uppsala, Sweden
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good question Outcast, I had to test it for myself.

    Since I'm quite finicky, I'll continue to use group-deactivation while running loops from a string or expression.
    Attached files Attached files

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,202
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Thanks for example Tompa, but I did not fully understand this example, could you explain the difference of the options?

    I was meaning that I use the activate - loop - and diactivate group events so that there will always only be 1 loop "available" to search for in the system. This way I don't even need to name the loops any different, I just always call a loop "0". This is also convenient when copying loops to other things since you never have to adjust the loop names.
    I have attached an example
    Attached files Attached files

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    tompa's Avatar
    Join Date
    Nov 2011
    Location
    Uppsala, Sweden
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure, "run from string" calls a loop by variable.
    The second checkbox utilize the group deactivation feature that shortens the index of loops that the computer has to.. compute, in order to find what loop to run.

    Calling a loop from variable or expression (breaks Fusion indexing for that action)
    start loop (sLoop_name) 10 times
    start loop ("playSFX_" + str$(iSound_buffer)) 10 times

    on loop "playSFX_1"
    do stuff


    Defining a loop as variable or expression (breaks Fusion indexing for every loop call in that application)
    start loop ("hello_1") 10 times

    on loop sLoop_name
    do stuff

    on loop "hello_" + str$(1)
    do stuff


    Utilizing the Fusion indexing for loops (twice as fast, no need for group activation, tested on 2.5)
    start loop "hello" 10 times

    on loop "hello"
    do stuff

Page 1 of 2 1 2 LastLast

Similar Threads

  1. .mfa no longer associated with a program & I can't reassociate
    By rubes in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 21st July 2013, 08:21 PM
  2. Collision with box no longer working?
    By LobsterKing in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 7th January 2013, 04:25 PM
  3. Can no longer build.........
    By scottige in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 5th October 2011, 10:02 PM
  4. Can no longer build flash
    By Christian_Wheel in forum SWF/Flash Export Module Version 2.0
    Replies: 13
    Last Post: 18th August 2011, 05:57 PM
  5. longer deaths?
    By scurvy in forum The Games Factory 2 - Technical Support
    Replies: 8
    Last Post: 18th November 2010, 06:00 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
  •