"Fisk Dimension β A visionary open-source collective on GitHub, where intellect, artistry, and innovation converge. Only the circled will do. π―"
This repository contains the minimal Unity scaffolding for loading an episode JSON file, playing dialogue audio line-by-line, and presenting branching choices that advance the story. The prototype is intentionally lightweight so it can be dropped into a new Unity project and expanded from there.
Assets/
βββ Resources/
β βββ Audio/ # Place generated dialogue audio here (e.g. ep001_s0_prologue_l000.wav)
β βββ episode.json # Sample episode data for testing
βββ Scripts/
βββ ChoiceOverlay.cs # Handles displaying choices to the player
βββ EpisodeLoader.cs # Loads and deserializes the episode JSON
βββ LipSyncDriver.cs # Simple placeholder lip-sync controller
βββ PlayerController.cs # Core gameplay loop for dialogue playback
- Create the Game Controller
Add an emptyGameObjectto your scene and rename itGameController. - Attach Scripts
AddPlayerController.csandLipSyncDriver.csto theGameControllerobject. - Add Audio Source
Attach anAudioSourcecomponent toGameControllerand assign it to thePlayerController's Audio Source field. - Create UI Canvas
In the Hierarchy choose UI β Canvas (Unity will also add anEventSystem). - Build the Choice Panel
- Inside the Canvas, create a Panel named
ChoicePanel. - Inside
ChoicePanel, add a Text element namedPromptText. - Add as many Button elements as needed for choices (the sample expects two). Name them
OptionButton1,OptionButton2, etc.
- Inside the Canvas, create a Panel named
- Wire Up
ChoiceOverlay- Select
ChoicePaneland add theChoiceOverlay.cscomponent. - Assign references in the Inspector: drag
ChoicePanelinto Choice Panel,PromptTextinto Prompt Text, and your button objects into the Option Buttons array.
- Select
- Reference the Choice Overlay
Return to theGameController, drag theChoicePanelobject into thePlayerController's Choice Overlay field, and drag your lip-sync driver component into Lip Sync Driver. - Add Episode Content
- Leave
Assets/Resources/episode.jsonin place for testing or replace it with your own episode file (remember the loader automatically remapscharβchar_idandgotoβgoto_scene). - Drop your generated audio clips into
Assets/Resources/Audio/using the naming conventionepisodeId_sceneId_l###(e.g.ep001_s0_prologue_l000).
- Leave
- Press Play
Enter Play Mode. ThePlayerControllerloads the JSON episode, plays each audio line sequentially, and displays choices when a scene defines them. Choice selection (or timeout) drives scene transitions.
- Replace placeholder lip-sync logic with your character animation system.
- Trigger rig animations and FX based on the
animandfxmetadata embedded in each line. - Expand the UI to visualize choice timers, player inventory, or relationship meters.
Feel free to adapt and build upon this scaffold as the project evolves.