From 11f43c24946358515a6c3e43e87fd07e5c4bdcfc Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sun, 28 Jan 2024 22:36:30 +0100 Subject: [PATCH] Update demo --- demo/demo/ai/trees/variables.tres | 26 ++++++++----------- demo/demo/ai/trees/waypoints.tres | 9 +++++-- demo/demo/examples/variables/variables.tscn | 10 ++++++- .../examples/waypoints/patrolling_agent.tscn | 5 ++++ .../agent_properties/agent_properties.tscn | 5 +++- .../agent_properties/bt_agent_properties.tres | 5 +++- .../bt_test_probability_selector.tres | 5 +++- .../test_probability_selector.tscn | 5 +++- 8 files changed, 48 insertions(+), 22 deletions(-) diff --git a/demo/demo/ai/trees/variables.tres b/demo/demo/ai/trees/variables.tres index 2fbc380..d88d651 100644 --- a/demo/demo/ai/trees/variables.tres +++ b/demo/demo/ai/trees/variables.tres @@ -1,16 +1,11 @@ -[gd_resource type="BehaviorTree" load_steps=13 format=3 uid="uid://cvm3gqes75f53"] +[gd_resource type="BehaviorTree" load_steps=11 format=3 uid="uid://cvm3gqes75f53"] -[sub_resource type="BBVariant" id="BBVariant_t70f2"] -resource_name = "false" -saved_value = false -type = 1 - -[sub_resource type="BTSetVar" id="BTSetVar_nxwdg"] -variable = "triggered" -value = SubResource("BBVariant_t70f2") - -[sub_resource type="BTRunLimit" id="BTRunLimit_mlytb"] -children = [SubResource("BTSetVar_nxwdg")] +[sub_resource type="BlackboardPlan" id="BlackboardPlan_a1pq1"] +var/triggered/name = "triggered" +var/triggered/type = 1 +var/triggered/value = false +var/triggered/hint = 0 +var/triggered/hint_string = "" [sub_resource type="BBVariant" id="BBVariant_8bpg1"] resource_name = "false" @@ -36,18 +31,19 @@ saved_value = "Hello, World!" type = 4 [sub_resource type="BTSetVar" id="BTSetVar_2e0uw"] -variable = "message" +variable = "_message" value = SubResource("BBVariant_cu1uc") [sub_resource type="BTConsolePrint" id="BTConsolePrint_533ui"] text = "Message is: %s" -bb_format_parameters = PackedStringArray("message") +bb_format_parameters = PackedStringArray("_message") [sub_resource type="BTSequence" id="BTSequence_bhar3"] children = [SubResource("BTCheckVar_g5b0s"), SubResource("BTSetVar_u051c"), SubResource("BTSetVar_2e0uw"), SubResource("BTConsolePrint_533ui")] [sub_resource type="BTSelector" id="BTSelector_ndrjh"] -children = [SubResource("BTRunLimit_mlytb"), SubResource("BTSequence_bhar3")] +children = [SubResource("BTSequence_bhar3")] [resource] +blackboard_plan = SubResource("BlackboardPlan_a1pq1") root_task = SubResource("BTSelector_ndrjh") diff --git a/demo/demo/ai/trees/waypoints.tres b/demo/demo/ai/trees/waypoints.tres index e48e485..3174634 100644 --- a/demo/demo/ai/trees/waypoints.tres +++ b/demo/demo/ai/trees/waypoints.tres @@ -8,10 +8,15 @@ var/speed/type = 3 var/speed/value = 200.0 var/speed/hint = 1 var/speed/hint_string = "10,1000,10" +var/waypoints/name = "waypoints" +var/waypoints/type = 28 +var/waypoints/value = [] +var/waypoints/hint = 0 +var/waypoints/hint_string = "22:" [sub_resource type="BTAction" id="BTAction_3xal7"] script = ExtResource("1_rhs33") -target_position_var = "wp" +target_position_var = "_wp" speed_var = "speed" tolerance = 50.0 @@ -33,7 +38,7 @@ children = [SubResource("BTAction_3xal7"), SubResource("BTPlayAnimation_s01ov"), [sub_resource type="BTForEach" id="BTForEach_0cp04"] children = [SubResource("BTSequence_a2ng0")] array_var = "waypoints" -save_var = "wp" +save_var = "_wp" [sub_resource type="BTCooldown" id="BTCooldown_gen0l"] children = [SubResource("BTForEach_0cp04")] diff --git a/demo/demo/examples/variables/variables.tscn b/demo/demo/examples/variables/variables.tscn index 0a59bb0..baf1707 100644 --- a/demo/demo/examples/variables/variables.tscn +++ b/demo/demo/examples/variables/variables.tscn @@ -1,8 +1,16 @@ -[gd_scene load_steps=2 format=3 uid="uid://d4bjeyescflm8"] +[gd_scene load_steps=3 format=3 uid="uid://d4bjeyescflm8"] [ext_resource type="BehaviorTree" uid="uid://cvm3gqes75f53" path="res://demo/ai/trees/variables.tres" id="1_cm2sf"] +[sub_resource type="BlackboardPlan" id="BlackboardPlan_w5klr"] +var/triggered/name = "triggered" +var/triggered/type = 3 +var/triggered/value = 0.0 +var/triggered/hint = 0 +var/triggered/hint_string = "" + [node name="Variables Example" type="Node2D"] [node name="BTPlayer" type="BTPlayer" parent="."] behavior_tree = ExtResource("1_cm2sf") +blackboard_plan = SubResource("BlackboardPlan_w5klr") diff --git a/demo/demo/examples/waypoints/patrolling_agent.tscn b/demo/demo/examples/waypoints/patrolling_agent.tscn index a91dc6b..88a10be 100644 --- a/demo/demo/examples/waypoints/patrolling_agent.tscn +++ b/demo/demo/examples/waypoints/patrolling_agent.tscn @@ -10,6 +10,11 @@ var/speed/type = 3 var/speed/value = 300.0 var/speed/hint = 1 var/speed/hint_string = "10,1000,10" +var/waypoints/name = "waypoints" +var/waypoints/type = 28 +var/waypoints/value = [] +var/waypoints/hint = 0 +var/waypoints/hint_string = "22:" [sub_resource type="Animation" id="Animation_5id00"] length = 0.001 diff --git a/demo/demo/tests/agent_properties/agent_properties.tscn b/demo/demo/tests/agent_properties/agent_properties.tscn index 59e664a..14eb63a 100644 --- a/demo/demo/tests/agent_properties/agent_properties.tscn +++ b/demo/demo/tests/agent_properties/agent_properties.tscn @@ -1,10 +1,13 @@ -[gd_scene load_steps=3 format=3 uid="uid://c3d3ed6545cly"] +[gd_scene load_steps=4 format=3 uid="uid://c3d3ed6545cly"] [ext_resource type="Script" path="res://demo/tests/agent_properties/agent_properties.gd" id="1_jh88u"] [ext_resource type="BehaviorTree" uid="uid://ddhxf0haxgw" path="res://demo/tests/agent_properties/bt_agent_properties.tres" id="2_txe8k"] +[sub_resource type="BlackboardPlan" id="BlackboardPlan_18k5d"] + [node name="AgentProperties" type="Node2D"] script = ExtResource("1_jh88u") [node name="BTPlayer" type="BTPlayer" parent="."] behavior_tree = ExtResource("2_txe8k") +blackboard_plan = SubResource("BlackboardPlan_18k5d") diff --git a/demo/demo/tests/agent_properties/bt_agent_properties.tres b/demo/demo/tests/agent_properties/bt_agent_properties.tres index a6e6931..dd13af3 100644 --- a/demo/demo/tests/agent_properties/bt_agent_properties.tres +++ b/demo/demo/tests/agent_properties/bt_agent_properties.tres @@ -1,4 +1,6 @@ -[gd_resource type="BehaviorTree" load_steps=29 format=3 uid="uid://ddhxf0haxgw"] +[gd_resource type="BehaviorTree" load_steps=30 format=3 uid="uid://ddhxf0haxgw"] + +[sub_resource type="BlackboardPlan" id="BlackboardPlan_salkr"] [sub_resource type="BBVariant" id="BBVariant_5o8fh"] resource_name = "200" @@ -106,4 +108,5 @@ children = [SubResource("BTSelector_hw3on"), SubResource("BTSetAgentProperty_lh1 children = [SubResource("BTSequence_7bmj1")] [resource] +blackboard_plan = SubResource("BlackboardPlan_salkr") root_task = SubResource("BTRunLimit_034mk") diff --git a/demo/demo/tests/probability_selector/bt_test_probability_selector.tres b/demo/demo/tests/probability_selector/bt_test_probability_selector.tres index 1997bb2..1513bd5 100644 --- a/demo/demo/tests/probability_selector/bt_test_probability_selector.tres +++ b/demo/demo/tests/probability_selector/bt_test_probability_selector.tres @@ -1,4 +1,6 @@ -[gd_resource type="BehaviorTree" load_steps=8 format=3 uid="uid://cen725hsk8lyl"] +[gd_resource type="BehaviorTree" load_steps=9 format=3 uid="uid://cen725hsk8lyl"] + +[sub_resource type="BlackboardPlan" id="BlackboardPlan_00d6h"] [sub_resource type="BTComment" id="BTComment_84hry"] custom_name = "This is a test of ProbabilitySelector choosing action to execute" @@ -24,4 +26,5 @@ children = [SubResource("BTProbabilitySelector_hy6es")] children = [SubResource("BTComment_84hry"), SubResource("BTDelay_mxnxy")] [resource] +blackboard_plan = SubResource("BlackboardPlan_00d6h") root_task = SubResource("BTSequence_auek2") diff --git a/demo/demo/tests/probability_selector/test_probability_selector.tscn b/demo/demo/tests/probability_selector/test_probability_selector.tscn index 0746b2e..6ab354b 100644 --- a/demo/demo/tests/probability_selector/test_probability_selector.tscn +++ b/demo/demo/tests/probability_selector/test_probability_selector.tscn @@ -1,8 +1,11 @@ -[gd_scene load_steps=2 format=3 uid="uid://dgeb7tg8xb3j4"] +[gd_scene load_steps=3 format=3 uid="uid://dgeb7tg8xb3j4"] [ext_resource type="BehaviorTree" uid="uid://cen725hsk8lyl" path="res://demo/tests/probability_selector/bt_test_probability_selector.tres" id="1_lr7l2"] +[sub_resource type="BlackboardPlan" id="BlackboardPlan_8wu7d"] + [node name="test_probability_selector" type="Node2D"] [node name="BTPlayer" type="BTPlayer" parent="."] behavior_tree = ExtResource("1_lr7l2") +blackboard_plan = SubResource("BlackboardPlan_8wu7d")