Smooth Tile Movement

by FIREking
A demo showing you how to achieve perfectly timed gliding for smoothest possible movement. [More]
To download this demo for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://FIREking.SmoothTileMovement##version=5

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://FIREking.SmoothTileMovement##version=5

1188 downloads
Version 5
Date added: Dec 1 2012
Last updated: May 20 2013
8 fans
A demo showing you how to achieve perfectly timed gliding for smoothest possible movement. Uses calculations based off of icon size and world.tick_lag to determine how long is necessary to wait for gliding to finish. Also shows you how to "transfer" movable atoms in this situation.

Version 5
-Fixed a timing issue with portals
-Fixed an accuracy problem
-Added robots to show how step() / NPC's use the same movement system for smooth movement

Version 4
-Updated move loop / step logic for better keyboard & wall-sliding handling

Version 3
-Changed how Move() uses functional procs
-Added proper keyboard / diagonal move / blocked wall sliding support
Version 2
-Changed transfers to set x, y, and z instead of using "loc = " because in multiplayer situations it could cause "black outs"
-Added WASD to control movement, just for fun.

Comments

1robib1: (Jul 28 2022, 1:08 am)
so "little" thing but i serch how to do it so much time, ty my friend its realy helped!

maybe someone can help me with 1 more thing about movement,
when i set world.fps = 40 and client.fps = 100, the movement look like robot, something that if i dont set the client fps is not hapnned, any idea how solve it?
if you ask why need 100 fps in client its cos i do a pvp rpg game and as i understand that good value to put, corecct me if i wroung
FIREking: (Jul 23 2014, 10:27 am)
LordAndrew wrote:
Just wanted to pop in and ask if there were any sort of terms of usage for this snippet. I'm especially fond of it and wanted to make sure I'm giving the right sort of credit to you for using it. Are you okay with potentially being used in commercial games as well?

I am giving permission for this code to be used for any purpose.
LordAndrew: (Jan 23 2014, 4:35 pm)
Just wanted to pop in and ask if there were any sort of terms of usage for this snippet. I'm especially fond of it and wanted to make sure I'm giving the right sort of credit to you for using it. Are you okay with potentially being used in commercial games as well?
Kboy33: (Jan 2 2014, 11:10 am)
I tried implementing this in my game, though when I include the code files, I can't move my character.

Any help?
FIREking: (Aug 2 2013, 9:12 am)
It is skipping with the number pad because the built-in procs that call client procs such as North() are not overridden (which means its trying to move outside of my system), adding this code will remove that...

client/North()
client/South()
client/East()
client/West()
client/Northwest()
client/Northeast()
client/Southwest()
client/Southeast()