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/move to - not working as expected.

So far I have got my AI to wander around randomly until it senses the player. It then chases the player until it loses sight of the player for about 10-20 seconds. It will then search for the player for a further 1-3 minutes. If it doesn't find the player then it forgets about them and goes back to wandering.

The problem is when it goes back to wandering it walks all the way back to where it first started, even if it has been chasing the player for miles. what I want is for it to just wander around the area that it reached after chasing/looking for the player.

The wander task is set to pick a random point around the AI and then walk there using the 'Move To' task node so why does it walk all the way back to where it started? Surely it should pick a new target point nearby when it goes back to wander?

alt text

Product Version: UE 4.8
behaviour tree.jpg (178.2 kB)
more ▼

asked Jul 02 '15 at 07:58 PM in Blueprint Scripting

avatar image

65 9 15 18

avatar image bishop86 Jul 03 '15 at 06:42 PM

It seems like the wander sequence is continuing from where it was interrupted, is there no way to reset it so it finds a new target?

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

2 answers: sort voted first

I'll compare it to mine tomorrow when am not on phone...and see what the options are. You can try connecting the get actor location target to your zombie cast 'as zombie' compile and see what that does. Might take whatever location your current zombie is at when it gives up looking and starts this task , wandering within a radius of wherever its current location is.

If it continuously changes cuz it's location does. You may need to set the current location into a variable so that that variable stays as that origin point and doesn't change each time the task is run. Set the variable with a do once or something.

more ▼

answered Jul 04 '15 at 07:29 AM

avatar image

644 38 36 70

avatar image bishop86 Jul 04 '15 at 09:24 AM

I connected the get actor to cast as zombie and it works. It's always something silly haha. Been working on my game only a week and the zombies already have better AI than DayZ lol. Thanks for the help very much appreciated :D

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

Post your Wander Task graph here.

Without seeing it: I'm guessing you're using the get random point in radius node. If so, then you're specifying the start point of this node. "origin". Is it the spawn location? that would explain why. At the end of your "give up looking" function, get the current location of the wandering actor and have it set that as the origin for the wandering task rather than whatever it is now?

more ▼

answered Jul 03 '15 at 11:16 PM

avatar image

644 38 36 70

avatar image bishop86 Jul 04 '15 at 06:42 AM

Hi, thanks for the comment. Here is my wander task. Shouldn't it get a point around the actors current location? Or does it work in a less obvious way?

I already tried setting the destination at the end of the "give up looking" function but it made no difference :(

alt text

wander task.jpg (137.2 kB)
(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