PoBDSDocs
简体中文v1.0.0
POBDS / 18

AI Configuration Guide

Configure extensible, layered AI in a PoBDS project with an elite enemy recipe, acceptance checks and a copyable agent prompt.

Extend an existing configuration

  1. Find the entry and available capabilities

    Inspect RootGraph on the Actor’s PoBDSComponent. Open the root flow in PoBDS Studio, follow its entry wire to the first BDS, and inventory existing nodes, variables and callable Actor members.

  2. Give each layer one decision

    Let the top layer choose an objective such as engage or patrol. Let the next layer choose a tactic such as attack or defend. A skill or defense layer makes local choices. Leaf flows handle movement, firing and cleanup.

  3. Compose existing Actions first

    Use Action nodes for movement, animation, Actor calls and variable writes. Pass arguments through typed pins. Advance persistent work in Update, signal Finish at a defined endpoint, and wire FINISHED to continue after all Actions complete.

  4. Add missing framework capabilities

    Expose readable properties with [PoBDSProp] and callable methods with [PoBDSMethod]. Mark evaluation-safe queries Pure = true. Put side effects in Actions. After adding members, run PoBDS → Generate.

Example elite enemy configuration

Prism Rogue Boss decision hierarchy

The diagram shows the existing Prism Rogue demo. The following rules are a separate example for a reusable tactical layer. Compare scores among candidates within the same layer.

CandidateGateBase scoreSwitching and execution
Emergency dodgeAn incoming projectile threatens a hit and an escape direction is available100Preempt → dodge flow
Low-health defenseHealth is below 40%70Choose preemption per game rules → child BDS picks cover, healing or retreat
Maintain fireA hostile target is within range and visible40Wait → firing flow
RepositionA hostile target exists10Wait → movement flow

Turn switching rules into acceptance checks

  1. Keep the winning Ability active

    Make one Ability win several evaluations in a row. Confirm that its Action keeps updating and enters again only after the previous behavior completes and is selected again.

  2. Check waiting and preemption

    Make an ordinary candidate lead while a behavior is running. Then trigger an emergency and verify that the relevant ancestor can preempt the old branch and that child cleanup runs first.

  3. Check parallel work and cleanup

    Run movement and firing in parallel with separate completion conditions. Connect Graph Exit to cleanup Actions for stopping fire, releasing reservations or clearing variables. Cleanup runs Enter and Exit.

  4. Reproduce edge cases with a fixed step

    Compare the score leader with the actual executor in decision history. Use integer milliseconds, millimeters and simulation RNG to reproduce edge cases. Read cached sensing results from the Actor.

Copy this prompt for an AI assistant

AI configuration prompt
Goal: configure an AI for [character and combat objective] in this Unity project.
1. Locate the root flow on PoBDSComponent and inspect the available BDS assets, variables, Actor members and registered Actions. List reusable assets with verified paths.
2. Draft the decision hierarchy. For each Ability, record its gate, base score, bonuses, preemption policy, Execution and completion condition.
3. Configure first. Use the editor or PoBDSDataSerializer to write binary configs while preserving existing references and stable IDs.
4. Extend the Actor when a required primitive is missing. Separate pure queries from state changes, expose typed parameters and categories, and run PoBDS > Generate.
5. On the same Actor, verify waiting, preemption, continued execution of the same Ability, parallel completion and Graph Exit cleanup. Report the observed decision paths, changed assets and test results.

Related manual and API pages

Prism Rogue layers and assets · Nodes and pin contracts · Actor extension API · Binary configuration API · Parallel child flows · Graph Exit and cleanup · Live debugging and decision history

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