From 88ce3ff47c84073327984d63f993b925b58a9b99 Mon Sep 17 00:00:00 2001 From: Alberyk Date: Sun, 19 Jul 2020 22:40:44 -0300 Subject: [PATCH] Revert "Adds glide_size to atom_movable and removes tickcomp (#9373)" (#9402) Either the pr is not working or I did something wrong on my side. --- code/controllers/configuration.dm | 4 ++++ code/game/atoms_movable.dm | 1 - code/modules/admin/verbs/ticklag.dm | 4 ++++ code/modules/clothing/spacesuits/rig/rig.dm | 7 ++++++- code/modules/mob/mob_movement.dm | 6 ++++++ config/example/config.txt | 3 +++ 6 files changed, 23 insertions(+), 2 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index f44f11072f3..a5a59b3fc63 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -45,6 +45,7 @@ var/list/gamemode_cache = list() 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/Ticklag = 0.4 + var/Tickcomp = 0 var/antag_hud_allowed = 0 // Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round. var/antag_hud_restricted = 0 // Ghosts that turn on Antagovision cannot rejoin the round. var/list/mode_names = list() @@ -659,6 +660,9 @@ var/list/gamemode_cache = list() if("antag_hud_restricted") config.antag_hud_restricted = 1 + if("tickcomp") + Tickcomp = 1 + if("ipc_timelock_active") ipc_timelock_active = TRUE diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 6fd4792f02f..3e9fd970306 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -1,6 +1,5 @@ /atom/movable layer = 3 - glide_size = 8 var/last_move = null var/anchored = 0 var/movable_flags diff --git a/code/modules/admin/verbs/ticklag.dm b/code/modules/admin/verbs/ticklag.dm index eaed465be6c..6b844ece5e6 100644 --- a/code/modules/admin/verbs/ticklag.dm +++ b/code/modules/admin/verbs/ticklag.dm @@ -14,5 +14,9 @@ message_admins("[key_name(src)] has modified world.tick_lag to [newtick]", 0) world.tick_lag = newtick feedback_add_details("admin_verb","TICKLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + switch(alert("Enable Tick Compensation?","Tick Comp is currently: [config.Tickcomp]","Yes","No")) + if("Yes") config.Tickcomp = 1 + else config.Tickcomp = 0 else to_chat(src, "Error: ticklag(): Invalid world.ticklag value. No changes made.") diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index e48f31db386..00300849628 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -903,10 +903,15 @@ // AIs are a bit slower than regular and ignore move intent. wearer_move_delay = world.time + ai_controlled_move_delay + var/tickcomp = 0 + if(config.Tickcomp) + tickcomp = ((1/(world.tick_lag))*1.3) - 1.3 + wearer_move_delay += tickcomp + if(istype(wearer.buckled, /obj/vehicle)) //manually set move_delay for vehicles so we don't inherit any mob movement penalties //specific vehicle move delays are set in code\modules\vehicles\vehicle.dm - wearer_move_delay = world.time + wearer_move_delay = world.time + tickcomp return wearer.buckled.relaymove(wearer, direction) if(istype(wearer.machine, /obj/machinery)) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 468fc48b6ba..9b374c83d55 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -304,6 +304,12 @@ move_delay += tally + var/tickcomp = 0 //moved this out here so we can use it for vehicles + if(config.Tickcomp) + // move_delay -= 1.3 //~added to the tickcomp calculation below + tickcomp = ((1/(world.tick_lag))*1.3) - 1.3 + move_delay = move_delay + tickcomp + if(istype(mob.machine, /obj/machinery)) if(mob.machine.relaymove(mob,direct)) return diff --git a/config/example/config.txt b/config/example/config.txt index 3e3c202096d..5310ce11c59 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -293,6 +293,9 @@ ALLOW_HOLIDAYS ##Defines the ticklag for the world. 0.33 (30 FPS) is the normal one, though you can go as low as 0.2 (50 FPS) for low-load servers. TICKLAG 0.33 +## 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. +#TICKCOMP + ## Uncomment this to activate the five day from character creation timelock on modifying IPC tags #IPC_TIMELOCK_ACTIVE