본문 바로가기

Unreal 게임 개발41

Unreal AIController 제작 이번에 BehaviorTree에 쓰일 AIContoroller(AIC)를 직접 제작해보았다. UPawnSensingComponent에서 UAIPerceptionComponent로 변경UPawnSensingComponent: 간단한 AI 감지 시스템에 필요한 경우 사용된다.UAIPerceptionComponent: PawnSensingComponent에서 제공하는 시각, 청각 감지 기능뿐만 아니라 손상 등 다양한 감지 기능을 지원한다.  이렇기에 이후에 더 확장성이 높은 UAIPerceptionComponent로 바꾸었다.AIPerceptionComponent = CreateDefaultSubobject(TEXT("AI Perception"));AIC의 생성자에 다음과 같이 추가했다. OnPossessht.. 2024. 10. 7.
Unreal StaticClass() StaticClass()이 함수는 클래스의 UClass 객체를 반환하는 정적 메서드로 주어진 클래스에 대한 정보를 저장한다.특정 클래스의 인스턴스를 생성할 때 또는 해당 클래스와 관련된 작업을 수행할 때 유용하게 사용된다.더보기정적 메서드: 객체 인스턴스와 관련 없이 클래스 자체에 속하는 메서드이다.객체를 생성하지 않고 호출이 가능하며 보통 클래스의 공통 기능이나 유틸리티 기능을 제공하는데 사용된다.더보기UclassUClass는 UE에서 클래스를 정의하고 관리하는 시스템.모든 UObject 파생 클래스(Actor, Component)는 UClass를 통해 인스턴스를 생성하고 조작이 가능하다. 또한 클래스의 구조, 속성, 메서드, 가상 함수, 에디터 노출 등 다양한 메타 정보를 저장한다. StaticCla.. 2024. 10. 3.
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.