Skip to content

Conversation

Doc94
Copy link
Contributor

@Doc94 Doc94 commented Aug 27, 2025

This PR just expose the accuracy for generate paths

@Doc94 Doc94 requested a review from a team as a code owner August 27, 2025 14:54
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Aug 27, 2025
@jpenilla
Copy link
Member

Not sure about the accuracy name, I know that's the name from Parchment but it's assigned to a vanilla field reachRange.

@Doc94
Copy link
Contributor Author

Doc94 commented Aug 29, 2025

Not sure about the accuracy name, I know that's the name from Parchment but it's assigned to a vanilla field reachRange.

yeah i has the same question what name use the field or the other...

@Malfrador
Copy link
Member

I like reachRange more. I don't really associate accuracy with pathfinding terminology personally.

If I wrote a pathfinder I'd probably name this parameter something like arrivalDistance or goalRadius.
reachRange seems close enough to that, and generally I think we should try to stick to Mojang names for simplicity.

@JavierFlores09
Copy link

JavierFlores09 commented Sep 7, 2025

I would call the parameter tolerance given it is only used in Pathfinder#findPath to check whether the manhattan distance between the currently evaluated node and the target node is less than or equal to the accuracy parameter. Higher accuracy values would lead to more target nodes being considered within reach, so it is counter-intuitive to what people would consider as "accurate".

That being said, higher tolerance values means more paths to search, which will either strain the server or just hit paper's pathfinding optimization where it just stops trying to pathfind after 10 failed paths or it has been less than 2 seconds since the last failed path. So there should be a note about using high values for this parameter. This is the case only for the moveTo methods, which I thought were being exposed too, it doesn't really matter for findPath

@lynxplay
Copy link
Contributor

lynxplay commented Sep 7, 2025

Agree with both above, accuracy is a pretty unfun name for this given it is inverted.
I don't have much of a preference between tolerance and reachRange, might as well just default to mojangs naming, the most important bit is good javadocs on the parameter (better than param reachRange The reach range lol)

@Leguan16
Copy link
Contributor

Leguan16 commented Sep 7, 2025

Another name I suggested in discord was deviation. I figured to throw it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting review
Development

Successfully merging this pull request may close these issues.

7 participants