User Tag List

Results 1 to 7 of 7

Thread: Event Editor Sub-groups

  1. #1
    Clicker Multimedia Fusion 2iOS Export ModuleXNA Export Module
    Asholay's Avatar
    Join Date
    Nov 2008
    Location
    England
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Event Editor Sub-groups

    In order to tidy code up, and to keep the game running smoothly, I want to create groups within groups which I can activate/deactivate.

    Is this safe from a resources point of view - and how many levels of grouping can you go down - i.e. can I do this:

    -Main engine code
    ---<<Group 1: Area 1 of game>>
    ------<<Sub-Group 1: Building x code>>
    ----------<< Sub-sub-group 1: Dialogue control of building>>
    ----------<< Sub-sub-group 2: other specific building code>>
    ------<<Sub-Group 2: Building y code>>
    ----------<< Sub-sub-group 1: ...>>
    etc, etc

    It's certainly tidier, but will I run into problems with memory, or crashes, doing it this way?

    Cheers
    Ash

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Event Editor Sub-groups

    Its how I've done every one of my projects. Subgroups just exist as permissions on what code is visible to the runtime or not. When a group is deactivated, all code inside it, subgroup or not, is deactivated.

    I'm sure that if you tried to break it by making 100,000 levels of subgroups, you'd run into some problems. But for any reasonable amount of grouping you'll never run into issues with memory, crashes, or other resource errors. And it will indeed make your code tidier and give you additional controls on activating/deactivating routines.

    Heres an example of what one of my projects looks like:


  3. #3
    Clicker Multimedia Fusion 2iOS Export ModuleXNA Export Module
    Asholay's Avatar
    Join Date
    Nov 2008
    Location
    England
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Event Editor Sub-groups

    Thanks for the info, I thought that was the case but wasn't sure; it's exceptionally tidy - much better than a single list of events - doesn't help that I'm a slave to OCD it would kill me to even leave an apostrophe out of a comments sentence, lol.

  4. #4
    No Products Registered

    Join Date
    Feb 2010
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Event Editor Sub-groups

    You do not need to using groups. It's cool to use flags.
    For simple example, [color:#FF0000]when you going to use it:[/color]

    Exit button clicked | "activate grup "RUN"
    :RUN
    only one action when event loops | Set text "BYE!"
    only one action when event loops | End the application,

    [color:#009900]just try to use this:[/color]

    Exit button clicked | Set internal flag 0 on
    Rich Edit internal flag 0 is on
    +only one action when event loops | Set text "BYE!"
    Rich Edit internal flag 0 is on
    +only one action when event loops | End the application

    You can also use global values instead flags:
    Set Global Value A to 1 instead Set internal flag 0 on
    Global Value A=1 instead internal flag 0 is on

  5. #5
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Event Editor Sub-groups

    If you're using lots of objects and a large program, thats a case where having groups and subgroups will explicitly run faster than using flags. When MMF2 reads a condition like:

    "Bad Guy Flag 0 is On?"

    it must then execute one conditional check per each instance of "Bad Guy" that is still scoped on that event- all instances if its the first condition.

    If you're running X loops of that event in a game with Y objects, this will require X * Y conditional checks; a polynomial time complexity. Were it an event that was activated via groups, or by a singular object instance's flag, then it would be linear time complexity (much faster).


    A good rule is to use flags for minor small off/on checks, and group activations/deactivations for large and complex chunks of code.

  6. #6
    No Products Registered

    Join Date
    Feb 2010
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Event Editor Sub-groups

    You are right, but sometimes flags looks much better, in small projects

  7. #7
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Event Editor Sub-groups

    Quote Originally Posted by Tomek
    You do not need to using groups. It's cool to use flags.
    For simple example, [color:#FF0000]when you going to use it:[/color]

    Exit button clicked | "activate grup "RUN"
    :RUN
    only one action when event loops | Set text "BYE!"
    only one action when event loops | End the application,

    [color:#009900]just try to use this:[/color]

    Exit button clicked | Set internal flag 0 on
    Rich Edit internal flag 0 is on
    +only one action when event loops | Set text "BYE!"
    Rich Edit internal flag 0 is on
    +only one action when event loops | End the application

    You can also use global values instead flags:
    Set Global Value A to 1 instead Set internal flag 0 on
    Global Value A=1 instead internal flag 0 is on
    In my opinion, it's a lot easier to read what is going on in your code with groups than to activate/deactivate using flags.

    Also, I built a custom pause feature for a game, because I needed to pause the game, but yet still allow for a menu to be usable while the game was paused, so I couldn't use the built in pause feature. Basically, I put everything inside a group for the main game loop,and the pause menu was in a different group. Upon pressing the pause button, I deactivated the main game loop stopping everything inside that.

Similar Threads

  1. Replies: 3
    Last Post: 14th October 2013, 12:54 PM
  2. Power ups and/or Event Groups
    By Henderman312 in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 11th March 2009, 11:58 PM
  3. [Request] Synced Event Editor + Event List Editor
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th March 2008, 07:44 AM
  4. Event Editor Glitch, Subgroups vs close all Groups
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 25th January 2008, 03:38 PM
  5. Global Event Groups
    By UnknownMonkeyman in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 6th July 2007, 09:41 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
  •