PoBDSDocs
简体中文v1.0.0
POBDS / 04

Quick start: two-Cube distance AI

Validate the complete chain from typed conditions and scores to a behavior flow graph.

Open and run the example

  1. Create and open the scene

    Run PoBDS/Demo/Cube Duel/Create Assets, then Open Scene. Enter Play mode and focus the Game view.

  2. Move the target

    Use WASD to control the target Cube. The AI should switch between attacking, walking closer and running closer.

  3. Inspect the graph

    Use Open Flow to inspect CubeBrain; double-click its BDS node to open CubeDecision. During Play mode, select the corresponding running AI instance.

Define unambiguous distance ranges

Distance in millimetersBehaviorDemo parameter
Distance ≤ 2000Attack10 damage every 600ms
2000 < distance ≤ 5000Walk closer1500 mm/s
Distance > 5000Run closer4000 mm/s

Each boundary belongs to exactly one branch. Use integer millimeters consistently: 2000 and 5000, rather than mixing meter values with millimeter properties.

Configure the same AI manually

  1. Create the root flow

    Connect Entry to a BDS node and reference CubeDecision. New nodes are initially disconnected; wire them manually.

  2. Add three Abilities

    Create Attack, Walk and Run candidates. Use comparisons and AND gates for the ranges above. Equal base scores are sufficient because their gates are mutually exclusive.

  3. Supply distance

    Read an integer millimeter distance property or the built-in target-distance value. Connect it to the comparison; enter thresholds inline or use constant nodes.

  4. Assign execution graphs

    Select Attack, Walk and Run flow graphs in the corresponding Executions. Inside each graph connect Entry to an Action and configure the demo behavior.

  5. Save and verify

    Save the child graphs and BDS. Place the target at approximately 1m, 3m and 7m and inspect the actual executing branch.

Read the editor layout

BDS workspace: variables on the left, typed blueprint in the center and inspector on the right. Screenshot content is illustrative; inspect the current demo asset for its exact configuration. · Click to view full image

Why walking can transition into attacking

Cube Duel movement Actions finish when their distance interval changes, allowing BDS to select another candidate. A continuous custom Action that never finishes will keep updating unless an eligible forced-interrupt candidate replaces it.

Combine keywords with / · Enter opens first result · Esc closes