Add production bathymetric sonar slice
This commit is contained in:
1 parent
a18e82eb44
commit
7613daee84
28 files changed
+1825
-87
No files matched your search
@@ -13,7 +13,7 @@ const ProductionInputAdapter = preload(
|
||||
"res://game/infrastructure/input/production_input_adapter.gd"
|
||||
)
|
||||
|
||||
const TEST_COUNT := 40
|
||||
const TEST_COUNT := 51
|
||||
|
||||
var _failures: Array[String] = []
|
||||
|
||||
@@ -78,11 +78,15 @@ func _test_vehicle_slice(composition: VerticalSliceRoot) -> void:
|
||||
var instruments = composition.cockpit_instrument_panel()
|
||||
var adapter := composition.input_adapter() as ProductionInputAdapter
|
||||
var hud := composition.active_screen() as CockpitHud
|
||||
var sonar_service = composition.sonar_service()
|
||||
var sonar_display = composition.sonar_display()
|
||||
_expect(composition.active_world() != null, "vehicle test world is assembled")
|
||||
_expect(actor != null, "production submarine actor is assembled")
|
||||
_expect(camera != null, "cockpit camera is attached to the submarine")
|
||||
_expect(instruments != null, "physical cockpit instruments are assembled")
|
||||
_expect(hud != null, "critical HUD overlay is assembled")
|
||||
_expect(sonar_service != null, "production sonar service is assembled")
|
||||
_expect(sonar_display != null, "shared sonar presentation is assembled")
|
||||
_expect(composition.latest_update() != null, "dive session starts with a typed update")
|
||||
if actor == null or camera == null or instruments == null or adapter == null or hud == null:
|
||||
return
|
||||
@@ -94,6 +98,24 @@ func _test_vehicle_slice(composition: VerticalSliceRoot) -> void:
|
||||
_expect("L/min" in instruments.resources_text(), "oxygen instrument has volume and consumption")
|
||||
_expect("bar" in instruments.integrity_text(), "hull instrument has current and certified pressure")
|
||||
_expect(not hud.alert_overlay_visible(), "normal telemetry stays on physical instruments only")
|
||||
_expect(
|
||||
instruments.sonar_texture() == sonar_display.sonar_texture(),
|
||||
"physical and expanded sonar views share one texture"
|
||||
)
|
||||
|
||||
adapter.sonar_scan_requested.emit()
|
||||
var first_scan = sonar_service.current_scan()
|
||||
_expect(first_scan != null, "manual sonar command publishes a typed scan")
|
||||
_expect(first_scan.samples.observed_count() > 1000, "reference acquisition captures dense bathymetry")
|
||||
_expect(first_scan.contacts.size() >= 1, "metal calibration target becomes a distinct contact")
|
||||
_expect("RELEVÉ EN COURS" in sonar_display.status_text(), "sonar display reports progressive reveal")
|
||||
for frame in 8:
|
||||
await physics_frame
|
||||
_expect(sonar_display.built_row_count() > 0, "renderer reveals near rows incrementally")
|
||||
adapter.sonar_view_toggle_requested.emit()
|
||||
_expect(sonar_display.is_expanded(), "sonar can expand without pausing the dive")
|
||||
adapter.sonar_view_toggle_requested.emit()
|
||||
_expect(not sonar_display.is_expanded(), "expanded sonar returns to cockpit view")
|
||||
|
||||
var start_position: Vector3 = actor.global_position
|
||||
var starting_battery: float = composition.latest_update().snapshot.battery.remaining_kwh
|
||||
@@ -130,6 +152,7 @@ func _test_vehicle_slice(composition: VerticalSliceRoot) -> void:
|
||||
_expect(instruments.global_transform.is_equal_approx(cockpit_transform), "cockpit remains fixed while the player looks around")
|
||||
|
||||
var paused_sequence: int = composition.latest_update().snapshot.tick_sequence
|
||||
var paused_sonar_progress: float = sonar_service.current_scan().reveal_progress
|
||||
adapter.pause_requested.emit()
|
||||
await process_frame
|
||||
_expect(paused, "pause menu suspends the scene tree")
|
||||
@@ -141,13 +164,17 @@ func _test_vehicle_slice(composition: VerticalSliceRoot) -> void:
|
||||
composition.latest_update().snapshot.tick_sequence == paused_sequence,
|
||||
"dive ticks are frozen while paused"
|
||||
)
|
||||
_expect(
|
||||
is_equal_approx(sonar_service.current_scan().reveal_progress, paused_sonar_progress),
|
||||
"sonar reveal is frozen while paused"
|
||||
)
|
||||
|
||||
var controls_button := pause_menu.get_node("%ControlsButton") as Button
|
||||
controls_button.pressed.emit()
|
||||
await process_frame
|
||||
var controls := composition.active_overlay() as ControlsSettingsScreen
|
||||
_expect(controls != null, "controls settings open over the paused dive")
|
||||
_expect(adapter.binding_snapshots().size() == 9, "all gameplay keyboard bindings are exposed")
|
||||
_expect(adapter.binding_snapshots().size() == 11, "all gameplay keyboard bindings are exposed")
|
||||
|
||||
var rebind_results: Array = []
|
||||
adapter.rebind_result_available.connect(
|
||||
@@ -186,7 +213,10 @@ func _test_vehicle_slice(composition: VerticalSliceRoot) -> void:
|
||||
adapter.pause_requested.emit()
|
||||
await process_frame
|
||||
_expect(not paused, "second escape resumes the dive")
|
||||
await physics_frame
|
||||
for frame in 3:
|
||||
await physics_frame
|
||||
if composition.latest_update().snapshot.tick_sequence > paused_sequence:
|
||||
break
|
||||
_expect(
|
||||
composition.latest_update().snapshot.tick_sequence > paused_sequence,
|
||||
"fixed dive ticks resume after pause"
|
||||
|
||||
Reference in new issue
Block a user