Talking-head dialogue: DialogueDirector, DialogueBox, conversations and speakers

Conversations saved in game/resources/dialogue/ play once at their night and
phase in a paper box with talking heads; example: the morning of day 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-07 21:33:54 -04:00
parent bbd8012fff
commit 1d92f49d96
22 changed files with 1158 additions and 2 deletions

View file

@ -201,6 +201,26 @@ pack (`assets/farm/ithappy/farm/prefabs/assets/`).
"Start the day" ends it. Playtest findings
and tuning notes: [`game/PLAYTEST.md`](game/PLAYTEST.md).
* **Talking heads** — `DialogueDirector` (`game/scripts/dialogue_director.gd`) plays every
`Conversation` saved in `game/resources/dialogue/` once, at its night and phase (`night` 2,
`phase` MORNING is the morning of day 2; `night` 18, `phase` NIGHT is night 18), `delay` seconds
in (the morning starts at once, and the morning sign waits until it's done). `DialogueBox`
shows it above the hotbar on a sheet of paper like the morning sign's: the speaker's name and
words on their side, and their picture standing behind the paper's top edge. Words are written
letter by letter while the head bobs (and flaps its mouth with `talk_frames`) and blips
(`voice`). To add one, in the editor's FileSystem dock: New Resource → `DialogueSpeaker`
per character (`game/resources/dialogue/speakers/`: name, portrait, side, name and text
color, font, size, italics, bold, speed, voice), then New Resource → `Conversation` in
`game/resources/dialogue/` (night, phase, delay, pause the game, auto-advance, and its lines:
`DialogueLine`, a speaker and text, with optional per-line face, color, size, italics, bold).
Text takes BBCode: `[i]`, `[b]`, `[color=#b02010]`, `[font_size=48]`, `[wave]`, `[shake]`. A
conversation pauses the game by default (in co-op the farm can't stop, so the player's
scarecrow stands still instead); one that doesn't takes no input and goes on by itself. A
retried night doesn't replay its conversations; a new vacation does. From code:
`sim.dialogue.play(conversation)`. Debug: F5 plays the current phase's again. The example
(`example_morning_day_2.tres`, the Scarecrow and a Little Green Alien) uses the HUD's painted
icons as placeholder portraits (`DialogueSpeaker.icon`) until real pictures are set.
* **Menus and saving** — `Main` (`game/scripts/main.gd`, `game/scenes/main.tscn`) hosts the farm
under the menus. `MainMenu` is the title screen (Continue, New vacation, Settings, Quit) over
the paused farm, with a camera circling it. `PauseMenu` (Escape / Start) pauses the whole tree
@ -291,6 +311,8 @@ pack (`assets/farm/ithappy/farm/prefabs/assets/`).
| In build mode: build / rotate / pick / dismantle or leave | LMB / Z, C / 1-4, Tab / RMB | RT / d-pad left, right / d-pad down / B |
| Repair a damaged structure (hold) | E | X |
| Start the day (morning review) | Click, Enter | A |
| Talking heads: write the line / next line | Click, Enter, Space, E | A, X |
| Talking heads: skip the conversation | Backspace | Back |
| Pause / resume | Escape | Start |
| Hide the tips | Backspace | Back |
| Mute / unmute your microphone (co-op) | M | - |