From 7dc9be74dbc2430d147439513f00291d80a5d796 Mon Sep 17 00:00:00 2001 From: Tino Date: Mon, 13 Jan 2025 22:44:01 +0700 Subject: [PATCH] Pathfinding: Increase timeout when activating Surf (#618) I've given the pathfinding algorithm 270 extra frames for waypoints that require activating Surf before triggering a pathing timeout for not having moved tiles for a while. I don't remember how I chose that particular number, but it caused some issues for me on Emerald where the timeout got triggered before the bot was done starting to surf. I've increased that limit to 300 frames and now it works. Oh well. --- modules/modes/util/walking.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/modes/util/walking.py b/modules/modes/util/walking.py index 09194c36..5843006a 100644 --- a/modules/modes/util/walking.py +++ b/modules/modes/util/walking.py @@ -155,6 +155,7 @@ def follow_waypoints(path: Iterable[Waypoint], run: bool = True) -> Generator: current_position = get_map_data_for_current_position() last_waypoint = None for waypoint in path: + print(waypoint) # For the first waypoint it is possible that the player avatar is not facing the same way as it needs to # walk. This leads to the first navigation step to actually become two: Turning around, then doing the step. # When in tall grass, that could lead to an encounter starting mid-step which messes up the battle handling. @@ -170,7 +171,7 @@ def follow_waypoints(path: Iterable[Waypoint], run: bool = True) -> Generator: if waypoint.is_warp: frames_remaining_until_timeout += extra_timeout_in_frames_for_warps if waypoint.action is WaypointAction.Surf: - frames_remaining_until_timeout += 270 + frames_remaining_until_timeout += 300 elif waypoint.action is WaypointAction.Waterfall: frames_remaining_until_timeout += 195 + (get_player_location()[0][1] - waypoint.coordinates[1]) * 42