Visual Logic Workflow
Connect graphs to behavior through DreamBehavior, map events, dialogue choices, or Godot signals.
Visual Logic integration: how a graph becomes behavior
A Visual Logic graph becomes game behavior only after three things exist: a trigger, an assigned graph, and a target object that can run it.
| Graph type | Use it for | Example |
|---|---|---|
| Input graph | Player buttons | Attack, interact, dash |
| Interaction graph | NPC/chest/door behavior | Talk, open, unlock, give item |
| Quest graph | Starting/completing objectives | Accept quest, update objective, give reward |
| Combat graph | Damage and death | Hit enemy, reduce HP, die, drop reward |
| AI graph/FSM | Enemy behavior | Idle, chase, attack, return, dead |
| UI graph | Feedback and HUD updates | HP bar, quest text, notification |
Attachment methods
DreamBehavior
Attach a saved .dcs graph to an object that should run logic.
Map event
Use an event template such as NPC, chest, door, pickup, trigger, or damage tile.
Dialogue choice
Use Narrative Weaver choice output to call a graph, set state, or start a quest.
Area/signal
Use collision/Area2D signals to start pickup, trap, region, or detection logic.
Visual Logic basics
Visual Logic lets you create gameplay behavior by connecting triggers, conditions, actions, variables, and feedback without writing GDScript.
Beginner mental model:
When this happens
→ Check this condition
→ Do this action
→ Show feedback
→ Save
→ Quick Play
| Term | Meaning |
|---|---|
| Trigger | The thing that starts logic. Example: player interacts, actor enters area, timer ends. |
| Condition | A check before an action. Example: player has key, quest is active, variable is true. |
| Action | What happens. Example: show dialogue, give item, open door, play sound. |
| Variable / switch | A remembered value used by logic. Example: chest opened, quest started, door unlocked. |
| Sequence | A saved chain/graph of logic steps. |
| Feedback | Sound, VFX, UI text, animation, camera shake, or other response that tells the player something happened. |
Visual Logic templates as starting points
Visual Logic templates are small behavior patterns. Use them as a starting graph, then connect the graph to a real trigger, a condition, an action, feedback, and a state change.
| Template pattern | Use it for | Expected result in Godot |
|---|---|---|
| Interaction | NPC talk, sign reading, door check, save point. | Interacting with an Area or event runs the graph once. |
| Pickup | Coins, keys, items, rewards. | The item disappears or changes state, inventory/currency updates, and feedback plays. |
| Damage zone | Hazards, traps, spikes, lava, enemy contact. | Entering the area changes HP or state and shows feedback. |
| Dialogue choice | Branching NPC choices, accept quest, reject quest, shop option. | Choosing an option changes variable/switch/quest state. |
| Quest state | Start, update, complete, unlock, reward. | Quest UI or NPC behavior changes after the state update. |
What you should see: a saved graph/resource, a node or map event pointing to it, a clear trigger signal, visible feedback during Quick Play, and a changed state if the graph is supposed to remember progress.
Visual Logic practical tutorials
NPC dialogue
- Place or select an NPC/interactable object.
- Create or assign a dialogue resource.
- Add a Visual Logic sequence: When player interacts → Show dialogue.
- Save and Quick Play.
Locked door
- Place a door or transfer event.
- Create a key item resource.
- Create a Visual Logic sequence: When player interacts → Check key item → Open door or show locked message.
- Validate missing item/scene references.
Chest reward
- Create an item resource.
- Place a chest event.
- Add logic: Interact → If not opened → Give item → Play sound/VFX → Set opened true.
- Validate the item reference and test twice to confirm it does not give infinite rewards unless intended.
Quest start
- Create a quest resource.
- Create an NPC dialogue.
- Add logic: Talk to NPC → Start quest → Show objective → Update quest log.
- Validate quest references and rewards.
Damage zone
- Place an Area2D/Area3D or map danger region.
- Add logic: Actor enters → Deal damage → Play effect.
- Validate collision layers and test in Quick Play.
