Merge alt development work

This commit is contained in:
Alexander Sellite 2026-08-03 17:10:50 -04:00
commit 4177cb19c3
78 changed files with 2280 additions and 72 deletions

View file

@ -48,7 +48,7 @@ func _run() -> void:
as PlayerAssetReservationService
)
assert(player != null)
assert(catalog != null and catalog.candidates.size() == 8)
assert(catalog != null and catalog.candidates.size() == 19)
assert(sale_service != null)
assert(shop_service != null)
assert(session != null and session.is_host())

View file

@ -40,8 +40,22 @@ const CATFISH_IDS: Array[StringName] = [
const FRESH_WATER_IDS: Array[StringName] = [
&"bluegill", &"carp", &"catfish_blue", &"catfish_channel",
&"catfish_flathead", &"catfish_white",
&"goby_round",
]
const SALT_WATER_IDS: Array[StringName] = [
&"bass",
&"sunfish",
&"tuna_albacore",
&"tuna_bigeye",
&"tuna_bluefin",
&"tuna_skipjack",
&"tuna_yellowfin",
&"salmon_atlantic",
&"salmon_chum",
&"salmon_coho",
&"salmon_pink",
&"salmon_sockeye",
]
const SALT_WATER_IDS: Array[StringName] = [&"bass", &"sunfish"]
func _initialize() -> void:
@ -58,9 +72,9 @@ func _run() -> void:
func _validate_catalog_and_pools() -> void:
assert(Catalog.candidates.size() == 8)
assert(PondPool.candidates.size() == 6)
assert(OceanPool.candidates.size() == 2)
assert(Catalog.candidates.size() == 19)
assert(PondPool.candidates.size() == 7)
assert(OceanPool.candidates.size() == 12)
for fish_id: StringName in ORIGINAL_IDS:
var original_fish: FishDataType = Catalog.get_fish_by_id(fish_id)
assert(original_fish != null)
@ -104,6 +118,43 @@ func _validate_catalog_and_pools() -> void:
assert(fish.sell_value_min == int(values[4]))
assert(fish.sell_value_max == int(values[5]))
var expected_tuna_values: Dictionary[StringName, Array] = {
&"tuna_albacore": [2, 1.5, 10.0, 45.0, 12, 24],
&"tuna_bigeye": [3, 0.55, 20.0, 120.0, 22, 48],
&"tuna_bluefin": [4, 0.18, 30.0, 250.0, 35, 90],
&"tuna_skipjack": [1, 3.0, 5.0, 25.0, 8, 16],
&"tuna_yellowfin": [2, 1.0, 15.0, 80.0, 16, 36],
}
for fish_id: StringName in expected_tuna_values:
var fish: FishDataType = Catalog.get_fish_by_id(fish_id)
var values: Array = expected_tuna_values[fish_id]
assert(fish != null and fish.is_selectable())
assert(int(fish.rarity) == int(values[0]))
assert(is_equal_approx(fish.base_catch_weight, float(values[1])))
assert(is_equal_approx(fish.weight_min_lb, float(values[2])))
assert(is_equal_approx(fish.weight_max_lb, float(values[3])))
assert(fish.sell_value_min == int(values[4]))
assert(fish.sell_value_max == int(values[5]))
var expected_new_values: Dictionary[StringName, Array] = {
&"goby_round": [0, 8.0, 0.1, 0.6, 2, 3],
&"salmon_atlantic": [3, 0.65, 8.0, 40.0, 20, 42],
&"salmon_chum": [1, 2.5, 6.0, 25.0, 10, 22],
&"salmon_coho": [2, 1.4, 5.0, 30.0, 14, 28],
&"salmon_pink": [1, 3.0, 3.0, 12.0, 8, 15],
&"salmon_sockeye": [2, 1.6, 4.0, 15.0, 12, 24],
}
for fish_id: StringName in expected_new_values:
var fish: FishDataType = Catalog.get_fish_by_id(fish_id)
var values: Array = expected_new_values[fish_id]
assert(fish != null and fish.is_selectable())
assert(int(fish.rarity) == int(values[0]))
assert(is_equal_approx(fish.base_catch_weight, float(values[1])))
assert(is_equal_approx(fish.weight_min_lb, float(values[2])))
assert(is_equal_approx(fish.weight_max_lb, float(values[3])))
assert(fish.sell_value_min == int(values[4]))
assert(fish.sell_value_max == int(values[5]))
var pond_context := FishingContextType.new()
pond_context.location_tags = [&"starter_pond"]
pond_context.water_type = WaterType.Type.FRESH_WATER

View file

@ -0,0 +1,54 @@
extends SceneTree
const FishingSpotScene := preload("res://fishing/fishing_spot.tscn")
func _initialize() -> void:
call_deferred("_run")
func _run() -> void:
var fishing_spot := FishingSpotScene.instantiate() as FishingSpot
root.add_child(fishing_spot)
await process_frame
var fight_audio := fishing_spot.get_node("%FightAudio") as AudioStreamPlayer
var bobber_audio := fishing_spot.get_node(
"%BobberAudio"
) as AudioStreamPlayer
assert(bobber_audio != null)
assert(bobber_audio.stream != null)
assert(bobber_audio.bus == &"SFX")
assert(is_equal_approx(bobber_audio.volume_db, -14.0))
var bobber_stream := bobber_audio.stream as AudioStreamWAV
assert(bobber_stream != null)
assert(bobber_stream.loop_mode == AudioStreamWAV.LOOP_DISABLED)
assert(fight_audio != null)
assert(fight_audio.stream != null)
assert(fight_audio.bus == &"SFX")
assert(is_equal_approx(fight_audio.volume_db, -10.0))
var fight_stream := fight_audio.stream as AudioStreamWAV
assert(fight_stream != null)
assert(fight_stream.loop_mode == AudioStreamWAV.LOOP_FORWARD)
assert(fight_stream.loop_end > fight_stream.loop_begin)
var reeling_audio := fishing_spot.get_node(
"%ReelingAudio"
) as AudioStreamPlayer
assert(reeling_audio != null)
assert(reeling_audio.stream != null)
assert(reeling_audio.bus == &"SFX")
assert(is_equal_approx(reeling_audio.volume_db, -10.0))
var reeling_stream := reeling_audio.stream as AudioStreamWAV
assert(reeling_stream != null)
assert(reeling_stream.loop_mode == AudioStreamWAV.LOOP_FORWARD)
assert(reeling_stream.loop_end > reeling_stream.loop_begin)
assert(fishing_spot.has_method("_start_fight_audio"))
assert(fishing_spot.has_method("_play_bobber_audio"))
assert(fishing_spot.has_method("_stop_fight_audio"))
assert(fishing_spot.has_method("_start_reeling_audio"))
assert(fishing_spot.has_method("_stop_reeling_audio"))
fishing_spot.free()
await process_frame
print("Fishing audio validation: PASS")
quit()

View file

@ -0,0 +1 @@
uid://bby8mv7bsjd3w

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() == 6)
assert(entry_buttons.size() == 7)
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() == 6)
assert((logbook.get("_entry_buttons") as Dictionary).size() == 7)
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() == 2)
assert((logbook.get("_entry_buttons") as Dictionary).size() == 12)
logbook.call("_select_category", WaterType.Type.FRESH_WATER)
await create_timer(0.25).timeout
assert((logbook.get("_entry_buttons") as Dictionary).size() == 6)
assert((logbook.get("_entry_buttons") as Dictionary).size() == 7)
player.collection_log.mark_discovered(&"bluegill")
await process_frame
logbook.call("_select_entry", &"bluegill", &"bluegill")
@ -101,7 +101,7 @@ func _validate_save_round_trip(
var player := main.get("_player") as Player
var catalog := main.get("fish_catalog") as FishPool
assert(catalog != null)
assert(catalog.candidates.size() == 8)
assert(catalog.candidates.size() == 19)
for index: int in 4:
_add_test_catch(player, catalog.candidates[index])
assert(save_manager.save_now())
@ -122,7 +122,7 @@ func _validate_save_round_trip(
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() == 8)
assert(player.inventory.get_all_catches().size() == 19)
for fish: FishData in catalog.candidates:
assert(player.inventory.get_count(fish.id) == 1)
assert(player.collection_log.has_discovered(fish.id))

View file

@ -49,6 +49,17 @@ func _validate_catalog() -> void:
&"catfish_channel",
&"catfish_flathead",
&"catfish_white",
&"tuna_albacore",
&"tuna_bigeye",
&"tuna_bluefin",
&"tuna_skipjack",
&"tuna_yellowfin",
&"goby_round",
&"salmon_atlantic",
&"salmon_chum",
&"salmon_coho",
&"salmon_pink",
&"salmon_sockeye",
]
assert(LogbookCatalog.CATALOG_ORDER == expected_ids)
for index: int in expected_ids.size():
@ -62,7 +73,20 @@ func _validate_catalog() -> void:
)
var expected_category: WaterType.Type = (
WaterType.Type.SALT_WATER
if expected_ids[index] in [&"bass", &"sunfish"]
if expected_ids[index] in [
&"bass",
&"sunfish",
&"tuna_albacore",
&"tuna_bigeye",
&"tuna_bluefin",
&"tuna_skipjack",
&"tuna_yellowfin",
&"salmon_atlantic",
&"salmon_chum",
&"salmon_coho",
&"salmon_pink",
&"salmon_sockeye",
]
else WaterType.Type.FRESH_WATER
)
assert(
@ -105,7 +129,7 @@ func _validate_page() -> void:
page.call("_select_category", category)
await create_timer(0.25).timeout
var entries: Dictionary = page.get("_entry_buttons")
assert(entries.size() == (6 if category == WaterType.Type.FRESH_WATER else 2))
assert(entries.size() == (7 if category == WaterType.Type.FRESH_WATER else 12))
for fish: FishDataType in LogbookCatalog.ordered_species(
CatalogResource.candidates
):
@ -155,7 +179,7 @@ func _validate_page() -> void:
candidate.display_name
)
)
assert(silhouette_count == 8)
assert(silhouette_count == 19)
page.call("_select_category", WaterType.Type.OTHER)
await create_timer(0.25).timeout

