User Tag List

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

Thread: Pseudo-3D Fixed-Camera Movement Engine- Collision Detection Issue

  1. #1
    Clicker Fusion 2.5 (Steam)
    LordRichTea's Avatar
    Join Date
    Apr 2020
    Location
    Norfolk, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pseudo-3D Fixed-Camera Movement Engine- Collision Detection Issue

    Morning all.
    This is my first post to this forum, to which I've been a reader for some time and have found some invaluable help with my project already.

    I am creating an adventure game based around static frames representing 3D "rooms" created with pre-rendered 3d objects imported as graphics and a 4-direction custom movement system which replicates the Z-axis by adjusting scales and vectors.
    However, to achieve a convincing effect of walking in a straight line in a square room, the forward/backward directions are skewed to an angle depending on the player's X-position in relation to the horizon "vanishing point", which is high up in the horizontal centre of the frame.
    The maths has been baffling so far considering I've learnt it as I've gone along.

    Physics Test.jpg

    Now, if you'll excuse the pun, I have run into a bit of a problem regarding collisions- particularly in the forward/backward direction due to the interference of the added skew towards the direction of the horizon vanishing point.
    I've drafted up a test frame demonstrating odd lines and objects as obstacles in order to fully test the collision system- nothing fancy and in a couple of scenarios, when attempting to go forward/backward I can get the player to move through objects in the opposite directions because the collision loop is triggering when the collision marker (a black oval) object is placed in a position where it is still overlapping the obstacle, due to the effect of the skew- because the angle is literally reversed to match the direction the player came from.

    Physics Test2.jpg

    Any help would be appreciated.
    Until I overcome this problem, I can't really progress with the rest of the game, as obviously movement is crucial to any game.
    I can try uploading the .mfa file on request.
    Images attachées Images attachées

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,307
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    My first thought is that if you can't detect the lines on the floor properly, you should break them into smaller segments to increase the fidelity of your collision. But it is a little hard to know the best solution without knowing how you are calculating and creating your 3D environment.

  3. #3
    Clicker Fusion 2.5 (Steam)
    LordRichTea's Avatar
    Join Date
    Apr 2020
    Location
    Norfolk, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have uploaded the .mfa file here:
    https://1drv.ms/u/s!Ap7eTtns-Ih3qCgM1rI6p03xqB_Z

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,307
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    It seems like you are not quite using fastloops correctly. You have a lot of redundant "Stop Loop" actions that are not needed. You only use a "Stop Loop" action INSIDE a fastloop. With that said, you already check if the detector is overlapping a backdrop within your movement loops. I would recommend adding in another check right after the movement event line (the one inside the fastloop) that check for the backdrop overlap. If there is an overlap, then you "back up" one step and then stop the fastloop. You also should be updating the ACTUAL X/Y Positions of the detector object to the variable inside the fastloop. This is the only way the detectors will update and actually be able to detect something inside the fastloop. I also noticed your collision detector shape for moving down is not the same as the other animation directions. You should probably keep them consistent.

    I have adjusted the up and down movement loop. It seems to have fixed the issue. i would do something similar to your other movement loops.

    https://drive.google.com/file/d/1Kiq...ew?usp=sharing

  5. #5
    Clicker Fusion 2.5 (Steam)
    LordRichTea's Avatar
    Join Date
    Apr 2020
    Location
    Norfolk, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for looking in to it.

    The collision detector is the same size in all directions, but I just included an arrow so that I could visibly see which way it was pointing to test when the problem was occurring.

    It would be fair to say that I'm probably putting "Stop Loop"s everywhere in order to attempt to curb the problem.
    I'm quite new to fastloops, as I originally envisaged using the standard 8-direction movement until I needed the speeds of X and Y directions to behave in different ways.

    I shall now go and have a play and analyse what you have done... Thanks for your swift assistance.

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,307
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    I fixed the down animation direction (24) in the mfa I posted. If you look at the one you posted, it is definitely a slightly different shape. But in the end, you really don't need to do that animation direction switching. Just use a single image for the detector. Fastloops take some time to get your head around, but you seem to be going in a good direction. Good luck.

  7. #7
    Clicker Fusion 2.5 (Steam)
    LordRichTea's Avatar
    Join Date
    Apr 2020
    Location
    Norfolk, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah. Well done.
    I have a feeling I may have tried resizing it inside one frame in the animation editor. That'll teach me for not checking!

    I see you've condensed the collision detection events so I no longer need so many events for both backdrop and active obstacles (good old OR(Logical) function).

    I have now amended the left/right events in the same fashion and it feels solid as a rock now.

    Just one other thing...
    Would there be a way of over-riding the skewed angle so that when the object collides going forward/back, the player would follow the nearest appropriate Y direction, rather than stop?
    If this is far too difficult to fathom, I may just leave it. It's only going to be a real problem when the player follows the line of the walls at the edges of the room.

  8. #8
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,307
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    You mean allowing the collider to slide along a wall when you walk against it diagonally?

  9. #9
    Clicker Fusion 2.5 (Steam)
    LordRichTea's Avatar
    Join Date
    Apr 2020
    Location
    Norfolk, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes! That's exactly what I mean.

  10. #10
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,341
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    I think you are going about this in completely the wrong way.
    You need to separate the movement engine from the visible sprites.
    You want to handle all movement, collisions and other interactions in two dimensions, using a pure top-down view - but keep it all invisible.
    Then you position your visible sprites using a simple a 3D projection - but those 3D sprites never directly interact with anything.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 27th November 2019, 08:25 AM
  2. Replies: 2
    Last Post: 16th October 2019, 10:40 PM
  3. Physic Engine collision detection complex shapes
    By GX01_RX in forum Fusion 2.5
    Replies: 2
    Last Post: 11th April 2019, 07:07 PM
  4. overlap (custom collision detection) issue
    By Hamcraft in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 26th May 2011, 02:08 PM
  5. Another collision detection issue...
    By fawfulfan in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 24th August 2009, 08:22 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
  •