Skip to content

Bot/pathfinding optimizations

Ceikry requested to merge pathing-fixes into master

What have you done in this MR?

  • Refactored components of the ScriptAPI to more efficiently utilize pathfinding
  • Implemented a global limit on pathfinding distance (server.max_pathfind_dist)
  • Pathfinding limit is enforced at the packet level as well as elsewhere (ContentAPI, etc)
  • Rudimentary profiling showed that average tick time had reduced by roughly 65%

Testers:

  • The current limit on pathfinding is 25 tiles (5 tiles more than authentic!)
  • You should be able to click basically anything in SD and have no trouble pathfinding to it if you were able to normally.
  • In HD, due to the limit, you should notice that clicking things on the edge of your render distance doesn't actually take you all the way there. Instead you'll stop short about halfway there (the HD render distance is 50 while SD is about 25)
  • You should get an "I can't reach that" message at the end of these shortened paths (I know it prints twice.)

(On the live server, the limit will likely be raised to 50 to allow full use of the HD render distance)

Are there any tricky things testers should keep an eye out for?

  • No

  • Yes, as follows:

  • I have tested these changes thoroughly.

  • This requires extra testing due to changes to architecture or other similarly risky changes.

  • I used the Thanos Tool for any JSON edits where possible, and have attached screenshots of any changes.

  • I acknowledge that this contribution will be released under the AGPL license.

*** NOTE: If Gitlab complains about pipelines stating that you need to "Validate your Gitlab account" there is no need to worry. You do not have to do this and it is only occurring because OUR pipeline tried to run on your fork. While it's preferred that you do validate your account, you can safely ignore/dismiss this message from Gitlab. ***

Edited by Ceikry

Merge request reports