Comments (2)
I haven't officially confirmed this or anything, but my suspicion on why this happens is on how the path finding would generally go in this case trying to get to the end you labeled.
So it goes great until it reaches what I labeled as 4.
Then it would move to (unlabeled sorry) red 5, 6 and it hits a disabled location and starts checking neighbors. The lower six, then the two 7 sevens, it might follow this red path for a bit as it's searching for where there might be an opening in this line of disabled points. Eventually it wraps all the way around and it has two paths, a path of distance 15 (the one it picks), and a path of distance 17, which it doesn't because that costs more.
At this point the algorithm realizes it cannot actually reach the destination and gives up. Because you selected the option to return a partial path, it will return the last path it had (as that's how it has been implemented) which would be the path distance of 15.
You'd expect that path of 6 that you labeled, but it didn't just stop there since in theory there could've been a valid path on the opposite side of your blocked box. When it gives up is when it returns the path, which it does after it's visited all possible points that could've been enabled.
I think it might be tricky to make this a consistent thing. It could, after realizing it has no valid path at all, try again ignoring disabled points and working backwards to discard points in disconnected paths. But by ignoring disabled points you might get shorter paths than expected, like if point labeled 4 was actually disabled, then you might just get a path to 3 and that's it. You'd need to figure out a "smart" way to ignore some points, which might just be iteratively ignoring N disabled points where you increment N by one every time it completely fails. That would probably fix the potential shorter path problem, but now you're rerunning the path potentially a lot of times which would be a little wasteful. There may be some optimizations here and there too.
As I work on #93409 this might see some improvements but can't promise for sure, it'll be something I try and think on though and I'll try to "officially confirm" this bug when I have a chance as well.
from godot.
While testing this I noticed something interesting. This seems to be present only if using HEURISTIC_EUCLIDEAN or HEURISTIC_OCTILE but not present if using HEURISTIC_MANHATTAN, HEURISTIC_CHEBYSHEV as the heuristic of choice for compute/estimate.
Using Manhattan or Chebyshev you get that expected short path. Technically Chebyshev is one off, but it's still close enough, and for all your other test cases both are identical and hitting your expected label.
If you mix and match the estimate and compute methods you'll often get strange results though, typically not your expected, but also doing that is a bit strange and to be expected I think. (If the estimated cost is greater than the compute cost, AStar returns strange results. This may be happening when you mix and match heuristics and this isn't inherently an engine bug in itself, that's just a consequence of the AStar algorithm. It's not recommended to have an estimate > compute.)
from godot.
Related Issues (20)
- Popups don't register mouse click shortly after opening HOT 2
- Inconsistent Import for bmps in 1bpp and 4bpp indexed format
- Baking Lightmaps with LightmapGI breaks meshlibrary (Gridmap) transforms. HOT 1
- Demo of a Godot game completely crashes computer upon start up. HOT 3
- Signal panel gets visible/invisible when i double click filesystem items
- Still if you copy and paste a TileMap it deletes hours of work just cause HOT 1
- Assigned shader ignored on mesh HOT 3
- Visual shader plugin complains about missing version and category HOT 2
- [C#] Data partially lost when iterating through a deserialized Dictionary HOT 2
- Disabled in editor NavigationLink3D doesn't have a map even after enabling it
- Code completion shortcut (CTRL+SPACE) does not work without a filter (e.g. on blank lines before you start typing)
- iOS version of the game crashes on iPad HOT 1
- GDShader allows commas in `for` conditions (middle part) incorrectly
- GDShader incorrectly expects `int` cases in `switch` on `uint` expressions
- When you click outiside of the Input map settings when changing an Action name the window crashes
- VisualShader resource's inspector uses "Node3D" instead of "Spatial" HOT 1
- Callback function _make_custom_tooltip() does not get called when used in a plugin control as a Built-In HOT 2
- Godot's .intersect_ray() detection appears to be buggy on Terrain3D, differs from Terrain3D's get_height() in some rectangles
- Editor camera position is overridden by Freelook after being set via Addon
- FBX import settings lost due to ConfigFile erasing keys when value set to null HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot.