User Tag List

Page 3 of 6 FirstFirst 1 2 3 4 5 ... LastLast
Results 21 to 30 of 56

Thread: Issue with horizontal collision with moving platform

  1. #21
    Clicker 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,300
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by schrodinger View Post
    From what I remember positions are updated correctly,
    it's "just" the collision mask used to detect overlaps that is not

    small proof:
    Attachment 22763

    (framerate is 1/sec)
    start of frame: object is positioned against other object coordinates, so the other object coordinates are correctly updated
    BUT (event 2) overlap is not detected until next frame
    Excellent. Thanks!

    Quote Originally Posted by schrodinger View Post
    X platform > X player - 200
    X platform < X player + 200
    Y platform > Y player - 200
    Y platform < Y player + 200
    >>> start foreach loop for platforms
    (so this would only cycle through platforms within range)
    I had no idea you could scope a foreach loop before it even began! Cool!




    I'm plugging away at those moving platforms. Slowly making progress. There are just so many factors. As well as straight player movement and platform movement, there's also: the player being half-on and hitting a wall (and being pushed back...but not remaining stuck to the wall when the platform hits it and changes direction), the player being squashed to death between a platform and a wall, the player stopping when her floor detector hits a moving platform....but somehow not stopping when the floor detector grazes past it when pressing against the platform and jumping, etc. etc. etc. It seems every time I get one piece of the puzzle working, another one somewhere else breaks. :/

  2. #22
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    646
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I personally broke down and made separate hitboxes for anything that will be pushing/pushed (player/platforms/blocks etc). These are then created and the old instances destroyed each time anything moves or is pushed via a "collision update" foreach loop, and collisions tested between the collision hitboxes instead of the actual base objects.

    You need to make sure that you create the collision objects exactly at the base object's position using the fusion 'create object' dialog. If you try to create an object out of frame intending to then position it or change its animation at all, it won't work because of the overlap delay. This is also why a single object containing different animations for each move-able object isn't possible.

    The solution is tedious, backwards, uses more objects, is really really stupid, and Clickteam needs to fix it. On the bright side: unless you have massive sprawling levels with many objects that need such precise collision (bullets will probably pose problems if you like bullet-hell-ish shooters) it shouldn't be that much of a hit performance-wise.

    Anyways, this is the only method i've found that works 100% of the time. Anything else i've tried either failed under certain circumstances or was far too complicated to be worth the effort. As far as i'm concerned, this is the method to beat the overlap bug. I don't know about you guys but if the delay bug is in Fusion 3 i'm personally washing my hands of it


    Very crude example: overlay delay workaround.mfa (You could make this perform better by only firing loops on objects that are flagged as "has moved since last frame", among other things)

  3. #23
    Clicker 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,300
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    Breaking down sounds about where I'm at, so I'll give your solution a go, casleziro

    But there are a couple of things about your mfa that I don't understand. It seems simple enough though, so probably my brain's a bit slow[er than usual] today.

    First, I'm confused as to why are we testing for "<>" here, rather than "="? Shouldn't "=" be necessary if we're trying to find whether the correct collider is overlapping the correct object?



    Also, if I move one of the objects in the frame editor before I run the MFA, both strings return "not overlapping". Looking through the events, I can't figure out why this would be.


    Actually, a third thing puzzles me. You're testing for collisions between a qualifier and an object that uses that same qualifier. Unless I'm mistaken, this doesn't actually work (I ran into this issue myself yesterday and did some searching on the forums about it). Sorry if I'm coming across as nitpicky here - I'm just trying to understand everything as well as possible. After banging my head against these issues for the past few days, I want to stay as on top of things as I can - I'm sure you understand


  4. #24
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    646
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    Breaking down sounds about where I'm at, so I'll give your solution a go, casleziro

    But there are a couple of things about your mfa that I don't understand. It seems simple enough though, so probably my brain's a bit slow[er than usual] today.

    First, I'm confused as to why are we testing for "<>" here, rather than "="? Shouldn't "=" be necessary if we're trying to find whether the correct collider is overlapping the correct object?

    Now that you mention it, using "< >" is pointless in this situation, and leftover code from my original test! You don't need it at all in that example. You would need to clarify that the Fixed ID is "=" to the base object if you had more than one of the base/collider, though. So thanks for pointing that out!


    Quote Originally Posted by Volnaiskra View Post
    Also, if I move one of the objects in the frame editor before I run the MFA, both strings return "not overlapping". Looking through the events, I can't figure out why this would be.
    I'm not sure I understand what the problem is there? Remember the objects are being moved 16 pixels towards each other, testing for collision, then moving back to their starting position in the same frame. The reason I have two strings in the first place was to test if both objects would register collision in the same frame cycle (thus proving the overlap delay bug was truly stamped out).


    Quote Originally Posted by Volnaiskra View Post
    Actually, a third thing puzzles me. You're testing for collisions between a qualifier and an object that uses that same qualifier. Unless I'm mistaken, this doesn't actually work (I ran into this issue myself yesterday and did some searching on the forums about it).
    An object can collide with another object using the same qualifier as long as you aren't trying to test both qualifiers against each other, or the same object against itself. You have to check for the individual object colliding against the group. Check this example here: colliding against object of same group.mfa

    It can cause some weird behavior when you try to test between duplicates of the same object, like in that example: try destroying Group.Good upon collision and both overlapping objects are destroyed! It's very useful with separate objects of the same group, though.

    EDIT: something that I just thought about too, that is related to the delay bug: Objects aren't destroyed immediately when you tell them to be. They are always destroyed at the end of frame cycle. I think PixelThief is the one who mentioned this a long time ago. A way to get around that is to use a flag or a value that marks the object as "destroyed", and then test if its flag is on/off in your conditions. I.E:

    -Object A overlaps Object B
    +Object B's Flag 0 is off (not destroyed)
    ---> do stuff

  5. #25
    Clicker 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,300
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by casleziro View Post
    I'm not sure I understand what the problem is there? Remember the objects are being moved 16 pixels towards each other, testing for collision, then moving back to their starting position in the same frame. The reason I have two strings in the first place was to test if both objects would register collision in the same frame cycle (thus proving the overlap delay bug was truly stamped out).
    Ah, I get it now. I misunderstood how the MFA was supposed to work.

    Quote Originally Posted by casleziro View Post
    An object can collide with another object using the same qualifier as long as you aren't trying to test both qualifiers against each other, or the same object against itself. You have to check for the individual object colliding against the group. Check this example here: colliding against object of same group.mfa
    Thanks for clearing that up*. When I tried it yesterday it seemed to not work, but that was clearly caused by some other unrelated bug in my programming.
    Quote Originally Posted by casleziro View Post
    It can cause some weird behavior when you try to test between duplicates of the same object, like in that example: try destroying Group.Good upon collision and both overlapping objects are destroyed!
    That seems like expected behaviour to me though. There are two Actives that meet that condition (are overlapping an 'apple'), therefore there are two objects that get deleted. Destroying "Active" instead of "group.Good" produces the same result:




    *Actually, while I was there, I tried both of these actions (one at a time, with the other inactivated), and they both also had the same result (both overlapping objects are destroyed, but the isolated third one remains). That would seem to contradict what we were saying earlier about how qualifiers can't overlap with themselves("as long as you aren't trying to test both qualifiers against each other, or the same object against itself")






    Quote Originally Posted by casleziro View Post
    EDIT: something that I just thought about too, that is related to the delay bug: Objects aren't destroyed immediately when you tell them to be. They are always destroyed at the end of frame cycle. I think PixelThief is the one who mentioned this a long time ago. A way to get around that is to use a flag or a value that marks the object as "destroyed", and then test if its flag is on/off in your conditions. I.E:

    -Object A overlaps Object B
    +Object B's Flag 0 is off (not destroyed)
    ---> do stuff
    Good point. I think what I'll do is I'll move the collision boxes to another (empty) layer just before I destroy them. That way they can't do any harm, since they can't collide with anything.

  6. #26
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    646
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    Thanks for clearing that up*. When I tried it yesterday it seemed to not work, but that was clearly caused by some other unrelated bug in my programming.
    That seems like expected behaviour to me though. There are two Actives that meet that condition (are overlapping an 'apple'), therefore there are two objects that get deleted. Destroying "Active" instead of "group.Good" produces the same result:




    *Actually, while I was there, I tried both of these actions (one at a time, with the other inactivated), and they both also had the same result (both overlapping objects are destroyed, but the isolated third one remains). That would seem to contradict what we were saying earlier about how qualifiers can't overlap with themselves("as long as you aren't trying to test both qualifiers against each other, or the same object against itself")

    I didn't know that

    I guess there's still a lot of quirks I need to figure out about Fusion.

    Feeling like my original example was kinda confusing, I made one as simple as possible. No qualifiers/IDs or anything, just two base objects, their colliders, and the solution. I added another frame without the workaround so you can see the delay bug in action. I really, really need to work on explaining things

    Example: simple overlap delay workaround.mfa


    Moving platforms can still be tricky, even after having this workaround. At least with the workaround, you can actually do things like "jump-through" platforms accurately (testing the bottom pixel of your player against the top pixel of the platform).

  7. #27
    Clicker 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,300
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by casleziro View Post
    Feeling like my original example was kinda confusing, I made one as simple as possible. No qualifiers/IDs or anything, just two base objects, their colliders, and the solution. I added another frame without the workaround so you can see the delay bug in action. I really, really need to work on explaining things

    Example: simple overlap delay workaround.mfa
    That's an excellent example! Both the problem and solution are clearly explained. I feel like whenever anyone asks about this issue on the forums from now on, we should just direct them to that post.


    Quote Originally Posted by casleziro View Post
    Moving platforms can still be tricky, even after having this workaround...
    That's what's so absolutely horrible about this bug. It takes an already complicated thing and adds an unnecessary layer of difficulty to it.

  8. #28
    Clicker 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,300
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    Finally! I'm getting somewhere. I still have some kinks to work out, but it's looking really promising. The destroy+recreate method is really solid and straightforward to use (I particularly like that I can have all my moving platform code in one place, whereas with the math-overlap-check method I had to split it up into before Spryke moves, during Spryke's movement, and after Spryke's movement, and keeping track of what was happening where was doing my head in.

    At this rate, I'll be ready to tackle vertically moving platforms soon! I haven't touched them since I gave up trying to get them to work 2 years ago . Their code is still sitting in an inactivated group in my MFA. Who knows, it might even work now that I know how to deal with the overlap bug (I didn't even know about the overlap bug back then - I just assumed it was my error).

    I've had a really frustrating few days, and I'm really grateful for the time and effort you guys put in to help me. Thanks shrodinger and casleziro!! I heartily bow to you in thanks.





  9. #29
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Thanks for the great example casleziro!

    And thanks for kind words Volnaiskra,
    I think your contribution is very useful around here by the way you seek and "unearth" details,
    going through all this pain pixel by pixel is making this thread very useful and interesting.

    Quote Originally Posted by Volnaiskra
    I particularly like that I can have all my moving platform code in one place, whereas with the math-overlap-check method I had to split it up
    Not sure of this, the two systems are two different method of testing an overlap,
    but both systems can be called to "validate" a movement situation with similar/same timings, I think?

    And I fear taking care of all those situations like getting stuck between platforms and walls etc.
    is going to be annoying hassle no matter what collision detection system is used
    (best solution is perhaps keeping moving platforms FAR from walls )

    For completeness, I've added the "math" option in casleziro example:

    simple overlap delay workaround_1.mfa

    To make it less intuitive (...) I've made it for multiple objects, and used some global values.
    So the code is a bit "longer" than it could be with just two objects,
    but I thought it could be an useful option to have.

    I don't see it much more impractical than the destroy-create system
    (also considering the destroy-delay casleziro already mentioned above),
    but I think the main disadvantage is that making the math-system work for non-rectangular collision masks would make it WAAAY more impractical than the destroy-create method!
    Anyway, for rectangular bounding boxes, I think checking coordinates is a fairly performant and overall "decent" method,
    so I guess it's worth consideration, depending on destination of use, as always, of course.

    Final positive note of this thread:
    I suspect we got another voice for the overlap bug to be finally banished in Fusion3

  10. #30
    Clicker 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,300
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by schrodinger View Post
    For completeness, I've added the "math" option in casleziro example:

    Attachment 22776

    Thanks for adding the math method to the MFA, shrodinger! That MFA should be well equipped to really help people out with this issue from now on.

    Quote Originally Posted by schrodinger View Post
    Not sure of this, the two systems are two different method of testing an overlap,
    but both systems can be called to "validate" a movement situation with similar/same timings, I think?..................I don't see it much more impractical than the destroy-create system
    (also considering the destroy-delay casleziro already mentioned above)
    Yes, technically you're right. And I didn't phrase myself well - what I said wasn't technically correct. However, in practice, at least in my particular case, the destroy/create system has been much simpler. The main reason is this: I already have robust, well-functioning code set up for collisions. Any time I add a new collidable object, it goes under the "physical object" qualifier, and I have pre-existing code to deal with, among other things:

    -what happens when the player lands on top of it
    -or jumps off it
    -or bumps into it from the side
    -or hits it from the underside
    -or hits it while floating in a bubble
    -or lands on it while still carrying inertia from a fast 'fling portal'
    -or derives some extra movement from it (eg. on a conveyor belt)
    -if a bullet hits it
    -etc.


    By 'fixing' the overlap bug, this method essentially turns my moving platforms into just another normal object, which for the most part, works perfectly with my pre-existing code. Also, I already use separate collision boxes for everything anyway, so that part of the destroy-create solution wasn't inconvenient to me.

    On the other hand, the math-system requires me to treat the moving platform as a special case, from start to end. Since the overlap bug remains 'unfixed', I need to remove the "physical object" qualifier from it, and instead I have to repeat, or at least supplement, pretty much all of the above bits of code. So, even though the math overlap check itself is relatively simple, I ended up having to make a whole bunch of new code, in various parts of my MFA, to slot the moving platform in with the rest of my code. I guess I wouldn't need to do this if I just used the math-overlap check for all objects, but that would be less convenient.

Page 3 of 6 FirstFirst 1 2 3 4 5 ... LastLast

Similar Threads

  1. Replies: 6
    Last Post: 2nd June 2015, 12:21 PM
  2. Horizontal Moving Platform using Platform Movement Object example
    By Warmachine in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 20th January 2015, 10:31 PM
  3. 2 Platform Movements overlapping on a moving platform
    By SuperDisk in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 2nd July 2013, 12:20 AM
  4. Moving Platform in Platform Movement Object
    By radel999 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 16th July 2012, 02:49 PM
  5. Horizontal moving platform
    By K1kk0z90 in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 23rd January 2011, 06:47 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
  •