ID:2544192
 
Resolved
The grace period before an icon's movement animation stops playing and the icon is considered non-moving again has been increased slightly, to prevent visual stutter in some higher-FPS games.
BYOND Version:513.1511
Operating System:Windows 7 Pro 64-bit
Web Browser:Chrome 80.0.3987.87
Applies to:Dream Seeker
Status: Resolved (513.1512)

This issue has been resolved.
Descriptive Problem Summary:
Whilst moving w pixel_movement in a hosted server, sometimes the non-moving states will flicker between frames.

Numbered Steps to Reproduce Problem:
Try walking on the testcase locally.
Whilst moving, the not-moving state won't flicker.

Try the walking on the testcase hosting it.
Whilst moving, sometimes the non-moving states will flicker between frames.

Code Snippet (if applicable) to Reproduce Problem:
https://www.sendspace.com/file/fopdbv

Expected Results:
Non-moving state not flicker between moving frames

Actual Results:
Non-moving state flickers between moving frames

Does the problem occur:
Every time? Or how often? Inconsistently between moves
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur? Never

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.) Not that I know of

Workarounds:
Not use pixel_movement
Gif showing it happen:


at first it didn't show when moving left
but after going right, it appeared
I do see this issue happening, but there's a slight problem of nomenclature here that's actually relevant to your problem: What you're using are pixel offsets, not pixel movement. Which is to say technically you do have pixel movement turned on, but you're not actually using it for the mob.

Pixel movement, to the engine, is defined as altering the step_x/y values. The pixel_x/y/w/z offsets are strictly visual. Thus the built-in glide code sees this strictly as tile movements.

I added features to the map to see how the movement works: a bunch of red turfs. What I noticed here is that your animation is all built around the idea that the player's mob will visually jump one tile at a time with no glide, because you've disabled tile gliding by including an object with off-tile bounds.

What I believe is happening is that because you're moving only once every four ticks because this is at 40 FPS, and therefore the client-side gliding code, although it's giving you a grace period to still consider the mob to be moving, isn't giving you quite as much of a grace period as you need. Slight timing differences between the client and server are enough to exceed that grace period. I can look into this more later on, but to be honest I'm kind of amazed it works most of the time, let alone all of the time in DS-only mode. This might be something I could fix by increasing the grace period.

What I did discover as a workaround however is that if you actually ditched all your pixel offset animations in Move(), and set world.fps to 10 while leaving client.fps at 40, the problem vanishes. Because of the nice even divisor, step gliding used to handle higher client.fps intervenes and you get flawless results even when hosting in DD.
In response to Lummox JR
The testcase is like that because I want to use pixel movement but still lock some atoms to the tile grid, like it is shown on the demo.

If you could increase that grace period I'd be more than happy :)

World.fps at 10 wouldn't work out for me unfortunately, since it wouldn't be as smooth as I want it to be.
Lummox JR resolved issue with message:
The grace period before an icon's movement animation stops playing and the icon is considered non-moving again has been increased slightly, to prevent visual stutter in some higher-FPS games.