-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
test_move() has misleading name and returns the opposite of the expected result, implement expected behavior #9259
Comments
As this is very clearly documented, and changing it would be a completely unacceptable compatibility breakage, this isn't something that can happen soon I don't consider it misleading, the name implies nothing about that it would return true or false for collision |
That's why I proposed the alternative solution. The relevant part:
|
That's a lot of work and clutter to correct some people being confused, especially when that confusion just goes away if you read the documentation, I don't think it's a good reason to deprecate and change a method that's been around for a long time, this was the same in 3.x, with
I don't think it's confusing, and I've never encountered anyone else having this issue, so I don't see any reason to believe it's a common cause of confusion, can you link to others having this issue? This isn't new Edit: there's not a single error report or proposal about this confusion, so your confusion does not seem common |
Is common practice for this kind of tester functions to return something if the movement was not achieved. Furthermore, inverting the behaviour would be extremely confusing. If something was found on the path, then you have information about what it was, if you found nothing, you don't have it and don't need it. It would be really confusing to have something returning null or false when is indeed providing you with information. |
Exactly Further this has been this way always in Godot, or at least since 2.1 This matches Unity's "SweepTest" |
Sorry, I edited the proposal since people keep focusing on the wrong solution. It should be now more clear.
But |
I think "Let's not fix a problem because it's been here for ages and we documented that this is a problem" is not a good reason to keep the problem in. (By deprecation, I do not mean removing the "Not enough people complained about this, to fix it" is also irrelevant, I am well aware that this is a papercut, test move is used like once or twice in my projects and then I promptly forget about it and cut myself on it every year or so when I need to use it. I myself have been ignoring it for actual years and just now realized it's been very annoying. Furthermore, I do not think that single new function with different name is lot of clutter. Pretty sure the deprecated flag for documentation was introduced for this exact reason. |
Duplicating functionality for the sake of doing it is even a worse idea. Again, it makes no sense at all to return true if nothing was found and then return false + the information. This is standard practice. Is this way in any place you look. Any collision resolution paper also use this dynamic. There is no problem to solve, but this proposal would create a huge one. Again, if you found something there is information to provide, if not, there is nothing. It does not even make practical sense. |
I know... You don't need to educate me on this...
We don't agree that it's a problem, or that it's poorly names, you're declaring it is, and rejecting arguments against it
Making everyone adjust their code because a few people are confused isn't fair or reasonable... And no one, not a single person, has raised this as an issue in the last ten years, unless you can find some
It was introduced for necessary deprecation where something needs to change
We're focusing on what's literally the title of this proposal and what you are suggesting, namely adding new, opposite, code, and it's still unnecessary |
What I'm saying is this, so we don't get confused about what I'm actually saying here:
In the end the solution is often to just adjust to the way the engine works if it's not a common issue, as annoying as it might be, especially instead of making things confusing and worse for everyone else |
Hm, ok, I am closing this proposal and I will make another attempt in the future with better explanation. |
Your explanation is sufficient, we just don't agree with your reasoning, not a lack of details or explanation, people can disagree with you, it doesn't require them not not understand Honestly the implication that we just don't understand you is insulting and unproductive And no one dogpiled you Edit: Also, if you do chose to revisit this, you should reopen this issue, not open a new one |
Describe the project you are working on
a JRPG
Describe the problem or limitation you are having in your project
I wasn't sure if I should report this as a bug or propose as a feature but here I go.
When I call test_move() I expect to return
TRUE
when there is no collision because I am testing for possibility of movement, not collision.Currently I have to do:
if NOT test_move():
Which when read gives off the incorrect idea.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Fixtest_move()
by inverting the behavior. Testing the possibility of movement will then return expected result.ORdeprecate
test_move()
and implementtest_collision()
/test_move_collision()
or any other name that better communicates what the function is actually doing. No compatibility breakage.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Either we duplicate the functionality under new function with better name or we fix the returned value of the existing function.
If this enhancement will not be used often, can it be worked around with a few lines of script?
it can be worked around with 1-3 characters:
!
orNOT
Is there a reason why this should be core and not an add-on in the asset library?
This is a change to GDScript.
The text was updated successfully, but these errors were encountered: