Skip to content

3.2 A Bubble Dialog

BDC_Patrick edited this page Dec 9, 2025 · 11 revisions

Bubble Dialogs

Image Info
Bubble Dialog Overhead speech bubbles for NPC chatter and barks.
Description

Bubble Dialogs are lightweight conversations that appear directly above an Actor's head in the game world. Unlike Front Dialogs, they run asynchronously in the background, meaning multiple NPCs can have bubble conversations simultaneously while the player is doing something else.

1. Actor Setup

For an Actor to spawn a bubble, it must be registered as a Participant.

Step Action Details
1 Add Component Attach a BDC_DialogBackend_ActorComponent to your NPC Actor.
2 Assign IDs In the Component Details:
  • Set Dialog_ParticipantID (Name): Used for text macro replacement.
  • Set Dialog_ParticipantIDTag (Tag): Must be unique! The system uses this to find which actor to attach the bubble to.
3 Define Attach Point (Optional) Add a SceneComponent named DialogBubble to your Actor. The bubble widget will snap to this location. If missing, it snaps to the Root Component.

2. Creating the Bubble Widget

The Bubble Widget is simpler than a full Front Dialog UI.

Requirement Implementation
Visuals Use a SizeBox (to limit width) containing a Border (Background Image) wrapping a RichTextBlock.
Interface Implement BDC_DialogBackend_InterfaceUI in Class Settings.
Logic Implement OnDialogUpdated:
  • Set the RichText from CurrentData.Message.
  • (Optional) Play CurrentData.MessageSound.
Implement OnDialogStarted / OnDialogFinished for fade-in/out animations.
Registration Assign your new Widget Class in Project Settings -> BDC Dialog Backend -> Widget - Bubble Dialog.

3. Graph Rules & Limitations

Because Bubbles run automatically in the background, they follow stricter rules than standard dialogs.

Allowed Nodes

  • Message Node: The core content.
  • Branch / Condition: To check global values.
  • Event: To trigger logic on the Actor (via OnReceivedEvent).
  • Jumper / End / Delay: Standard flow control.

Restrictions

  • No Options: Bubbles cannot display interactive choices.
  • No Beacons: Beacons are ignored in bubble context.
  • Forced Auto-Forward:
    • Bubbles always advance automatically.
    • They cannot be skipped manually by the player.
    • If the Message Node has no "Auto Forward" time set (or set to -1), the system uses the global Bubble Widget Minimum wait time (Default: 3.0s) defined in Project Settings.

4. Starting & Managing Bubbles

Triggering the Bubble

Call BDC_Dialog_Library::StartDialog.

  • SourceDialogAsset: Your Dialog Tree.
  • DialogID: The Row Name to start.
  • OfType: Select DialogBubble (NPC Chat).
  • ParticipantTags: Important! Pass the ParticipantIDTag of the Actor you want the bubble to appear on.

Optimization Tip

To reduce rendering stress, consider starting/stopping bubbles based on player proximity:

  • On BeginOverlap (Sphere Collision): Call StartDialog (Bubble).
  • On EndOverlap: Call ForceBubbleClosureByParticipant to clean up widgets that are no longer visible.

Handling Events

Even though Bubbles are automated, they can still trigger logic. When an Event Node is reached in a Bubble Dialog, the OnReceivedEvent dispatcher on the specific Actor's BDC_DialogBackend_ActorComponent will fire.

Documentation Index

I. What is the Dialog Backend?
II. Setting up
III. Binding UI
IV. The Subsystem
V. The Components
VI. Dispatchers
VII. Others

Demo available: Demo Page

Clone this wiki locally