AI has better detection, committing before a larger rework

This commit is contained in:
derek
2025-04-24 15:22:30 -05:00
parent 53ce4e401f
commit 9be895e89f
19 changed files with 240 additions and 48 deletions

View File

@@ -45,12 +45,12 @@ start_mags = 10
bullet_damage = 1
smoke_enabled = false
bullet_force_mod = 5.0
bullet_speed = 600
bullet_speed = 150
vibration_weak_magnitude = 0.1
vibration_strong_magnitude = 0.5
vibration_duration = 0.1
chamber_rot_amount = 60.0
shotgun_spread = Vector3(180, 180, 180)
shotgun_spread = Vector3(45, 45, 45)
pellets_per_shot = 50
blast_power = 50.0
hitscan_range = 100.0

View File

@@ -34,7 +34,7 @@ mass = 0.01
physics_material_override = SubResource("PhysicsMaterial_0ewk3")
continuous_cd = true
contact_monitor = true
max_contacts_reported = 1
max_contacts_reported = 10
script = ExtResource("1_1v1ju")
collision_shape = NodePath("CollisionShape3D")
mesh = NodePath("MeshInstance3D")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=87 format=4 uid="uid://djr7vnr1hcx82"]
[gd_scene load_steps=88 format=4 uid="uid://djr7vnr1hcx82"]
[ext_resource type="Script" uid="uid://cdofgtwevbray" path="res://scripts/spider.gd" id="1_7e7fe"]
[ext_resource type="PackedScene" uid="uid://h5ojldugfyyu" path="res://assets/bullet_enemy.tscn" id="2_aew5r"]
@@ -29,6 +29,9 @@
[ext_resource type="AudioStream" uid="uid://d0n46ursprjjs" path="res://assets/Audio/Enemy SFX/servo-motor-SBA-300109173.mp3" id="25_lr3lm"]
[ext_resource type="AudioStream" uid="uid://br3tyu6cmgyy2" path="res://assets/Audio/Weapons/7Mag Bolt Action Rifle/Gunshots/7Mag Bolt Action Rifle - Gunshot A 004.wav" id="26_1b3cb"]
[sub_resource type="SphereShape3D" id="SphereShape3D_fborx"]
radius = 15.0
[sub_resource type="ViewportTexture" id="ViewportTexture_87l3v"]
viewport_path = NodePath("SubViewport")
@@ -821,12 +824,14 @@ random_pitch = 1.1
streams_count = 1
stream_0/stream = ExtResource("25_lr3lm")
[node name="spider" type="CharacterBody3D" node_paths=PackedStringArray("nav_agent") groups=["enemy", "persist"]]
[node name="spider" type="CharacterBody3D" node_paths=PackedStringArray("nav_agent", "visibility_areas", "line_of_sight_ray") groups=["enemy", "persist"]]
collision_layer = 8
collision_mask = 521
up_direction = Vector3(0.0449994, 0.998987, 0)
script = ExtResource("1_7e7fe")
nav_agent = NodePath("NavigationAgent3D")
visibility_areas = [NodePath("VisibilityArea")]
line_of_sight_ray = NodePath("LineOfSight")
bullet = ExtResource("2_aew5r")
casing = ExtResource("3_e5ft5")
bullet_speed = 75
@@ -843,6 +848,7 @@ initial_state = NodePath("Idle")
script = ExtResource("7_cwyr0")
enemy = NodePath("../..")
enemy_targets = [NodePath("../../body/backTarget")]
can_see = true
[node name="Stunned" type="Node" parent="StateMachine" node_paths=PackedStringArray("stunned_stars", "enemy", "enemy_targets")]
script = ExtResource("8_wpql0")
@@ -859,6 +865,7 @@ metadata/_custom_type_script = "uid://dhxolagi0b5s1"
script = ExtResource("10_gicen")
enemy = NodePath("../..")
enemy_targets = [NodePath("../../body/backTarget")]
can_see = true
[node name="Reload" type="Node" parent="StateMachine" node_paths=PackedStringArray("reload_sound", "enemy", "enemy_targets")]
script = ExtResource("11_ekglj")
@@ -866,6 +873,14 @@ reload_sound = NodePath("../../AUIDO/Reload")
enemy = NodePath("../..")
enemy_targets = [NodePath("../../body/backTarget")]
[node name="VisibilityArea" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 4
[node name="CollisionShape3D" type="CollisionShape3D" parent="VisibilityArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -14.4461)
shape = SubResource("SphereShape3D_fborx")
[node name="HealthBarSprite" parent="." node_paths=PackedStringArray("character") instance=ExtResource("7_87l3v")]
transform = Transform3D(0.254412, 0, 0, 0, 0.561068, 0, 0, 0, 1, 0, 2.41498, 0)
billboard = 2
@@ -937,6 +952,11 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00161432, 1.62046, 0.001342
target_position = Vector3(0, 0, -50)
collision_mask = 5
[node name="LineOfSight" type="RayCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00161432, 1.62046, 0.00134204)
target_position = Vector3(0, 0, -50)
collision_mask = 5
[node name="SpiderLookNext" type="RayCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00161432, 1.62046, 0.00134204)
target_position = Vector3(0, 0, -50)