User Tag List

Results 1 to 5 of 5

Thread: Less VS More conditions

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Less VS More conditions

    Lets say i have a design for a game consisting of two types of objects, Block and Ball
    ...
    The game contains 50 Blocks and 10 Balls

    Balls bounce randomly around
    If a ball hits a Block, bothe the Block and the Ball is destroyed
    If no Blocks left, you win!
    ...
    I will present two different methods of handling this

    (1)
    In the first method i have 10 instance of object Ball
    My event editor looks somthing like this:

    Ball collides with Block ---> Ball destroy, Block destroy
    If Blocks <= 0 ---> Next level ( you win )

    (2)
    In this method, Instead of having 10 instanced of object Ball, i have 10 different Ball Objects
    Ball 1, Ball 2, Ball 3, Ball 4, and so on...
    Now, my event editor looks somthing like this:

    Ball 1 collides with Block ---> Ball 1 destroy, Block destroy
    Ball 2 collides with Block ---> Ball 2 destroy, Block destroy
    Ball 3 collides with Block ---> Ball 3 destroy, Block destroy
    Ball 4 collides with Block ---> Ball 4 destroy, Block destroy
    and so on...
    If Blocs <= 0 ---> Next level ( you win )

    Needless to say, this secound method requires alot more events than the first mehtod.
    ...
    Now whats the significant impact of the two different methods?
    If it doesnt matter much, is that because of the simple nature of the design/ game?
    ...
    Imagie i redesign the game to be more complicated.
    Balls no longer bounce around randomly, they have AI intelligence, shoot bullets at the blocks, attack eachother ( other Balls ) and use different tactics.

    Now whats the significant impact of the two different methods?

  2. #2
    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)
    I might not be understanding this correctly, but from what events I can see you are using, I think you'd benefit greatly from using groups. If every ball has the same event when colliding with a block, just assign the ball objects to a group and test for the ball group colliding with a block instead of every inidividual ball. This lets you test the 10 individual ball collisions as one object in one event, and still lets you be able to have individual events for the 10 different ball objects.

    I think it would probably be better though to use one ball active object, then create 10 of them at start of frame or whenever you want and assign an alterable value to each one to differentiate them. But ultimately it would be the same difference as actually having 10 unique ball objects, but it lets you cut down on making a bunch of different types of objects. If you test alterable values you wouldn't need to actually use a group to test the collisions. For assigning unique behaviors you would just test If alt val A of ball = 1, then do whatever behavior for ball 1. If Alt Val A of ball = 2, then do that, etc.

    It doesn't matter if you use more events to accomplish something as long as it works right, but it certainly makes life easier.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The explanation of my problem might have been abit overcomplicated or not very well defined, and im sorry for that...
    ...
    Quote Originally Posted by Shawn View Post
    It doesn't matter if you use more events to accomplish something as long as it works right
    But this is 'exactly' what i want to know. Does this statement realy hold true?
    ...
    Is ( method 1 ) using 1 ball with '10 istances' ( wich only requires conditions for 1 ball wich all instances act uppon ) the same as ( mehtod 2 ) 10 different ball 'objects' ( wich requires 10 times the conditions )?

    Does the number of conditions i use to create this design not matter at all? can i use 100 conditions to complete this ( simple ) design and its all the same, no differencein use of computer resources, no lag or slowdown?

    My question is valid, although im not really talking about something as simple as 'bouncing balls colliding with blocks' here. In reality im trying to solv a problem for a much more sophisticated application, the bouncing ball analogy was just the easiest way i could think of explaining it.

  4. #4
    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)
    As far as I'm aware, the only time you really will have any performance issues is using a ton of fastloops, though even then I think you can have a lot going on. I'm not an expert, but that is my understanding. Unless you're doing something really CPU intensive I don't think you'll have a problem. Only other performance issues is if you have a ton of actives going on, but if you're using HWA even that should be a non-issue (depending on what you are doing). I think you might have more concerns if you are using exporters than you would making a regular MMF2 app.

    I'm not an expert though as I said, so someone can clarify for sure.

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2011
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interessting question.

    As far as I know:
    - Method B should not slow down the application. I heard you can have almost unlimited events without performance issues. Only if you use heavy fastloops for every object, it could be a problem. But: depending on how complex your application is, it gets really messy...

    - I went with Method A. It is much cleaner and easier to make changes later in development. But make sure you understand spread values, object references and fastloops. Problem here is: this method is not for beginners...

Similar Threads

  1. Two conditions for one event?
    By delta9857 in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 5th November 2010, 07:38 AM
  2. Conditions for a Rebootrequest
    By Fritz_Bilda in forum Install Creator and Patch Maker
    Replies: 3
    Last Post: 6th October 2010, 11:08 AM
  3. What is Immediate conditions?
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th May 2009, 08:12 AM
  4. AND conditions
    By maestro1 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 24th February 2008, 08:11 AM
  5. AND OR conditions
    By Golds in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 7th September 2007, 01:21 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
  •