User Tag List

Results 1 to 10 of 10

Thread: Movement Engine Problems

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Oct 2006
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Movement Engine Problems

    http://srpgp.supersanctuary.net/STEmerald1.mfa

    Using MMF2 Standard.

    I got a few problems with a couple ways MMF works and I was hoping to see about some work arounds here. See, my aim is to develop an engine similar to this: http://www.youtube.com/watch?v=kujlUSVP5fQ

    But...as you can see I have a few problems. Firstly, the detector objects are not fast enough, upon using shift to speed up, you will go through walls because they lag behind the mask. I've tried using loops but they don't work...they used to in MMF1.5 so I have no clue what's wrong.

    Secondly, I can't seem to fit the mask into single tile wide gaps, the whole engine runs off of a 32x32 tile based grid but the detectors reach out too far to allow it to fit in these gaps. Thing is, if I retracted the detectors to allow it to do this, then I would be having lots of instances of the mask going straight through walls.

    Finally, movement up and down wise doesn't seem very smooth. When moving up or down JUST before you hit a wall, the mask jitters as it hits the wall. That's nothing more than cosmetic though.

    If anyone is willing to help please do so. Thanks in advance.

  2. #2
    No Products Registered

    Join Date
    May 2007
    Location
    Alaska
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement Engine Problems

    I don't know how much this will help but I took a look at it and made some changes.

    downlaod new source here
    http://jsonicserver.no-ip.org/files/1/STEmerald1.mfa

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Oct 2006
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement Engine Problems

    I hate to say it but that really only makes things worse.

    I avoided using bounce because the player is only supposed to move left and right automatically. If corners collide (which is a lot more likely to happen than you'd think) then the ball movement starts moving the player up and down or worse....diagonally! That's not supposed to happen.

    Second, if I restore my old method of "bouncing", i.e. I use change direction instead, it doesn't work period. Nothing else was fixed.

    Sorry.

  4. #4
    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: Movement Engine Problems

    I'd investigate using fastloops again. Start a "horizontal movement" fastloop X number of times depending on how fast you want the player to move, and move the player and detectors 1 pixel per loop. When a collision is detected, stop the loop.

    The problem of detectors lagging behind the mask doesn't sound like something that using loops should fix... instead, it's important that the detectors are moved to the player's position after all player movement has been done in the event list.

  5. #5
    Clicker Multimedia Fusion 2

    Join Date
    Oct 2006
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement Engine Problems

    That might work but if you stop the loop, you stop moving. How would you bounce off walls? How would you keep moving if you couldn't move the player off the wall?

    And I've tried that, honestly, it doesn't work. Especially when player movement relies on MMF's movement and not on movement from the events list.

  6. #6
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement Engine Problems

    To bounce, instead of stopping the loop, just reverse the players direction and let it keep going.

  7. #7
    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: Movement Engine Problems

    I'd probably scrap the MMF internal movement and rely totally on events for this. To bounce off walls you would stop the loop, then set the value that controls how many times to loop to the negative of its current value, reversing the direction of movement.

    This thread shows a continual left-right movement using fastloops (it also has bouncing due to gravity, but your game doesn't seem to need that so you can probably ignore it).

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=37931

  8. #8
    Clicker Multimedia Fusion 2

    Join Date
    Oct 2006
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement Engine Problems

    Hmm, it works for you but for some reason, it just doesn't want to cooperate with me...

    When I use it, the engine just totally bugs out on me. For one, about 80% of the time the mask will get "stuck" inside a wall, forever trying to get out and failing. It constantly bounces back and forth inside the wall.

    Second, no matter what starting value I choose, the speed of it is always different. Sometimes the mask will zoom around at such amazing speeds like it's Road Runner basically ignoring all collisions, causing it to zip off the window's edge within the first second the app is started. Other times it will refuse to go any faster than a snail's pace. This is strange to me...totally goes against all logic. I'm not sure if this is my shoddy coding or just MMF being weird on me so I was hoping someone could look at the source with DavidN's movement engine sorta plastered on, and see if it does the same to them.

    http://srpgp.supersanctuary.net/STEmerald2.mfa

  9. #9
    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: Movement Engine Problems

    I got the chance to take a look at this again this morning - I've gone through and made some changes, commenting them to let you see what's going on.

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=41904

    The problem you had with the speed was because there was still a Bouncing Ball movement on the object, and depending on whether that went left or right at first, it counteracted or worked with the movement you had in the event editor - so that was why you were seeing different speeds.

    Otherwise, you were nearly there with the fastloops for horizontal movement. The shape-changing detectors for different directions were a clever idea, but fastloops get around the problem by checking on every pixel anyway, so I replaced them with one-pixel-wide ones. With fastloops, you'll notice you can bump the speed up to massive levels without it failing into walls - I've left it at 8 in the upload.

    To complete the movement, fastloops should also be used for the vertical movement, in much the same way as the horizontal - move 1 pixel X amount of times, and pull it back if that results in it going into a wall.

  10. #10
    Clicker Multimedia Fusion 2

    Join Date
    Oct 2006
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement Engine Problems

    I could have sworn I took that movement off! Ahh, I guess even great minds have their faults. =P

    Anyhow, thank you, I'll get to looking at this soon but from what I can tell, this should pretty much be it and I can finally continue on with it. Thanks!

Similar Threads

  1. Platform engine problems
    By brett in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 17th December 2011, 05:23 PM
  2. Problems with my engine.. example enclosed
    By Redsquirrel in forum File Archive
    Replies: 6
    Last Post: 18th May 2011, 04:38 PM
  3. Problems with my engine.. example enclosed
    By Redsquirrel in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 18th May 2011, 04:36 PM
  4. For "Movement Engine Problems" thread - fastloops
    By DavidN in forum File Archive
    Replies: 0
    Last Post: 23rd May 2007, 03:29 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
  •