extends SceneTree ## Verify LEVEL 0 end to end: the generated maze produces walls, everything smashable is ## invisible on arrival, a discharge coats what's in front of you and NOT what's behind, ## the coating settles again, and breathing it registers. ## ## Godot --headless --path game --script dev/probe_backrooms.gd func _initialize() -> void: var main: Node = (load("res://main.tscn") as PackedScene).instantiate() get_root().add_child(main) await process_frame main._load_level("backrooms") for i in 8: await physics_frame var plan = main.get("_plan") var dust = main.get("_dust") var player = main.get("_player") print("site : ", plan.level_name(), " — ", plan.subtitle()) print("generated walls: ", plan.spec["walls"].size(), " pillars+trim slabs: ", plan.spec["slabs"].size()) print("smashables : ", get_nodes_in_group("smashable").size()) print("dust active : ", dust.active) print("visible now : ", _visible_count()) # stand in the middle and spray player.global_position = Vector3(0, 0, 0) await physics_frame dust._cd = 0.0 dust.discharge() await physics_frame print("after 1 puff : visible = ", _visible_count(), " inhaled = %.2f" % dust.inhaled) dust._cd = 0.0 dust.discharge() dust._cd = 0.0 dust.discharge() await physics_frame print("after 3 puffs : visible = ", _visible_count(), " inhaled = %.2f" % dust.inhaled) # fast-forward past the coating time for e in dust._hidden: if is_instance_valid(e): e.set_meta("dust_until", 1) await process_frame await process_frame print("after settling: visible = ", _visible_count()) print("hud : ", dust.hud_line()) # leaving must clear it, or the mechanic leaks into every other site main._load_level("scranton") for i in 6: await physics_frame print("back at office: dust active = ", dust.active, " visible = ", _visible_count(), " / ", get_nodes_in_group("smashable").size()) quit() func _visible_count() -> int: var n := 0 for s in get_nodes_in_group("smashable"): for mi in Floorplan.meshes(s): if (mi as MeshInstance3D).visible: n += 1 break return n