User Tag List

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

Thread: Group of events & global events - performance?

  1. #1
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Sep 2007
    Location
    Austria
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Group of events & global events - performance?

    My game has 1600 events per frame. With two players, only half of them are active...I activate one group for each player. My code's a mess and I want to change some features...

    Does it make sense to have groups of events to boost the performance or could I also have 1600 events in the frame without a worse performance although only a quarter of them are used (but MMF2 has to check them all again and again)?

    And what about global events? It is really much work if I change or add something and have to do this in all of my 30 frames! Now a developer told me that his frames did not contain much code anyway and he used almost 2000 global events for his game.
    Does this affect the performance?

    There is a huge difference of course if you add something and do this just in the global events or you have to sit in front of the computer for a couple of hours to replace lines of code in 30 frames.

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Group of events & global events - performance?

    Why do you have one group of events per player? That sounds like a nightmare! Are they all the same but just the player object they use is different? There is a better way to do that you know
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Sep 2007
    Location
    Austria
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Group of events & global events - performance?

    Well, I don't know.

    Character (P1) collides with bomb (p2): play sound, subtract 10 points (P1), add 10 points (p2)
    Character (P1) collides with bomb (p3): ...
    Character (P1) collides with bomb (p4):...

    The same for Char (p2), p3 and p4.

    And as I have many monsters, many power-ups and four players I get a ton of events.

    A friend of mine who is a programmer (c++) once asked if there are no child objects in MMF2. And I did not know.

    Let's say there are 3 power-ups you can kill one of 10 monsters. In my project, this equals 30 events... then another 30 for player 2 and his power-ups, another 30 for player 3 etc.

  4. #4
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    California, USA
    Posts
    1,247
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: Group of events & global events - performance?

    You could cut a lot of these events if you use Qualifiers.

    Examples:
    Set all monsters to type "Bad". Then replace all of the monster collisions events with type Bad. (if the sounds, points, others actions are the same)

    This would work more like your friends parent/child relationship.
    DT
    Special Projects Director

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Group of events & global events - performance?

    Even if you have to put the qualifier and other objects in some loops with the ForEach object, it can be done in a lot less than 1 group of a lotta events per player.
    Working as fast as I can on Fusion 3

  6. #6
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Sep 2007
    Location
    Austria
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Group of events & global events - performance?

    I know how to use qualifiers but they don't always work.

    e.g.

    Group(bad) collides with bomb1 -> destroy group(bad), play sound works but not if each monster has a distinctive "killed" sound and animation. Not an actual animation but another object is created and shot around the screen. This object does not bounce or hurt the player, it is just eye-candy.

    EDIT And what about this one?

    Bomb player 1 collides with player 2: bomb 1 is destroyed, a sound is played, player 2 loses points, player 1 is awarded points

    Now I need events for three types of bombs and four players. The third bomb does not award points but the hit player only loses points.

    I did not know how to code this apart from all single events:

    B = bomb, P = player... B1.1 = bomb type 1 of player 1

    B1.1-P2
    B1.1-P3
    B1.1-P4
    B2.1-P2
    B2.1-P3
    B2.1-P4
    the same with B3.1

    B1.2-P1
    B1.2-P3
    B1.2-P4
    etc etc...

    many, many events.

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Group of events & global events - performance?

    Still, there are some events that CAN be used with the qualifier. The fewer the merrier!
    Working as fast as I can on Fusion 3

  8. #8
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Group of events & global events - performance?

    I would set a certain alterable value on each bomb (alt value D, say, because I've got into the habit of using that for ID) and each player - then, on the collision event, check against the qualifier the bombs were in and make sure that Alterable Value D of the bomb is different from that of the player.

  9. #9
    Clicker Multimedia Fusion 2SWF Export Module

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

    Re: Group of events & global events - performance?

    In terms of overhead, the more code running at once, the more slowdown you will have. If the game has to parse 1600 lines of events every frame, it will be slower than 1200 of those lines of events.

    However, 1600 is not all that much. Depending on how complicated your code is, the fast loops you're running, etc, and guessing from what you've said, there should be no slowdown at all on any machine. One of my projects used 3200 lines of code, before I was into formatting it to only parse active code- 3200 lines of events per frame, and it ran with no real slowdown.


    Grouping your events will improve performance, but it will only be noticeable as your project becomes complex- particularly with looping. You can read more here
    http://create-games.com/article.asp?id=1937

  10. #10
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Sep 2007
    Location
    Austria
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Group of events & global events - performance?

    Fast loops? I don't even use them.

    I only use e.g. "always: set counter to value x(object)"

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Performance of behavior events vs frame events
    By Ryan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 4th July 2013, 05:24 AM
  2. Creating group events?
    By Morpheus in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 24th April 2011, 06:43 PM
  3. Group of events
    By Skyhunter in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th March 2011, 03:22 PM
  4. Global events or Frame events first?
    By Digitalic in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 25th June 2010, 08:18 PM
  5. Set Group in events?
    By RobertRule in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 5th September 2008, 09:58 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
  •