Fractional Movement Speed

DumbPomelo

Villager
Member
Joined
Jun 2, 2019
Messages
20
Reaction score
1
First Language
English
Primarily Uses
RMVXA
I'd like to give player a slight boost in movement speed, among other things, to cut down time on backtracking.
However, setting speed to something uneven like "@move_speed = 4.2" causes their sprite to jitter back and forth a few pixels in direction of movement on occassion. Sometimes the pixel shift lingers even after movement is over, causing their graphic to be permanently displaced.

I was also using this bugfix snippet, and it made the effect much worse, the sprite now shakes during walking as if an earthquake is taking place.

Code:
##------
## Display rounding error fix created by Neon Black.
##
## When certain slow display panning speeds are used, events will improperly
## round floating values to determine their position on screen.  This causes
## them to appear off from the tilemap by a single pixel.  Though minor this is
## noticable.  This snippet fixes this behaviour.
##
## This snippet may be used in any project.
##
## -- Original Topic:
## http://forums.rpgmakerweb.com/index.php?/topic/17448-event-jitter-fix-display-rounding-error-fix
##------
class Game_Map ## Rounds X and Y display values DOWN so the nearest 32 is found.
  def display_x
    (@display_x * 32).floor.to_f / 32
  end
 
  def display_y
    (@display_y * 32).floor.to_f / 32
  end
 
  def adjust_x(x)
    if loop_horizontal? && x < display_x - (width - screen_tile_x) / 2
      x - display_x + @map.width
    else
      x - display_x
    end
  end
 
  def adjust_y(y)
    if loop_vertical? && y < display_y - (height - screen_tile_y) / 2
      y - display_y + @map.height
    else
      y - display_y
    end
  end
end

What can I try to remedy this before giving up and going back to 4 speed?
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
What can I try to remedy this before giving up and going back to 4 speed?
You cannot do it, at least not if you do not plan on messing up with the grid system. However, you should be able to do it with a pixel based movement system, but then you have to bear all the downsides that a pixel based movement system brings when it comes to events interaction and collisions.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,447
Members
137,820
Latest member
georg09byron
Top