User Tag List

Results 1 to 9 of 9

Thread: The Classic Duplicate Problem

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export Module
    Ramses's Avatar
    Join Date
    Jul 2006
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The Classic Duplicate Problem

    I've been an MMF user for over six years though I don't frequent the forums often. I was wondering if anyone has ever figured out a work around to this common problem when using duplicates:

    Let's say you have two active objects (Object1 and Object2) each with multiple duplicates in the frame and you have a condition like this:

    If Object1 is overlapping Object2
    + Object1 Alterable Value A = 1
    + Object2 Alterable Value B = 4

    Well as I'm sure many know, this condition won't work very well with duplicates because in the first condition, MMF only "remembers" the specific duplicate of Object1 that is overlapping Object2 and NOT the specific duplicate of Object2. So when it gets to "+ Object2 Alterable Value B = 4", it doesn't necessarily check the Alterable Value of the duplicate that is overlapping Object1.

    Fastloops help when your trying to match two pairs of duplicates that have their alterable values spread out. But they won't really help in this situation. So my question is - has anyone ever figured a way around this?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jul 2006
    Location
    USA
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: The Classic Duplicate Problem

    should've read the whole post...

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS 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)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: The Classic Duplicate Problem

    * object 1 is overlapping object 2
    : start loop "A" 100 times

    * on loop "A"
    + pick one of object 1
    + pick one of object 2
    + alterable value A of object 1 = 1
    + alterable value A of object 2 = 4
    + object 1 is overlapping object 2

    : do action

  4. #4
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: The Classic Duplicate Problem

    Seeing as MMF2 uses a subject "variable" to remember the Fixd Val of the subject I think it should expand to other values aswell.

    Also when choosing expressions then you should be able to define the type of object - e.g. "all" duplicates (standard), "nth" Duplicate, qualifier, or selected object "x".

    In the event editor you should be able to do things like:
    [color:blue]
    +Pick One "Object2" (use as chosen obj. "var1")

    +If Alterable Value A of "all" "Object1" (use as chosen obj. "var2") = Alterable Value B of "var1" "Object2" ("var1" of course)
    - Add one to Alterable B "Objecr2" "var1"
    - Subtract to Alt. A of "Object1" "var2"
    [/color]
    There might be a fatal flaw in logic when this loops

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export Module
    Ramses's Avatar
    Join Date
    Jul 2006
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: The Classic Duplicate Problem

    Quote Originally Posted by Popcorn
    * object 1 is overlapping object 2
    : start loop "A" 100 times

    * on loop "A"
    + pick one of object 1
    + pick one of object 2
    + alterable value A of object 1 = 1
    + alterable value A of object 2 = 4
    + object 1 is overlapping object 2

    : do action
    Thanks for the reply.

    The issue with that though, is that theoretically, it could go through the loop 100 times and still not randomly pick the right objects. The more duplicates, the greater the chance that would happen. One could just raise the number of loops to an extreme number but then it would really start to slow down the application especially if you have other fastloops going on.

  6. #6
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: The Classic Duplicate Problem

    fastloops have little effect on the speed below the 1000s

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export Module
    Ramses's Avatar
    Join Date
    Jul 2006
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: The Classic Duplicate Problem

    Quote Originally Posted by raytrace
    fastloops have little effect on the speed below the 1000s
    I don't know. Let's say you had 50 duplicates of object1 and 50 duplicates of object2. The probability of it picking the right ones isn't that good. Now let's say you had half of them overlapping each other in one event loop. In that case, there would be a good chance one would be missed every once in a while unless you really shot of the number of loops to 100000 or so. It's just not full proof is all I'm saying.

  8. #8
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: The Classic Duplicate Problem

    1) the code above is faulty because "pick one" can pick an object twice (you would have to spread an alterable value and compare it to the loop index)

    2) your problem can be solved easily by the below: [color:blue]

    + Object 1 Overlapping 2
    + Object 1 Val A = 1
    - Set Global Value A to Object fixed value

    + Object 2 Overlapping 1
    + Object 2 Val B = 4
    - Set Global Value B to Object2 fixed value

    + Object 1 Overlapping 2
    - Use fixed vals for expression
    [/color]
    is that what you want?

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export Module
    Ramses's Avatar
    Join Date
    Jul 2006
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: The Classic Duplicate Problem

    Sorry, maybe I should have gave a better example. What I mentioned in my first post is just a generic example of the problem with dealing with duplicates. Using global values wouldn't be helpful as some of the duplicates might be overlapping at the same time.

    Let me give a more specific example. Let's say you have a bunch of duplicates of ENEMY and a bunch of duplicates of PLATFORMCREATURE. Both of these objects walk around and have a basic custom platform movement behavior. The PLATFORMCREATUREs act as platforms that the ENEMYs can walk through, but if they are falling and land on a PLATFORMCREATURE they stop falling. And for the moment, let's not even worry about having the ENEMY object move along with the PLATFORMCREATURE when it's on top of it. We just want it to stop falling, when it lands on one. Also, let's make it so both objects are just 10x10 pixel solid squares and let's say we have 10 to 20 duplicates of each.

    Okay so during the Falling loop of ENEMY object you would have something like this:

    [color:#3333FF]
    + ALWAYS
    - Set Y position of ENEMY to Y position of ENEMY + 1


    + If ENEMY is overlapping PLATFORMCREATURE
    + Y position of ENEMY = Y position of PLATFORMCREATURE - 9
    - Set Y position of ENEMY to Y position of ENEMY - 1[/color]


    This doesn't work and is simplified, but it should illustrate what one would be trying to do. In this example, when it gets to "[color:#3333FF]If ENEMY is overlapping PLATFORMCREATURE[/color]", MMF only takes note of which ENEMY duplicate is overlapping PLATFORMCREATURE. So when it gets to "[color:#3333FF]Y position of ENEMY = Y position of PLATFORMCREATURE - 9[/color]", it won't necessarily check the Y position of the PLATFORMCREATURE duplicate that the ENEMY duplicate is overlapping. Using "Pick Object at random" wouldn't work well for you would have some of the ENEMYs falling through the PLATFORMCREATUREs from time to time. Using a "Pick objects with reference of their Value" within a fastloop wouldn't work either. This specific example is something I tried long ago, but never got it to work. There are a bunch of other things I've wanted to do, but wasn't able to due to way MMF handles events with duplicates.

Similar Threads

  1. Duplicate enemy problem
    By Ziplock in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 30th October 2013, 05:48 PM
  2. Problem with duplicate enemies matching ID with..
    By DaveC in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 27th July 2011, 11:50 AM
  3. duplicate enemies problem
    By AndyB in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 18th October 2009, 10:54 PM
  4. Problem with picking duplicate objects
    By Simon in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 28th March 2009, 12:41 AM
  5. Classic RPG Movement
    By Strider in forum File Archive
    Replies: 0
    Last Post: 4th February 2007, 01:10 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
  •