diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index c1f5275917b..ff6f803f5f0 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -37,6 +37,7 @@ var/allow_Metadata = 0 // Metadata is supported. var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. var/fps = 10 + var/Tickcomp = 0 var/allow_holidays = 0 //toggles whether holiday-specific content should be used var/hostedby = null @@ -309,6 +310,8 @@ fps = 10 / ticklag if("fps") fps = text2num(value) + if("tickcomp") + Tickcomp = 1 if("automute_on") automute_on = 1 if("comms_key") diff --git a/code/modules/admin/verbs/fps.dm b/code/modules/admin/verbs/fps.dm index 7e49860b1c9..b243d3d2259 100644 --- a/code/modules/admin/verbs/fps.dm +++ b/code/modules/admin/verbs/fps.dm @@ -15,7 +15,11 @@ if(alert(src, "You are setting fps to a high value:\n\t[fps] frames-per-second\n\tconfig.fps = [config.fps]","Warning!","Confirm","ABORT-ABORT-ABORT") != "Confirm") return - var/msg = "[key_name(src)] has modified world.fps to [fps]" + switch(alert("Enable Tick Compensation?","Tick Comp is currently: [config.Tickcomp]","Enable","Disable")) + if("Enable") config.Tickcomp = 1 + else config.Tickcomp = 0 + + var/msg = "[key_name(src)] has modified world.fps to [fps] and config.Tickcomp to [config.Tickcomp]" log_admin(msg, 0) message_admins(msg, 0) feedback_add_details("admin_verb","TICKLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 6e2aac8909e..d65438f65e7 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -136,6 +136,12 @@ if(isturf(mob.loc)) + + var/turf/T = mob.loc + move_delay = world.time//set move delay + + move_delay += T.slowdown + if(mob.restrained()) //Why being pulled while cuffed prevents you from moving for(var/mob/M in range(mob, 1)) if(M.pulling == mob) @@ -146,13 +152,6 @@ else M.stop_pulling() - //We are now going to move - moving = 1 - move_delay = 0 - - var/turf/T = mob.loc - move_delay += T.slowdown - switch(mob.m_intent) if("run") if(mob.drowsyness > 0) @@ -160,12 +159,18 @@ move_delay += config.run_speed if("walk") move_delay += config.walk_speed - move_delay += mob.movement_delay() - //Something with pulling things //This really needs to be redone by someone, NOT ME THOUGH HA HA! + if(config.Tickcomp) + move_delay -= 1.3 + var/tickcomp = (1 / (world.tick_lag)) * 1.3 + move_delay = move_delay + tickcomp + + //We are now going to move + moving = 1 + //Something with pulling things if(locate(/obj/item/weapon/grab, mob)) - move_delay = max(move_delay, 7) + move_delay = max(move_delay, world.time + 7) var/list/L = mob.ret_grab() if(istype(L, /list)) if(L.len == 2) @@ -195,22 +200,6 @@ M.animate_movement = 2 return - var/ticks = Ceiling(move_delay / world.tick_lag) - if(ticks <= 0) - ticks = 1 - var/target_glide_size = world.icon_size / ticks - - glide_size = target_glide_size - mob.glide_size = target_glide_size - - //byond floor()'s glide_size, we want it to Ceiling(), - //but we don't want it to Ceiling() if they fix it to accept floating point numbers - if(glide_size != target_glide_size) - glide_size = Ceiling(target_glide_size) - mob.glide_size = glide_size - - move_delay += world.time - 0.0001 //Ensure we're on the right tick even if there's rounding errors - if(mob.confused && IsEven(world.time)) step(mob, pick(cardinal)) else @@ -220,6 +209,8 @@ if(mob && .) mob.throwing = 0 + return . + ///Process_Grab() ///Called by client/Move() diff --git a/config/config.txt b/config/config.txt index a85392e1543..6f12881387b 100644 --- a/config/config.txt +++ b/config/config.txt @@ -145,6 +145,9 @@ ALLOW_HOLIDAYS ##Defines the ticklag for the world. 0.9 is the normal one, 0.5 is smoother. TICKLAG 0.9 +## Defines if Tick Compensation is used. It results in a minor slowdown of movement of all mobs, but attempts to result in a level movement speed across all ticks. Recommended if tickrate is lowered. +TICKCOMP 0 + ## Comment this out to disable automuting #AUTOMUTE_ON