From 3f40e58929dcfc50b74103e8ea490a32fd7d94e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Tue, 10 Dec 2013 00:03:52 +0100 Subject: [PATCH] increased suck and drop delays on robot; taking into account the tick that's "lost" by requiring the server thread to resume the robot in the delays to get the effective delay right (was one tick more than set in the config) --- li/cil/oc/Settings.scala | 16 +++++++++------- reference.conf | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/li/cil/oc/Settings.scala b/li/cil/oc/Settings.scala index 6ff0e98d8..e4d5daa6c 100644 --- a/li/cil/oc/Settings.scala +++ b/li/cil/oc/Settings.scala @@ -70,13 +70,15 @@ class Settings(config: Config) { // ----------------------------------------------------------------------- // // robot.delays - val turnDelay = config.getDouble("robot.delays.turn") max 0.05 - val moveDelay = config.getDouble("robot.delays.move") max 0.05 - val swingDelay = config.getDouble("robot.delays.swing") max 0 - val useDelay = config.getDouble("robot.delays.use") max 0 - val placeDelay = config.getDouble("robot.delays.place") max 0 - val dropDelay = config.getDouble("robot.delays.drop") max 0 - val suckDelay = config.getDouble("robot.delays.suck") max 0 + // Note: all delays are reduced by one tick to account for the tick they are + // performed in (since all actions are delegated to the server thread). + val turnDelay = (config.getDouble("robot.delays.turn") - 0.06) max 0.05 + val moveDelay = (config.getDouble("robot.delays.move") - 0.06) max 0.05 + val swingDelay = (config.getDouble("robot.delays.swing") - 0.06) max 0 + val useDelay = (config.getDouble("robot.delays.use") - 0.06) max 0 + val placeDelay = (config.getDouble("robot.delays.place") - 0.06) max 0 + val dropDelay = (config.getDouble("robot.delays.drop") - 0.06) max 0 + val suckDelay = (config.getDouble("robot.delays.suck") - 0.06) max 0 val harvestRatio = config.getDouble("robot.delays.harvestRatio") max 0 // ----------------------------------------------------------------------- // diff --git a/reference.conf b/reference.conf index 23c2c6b8e..ad53d769b 100644 --- a/reference.conf +++ b/reference.conf @@ -291,11 +291,11 @@ opencomputers { # The time in seconds to pause execution after an item was # successfully dropped from a robot's inventory. - drop: 0.3 + drop: 0.5 # The time in seconds to pause execution after a robot successfully # picked up an item after triggering a suck command. - suck: 0.3 + suck: 0.5 # This is the *ratio* of the time a player would require to harvest a # block. Note that robots cannot break blocks they cannot harvest. So