Skip to content
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

Change param name of AStar's _estimate_cost method #92123

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

timothyqiu
Copy link
Member

A* classes all have two similar cost functions:

  • _estimate_cost(from, to)
  • _compute_cost(from, to)

It's easy to misunderstand that their second parameters are the same. But in fact, _estimate_cost() receives the end point of the search query, while _compute_cost() receives a connected (neighbour) point.

@timothyqiu timothyqiu requested review from a team as code owners May 19, 2024 14:42
@AThousandShips AThousandShips added this to the 4.x milestone May 19, 2024
Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

Seems fine by me, but I wonder if this is more of a fault of the docs and if they could make it even more explicit.

@AThousandShips AThousandShips requested a review from a team July 6, 2024 07:46
Copy link
Member

@raulsntos raulsntos left a comment

Choose a reason for hiding this comment

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

Changes to parameter names break source compatibility in C# because the call-site could be using named parameters, but since these are virtual methods and aren't meant to be called from scripting, then I don't think this matters.

So regarding C# compat, I think the change is fine 👍

@akien-mga akien-mga modified the milestones: 4.x, 4.4 Aug 27, 2024
@akien-mga akien-mga merged commit 1e6b6ea into godotengine:master Aug 27, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@timothyqiu timothyqiu deleted the estimate-end branch August 28, 2024 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants