User Tag List

Results 1 to 10 of 10

Thread: Active Object Behaviours - What's The Point?

  1. #1
    Clicker Firefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Nov 2017
    Posts
    103
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Active Object Behaviours - What's The Point?

    Quick one, would like to know thoughts here... is there any point in using behaviours outside of organisation? Is it purely so you can nestle events for an object into that object so it's not "in the way" in the main event editor? Is there a worthwhile performance gain anywhere?

    I have enemies and their movement loop is defined within the main events, applied to a qualifier. Each enemy then has all events specific to them (i.e. their attack patterns, etc) coded in their own Behaviour... but I'm starting to find it a hassle when I need to cross-reference something I did in Enemy A to check I'm doing the same way with Enemy B, for example. I'm starting to think I should just move all events back to the main events.

  2. #2
    Clicker Fusion 2.5Android Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AftPeakTank's Avatar
    Join Date
    Apr 2013
    Location
    Greece
    Posts
    399
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Good points but if you own the Dlc, then you can make behaviors that contain qualifiers. No hassle for keeping the same behaviors in every enemy. Just be sure u put the right qualifier on this.

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLCFirefly 3D Module
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    668
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    I think for objects where the order of events is not important, behaviors can be a way to keep your main event editor from getting too cluttered (all behavior code is tacked onto the bottom of the main event editor, in order of object creation). Seeing as how I haven't found many situations where I don't care about the order of events, I never use them personally.

  4. #4
    Clicker Firefly 3D 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,350
    Mentioned
    101 Post(s)
    Tagged
    0 Thread(s)
    I remember having different code spread across different objects, many years ago when I was using Flash. It always ended up as a nightmare keeping track of it all. I think that's why I've never used behaviours in Fusion (that and the pre-2.5+ limitations, plus the inconvenience of accessing them).

    If you're organised and disciplined with groups and subgroups then it's easy to keep your events uncluttered. And now that 2.5+ has made global events good, you can move some code there if you need code that follows objects across multiple frames.

    So I don't really see any appeal with behaviours personally. I can see some genuine benefits though, in the case of objects that will be copied/pasted across multiple mfas. So, if you will use an object in many games, or to sell on the clickstore, then bundling its code in a behaviour suddenly seems really helpful.

    As far as I know, there's no technical or performance advantage to behaviours. It's just an organisational choice.

  5. #5
    Clicker Firefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Nov 2017
    Posts
    103
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I'm working entirely in the Global event editor and I've just moved all my enemy code to a sub-group, with wach enemy having it's own group. Already feels much better as now I can easily compare them, copy events fromone to the other (which is why I was getting frustrated before), etc.

    I don't think I'll be going back to using behaviours.

  6. #6
    Clicker Firefly 3D 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,350
    Mentioned
    101 Post(s)
    Tagged
    0 Thread(s)
    I guess another advantage of behaviours is that the code doesn't run if the objects aren't present in the frame, so you don't waste cpu time on it when it's not needed. . So if you keep everything in frame events or global events, you should have some sort of system where you check what objects are and aren't present in the current level, and enable/disable groups accordingly. Easily doable, but definitely an extra little chore.

  7. #7
    Clicker Fusion 2.5Android Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AftPeakTank's Avatar
    Join Date
    Apr 2013
    Location
    Greece
    Posts
    399
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    With respect to all the people who replied...

    I just want to say again, that now you can use qualifiers in behaviors. So this way, there is minor possibility of messing around things...

    But you need Fusion 2.5++

    Check here how I implemented this:

    https://www.indiedb.com/members/aftp...miner-maniakos

  8. #8
    Clicker Firefly 3D 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,350
    Mentioned
    101 Post(s)
    Tagged
    0 Thread(s)
    Progject has 2.5+ (the icon is next to their avatar), so they probably know already that you can use qualifiers in behaviours. The issue is that behaviours, whether with qualifiers or not, have inherent disadvantages. For example:

    -they are annoying to access (no hotkeys - you first need to locate the right object, then move to the correct tab in its properties, then click a little button).
    -they fragment your code, which harms readability (Progject found having to switch between global events and the behaviours of various individual objects to be tedious and/or confusing)
    -they increase the likelihood that you'll forget about some piece of code (because it's buried in the behaviours of some obscure object you worked on 6 months ago) which may cause unexpected bugs.

    So Progject wanted help deciding whether these sorts of disadvantages are worth the trouble.

  9. #9
    Clicker Fusion 2.5Android Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AftPeakTank's Avatar
    Join Date
    Apr 2013
    Location
    Greece
    Posts
    399
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    Progject has 2.5+ (the icon is next to their avatar), so they probably know already that you can use qualifiers in behaviours. The issue is that behaviours, whether with qualifiers or not, have inherent disadvantages. For example:

    -they are annoying to access (no hotkeys - you first need to locate the right object, then move to the correct tab in its properties, then click a little button).
    -they fragment your code, which harms readability (Progject found having to switch between global events and the behaviours of various individual objects to be tedious and/or confusing)
    -they increase the likelihood that you'll forget about some piece of code (because it's buried in the behaviours of some obscure object you worked on 6 months ago) which may cause unexpected bugs.

    So Progject wanted help deciding whether these sorts of disadvantages are worth the trouble.
    Well said... I hope all these matters will be somehow be improved. Personally I am a big fan of behaviors cause I can have clean code in my main events. I have very small projects though. I guess in projects that are big (like spryke) things can easily get messy with behaviors.

  10. #10
    Clicker Firefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Nov 2017
    Posts
    103
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Another thing that tipped me over the edge was that my game pauses for various reasons - accessing menus and whatnot. When this happens, the "Main Engine" group gets disabled.

    Because I cannot disable the enemy behaviours, I was actually making a condition "When the game is paused (using a global variable)" then nestling all events into the child events of that condition.

    This worked fine... until I realised that because they are child events, there are certain conditions I cannot create, such as "X collides with X" as these are child events after all.

    Strangely, if I were to create the entire event outside of the parent and then drag it up so it becomes a child event, it actually had no problem with this.

    Also, having an event which enabled/disabled a group witin the enemy's behaviour just crashed the game for me
    It isn't worth trying to figure out why, so I just moved them all back to Global Events.

    Good point on the extra code overhead - it shouldn't be a problem having a check that certain objects are present and enable/disable the group if so.

Similar Threads

  1. point chaud de l'active picture ???? Hot point under android
    By Rached MILADI in forum Android Export Module 2.5
    Replies: 6
    Last Post: 11th January 2017, 02:12 PM
  2. Player controlled active object orbiting around fixed point?
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 10th June 2012, 04:21 AM
  3. Action Point on Active Picture Object
    By reptilezero in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 29th January 2012, 11:35 PM
  4. Rotate active object about a point
    By Digitalic in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 3rd June 2010, 03:21 PM
  5. [help] calculate point on rotated active as if....
    By nightofgrim in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd January 2008, 05:30 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
  •