[gd_scene format=3 uid="uid://dqvrhiqgkd3w1"] [ext_resource type="PackedScene" uid="uid://bnnuke5e7e1yr" path="res://core/ai/agents/human/ai_citizen_walker.tscn" id="1_a2xtd"] [ext_resource type="PackedScene" uid="uid://ceqxsqfiotm5j" path="res://core/ai/agents/human/ai_farmer.tscn" id="2_n3ssi"] [ext_resource type="PackedScene" uid="uid://bbseno7clbepx" path="res://core/ai/agents/human/ai_citizen_sitter.tscn" id="3_fdj8t"] [ext_resource type="PackedScene" uid="uid://dd8wn62anbts8" path="res://core/ai/agents/cow/ai_cow.tscn" id="4_wr508"] [ext_resource type="PackedScene" uid="uid://cayakdk7gmlyg" path="res://core/ai/agents/horse/ai_horse.tscn" id="5_7kg15"] [ext_resource type="PackedScene" uid="uid://c2hg6hu2y5srb" path="res://core/ai/agents/pig/ai_pig.tscn" id="6_hw7u7"] [ext_resource type="PackedScene" uid="uid://2md4l83fy8kr" path="res://core/ai/agents/pug/ai_pug.tscn" id="7_s6v14"] [ext_resource type="PackedScene" uid="uid://bs1bdtm7jdtgb" path="res://core/ai/agents/sheep/ai_sheep.tscn" id="8_amn6p"] [sub_resource type="NavigationMesh" id="NavigationMesh_optuv"] vertices = PackedVector3Array(8.984741, 0.25012434, -0.014038086, 9.234741, 0.25012434, -1.0140381, -18.015259, 0.25012434, -18.014038, 17.984741, 0.25012434, 17.985962, 10.984741, 0.25012434, 1.2359619, 9.234741, 0.25012434, 1.2359619, 10.984741, 0.25012434, -1.0140381, 17.984741, 0.25012434, -18.014038, -18.015259, 0.25012434, 17.985962, 11.234741, 0.25012434, 0.23596191) polygons = [PackedInt32Array(2, 1, 0), PackedInt32Array(5, 4, 3), PackedInt32Array(7, 6, 1), PackedInt32Array(5, 8, 0), PackedInt32Array(0, 8, 2), PackedInt32Array(5, 3, 8), PackedInt32Array(1, 2, 7), PackedInt32Array(3, 4, 9), PackedInt32Array(6, 7, 9), PackedInt32Array(9, 7, 3)] border_size = 2.0 [sub_resource type="PlaneMesh" id="PlaneMesh_optuv"] [sub_resource type="BoxShape3D" id="BoxShape3D_xtjak"] size = Vector3(1.9942131, 0.09710693, 1.984024) [sub_resource type="BoxMesh" id="BoxMesh_lmjyn"] [sub_resource type="BoxShape3D" id="BoxShape3D_lmjyn"] [sub_resource type="Environment" id="Environment_lmjyn"] [node name="GymAI" type="Node3D" unique_id=868339787] [node name="NavigationRegion3D" type="NavigationRegion3D" parent="." unique_id=774907858] navigation_mesh = SubResource("NavigationMesh_optuv") [node name="Floor" type="MeshInstance3D" parent="NavigationRegion3D" unique_id=1976415311] transform = Transform3D(20, 0, 0, 0, 20, 0, 0, 0, 20, 0, -0.83473957, 0) mesh = SubResource("PlaneMesh_optuv") [node name="StaticBody3D" type="StaticBody3D" parent="NavigationRegion3D/Floor" unique_id=2007477719] [node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/Floor/StaticBody3D" unique_id=1446628130] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0036563873, -0.009703338, -0.00868988) shape = SubResource("BoxShape3D_xtjak") [node name="Obstacle" type="MeshInstance3D" parent="NavigationRegion3D" unique_id=710701082] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10.148018, 0.06508446, 0) mesh = SubResource("BoxMesh_lmjyn") [node name="StaticBody3D" type="StaticBody3D" parent="NavigationRegion3D/Obstacle" unique_id=67152580] [node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/Obstacle/StaticBody3D" unique_id=1663742898] shape = SubResource("BoxShape3D_lmjyn") [node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1772424900] environment = SubResource("Environment_lmjyn") [node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=269230449] transform = Transform3D(1, 0, 0, 0, 0.17952333, 0.98375374, 0, -0.98375374, 0.17952333, 0, 18.920979, 0) [node name="Control" type="Control" parent="." unique_id=1072240389] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 [node name="PanelContainer" type="PanelContainer" parent="Control" unique_id=1647272132] layout_mode = 0 offset_left = 50.0 offset_top = 50.0 offset_right = 400.0 offset_bottom = 827.0 [node name="Label" type="Label" parent="Control/PanelContainer" unique_id=272421245] custom_minimum_size = Vector2(1, 1) layout_mode = 2 size_flags_vertical = 1 text = "System Logic: - The NPC uses a finite state machine to switch between behaviors. - State logic runs during physics updates, while movement is handled by the agent through NavigationAgent3D. AI States: - IdleState: The agent waits in place for the duration defined by wait_time. - PatrolState: The agent selects a valid random destination and moves toward it. Core Components: - NavigationAgent3D: Calculates the path and reports when the destination has been reached. - PatrolRadiusShape: Defines the random movement area used when choosing the next patrol point. - StateMachine: Initializes the available states and handles transitions between them. Parameters: - Speed: Movement speed of the agent. - Wait Time: Delay in seconds on the IdleState node. - Area Radius: Radius of the SphereShape3D used by PatrolRadiusShape." autowrap_mode = 2 [node name="AiCitizenWalker" parent="." unique_id=1228675528 instance=ExtResource("1_a2xtd")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.690094, 1, -11.367183) [node name="Camera3D" type="Camera3D" parent="." unique_id=1753000680] transform = Transform3D(1, 0, 0, 0, 0.42261824, 0.9063078, 0, -0.9063078, 0.42261824, 0, 18.361065, 15.377485) [node name="AiFarmer" parent="." unique_id=1839077075 instance=ExtResource("2_n3ssi")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2447205, 0.94226265, 2.9251099) [node name="AiCitizenSitter" parent="." unique_id=127569260 instance=ExtResource("3_fdj8t")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.074956, 1.3552468, 11.883549) [node name="AiCow" parent="." unique_id=1021070481 instance=ExtResource("4_wr508")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.4981034, 0.94226265, 15.013644) [node name="AiHorse" parent="." unique_id=71046494 instance=ExtResource("5_7kg15")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.385908, 0.94226265, 14.142443) [node name="AiPig" parent="." unique_id=430569938 instance=ExtResource("6_hw7u7")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.327689, 0.94226265, 6.6309185) [node name="AiPug" parent="." unique_id=1284695236 instance=ExtResource("7_s6v14")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.4858246, 0.9422617, 9.294181) [node name="AiSheep" parent="." unique_id=806542551 instance=ExtResource("8_amn6p")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.740941, 1.1779783, 16.328548)