View file

@ -0,0 +1,48 @@
extends SceneTree
const ShorelineAmbienceType := preload("res://world/shoreline_ambience.gd")
const WavesStream := preload("res://audio/ambience/waves.wav")
func _initialize() -> void:
call_deferred("_run")
func _run() -> void:
var waves := WavesStream as AudioStreamWAV
assert(waves != null)
var segments: Array[PackedVector2Array] = [
PackedVector2Array([Vector2.ZERO, Vector2(10.0, 0.0)]),
]
assert(is_equal_approx(
ShorelineAmbienceType.distance_to_segments(Vector2(5.0, 3.0), segments),
3.0,
))
assert(is_equal_approx(
ShorelineAmbienceType.distance_to_segments(Vector2(-4.0, 0.0), segments),
4.0,
))
var controller := ShorelineAmbienceType.new() as ShorelineAmbience
var runtime_audio := AudioStreamPlayer.new()
runtime_audio.name = "WavesAudio"
runtime_audio.unique_name_in_owner = true
runtime_audio.stream = WavesStream
runtime_audio.bus = &"SFX"
controller.add_child(runtime_audio)
runtime_audio.owner = controller
root.add_child(controller)
await process_frame
assert(runtime_audio.bus == &"SFX")
assert(controller.near_distance < controller.far_distance)
assert(controller.near_volume_db > controller.far_volume_db)
var runtime_waves := runtime_audio.stream as AudioStreamWAV
assert(runtime_waves.loop_mode == AudioStreamWAV.LOOP_FORWARD)
assert(runtime_waves.loop_begin == 0)
assert(runtime_waves.loop_end == 1044956)
controller.free()
await process_frame
print("Shoreline ambience validation: PASS")
quit()

