Branching conversation and dialog system for the Fyrox Rust game engine. Build RPG-style dialog trees with 5 node types, a UI-independent runner, and Blackboard integration.
Design your conversation graph, run it through pure logic, handle events in your own UI code.
Build dialog trees with Text, Choice, Condition, Action, and End nodes. Wire them into branching conversations.
Feed the graph to DialogRunner. It traverses nodes, evaluates Blackboard conditions, and emits events — zero UI coupling.
Receive typed events: text to display, choices to present, actions to trigger, dialog ended. Your code, your rules.
Use any UI approach — Fyrox UI, egui, custom HUD, or even console output. The system does not dictate visuals.
Core dialog functionality is free and MIT-licensed. Pro adds visual editing, editor integration, and developer tools.
Define conversations in code with the Free tier, or use the visual editor in Pro.
use fyrox_dialog::{DialogGraph, TextNode, ChoiceNode, ConditionNode, ActionNode, EndNode};
use fyrox_ai::blackboard::Blackboard;
// Build a simple branching dialog
let mut graph = DialogGraph::new();
// Add nodes
let greeting = graph.add_node(TextNode {
speaker: "Merchant".into(),
text: "Welcome, traveler! Looking to trade?".into(),
});
let choice = graph.add_node(ChoiceNode {
choices: vec![
"Show me your wares".into(),
"Not today".into(),
"Any special deals?".into(),
],
});
// Condition: check if player has enough gold
let gold_check = graph.add_node(ConditionNode::from_blackboard(
"gold", Condition::gte(100),
));
let deal_yes = graph.add_node(TextNode {
speaker: "Merchant".into(),
text: "I have a rare sword, just for you!".into(),
});
let deal_no = graph.add_node(TextNode {
speaker: "Merchant".into(),
text: "Come back when you have more coin.".into(),
});
let goodbye = graph.add_node(ActionNode { action: "close_shop".into() });
let end = graph.add_node(EndNode);
// Wire the graph
graph.connect(greeting, choice);
graph.connect_choice(choice, 0, deal_yes); // "Show me your wares"
graph.connect_choice(choice, 1, goodbye); // "Not today"
graph.connect_choice(choice, 2, gold_check); // "Any special deals?"
graph.connect_condition(gold_check, true, deal_yes);
graph.connect_condition(gold_check, false, deal_no);
graph.connect(deal_yes, end);
graph.connect(deal_no, end);
graph.connect(goodbye, end);
// Run the dialog
let mut runner = DialogRunner::new(&graph, &blackboard);
while let Some(event) = runner.next_event() {
match event {
DialogEvent::Text { speaker, text } => show_text(speaker, text),
DialogEvent::Choice { choices } => {
let pick = show_choices(&choices);
runner.select_choice(pick);
}
DialogEvent::Action { action } => handle_action(action),
DialogEvent::End => break,
}
}
See exactly what each tier includes at a glance.
| Feature | Free | Pro |
|---|---|---|
| Dialog graph (Text, Choice, Condition, Action, End) | ✓ | ✓ |
| DialogRunner (pure logic, UI-independent) | ✓ | ✓ |
| Blackboard integration (fyrox-ai Blackboard & Condition) | ✓ | ✓ |
| Full serde serialization | ✓ | ✓ |
| Visual Node Graph Editor (2-panel: graph + properties) | — | ✓ |
| DialogPlayer script (drop on NPCs) | — | ✓ |
| .dialog resource format with hot-reload | — | ✓ |
| DialogDebugLogger (11+ event types) | — | ✓ |
| AutoAdvancer (timed progression) | — | ✓ |
| JSON File I/O | — | ✓ |
Fyrox Dialog is a branching conversation and dialog system for the Fyrox Rust game engine. It lets you build dialog trees with 5 node types (Text, Choice, Condition, Action, End) and run them through a pure-logic DialogRunner. The Free tier is MIT-licensed and the Pro tier adds a visual node graph editor, editor-integrated scripts, debug logging, and more.
Yes. The core DialogRunner is pure logic with zero UI dependencies. It emits typed events (text shown, choice presented, action triggered, dialog ended) that you handle in your own rendering code. This means you can use Fyrox UI, egui, a custom HUD, or even a console — the dialog system never dictates how your conversations look on screen.
Yes. Fyrox Dialog directly reuses fyrox-ai's Blackboard and Condition types. Your AI state machines, behavior trees, and dialog trees can all share the same Blackboard, enabling tight integration between NPC behavior and conversations. The Free tier depends on fyrox-ai-free.
In Fyrox Dialog Pro, conversations are stored in the .dialog resource format. When you save changes to a .dialog file, the Fyrox editor automatically picks up the changes without requiring a restart. This enables rapid iteration — edit your conversation trees and see results immediately in the running game.
Start free with the MIT-licensed core. Upgrade to Pro for visual editing, hot-reload, and debug tools.