ID:138074
 

Smooth Movement!

(What, you didn't think it was something else, did you?)

Last night, an idea dawned on me; if layers are server-based, but transmitted to the client, who maintains them, why not have smooth movement the same way?

Let's assume that all /atom/movable objects have a movement_frames var. Every object on the client's viewscreen has a smooth movement variable that, when an object comes into view, the client asks the server for what that object's movement_frames is.

-1 = adaptive speed (current behaviour)
0 = no smooth movement
1 = 1 frame between the turfs
2 = 2 frames between the turfs
3 = 3 frames between the turfs
4 = 4 frames between the turfs
n = n frames between the turfs


By default, all /atom/movable objects have a movement_frames of -1. If someone wants fine control over the movement speed, they can always override it themself.

Thus, from a programming standpoint, there are two variables per object in view that the client keeps track of; whatever variable you are currently using (for the adaptive speeds) and an additional variable to determine the base speed. Normally, the adaptive variable would be the same as the base variable if the movement_frames was not -1. If movement_frames is -1, it behaves the exact same as it currently does.

If someone wants more control over smooth movement, every time movement_frames is modified it transmits that data to the client; thus, midstream, the server could alternate between 2 frames and three frames, to get an average of 2.5 frames per move.


How's that for an idea?! =)