Update AutismBotIngame/python/ingamefollowct.py

This commit is contained in:
Metroid_Skittles 2026-02-07 08:08:01 +01:00
parent 15a8093138
commit 58afbe66af

View File

@ -113,35 +113,43 @@ def bot_process_movement(input_line):
def forward_burst(wait_ticks):
return f"+forward; wait {wait_ticks}; -forward; "
# Keep movement fluid: avoid frequent full stops.
should_push_forward = False
if state >= 3 or state == 1 or state == 8:
should_push_forward = True
if dist_target > team_follow_distance or enemy_distance <= enemy_chase_distance:
should_push_forward = True
if time.time() - last_forward_time < momentum_hold_seconds:
should_push_forward = True
is_aggressive_state = state >= 3 or state == 1 or state == 8
far_from_team = dist_target > team_follow_distance
enemy_close = enemy_distance <= enemy_chase_distance
enemy_very_close = enemy_distance <= infect_chase_distance
very_close_to_team = dist_target < (team_follow_distance * 0.35)
momentum_active = time.time() - last_forward_time < momentum_hold_seconds
if should_push_forward:
strInput += forward_burst(2)
# Decide one primary forward burst to avoid conflicting movement bursts in a single packet.
forward_ticks = 0
if far_from_team:
# Strong regroup push when separated from teammates.
forward_ticks = random.randint(min_forward_wait, max_forward_wait + 2)
elif enemy_close:
# Controlled chase pressure when enemy is in range.
forward_ticks = random.randint(min_forward_wait - 1, max_forward_wait - 1)
elif is_aggressive_state or momentum_active:
# Keep motion alive without overcommitting.
forward_ticks = 2
# Prevent overshooting teammates when no nearby threat.
if very_close_to_team and not enemy_close:
forward_ticks = min(forward_ticks, 2)
if forward_ticks > 0:
strInput += forward_burst(forward_ticks)
last_forward_time = time.time()
else:
strInput += "wait 2;"
#print('dist_target: ', dist_target, ' enemy distance: ', enemy_distance, ' targeteam: ', targeteam, ' state:', state)
if dist_target > team_follow_distance:
# Favor forward movement when drifting away from teammates.
strInput += forward_burst(random.randint(min_forward_wait, max_forward_wait))
elif enemy_distance <= enemy_chase_distance:
# Close enemy: keep pressure by closing distance.
strInput += forward_burst(random.randint(min_forward_wait, max_forward_wait))
if enemy_distance <= infect_chase_distance:
# Chase and attack at close range.
strInput += forward_burst(10)
strInput += "+attack; wait 20; -attack; "
if dist_target <= team_follow_distance:
# Keep subtle strafes to avoid robotic straight lines.
strInput = strinput_append(strInput, 2)
if enemy_very_close:
# Close-range commit with a short firing hold.
strInput += "+attack; wait 16; -attack; wait 4; "
if dist_target <= team_follow_distance and not enemy_very_close:
# Lighter, steadier strafes while maintaining formation.
strafe_pulses = 1 if very_close_to_team else 2
strInput = strinput_append(strInput, strafe_pulses)
if enemy_distance <= shoot_distance:
for _ in range(shoot_burst_cycles):
strInput += "+attack; wait 12; -attack; wait 4; "
@ -149,12 +157,18 @@ def bot_process_movement(input_line):
writeCfgInput(strInput)
def strinput_append(strInput, nth):
for _ in range(3 * nth):
boolean_val = random.choice([True, False])
if boolean_val:
strInput += " +moveleft; wait 15; -moveleft; "
if nth <= 0:
return strInput
direction_left = random.choice([True, False])
for _ in range(nth):
# Keep direction for a pulse to reduce jitter, occasionally switch.
if direction_left:
strInput += f" +moveleft; wait {random.randint(10, 16)}; -moveleft; "
else:
strInput += " +moveright; wait 15; -moveright; "
strInput += f" +moveright; wait {random.randint(10, 16)}; -moveright; "
if random.random() < 0.30:
direction_left = not direction_left
return strInput
def kill_user_owned_pid(pid):