Comments (4)
So while technically a disabled/solid point is part of the point list, if the end point is disabled (or "solid" for the AStarGrid2D
class) _solve
returns early which means even when asked to return the partial path the path is still an empty array as no actual pathfinding was done yet. You can see this early return here
https://github.com/godotengine/godot/blob/master/core/math/a_star_grid_2d.cpp#L453
The original issue that the partial path implementation was for was for non-disabled points that are in the point list, finding a path close to those even if there are obstacles preventing a complete path. The picture from the original proposal (godotengine/godot-proposals#277) showcases that intention
I did not change/modify the early termination present when the destination is itself disabled, however I can see the merit in having this functionality too. The main issue is this change would, unless I dragged in the partial path option into the _solve
function to modify the early termination (which could be done if desired), mean that even for users who are not desiring a partial return the extra "processing" would happen to find that partial path even though we would then discard that result and return the empty array.
This short circuit was added as part of #27506 when disabling points became an option, as it represents a much more performant way to temporarily add/remove points from pathfinding without having to actually run the more expensive add/remove point functions. I believe the specific part of having it in _solve
was just for the optimization of not trying to pathfind when the destination was "invalid", though this is speculation on my part as the intention wasn't directly stated anywhere.
Curious to hear other's thoughts on it as well!
from godot.
I was personally caught out by this just now. The documentation of the current behaviour in the AStarGrid2D doc lead me to believe that it would find the closest non-solid tile to a solid tile. It's very understandable why this isn't the case upon reading into it, though!
That said, I do think it should be considered inside the _solve
function, since it makes sense in my head for allow_partial_path
to perform the way I originally thought it would. I'll work around it in the meantime!
from godot.
I found godotengine/godot-proposals#277 (comment) so it seems like I'm not alone with there being some confusion on how partial path is meant to work
from godot.
I found godotengine/godot-proposals#277 (comment) so it seems like I'm not alone with there being some confusion on how partial path is meant to work
#88047 description says:
Note: This will not return a partial path to a location not in the AStar point list, the destination point still has to be a point. This is especially helpful for games where points may become disconnected due to other points being disabled during play while still permitting a path that gets close to the destination point.
from godot.
Related Issues (20)
- Exported windows application named "Godot Engine" instead of Product name set in export settings HOT 2
- Selecting windows taskbar menu application item starts new duplicate process instead of activating application HOT 5
- Incorrect Calculation of event.relative for InputEventScreenDrag with Multitouch in Web Version
- Opening a project in different versions causes mass asset reimport HOT 1
- Switching from TAA to MSAA breaks compositor effects
- Missing: "Always Close Output on Stop" HOT 2
- MSAA is not functional with motion blur compositor effect, even with access resolved color on.
- MultiplayerSpawner does not update its spawnable scenes when it is instanced into another scene
- Enabling both `process_in_physics` and `ignore_timescale` on a SceneTreeTimer causes timer slowdown at high framerates
- [4.3.beta3] NavigationAgent not working properly when baking at runtime. HOT 1
- Overlapping CollisionObject3Ds cause mouse_entered and mouse_exited to glitch
- [4.3-beta3]: Crash in certain autocompletion situations
- PhysicsDirectSpaceState2D.intersect_shape stops working when there are lots of Area2Ds HOT 2
- Theme on container overrides theme on child button even though one is selected for that button.
- Help > Copy System Info from Godot gives me incorrect OS version HOT 1
- Window surface shifted after resizing window (Godot 4, Windows) HOT 1
- `CSGShape3D` wireframe is still visible when disabling gizmos HOT 1
- Cyclic Reference Bug HOT 1
- "Class hides a global script class" script parsing issue HOT 2
- Cannot copy-paste ButtonGroup reference in editor, must manually edit *.tscn file
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.