Topics
MySys22.DialogueSystem — Documentation
General guide
Technical reference
MySys22.DialogueSystem — Documentation
System scope, technical characteristics, document organization and glossary.
1. Purpose of the documentation
The present set of documents describes MySys22.DialogueSystem, a system for the management of interactive dialogues intended for projects developed with Unity. The documentation is divided into standalone documents, each of which is intended for a specific category of users and can be consulted independently of the others.
2. Scope of the system
MySys22.DialogueSystem separates the authoring phase of the textual content from the execution phase of the dialogue within the application product. The separation is implemented by means of two distinct components that communicate exclusively through a shared file structure.
2.1 Components
| Commercial name | Component | Technology | Intended users |
|---|---|---|---|
| MYSYS22.DEn | Execution engine running within Unity | C# (Unity 6) | developers, game designers |
| MYSYS22.DEd | Standalone authoring editor, distributed as a jar with a lib/ folder | Java 21, JavaFX | writers, translators, narrative designers |
2.2 Integration model
The two components share neither code nor compilation dependencies. Data exchange takes place through the Assets/StreamingAssets folder of the Unity project, which constitutes the single contract of the system: it contains dialogue graphs, the line database, the character registry, the variable catalogue and the manifest files. The engine reads this structure at runtime; the editor produces and updates it by means of the deploy operation.
Operational consequence: the authors of the texts can work in parallel with the definition of the graph, and neither role must have access to the tools of the other.
3. Technical characteristics
| Characteristic | Description |
|---|---|
| Authoring independence | the editor is a standalone application; the drafting of texts requires neither opening Unity nor compiling the project |
| Single contract | paths, formats and denominations are defined in a single structure shared between editor and engine |
| Separation between path and text | the graph contains exclusively numeric DID references; the line database contains exclusively text |
| Identifier stability | identifiers already referenced by the graph cannot be deleted; new lines occupy the free intervals |
| Localization | each language corresponds to a folder of normalized files with an index; the language can also be changed at runtime |
| Application actions | the operations required by the game are implemented as C# actions with parameters, wait and boolean result |
| Platforms | single content for Windows, Linux, macOS, Android, iOS and WebGL; asynchronous reading by means of indices on platforms without direct file system access; IL2CPP support |
| Preliminary checks | project validation, identifier coverage and graph digests, also available from the command line |
| Editor interface | English, Italian, Spanish, Romanian, Japanese |
| Extension | typed variables, expressions evaluated by an interpreter without code execution, quest system, audio management per node and per line, public API |
4. Organization of the documentation
Every document is self-contained: only the required document is consulted.
| Document | Recipients | Content |
|---|---|---|
| General guide | all personnel involved | scope of the system, requirements, installation, initial configuration, data structure, complete reference of the interfaces |
| Technical documentation | technical game designers, integrators, maintainers | architecture, file formats, node types, execution cycle, actions, conditions, platforms, build process, error codes |
| Developer API | C# programmers | public API, custom actions, variables, quests, audio, position and save |
Each document exists in two forms: the Markdown file, which is the source, and the static site page generated from it.
| Form | Path |
|---|---|
| Source | 01-GUIDA-GENERALE.md, 02-TECNICO-MOTORE-EDITOR.md, 03-DEVELOPER-API.md |
| Site (Italian) | site/index.html |
| Site (English) | site/index.en.html |
Translations of the documents are stored in i18n/<language code>/ with identical file names.
5. Glossary
| Term | Definition |
|---|---|
| DID | numeric identifier of a line within the file of a character; it constitutes the key shared between graph and line database |
| CID | numeric identifier of a character (for example 0 for Anna); the displayed name is defined in characters.list.yaml |
| Graph | file *.graph.yaml containing nodes and connections that define a dialogue |
| Contract | file structure internal to Assets/StreamingAssets comprising graphs, lines, characters, variables and manifest; it represents the single point of contact between editor and engine |
| Digest | file engine.graphdigest.json, produced by the engine, which lists the identifiers used by the game |
| Function | node that calls application code and waits for a result |
| manifest.txt | index of the files, employed on platforms where it is not possible to enumerate the content of a folder |
General guide
Requirements, installation, initial configuration, on-disk data structure and the complete interface reference.
1. Overview
MySys22.DialogueSystem consists of two distinct programs that operate on the same data structure: the execution engine, integrated in Unity, and the authoring editor, a standalone application intended for the drafting of texts. The present guide describes installation, initial configuration, the data structure and the complete reference of the two interfaces.
1.1 Functional architecture
- The engine (
MYSYS22.DEn) resides in the Unity project, interprets the dialogue graphs,
presents the lines and calls the actions required by the game logic.
- The editor (
MYSYS22.DEd) operates on an independent writing project, produces the line
databases and transfers the content to the Unity project by means of the deploy operation.
- The data exchange takes place exclusively through the
Assets/StreamingAssetsfolder, which
constitutes the contract of the system.
1.2 Operational roles
| Role | Tool | Responsibility |
|---|---|---|
| Writer, translator | Java editor | drafting and revision of the lines, management of characters and variables, deploy of the content |
| Game designer | Unity | definition of the graph: sequence of the lines, choices, functions, conditions, jumps between graphs |
| Developer | Unity, C# code | implementation of the actions required by the graph, management of events, variables, quests, audio and position |
1.3 Reasons for the separation into two components
The separation allows the drafting of texts while the graph is being modified, without requiring either role to learn the tool of the other. The graph contains no text and the line database contains no path references: the two activities proceed independently and meet solely through the identifiers of the lines.
2. Requirements and installation
2.1 Requirements
| Component | Requirements |
|---|---|
| Engine | Unity 6 (version 6000.0.x), TextMeshPro, Input System |
| Editor | Java 21; for compilation from sources, Maven |
The engine is compatible with the classic input manager, with the new Input System and with the simultaneous activation of both.
2.2 Installation of the engine (MYSYS22.DEn)
- Copy the
Assets/MySys22.DialogueEnginefolder into the Unity project.
- Select the menu
MySys22 ▸ Dialogue ▸ Setup Sceneto create and connect the dialogue interface
in the current scene.
- The data structure in
Assets/StreamingAssetsis created automatically on first use.
2.3 Installation of the editor (MYSYS22.DEd)
Two execution modes are provided:
| Mode | Procedure | Intended users |
|---|---|---|
| Portable distribution | run run.sh (Linux, macOS) or run.bat (Windows) from the folder containing mysys22-dialogue-editor.jar and the lib/ folder | end users |
| Compilation from sources | run MySys22.DialogueEditor/run.sh, which performs the compilation by means of Maven | developers |
The editor starts on the initial screen with the list of recent projects; it does not require the installation of Unity.
3. Initial configuration procedure
The following procedure produces a working dialogue consisting of a line associated with a character.
- In Unity, open the window
MySys22 ▸ Dialogue ▸ Dialogue Graph Editor.
- On the canvas, select with the right button
Add Dialogue Nodeand specify the fieldsSpeaker
(identifier of the character), Start DID and End DID.
- Select the node, open the context menu and choose
Set as Start Node; the node concerned is
highlighted with a green border.
- Save the graph with
File ▸ Save. The file is written toAssets/StreamingAssets/Graphs.
- In the Java editor, select
New Projectand specify name, language and path of the Unity
project.
- Open the lines tab, insert the rows with identifier
LIDcorresponding to theDIDdefined in
the graph, then draft the texts.
- Select the button
Injectto transfer the content to the Unity project.
- In Unity, add the
GameSetupcomponent to the scene, or useSetup Scene, and start playback:
the dialogue is presented on screen.
If [317] No dialogue graph found is signalled in the Console, the configured graph has not been located: set the field Graph of the GameSetup component to the desired graph and verify that the corresponding file is present in Assets/StreamingAssets/Graphs.
4. Data structure on disk
4.1 Runtime contract (Unity project)
The engine reads the dialogue data from the Assets/StreamingAssets folder:
Assets/StreamingAssets/
├── engine.manifest.json project descriptor
├── engine.graphdigest.json list of the DID used by the game
├── Graphs/
│ ├── <grafo>.graph.yaml dialogue graphs
│ └── manifest.txt index of the graphs
├── Dialogue/
│ └── <LINGUA>/
│ ├── <CID>.yaml lines of a character
│ └── manifest.txt index of the line files
├── Characters/
│ └── characters.list.yaml identifiers and names of the characters
└── Variables/
└── variables.yaml variables used by the conditions
4.2 Writing project (Java editor)
The editor stores the content in a dedicated project folder, defined at creation time. The structure comprises the file .project.yaml, the databases lines/<LINGUA>/<CID>.yaml, the folders Characters and variables, and the digest imported from the engine.
The deploy operation copies and normalizes such content into the Assets/StreamingAssets folder, without requiring the intervention of Unity.
5. Unity interface reference
5.1 Main menu (MySys22 ▸ Dialogue)
| Menu item | Description |
|---|---|
Dialogue Graph Editor | opens the graph definition window |
Setup Scene | creates or restores the dialogue interface in the current scene (canvas, texts, choice panel) and connects the references |
Auto Setup Scene On/Off | enables or disables the automatic configuration of the scene on opening |
Validate Project | verifies graphs, identifiers, actions and choices; produces a report in the Console with the error codes |
Export Graph Digest | generates engine.graphdigest.json, containing the identifiers used by the game |
Reveal Graph Digest | shows the digest file in the file manager of the operating system |
Generate Index Manifests | regenerates Graphs/manifest.txt and all the files Dialogue/<LINGUA>/manifest.txt, required on Android, iOS and WebGL |
Generate Manifest for Current Language | regenerates the index of the current language only |
Generate AOT link.xml | generates the file link.xml, which prevents IL2CPP from eliminating the classes used for reflection (actions, YAML data types) |
Open Engine Folder | opens Assets/StreamingAssets in the file manager |
Open Project Folder | opens the folder of the Unity project |
Open Dialogue Editor (Java) | starts the Java editor |
Editor Settings... | configures the path of the Java editor (folder, Maven executable, jar archive) |
Engine Status | displays a summary: manifest, languages, graphs, loaded rows and active provider |
5.2 Inspector panel
The project section is present on the inspectors of the GameSetup and DialogueBridge components and comprises the following buttons.
| Button | Description |
|---|---|
Refresh | re-reads manifest, languages and graphs without reloading the dialogue |
Validate | performs the same verification as Validate Project, limited to the selected component |
Export Digest | exports the digest of the graphs used |
Graph Editor | opens the graph definition window |
Open StreamingAssets | opens the contract folder |
Open Dialogue Editor (Java) | starts the Java editor |
Editor Settings | opens the settings of the Java editor |
Configuration parameters:
| Field | Description |
|---|---|
Language | Project default or a specific language; it does not overwrite the preference stored by the player |
Graph | First graph found or a specific graph |
Auto start dialogue (GameSetup) | enables the automatic start of the dialogue at scene start |
Create overlay fallback (GameSetup) | in the absence of a connected interface, creates a minimal one, ensuring the presentation of the dialogue |
Enable logs (GameSetup) | enables or disables the log messages with prefix [MySys22.DialogueEngine] |
5.3 Dialogue Graph Editor window
| Command | Position | Description |
|---|---|---|
File ▸ New | command bar | creates an empty graph |
File ▸ Load | command bar | opens a file *.graph.yaml |
File ▸ Save | command bar | saves the current graph and rewrites the graph index |
File ▸ Save As... | command bar | saves the graph under a different name |
Add Dialogue Node | context menu of the canvas | inserts a line node, with the fields Speaker, Start DID, End DID, audio and automatic actions |
Add Choice Node | context menu of the canvas | inserts a choice node, with one output for each option (label, text identifier, condition) |
Add Function Node | context menu of the canvas | inserts a node that calls a game action (Action, parameters, wait) |
Add Condition Node | context menu of the canvas | inserts a node with two outputs, True and False |
Add Jump Node | context menu of the canvas | inserts a jump node towards another graph or a return to the calling graph |
Add End Node | context menu of the canvas | inserts a dialogue closing node |
Set as Start Node | context menu of a node | defines the initial node of the dialogue, highlighted with a green border |
Clear Start Node | context menu of the canvas | removes the designation of the initial node |
5.4 Node types
| Type | Function | Main fields |
|---|---|---|
| Dialogue | presents a line | Speaker (CID), Start DID, End DID, audio, repetition, voice per line, parallel and completion actions |
| Choice | presents a set of options | list of the options: label, identifier of the localized text, condition; one output per option |
| Function | calls application code and waits for its outcome | Action, parameters, wait for completion |
| Condition | routes the outcome of a function | two outputs, True and False, connectable to any node |
| Jump | transfers the execution to another graph | destination graph, return to the calling graph |
| End | concludes the dialogue | no field |
6. Java editor interface reference
6.1 Initial screen
| Element | Description |
|---|---|
New Project | creates a project: name, language, version and chapter, then local path and folder of the Unity project |
Open Project | opens an existing project from the file system, from SFTP or from a Git repository |
| Recent project card | reopens the corresponding project |
Context menu ▸ Open | equivalent to opening from the card |
Context menu ▸ Edit name | modifies the project name and updates the manifest |
Context menu ▸ Copy path | copies the project path to the clipboard |
Context menu ▸ Remove from list | removes the project from the recent list without deleting any data |
Context menu ▸ Local delete | deletes the project folder, subject to confirmation |
| Information icon | opens the settings panel, including the interface language selector |
The languages available for the interface are: English, Italian, Spanish, Romanian and Japanese.
6.2 Opening a project
| Tab | Description |
|---|---|
Local | selection of a folder containing a file .project.yaml; the import starts with Import |
SFTP | download of the project from a remote server: host, port, user, SSH key or password and local path |
Git | cloning of the project: repository URL, branch and local path |
6.3 Editing window
Title bar:
| Element | Description |
|---|---|
File ▸ Save, Save All | not active: saving is automatic on every modification |
File ▸ Exit | closes the editor |
Settings | opens the information and settings panel |
Window ▸ Reset Layout | not active |
Inject | performs the deploy towards the Unity project and presents a summary: languages, files, rows, destination path and reports |
Project Manager panel (on the left): tree structure of the project files.
| Context menu item | Description |
|---|---|
New File | creates a file, adding the extension .yaml if absent |
New Folder | creates a folder |
Delete | deletes the selected element; the protected files .project.yaml and .registry.log cannot be deleted |
| Double click on a file | opens the corresponding tab |
Side icons, which open the lower panels:
| Icon | Description |
|---|---|
Git | Git console, available if Git management is active in the project |
SFTP | SFTP synchronization panel |
Debug | diagnostics panel, including the command Import Digest |
Console | system console of the project (bash or PowerShell) |
6.4 Work tabs
Lines tab, identified as ‹CID› [LINGUA]:
| Element | Description |
|---|---|
Field CID | modifies the character associated with the file; if the identifiers are already used by the game, confirmation is requested |
Column LID | identifier of the line; not modifiable |
Column Line | text of the line; editing is activated with a double click |
Insert | inserts a line between two existing identifiers, using a free interval; if no space is available, a report is emitted |
+ | adds a line with the next free identifier |
− | deletes the selected line; the operation is rejected if the identifier is referenced by the game |
↶, ↷ | undoes and restores the last operation; equivalent to Ctrl+Z, Ctrl+Y and Ctrl+Shift+Z |
The tab furthermore indicates the list Referenced DIDs, that is the identifiers actually used by the graph, obtained from the digest.
Tab characters.list:
| Element | Description |
|---|---|
Columns CID, Name, Language | character registry; the field Name defines the name displayed in the dialogue |
+, − | adds or removes a character |
↶, ↷ | undoes and restores the last operation |
Tab variables:
| Element | Description |
|---|---|
Columns Name, Type, Default, Description | variables used by the conditions of the graph; the admitted types are bool, int, float and string |
+, − | adds or removes a variable |
↶, ↷ | undoes and restores the last operation |
Tab .project.yaml:
| Element | Description |
|---|---|
| Name, dialogue version, chapter | identifying data of the project, also used in the reports |
| Default language | start language of the dialogue |
| Languages | comma-separated list; codes not included among the interface languages are admitted |
| Path of the Unity project | destination of the deploy operation |
| SFTP section | connection parameters to the remote server |
Save | saves the project manifest |
Create shortcut... | creates a file .mysys22 that allows the project to be opened with a double click |
The tab .registry.log presents the change log in read-only mode.
Debug panel:
| Element | Description |
|---|---|
Import Digest | imports the file engine.graphdigest.json exported by Unity |
↻ | re-runs the verifications on the project and populates the table with information, warnings and errors |
7. Workflow
- The game designer defines or updates the graphs in Unity, assigning the identifiers to the
lines.
- The game designer runs
Export Graph Digestand transfers the digest to the text writer.
- The writer imports the digest into the Java editor by means of
Debug ▸ Import Digest; the lines
tab signals the identifiers not yet documented.
- The writer produces the texts, performs the translations and updates characters and variables.
- The writer runs
Inject: the editor validates the project, writes the data to
Assets/StreamingAssets and removes the files no longer belonging to the project.
- The developer starts the scene in Unity. Before a build intended for mobile platforms, the
developer runs Generate Index Manifests.
The correct operation of the system depends on the correspondence between the identifiers of the lines present in the graph and those defined in the textual databases. As long as such correspondence is maintained, the content of the texts can be modified without intervening on the graph.
Technical reference
Architecture, file formats, node types, execution cycle, actions, conditions, platforms, build process and error codes.
This document is intended for those who integrate, maintain or extend the system. It describes the on-disk contract, the runtime behaviour of the engine, the Java editor and the build rules.
1. Architecture overview
| Component | Location | Technology | Responsibility |
|---|---|---|---|
| MYSYS22.DEn — engine | Assets/MySys22.DialogueEngine/ | C# (Unity 6) | reads the contract, executes graphs, exposes API/events |
| MYSYS22.DEd — editor | MySys22.DialogueEditor/ | Java 21 + JavaFX | writes lines/characters/variables, validates, performs deployment |
The system is structured into the following Unity assemblies:
| Assembly | Root namespace | Content |
|---|---|---|
MySys22.DialogueEngine.Runtime | MySys22.DialogueEngine | Core, Bridge, UI, Audio, API |
MySys22.DialogueEngine.Editor | MySys22.DialogueEngine.Editor | graph window, node view, inspector, validation, digest, AOT, scene setup |
The runtime depends on Unity.TextMeshPro, Unity.InputSystem, YamlDotNet, Unity.Burst, Unity.Collections, Unity.Jobs, Unity.Mathematics. The SIMD code is optional and always has a scalar fallback.
Project rule: no game logic is contained within the engine. The engine determines *when* a function must start and *what* must be done with the result; the manner in which a door is opened is instead determined by the game.
2. The on-disk contract
The root is unique: Assets/StreamingAssets/ (no wrapper folder).
| File / folder | Written by | Read by | Notes |
|---|---|---|---|
engine.manifest.json | Java editor | engine | project descriptor |
Graphs/<id>.graph.yaml | Graph Editor (Unity) or deployment | engine | graphs |
Graphs/manifest.txt | Unity menu / deployment | engine (mobile) | graph index |
Dialogue/<LINGUA>/<CID>.yaml | deployment | engine | line database |
Dialogue/<LINGUA>/manifest.txt | Unity menu / deployment | engine (mobile) | line index |
Characters/characters.list.yaml | deployment | engine | CID → displayed name |
Variables/variables.yaml | deployment | engine | variable declaration |
engine.graphdigest.json | engine (Unity menu) | Java editor | inventory for the writer |
The ownership of the data is partitioned as follows:
- The path of the dialogue (nodes, choices, functions) resides in the graphs and is therefore the
responsibility of the game designer.
- The text resides in the line database and is therefore the responsibility of the writer.
- The two domains communicate by means of the DID: the graph never contains text, but only numbers.
The legacy paths (Assets/StreamingAssets/MySys22.DialogueEngine/…, MySys22.DialogueAssets/…) are recognised and normalised by the engine; the Java deployment migrates the old folder if it detects it.
3. Format model
3.1 engine.manifest.json
{
"formatVersion": 1,
"projectId": "test",
"name": "test",
"dialogueVersion": "1.0",
"chapter": "1",
"defaultLanguage": "EN",
"languages": ["EN"],
"graphs": 0,
"variables": 0,
"generatedBy": "MySys22 Dialogue Editor 0.1.0",
"generatedAt": "2026-09-24T12:18:37Z"
}
On mobile the file constitutes the source of truth for the language list, since it is not possible to enumerate folders.
3.2 Graphs/<id>.graph.yaml
graphId: test_new_graph
startNode: 2de7e841
nodes:
- id: 2de7e841
type: dialogue
speaker: 0
start_did: 1
end_did: 2
params: {}
next: 6cb687b5
choices: []
position: { x: 351, y: -62 }
isStart: true
The following table lists the fields of a node (NodeData):
| Field | Type | Used by | Meaning |
|---|---|---|---|
id | string | all | node identifier (8 characters) |
type | string | all | dialogue, choice, function, condition, jump, end |
speaker | string | dialogue, choice | CID of the character |
start_did / end_did | int | dialogue | line range of the node (inclusive) |
next | string | all | next node |
action | string | function | id of the action to execute |
params | map | function | parameters passed to the action |
wait | bool | function | if true the dialogue waits for the end of the function |
conditions | list | function | condition nodes to which the result is passed |
condition | string | condition, dialogue, choice | boolean expression |
else | string | condition | alternative branch |
on_true / on_false | string | condition | destination node for the two outcomes |
option | string | condition | free label of the branch |
graph | string | jump | destination graph |
return | bool | jump | if true returns to the calling graph at the end of the branch |
choices | list | choice | options described in the following subsection |
audio / audio_loop | string/bool | dialogue | ambient track of the node |
voice | bool | dialogue | one clip for each DID of the line |
on_parallel | string | dialogue | action started while the line is on screen |
on_complete | string | dialogue | action executed when the line has been read |
position | x/y | editor | position of the node in the canvas |
isStart | bool | editor | highlights the start node |
The following table lists the fields of a choice option (ChoiceData):
| Field | Meaning |
|---|---|
text | working label (fallback if text_did is 0) |
text_did | DID from which the localised text of the choice is read |
next | destination node |
portGuid | port identifier (used by the editor) |
onChosen | action executed when the option is chosen |
condition | if false, the option is not shown |
3.3 Dialogue/<LINGUA>/<CID>.yaml
character: '0'
language: EN
lines:
- did: 1
text: Ciao mi chiamo anna
- did: 2
text: Come stai?
The value did cannot be repeated within the same file; the DIDs need not be consecutive, since gaps are deliberately available for future insertions.
3.4 Characters/characters.list.yaml
characters:
- id: 0
name: Anna
language: EN
The field id is the CID used by the graphs; the field name is a UI label only.
3.5 Variables/variables.yaml
variables:
- name: has_key
type: bool
value: 'false'
description: The player has the key
The permitted types are bool, int, float, string.
3.6 manifest.txt (indices)
| File | Content | Consumer |
|---|---|---|
Graphs/manifest.txt | one file name per line (test_new_graph.yaml) | DialogueGraphIndex |
Dialogue/<LINGUA>/manifest.txt | one CID per line (0) | YamlLineProvider |
Lines starting with # are comments. On desktop the indices are ignored, since the engine enumerates folders.
3.7 engine.graphdigest.json
{
"formatVersion": 1,
"generatedBy": "MySys22.DialogueEngine 1.0",
"languages": ["EN"],
"characters": [{ "cid": "0", "name": "Anna", "language": "EN" }],
"graphs": [
{
"graphId": "test_new_graph",
"file": "test_new_graph.yaml",
"startNode": "2de7e841",
"nodes": [
{ "id": "2de7e841", "type": "dialogue", "speaker": "0",
"startDid": 1, "endDid": 2, "next": "6cb687b5", "choices": [] }
]
}
]
}
The file is intended for the writer, who can thereby know which DIDs are actually used. The Java editor imports it (Debug ▸ Import Digest), while the coverage command verifies that every referenced DID has a text available.
4. Data semantics
4.1 DID and CID
- CID: numeric string of the character, defined in
characters.list.yaml.
- DID: integer of the line within the file of that character.
- The
dialoguenode withstart_did: 5andend_did: 7shows lines 5, 6, 7 in sequence.
- A missing DID produces
[MISSING: <CID> - DID <n>]on screen and a warning in the Console: the
dialogue does not block.
- Stable DIDs: the
Insertcommand in the editor looks for a free gap among the neighbouring
DIDs and never reuses a number already referenced by the game; a referenced DID cannot be deleted. It follows that the graph continues to work even after months of editing.
4.2 Jump between graphs
- The
jumpnode loads another graph (LoadGraphByName, from the in-memory cache on mobile) and
proceeds from there.
- With
return: true, at the end of the destination graph the dialogue returns to the calling graph,
by means of the jump stack in the player.
- If the destination graph does not exist, the engine logs
[319]and terminates the dialogue.
4.3 Audio
- The field
audioon the Dialogue node starts a track (DialogueAudio.Play), whileaudio_loop
repeats it.
- The field
voice: truedetermines the search for a clip for each DID (PlayVoice(cid, did)).
- The clips are resolved from a registry (
DialogueAudio.RegisterAudioClip) or fromResources.
- The audio can also be commanded from the API (
Dialogue.PlayAudio,StopAudio,PlayVoice).
4.4 Position and saving
The engine does not save games: it exposes a snapshot of the position and leaves its management to the game.
Dialogue.Position // current position
Dialogue.SavePosition() // string to be saved at the required location
Dialogue.RestorePosition(s) // reads the string back
Dialogue.OnPositionChanged // event
Dialogue.SetFunctionProgress("step 3/7") // progress within a long-running function
The fields of DialoguePosition are: GraphId, NodeId, NodeType, Speaker, LineIndex, Did, LineCount, WaitingForChoice, WaitingForAction, FunctionActionId, FunctionProgress, Language, Running.
It falls within the responsibility of the game to save the string and, on restore, to bring the graph back to the desired state. See API for developers.
5. Engine execution cycle
| Class | Role |
|---|---|
DialoguePaths | all positions of the contract; no other file may construct paths |
DialogueStreamingAssets | per-platform I/O (direct file or UnityWebRequest) |
DialogueProjectLoader | prepares the project and loads the graph |
DialogueProjectManifestLoader | reads engine.manifest.json |
LanguageManager | current language, available languages, saved preference |
YamlLineProvider | in-memory line database (GetLine(cid, did)) |
CharacterRegistry | CID → displayed name |
DialogueVariableCatalog | variable declarations |
DialogueGraphIndex | graph index + in-memory graphs (used by jump nodes) |
GraphYamlParser | YAML ↔ GraphData |
DialogueGraphPlayer | executes the graph: nodes, choices, waits, functions, audio |
ActionRegistry | discovery and instantiation of the actions |
DialogueBridge (MonoBehaviour) | facade: events, language, variables, quests, position |
Dialogue (static) | convenient API for the game |
DialogueUICanvas / DialogueOverlayUI | presentation (IDialogueView) |
DialogueProjectValidator | graph/line consistency checks |
The startup sequence, valid on both desktop and mobile, is the following:
GameSetup/DialogueBridge.Awakestarts initialisation (asynchronous on mobile, synchronous on
desktop).
DialogueProjectLoaderreads manifest → languages → characters → variables → graph index → graph.
YamlLineProviderloads the lines of the selected language.
- The bridge connects the variables (with
QuestVariableMirror) and creates the player.
StartDialogue()starts from thestartNodenode;Update()callsTick()every frame.
The call to StartDialogue() performed before initialisation has finished is not lost: it is deferred (_startWhenReady).
5.1 DialogueGraphPlayer — states
| State | Meaning |
|---|---|
Running | is showing a node or advancing |
WaitingForChoice | waits for Choose(index) |
WaitingForAction | waits for the end of a function (with safety timeout) |
| stopped | dialogue terminated (End or finished graph) |
The following rules apply:
Tick()advances the typewriter and the waits; it is not necessary on desktop only because the
events arrive from the bridge, but it is mandatory if the game drives the player on its own.
- On desktop the action is executed on the Unity main thread; the internal waits use
ConfigureAwait(false) so as not to block Tick().
StopDialogue, language change, graph change and bridge destruction callCancel()on the actions
in progress.
6. Management of functions and actions
The interface contract is the following:
public interface IAction
{
void Execute(DialogueActionContext context);
Task ExecuteAsync(DialogueActionContext context, CancellationToken cancellationToken);
void Cancel();
}
With regard to automatic discovery: a class decorated with [DialogueAction("NomeAzione")] is found at startup and its name appears in the dropdown of the Function node. MonoBehaviours are rejected with a warning: the actions must be pure classes, since they are instantiated by the engine.
The DialogueActionContext object exposes: ActionId, Node, Graph, Speaker, Language, Parameters (with GetParameter, GetInt, GetFloat, GetBool), Player, Variables, Quests, Completion, Result, plus the commands SetResult(bool), SetNeutral(), Complete().
| Concept | Behaviour |
|---|---|
Wait for completion on the node | the dialogue stops until the function closes |
ctx.SetResult(true/false) | routes the dialogue onto the True/False outputs of the connected Condition nodes |
ctx.CompleteNeutral() | neutral result: the normal output is taken, the conditions are ignored (with a warning if any exist) |
CompletesExternally = true | the function remains open until the game calls Dialogue.Complete(...) |
FunctionTimeoutSeconds | if nobody closes within the time, the engine closes by itself and proceeds |
| Exception in the action | log [305], the function closes in neutral mode, the dialogue continues |
On Parallel (Dialogue node) | action started in parallel while the line is on screen |
On Complete (Dialogue node) | action executed when the line has been read |
The built-in actions are the following:
| Id | Parameters | What it does |
|---|---|---|
LogDebug | message | writes to the Console |
Wait | seconds | waits N seconds (WaitsForCompletion) |
QuestAccept | questId | accepts a quest |
QuestComplete | questId | completes a quest |
QuestFail | questId | fails a quest |
QuestStep | questId, stepId, done | marks an objective |
ReportResult | result | closes the function with true/false |
ExternalResult | — | closes nothing: waits for the game |
7. Condition system
A Condition node connected to the output of a Function receives the result of the function and routes onto on_true / on_false. A Condition node with a condition field is instead evaluated directly.
The supported grammar is the following (no eval, no access to code):
| Element | Examples | ||
|---|---|---|---|
| Comparison operators | ==, !=, <, <=, >, >= | ||
| Logical operators | &&, `\ | \ | , !` |
| Parentheses | `(a \ | \ | b) && c` |
| Literals | true, false, integer and decimal numbers, strings in quotes | ||
| Identifiers | also dotted: quest.rescue.state | ||
| Unary minus | -1 |
Arithmetic is not supported: for counters, AddInt from the API or the quest actions are used.
The quest variables are exposed automatically (QuestVariableMirror):
quest.<id>.state available | active | completed | failed
quest.<id>.available bool
quest.<id>.active bool
quest.<id>.completed bool
quest.<id>.failed bool
quest.<id>.step.<stepId> bool
An invalid expression is logged with [324] and considered false.
8. Variables and quests
- The types are
bool,int,float,string;DialogueVariablesis a typed dictionary with the
OnChanged event.
- The declarations in
variables.yamlpopulate the catalog (DialogueVariableCatalog), used for the
validation and for the editor.
- Conditions on undeclared variables are permitted (with a warning in the validator).
IQuestServiceis the abstraction of the quests;InMemoryQuestServiceis the default
implementation. The game may supply its own (SetQuestService).
QuestVariableMirrormirrors the quest state inside the variables, so that the conditions can read
it without code.
9. Cross-platform support
The DialogueStreamingAssets class is divided by compilation:
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL
private const bool StreamingPlatform = true;
#else
private const bool StreamingPlatform = false;
#endif
public static bool RequiresAsync => ForceAsync || (!Application.isEditor && StreamingPlatform);
| Platform | File access | Notes |
|---|---|---|
| Windows / Linux / macOS standalone | direct File / Directory | the manifest.txt files are ignored |
| Android / iOS | UnityWebRequest with URL jar:file://…!/assets/… | mandatory indices, asynchronous init |
| WebGL | UnityWebRequest with http URL | mandatory indices, no writing to disk |
Since the constant is declared const, the compiler eliminates the useless branch: a desktop build does not contain the jar:/http: code, while a mobile build does not contain the direct I/O. Application.isEditor keeps the play mode in Unity on the direct access path even with an Android build target.
The following consequences arise:
- on mobile folders cannot be enumerated: everything passes through the indices;
DialoguePaths.EnsureLayout()does not create folders when the platform is not writable;
- the restoration of the dialogue in mid-course (
RestorePosition) must be managed by the game.
10. Java editor
10.1 Project structure (user folder)
| Path | Content |
|---|---|
.project.yaml | project manifest (name, languages, Unity path, SFTP) |
.registry.log | change registry |
lines/<LINGUA>/<CID>.yaml | lines |
Characters/characters.list.yaml | characters |
variables/variables.yaml | variables |
graphs/ | graphs (optional: they normally reside in Unity) |
.engine/graphdigest.json | digest imported from the engine |
The state files of the editor, located outside the project (~/.mysys22-dialogue-editor/), are: settings.yaml (UI language), sessions/<projectId>.json (open tabs), recent-projects.json (max 20 recent). The .mysys22 shortcuts contain a project=<percorso> line.
10.2 Deployment
The service UnityDeployService.deploy(session, unityRoot) performs the following steps:
- validates the project (
validateForDeploy): if errors exist, it aborts without touching Unity;
- migrates the old
MySys22.DialogueEnginefolder if present;
- writes
Dialogue/<LINGUA>/<CID>.yamlnormalisingcharacterand sorting the DIDs, plus
manifest.txt per language;
- removes the
.yamlfiles no longer present and the stale language folders (with their.meta);
- writes
Characters/characters.list.yamlandVariables/variables.yaml(empty if absent);
- copies
graphs/*.yamlonly if the project has agraphs/folder, then rewrites
Graphs/manifest.txt from what it actually finds;
- writes
engine.manifest.jsonand realigns the languages in the.project.yaml.
The same operation is available from the Inject button (GUI) and from the deploy command (CLI).
10.3 Tabs and panels
| Tab | File | Notes |
|---|---|---|
‹CID› [LINGUA] | LinesEditorTab | LID/Text table, Insert, +, −, undo/redo |
characters.list | CharacterListTab | CID/Name/Language table |
variables | VariableListTab | Name/Type/Default/Description table |
.project.yaml | ProjectConfigTab | configuration + Save + Create shortcut... |
.registry.log | RegistryLogTab | read-only |
The bottom panels are: Console (project shell), Debug (Import Digest + refresh), SFTP (connect/download), Git (git commands only). The undo/redo functions are associated with the combinations Ctrl+Z, Ctrl+Y, Ctrl+Shift+Z and the history comprises 200 steps.
10.4 CLI (headless)
MySys22 Dialogue Editor - headless tool
validate --project <dir>
coverage --project <dir>
deploy --project <dir> --unity <unity-project-root>
The exit codes of each command are reported in the following table:
| Command | Exit code |
|---|---|
validate | 0 if no errors, 1 if errors exist |
coverage | 0 if no referenced DID is missing, 1 otherwise |
deploy | 0 if the deployment succeeded, 1 otherwise |
| usage error (missing arguments, invalid folder, unknown command) | 2 |
The --project option accepts exclusively the form --project <dir> (no --flag=value).
10.5 Packaging
The packaging scripts are packaging/package-app.sh (Linux/macOS) and package-app.ps1 (Windows):
| Flag / parameter | Effect | |||
|---|---|---|---|---|
| `--type app-image\ | deb\ | dmg / -Type app-image\ | msi` | output type |
--version X.Y.Z / -Version | applied version | |||
--slim / -Slim | reduced runtime with jlink | |||
--fat | complete runtime (copy of the JDK) | |||
--runtime-image DIR | runtime supplied by the user | |||
--skip-build / -SkipBuild | reuses the already compiled jars | |||
--release | produces the portable folder jar + lib/ and terminates (no jpackage) |
For the writers,