diff --git a/home/minqlx-plugins/lgbot.py b/home/minqlx-plugins/lgbot.py index 11b0e43..28397a0 100644 --- a/home/minqlx-plugins/lgbot.py +++ b/home/minqlx-plugins/lgbot.py @@ -9,6 +9,9 @@ import random import time RUN_SPEED = 320 # QL ground run speed, units/s +# Ground friction takes ~25% of the velocity we set before the frame's move happens (measured: +# 288 set -> ~220 actual), so we set this much more to end up at the wanted speed. +FRICTION_COMP = 1.3 KEYS = ["strafe_min", "strafe_max", "fake", "range", "range_play", "speed"] LIMITS = {"strafe_min": (50, 2000), "strafe_max": (50, 2000), "fake": (0, 100), @@ -180,7 +183,7 @@ if minqlx: want = wanted_range(s, bot.health, target.health) vx, vy = steer((bpos.x, bpos.y), (tpos.x, tpos.y), direction, s, want) vel = bot.velocity() - bot.velocity(x=vx, y=vy, z=fix_z(vel.z)) + bot.velocity(x=vx * FRICTION_COMP, y=vy * FRICTION_COMP, z=fix_z(vel.z)) if self.debug: self.debug_line(now, vel, (vx, vy), tpos, bpos, want, direction)