lgbot: friction boost on the ground only

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
esefandClaude Opus 5.5 committed 2026-10-15 14:40:14 +03:00
1 parent dc8409f872
commit 696d2f2dad
2 files changed
+5 -3

No files matched your search

+4 -2
View File
@@ -10,7 +10,8 @@ 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.
# 288 set -> ~220 actual), so on the ground we set this much more to end up at the wanted speed.
# In the air there is no friction, so no boost (vertical speed 0 = on the ground, near enough).
FRICTION_COMP = 1.3
KEYS = ["strafe_min", "strafe_max", "fake", "range", "range_play", "speed"]
@@ -183,7 +184,8 @@ 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 * FRICTION_COMP, y=vy * FRICTION_COMP, z=fix_z(vel.z))
comp = FRICTION_COMP if abs(vel.z) < 1 else 1.0
bot.velocity(x=vx * comp, y=vy * comp, z=fix_z(vel.z))
if self.debug:
self.debug_line(now, vel, (vx, vy), tpos, bpos, want, direction)