Alright so far I’ve been trying to move my player towards using a behavior tree. I haven’t messed with behavior trees before, but I went through all the tutorials and links that you posted for me. I managed to create a wandering AI for a rabbit in my game (which works great!).
The issue that I’m running into now is how I would pass what I should do to the behavior tree. The way I have my game set up is that the client has a Player Controller and a Pawn that he controls. When the game begins he spawns an AI controller on the server that spawns the actual character. When I click the Player Controller tells the AI Controller to move the character on the server to the new location. I’ve had all this working fine so far, but kept running into problems when I wanted to add more functionality.
For example my character can place down items/buildings from his inventory on the ground. First he should check to make sure that he’s within a certain distance (if not move closer) then he can place these down. I’m having trouble of thinking how I should do this with the behavior tree. On my player controller should I keep flags for what I’m currently trying to do (bPlacingItem, bPickUpItem) and check the distance, then tell the behavior tree to move first, but then I would need some way to know that we finished moving close so the item can now be picked up. The way I was thinking this would work would be to kind of set some kind of enum from the player controller to the AI controller, so that the behavior tree knows basically what “state” i’m trying to be in. Then I could set the state to moving, have the behavior tree tell me when moving is finished, have the ai controller tell the player controller it’s finished, and add the item to inventory/remove it from ground.
Maybe I’m thinking about this all wrong, would love some insight! Thanks again.