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"

'Move to Location' offset issue in Behavior Trees

Hi, I'm working on grid based movement in my game. I'm using the camera as the default player character, while having all the player controlled characters and AI characters being controlled by AI controllers. Until recently, I had used the default blueprints to handle the movements. Since I'm using AI controllers, I could use the 'Move to Location' to let my characters reach the exact destination, unlike the 'Simple Move to Location' which always has an offset. So here's a screenshot of what I've been doing before I got into Behavior Trees.

alt text

You may notice that I'm using Behavior Trees here as well. But that is only to check if it has reached the Movement goal. The actual movement is handled from the outside blueprint as shown in the screenshot.

And everything was working perfectly, as seen below. The units are moving to the center of the grid, which is what I want to happen.

alt text

Today, I tried putting the movement code inside the blueprint. Initially I used the 'Move To' task inside the Behavior Tree. In spite of acceptance radius being set to low values like 0.0 and 1.0, the character was not reaching the exact destination point. Here's a screenshot of that:

alt text

So thinking that this movement might be handled similar to 'Simple Move to Location', I made a new task for movement. I got my AIController class and used 'Move to Location', with the same conditions as my previous Blueprint based settings. Low acceptance radius, and no overlap conditions.

alt text

However I'm still facing the same movement offset issue. I'm using the same code under both conditions, yet the results are different. Is there any way to get the 'Move to Location' working inside Behavior Trees? Or am I doing something wrong with the code here?

Product Version: Not Selected
Tags:
more ▼

asked Jan 22 '15 at 06:30 AM in Blueprint Scripting

avatar image

Stormrage256
1k 83 75 118

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

1 answer: sort voted first

It's a known issue and it has been fixed in 4.7. Please give it a try once it's out, or try using latest 4.7 preview build, and let me know how it went.

Cheers,

--mieszko

more ▼

answered Jan 22 '15 at 09:48 AM

avatar image

MieszkoZ STAFF
7.3k 223 57 412

avatar image Stormrage256 Jan 22 '15 at 09:56 AM

Awesome!! Thanks man, I'm downloading the preview build. Should be done by tomorrow. I'll check and let you know.

avatar image Stormrage256 Jan 27 '15 at 04:27 AM

Hi, I've downloaded the 4.7 preview 4 for testing it out. Unfortunately, the behavior tree movement is still causing an offset. I have not tried it out in a new project in 4.7, I just used the same project that I was using earlier in 4.6.

avatar image MieszkoZ STAFF Jan 27 '15 at 08:43 AM

I've just tested it and you're totally right! Quick investigation showed that there are simply parameters missing in BT's movement tasks, namely StopOnOverlap. I've just fixed it so you can either try to use master branch from the github, wait for this change make it to the promoted branch, or wait for 4.8 with this (it's too late to squeeze something this minor to a almost closed version, sorry!).

Or you can just take this one change and apply it to your local engine sources - it's really small!

avatar image Stormrage256 Jan 27 '15 at 09:14 AM

Hi, just one more doubt. I have not checked the source before, so I'm not acquainted with code and structure within. I checked out the github version. Seems there is a new 'Private' folder under Runtime AI Module, which is not present in the 4.7 preview or 4.6. Is the folder getting included as part of the 4.7 final version?

avatar image MieszkoZ STAFF Jan 27 '15 at 09:21 AM

The "version" builds do not contain cpp files which are usually put in the private folders. You just get the headers to be able to compile game-only code.

avatar image Stormrage256 Jan 27 '15 at 09:51 AM

I'm sorry, I didn't get what you meant there. So far, I've only copied the uproperty code from the two header files. Would I need to get Visual Studio for implementing the rest of the code?

avatar image MieszkoZ STAFF Jan 27 '15 at 09:53 AM

Yes, you'll need full engine sources and VS to compile it. Maybe you can wait for this change to hit the promoted branch instead?

avatar image Stormrage256 Jan 27 '15 at 10:06 AM

Alight, yea I'm currently running the movement logic outside the behavior trees. And as of now, nothing else in my project is dependent on whether it's inside BT or not, as long as I have Reached Move Goal inside the BT. I'll keep using it this way until the change is updated.

avatar image Stormrage256 Jan 27 '15 at 09:00 AM

Sure, no issue man. Thanks for the code, I'll try it out in my local engine source for now.

(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