Dress a Godot 4 scene with a wind bed, a distant bell and a crow

2026-11-24来源 dev.toEnglish
Dress a Godot 4 scene with a wind bed, a distant bell and a crow

A foggy night field in Godot 4: a church on a hill, a dead tree with a crow, and a mixer at the bottom lighting up a wind bed, then a church bell, then a crow

A silent field is just a painting. The same field with wind under it, a church bell that sounds a little too far away, and a crow that never caws the same way twice, is a place the player should not stay the night.

This is how I dress a scene with the Folk Horror SFX & Ambience pack in Godot 4. One looping wind bed does the work of fog you can hear. A quieter, slightly lower church bell sits behind it. Crows come from an AudioStreamRandomizer, so the same take never plays twice in a row. The GIF above is a real Godot 4.3 run of the scripts below (Compatibility renderer, 1280x720). The stills are frames from that run.

Four frames from the same run: wind only, a church bell, a crow, and a second crow take

1. Put the files where Godot expects them

Copy the pack so ogg/ and godot/ sit side by side, for example at res://sfx/folk_horror/ogg/ and res://sfx/folk_horror/godot/. You can skip the wav/ folder in a Godot project. Keep the two folders together, because the randomizer .tres files point at ../../../ogg/....

Godot imports OGG with looping off. The 22 files in ogg/13_ambience_loops/ are already seamless, but they will not wrap until you turn Loop on. Either:

  1. Copy every file from godot/loop_import/ into ogg/13_ambience_loops/ before you open the project (they are .ogg.import files with Loop already on), or
  2. Select the loop files in the FileSystem dock, open the Import dock, tick Loop, and press Reimport.

This walkthrough uses open_field_wind_loop as the fog bed, church_bell_single for the far bell, and crow_caw for the bird. There is no file literally named fog. Wind over an empty field is what reads as fog once the picture is still and grey.

2. Three players, three buses, one autoload

Save this as res://atmosphere.gd and add it under Project > Project Settings > Globals > Autoload with the name Atmosphere.

extends Node # Autoload this as "Atmosphere". # Three layers: a looping wind bed for the fog, a distant church bell, # and crows that never play the same take twice in a row. const DIR := "res://sfx/folk_horror/" const LOOP_WIND := DIR + "ogg/13_ambience_loops/open_field_wind_loop.ogg" const BELL := DIR + "godot/randomizers/01_bells_and_chimes/church_bell_single.tres" const CROW := DIR + "godot/randomizers/08_crows_owls_night_birds/crow_caw.tres" var bed: AudioStreamPlayer var bell: AudioStreamPlayer var crow: AudioStreamPlayer func _ready() -> void: _make_buses() bed = _player("Bed", load(LOOP_WIND), "Ambience", -8.0) bell = _player("Bell", load(BELL), "Bells", -10.0) crow = _player("Crow", load(CROW), "Creatures", -4.0) # Sit the bell a little low so it feels far away in the fog. bell.pitch_scale = 0.92 bed.play() func _player(node_name: String, stream: AudioStream, bus: String, volume_db: float) -> AudioStreamPlayer: var p := AudioStreamPlayer.new() p.name = node_name p.stream = stream p.bus = bus p.volume_db = volume_db add_child(p) return p func _make_buses() -> void: for bus_name in ["Ambience", "Bells", "Creatures"]: if AudioServer.get_bus_index(bus_name) != -1: continue var i := AudioServer.bus_count AudioServer.add_bus() AudioServer.set_bus_name(i, bus_name) AudioServer.set_bus_send(i, "Master") func play_bell() -> void: bell.play() func play_crow() -> void: crow.play() # Crossfade from one looping bed to another (a field into a barn, say). func crossfade(from: AudioStreamPlayer, to: AudioStreamPlayer, secs := 2.0, target_db := -8.0) -> void: to.volume_db = -40.0 to.play() var t := create_tween().set_parallel(true) t.tween_property(from, "volume_db", -40.0, secs) t.tween_property(to, "volume_db", target_db, secs) t.chain().tween_callback(from.stop) 

The wind player starts itself. The bell sits 2 dB under the bed and at 0.92 pitch, which is enough to push it back in the picture without turning it into a different instrument. The crow stays a little louder, because a caw should cut through the wind.

Each one-shot uses an AudioStreamRandomizer from the pack. church_bell_single.tres holds 6 takes. crow_caw.tres holds 4. Playback mode is already "Random (Avoid Repeats)", with a light pitch wobble, so you can call play() and not think about it.

3. Layer them on a timer

In the scene that should feel haunted, wait a breath, then let the bell and the crow in:

func _ready() -> void: # Atmosphere starts the wind bed in its own _ready. await get_tree().create_timer(2.0).timeout Atmosphere.play_bell() await get_tree().create_timer(2.5).timeout Atmosphere.play_crow() await get_tree().create_timer(2.5).timeout Atmosphere.play_crow() await get_tree().create_timer(2.0).timeout Atmosphere.play_bell() 

In a real game, swap the timers for the moments that matter: a bell when the player crosses the churchyard, a crow when they look at the tree, a second crow a few seconds later so the first one feels like it had friends.

The same run, just after the first crow: the Creatures meter is lit, the wind bed is still under it

Tuning notes

  • Keep the bed a few dB under the one-shots. If the wind is as loud as the bell, nothing is far away.
  • Pitch the bell down a little, not the crow. A low crow sounds injured. A low bell sounds distant.
  • For a change of place, add a second loop (a barn, a church interior, crickets in a hedge) and call crossfade(). I ran that too, from open_field_wind_loop into night_field_crickets_loop: the wind player stopped at -40 dB, and the cricket loop landed at -8 dB.
  • If you start on crickets and something enters the field, the pack also has a stinger named stinger_insects_stop. That is the sound of the night noticing you.

What I checked

All of this ran in Godot 4.3.stable (Compatibility renderer) on the box, headless for the audio checks and under Movie Maker at 30 FPS for the GIF.

  • open_field_wind_loop imported with Loop on, length 24.0 s, and stayed playing on the Ambience bus at -8 dB.
  • church_bell_single loaded 6 takes (1.38 s to 1.61 s). crow_caw loaded 4 takes (0.32 s to 0.55 s).
  • play_bell() and play_crow() both started, with playback at 0.09 s shortly after the call. The bell player stayed at pitch 0.92.
  • The crossfade test landed: wind bed stopped at -40 dB, cricket loop playing at -8 dB, and the cricket file also had Loop on (24.0 s).
  • The 12 second Movie Maker run logged the wind bed, two bells and two crows, and finished with the bed still playing. 362 frames, no script errors.

A field is only as haunted as its sounds

The scripts above are short on purpose. What they need is enough real takes that a long walk through the same field never settles into a loop of one crow and one bell. Folk Horror SFX & Ambience is 868 sounds cut from real recordings: church bells and hand bells, ritual drums, crows and owls, barn doors, well rope, wind in tall grass, 22 seamless ambience loops, and the stingers you reach for when the crickets stop. Each named sound with more than one take already has a Godot 4 randomizer, so the arrays are already filled in.

Waveforms drawn from the pack's real recordings, grouped the way the folders are named

The pack folder layout and file names, including church_bell_single and crow_caw

Grab it here: Folk Horror SFX & Ambience

Questions: folk-horror-sfx@darrellbest.com

原文:https://www.a8q9.cn/en/article/dress-a-godot-4-scene-with-a-wind-bed-a-distant-bell-and-a-crow-3f45ac.html

相关文章