As a new Unreal Engine developer, unpacking the complexities of Behavior Trees and AIControllers with their associated Components provides a challenge for someone coming from Unity and custom engine development. Especially if you try to avoid Blueprints from the start. As it turns out: AIPerceptionComponent can only be safely attached to an AIController, which also requires the addition of an AIPerceptionStimuliSource on the Actor object for your AI in order to effectively link your functionality! If you don't do this, you will either not get any responsiveness from the AIPerceptionComponent or if you put the AIPerceptionComponent directly onto your Actor, you will get warning messages saying that the intended use of that Component is to be inside an AIController object! Without this core, Behavior Trees will have a serious issue in tracking other Actors or Stimuli in order to perform their desired Tasks.
After several days of multiple iterations, I was able to conclude the correct order of operations is:
It is also wise to create these in Blueprint first, as it is generally a lot easier to track down your problems than having to go back and forth to your IDE to adjust code, then back to the editor to compile/test. Once you have your desired operational structure, you can tackle conversion to C++ for optimization.
This is very dependent upon your development schedule, but if you are still new I truly do advise to take this route otherwise you can spend days chasing your tail in a loop while halting development completely. It is better to spend more time and result in something functional than to spend all of your time with no result at all.
author: Clinton ButlerDid you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.