Threat table with taunts and switch margin
In your harnessGodot componentMIT
Track threat per attacker for an enemy, decay it over time, force the target with taunts, and change targets only when another attacker passes the current one by a margin.
ATTRIBUTION.mdLICENSEREADME.mdbaltor_test.gdcomponent.jsoninspect_gdscript.pyrun_tests.gdtest_package.pytests/test_threat_table.gdthreat_table.gdverification/native.json
Full files in your harness.
What it takes and gives
- Class
- BaltorThreatTable, extends RefCounted
- Methods
- add_threat(source: StringName, amount: float) -> void; get_threat(source: StringName) -> float; remove_source(source: StringName) -> void; taunt(source: StringName, seconds: float) -> void; update(delta: float) -> void; get_target() -> StringName; get_sorted_sources() -> Array[StringName]; get_taunt_time_left() -> float; and 1 more
- Signals
- target_changed
- Placement
- res://baltor/godot_components/threat_table/
Limits. Target selection uses threat only (no range or line of sight rules). Decay is exponential per second and applied in update(). Attacker ids are StringNames. 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, 76.1 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
- threat table (aggro list), hysteresis switch margin, exponential decay
- Tags
- aggro, threat, ai, rpg, targeting, combat
- Identity
library.supply.creative_originals.1475b11022c5a906cda53a44.f155e988ad9326b9- Version
f155e988ad9326b9f4daac73e8e089b496ec79bbadb0292d1d16f3acecf51d05
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.