← All examples

godot components

Utility AI scorer with response curves

Score named actions from considerations mapped through response curves (linear, polynomial, logistic, step, smoothstep) with compensated products, vetoes, weights and hysteresis, and pick the best action.

What this component contains

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

How it works

Class
BaltorUtilityAI, extends RefCounted
Methods
add_action(action_name: StringName, weight: float = 1.0) -> bool; add_consideration(action_name: StringName, input: Callable, minimum: float, maximum: float, curve: Response = Response.LINEAR, slope: float = 1.0, exponent: float = 1.0, x_shift: float = 0.0, y_shift: float = 0.0) -> bool; curve_value(curve: Response, x: float, slope: float = 1.0, exponent: float = 1.0, x_shift: float = 0.0,…
Signals
action_changed
Placement
res://baltor/godot_components/utility_ai/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • godot_parse_check_only
  • godot_gdscript_tests
  • godot_tests_reject_gutted_component
  • godot_editor_import
  • godot_contract_reflection
  • godot_readme_usage_compiles

Limits to consider

Chooses the single best action; no weighted random among the top choices. Scores are only as good as the considerations and curve parameters, which need tuning per game. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.