AI Controller : 우리 뇌-신경처럼 게임속 AI 액터를 찾아서 움직이도록 조작
Behavior Tree : 어떤 상황에 무슨 행동을 할지 등 상황 판단 행동 규약(알고리즘)을 저장
Blackboard : 뇌처럼 AI가 해야 할 일 등의 정보와 키(Key) 등을 기억(저장)
NavMeshBoundsVolume : AI뿐만 아니라 내비게이션 메시 시스템을 사용하는 모든 오브젝트의 이동 영역을 정의하는 볼륨
Runtime Generation
Navigation Invoker : NavMeshBoundsVolume이 Mesh를 만들 때 발생하는 비효율적인 연산을 효율적이게 바꿔줌
Nav Modifier Volume : 배치된 구역의 이동 비용을 높일 수 있는 볼륨
AI Character 이동 시에는 AIController의 내장 함수인 MoveToActor()
/ MoveToLocation()
사용
![]() | ![]() |
---|
RVO(Reciprocal Velocity Obstacles) : AI 캐릭터들이 서로 충돌하지 않고 자연스럽게 회피/이동할 수 있게 도와주는 알고리즘
CharacterMovementComponent
내 RVO 옵션 설정bUseRVOAvoidance
: RVO 충돌 회피 알고리즘 활성화AvoidanceConsiderationRadius
: 회피 시작 거리AvoidanceWeight
: 회피 가중치플레이어 추적을 위한 AIController 생성
AI 상태 정의
매 틱 AI의 상태를 체크
Chasing 상태일 때 추적
인지 시스템 추가
제공된 코드는 잘 안됐음
AIController는 기본적으로 AIPerceptionComponent를 가지고 있음. 근데 할당하지 않으면 에디터에서 안보였음(그냥 포인터로만 가지고 있는 듯)
그래서 직접 할당하고, Sense값 초기화
OnTargetPerceptionUpdated
에 바인딩되는 OnPerceptionUpdated
함수에서도 AI 캐릭터가 플레이어 캐릭터를 인지했을 때, 서로 간의 거리에 따라 AI 캐릭터의 상태를 변경
마지막으로 플레이어 캐릭터도 AI에게 인지될 수 있도록 AIPerceptionStimuliSouceComponent
추가
참조 사이트
1. https://dev.epicgames.com/documentation/ko-kr/unreal-engine/using-avoidance-with-the-navigation-system-in-unreal-engine
2. https://dev.epicgames.com/documentation/ko-kr/unreal-engine/overview-of-how-to-modify-the-navigation-mesh-in-unreal-engine
3. https://dev.epicgames.com/documentation/ko-kr/unreal-engine/automatic-navigation-link-generation#%EC%96%B8%EB%A6%AC%EC%96%BC%EC%97%94%EC%A7%84%EC%9D%98%EB%82%B4%EB%B9%84%EA%B2%8C%EC%9D%B4%EC%85%98%EB%A7%81%ED%81%AC
4. https://dev.epicgames.com/documentation/ko-kr/unreal-engine/automatic-navigation-link-generation#%EB%82%B4%EB%B9%84%EA%B2%8C%EC%9D%B4%EC%85%98%EB%A7%81%ED%81%AC%EB%B9%84%ED%97%A4%EC%9D%B4%EB%B9%84%EC%96%B4%ED%85%8C%EC%8A%A4%ED%8A%B8%ED%95%98%EA%B8%B0
------ AIController의 AIPerceptionComponent
5. https://forums.unrealengine.com/t/uaiperceptioncomponent-added-in-aicontroller-via-c-wont-allow-me-to-add-senses/468928
6. https://forums.unrealengine.com/t/perception-component-added-in-c-wont-allow-senses-config-in-derived-blueprint/394093/3