Baltor Get started

Gallery / Godot components

Obstacle avoidance steering among circle obstacles

In your harnessGodot componentMIT

Steer a 2D agent around circle obstacles with a detection corridor ahead of it: find the closest threat, push sideways away from it and brake, harder when closer, with a repeatable choice for dead-ahead obstacles.

Files, names only

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • baltor_test.gd
  • component.json
  • inspect_gdscript.py
  • obstacle_avoidance_2d.gd
  • run_tests.gd
  • test_package.py
  • tests/test_obstacle_avoidance_2d.gd
  • verification/native.json

Full files in your harness.

What it takes and gives

Class
BaltorObstacleAvoidance, extends RefCounted
Methods
ray_circle(origin: Vector2, direction: Vector2, center: Vector2, radius: float) -> float; find_threat(position: Vector2, velocity: Vector2, obstacles: PackedVector3Array, agent_radius: float, look_ahead: float) -> int; avoid(position: Vector2, velocity: Vector2, obstacles: PackedVector3Array, agent_radius: float, look_ahead: float, max_force: float) -> Vector2
Placement
res://baltor/godot_components/obstacle_avoidance_2d/

Limits. Circle obstacles only, given as Vector3(x, y, radius); walls and polygons need another method. Avoids one obstacle at a time, so dense clusters can still trap an agent. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.

Details

Kind
Godot component
Engine
Godot 4.3 or later
Files
11 files, 74.2 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, headless
Checks
godot parse check only, godot gdscript tests, godot tests reject gutted component, godot editor import, godot contract reflection, godot readme usage compiles
Techniques
detection corridor obstacle avoidance, ray-circle intersection
Tags
steering, obstacle avoidance, ai, collision avoidance, agents
Identity
library.supply.creative_originals.6d7152d496160e5028d14049.64d8e1963abf478b
Version
64d8e1963abf478b8f40af703d7d4ab83c11e38b72cc6fe3deb0e4ebb986040c

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.