tweaks to ai, pickup drops, and added scene image capturerer

This commit is contained in:
derek
2025-05-06 17:00:05 -05:00
parent 617c78d2e7
commit 739af6feeb
13 changed files with 136 additions and 24 deletions

View File

@@ -0,0 +1,62 @@
[gd_scene load_steps=9 format=3 uid="uid://bogw8jyy11bmy"]
[ext_resource type="Script" uid="uid://cdn5lcvtn15ng" path="res://scripts/texture_catcher.gd" id="1_ufykk"]
[ext_resource type="PackedScene" uid="uid://b73qmmwsxnkgh" path="res://scenes/on_all_sides.tscn" id="2_fxwbd"]
[ext_resource type="PackedScene" uid="uid://cwy8iv8nlwqrc" path="res://assets/realtime_day_night_cycle.tscn" id="3_prwgy"]
[ext_resource type="Shader" uid="uid://b25ccujykxt3c" path="res://assets/Shaders/outline.gdshader" id="13_33tqg"]
[sub_resource type="ViewportTexture" id="ViewportTexture_xiqw1"]
viewport_path = NodePath("CAPTURE/SubViewport")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hif0q"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hs00l"]
render_priority = 0
next_pass = SubResource("ShaderMaterial_hif0q")
shader = ExtResource("13_33tqg")
shader_parameter/outlineColor = Color(0, 0, 0, 1)
shader_parameter/depth_threshold = 0.025
shader_parameter/normal_threshold = 0.5
shader_parameter/normal_smoothing = 0.25
shader_parameter/max_thickness = 1.3
shader_parameter/min_thickness = 0.5
shader_parameter/max_distance = 75.0
shader_parameter/min_distance = 2.0
shader_parameter/grazing_fresnel_power = 5.0
shader_parameter/grazing_angle_mask_power = 1.0
shader_parameter/grazing_angle_modulation_factor = 50.0
[sub_resource type="QuadMesh" id="QuadMesh_wigdd"]
material = SubResource("ShaderMaterial_hs00l")
flip_faces = true
size = Vector2(2, 2)
[node name="TextureCatcher" type="Node3D"]
script = ExtResource("1_ufykk")
path = "res://assets/Textures/SceneThumbnails/%s.png"
[node name="CAPTURE" type="Node3D" parent="."]
[node name="SubViewport" type="SubViewport" parent="CAPTURE"]
size = Vector2i(1024, 1024)
render_target_update_mode = 4
[node name="Camera3D" type="Camera3D" parent="CAPTURE/SubViewport"]
transform = Transform3D(1, 0, 0, 0, 0.866025, 0.5, 0, -0.5, 0.866026, 0, 0, 0)
size = 1.86
[node name="snapshotModel" type="Node3D" parent="CAPTURE/SubViewport"]
[node name="On All Sides" parent="CAPTURE/SubViewport/snapshotModel" instance=ExtResource("2_fxwbd")]
transform = Transform3D(-0.329789, 0, 0.944054, 0, 1, 0, -0.944054, 0, -0.329789, 1.67579, -15.3228, -39.0264)
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = SubResource("ViewportTexture_xiqw1")
[node name="PostProcessing" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.271851, 1.43588, -9.80906)
extra_cull_margin = 16384.0
mesh = SubResource("QuadMesh_wigdd")
[node name="Realtime Day Night Cycle" parent="." instance=ExtResource("3_prwgy")]
realtime = false

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dbu18xnrcfqjx"
path="res://.godot/imported/On All Sides.png-dd711c7b17487d592c48fe209f4a78c3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Textures/SceneThumbnails/On All Sides.png"
dest_files=["res://.godot/imported/On All Sides.png-dd711c7b17487d592c48fe209f4a78c3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,9 +1,9 @@
[gd_scene load_steps=21 format=3 uid="uid://dslxb3psx30vp"] [gd_scene load_steps=22 format=3 uid="uid://dslxb3psx30vp"]
[ext_resource type="PackedScene" uid="uid://svrb3n31mkag" path="res://assets/Models/gun.blend" id="1_frekg"] [ext_resource type="PackedScene" uid="uid://svrb3n31mkag" path="res://assets/Models/gun.blend" id="1_frekg"]
[ext_resource type="Script" uid="uid://dhr2xfj3qow4c" path="res://scripts/weapon_uberscript.gd" id="2_wrnws"] [ext_resource type="Script" uid="uid://dhr2xfj3qow4c" path="res://scripts/weapon_uberscript.gd" id="2_wrnws"]
[ext_resource type="Resource" uid="uid://dpcoofjsxi10q" path="res://assets/weaponresources/pistol1.tres" id="3_er7xg"] [ext_resource type="Resource" uid="uid://dpcoofjsxi10q" path="res://assets/weaponresources/pistol1.tres" id="3_er7xg"]
[ext_resource type="AudioStream" uid="uid://bxjv50ivk3fvn" path="res://assets/Audio/Weapons/9mm Full Size Pistol/Gunshots/9mm Full Size Pistol - Gunshot B 001.wav" id="7_25stk"] [ext_resource type="AudioStream" uid="uid://b1d7gfcemx280" path="res://assets/Audio/Weapons/9mm Micro Pistol/Gunshots/9mm Micro Pistol - Gunshot A 002.wav" id="4_er7xg"]
[ext_resource type="AudioStream" uid="uid://t50i483xmj3a" path="res://assets/Audio/Weapons/toy-click-spin-SBA-300071143.wav" id="9_btm61"] [ext_resource type="AudioStream" uid="uid://t50i483xmj3a" path="res://assets/Audio/Weapons/toy-click-spin-SBA-300071143.wav" id="9_btm61"]
[ext_resource type="AudioStream" uid="uid://db3iy0f1pa5lg" path="res://assets/Audio/Weapons/gun-m-16-reload-full-clip-magazine-SBA-300121257.wav" id="10_xn8pu"] [ext_resource type="AudioStream" uid="uid://db3iy0f1pa5lg" path="res://assets/Audio/Weapons/gun-m-16-reload-full-clip-magazine-SBA-300121257.wav" id="10_xn8pu"]
[ext_resource type="Texture2D" uid="uid://dtg3nb2ew72c3" path="res://assets/star_05.png" id="11_x0sef"] [ext_resource type="Texture2D" uid="uid://dtg3nb2ew72c3" path="res://assets/star_05.png" id="11_x0sef"]
@@ -445,6 +445,13 @@ _data = {
&"swap_out": SubResource("Animation_lleyf") &"swap_out": SubResource("Animation_lleyf")
} }
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_3q8ts"]
random_pitch = 1.1
streams_count = 3
stream_0/stream = ExtResource("4_er7xg")
stream_1/stream = ExtResource("4_er7xg")
stream_2/stream = ExtResource("4_er7xg")
[node name="Pistol" node_paths=PackedStringArray("anim_player", "barrel_ray", "casing_ejector", "mag_ejector", "audio_fire", "audio_empty", "audio_reload") instance=ExtResource("1_frekg")] [node name="Pistol" node_paths=PackedStringArray("anim_player", "barrel_ray", "casing_ejector", "mag_ejector", "audio_fire", "audio_empty", "audio_reload") instance=ExtResource("1_frekg")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0145504, -0.0460228) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0145504, -0.0460228)
script = ExtResource("2_wrnws") script = ExtResource("2_wrnws")
@@ -492,8 +499,7 @@ libraries = {
[node name="Audio" type="Node3D" parent="." index="2"] [node name="Audio" type="Node3D" parent="." index="2"]
[node name="Fire" type="AudioStreamPlayer3D" parent="Audio" index="0"] [node name="Fire" type="AudioStreamPlayer3D" parent="Audio" index="0"]
stream = ExtResource("7_25stk") stream = SubResource("AudioStreamRandomizer_3q8ts")
volume_db = 5.0
bus = &"SFX" bus = &"SFX"
[node name="Empty" type="AudioStreamPlayer3D" parent="Audio" index="1"] [node name="Empty" type="AudioStreamPlayer3D" parent="Audio" index="1"]

View File

@@ -464,6 +464,7 @@ size = Vector2(2, 2)
[node name="TextureCatcher" type="Node3D"] [node name="TextureCatcher" type="Node3D"]
script = ExtResource("1_x3mk2") script = ExtResource("1_x3mk2")
path = null
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_w2vw8") environment = SubResource("Environment_w2vw8")

View File

@@ -12,7 +12,7 @@ config_version=5
config/name="First Person Test" config/name="First Person Test"
config/tags=PackedStringArray("fps") config/tags=PackedStringArray("fps")
run/main_scene="uid://b55ukxds1s7ih" run/main_scene="uid://f7e0v1r6ra6c"
config/features=PackedStringArray("4.4", "Forward Plus") config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="uid://6svuq1l83al5" config/icon="uid://6svuq1l83al5"

View File

@@ -197,10 +197,10 @@ use_collision = true
size = Vector3(25.4058, 1, 51.1521) size = Vector3(25.4058, 1, 51.1521)
[node name="CSGBox3D9" type="CSGBox3D" parent="NavigationRegion3D"] [node name="CSGBox3D9" type="CSGBox3D" parent="NavigationRegion3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -39.099, 4.64942, -0.755195) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -39.099, 5.1211, -0.755195)
material_override = ExtResource("3_qhpyo") material_override = ExtResource("3_qhpyo")
use_collision = true use_collision = true
size = Vector3(7.59146, 7.0918, 39.0459) size = Vector3(7.59146, 6.14844, 39.0459)
[node name="CSGBox3D10" type="CSGBox3D" parent="NavigationRegion3D"] [node name="CSGBox3D10" type="CSGBox3D" parent="NavigationRegion3D"]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 2.14892, 0, -34.5955) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 2.14892, 0, -34.5955)
@@ -221,10 +221,10 @@ use_collision = true
size = Vector3(25.4058, 1, 51.1521) size = Vector3(25.4058, 1, 51.1521)
[node name="CSGBox3D13" type="CSGBox3D" parent="NavigationRegion3D"] [node name="CSGBox3D13" type="CSGBox3D" parent="NavigationRegion3D"]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 38.7217, 4.82715, 8.97686) transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 38.7217, 5.39478, 8.97686)
material_override = ExtResource("3_qhpyo") material_override = ExtResource("3_qhpyo")
use_collision = true use_collision = true
size = Vector3(7.59146, 6.73633, 39.0459) size = Vector3(7.59146, 5.60108, 39.0459)
[node name="CSGBox3D14" type="CSGBox3D" parent="NavigationRegion3D"] [node name="CSGBox3D14" type="CSGBox3D" parent="NavigationRegion3D"]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -5.54569, 7.62939e-06, 44.682) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -5.54569, 7.62939e-06, 44.682)
@@ -233,10 +233,10 @@ use_collision = true
size = Vector3(25.4058, 1, 51.1521) size = Vector3(25.4058, 1, 51.1521)
[node name="CSGBox3D15" type="CSGBox3D" parent="NavigationRegion3D"] [node name="CSGBox3D15" type="CSGBox3D" parent="NavigationRegion3D"]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -8.15719, 4.7732, 44.728) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -8.15719, 5.08045, 44.728)
material_override = ExtResource("3_qhpyo") material_override = ExtResource("3_qhpyo")
use_collision = true use_collision = true
size = Vector3(7.59146, 6.84424, 39.0459) size = Vector3(7.59146, 6.22974, 39.0459)
[node name="CSGBox3D4" type="CSGBox3D" parent="NavigationRegion3D"] [node name="CSGBox3D4" type="CSGBox3D" parent="NavigationRegion3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.38403, 0, 14.1554) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.38403, 0, 14.1554)

View File

@@ -1,8 +1,11 @@
extends EnemyState extends EnemyState
class_name EnemySearch class_name EnemySearch
@export var max_search_time : float = 10.0
@export var scan_time : float = 3 @export var scan_time : float = 3
@export var scan_cone_angle : float = 90 @export var scan_cone_angle : float = 90
var search_timer = max_search_time
var scan_timer var scan_timer
var scan_direction = scan_cone_angle/2 var scan_direction = scan_cone_angle/2
@@ -11,13 +14,17 @@ func Enter():
get_new_point_of_interest() get_new_point_of_interest()
func Update(delta): func Update(delta):
update_minimap(0,1.0,ColorSwatch.ORANGE_COLOR) if search_timer > 0:
attack_on_sight() search_timer -= delta
#on timeout change scan direction update_minimap(0,1.0,ColorSwatch.ORANGE_COLOR)
if scan_timer > 0: attack_on_sight()
scan_timer -= delta #on timeout change scan direction
if scan_timer > 0:
scan_timer -= delta
else:
change_scan_direction()
else: else:
change_scan_direction() Transitioned.emit(self,"idle")
func Physics_Update(delta): func Physics_Update(delta):
#draw target for debug purposes #draw target for debug purposes

View File

@@ -7,5 +7,5 @@ signal body_part_hit(dam,bullet_damage)
func hit(bullet_damage): func hit(bullet_damage):
emit_signal("body_part_hit", damage, bullet_damage) emit_signal("body_part_hit", damage, bullet_damage)
#func _on_body_entered(body: Node3D) -> void: func _on_body_entered(body: Node3D) -> void:
#hit(body.bullet_damage) hit(body.bullet_damage)

View File

@@ -233,9 +233,9 @@ func pickup_spawn(randomized):
"1": "1":
value = randi_range(int(gamemode.max_stamina * .25),gamemode.max_stamina) value = randi_range(int(gamemode.max_stamina * .25),gamemode.max_stamina)
"2": "2":
value = randi_range(int(gamemode.start_health * .25),gamemode.start_health) value = 1
"3": "3":
var bill_denoms = [5,10,20,50,100] var bill_denoms = [5,10,20]
value = bill_denoms.pick_random() value = bill_denoms.pick_random()

View File

@@ -7,7 +7,7 @@ extends Node3D
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
die_particles.emitting = true die_particles.emitting = true
die_particles_2.emitting = true # die_particles_2.emitting = true
audio_explode.play() audio_explode.play()
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.

View File

@@ -99,7 +99,7 @@ func _ready():
target.body_part_hit.connect(take_damage) target.body_part_hit.connect(take_damage)
func _process(delta): func _process(delta):
line_of_sight.global_position = global_position line_of_sight.global_position = global_position + Vector3(0,1.5,0)
move_and_slide() move_and_slide()
look_at_player() look_at_player()

View File

@@ -1,9 +1,11 @@
@tool @tool
extends Node3D extends Node3D
class_name TextureCamera
@onready var sub_viewport: SubViewport = $CAPTURE/SubViewport @onready var sub_viewport: SubViewport = $CAPTURE/SubViewport
@onready var snapshot_model: Node3D = $CAPTURE/SubViewport/snapshotModel @onready var snapshot_model: Node3D = $CAPTURE/SubViewport/snapshotModel
@export var path : String = "assets/Textures/ObjectTextures/%s.png"
@export var take_snapshot : bool = false @export var take_snapshot : bool = false
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
@@ -17,6 +19,6 @@ func _process(delta: float) -> void:
var snapshot_name = snapshot_model.get_child(0).get_name() var snapshot_name = snapshot_model.get_child(0).get_name()
await get_tree().create_timer(.5).timeout await get_tree().create_timer(.5).timeout
var img = sub_viewport.get_viewport().get_texture().get_image() var img = sub_viewport.get_viewport().get_texture().get_image()
var image_path = "assets/Textures/ObjectTextures/%s.png" % snapshot_name var image_path = path % snapshot_name
img.save_png(image_path) img.save_png(image_path)
take_snapshot = false take_snapshot = false