The current basic "native pixel movement" requires you to shift positions by integer(s) at a time. This inaccuracy is problematic in a number of cases. Mainly, at higher frames-per-second, the minimum speed limit of 1p/t(pixel per tick) really noticeable. There are also obvious rounding issues with trig functions. They simply won't work with low speeds, causing you to only be able to move one of the 8 directions at rounded speeds. Using the "simple" Move(loc, dir, step_x + dx, step_y + dy) won't use BYOND's awesome pixel-perfect collision detection, where, if an object's bounding box intersects (or possibly even overshoots?) another, it is instantly pushed back.
What I ask for is the simplest fully-functional method that best uses BYOND's native pixel movement support while providing fractional displacements. Forum_account's technique is to build up the fractional parts and add the integer parts. Is there a simpler way that replaces less of BYOND's native functionality?
edit (30 Aug 2015):
The current simplest way I've found:
atom/movable
// position relative to the current pixel, between -0.5 and 0.5
var __dx, __dy
// sub-pixel movement along a translation vector
proc/Translate(Tx, Ty)
if(!(Tx || Ty)) return
// full-pixel movements
var rx = round(__dx + Tx, 1)
var ry = round(__dy + Ty, 1)
__dx += Tx - rx
__dy += Ty - ry
// change step_size only for this movement,
// gotta make it a slide instead of a jump
var s = step_size
step_size = 1 + max(abs(rx), abs(ry))
// move if we can, return success if we tried to move but didn't move a full pixel
. = (Tx || Ty) ? (rx || ry) ? Move(loc, dir, step_x + rx, step_y + ry) : TRUE : FALSE
step_size = s
proc/Project(Distance, Angle)
. = Distance && Translate(Distance*sin(Angle), Distance*cos(Angle))