# Blackboard or GameState?

**URL:** <https://forums.unrealengine.com/t/blackboard-or-gamestate/426960>\
**Category:** AI\
**Tags:** EQS, blackboard, game-state, unreal-engine, Blueprint, question\
**Created:** [June 8, 2018, 4:06pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960 "2018-06-08T16:06:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![CatClicli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CatClicli](https://forums.unrealengine.com/u/CatClicli)\
**Post date:** [June 8, 2018, 4:06pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/1 "2018-06-08T16:06:07Z")

</div>

I’m making a kind of Capture the Flag game.

I would like to let the AI know where the players and the flags are, should I use Game State, Blackboard or EQS for this?

The Blackboard was my first choice, but there is no support for an array of player locations or object locations. They say you can create your own class with all the needed information in it. But then I feel like I’m duplicating GameState.

The forums say

> 1. To Make Efficient Event-Driven Behaviors Changes to the blackboard  
> can throw events to change the flow in  
> the behavior tree without having to  
> update every frame to check the value.  
> I’ll have more details about this in a  
> separate section of Behavior Tree  
> documentation (and I’ll link from here  
> once that’s ready).

[1](https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/2138-blackboard-documentation)

So… having a Blackboard would be better to prevent polling the location of the flags everytime they change? Or I should just store an array of each object class and work the intelligence of wether the AI knows or doesn’t know this information?

Advice? Ideas?

---

<div class="post-metadata">

**Author:** ![ZazarLaLiche](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZazarLaLiche](https://forums.unrealengine.com/u/ZazarLaLiche)\
**Post date:** [June 8, 2018, 4:37pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/2 "2018-06-08T16:37:07Z")

</div>

Hi, couldn’t you store this data in the AI Controller ? You could then choose which player your AI is currently interacting with inside the controller and then set any player as the “currentTarget” in the Blackboard ?

If this doesn’t help, what do you want your AI to do with these players ?

---

<div class="post-metadata">

**Author:** ![CatClicli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CatClicli](https://forums.unrealengine.com/u/CatClicli)\
**Post date:** [June 8, 2018, 4:41pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/3 "2018-06-08T16:41:40Z")

</div>

That’s an option, but currentTarget should be in the AIController as well if different AI might target different players on whatever criteria. See the edit for another example in which this might not be a good solution.

---

<div class="post-metadata">

**Author:** ![Xptohz3\_turbo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xptohz3\_turbo](https://forums.unrealengine.com/u/Xptohz3_turbo)\
**Post date:** [June 8, 2018, 4:45pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/4 "2018-06-08T16:45:36Z")

</div>

Indeed! Since BBs don’t support Arrays out of the box, you can store in the AIController. Nice one! 😉

---

<div class="post-metadata">

**Author:** ![CatClicli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CatClicli](https://forums.unrealengine.com/u/CatClicli)\
**Post date:** [June 8, 2018, 4:48pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/5 "2018-06-08T16:48:06Z")

</div>

On second though while writing it. I do think it’s a much better solution to store all these informations in the AIController and work the behaviour tree diferently.

---

<div class="post-metadata">

**Author:** ![CatClicli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CatClicli](https://forums.unrealengine.com/u/CatClicli)\
**Post date:** [June 8, 2018, 4:52pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/6 "2018-06-08T16:52:52Z")

</div>

Used to the smugness of stackoverflow. unrealengine answers’ positivity is like a cultural shock. Keep it up 🙂

---

<div class="post-metadata">

**Author:** ![ZazarLaLiche](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZazarLaLiche](https://forums.unrealengine.com/u/ZazarLaLiche)\
**Post date:** [June 8, 2018, 4:53pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/7 "2018-06-08T16:53:45Z")

</div>

From what I understand of your example, you could still use the Controller. At the start of the game, just populate an array of players / flags references so you can acces their data anytime without having to search for them again. You could also store your currentTarget in it as well as in the blackboard and just fire an event to update it in the blackboard only if its value changes in the Controller.

If this is not what you want then I think I didn’t understand your problem ^^

---

<div class="post-metadata">

**Author:** ![CatClicli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CatClicli](https://forums.unrealengine.com/u/CatClicli)\
**Post date:** [June 8, 2018, 5:03pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/8 "2018-06-08T17:03:18Z")

</div>

You did. Just correct me if I’m wrong: If I set the target to follow in the blackboard, since all AI have the same blackboard, wouldn’t they all follow the same player? Thus, shouldn’t currentPlayer also go in the controller? Or you’re assuming that each IA has it’s blackboard? If so, why use a blackboard at all?

---

<div class="post-metadata">

**Author:** ![ZazarLaLiche](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZazarLaLiche](https://forums.unrealengine.com/u/ZazarLaLiche)\
**Post date:** [June 8, 2018, 5:07pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/9 "2018-06-08T17:07:53Z")

</div>

You are using one blackboard asset but each AI has its own AIController and also its own version of the blackboard. They do not share the informations inside it, each AI will run its own behaviorTree, blackboard etc …

---

<div class="post-metadata">

**Author:** ![CatClicli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CatClicli](https://forums.unrealengine.com/u/CatClicli)\
**Post date:** [June 8, 2018, 5:16pm UTC](https://forums.unrealengine.com/t/blackboard-or-gamestate/426960/10 "2018-06-08T17:16:10Z")

</div>

Got it! the every IA has its blackboard was the info missing. thanks!
