Improve phone ambience and dialogue flow; keep stairwell intact
This commit is contained in:
@@ -13,6 +13,10 @@ func check(ok: bool, message: String) -> void:
|
||||
push_error("PHONE QA: " + message)
|
||||
|
||||
func click(id: String) -> void:
|
||||
var gameplay := id in ["question", "cancel"]
|
||||
for action in game.story.actions:
|
||||
if action.id == id: gameplay = true
|
||||
if gameplay: wait_for_speech()
|
||||
var control: Button = game.action_button(id)
|
||||
check(control != null, "Visible button: " + id)
|
||||
if control != null:
|
||||
@@ -20,8 +24,19 @@ func click(id: String) -> void:
|
||||
control.pressed.emit()
|
||||
|
||||
func at(second: float) -> void:
|
||||
if second >= game.speech_until: game.voice.stop()
|
||||
game.start_tick = Time.get_ticks_msec() - int(second * 1000.0)
|
||||
game._process(0)
|
||||
if second >= game.speech_until: game.voice.stop()
|
||||
game.refresh_live()
|
||||
|
||||
func wait_for_speech() -> void:
|
||||
for step in range(12):
|
||||
if game.speech_finished() and game.events.is_empty(): return
|
||||
var next: float = maxf(game.elapsed, game.speech_until) + 0.01
|
||||
if not game.events.is_empty(): next = maxf(next, float(game.events[0].at) + 0.01)
|
||||
at(next)
|
||||
check(false, "Dialogue must finish before choosing")
|
||||
|
||||
func perform(id: String) -> void:
|
||||
click(id)
|
||||
@@ -84,6 +99,11 @@ func realtime_check() -> void:
|
||||
await game.get_tree().create_timer(5.0).timeout
|
||||
check(game.chapter == 2 and game.running, "Production redial")
|
||||
check("greeting" in game.heard and "call_02_k" in game.heard, "Production second opening")
|
||||
check(game.action_button("keys_search").disabled, "Real audio keeps early answers disabled")
|
||||
for frame in range(100):
|
||||
if game.can_respond(): break
|
||||
await game.get_tree().create_timer(0.2).timeout
|
||||
check(game.can_respond() and not game.action_button("keys_search").disabled, "Real audio completion unlocks answers")
|
||||
game.qa_mode = true
|
||||
start(10, 2)
|
||||
for id in ["keys_fast", "lamp_fast", "safe", "front", "side_open", "phone_shelf"]: perform(id)
|
||||
@@ -99,7 +119,7 @@ func run(target: Node) -> void:
|
||||
game = target
|
||||
DirAccess.make_dir_recursive_absolute(directory())
|
||||
check(game.story.chapters.size() == 10, "Ten chapters")
|
||||
check(game.story.lines.size() == 102, "All 102 spoken lines")
|
||||
check(game.story.lines.size() == 110, "All 110 spoken lines")
|
||||
for id in game.story.lines:
|
||||
check(game.voice_stream(id) != null and game.voice_length(id) > 0.1, "Playable audio " + id)
|
||||
var voices: Dictionary = JSON.parse_string(FileAccess.get_file_as_string("res://data/voice_manifest.json"))
|
||||
@@ -112,8 +132,8 @@ func run(target: Node) -> void:
|
||||
else:
|
||||
check(voices[id].provider == "ElevenLabs" and voices[id].voice_id == "5u41aNhyCU6hXOcjPPv0", "Carol assigned: " + id)
|
||||
carol_count += 1
|
||||
check(jessica_count == 48, "All 48 Katya lines use Jessica")
|
||||
check(carol_count == 54, "All 54 mother lines use Carol")
|
||||
check(jessica_count == 52, "All 52 Katya lines use Jessica")
|
||||
check(carol_count == 58, "All 58 mother lines use Carol")
|
||||
check(game.voice_length("greeting") <= game.story.intro[0].at, "Greeting fits before prologue")
|
||||
check(45 + game.voice_length("power") <= 51, "Blackout reaction fits before conversation resumes")
|
||||
check(85 + game.voice_length("hum") <= 90, "Hum reaction fits before strike")
|
||||
@@ -126,6 +146,51 @@ func run(target: Node) -> void:
|
||||
click("settings")
|
||||
await capture("phone-credits")
|
||||
click("back_menu")
|
||||
start(2)
|
||||
var blocked: Button = game.action_button("keys_search")
|
||||
check(blocked != null and blocked.disabled, "Choices visible but disabled during greeting")
|
||||
await capture("phone-locked-answers")
|
||||
blocked.pressed.emit()
|
||||
game.choose_action("keys_search")
|
||||
check(game.busy.is_empty() and game.heard == ["greeting"], "Early clicks cannot cut off a speaker")
|
||||
at(game.speech_until - 0.02)
|
||||
check(game.action_button("keys_search").disabled, "Still blocked before audio end")
|
||||
wait_for_speech()
|
||||
check(not game.action_button("keys_search").disabled, "Choices enabled after complete opening exchange")
|
||||
click("keys_search")
|
||||
check(game.cancel_button.disabled, "Cancellation cannot interrupt the spoken request")
|
||||
game.cancel_task()
|
||||
check(not game.busy.is_empty(), "Direct cancel rejected while speaking")
|
||||
at(game.reply_at + 0.01)
|
||||
check(game.cancel_button.disabled, "Mother's answer cannot be interrupted")
|
||||
at(game.busy_end + 0.12)
|
||||
check(game.can_respond(), "Next choices enabled after response and task completion")
|
||||
|
||||
start(1)
|
||||
check(game.soundscape.streams.size() == 16, "All ambience and foley assets loaded")
|
||||
check(game.soundscape.beds.fridge.playing and game.soundscape.beds.tv.playing, "Powered room starts alive")
|
||||
check(game.soundscape.duck_db <= -11.9, "Background ducks under spoken greeting")
|
||||
game.soundscape.update_mix(0.5, false)
|
||||
check(game.soundscape.duck_db > -11 and game.soundscape.duck_db < 0, "Background recovers gently after speech")
|
||||
game.soundscape.dialogue_started(-40)
|
||||
check(game.soundscape.duck_db <= -23.9, "Very quiet voices receive extra background attenuation")
|
||||
game.soundscape.set_volume(0)
|
||||
check(AudioServer.get_bus_volume_db(game.soundscape.scene_bus) <= -79, "Independent background mute")
|
||||
game.soundscape.set_volume(0.75)
|
||||
at(36.1)
|
||||
check(game.soundscape.history.any(func(cue): return cue.id == "kettle"), "Kettle follows the shared call clock")
|
||||
at(45.01)
|
||||
check(not game.soundscape.beds.fridge.playing and not game.soundscape.beds.tv.playing, "Power cut silences appliances")
|
||||
check(game.soundscape.beds.room.playing and game.soundscape.beds.line.playing, "Room and telephone survive power cut")
|
||||
finish("flat")
|
||||
check(not game.soundscape.active and game.soundscape.queue.is_empty(), "Strike stops room and all pending sounds")
|
||||
start(2)
|
||||
perform("keys_search")
|
||||
check(game.soundscape.history.any(func(cue): return cue.id == "keys"), "Key sound follows actual search")
|
||||
click("lamp_search")
|
||||
wait_for_speech()
|
||||
click("cancel")
|
||||
check(not game.soundscape.queue.any(func(cue): return cue.task), "Cancel discards pending action sounds")
|
||||
# Every redial repeats the same external world, including the first call.
|
||||
for number in range(1, 11):
|
||||
start(number)
|
||||
@@ -166,7 +231,7 @@ func run(target: Node) -> void:
|
||||
check(game.action_button("keys_search") == null, "Prologue has no commands")
|
||||
check(game.clock_label.text == "Разговор", "Prologue hides time")
|
||||
for beat in game.story.intro: at(beat.at + 0.01)
|
||||
check(game.heard.size() == 11 and "power" in game.heard, "Ordinary conversation and blackout acknowledgement")
|
||||
check(game.heard.size() == 19 and "power" in game.heard, "Ordinary conversation and blackout acknowledgement")
|
||||
else:
|
||||
var entry: Dictionary = game.story.chapters[number - 1]
|
||||
var opening_at: float = game.events[0].at
|
||||
@@ -249,7 +314,9 @@ func run(target: Node) -> void:
|
||||
perform("keys_search")
|
||||
perform("front")
|
||||
perform("stairs")
|
||||
check(game.facts.has("stairs"), "Blocked stairs discovered")
|
||||
check(game.facts.has("stairs"), "Unlit intact stairs discovered")
|
||||
check("целая" in game.story.facts.stairs and "завален" not in game.story.facts.stairs, "Stairwell is intact")
|
||||
await capture("phone-dark-stairwell")
|
||||
finish("landing")
|
||||
|
||||
# Full route with learned facts is feasible at normal production durations,
|
||||
@@ -358,7 +425,8 @@ func run(target: Node) -> void:
|
||||
file.close()
|
||||
print("PHONE_QA ", "PASS" if errors.is_empty() else "FAIL", " checks=", checks, " route=", route_time, " errors=", errors)
|
||||
await render()
|
||||
for player in [game.voice, game.room, game.siren, game.effect, game.hum, game.notification_sound]:
|
||||
game.soundscape.stop()
|
||||
for player in [game.voice, game.siren, game.effect, game.hum, game.notification_sound]:
|
||||
player.stop()
|
||||
player.stream = null
|
||||
await game.get_tree().create_timer(0.1).timeout
|
||||
|
||||
Reference in New Issue
Block a user