ID:2195586
 
BYOND Version:511.1366
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 55.0.2883.87
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:

If glide_size is set to a partial-pixel value, the viewport renders considering these partial pixels. This causes ugly flickering on some icons:



#define TILE_WIDTH 16
#define TILE_HEIGHT 16
#define TICK_LAG 0.25

world
fps = 40
icon_size = 16

mob
appearance_flags = LONG_GLIDE
var
move_delay = 2.5

Move()
glide_size = TILE_WIDTH/move_delay*TICK_LAG
. = ..()


If I change the move_delay to 2, I get an integer glide_size:



Flickering disappears.

Rendering needs to round the excess so that it doesn't distort the rendering of graphics and induce anti-aliasing.
I always just assumed that was my eyes messing with me, because it happens in professional games on the SNES a lot too with similar patterns.

At least now I know I'm not insane...er than I already was.
I don't think this is a bug; more like it's a side-effect of the pixels not always moving at the same speed between every frame, and your monitor needing time to change the colors of each pixel.

Think of a square switching back and forth between black and white every frame. It would look appear a pretty consistent gray; more consistently so at higher framerates. Compare that with the square staying black for 2 frames and then white for 1 frame; it would look a bit darker on average and the flicker would be more apparent.

Also, you were warned in the glide_size reference page:
Be careful about using small step sizes. Icons with high contrast pixel-level detail can look pretty ugly when displaced by short distances.
In response to Kaiochao
Kaiochao wrote:
I don't think this is a bug; more like it's a side-effect of the pixels not always moving at the same speed between every frame, and your monitor needing time to change the colors of each pixel.

Also, you were warned in the glide_size reference page:
Be careful about using small step sizes. Icons with high contrast pixel-level detail can look pretty ugly when displaced by short distances.

This is the dumbest thing I've heard you say in a long, long time.
In response to Ter13
If you want proof, you could try splitting the gif into frames to see that the viewport's position is already being rounded and the pixels are not being distorted.
I don't think this is a bug; more like it's a side-effect of the pixels not always moving at the same speed between every frame, and your monitor needing time to change the colors of each pixel.

Okay, it is in fact an optical illusion, as your post edit alludes to. The way your post read before you edited it made what you said way off the mark.
Crap, I was right, I am insane. Thanks guys.
I think Kaiochao is right (at least post-edit), because internally everything gets rounded off once it comes time to display. This appears to be a function of the display not being vsynced. I think it's reasonable that I look into adding some kind of option for that.