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

1009 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

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()


Shadowwulf: (Aug 2 2013, 6:26 am)
I am more than willing to accept that I am having trouble learning to use this engine, but I can't seem to undertand how to implement this.

Even just taking the demo as is, the skipping and jumping is present. I thought it was something I added or changed or how I was using it.

Just using the WASD movement it's great I can't make it skip no matter how hard I try.
Using numpad, diagonal skips every step when held.

It boggles me that the if the system can already see that mobs/objs are size X and have a step size of X, why it doesnt check that the transfer is done before trying again.

I really like this engine but sometimes it's the simple things that give me the biggest headache!