From e376d0b5225085da3e3fa8b2ee3026fc55400955 Mon Sep 17 00:00:00 2001 From: Pawel Lampe Date: Thu, 25 Jan 2024 22:32:28 +0100 Subject: [PATCH] Improve navigation/agent-related settings, #74 --- source/match/Match.tscn | 7 +++++-- source/match/MatchConstants.gd | 6 +++--- source/match/units/AircraftFactory.tscn | 2 +- source/match/units/AntiAirTurret.tscn | 2 +- source/match/units/AntiGroundTurret.tscn | 2 +- source/match/units/CommandCenter.tscn | 2 +- source/match/units/Tank.tscn | 5 ++++- source/match/units/VehicleFactory.tscn | 2 +- source/match/units/non-player/ResourceA.tscn | 1 + source/match/units/non-player/ResourceB.tscn | 1 + 10 files changed, 19 insertions(+), 11 deletions(-) diff --git a/source/match/Match.tscn b/source/match/Match.tscn index b08a495..d6f2ffb 100644 --- a/source/match/Match.tscn +++ b/source/match/Match.tscn @@ -97,9 +97,12 @@ geometry_parsed_geometry_type = 2 geometry_collision_mask = 4278190082 geometry_source_geometry_mode = 2 geometry_source_group_name = &"terrain_navigation_input" -agent_height = 2.0 -agent_radius = 1.0 +cell_size = 0.3 +cell_height = 0.3 +agent_height = 1.8 +agent_radius = 0.9 agent_max_climb = 0.0 +edge_max_error = 1.0 [sub_resource type="ViewportTexture" id="ViewportTexture_vu2gm"] viewport_path = NodePath("FogOfWar/CombinedViewport") diff --git a/source/match/MatchConstants.gd b/source/match/MatchConstants.gd index 011830d..1ce08c8 100644 --- a/source/match/MatchConstants.gd +++ b/source/match/MatchConstants.gd @@ -41,9 +41,9 @@ class Terrain: const PLANE = Plane(Vector3.UP, 0) class Navmesh: - const CELL_SIZE = 0.25 - const CELL_HEIGHT = 0.25 - const MAX_AGENT_RADIUS = 1.0 # max radius of movable units + const CELL_SIZE = 0.3 + const CELL_HEIGHT = 0.3 + const MAX_AGENT_RADIUS = 0.9 # max radius of movable units class Resources: diff --git a/source/match/units/AircraftFactory.tscn b/source/match/units/AircraftFactory.tscn index 6ce3fd6..bfcec49 100644 --- a/source/match/units/AircraftFactory.tscn +++ b/source/match/units/AircraftFactory.tscn @@ -17,7 +17,7 @@ radius = 1.5 [sub_resource type="CylinderShape3D" id="CylinderShape3D_ea0ur"] height = 1.0 -radius = 1.5 +radius = 1.1 [sub_resource type="BoxShape3D" id="BoxShape3D_67hxr"] size = Vector3(0.1, 5, 0.1) diff --git a/source/match/units/AntiAirTurret.tscn b/source/match/units/AntiAirTurret.tscn index f024198..6e9a5df 100644 --- a/source/match/units/AntiAirTurret.tscn +++ b/source/match/units/AntiAirTurret.tscn @@ -16,7 +16,7 @@ radius = 0.6 [sub_resource type="CylinderShape3D" id="CylinderShape3D_65kle"] height = 0.8 -radius = 0.6 +radius = 0.2 [node name="AntiAirTurret" type="Area3D"] collision_layer = 2 diff --git a/source/match/units/AntiGroundTurret.tscn b/source/match/units/AntiGroundTurret.tscn index c7b1854..de10814 100644 --- a/source/match/units/AntiGroundTurret.tscn +++ b/source/match/units/AntiGroundTurret.tscn @@ -16,7 +16,7 @@ radius = 0.6 [sub_resource type="CylinderShape3D" id="CylinderShape3D_t2frt"] height = 0.8 -radius = 0.6 +radius = 0.2 [node name="AntiGroundTurret" type="Area3D"] collision_layer = 2 diff --git a/source/match/units/CommandCenter.tscn b/source/match/units/CommandCenter.tscn index bd4f49a..4b30e83 100644 --- a/source/match/units/CommandCenter.tscn +++ b/source/match/units/CommandCenter.tscn @@ -17,7 +17,7 @@ radius = 1.8 [sub_resource type="CylinderShape3D" id="CylinderShape3D_2xy8f"] height = 0.8 -radius = 1.8 +radius = 1.4 [sub_resource type="BoxShape3D" id="BoxShape3D_mt1cx"] size = Vector3(0.1, 5, 0.1) diff --git a/source/match/units/Tank.tscn b/source/match/units/Tank.tscn index e5f35b1..d5aac56 100644 --- a/source/match/units/Tank.tscn +++ b/source/match/units/Tank.tscn @@ -36,16 +36,18 @@ shape = SubResource("CylinderShape3D_sjc11") [node name="Highlight" parent="." instance=ExtResource("1_n4t54")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0) +radius = 0.9 [node name="Selection" parent="." instance=ExtResource("2_mbcqe")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0) +radius = 0.9 [node name="Movement" parent="." instance=ExtResource("3_4m8ma")] path_desired_distance = 0.5 target_desired_distance = 0.5 path_height_offset = 0.5 path_max_distance = 0.51 -radius = 1.0 +radius = 0.9 neighbor_distance = 8.0 max_neighbors = 40 time_horizon_agents = 3.0 @@ -57,3 +59,4 @@ size = Vector2(160, 10) [node name="Targetability" parent="." instance=ExtResource("8_ca2nt")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0) +radius = 0.9 diff --git a/source/match/units/VehicleFactory.tscn b/source/match/units/VehicleFactory.tscn index 07c71cf..22ec18a 100644 --- a/source/match/units/VehicleFactory.tscn +++ b/source/match/units/VehicleFactory.tscn @@ -17,7 +17,7 @@ radius = 1.5 [sub_resource type="CylinderShape3D" id="CylinderShape3D_x8l2r"] height = 1.0 -radius = 1.5 +radius = 1.1 [sub_resource type="BoxShape3D" id="BoxShape3D_jajvw"] size = Vector3(0.1, 5, 0.1) diff --git a/source/match/units/non-player/ResourceA.tscn b/source/match/units/non-player/ResourceA.tscn index 80a46c9..70049ce 100644 --- a/source/match/units/non-player/ResourceA.tscn +++ b/source/match/units/non-player/ResourceA.tscn @@ -13,6 +13,7 @@ height = 0.6 [sub_resource type="CylinderShape3D" id="CylinderShape3D_wb6so"] height = 0.6 +radius = 0.1 [node name="ResourceA" type="Area3D" groups=["resource_units"]] script = ExtResource("1_3daqx") diff --git a/source/match/units/non-player/ResourceB.tscn b/source/match/units/non-player/ResourceB.tscn index d792713..9b2895a 100644 --- a/source/match/units/non-player/ResourceB.tscn +++ b/source/match/units/non-player/ResourceB.tscn @@ -13,6 +13,7 @@ height = 0.8 [sub_resource type="CylinderShape3D" id="CylinderShape3D_002vj"] height = 0.8 +radius = 0.1 [node name="ResourceB" type="Area3D" groups=["resource_units"]] script = ExtResource("1_57n8v")