diff --git a/component/FollowerSprite.gd b/component/FollowerSprite.gd index 98a5634..a0c3ef1 100644 --- a/component/FollowerSprite.gd +++ b/component/FollowerSprite.gd @@ -18,9 +18,8 @@ func _deferred_ready(): material = material.duplicate(true) material.set_shader_parameter("radius", type.radius) material.set_shader_parameter("offset", type.offset) - # Kind of a hack - parent.item_screen_box_side_length = 2 * type.radius + 25 + parent.item_screen_box_side_length = 3 * type.radius + 25 func _process(_delta): if parent: diff --git a/component/controllers/ai/AIController.gd b/component/controllers/ai/AIController.gd index 4466364..ad3445b 100644 --- a/component/controllers/ai/AIController.gd +++ b/component/controllers/ai/AIController.gd @@ -48,6 +48,13 @@ func _verify_target(): change_state_idle() return false return true + +func _verify_path_target(): + if path_target == null or not is_instance_valid(path_target): + #print("No target", target) + change_state_idle() + return false + return true func _physics_process(delta): if get_tree().debug_collisions_hint: @@ -70,6 +77,7 @@ func _physics_process(delta): process_warping_out(delta) func process_state_path(delta): + _verify_path_target() populate_rotation_impulse_and_ideal_face( Util.flatten_25d(path_target.global_transform.origin), delta diff --git a/data/biomes.csv b/data/biomes.csv index 35acff1..963511b 100644 --- a/data/biomes.csv +++ b/data/biomes.csv @@ -1,10 +1,10 @@ -id,name,spawns_old,spawns,quadrants,map_color,ambient_color,starlight_color,do_seed,foreground,background -empty,Deserted,sleeper asteroids,planet,A B,#C0C0C0,#262626,#FFFFFF,TRUE,res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Blue Nebula/1024x1024 Blue Nebula 4.png -aliens,Purple,aliens sleeper red_asteroids aliens,asteroids planet,B C,#FF0000,#262626,#FFFFFF,TRUE,res://assets/ScreamingBrain/sharp_neb/modified/1024x1024 Orange Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 4.png -rich,Rich,blue_asteroids green_asteroids free_asteroids planet,planet,C D,#A0A0A0,#262626,#FFFFFF,FALSE,res://assets/ScreamingBrain/sharp_neb/Purple Nebula/1024x1024 Purple Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Blue Nebula/1024x1024 Blue Nebula 4.png -blue,Blue,aliens sleeper planet,planet asteroids_blue,D A,#000080,#262626,#FFFFFF,TRUE,res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 2.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 3.png -green,Green,aliens green_asteroids planet,planet asteroids_green,A C,#00AA00,#262626,#FFFFFF,TRUE,res://assets/ScreamingBrain/sharp_neb/Green Nebula/1024x1024 Green Nebula 2.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 4.png -orange,Orange,aliens sleeper red_asteroids planet,asteroids planet,B D,#FF4500,#262626,#FFFFFF,TRUE,res://assets/ScreamingBrain/sharp_neb/modified/1024x1024 Purple Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Blue Nebula/1024x1024 Blue Nebula 4.png -lightblue,Light Blue,aliens sleeper blue_asteroids green_asteroids planet,planet asteroids_blue asteroids_green,D A,#00CED1,#262626,#FFFFFF,TRUE,res://assets/ScreamingBrain/sharp_neb/Purple Nebula/1024x1024 Purple Nebula 2.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 3.png -gold,Gold,asteroids asteroids yellow_asteroids sleeper sleeper,asteroids,A B C,#FFD700,#262626,#FFFFFF,TRUE,res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 3.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 4.png -purple,Purple,blue_asteroids red_asteroids asteroids sleeper aliens,planet,A B D,#800080,#262626,#FFFFFF,TRUE,res://assets/ScreamingBrain/sharp_neb/modified/1024x1024 Red Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Blue Nebula/1024x1024 Blue Nebula 4.png +id,name,spawns_old,spawns,quadrants,map_color,ambient_color,starlight_color,do_seed,grow,foreground,background +empty,Deserted,sleeper asteroids,planet,A B,#C0C0C0,#262626,#FFFFFF,TRUE,FALSE,res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Blue Nebula/1024x1024 Blue Nebula 4.png +aliens,Purple,aliens sleeper red_asteroids aliens,asteroids planet,B C,#FF0000,#262626,#FFFFFF,TRUE,TRUE,res://assets/ScreamingBrain/sharp_neb/modified/1024x1024 Orange Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 4.png +rich,Rich,blue_asteroids green_asteroids free_asteroids planet,planet,C D,#A0A0A0,#262626,#FFFFFF,FALSE,FALSE,res://assets/ScreamingBrain/sharp_neb/Purple Nebula/1024x1024 Purple Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Blue Nebula/1024x1024 Blue Nebula 4.png +blue,Blue,aliens sleeper planet,planet asteroids_blue,D A,#000080,#262626,#FFFFFF,TRUE,TRUE,res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 2.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 3.png +green,Green,aliens green_asteroids planet,planet asteroids_green,A C,#00AA00,#262626,#FFFFFF,TRUE,TRUE,res://assets/ScreamingBrain/sharp_neb/Green Nebula/1024x1024 Green Nebula 2.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 4.png +orange,Orange,aliens sleeper red_asteroids planet,asteroids planet,B D,#FF4500,#262626,#FFFFFF,TRUE,TRUE,res://assets/ScreamingBrain/sharp_neb/modified/1024x1024 Purple Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Blue Nebula/1024x1024 Blue Nebula 4.png +lightblue,Light Blue,aliens sleeper blue_asteroids green_asteroids planet,planet asteroids_blue asteroids_green,D A,#00CED1,#262626,#FFFFFF,TRUE,TRUE,res://assets/ScreamingBrain/sharp_neb/Purple Nebula/1024x1024 Purple Nebula 2.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 3.png +gold,Gold,asteroids asteroids yellow_asteroids sleeper sleeper,asteroids,A B C,#FFD700,#262626,#FFFFFF,TRUE,FALSE,res://assets/ScreamingBrain/sharp_neb/Blue Nebula/1024x1024 Blue Nebula 3.png,res://assets/ScreamingBrain/soft_neb/Green Nebula/1024x1024 Green Nebula 4.png +purple,Purple,blue_asteroids red_asteroids asteroids sleeper aliens,planet,A B D,#800080,#262626,#FFFFFF,TRUE,TRUE,res://assets/ScreamingBrain/sharp_neb/modified/1024x1024 Red Nebula 1.png,res://assets/ScreamingBrain/soft_neb/Blue Nebula/1024x1024 Blue Nebula 4.png diff --git a/data/spobs.csv b/data/spobs.csv index e280b19..5a96a5e 100644 --- a/data/spobs.csv +++ b/data/spobs.csv @@ -66,7 +66,7 @@ rc-21,res://assets/eamonn/lunarcell_planets/rc-21.png,63,0 0, rc-22,res://assets/eamonn/lunarcell_planets/rc-22.png,63,0 0, rc-23,res://assets/eamonn/lunarcell_planets/rc-23.png,63,0 0, rc-24,res://assets/eamonn/lunarcell_planets/rc-24.png,63,0 0, -rc-25,res://assets/eamonn/lunarcell_planets/rc-25.png,63,0 0, +rc-25,res://assets/eamonn/lunarcell_planets/rc-25.png,62,-2 0, rc-26,res://assets/eamonn/lunarcell_planets/rc-26.png,63,0 0, rc-27,res://assets/eamonn/lunarcell_planets/rc-27.png,63,0 0, rc-28,res://assets/eamonn/lunarcell_planets/rc-28.png,63,0 0, diff --git a/entities/constructed/Telescope.gd b/entities/constructed/Telescope.gd index 3dbde19..88e06c6 100644 --- a/entities/constructed/Telescope.gd +++ b/entities/constructed/Telescope.gd @@ -23,7 +23,8 @@ func _ready(): func serialize() -> Dictionary: return Util.get_multiple(self, [ "transform", - "scene_file_path" + "scene_file_path", + "spob_name" ]) func deserialize(data: Dictionary): diff --git a/entities/constructed/TurretStation.gd b/entities/constructed/TurretStation.gd index 54eaf7b..06097bf 100644 --- a/entities/constructed/TurretStation.gd +++ b/entities/constructed/TurretStation.gd @@ -18,7 +18,8 @@ func _ready(): func serialize() -> Dictionary: return Util.get_multiple(self, [ "transform", - "scene_file_path" + "scene_file_path", + "spob_name" ]) func deserialize(data: Dictionary): diff --git a/entities/constructed/Workbench.gd b/entities/constructed/Workbench.gd index 9e2787c..faa9d73 100644 --- a/entities/constructed/Workbench.gd +++ b/entities/constructed/Workbench.gd @@ -23,7 +23,8 @@ func _ready(): func serialize() -> Dictionary: return Util.get_multiple(self, [ "transform", - "scene_file_path" + "scene_file_path", + "spob_name" ]) func deserialize(data: Dictionary): diff --git a/entities/spobs/Spob.tscn b/entities/spobs/Spob.tscn index c851b7e..7aac5e9 100644 --- a/entities/spobs/Spob.tscn +++ b/entities/spobs/Spob.tscn @@ -2,13 +2,13 @@ [ext_resource type="Script" path="res://entities/spobs/Spob.gd" id="1_1liil"] [ext_resource type="Shader" path="res://entities/spobs/Spob.gdshader" id="2_ryjfe"] -[ext_resource type="Texture2D" uid="uid://dr05w1fp8yyka" path="res://assets/eamonn/lunarcell_planets/Untitled-5.png" id="3_imvle"] [ext_resource type="Script" path="res://component/FollowerSprite.gd" id="3_mu5to"] +[ext_resource type="Texture2D" uid="uid://doyi0ng7eb3b7" path="res://assets/eamonn/lunarcell_planets/rc-25.png" id="3_p27b8"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_i6h1x"] shader = ExtResource("2_ryjfe") -shader_parameter/center = Vector2(6, -2) -shader_parameter/radius = 63 +shader_parameter/center = Vector2(-2, 0) +shader_parameter/radius = 62 [sub_resource type="SphereShape3D" id="SphereShape3D_gve3x"] radius = 2.5 @@ -21,7 +21,7 @@ spob_prefix = "UBP-" [node name="FollowerSprite" type="Sprite2D" parent="."] material = SubResource("ShaderMaterial_i6h1x") -texture = ExtResource("3_imvle") +texture = ExtResource("3_p27b8") script = ExtResource("3_mu5to") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] diff --git a/entities/spobs/TormentNexus.gd b/entities/spobs/TormentNexus.gd index bf7ecc0..52a15f6 100644 --- a/entities/spobs/TormentNexus.gd +++ b/entities/spobs/TormentNexus.gd @@ -1,11 +1,10 @@ extends StaticBody3D -var spob_name: String var type: String var item_screen_box_side_length = 200 -var faction = 3 +var faction = "3" func display_name(): return "The Torment Nexus" @@ -20,7 +19,10 @@ func _ready(): Util.clickable_spob(self) func serialize() -> Dictionary: - var data = {} + var data = { + "scene_file_path": scene_file_path, + "spob_name": "The Torment Nexus" # To make it show up in the map + } data["transform"] = Util.serialize_vec(Util.flatten_25d(transform.origin)) return data @@ -29,3 +31,4 @@ func deserialize(data: Dictionary): func _on_health_destroyed(): Client.display_message("Congradulations! You have destroyed the torment nexus and defeated iLisk") + queue_free() diff --git a/entities/spobs/TormentNexus.tscn b/entities/spobs/TormentNexus.tscn index 98f594a..3de2bf1 100644 --- a/entities/spobs/TormentNexus.tscn +++ b/entities/spobs/TormentNexus.tscn @@ -6,7 +6,7 @@ [ext_resource type="Texture2D" uid="uid://dd426tf71mhor" path="res://assets/eamonn/station/Station_lights.png" id="3_4kvt1"] [ext_resource type="Texture2D" uid="uid://b2lm643e7evd2" path="res://assets/eamonn/station/Station_RM.png" id="4_1atim"] [ext_resource type="Texture2D" uid="uid://c51a8tdglxqb7" path="res://assets/eamonn/station/Station_N.png" id="5_1pay4"] -[ext_resource type="Script" path="res://component/Health.gd" id="7_oab27"] +[ext_resource type="PackedScene" uid="uid://r6jv80byk5dl" path="res://component/Health.tscn" id="7_37gk7"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dx8go"] albedo_texture = ExtResource("2_oba8n") @@ -23,7 +23,7 @@ texture_filter = 0 [sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_2quce"] points = PackedVector3Array(6.28368, 0.445391, 0.933927, -5.96265, -1.28598, -0.813835, -4.85807, -0.221997, -3.96746, -0.402594, 5.79427, 5.16828, 0.488013, -5.79427, 5.16828, 0.488013, -5.79427, -5.30521, 0.488013, 5.79427, -5.30521, -5.52755, 5.12548, 0.711581, -5.30521, -5.79427, 0.488013, -3.96746, -0.445391, 4.72359, 5.39185, -5.57087, -0.62494, 5.39185, 5.57087, -0.62494, 4.72237, -0.445391, -3.96746, 4.05411, 0.445391, 4.72359, 0.46964, -6.83718, 0.255309, 0.256475, 6.83699, 0.469629, 0.933927, -0.445391, 6.28368, 0.933927, 1.33617, -6.19703, -5.30521, 5.57087, -0.62494, -0.847286, -4.4567, -5.75112, -0.847286, 4.4567, -5.75112, 5.83776, -4.01131, 0.933927, 5.39185, 5.57087, 0.488013, -6.19703, -1.33617, 0.933927, -0.62494, -5.57087, 5.39185, 0.711581, 4.90209, 5.61419, -5.30521, -5.57087, -0.62494, -0.847286, 4.01131, 5.83776, 3.83176, 0.221997, -4.85807, -3.96746, 0.221997, -4.85807, -4.85807, 0.221997, 3.83176, -5.75112, 4.4567, -0.847286) -[node name="Workbench" type="StaticBody3D"] +[node name="TormentNexus" type="StaticBody3D"] collision_layer = 9 collision_mask = 0 script = ExtResource("1_foc72") @@ -37,10 +37,6 @@ surface_material_override/0 = SubResource("StandardMaterial3D_dx8go") transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0) shape = SubResource("ConvexPolygonShape3D_2quce") -[node name="Health" type="Node3D" parent="."] -script = ExtResource("7_oab27") -max_health = 10 -shields = 10 +[node name="Health" parent="." instance=ExtResource("7_37gk7")] -[connection signal="damaged" from="Health" to="." method="_on_health_damaged"] [connection signal="destroyed" from="Health" to="." method="_on_health_destroyed"] diff --git a/procgen/Procgen.gd b/procgen/Procgen.gd index 8e4f17b..c301975 100644 --- a/procgen/Procgen.gd +++ b/procgen/Procgen.gd @@ -64,6 +64,7 @@ func generate_systems(seed_value: int) -> String: calculate_system_distances() calculate_system_quadrants() var start_sys = place_static_systems() + place_preset_static_spawns() populate_biomes() place_natural_static_spawns() populate_factions() @@ -149,7 +150,7 @@ func fill_remaining_empty_biomes(): # Fill in any systems that somehow fell through the cracks for system in systems.values(): if system.biome == "": - system.biome = "empty" + system.biome = Data.biomes.keys()[0] func grow_attribute(_attribute): pass @@ -256,7 +257,7 @@ func assign_faction_core_worlds() -> Array: scaled_rnd_result = rng.randi_range(0, sorted.size()) # TODO: This code kinda baffles me, but it's happening a lot. # Fix it and we can get a decent perf improvement - if scaled_rnd_result > sorted.size() or scaled_rnd_result < 0 - sorted.size(): + if scaled_rnd_result >= sorted.size() or scaled_rnd_result <= - sorted.size(): # print("Long tail too long: ", rnd_result, " (", scaled_rnd_result, ")") continue var system_id = sorted[scaled_rnd_result]