Commit Graph

198 Commits

Author SHA1 Message Date
Serhii Snitsaruk 2e0047bb59
Call both native and script's `_setup()` in BTTask
Current behavior is overriding, which is not correct as it's an initializer function.
2024-09-22 14:49:46 +02:00
Serhii Snitsaruk ac2d734122
Use different prefetch root for the base plan in BTPlayer and BTState 2024-09-15 15:47:11 +02:00
Serhii Snitsaruk da2bc5e3bb
Fix `BTSetAgentProperty` name generation 2024-09-14 19:56:31 +02:00
Serhii Snitsaruk b8c9db0d44
Fix BTForEach crash if elements are removed from the array during iteration 2024-09-14 16:42:30 +02:00
Serhii Snitsaruk 16a3bb0273
Override _to_string() to print useful info about objects in GDExtension 2024-09-05 13:39:47 +02:00
Serhii Snitsaruk b981d430f1
Fix custom scene root is not used in BTPlayer and BTState 2024-08-31 19:37:44 +02:00
Serhii Snitsaruk 9da16a1e0f
Clean up unused string names 2024-08-21 20:04:35 +02:00
Serhii Snitsaruk 000f9c15d8
Fix BTState overwriting blackboard variables on init 2024-08-15 23:41:36 +02:00
Serhii Snitsaruk 314fcfd741
Fix monitor_performance screwing C# exports 2024-08-11 12:37:37 +02:00
Serhii Snitsaruk 84becbe914
Fix C# exports print errors due to missing ClassDB binding 2024-08-06 18:17:55 +02:00
Serhii Snitsaruk 319c5787be
Add BTState::set_scene_root_hint() 2024-08-05 13:21:57 +02:00
Serhii Snitsaruk 1e9b321283
Allow setting custom scene root for behavior trees
- Adds new argument to `BehaviorTree.instantiate()`
- Adds `BTPlayer.set_scene_root_hint()` method
2024-08-05 13:03:50 +02:00
Serhii Snitsaruk 40863313dd
Check if blackboard is null in `BehaviorTree.instantiate()` 2024-08-04 12:41:25 +02:00
Serhii Snitsaruk ee12a56e96
BTPlayer: Allow changing BT instance at runtime 2024-08-04 12:36:44 +02:00
Serhii Snitsaruk df11afaf44
Allow monitoring BT performance in BTState 2024-08-04 10:37:41 +02:00
Serhii Snitsaruk 63ef3e0555
BTPlayer: Fix `updated` signal and deprecate `behavior_tree_finished` signal 2024-08-03 16:11:47 +02:00
Serhii Snitsaruk 869b6465b9
Unregister BT instance with debugger if BTPlayer is removed from tree 2024-08-03 14:57:57 +02:00
Serhii Snitsaruk 6b4c97e545
Fix BehaviorTree.instantiate() method binding 2024-08-03 14:29:24 +02:00
Serhii Snitsaruk 5f5b62a4ea
Fix BTState setup 2024-08-03 14:17:26 +02:00
Serhii Snitsaruk 68a9492f3d
Fix uninitialized integers 2024-08-03 13:48:15 +02:00
Serhii Snitsaruk 6c794d6a7e
Refactor BTInstance.update() 2024-08-03 11:56:32 +02:00
Serhii Snitsaruk c4c9b5fe09
Utilize BTInstance in BTState 2024-08-03 11:39:23 +02:00
Serhii Snitsaruk fc26f51ff2
Implement BTInstance - runtime instance of BehaviorTree 2024-08-03 11:07:06 +02:00
Serhii Snitsaruk ce1867be7a
Fix error if `changed` signal is already connected to a BBParam in a bunch of tasks 2024-08-02 10:07:42 +02:00
Serhii Snitsaruk 456687c857
Fix BTPlayer.restart() crash 2024-07-30 12:42:22 +02:00
yds 7073db7bfa Fix error when loading scene with a `BTPlayer` 2024-07-17 13:25:58 -03:00
Serhii Snitsaruk 8dfbd70718
Fix: GDExtension load fails due to Expression used w/o Ref 2024-06-30 14:29:40 +02:00
Serhii Snitsaruk cd0bc8e796
Register and call virtual methods on scripts in GDExtension 2024-06-30 12:34:06 +02:00
Serhii Snitsaruk a2dedabd77
Fix potential rare var name conflict in BTCooldown 2024-06-23 12:14:15 +02:00
Serhii Snitsaruk 7eaebc4e7c
Fix crash when freeing agent with performance monitoring enabled 2024-06-04 09:30:42 +02:00
Serhii Snitsaruk 06de52492a
Fix reparenting an agent deactivates its HSM 2024-06-03 14:55:00 +02:00
Serhii Snitsaruk ce5f012101
Fix sticky name issues in custom tasks due to script errors 2024-06-03 10:45:01 +02:00
Serhii Snitsaruk 361eb3eb15
Fix compile-time errors with updated godot-cpp 2024-05-28 19:50:57 +02:00
Serhii Snitsaruk d36f8f1122
Fix variables missing from BTState blackboard
Non-overridden variables could be missing at runtime in the BTState blackboard due to a bug this commit fixes.
2024-05-15 11:43:31 +02:00
Serhii Snitsaruk a572613001
BlackboardPlan: Utilize mapping in LimboHSM
Also changes how parent plan providing is implemented (used for editor hints).
2024-05-15 11:38:53 +02:00
Serhii Snitsaruk ef1c1e5192
Fix circular ref & non-tools compilation errors 2024-05-14 22:03:29 +02:00
Serhii Snitsaruk a1cdff2e2e
Fix issues with mapping in BTSubtree 2024-05-14 19:47:05 +02:00
Serhii Snitsaruk 0d1e846d93
BlackboardPlan: Use mapping with BTSubtree 2024-05-14 11:39:32 +02:00
Serhii Snitsaruk e36ea6d3e6
Better error handling in BTState, BTPlayer & BehaviorTree 2024-05-02 14:10:29 +02:00
Serhii Snitsaruk 84c89356a6
Print error if agent node is set after initialization 2024-05-02 12:49:32 +02:00
Serhii Snitsaruk a2dae24b99
Rename BTPlayer's agent => agent_node 2024-05-02 12:11:59 +02:00
Serhii Snitsaruk af23272e3d
Fix unnamed arguments in method bindings 2024-05-02 01:27:14 +02:00
Serhii Snitsaruk 506d8aa967
Use `scene_root` with `BBParam` 2024-05-01 23:39:09 +02:00
Serhii Snitsaruk 5dff2e537b
Add `agent` parameter to `BTPlayer` to propagate upon `BehaviorTree` initialization, and add `scene_root` property to `BTTask`
`scene_root` is useful to resolve exported NodePath properties in `BTTask` instances (and for BBNode parameters).
2024-05-01 23:20:17 +02:00
Serhii Snitsaruk e1c8ce4a58
BTDecorator: Add default `_tick` implementation
The default implementation simply ticks the child task and returns its status.
2024-04-22 11:07:50 +02:00
Serhii Snitsaruk c4df916bdf
HSM: Delay state transition till update is finished 2024-04-20 21:30:26 +02:00
Serhii Snitsaruk 5048d6a485
Fix BT being ticked after transition happened and state is no longer active 2024-04-20 20:19:07 +02:00
Serhii Snitsaruk 3918272227
BehaviorTree: New signal for when BB plan changes
Utilize `plan_changed` signal in `BTPlayer` and `BTState`.
2024-04-01 16:34:36 +02:00
Serhii Snitsaruk 302de87e32
Prevent using external resources for derived blackboard plans in `BTPlayer` and `BTState` 2024-04-01 15:25:54 +02:00
Serhii Snitsaruk 5ff42e29e4
Always duplicate `BlackboardPlan` props 2024-04-01 01:11:51 +02:00