x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

What would cause Behavior tree no to execute?

So I am setting up some very simple enemy AI using Behavior tree. I have done some reading and followed a tutorial to get it set up, so that I can then experiment with/learn the system better. I have the Behavior tree and the Blackboard setup. I also have a blueprint setup to execute the BT task on event begin play, as well as a blueprint to set the player's position for use as a key.

When I look at the Behavior tree while I'm playing, I can see that the player position is being updated as I move the player. The enemy is supposed to then "move to" the player's location using this info ( a key called playerposition ). When I hit simulate the enemy does as I intended and moves to the player. However when I hit play and start the game nothing happens.

Product Version: Not Selected
Tags:
more ▼

asked Aug 04 '14 at 07:34 PM in Blueprint Scripting

avatar image

daniel311311
3 4 6 7

avatar image Duncan Dam Aug 05 '14 at 01:57 AM

Can you show your BT ? What you mean nothing happen, is BT not run or you have some condition that block "move to" task ? Btw, i think you can set the key as the player pawn, so you no need to update the player position.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

How are you spawning the Bot with the BehaviorTree on it in game?

If you use the node, it's called something like spawn from AI, or spawn class with AI. You can set the BehaviorTree in it and it will initialize it.

Otherwise you will need to activate the BehaviorTree yourself, easier just to use the node since it is working now.

more ▼

answered Aug 04 '14 at 08:06 PM

avatar image

mikepurvis
2.5k 102 67 261

avatar image daniel311311 Aug 05 '14 at 12:36 AM

In case I didn't mention before. When I hit simulate, the Behavior Tree functions. It does not function however when I actually play my game. I have watched the player position vector in the Behavior Tree while in play mode, and it does in fact update with my player's position, but then the move to is not executed.

playerposition.jpg (160.2 kB)
avatar image MieszkoZ STAFF Aug 05 '14 at 08:54 AM

use a blueprint to activate the BT task

What do you mean by that? What function are you calling?

avatar image daniel311311 Aug 05 '14 at 07:48 PM

So this is what I have alt text

playerposition.jpg (160.2 kB)
avatar image daniel311311 Aug 05 '14 at 07:50 PM

Here is the Behavior tree/ AI controller alt text

behavior tree.png (188.7 kB)
ai controller.png (63.2 kB)
avatar image mikepurvis Aug 05 '14 at 09:18 PM

Try using the Spawn AI Actor Node, you don't need to call run on the BT. Post of pic of your Behavior Tree also. Where is that function that you show?

avatar image daniel311311 Aug 05 '14 at 09:35 PM

I put up a pic of the Behavior Tree, its linked right under the AI controller. I'll try putting in the node you mentioned. What function are you asking about? The AI controller is a BP/AI controller class, I have the enemy pawn's AI set to use that. The Player position is a BTTask blueprint, you can see in my Behavior tree that it is a vector on my blackboard I'm using to track the player position.

avatar image mikepurvis Aug 05 '14 at 10:00 PM

Sorry, thought the links for the pics that were displaying.

You can set BlackBoard values in Tasks, but you should really make a Service Node to do that, then set the time on it so it's not every tick.

How are you spawning the Bot that this Tree is on? You do not have to do the step you did in the CubeEnemyController. The spawn node will set it, or just place the character in the level should be fine.

avatar image daniel311311 Aug 05 '14 at 10:12 PM

Yeah, I have just been placing it in the level for now. If I use the spawn node, what would be a good way to set the location where I wanted it to be spawned?

avatar image mikepurvis Aug 05 '14 at 03:11 AM

If the BehaviorTree is activated, just place a composite node under the root and wire your task to that. It will play.

You don't call into the BT from external Blueprints to activate nodes, put the flow for that in the Tree itself.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I had a similar problem. I had to find the 'Pawn' tab in the details window for MyAICharacter actor in the World outliner and make sure "AI Controller Class" was set to MyAIController class. For some reason, despite being set correctly in the BP editor, when I place the actor its AI controller is reset to the default AIController class.

more ▼

answered Oct 02 '16 at 10:49 AM

avatar image

Curator23
6 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question