Bug Fix: Event Jitter / Display Rounding Error

Discussion in 'JS Plugin Releases (RMMV)' started by Archeia, Apr 9, 2019.

  1. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,538
    Likes Received:
    14,198
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    Some people mistake this for Screen Tearing or Character lag.



    Events and the tilemap were rounding extremely low values from "display_x" and "display_y" differently. The tilemap are always rounded up while characters/events are always rounded down.

    What do I mean by extremely low values? Because of the formula used to calculate scroll distance (2 ** @scroll_speed / 256.0) the display points can end up being values such as 15.5 pixels.

    As mentioned earlier, the tilemap would round this up to 16 while the events would round this down to 15. This would cause events to display 1 pixel away from where they were supposed to.

    Github Download
     
    #1
    kaine, Mojo907, TheTitan99 and 19 others like this.
  2. Doktor_Q

    Doktor_Q I'm not a real doktor, but I am a real Q Veteran

    Messages:
    573
    Likes Received:
    321
    Location:
    Denial
    First Language:
    English
    Primarily Uses:
    RMMV
    Just tried it out with a smooth scrolling plugin I had installed, works perfectly. This is incredibly helpful, thank you.
     
    #2
  3. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,826
    Likes Received:
    2,469
    First Language:
    Greek
    Primarily Uses:
    RMMV
    Wow. I remember this issue. Gee you were fast!!!!
     
    #3
  4. SwiftIllusion

    SwiftIllusion Veteran Veteran

    Messages:
    107
    Likes Received:
    180
    First Language:
    English
    YAY!
    Thank you sincerely so much, this was driving me crazy and another RPG Maker thing I thought I just had to deal with.
    There were a bunch of things I couldn't do/had to find workaround/looked bad because of that pixel difference, the most basic of those being when you needed events as stand-ins for an extra mapping layer but then it wouldn't align properly. Now it works :D
    Really so happy to have this fixed!

    Just a small question regarding who to add in credits, is that to you having converted it? or liquidize as in the plugin/original author? Or both.
     
    #4
  5. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,538
    Likes Received:
    14,198
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    I only really find bugs, isolate them and find why they happen, report them and test them in this case. NeonBlack was the one who originally found the fix and I just requested Liquidize to do it for MV as well. So I guess technically both of them haha.
     
    #5
  6. Drifter92

    Drifter92 Veteran Veteran

    Messages:
    114
    Likes Received:
    67
    First Language:
    English
    Primarily Uses:
    RMMV
    Oh wow! Thank you. My game feels so much better because of this! :D :D
     
    #6
  7. Shaz

    Shaz Veteran Veteran

    Messages:
    37,342
    Likes Received:
    11,142
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    This is for the quackguyver issue? Nice!
     
    #7
    Lonewulf123 likes this.
  8. TheTitan99

    TheTitan99 Veteran Veteran

    Messages:
    165
    Likes Received:
    65
    First Language:
    English
    Primarily Uses:
    RMMV
    This plugin fixes the off by 1 error in my extremely low res game I've been making. Events now match the ground!

    However, now the player character jitters by 1 pixel a ton when walking. When very zoomed out, it's not an issue, but my game is very, very low res, so even 1 pixel is very noticeable. Is this a known issue, or am I the only one getting it?
     
    #8
  9. bazrat

    bazrat Veteran Veteran

    Messages:
    166
    Likes Received:
    85
    Location:
    Washington State
    First Language:
    English
    Primarily Uses:
    RMMV
    I was having same issue, we had to turn it off :(

    We use altimits so i figured the issue was with it, since altimits is not friendly to many plugins
     
    #9
    TheTitan99 likes this.
  10. TheTitan99

    TheTitan99 Veteran Veteran

    Messages:
    165
    Likes Received:
    65
    First Language:
    English
    Primarily Uses:
    RMMV
    Alright, it's good to know it's not just me.

    I've turned off other plugins. This does seem to be an issue with this bug fix, that this fix causes the player sprite to jitter. I've attempted to fix it on my own, trying to locate where the off by 1 error is, adding Math.floor() to other functions to make rounding consistent throughout all code, but with no success.

    Hopefully someone with more coding knowledge than me can figure this one out, since this fix is unusable t me right now, due to the constant 1 pixel jittering on the main character. On a high res game, it's not noticeable. But on a super low res game, it is very, very noticeable and distracting.
     
    #10
  11. quackgyver

    quackgyver I make retro games for astrojone.com Veteran

    Messages:
    64
    Likes Received:
    21
    First Language:
    English
    Primarily Uses:
    RMMV
    What's the license for using this plugin? Can it be used freely in commercial projects?
     
    #11
  12. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,538
    Likes Received:
    14,198
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    I also had this same problem and it seems to be related on screen panning? The problem with MV tilemap is very deep and I honestly don't know how else to fix it :/
     
    #12
    TheTitan99 likes this.
  13. TheTitan99

    TheTitan99 Veteran Veteran

    Messages:
    165
    Likes Received:
    65
    First Language:
    English
    Primarily Uses:
    RMMV
    Well, hopefully a fix to this can be found at some time. As it stands right now, my super low res game just can't be made with the jittering.

    I do appreciate all the work everyone's put into this! I just know I can't continue work on my game unless this gets fully fixed, which is a shame, as MV is nice to work with.
     
    #13
  14. Elliott404

    Elliott404 RookieGameDev Veteran

    Messages:
    427
    Likes Received:
    1,025
    First Language:
    English
    Primarily Uses:
    RMMV
    Tbh, I'd rather have the actor gets all jittery if the events/doors, etc. stay in their places. Unless there is a fix for this minor issue, I wouldn't go against it.
     
    #14
  15. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,538
    Likes Received:
    14,198
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    There is a fix by FUKU that doesn't let both to happen:


    However, I noticed that RPG Maker camera is really painful to work with especially if you use pan screen. Even without the fixes or with the fix, the player can move jittery thanks to it. I recommend using stuff like @Galv's camera when you do panning shots instead as it's the only workaround I found that works nicely.
     
    #15
    Kaelan and Eliaquim like this.

Share This Page