Conversation
3dea09a to
b4406db
Compare
ReviewI read through Correctness / behaviour1. 2. 3. Dead-ending the tick when no legal warp exists. Both the cross-map branch and the new same-map branch 4. Consistency5. Two clocks in one class. 6. 7. Tests8. 9. Test 2 asserts the outcome only via position. Nits
Nothing here is a blocker for the core idea — items 1, 3 and 6 are the ones I'd want resolved before merge. Generated by Claude Code |
cdd9b4c to
0acf460
Compare
Re-review (head
|
What was wrong
Some maps, such as Dungeon and Lost Tower, contain several disconnected floors inside the same runtime map. When the party leader moved to another floor, a bot follower still considered the leader to be on the same map. It kept trying an impossible walking route and never considered using a warp gate to regroup.
There was a related problem when tracking whether the leader had settled after changing maps: map numbers are not unique enough to distinguish every runtime map instance.
What changed
The follow logic now treats these as two separate cases:
To choose that gate, the bot runs one flood fill from the leader across the walk map. This tells us which gate landing points are reachable and how far they are from the leader without running a separate A* search for every point of every gate. Among the usable gates, the bot chooses the one with the shortest worst-case landing distance.
Gate placement is random and
WarpToAsyncdoes not retry a bad landing point. For that reason, a gate is accepted only when every point that random placement may choose is walkable and can reach the leader. This is intentionally conservative: it avoids making follow behavior succeed or fail by chance. The gate containing the bot's current position is also skipped, so the bot cannot repeatedly warp back to the floor where it is already standing.If no suitable gate is found, the bot waits 20 seconds before doing another gate search. This backoff is separate from the normal warp cooldown: a failed search should not prevent unrelated warp behavior. The failed follow attempt also leaves the tick available for normal local hunting instead of making the bot idle.
Leader-settle and follow-warp timing now use
TimeProvider, which makes the cooldown behavior deterministic in server-side tests.Compatibility notes
ExitGateExtensions, including support for single-coordinate gates and validation of reversed bounds. For normal multi-coordinate gates it preserves the existing upper-exclusive random-placement behavior.Tests
The tests exercise the logic directly without a client or UI. They cover: