Feat/env-manager #1

Merged
math-pixel merged 46 commits from feat/env-manager into develop 2026-05-11 15:23:32 +00:00
Owner

feat: add dialogue, subtitles, cinematics and editor tooling

Summary

This PR adds the first complete runtime and editor workflow for audio dialogues, subtitles, and camera cinematics.

It introduces:

  • dialogue playback driven by a manifest
  • SRT subtitle loading with FR fallback
  • runtime cinematic playback with GSAP camera keyframes
  • synchronized dialogue cues inside cinematics
  • editor panels to manage SRT files, dialogue manifests, and cinematic manifests
  • dev API endpoints to save and validate those assets from /editor
  • settings UI for audio volumes, subtitles, subtitle language, and repair runtime mode
  • documentation updates for users and technical contributors

Runtime Changes

Audio

  • Extends AudioManager with audio categories:
    • music
    • sfx
    • dialogue
  • Adds per-category volume support.
  • Allows one-shot SFX/dialogue playback to return the created HTMLAudioElement.
  • Adds optional stereo pan support through Web Audio StereoPannerNode.
  • Connects gameplay SFX to repair interactions, including case opening feedback.

Settings

  • Adds a runtime settings store.
  • Adds an in-game settings menu opened with Escape.
  • Adds controls for:
    • music volume
    • SFX volume
    • dialogue volume
    • subtitles enabled/disabled
    • subtitle language
    • repair runtime mode: JS or Python

Subtitles

  • Adds SRT parsing and validation utility.
  • Adds subtitle state management.
  • Adds a runtime subtitle overlay mounted in game UI and editor.
  • Supports one SRT file per voice/person.
  • Uses subtitle times relative to each dialogue audio file.
  • Adds FR subtitle files for:
    • narrateur
    • fermier
    • electricienne
  • Adds EN subtitle fallback policy:
    • missing EN SRT files produce warnings
    • runtime falls back to FR
    • missing EN SRT files are not blocking errors

Dialogues

  • Adds public/sounds/dialogue/dialogues.json.
  • Adds dialogue manifest types and validation.
  • Adds dialogue manifest loading with subtitle fallback.
  • Adds dialogue playback helpers:
    • playDialogueById
    • queueDialogueById
    • clearQueuedDialogues
  • Adds runtime dialogue triggers from:
    • global timecodes
    • gameplay interactions
    • cinematic dialogue cues
  • Renames the old Leonie-related audio asset to the electricienne naming convention.

Cinematics

  • Adds public/cinematics.json.
  • Adds cinematic manifest types and validation.
  • Adds runtime cinematic loading.
  • Adds GameCinematics using GSAP camera keyframes.
  • Adds support for cinematic dialogueCues.
  • Prevents player input during cinematic playback.
  • Synchronizes the intro dialogue through cinematics.json instead of duplicating a global dialogue timecode.

Editor Changes

SRT Editor

Adds EditorSrtPanel with:

  • voice/language selection
  • SRT editing
  • template generation
  • diagnostics
  • save/export actions
  • audio preview
  • timing helpers

Dialogue Manifest Editor

Adds EditorDialogueManifestPanel with:

  • dialogue listing
  • add/edit/delete support
  • audio path and speaker metadata editing
  • dialogue preview
  • helper to create matching FR subtitle cues

Cinematic Manifest Editor

Adds EditorCinematicManifestPanel with:

  • cinematic listing
  • camera keyframe editing
  • dialogue cue editing
  • dialogueId selection from dialogues.json
  • local validation of known dialogue IDs
  • preview support in /editor

Dev APIs

Adds Vite dev endpoints:

  • POST /api/save-srt
  • POST /api/save-dialogues
  • POST /api/save-cinematics
  • GET /api/validate-dialogues

The save endpoints validate payloads before writing to public/.

save-cinematics now also validates that every dialogueCues[].dialogueId exists in dialogues.json, preventing broken cinematic-dialogue references.

Documentation

Updates:

  • docs/user/features.md
  • docs/user/editor.md
  • docs/technical/architecture.md
  • docs/technical/editor.md
  • embedded docs translations in src/data/docs/docsTranslations.ts

The documentation now covers:

  • audio categories
  • settings menu
  • subtitle workflow
  • dialogue manifest workflow
  • cinematic manifest workflow
  • editor save/validation APIs
  • EN-to-FR subtitle fallback behavior

Validation

Ran:

  • rtk npm run lint:fix
  • rtk npm run format
  • rtk npm run typecheck

Dev API validation:

  • GET /api/validate-dialogues
    • result: valid: true
    • warnings only for missing EN subtitle files, expected fallback behavior
  • POST /api/save-cinematics
    • result: success: true with the current cinematic manifest
  • negative validation test:
    • unknown dialogueCues[].dialogueId
    • correctly rejected with: Cinematic bad_cinematic references unknown dialogue dialogue_inconnu

Notes For Review

  • EN SRT files are intentionally not included yet.
  • Missing EN subtitles are warnings, not errors, because runtime falls back to FR.
  • SRT files are organized by voice/person, not by dialogue.
  • SRT timestamps are relative to each dialogue MP3, not global game time.
  • Cinematic/dialogue synchronization now belongs in cinematics.json.dialogueCues.
  • The intro dialogue no longer has a duplicated global timecode.
# feat: add dialogue, subtitles, cinematics and editor tooling ## Summary This PR adds the first complete runtime and editor workflow for audio dialogues, subtitles, and camera cinematics. It introduces: - dialogue playback driven by a manifest - SRT subtitle loading with FR fallback - runtime cinematic playback with GSAP camera keyframes - synchronized dialogue cues inside cinematics - editor panels to manage SRT files, dialogue manifests, and cinematic manifests - dev API endpoints to save and validate those assets from `/editor` - settings UI for audio volumes, subtitles, subtitle language, and repair runtime mode - documentation updates for users and technical contributors ## Runtime Changes ### Audio - Extends `AudioManager` with audio categories: - `music` - `sfx` - `dialogue` - Adds per-category volume support. - Allows one-shot SFX/dialogue playback to return the created `HTMLAudioElement`. - Adds optional stereo pan support through Web Audio `StereoPannerNode`. - Connects gameplay SFX to repair interactions, including case opening feedback. ### Settings - Adds a runtime settings store. - Adds an in-game settings menu opened with `Escape`. - Adds controls for: - music volume - SFX volume - dialogue volume - subtitles enabled/disabled - subtitle language - repair runtime mode: JS or Python ### Subtitles - Adds SRT parsing and validation utility. - Adds subtitle state management. - Adds a runtime subtitle overlay mounted in game UI and editor. - Supports one SRT file per voice/person. - Uses subtitle times relative to each dialogue audio file. - Adds FR subtitle files for: - `narrateur` - `fermier` - `electricienne` - Adds EN subtitle fallback policy: - missing EN SRT files produce warnings - runtime falls back to FR - missing EN SRT files are not blocking errors ### Dialogues - Adds `public/sounds/dialogue/dialogues.json`. - Adds dialogue manifest types and validation. - Adds dialogue manifest loading with subtitle fallback. - Adds dialogue playback helpers: - `playDialogueById` - `queueDialogueById` - `clearQueuedDialogues` - Adds runtime dialogue triggers from: - global timecodes - gameplay interactions - cinematic dialogue cues - Renames the old Leonie-related audio asset to the `electricienne` naming convention. ### Cinematics - Adds `public/cinematics.json`. - Adds cinematic manifest types and validation. - Adds runtime cinematic loading. - Adds `GameCinematics` using GSAP camera keyframes. - Adds support for cinematic `dialogueCues`. - Prevents player input during cinematic playback. - Synchronizes the intro dialogue through `cinematics.json` instead of duplicating a global dialogue timecode. ## Editor Changes ### SRT Editor Adds `EditorSrtPanel` with: - voice/language selection - SRT editing - template generation - diagnostics - save/export actions - audio preview - timing helpers ### Dialogue Manifest Editor Adds `EditorDialogueManifestPanel` with: - dialogue listing - add/edit/delete support - audio path and speaker metadata editing - dialogue preview - helper to create matching FR subtitle cues ### Cinematic Manifest Editor Adds `EditorCinematicManifestPanel` with: - cinematic listing - camera keyframe editing - dialogue cue editing - `dialogueId` selection from `dialogues.json` - local validation of known dialogue IDs - preview support in `/editor` ### Dev APIs Adds Vite dev endpoints: - `POST /api/save-srt` - `POST /api/save-dialogues` - `POST /api/save-cinematics` - `GET /api/validate-dialogues` The save endpoints validate payloads before writing to `public/`. `save-cinematics` now also validates that every `dialogueCues[].dialogueId` exists in `dialogues.json`, preventing broken cinematic-dialogue references. ## Documentation Updates: - `docs/user/features.md` - `docs/user/editor.md` - `docs/technical/architecture.md` - `docs/technical/editor.md` - embedded docs translations in `src/data/docs/docsTranslations.ts` The documentation now covers: - audio categories - settings menu - subtitle workflow - dialogue manifest workflow - cinematic manifest workflow - editor save/validation APIs - EN-to-FR subtitle fallback behavior ## Validation Ran: - `rtk npm run lint:fix` - `rtk npm run format` - `rtk npm run typecheck` Dev API validation: - `GET /api/validate-dialogues` - result: `valid: true` - warnings only for missing EN subtitle files, expected fallback behavior - `POST /api/save-cinematics` - result: `success: true` with the current cinematic manifest - negative validation test: - unknown `dialogueCues[].dialogueId` - correctly rejected with: `Cinematic bad_cinematic references unknown dialogue dialogue_inconnu` ## Notes For Review - EN SRT files are intentionally not included yet. - Missing EN subtitles are warnings, not errors, because runtime falls back to FR. - SRT files are organized by voice/person, not by dialogue. - SRT timestamps are relative to each dialogue MP3, not global game time. - Cinematic/dialogue synchronization now belongs in `cinematics.json.dialogueCues`. - The intro dialogue no longer has a duplicated global `timecode`.
math-pixel added 45 commits 2026-05-11 15:19:11 +00:00
fix: a pb with octree
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
6854f52b23
math-pixel added 1 commit 2026-05-11 15:23:06 +00:00
Update .gitignore
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
79dc778e43
math-pixel merged commit 03cf39bcda into develop 2026-05-11 15:23:32 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: math-pixel/La-Fabrik#1