wobblyhead hg > minor_monsters
annotate doc/sound.md @ 33:767970d80214
Added tag 0.10.0 for changeset 85d23328a215
| author | ark |
|---|---|
| date | 2026-10-20 18:39 +0200 |
| parents | 85d23328a215 |
| children |
| rev | line source |
|---|---|
| 0 | 1 sound |
| 2 ----- | |
| 3 | |
| 4 | 4 events with a voice recording play the recording. the others play |
| 5 placeholder beeps, generated in the browser (web audio oscillator, a few notes | |
| 6 each), until a recording arrives. | |
| 0 | 7 |
| 8 | |
| 9 events | |
| 10 ------ | |
| 11 | |
| 4 | 12 the event name is the name of its recordings and its entry in [sound.event] |
| 13 in config/game.toml. | |
| 14 | |
| 15 | event | name | notes | | |
| 16 |----------------------|-------------------|-------| | |
| 17 | t0 attack | t0_attack | recorded, 4 variants | | |
| 18 | t1 shot | t1_shot | recorded, 6 variants | | |
| 19 | t2 shot | t2_shot | recorded, 4 variants | | |
| 20 | t3 shot | t3_shot | recorded, 7 variants | | |
| 21 | monster hit | monster_hit | frequent; keep short or play only some of them | | |
| 22 | monster enters map | monster_enter | recorded, 3 variants. every monster for now; to playtest | | |
| 23 | monster dies | monster_die | recorded, 4 variants | | |
| 24 | monster reaches exit | monster_exit | recorded. a heart is lost | | |
| 25 | boss appears | boss_enter | recorded | | |
| 26 | boss reaches exit | boss_exit | recorded | | |
| 27 | boss dies | boss_die | recorded | | |
| 28 | coins arrive | coins_arrive | at most one per short interval | | |
| 29 | wave starts | wave_start | | | |
| 30 | early start bonus | early_bonus | | | |
| 31 | tower built | tower_built | | | |
| 6 | 32 | tower upgraded | tower_upgraded | | |
| 33 | tower sold | tower_sold | | | |
| 4 | 34 | placement refused | placement_refused | no legal spot within reach | |
| 35 | button tap | button_tap | | | |
| 36 | map won | map_won | recorded | | |
| 37 | map lost | map_lost | recorded | | |
|
32
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
38 | splash screen music | intro | recorded, loops while the splash screen shows | |
| 0 | 39 |
| 40 several recordings per event are allowed; the game picks one at random. | |
| 41 | |
| 4 | 42 the map won sound waits until a boss or monster death sound still playing has |
| 43 ended, and map lost waits for the last exit sound. the boss wave may not stay | |
| 44 the end of a map, so boss_die and map_won are separate sounds. | |
| 45 | |
| 46 per event, the config sets a volume, an optional least time between two | |
| 47 plays (plays in between are dropped) and the placeholder beep. | |
| 48 | |
| 0 | 49 |
| 50 recordings | |
| 51 ---------- | |
| 52 | |
| 53 - recorded on any device, supplied in any common format | |
| 4 | 54 - art/sound_sources/ holds the recordings as supplied, named after the event. |
| 55 a recording may hold several variants with pauses between them | |
| 56 - tools/cut_sounds.py turns them into game sounds in art/sounds/. it is run | |
| 57 by hand after a recording changes, not by the build, because it needs | |
| 58 ffmpeg. it lists the number of variants per recording and splits those | |
| 59 recordings at their longest pauses, into NAME_1, NAME_2 and so on. it | |
| 60 trims silence, filters low rumble, fades the ends and brings every sound to | |
| 61 the same peak level. the output is mono mp3, which desktop browsers and | |
| 62 tablets (including safari) play | |
|
32
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
63 - the script can drop the start of a recording up to a set time, and add a |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
64 pause of silence after a sound that loops. intro loses its first 3 s, |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
65 which hold a burp before the music, and gets 0.3 s of silence at the end |
| 17 | 66 - the build embeds art/sounds/ as base64 in www/data/sounds.js. see |
| 4 | 67 architecture.md for why |
| 0 | 68 |
|
32
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
69 browsers only play sound after the first user interaction. on the first |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
70 splash screen after loading, a sound button covers the play button. it |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
71 pulses with a red glow, like an armed sell button. tapping it starts the |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
72 sound and the intro music, and uncovers the play button. when sound was |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
73 switched off in an earlier visit, there is no sound button: the play button |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
74 shows at once and starts the sound as before, and there is no music. |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
75 |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
76 the intro loops until the play button is tapped, then fades out over the |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
77 music_fade setting in [sound]. the splash screen that follows a won game |
|
85d23328a215
added intro music, logic for browser audio triggering on splash screen
ark
parents:
17
diff
changeset
|
78 plays the intro at once, as sound is already running. |
| 0 | 79 |
|
8
2c4fed8baed9
art update, persistent sound setting, tower selling as double action
ark
parents:
6
diff
changeset
|
80 the sound button in the top bar switches sound on and off. the choice is |
|
2c4fed8baed9
art update, persistent sound setting, tower selling as double action
ark
parents:
6
diff
changeset
|
81 stored in the browser (architecture.md, persistence). until the player first |
|
2c4fed8baed9
art update, persistent sound setting, tower selling as double action
ark
parents:
6
diff
changeset
|
82 uses it, the enabled setting in [sound] applies. |
