Friendly AI Behavior (for pets etc)

So I have found plenty of enemy AI behavior trees/packs in the store, but I need a simple blueprint/behavior tree to get an actor to do the following:

consume food/item dropped by player (to fill “happy meter”)

pick up an item dropped by player and put in socket (wear it)

Does anyone have a basic example of this? Right now my behavior tree just has my actors following around the player so that is the extent of my blackboard experience so far haha.

Yes, I have code for stuff like this in a project that I stopped working on. It’s not really basic and it’s not generic either.

You need to design out all your interactions and then make tasks for them as well as add the variables such as your “Happy Meter” to your controllers. I’m sure if you start working on it and you run into difficulty people will help you get past sticking points, but as far as someone just doing it for you, that’s not how it generally works on the forums. Show the work you have done and people will help.

Or, hire someone to make the system for you.

Thanks I will check that out when I get home. I wasn’t expecting anyone to do it for me, just looking for a starting point :)…

Honestly, I would have been fine just buying the setup to learn from, but I didn’t find anything close enough on the asset store unfortunately.

I can’t share the project it’s in, due to the art assets even though it’s not in development any more. And the AI is a Utility System in C++, so it is probably more complicated than would be helpful.

basic steps you’ll need.

On the pet controller, give him a variable for HappinessMeter.
Make the food object class, and make the player be able to drop it into the level.
Make an EQS, that searches for food actors.
Add a foodtarget variable to the pet’s blackboard
In the pets BehaviorTree run the EQS search and set the foodtarget on the blackboard if it’s in range
do a move to, to the food if it’s not NULL.
Make a function on the pet controller that eats food.
On the behavior tree, when you get in range to the food call the eat food function on the pet controller.
On the pet controller, in the eatfood function, raise the value of the happiness meter. destroy the food.

Ah ok, that should work. I will start working on it tonight. Thanks for the assistance :slight_smile: