본문 바로가기

Unreal 게임 개발/Unreal Tool 활용23

Unreal AIController 제작 이번에 BehaviorTree에 쓰일 AIContoroller(AIC)를 직접 제작해보았다. UPawnSensingComponent에서 UAIPerceptionComponent로 변경UPawnSensingComponent: 간단한 AI 감지 시스템에 필요한 경우 사용된다.UAIPerceptionComponent: PawnSensingComponent에서 제공하는 시각, 청각 감지 기능뿐만 아니라 손상 등 다양한 감지 기능을 지원한다.  이렇기에 이후에 더 확장성이 높은 UAIPerceptionComponent로 바꾸었다.AIPerceptionComponent = CreateDefaultSubobject(TEXT("AI Perception"));AIC의 생성자에 다음과 같이 추가했다. OnPossessht.. 2024. 10. 7.
Unreal BehaviorTree RequestExecution(), StopTree() Player를 쫓아오는 AI를 만들 때 일정 거리에 도달하면 근처에서 대치하는 상황을 만들고 싶었다. 이때 이상한 현상이 발생했다.코드는 다음과 같다.void UBTD_IsWithInIdealRange::TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds){ CalculateRawConditionValue(OwnerComp, NodeMemory); if(!TickFlag){ UE_LOG(LogTemp, Display, TEXT("Tick Node!!")); TickFlag = true; }}bool UBTD_IsWithInIdealRange::CalculateRawCon.. 2024. 9. 24.
Unreal BehaviorTree OnBecomeRelevant & OnCeaseRelevant OnBecomeRelevant & OnCeaseRelevant먼저 OnBecomeRelevant를 도큐먼트에 검색해보면 두가지가 나온다.https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/AIModule/BehaviorTree/Decorators/UBTDecorator_BlueprintBase/OnBecomeRelevant?application_version=5.4https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Developer/AITestSuite/BehaviorTree/UTestBTDecorator_Blackboard/OnBecomeRelevant?applic.. 2024. 9. 24.
Unreal Behavior Tree 'Check Condition Only if Blackboard Changes' Behavior Tree의 Decorator를 Blueprint로 만든 것에서 CPP로 만들다가 발생한 이슈에 대한 풀이이다.이 영상이 의도한대로 구현된 것이다. 일정거리 이상 멀어지면 바로 따라오도록 만들고 싶었다.Blueprint로 만든 것은 이렇게 생겼다. 이걸 그대로 구현하고 싶어서 cpp에는 이렇게 만들었다.#include "Enemy/EnemyAI/Decorator/BTD_IsWithInIdealRange.h"#include "AIController.h"#include "BehaviorTree/BlackboardComponent.h"UBTD_IsWithInIdealRange::UBTD_IsWithInIdealRange(){}bool UBTD_IsWithInIdealRange::Calculate.. 2024. 9. 23.