Skip to content

1123 use pathfinding in actual bot behavior #1129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Apr 15, 2025

Conversation

mFragaBA
Copy link
Contributor

@mFragaBA mFragaBA commented Mar 18, 2025

Motivation

On #1112 and #1119 we introduced a pathfinding module and used it on bot behavior but under a flag but we were not using it for anything relevant.

Closes #1123

Summary of changes

On this PR we remove the pathfinding flag and restore the pre-existing bot behavior (:move, track, attack) but consuming the pathfinding module instead of naively moving towards a direction.

Besides this, I noticed a bug by which the bot was never entering the :tracking_player state, this was because it was using the attack distance instead of the track distance.

Note

Dashing won't be used when tracking the player or moving for now as it adds complexity to pathfinding and path following. I openned an issue to re-introduce it but with another intention > #1137

Note

The bot state machine states are instant, we don't differenciate things to do when entering / exiting a state or behaviors to keep over the duration of a state (for example, when we attack we should wait at least until the character finished casting the attack before attempting to add new input > #1159. This is something the unity client already does). Also the back is not performing any validations regarding this, so it's possible for the bots to instantly cast multiple abilities which shouldn't be possible and also is not possible for the unity client > #1160

How to test it?

Start the backend locally. Either on the web client or on Unity (selecting localhost as the server), run a new game. Check that now bots can actually chase you down, though now they can attack (like before the pathfinding PoC changes).

Checklist

  • Tested the changes locally.
  • Reviewed the changes on GitHub, line by line.
  • This change requires new documentation.
    • Documentation has been added/updated.

@mFragaBA mFragaBA force-pushed the 1123-use-pathfinding-in-actual-bot-behavior branch 2 times, most recently from 8d6a2f9 to 96f112b Compare March 19, 2025 18:40
@mFragaBA mFragaBA force-pushed the 1123-use-pathfinding-in-actual-bot-behavior branch from 7a093fd to 0f03a51 Compare March 25, 2025 17:46
@mFragaBA mFragaBA marked this pull request as ready for review March 25, 2025 20:56
@mFragaBA mFragaBA marked this pull request as draft March 27, 2025 17:31
@mFragaBA
Copy link
Contributor Author

converted to draft until #1136 gets merged

@mFragaBA mFragaBA force-pushed the 1123-use-pathfinding-in-actual-bot-behavior branch from 412a89c to cd66994 Compare April 1, 2025 13:28
@mFragaBA mFragaBA force-pushed the 1123-use-pathfinding-in-actual-bot-behavior branch from ae46d35 to a7850ce Compare April 3, 2025 20:42
Copy link
Collaborator

@Nico-Sanchez Nico-Sanchez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's run some loadtests with current main and this branch before proceeding.

@mFragaBA
Copy link
Contributor Author

Let's run some loadtests with current main and this branch before proceeding.

Did the loadtests! Thanks for suggesting them. Results here: https://www.notion.so/lambdaclass/Loadtests-bots-with-pathfinding-10-04-2025-1d0b9462471380e086f1fc5071eac2ce

@Nico-Sanchez Nico-Sanchez merged commit e6bb209 into main Apr 15, 2025
1 check passed
@Nico-Sanchez Nico-Sanchez deleted the 1123-use-pathfinding-in-actual-bot-behavior branch April 15, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BOTS] - Pathfinding: do something useful with pathfinding in bots behavior
2 participants