View file

@ -0,0 +1 @@
uid://bwvhgpbkb00l1

View file

@ -17,6 +17,12 @@ const FishableWaterRegionType = preload(
const WeatherIconType = preload("res://ui/weather_icon.gd")
const Catalog: FishPoolType = preload("res://fish/pools/fish_catalog.tres")
const SaltWaterMaterial: ShaderMaterial = preload(
"res://world/materials/stylized_water.tres"
)
const FreshWaterMaterial: ShaderMaterial = preload(
"res://world/materials/stylized_water_fresh.tres"
)
func _initialize() -> void:
@ -138,7 +144,21 @@ func _validate_fishing_availability() -> void:
assert(not night_fish.availability.is_available(day_context))
assert(night_fish.availability.is_available(night_context))
assert(night_fish.availability.is_available(transition_context))
for fish_id: StringName in [&"bass", &"carp"]:
for fish_id: StringName in [
&"bass",
&"carp",
&"tuna_albacore",
&"tuna_bigeye",
&"tuna_bluefin",
&"tuna_skipjack",
&"tuna_yellowfin",
&"goby_round",
&"salmon_atlantic",
&"salmon_chum",
&"salmon_coho",
&"salmon_pink",
&"salmon_sockeye",
]:
var all_time_fish: FishDataType = Catalog.get_fish_by_id(fish_id)
assert(all_time_fish.availability.is_available(day_context))
assert(all_time_fish.availability.is_available(night_context))
@ -229,6 +249,14 @@ func _validate_environment_presentation() -> void:
< 0.01
)
var day_ambient_energy: float = runtime_environment.ambient_light_energy
var day_water_brightness := float(
SaltWaterMaterial.get_shader_parameter("environment_brightness")
)
assert(day_water_brightness > 0.99)
assert(is_equal_approx(
float(FreshWaterMaterial.get_shader_parameter("environment_brightness")),
day_water_brightness,
))
visuals.apply_time_immediately(0.0)
var night_horizon: Color = runtime_sky_material.get_shader_parameter(
"sky_horizon_color"
@ -251,6 +279,47 @@ func _validate_environment_presentation() -> void:
assert(night_moon_direction.y > 0.85)
assert(night_moon_direction.is_equal_approx(-night_sun_direction))
assert(runtime_environment.ambient_light_energy < day_ambient_energy)
var night_water_brightness := float(
SaltWaterMaterial.get_shader_parameter("environment_brightness")
)
assert(night_water_brightness < day_water_brightness * 0.4)
assert(is_equal_approx(
float(FreshWaterMaterial.get_shader_parameter("environment_brightness")),
night_water_brightness,
))
var night_water_tint := (
SaltWaterMaterial.get_shader_parameter("environment_tint") as Color
)
assert(night_water_tint.get_luminance() < 0.5)
var night_background_energy := runtime_environment.background_energy_multiplier
var night_adjustment_brightness := runtime_environment.adjustment_brightness
var night_adjustment_saturation := runtime_environment.adjustment_saturation
visuals.apply_weather_immediately(WorldWeatherService.Weather.FOGGY)
visuals.apply_time_immediately(0.0)
var foggy_sky_horizon := (
runtime_sky_material.get_shader_parameter("sky_horizon_color") as Color
)
assert(foggy_sky_horizon.is_equal_approx(night_horizon))
assert(is_zero_approx(runtime_environment.fog_sky_affect))
assert(is_equal_approx(runtime_environment.fog_depth_begin, 3.0))
assert(is_equal_approx(runtime_environment.fog_depth_end, 28.0))
assert(is_equal_approx(
float(SaltWaterMaterial.get_shader_parameter("environment_brightness")),
night_water_brightness,
))
assert(is_equal_approx(
runtime_environment.background_energy_multiplier,
night_background_energy,
))
assert(is_equal_approx(
runtime_environment.adjustment_brightness,
night_adjustment_brightness,
))
assert(is_equal_approx(
runtime_environment.adjustment_saturation,
night_adjustment_saturation,
))
visuals.apply_weather_immediately(WorldWeatherService.Weather.SUNNY)
visuals.apply_time_immediately(20.0)
var dusk_horizon: Color = runtime_sky_material.get_shader_parameter(
"sky_horizon_color"