Godot Steering AI Framework

repository·master·Indexed 23 days ago

https://github.com/gdquest/godot-steering-ai-framework

A GDScript framework for the Godot engine that implements complex and smooth AI movement using steering behaviors in 2D and 3D environments. It utilizes Steering Agents to maintain state and Steering Behaviors to calculate velocity changes, allowing AI logic to be managed within GDScript classes.

Tokens
303
Snippets
0
Records
3
Agent score
31%

What's inside godot-steering-ai-framework

  1. How steering agents and behaviors work

    master

    The framework uses two primary abstractions to manage movement:

    1. Steering Agent: Represents a character or vehicle. It maintains state such as position, orientation, maximum speeds, and current velocity.
    2. Steering Behavior: A logic component that calculates the necessary linear or angular change in velocity based on the agent's current information (e.g., fleeing, following, or looking at a target).

    Because every class extends Godot's Reference type, you can manage AI logic entirely within GDScript classes without needing to build a complex scene tree for the AI calculations themselves.

  2. Apply steering acceleration to characters

    master

    The framework calculates acceleration (the change in velocity), but it does not move the character for you. You must manually apply the calculated acceleration to your character's movement logic.

    Depending on your character type, you might use:

    • RigidBody: Use apply_impulse to apply the acceleration.
    • KinematicBody (or CharacterBody in Godot 4): Use move_and_slide to apply the velocity changes.