Blueprints & Scènes
Structure du blueprint
Un BlueprintExport est le fichier JSON exporté de l'éditeur LSDE. Il contient toutes les données dont le engine a besoin.
interface BlueprintExport {
format: "lsde-blueprints"; // anything else is refused outright
version: 1; // the FORMAT version, not the editor's
generator: Generator; // which software wrote the file
exportedAt: string; // ISO 8601
project: string;
locales: string[];
referenceLocale: string; // the locale written first
dictionaries: DictionaryDefinition[];
functions: FunctionDefinition[];
cards: Card[]; // what a block's `actors` and `emotion` cite
scenes: BlueprintScene[];
}public class BlueprintExport {
public string Format { get; set; } // "lsde-blueprints"
public int Version { get; set; } // 1
public Generator? Generator { get; set; }
public string ExportedAt { get; set; }
public string Project { get; set; }
public List<string> Locales { get; set; }
public string ReferenceLocale { get; set; }
public List<DictionaryDefinition> Dictionaries { get; set; }
public List<FunctionDefinition> Functions { get; set; }
public List<Card> Cards { get; set; }
public List<BlueprintScene> Scenes { get; set; }
}struct BlueprintExport {
std::string format; // "lsde-blueprints"
int version = 0; // 1
Generator generator;
std::string exportedAt;
std::string project;
std::vector<std::string> locales;
std::string referenceLocale;
std::vector<DictionaryDefinition> dictionaries;
std::vector<FunctionDefinition> functions;
std::vector<Card> cards;
std::vector<BlueprintScene> scenes;
};# Dictionary with keys:
# "format": String — always "lsde-blueprints"
# "version": int — the FORMAT version, 1
# "generator": Dictionary
# "exportedAt": String — ISO 8601
# "project": String
# "locales": Array[String]
# "referenceLocale": String
# "dictionaries": Array[Dictionary]
# "functions": Array[Dictionary]
# "cards": Array[Dictionary]
# "scenes": Array[Dictionary]Scenes
Une scene est une séquence de dialogue autonome — une conversation, une cinématique, un tutoriel, une interaction de shop. Dans un jeu, les scenes sont généralement déclenchées par des événements scriptés : le joueur parle à un NPC, entre dans une zone, ou ramasse un objet.
Chaque scene a son propre block d'entrée, son propre flow et son propre état. Plusieurs scenes peuvent tourner en parallèle (ex: un dialogue principal et un overlay de tutoriel). Les scenes sont définies par l'interface BlueprintScene :
interface Scene {
scene: string; // the path — reactor_breach. Builds the i18n keys; changes on a rename.
id: string; // the stable id — sc_u0vqg2g8. Store THIS outside the payload.
label?: string;
start?: string; // the id of the entry block. The scene names it; blocks carry no flag.
blocks: Block[]; // wires live on each block, in block.next. There is no connection table.
}public class BlueprintScene {
public string Scene { get; set; } // the path — reactor_breach
public string Id { get; set; } // the stable id — sc_u0vqg2g8
public string? Label { get; set; }
public string? Start { get; set; } // the id of the entry block
public List<BlueprintBlock> Blocks { get; set; }
}struct BlueprintScene {
std::string scene; // the path — reactor_breach
std::string id; // the stable id — sc_u0vqg2g8
std::optional<std::string> label;
std::optional<std::string> start; // the id of the entry block
std::vector<BlueprintBlock> blocks;
};# Dictionary with keys:
# "scene": String — the path, reactor_breach
# "id": String — the stable id, sc_u0vqg2g8
# "label": String (optional)
# "start": String (optional) — the id of the entry block
# "blocks": Array[Dictionary] — wires live on each block, in block["next"]Connections
Les connections sont les fils entre les blocks — elles définissent quel block mène à quel autre. Il n'y a pas de table de connexions dans l'export : chaque block porte ses propres fils sortants dans block.next, et un fil ne dit que par quel port il part et où il va.
Un fil n'a jamais traversé une scène, dans aucune version du format : to désigne toujours un block de la même scène.
BlueprintConnection est la vue aplatie de ces fils, celle que rend engine.getSceneConnections(sceneRef) — un fil auquel on a rattaché le block dont il part :
// A Link, plus the block it leaves. `Link` is what the payload carries, on block.next.
type BlueprintConnection = Link & { from: string };
interface Link {
port: string; // the exit port NAME: out, then, catch, default, C1, K1, or a card id
to: string; // the id of the target block, IN THE SAME SCENE
toPort: string; // always "in"
}public class BlueprintConnection {
public string From { get; set; } // the id of the block this wire leaves
public string Port { get; set; } // the exit port NAME
public string To { get; set; } // the id of the target block, in the same scene
public string ToPort { get; set; } // always "in"
}struct BlueprintConnection {
std::string from; // the id of the block this wire leaves
std::string port; // the exit port NAME
std::string to; // the id of the target block, in the same scene
std::string toPort = "in";
};# Dictionary with keys:
# "from": String — the id of the block this wire leaves
# "port": String — the exit port NAME: out, then, catch, default, C1, K1, or a card id
# "to": String — the id of the target block, in the same scene
# "toPort": String — always "in"Vous n'aurez normalement pas besoin de les inspecter — le engine gère le routing en interne. engine.getSceneConnections(sceneRef) les expose pour de l'inspection de graphe : une vue de debug qui montre le câblage sans jouer la scène.
Dictionaries
Les dictionaries décrivent les registres de votre jeu — switches, variables, inventaire. Le développeur les déclare dans LSDE pour exposer au narrative designer les variables disponibles dans le moteur. Au runtime, le développeur mappe chaque dictionnaire vers le système correspondant de son jeu. Les conditions et onResolveCondition utilisent ces clés pour évaluer l'état du jeu. Définis par DictionaryDefinition :
interface DictionaryDefinition {
id: string; // what a ConditionTest.dict cites
valueType: 'boolean' | 'number' | 'string'; // what its entries hold
entries: string[]; // the entry names, flat
}public class DictionaryDefinition {
public string Id { get; set; }
public string ValueType { get; set; } // "boolean" | "number" | "string"
public List<string> Entries { get; set; }
}struct DictionaryDefinition {
std::string id;
std::string valueType; // "boolean" | "number" | "string"
std::vector<std::string> entries;
};# Dictionary with keys:
# "id": String
# "valueType": "boolean" | "number" | "string"
# "entries": Array[String]Functions
Les functions décrivent les actions que votre jeu sait exécuter — set_flag, play_sound, give_item. Le développeur les déclare dans LSDE pour que le narrative designer compose des séquences avec des paramètres typés. Au runtime, c'est l'id de la function que le développeur mappe vers ses propres systèmes : un block ACTION le cite dans call.fn, et ses arguments arrivent par nom dans call.args. Définies par FunctionDefinition :
interface FunctionDefinition {
id: string; // what an ActionCall.fn names
params: FunctionParameter[];
}
interface FunctionParameter {
name: string; // ActionCall.args is keyed BY NAME, never by position
type: ValueType; // 'boolean' | 'number' | 'string' | 'dictionaryKey'
dictionary?: string; // for type 'dictionaryKey': the DictionaryDefinition.id it draws from
}public class FunctionDefinition {
public string Id { get; set; }
public List<FunctionParameter> Params { get; set; }
}
public class FunctionParameter {
public string Name { get; set; }
public string Type { get; set; }
public string? Dictionary { get; set; }
}struct FunctionDefinition {
std::string id;
std::vector<FunctionParameter> params;
};
struct FunctionParameter {
std::string name;
std::string type;
std::optional<std::string> dictionary;
};# FunctionDefinition Dictionary:
# "id": String
# "params": Array[FunctionParameter]
#
# FunctionParameter Dictionary:
# "name": String — args are keyed BY NAME, never by position
# "type": "boolean" | "number" | "string" | "dictionaryKey"
# "dictionary": String (optional) — for type "dictionaryKey", the DictionaryDefinition id