A blackboard is a shared place for AI facts.

It is not the AI itself. It is the data the AI agrees to read and write.

Blackboard Architecture For Game Ai diagram

What a blackboard does

A blackboard sits between the systems that notice things and the systems that decide what to do.

A sensor can write, “the player was seen here.” A combat system can write, “ammo is low.” A movement system can write, “cover is available.” Then a behavior tree, GOAP planner, or utility system can read those facts without needing direct links to every writer.

That separation is the whole point.

Why it exists

Game AI gets messy when every decision node reaches into every other system.

Without a blackboard, code tends to grow hard-coded dependencies:

  • the patrol node asks the vision system directly
  • the attack node asks the weapon system directly
  • the flee node asks the health system directly
  • the planner has to know where every fact lives

That works for a small prototype. It becomes a problem when the AI needs to grow.

A blackboard gives you one shared place for transient facts. The decision system can stay focused on choosing actions instead of hunting through unrelated components.

What belongs on a blackboard

Good blackboard values are short-lived and useful to more than one system.

Examples:

  • current target
  • last seen player position
  • current goal
  • cover location
  • ammo count
  • health threshold
  • alert level
  • timer since contact

Those values matter because they are part of the current decision, not permanent game state.

What should not live there

A blackboard is not a junk drawer.

Do not use it for everything.

Bad candidates include:

  • stable save data
  • large inventory graphs
  • long-term quest history
  • full object ownership rules
  • state that belongs inside a dedicated component

If the value is persistent or strongly owned by one system, keep it there. The blackboard should hold the facts that multiple AI systems need to share right now.

Why behavior trees like blackboards

Behavior trees work well with blackboards because the tree can stay readable while the data stays centralized.

A branch can check:

  • is the player visible?
  • is health low?
  • is cover available?
  • is a target already set?

The tree does not need to know where those facts came from. It only needs to know whether they are true.

That keeps the tree small and the data flow easier to follow.

Why GOAP likes blackboards

GOAP also benefits from a blackboard, but in a different way.

The planner needs a world state. The action runner needs current facts. Replanning needs a quick way to tell whether the world has changed enough to matter.

That is why a lot of GOAP setups end up with a blackboard or shared state object.

The blackboard is where the agent keeps the facts that the planner can use to build a plan.

If you want the GOAP side in more detail, see GOAP for Game AI: Let Actions Build the Plan. The shared-state version shows up in the implementation section there.

A simple Unity shape

In Unity, a blackboard is often just a component or plain data object attached to the agent.

A practical setup looks like this:

  • sensors update blackboard values
  • decision logic reads those values
  • actions write back when they change state
  • debug views inspect the same object

That setup is simple, but it gives you a clean place to inspect what the AI thinks is true.

Common mistakes

The most common mistake is treating the blackboard like a global singleton.

That makes debugging easier at first and harder later.

Other mistakes include:

  • storing too much unrelated data
  • letting every system write every field
  • using unclear names
  • mixing transient facts with long-term game state
  • forgetting who owns a value

A blackboard works best when it stays narrow and intentional.

Practical takeaway

A blackboard does not make AI smarter by itself.

It makes the system easier to organize.

That is the real value: behavior trees, GOAP, and other AI systems can share facts without becoming tightly coupled to the rest of the game.

If the AI needs to react to changing conditions, a blackboard is usually one of the first pieces worth adding.