Separate generated freshwater fish habitats

This commit is contained in:
Alexander Sellite 2026-08-21 12:29:19 -04:00
parent 7242e5d433
commit 8656f46ce4
27 changed files with 177 additions and 36 deletions

View file

@ -15,5 +15,5 @@ allowed_neighbor_tags = PackedStringArray("grass")
preferred_neighbor_tags = PackedStringArray("grass")
water_inlet_edges = 1
water_outlet_edges = 4
water_surface_size = Vector2(2.1, 10)
water_surface_size = Vector2(2.3, 10)
water_surface_offset = Vector2(-0.315, 0)

View file

@ -14,5 +14,5 @@ tags = PackedStringArray("land", "walkable", "fresh_water", "pond")
allowed_neighbor_tags = PackedStringArray("grass")
preferred_neighbor_tags = PackedStringArray("grass")
water_inlet_edges = 1
water_surface_size = Vector2(6.7, 7.75)
water_surface_size = Vector2(7, 8)
water_surface_offset = Vector2(-0.32, -1.03)

View file

@ -15,5 +15,5 @@ allowed_neighbor_tags = PackedStringArray("grass")
preferred_neighbor_tags = PackedStringArray("grass")
water_inlet_edges = 1
water_outlet_edges = 4
water_surface_size = Vector2(2.1, 10)
water_surface_offset = Vector2(-0.315, 0)
water_surface_size = Vector2(2.3, 10)
water_surface_offset = Vector2(0.323, 0)

View file

@ -16,8 +16,14 @@ const SALT_WATER_MATERIAL: Material = preload(
const FRESH_WATER_MATERIAL: Material = preload(
"res://world/materials/stylized_water_fresh.tres"
)
const POND_POOL: FishPool = preload(
"res://fish/pools/starter_pond_pool.tres"
const GENERATED_POND_POOL: FishPool = preload(
"res://fish/pools/generated_pond_pool.tres"
)
const GENERATED_LAKE_POOL: FishPool = preload(
"res://fish/pools/generated_lake_pool.tres"
)
const GENERATED_RIVER_POOL: FishPool = preload(
"res://fish/pools/generated_river_pool.tres"
)
const OCEAN_POOL: FishPool = preload(
"res://fish/pools/starter_ocean_pool.tres"
@ -374,7 +380,7 @@ func _configure_fresh_water(records: Array[Dictionary]) -> void:
body.visual_surface_enabled = false
body.water_material = _fresh_water_material()
body.water_type = WaterType.Type.FRESH_WATER
body.fish_pool = POND_POOL
body.fish_pool = _fresh_water_pool(tags)
body.location_tags = _fresh_water_location_tags(tags)
body.selection_priority = 10
@ -388,6 +394,14 @@ func _fresh_water_location_tags(tags: PackedStringArray) -> Array[StringName]:
return result
func _fresh_water_pool(tags: PackedStringArray) -> FishPool:
if "river" in tags:
return GENERATED_RIVER_POOL
if "lake" in tags:
return GENERATED_LAKE_POOL
return GENERATED_POND_POOL
func _configure_diggable_area() -> void:
var half_extents := get_playable_half_extents()
_diggable_beach.generation_bounds = Rect2(

View file

@ -159,7 +159,7 @@ script = ExtResource("10_water_body")
surface_size = Vector2(16.1, 12.3675)
water_material = ExtResource("19_fresh_water")
fish_pool = ExtResource("12_pond_pool")
location_tags = Array[StringName]([&"starter_pond"])
location_tags = Array[StringName]([&"starter_pond", &"pond"])
selection_priority = 1
[node name="VisualWater" type="MeshInstance3D" parent="WaterBodies/Pond" unique_id=1034265960]
@ -171,7 +171,7 @@ collision_layer = 4
collision_mask = 0
monitoring = false
script = ExtResource("3_water")
location_tags = Array[StringName]([&"starter_pond"])
location_tags = Array[StringName]([&"starter_pond", &"pond"])
water_type = 0
fish_pool = ExtResource("12_pond_pool")
selection_priority = 1