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"

[BUG] Service timing in behavior trees

Hi there,

yesterday, I upgraded my project to version 4.12 prev. 5 and my AI was jumping around the map like a mad chicken. Turns out my waypoint picker service is getting called something about twice a second, although it should be called every 10 seconds (pic)

alt text

I've tried it for selectors and simple parallel nodes and the specified tick time doesn't work with neither of them. Different from the behavior in version 4.11.2, so maybe a bug?

Kind Regards

Product Version: UE 4.12 Preview
Tags:
graph.png (132.0 kB)
more ▼

asked May 31 '16 at 08:40 AM in Blueprint Scripting

avatar image

E1andri1
96 6 10 17

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

5 answers: sort voted first

Seems to be fixed in 4.12.3

more ▼

answered Jun 21 '16 at 01:46 PM

avatar image

E1andri1
96 6 10 17

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

Ok, this is the situation now

Updated my 4.12 preview 5 to 4.12.0 (release)

created a new project, added a pawn, set up an ai controller, attachted a behaviour tree with a blackboard to it and created a service which doesn't do anything but printing the time delta. The service should run every 5 seconds. When I run the scene, I see a message every 0.4 to 0.6 seconds on the screen.

If I change the engine version to 4.11. I get the message every 5 seconds. The mentioned parameters (calltickon... restarttimeron...) are both set to false.

I also have tested it on a different system. Same Result.

more ▼

answered Jun 06 '16 at 09:45 AM

avatar image

E1andri1
96 6 10 17

avatar image jblaswu Jun 07 '16 at 03:50 PM

related post

https://answers.unrealengine.com/questions/69557/event-tick-in-behaviour-tree-service-doesnt-get-ca.html

however, it doesnt explains why it works (or maybe it was broken on 4.11) differently before. however, that post says the same as my previous point...that you have to break the task/node before the service starts opening the branch again.

avatar image E1andri1 Jun 07 '16 at 04:18 PM

Will try this as soon as possible, but my prediction is: the service in the sequence node will run every 0.5 seconds no matter what you specify

avatar image jblaswu Jun 07 '16 at 05:07 PM

you are right, it still spams and the task doesnt even care about the decorator which is even more fun....

i got my other behavior trees running fine so i doubt im messing with the "how it works" basics.

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

Just checked.

Still broken in version 4.12.2

more ▼

answered Jun 13 '16 at 08:24 AM

avatar image

E1andri1
96 6 10 17

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

I have the same issue, just upgraded and it has broken a lot of the AI. I can figure out a workaround but it is quite important this gets fixed.

more ▼

answered Jun 13 '16 at 02:35 PM

avatar image

FishWizard
16 1 2

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

as far as i understand, services are not timers for the branches below just by themself. if you want the branch to depend on the service, you would have to do a little extra logic there. Sorry for the totally undescriptible names but i hope you get the idea. My Service runs every 1s and assigns a message to the blackboard, the task runs if the value is set and unsets it on the same task, the task will abort itself when value is unset and the tree will stay on the service, until the value is set, then the branch will re-activate. not 100% as your example but i think it explains enough to apply on your case. just add an extra decorator on your simple parallel and reset the value when you are done (on MoveTask for example).

This was one on 4.11.2

alt text

btt.png (916.2 kB)
more ▼

answered May 31 '16 at 02:04 PM

avatar image

jblaswu
813 22 11 46

avatar image E1andri1 May 31 '16 at 02:41 PM

No, I think, you got me wrong. Of course a service isn't a timer for successing tasks. My WaypointPicker just rolls a dice every 10 seconds and sets a waypoint in the blackboard. The MoveTask then moves to that destination. Before 4.12 the service indeed picked a waypont once every 10 seconds. Now, the service runs about twice (can't determine the exact frequency) a second (although it is set to 10 seconds)

avatar image jblaswu May 31 '16 at 02:59 PM

in my screenshot the service does run and sets the Message value every 1 second so maybe you are setting something wrong on your service. my test is done in 4.11.2

avatar image E1andri1 May 31 '16 at 03:11 PM

yes, and as I stated in my post: it's broken in 4.12 Preview

avatar image jblaswu May 31 '16 at 03:15 PM

and this is on 4.12 preview 5, you can see the service is selecting every 1 sec, instead of randomly spamming the selecting (thats why its repeating the same value). for this example, i didnt let the task abort itself.

alt text

untitled.png (2.5 MB)
avatar image E1andri1 May 31 '16 at 03:31 PM

then, why is your service running every second? because you've specified it? But that's what I've done as well, but my value (the service is basically just setting a vector every 10 seconds) is set about twice a second. Regardless whatever task is running after that

the question is: what has changed between 4.11.2 (where everything was fine) and 4:12 prev 5?

avatar image jblaswu May 31 '16 at 03:55 PM

you are right, i just couldnt timed it correctly cause the interval was too short. tested the same BP on 4.11.2 and 4.12, 4.12 runs it twice every second (it basically always uses the default interval settings on services). steps to reproduce are straightforward.

  • create tree

  • add interval on service

  • add integer assignation on service

  • you will see the resulting integer will always be the doble as the elapsed time

sorry to kinda mislead you. hopefully Epic staff sees this.

avatar image MieszkoZ STAFF Jun 04 '16 at 08:21 PM

I've just tried it with what you may call 4.12+ and wasn't able to repro it. Make sure your service has both CallTickOnSearchStart and RestartTimerOnEachActivation set to false. Let me know if it helps or not (ping me on twitter or something :) )

Cheers,

--mieszko

avatar image jblaswu Jun 05 '16 at 11:18 AM

hi Mieszko. thanks for the follow up. sadly i dont have the project so i couldnt test it right away, i did try to replicate the issue but not even the ticking worked, and other stuff came up so decided to fix my own stuff first! now i got my 4.12 engine compiling (40min of waiting...) ill try this again later on the day.

avatar image E1andri1 Jun 06 '16 at 09:14 AM

Just checked... they're both unchecked.

Tick Time is set to 10 but the variable value changes still about twice a second.

avatar image jblaswu Jun 07 '16 at 07:59 AM

Hi Mieszko, i tried this on 4.12 release (built from source) and the master branch (4.13) and it still gives me the same error. if i set the observer to break the task, then it will wait for the next service tick (dont have the exact example but i remember it working fine like that), it just doesnt work if you just let it go through without any type of break.

all the setup is on this screenshots, blackboard is empty, actors, ai controller (only the run tree on begin play), everything was made on new templates. i have uploaded the project as well (4.12) if you need to check for anything else but thats pretty much it

  • new project

  • new character

  • new aicontroller

  • new blackboard

  • new tree

  • new bttask

  • new service

  • set service to 5seconds (or whatever higher enough to not be confused with the low timed tick)

  • set task to print something and finish task with finish execute (success or not makes no difference)

  • make tree with service on node

  • see the print spam.

the project will be uploaded in a few minutes (slow internet)

UPDATED 4.12 project https://drive.google.com/open?id=0BxVkFZ_FgTxQU3NfMm5jQTM3dU0

alt text

btree.png (462.4 kB)
(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