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"

Behaviour Tree doesn't act as expected when decorator placed on Service.

Hello,

I followed a tutorial on a basic AI that I wanted to expand on. The basic AI wandered the scene and would have a vision check that checked if the player was in the cone of vision. If yes, it would follow the player until reaching them (whilst constantly keeping a record of the players latest location), if no, it would wander, if no (and had a memory of the players last location) it would go there then start to wander.

It looks like this:

alt text

This worked. If the AI saw me it would go up to me and stop until I move away.

I didn't want this 'vision check' service to be the main behaviour of the AI so put a decorator on it that checks another blackboard variable. When the variable is the correct one it should start the vision check behaviour. It looked like this:

alt text

This makes the AI go up to me and, instead of just stopping like it used to, it just starts awkwardly turning back and forth on the spot as it seems to be looping through the three sequences under vision check. It goes up to me, turns away for some reason, then instantly turns to go to the memory of my last location even though it sees me, then turns away instantly etc.

I guess this is a result of the vision check behaviour being rerun unlike how it was before or something. I'm new to behaviour trees so any help with this is appreciated.

Thanks,

Jack

Product Version: Not Selected
Tags:
capture11.png (164.3 kB)
capture112.png (186.8 kB)
more ▼

asked Feb 06 '19 at 01:48 PM in Blueprint Scripting

avatar image

Jack W Lewis
9 4 5 7

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Putting a decorator on the top of the service and nothing after it on the selector (below the root) means that as soon as the AI awareness is equal to anything but "On Quest" it will abort the entire tree below it and since you have no second option for it if this is the case, it probably gets into some weird loop and does nothing.

more ▼

answered Feb 06 '19 at 08:12 PM

avatar image

Nebula Games Inc
3.6k 20 9 14

(comments are locked)
10|2000 characters needed characters left
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