Movement smoothness tweaks (#1736)

This PR ports /tg/'s movement verbs, which allow for smoother movement that's less dependent on server tick rate.

Also ports /tg/'s Stat() limiter, which reduces how often Stat() updates to reduce pointless server load.
This commit is contained in:
Lohikar
2017-02-11 15:36:02 +02:00
committed by skull132
parent 5aa2273625
commit e99ab0ae68
4 changed files with 80 additions and 40 deletions
+12
View File
@@ -610,3 +610,15 @@
server_greeting.find_outdated_info(src, 1)
server_greeting.display_to_client(src)
// Byond seemingly calls stat, each tick.
// Calling things each tick can get expensive real quick.
// So we slow this down a little.
// See: http://www.byond.com/docs/ref/info.html#/client/proc/Stat
/client/Stat()
. = ..()
if (holder)
sleep(1)
else
sleep(5)
stoplag()
+24
View File
@@ -514,3 +514,27 @@
if(Check_Shoegrip())
return 0
return prob_slip
// /tg/ movement procs
//The byond version of these verbs wait for the next tick before acting.
// instant verbs however can run mid tick or even during the time between ticks.
/client/verb/moveup()
set name = ".moveup"
set instant = 1
Move(get_step(mob, NORTH), NORTH)
/client/verb/movedown()
set name = ".movedown"
set instant = 1
Move(get_step(mob, SOUTH), SOUTH)
/client/verb/moveright()
set name = ".moveright"
set instant = 1
Move(get_step(mob, EAST), EAST)
/client/verb/moveleft()
set name = ".moveleft"
set instant = 1
Move(get_step(mob, WEST), WEST)