Strategy game AI, Behavior Tree vs Logic

I have built a puzzle strategy game, which involves clicking on blocks and moving them into patterns.

I now want to implement a singleplayer mode (vs. NPC). The first thought was to implement a Behavior Tree. If I where to do this to what should I attach my AI controller? (since there is no character to represent the AI). How hard is it to make the Behavior Tree modify my game board and move tiles? I assume it wouldn’t be ideal to pass references of the board around but how else would the AI know what to move?

On the other hand I could just have a boolean “AI Turn” or something and create NPC logic within the board’s blueprint.

What is more standard practice? Does anyone have any examples of implementing such?

Thank you!

Hello! UBehaviorTree class is used mainly by AAIController class, which work in pair with APawn class. In the case of Board game, NPC is not represented as APawn and all NPC’s stuff is just around some actions on the Board. So, you can

  • just implement your own NPCService for that…
  • create a special invisible actor (say, AAITurn) and spawn it on the map if it is Player vs Computer match…