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"

BTService first tick happens earlier than activation

If you use a simple BT service (see bottom of this post), you can clearly see that its first tick will happen before activation. I consider this behavior a bug because it works against common sense, which assumes [Activation -> Tick, Tick, Tick -> Deactivation] instead of [Tick -> Activation -> Tick, Tick, Tick -> Deactivation] lifecycle. Activation is commonly used to set up various variables that are later used in ticks. With current behavior, user has to explicitly guard Tick with an artificial "have we activated yet?" check.

Way to reproduce

Product Version: Not Selected
Tags:
btservice.png (77.6 kB)
more ▼

asked Feb 14 '15 at 01:22 PM in Bug Reports

avatar image

Slonopotamus
195 7 12 15

avatar image TJ V ♦♦ STAFF Feb 17 '15 at 08:32 PM

Hi Slonopotamus,

I attempted to reproduce what you are seeing in a new 4.6.1 project but so far I haven't been able to. This is the result that I'm getting. The Tick is only started after the Activation is called.

alt text

Are you seeing this behavior in your personal project? If so, can you try reproducing it in a new project?

avatar image Slonopotamus Feb 18 '15 at 01:14 PM

Tick happens this way:

 UKismetSystemLibrary::PrintString
 UKismetSystemLibrary::execPrintString
 UFunction::Invoke
 UObject::CallFunction
 UObject::execFinalFunction
 FFrame::Step
 UObject::ProcessContextOpcode
 UObject::execContext_FailSilent
 FFrame::Step
 UObject::ProcessInternal
 UObject::CallFunction
 UObject::execVirtualFunction
 FFrame::Step
 UObject::ProcessInternal
 UFunction::Invoke
 UObject::ProcessEvent
 UBTService_BlueprintBase::ReceiveTick
 UBTService_BlueprintBase::TickNode
 UBTService::OnSearchStart
 UBTService_BlueprintBase::OnSearchStart
 UBTService::NotifyParentActivation
 UBTCompositeNode::OnNodeActivation
 UBTCompositeNode::OnChildActivation
 UBTCompositeNode::FindChildToExecute
 UBehaviorTreeComponent::ProcessExecutionRequest

And then, node activation happens this way:

 UKismetSystemLibrary::PrintString
 UKismetSystemLibrary::execPrintString
 UFunction::Invoke
 UObject::CallFunction
 UObject::execFinalFunction
 FFrame::Step
 UObject::ProcessContextOpcode
 UObject::execContext_FailSilent
 FFrame::Step
 UObject::ProcessInternal
 UObject::CallFunction
 UObject::execVirtualFunction
 FFrame::Step
 UObject::ProcessInternal
 UFunction::Invoke
 UObject::ProcessEvent
 UBTService_BlueprintBase::ReceiveActivation
 UBTService_BlueprintBase::OnBecomeRelevant
 UBTAuxiliaryNode::WrappedOnBecomeRelevant
 UBehaviorTreeComponent::ApplySearchUpdates
 UBehaviorTreeComponent::ApplySearchData
 UBehaviorTreeComponent::ProcessExecutionRequest


Detailed callstacks

full_callstack.txt (11.4 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Answering to myself, this bug should be fixed by following commit:

 commit dcb419aca08133c5315ca253b4127323fe034221
 Author: Lukasz Furman <Lukasz.Furman@epicgames.com>
 Date:   Thu Dec 18 07:57:13 2014 -0500
 
     removed initial Tick event from behavior tree service - this should be implemented using OnSearchStart,
     fixed task search using outdated info when more important request was accepted
     #ue4
     
     [CL 2392367 by Lukasz Furman in Main branch]
more ▼

answered Feb 18 '15 at 01:55 PM

avatar image

Slonopotamus
195 7 12 15

avatar image kamrann Apr 04 '15 at 06:49 PM

Is this issue resolved now for you? I've had it since the start of 4.7 I think, possibly earlier, and still have it using 4.7.4.

avatar image Slonopotamus Apr 04 '15 at 08:26 PM

This commit isn't included in 4.7.x. You can either wait for 4.8 or cherry-pick it in your custom build. This issue isn't hard to workaround.

avatar image kamrann Apr 04 '15 at 08:36 PM

Okay thanks. I wondered, but it seemed such an obvious one I thought it would have been included if resolved. No problem waiting, just wanted to check that it hadn't been overlooked.

(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