From aff399e213f94def267772b35682897f51fd7be8 Mon Sep 17 00:00:00 2001 From: Peter Vaiko Date: Thu, 24 Apr 2025 06:21:42 -0400 Subject: [PATCH 1/2] feat: unloader alignment to moving combine Be more tolerant when aligning with a moving combine so we don't try to fix our position prematurely. --- scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua b/scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua index 05f8f5aad..484c6f620 100644 --- a/scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua +++ b/scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua @@ -1213,6 +1213,11 @@ function AIDriveStrategyUnloadCombine:isLinedUpWithPipe(dx, dz, pipeOffset, debu -- allow more offset when further away from the pipe, this is +- 50 cm at the pipe and grows -- 25 cm with every meter, which is about 30 degrees (15 left and 15 right) local tolerance = 0.25 + 0.5 * math.abs(dz) + local combineSpeed = self.combineToUnload.lastSpeedReal * 3600 + if combineSpeed > 6 then + -- when the combine is moving, we can be more tolerant as we'll have a lot more space to align + tolerance = 2 * tolerance + end self:debugIf(debugEnabled, 'isLinedUpWithPipe: dx > pipe offset +- tolerance (%.1f > %.1f +- %.1f) at dz: %.1f', dx, pipeOffset, tolerance, dz) return dx > pipeOffset - tolerance and dx < pipeOffset + tolerance From e16582d8181b0044b91d40866efe880cae23c1f0 Mon Sep 17 00:00:00 2001 From: Tensuko Date: Thu, 24 Apr 2025 19:29:30 +0200 Subject: [PATCH 2/2] more tolerance --- scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua b/scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua index 484c6f620..4dd685d7b 100644 --- a/scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua +++ b/scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua @@ -1212,7 +1212,7 @@ end function AIDriveStrategyUnloadCombine:isLinedUpWithPipe(dx, dz, pipeOffset, debugEnabled) -- allow more offset when further away from the pipe, this is +- 50 cm at the pipe and grows -- 25 cm with every meter, which is about 30 degrees (15 left and 15 right) - local tolerance = 0.25 + 0.5 * math.abs(dz) + local tolerance = 0.55 + 0.5 * math.abs(dz) local combineSpeed = self.combineToUnload.lastSpeedReal * 3600 if combineSpeed > 6 then -- when the combine is moving, we can be more tolerant as we'll have a lot more space to align