User Tag List

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

Thread: compensation the diagonal movement speed

  1. #1
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)
    ASD's Avatar
    Join Date
    Feb 2007
    Location
    Japan
    Posts
    1,853
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    Question compensation the diagonal movement speed

    I created 8 direction movement event for compensation the diagonal movement speed.
    However, the object will trembling when moving diagonal direction.

    How I do to smooth diagonal movement keep compensation diagonal movement speed?

    Attached files Attached files

  2. #2
    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)
    Are you using your own createdmovement, or are you modifying the built in one?

    EDIT: nevermind

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You really should be using fastloops for accurate movement. Also you are setting the x and y positions a LOT during your events but at the bottom you have an Always event that is setting the x and y position to alterable A and B anyway, so it's overriding all of those other set positions... To me it just seems like a lot of unneeded actions.

  4. #4
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)
    ASD's Avatar
    Join Date
    Feb 2007
    Location
    Japan
    Posts
    1,853
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)
    @Konidias Could you send me example?

  5. #5
    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)
    Are fast loops realy nessesary for this?

    Couldnt one just use built in 8 directional, and modify the speed for the diagonal directions?

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,398
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Nope (to the first question) - the only reason for using fastloops in a custom movement would be if you needed to check for collisions after each step. Otherwise it's just pointless and inefficient.
    I could be wrong, but I think built-in movements only support integer speeds, and anyway they suck.

    Anyway, the cause of the problem is very hard to explain, (it's to do with the fact that you're using sub-pixel positioning so the line doesn't pass through the centre of each pixel, and since you don't draw every pixel the line passes through, you end up with a jagged line).
    jitter.jpg

    The simplest fix I can think of right now, is to lock the object's position to the nearest pixel (integer) whenever it changes direction.
    eg. http://sdrv.ms/14sZAHk

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    MuddyMole, I wouldn't dismiss fastloops so quickly. they are far more accurate and result in the best possible movement/collision that you're going to get. It's hard to argue otherwise. Also I don't like the stigma that all fastloops are inefficient... You are not going to see frame drops with less than 30 simple fastloop events per tick.

  8. #8
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,398
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Konidias View Post
    MuddyMole, I wouldn't dismiss fastloops so quickly. they are far more accurate and result in the best possible movement/collision that you're going to get
    More accurate collision detection, yes - but that's all. What ASD is doing doesn't require collision detection, so there is absolutely no advantage to using fastloops.

  9. #9
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Pineapple's Avatar
    Join Date
    Oct 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's a fixed up version that uses trigonometry for the movement.
    The jittery line issue will appear if you press more than 2 directional arrows at once, but otherwise, it works fine.diagonal_movement2.mfa

  10. #10
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)
    ASD's Avatar
    Join Date
    Feb 2007
    Location
    Japan
    Posts
    1,853
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)
    @Pineapple Nice example! But, I'm making game using Joystick 2 extension. It not have immediate condition (I can't make line no.4 event in your file.).
    Can you modify the event without immediate condition?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. diagonal platform movement without PMO
    By ac3raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 9th August 2011, 11:45 AM
  2. Method of correcting speed when diagonal moving
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th March 2010, 02:13 PM
  3. Custom movement diagonal help
    By Ralucard in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st November 2007, 10:53 PM
  4. Associative Array=bad compensation for datastores?
    By integrality in forum Extension Development
    Replies: 7
    Last Post: 28th July 2006, 01:01 PM
  5. compensation for datastore objects
    By integrality in forum Extension Development
    Replies: 15
    Last Post: 25th July 2006, 10:24 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
  •