Skip to content

Commit 6d0405c

Browse files
[Auto] [Improve] Enhanced pathfinding documentation with grid offsets, smoothing, and obstacle details (#442)
1 parent 22fe97a commit 6d0405c

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

automated_updates_data.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"last_automated_updates_commit": "82f1660d3e9649d22b99ac8e6d99d1c614e83d9c",
33
"last_improved_things": [
44
{ "date": "2026-02-16", "summary": "Enhanced 3D model documentation with animation controls, material types, origin/center points, and shadow configuration" },
5-
{ "date": "2026-02-16", "summary": "Improved core behavior documentation: added Window Center anchor option, draggable collision mask and Z-order details, destroy outside parameters" }
5+
{ "date": "2026-02-16", "summary": "Improved core behavior documentation: added Window Center anchor option, draggable collision mask and Z-order details, destroy outside parameters" },
6+
{ "date": "2026-02-16", "summary": "Enhanced pathfinding documentation with grid offset properties, path smoothing, obstacle cost clarification, and activation behavior" }
67
]
78
}

docs/gdevelop5/behaviors/pathfinding/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ When the behavior is added to an object, some properties can be modified:
1414
![](pasted/20230304-155732.png)
1515

1616
* **impassable:** if enabled, the obstacle is going to be impassable. The moving object will be avoiding them and never go through them.
17-
* **cost:** if the obstacle is not impassable, a cost can be set the obstacle. The moving object, when looking for the best possible path to a destination, will prefer to avoid the obstacle with high-cost values. For example, a river might have some cost. The moving object, if possible, will avoid it. However, if there is no other way around the river, or if the river has a lower cost compared to another area, the moving object will go through it (instead of climbing a mountain with a higher cost for example). And if we put crocodiles into the river and increase its cost, the moving object might decide to climb the mountains instead.
17+
* **cost:** if the obstacle is not impassable, a cost can be set for the obstacle. The moving object, when looking for the best possible path to a destination, will prefer to avoid obstacles with high-cost values. For example, a river might have some cost. The moving object, if possible, will avoid it. However, if there is no other way around the river, or if the river has a lower cost compared to another area, the moving object will go through it (instead of climbing a mountain with a higher cost for example). And if we put crocodiles into the river and increase its cost, the moving object might decide to climb the mountains instead. The cost value is a multiplier applied to the path length through that obstacle.
1818

1919
!!! tip
2020

@@ -32,9 +32,11 @@ After we add the behavior to the object, we can customize a number of options:
3232
* **allow diagonals:** set if the object can move in diagonals.
3333
* **angle offset:** in case the sprite is facing the wrong direction we can set the angle offset
3434
* **extra border size:** sets the border size around the object. This setting determines how close the object can move to the obstacles.
35+
* **grid offset X/Y:** offsets the virtual grid position by the specified number of pixels. This can be useful to align the grid with your level layout. Default is 0 for both X and Y.
3536
* **max speed:** maximum speed the object can move on the path.
3637
* **rotate object:** if you don't want the object to rotate while moving on the path, disable the object's rotation.
3738
* **rotate speed:** sets the speed of the object's rotation.
39+
* **smoothing max cell gap:** controls path smoothing when diagonal movement is enabled. When set to 1 (default), the path is smoothed by removing unnecessary waypoints. Set to 0 to disable smoothing and follow the grid exactly. This is an advanced setting.
3840
* **virtual cell height and width:** the path is generated using a virtual grid. The size of the cells if this virtual grid can be changed. When the grid is smaller, the movement is more precise and can find path between objects - but is also more intensive for the device to compute.
3941

4042
!!! note

scripts/improve-docs.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ IMPORTANT CONSTRAINTS
176176
• NEVER create new files unless absolutely necessary.
177177
• NEVER edit files outside docs/gdevelop5/ (except automated_updates_data.json as described below).
178178
• Do NOT touch images or binary files.
179+
• Do NOT document non-user-facing implementation details. Focus only on information
180+
that is relevant to users creating games with GDevelop, not internal engine behavior.
179181
180182
WHEN YOU ARE DONE
181183
-----------------

0 commit comments

Comments
 (0)