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"

CustomMoveToTask

Hello. How would I correctly make a custom moveto task in my behaviour tree. The way i have it set up now is with a state machine that: 1st task builds the path, 2nd task cycles the checkpoints in the path; and the MoveTo itself. The move to is designed as an event that moves the actor a tiny bit towards the checkpoint. I thought that will work out fine because as the ai behaviour tree ticks so will the event move to because the state machine tells him to do only that one thing. It turns out it's breaking my computer to run just a single ai and that's not acceptable. What did I do wrong? P.S. The reason I need the custom move to is because im building a 2D game and just finished a pathfinder for it. Now I need the move to to read the path and follow it.

Product Version: UE 4.11
Tags:
more ▼

asked Apr 18 '16 at 01:48 PM in Blueprint Scripting

avatar image

GammaD
73 4 6 13

avatar image DoctorD Apr 21 '16 at 05:22 PM

BumP! Need the same answer

avatar image v.s. Apr 24 '16 at 05:50 PM

I know how to do this in C++.

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

1 answer: sort voted first

Hello GammaD & DoctorD,

I have a pretty strong paltop, so I don't really know the impact of this addition, but I can run my settup with like 15 AI without noticing it with my frames.

It depends on how you did your pathfinding code, but this is what I did: But I have done similar stuff in two different ways:

Situation A: I don't know in advance where to move to. I let a Service make a "Memory Marker" It is just a target point, but I set a blackboard key with the same info as well (Object Actor key). alt text Then in my behaviour three I have a Task: MoveTo MemoryMarker.

alt text

Situation B: I do know where to move to in advance. I make some TargetPoints in my level. And make my AIcontrolled class have a Public array of target points, I place my AIControlled class in my level and assign my target points to it. Then I made a Service to check wheter or not it has targets points, since I am using situation A AND B together.

alt text

Then in case I have targetpoints, I have a "PatrolBetweenPoints" Task, This one isn't perfect yet, but this is what I have right now:

alt text

And this is how my behaviour three looks like in situation B.

alt text

  • Erik

more ▼

answered Apr 24 '16 at 07:43 PM

avatar image

erik321123
413 17 15 31

avatar image GammaD May 10 '16 at 03:33 PM

You use the premade move to function. I made a spline network for my ai to use and pathfind around. no gravity just follow the splines. while i could use the movement component and flying movement its very clunky to implement compared to making just a custom move to task that follows the distance along the spline. i made it work in my controllers tick but when i implemented it into a ticking task it was very laggy. no behaviour trees for me.

(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