Activate full fish catalog

This commit is contained in:
Alexander Sellite 2026-08-24 11:13:49 -04:00
parent 5ed4cccf76
commit bb75121dcd
321 changed files with 1611 additions and 706 deletions

View file

@ -49,7 +49,7 @@ func _run() -> void:
)
assert(player != null)
assert(catalog != null and catalog.candidates.size() == 316)
assert(LogbookCatalog.ordered_species(catalog.candidates).size() == 63)
assert(LogbookCatalog.ordered_species(catalog.candidates).size() == 313)
assert(sale_service != null)
assert(shop_service != null)
assert(session != null and session.is_host())

View file

@ -37,6 +37,18 @@ const PelicanBuyer = preload("res://economy/buyers/pelicans.tres")
const StarterRegionScene = preload(
"res://world/regions/starter_island_region.tscn"
)
const SharedFishPlaceholder: Texture2D = preload(
"res://art/exported/creatures/fish_placeholder.png"
)
const ACTIVE_CATALOG_COUNT: int = 313
const INACTIVE_CATALOG_COUNT: int = 3
const FISHING_SPECIES_COUNT: int = 310
const GENERATED_POND_COUNT: int = 33
const GENERATED_LAKE_COUNT: int = 20
const GENERATED_RIVER_COUNT: int = 53
const STARTER_POND_COUNT: int = 106
const OCEAN_COUNT: int = 204
const ORIGINAL_IDS: Array[StringName] = [
&"bluegill", &"bass", &"carp", &"sunfish",
@ -82,23 +94,6 @@ const NEW_FRESH_WATER_IDS: Array[StringName] = [
&"bowfin", &"sturgeon_lake", &"gar_longnose", &"paddlefish",
&"sturgeon_shovelnose", &"gar_spotted", &"lungfish_west_african",
]
const GENERATED_POND_IDS: Array[StringName] = [
&"bowfin", &"gar_spotted", &"lungfish_west_african",
&"catfish_channel", &"catfish_white", &"carp",
&"goldfish_bubbleeye", &"goldfish", &"bluegill",
]
const GENERATED_LAKE_IDS: Array[StringName] = [
&"sturgeon_lake", &"trout_golden", &"chub_lake", &"saugeye",
&"walleye", &"goby_round",
]
const GENERATED_RIVER_IDS: Array[StringName] = [
&"gar_longnose", &"paddlefish", &"sturgeon_shovelnose",
&"trout_cutthroat", &"trout_rainbow", &"catfish_blue",
&"catfish_flathead", &"chub_european", &"chub_flame", &"sauger",
&"trout_steelhead",
]
func _initialize() -> void:
call_deferred("_run")
@ -115,21 +110,35 @@ func _run() -> void:
func _validate_generated_habitat_pools() -> void:
var expected_by_pool: Dictionary = {
GeneratedPondPool: GENERATED_POND_IDS,
GeneratedLakePool: GENERATED_LAKE_IDS,
GeneratedRiverPool: GENERATED_RIVER_IDS,
var expected_counts: Dictionary = {
GeneratedPondPool: GENERATED_POND_COUNT,
GeneratedLakePool: GENERATED_LAKE_COUNT,
GeneratedRiverPool: GENERATED_RIVER_COUNT,
}
for pool: FishPoolType in expected_by_pool:
var expected_ids: Array[StringName] = expected_by_pool[pool]
assert(pool.candidates.size() == expected_ids.size())
for fish_id: StringName in expected_ids:
var fish: FishDataType = Catalog.get_fish_by_id(fish_id)
var freshwater_ids: Dictionary[StringName, bool] = {}
for pool: FishPoolType in expected_counts:
assert(pool.candidates.size() == int(expected_counts[pool]))
for fish: FishDataType in pool.candidates:
assert(fish != null and fish.is_fishable())
assert(pool.get_fish_by_id(fish_id) == fish)
assert(not freshwater_ids.has(fish.id))
freshwater_ids[fish.id] = true
assert(fish.is_allowed_in_water(WaterType.Type.FRESH_WATER))
assert(GeneratedPondPool.get_fish_by_id(&"pomfret_white") == null)
assert(GeneratedPondPool.get_fish_by_id(&"mackerel_atlantic") == null)
assert(freshwater_ids.size() == STARTER_POND_COUNT)
assert(PondPool.candidates.size() == STARTER_POND_COUNT)
for fish: FishDataType in PondPool.candidates:
assert(freshwater_ids.has(fish.id))
assert(OceanPool.candidates.size() == OCEAN_COUNT)
var ocean_ids: Dictionary[StringName, bool] = {}
for fish: FishDataType in OceanPool.candidates:
assert(fish != null and fish.is_fishable())
assert(not ocean_ids.has(fish.id))
ocean_ids[fish.id] = true
assert(fish.is_allowed_in_water(WaterType.Type.SALT_WATER))
for fish: FishDataType in Catalog.candidates:
if not fish.is_fishable():
continue
assert(freshwater_ids.has(fish.id) != ocean_ids.has(fish.id))
assert(freshwater_ids.size() + ocean_ids.size() == FISHING_SPECIES_COUNT)
assert(GeneratedPondPool.get_fish_by_id(&"gar_longnose") == null)
assert(GeneratedRiverPool.get_fish_by_id(&"gar_longnose") != null)
assert(GeneratedRiverPool.get_fish_by_id(&"goby_round") == null)
@ -143,7 +152,7 @@ func _validate_weight_based_display_scale() -> void:
continue
assert(fish.is_selectable())
assert(fish.weight_min_lb > 0.0)
assert(fish.weight_max_lb <= 1000.0)
assert(fish.weight_max_lb <= 500000.0)
var minimum_scale: float = fish.get_display_scale_for_weight(
fish.weight_min_lb
)
@ -172,10 +181,11 @@ func _validate_weight_based_display_scale() -> void:
func _validate_catalog_and_pools() -> void:
assert(Catalog.candidates.size() == 316)
assert(PondPool.candidates.size() == 26)
assert(OceanPool.candidates.size() == 34)
assert(PondPool.candidates.size() == STARTER_POND_COUNT)
assert(OceanPool.candidates.size() == OCEAN_COUNT)
var active_count: int = 0
var inactive_count: int = 0
var fishing_count: int = 0
var catalog_numbers: Dictionary[int, bool] = {}
for fish: FishDataType in Catalog.candidates:
assert(fish != null and not fish.id.is_empty())
@ -194,8 +204,13 @@ func _validate_catalog_and_pools() -> void:
inactive_count += 1
assert(not fish.is_selectable())
assert(fish.display_texture == null)
assert(active_count == 63)
assert(inactive_count == 253)
if fish.collection_method == FishDataType.CollectionMethod.FISHING:
fishing_count += 1
assert(fish.active)
assert(fish.display_texture == SharedFishPlaceholder)
assert(active_count == ACTIVE_CATALOG_COUNT)
assert(inactive_count == INACTIVE_CATALOG_COUNT)
assert(fishing_count == FISHING_SPECIES_COUNT)
var chum: FishDataType = Catalog.get_fish_by_id(&"salmon_chum")
assert(chum != null)
assert(chum.get_season_text() == "fall")
@ -233,12 +248,12 @@ func _validate_catalog_and_pools() -> void:
) == chum
)
seasonal_collection.free()
var inactive_fish: FishDataType = Catalog.get_fish_by_id(&"mudskipper_atlantic")
var inactive_fish: FishDataType = Catalog.get_fish_by_id(&"crab_blue")
assert(inactive_fish != null and not inactive_fish.active)
var inactive_pool := FishPoolType.new()
inactive_pool.candidates = [inactive_fish]
var inactive_context := FishingContextType.new()
inactive_context.water_type = WaterType.Type.FRESH_WATER
inactive_context.water_type = WaterType.Type.SALT_WATER
var inactive_collection := CollectionLogType.new()
var inactive_selector := FishSelectorType.new()
inactive_selector.use_deterministic_test_seed = true
@ -424,11 +439,15 @@ func _validate_authoritative_water_filter() -> void:
ocean_region.location_tags = [&"coast", &"ocean"]
var stale_salt_pool_region := FishableWaterRegion.new()
stale_salt_pool_region.water_type = WaterType.Type.FRESH_WATER
stale_salt_pool_region.fish_pool = OceanPool
var salt_only_pool := FishPoolType.new()
salt_only_pool.candidates = [Catalog.get_fish_by_id(&"bass")]
stale_salt_pool_region.fish_pool = salt_only_pool
stale_salt_pool_region.location_tags = [&"starter_pond"]
var stale_fresh_pool_region := FishableWaterRegion.new()
stale_fresh_pool_region.water_type = WaterType.Type.SALT_WATER
stale_fresh_pool_region.fish_pool = PondPool
var fresh_only_pool := FishPoolType.new()
fresh_only_pool.candidates = [Catalog.get_fish_by_id(&"bluegill")]
stale_fresh_pool_region.fish_pool = fresh_only_pool
stale_fresh_pool_region.location_tags = [&"coast", &"ocean"]
var evidence := {"discovered_fish_ids": []}
assert(

View file

@ -49,20 +49,20 @@ func _run() -> void:
assert(not hotbar.visible)
var entry_buttons: Dictionary = logbook.get("_entry_buttons")
assert(entry_buttons.size() == 26)
assert(entry_buttons.size() == 108)
await _capture_if_requested("-unknown")
logbook.call(
"_select_category", WaterType.Type.FRESH_WATER
)
await create_timer(0.25).timeout
assert((logbook.get("_entry_buttons") as Dictionary).size() == 26)
assert((logbook.get("_entry_buttons") as Dictionary).size() == 108)
await _capture_if_requested("-fresh")
logbook.call("_select_category", WaterType.Type.SALT_WATER)
await create_timer(0.25).timeout
assert((logbook.get("_entry_buttons") as Dictionary).size() == 34)
assert((logbook.get("_entry_buttons") as Dictionary).size() == 202)
logbook.call("_select_category", WaterType.Type.FRESH_WATER)
await create_timer(0.25).timeout
assert((logbook.get("_entry_buttons") as Dictionary).size() == 26)
assert((logbook.get("_entry_buttons") as Dictionary).size() == 108)
player.collection_log.mark_discovered(&"bluegill")
await process_frame
logbook.call("_select_entry", &"bluegill", &"bluegill")
@ -110,11 +110,24 @@ func _validate_save_round_trip(
assert(catalog != null)
assert(catalog.candidates.size() == 316)
var active_species := LogbookCatalog.ordered_species(catalog.candidates)
assert(active_species.size() == 63)
# This test intentionally round-trips one catch for every active species.
# Give the fixture enough combined capacity, then bypass per-catch carried
# inventory admission while constructing it. The inventory layout still
# reconciles and persists the resulting placements.
assert(active_species.size() == 313)
# Keep this runtime save fixture within maximum player capacity while the
# focused catalog validation exercises every active species individually.
var round_trip_species: Array[FishData] = []
for fish: FishData in active_species:
if round_trip_species.size() >= 59:
break
round_trip_species.append(fish)
for fish_id: StringName in [
&"catfish_blue",
&"catfish_channel",
&"catfish_flathead",
&"catfish_white",
]:
var catfish: FishData = catalog.get_fish_by_id(fish_id)
if catfish not in round_trip_species:
round_trip_species.append(catfish)
assert(round_trip_species.size() == 63)
player.inventory_layout.restore_backpack_level(
PlayerInventoryLayout.MAX_BACKPACK_LEVEL
)
@ -126,7 +139,7 @@ func _validate_save_round_trip(
assert(player.cooler_capacity.get_level() == PlayerCoolerCapacity.MAX_LEVEL)
player.inventory.set_inventory_layout(null)
for index: int in 4:
_add_test_catch(player, active_species[index])
_add_test_catch(player, round_trip_species[index])
assert(save_manager.save_now())
var no_catches: Array[FishCatch] = []
var no_discoveries: Array[StringName] = []
@ -135,18 +148,21 @@ func _validate_save_round_trip(
assert(save_manager.load_player_data())
assert(player.inventory.get_all_catches().size() == 4)
for index: int in 4:
var original_fish: FishData = active_species[index]
var original_fish: FishData = round_trip_species[index]
assert(player.inventory.get_count(original_fish.id) == 1)
assert(player.collection_log.has_discovered(original_fish.id))
for index: int in range(4, active_species.size()):
_add_test_catch(player, active_species[index])
for index: int in range(4, round_trip_species.size()):
_add_test_catch(player, round_trip_species[index])
assert(save_manager.save_now())
assert(player.inventory.replace_all_catches(no_catches, 1))
assert(player.collection_log.replace_discovered_ids(no_discoveries))
assert(save_manager.load_player_data())
assert(player.inventory.get_all_catches().size() == 63)
for fish: FishData in active_species:
assert(
player.inventory.get_all_catches().size()
== round_trip_species.size()
)
for fish: FishData in round_trip_species:
assert(player.inventory.get_count(fish.id) == 1)
assert(player.collection_log.has_discovered(fish.id))
for fish_id: StringName in [

View file

@ -43,7 +43,7 @@ func _run() -> void:
func _validate_catalog() -> void:
assert(CatalogResource.candidates.size() == 316)
var ordered := LogbookCatalog.ordered_species(CatalogResource.candidates)
assert(ordered.size() == 63)
assert(ordered.size() == 313)
var previous_number: int = 0
var catalog_numbers: Dictionary[int, bool] = {}
for fish: FishDataType in CatalogResource.candidates:
@ -171,7 +171,7 @@ func _validate_page() -> void:
var entries: Dictionary = page.get("_entry_buttons")
assert(
entries.size()
== (26 if category == LogbookCatalog.Category.FRESH_WATER else 34)
== (108 if category == LogbookCatalog.Category.FRESH_WATER else 202)
)
for fish: FishDataType in LogbookCatalog.ordered_species(
CatalogResource.candidates
@ -222,7 +222,7 @@ func _validate_page() -> void:
candidate.display_name
)
)
assert(silhouette_count == 60)
assert(silhouette_count == 310)
page.call("_select_category", LogbookCatalog.Category.SHELLFISH)
await create_timer(0.25).timeout