본문 바로가기
개발/읽을거리

읽을거리) Unity 에서 AI를 만드는 방법 1부, 2부

by 테샤르 2024. 1. 19.

Unity 에서 AI를 만드는 방법 1부, 2부 

 

Game Dev tv 사이트를 보다가 간단하게 설명이 잘되어 있는 글을 발견하게 되어서 간략하게 포스팅 한다.

 

 

Unity 에서 AI를 지각 있게 만드는 방법 1부 - 원본 링크 : [링크]

 

How to make AI sentient in Unity, Part I

In the first of two parts miniseries about AI senses, I'm going to guide you through an implementation of eyes and ears for NPCs, that takes advantage of inheritance and UnityEvents. In the subsequent part, I'll show you how to create some reactive behavio

blog.gamedev.tv

Unity 에서 AI를 지각 있게 만드는 방법 2부 - 원본 링크 : [링크]

 

How to make AI sentient in Unity, Part II

In the second, and final, part of the miniseries about AI senses, I'm going to guide you through an implementation of reactive AI behavior for patrolling between selected points, chasing a player when it's seen, and investigating a location player has been

blog.gamedev.tv

 

<간단 요약>

 

Unity 엔진을 활용해서 간단하게 NavMeshAgent와 Script를 통해서 순찰(Patrol), 찾기(Dector), 다가가기(Run)의 기능을

구현한다.

구현하는 과정에서는 수학공식을 통한 FOV(Field Of View) 시야과

디자인 패턴인 State, Observer를 통해서 간략하게 구성하는 포스팅이다.

 

반응형

 

< 기본 Class >

 

< 시야각 (Field Of View) >

반응형

 

순찰은 간단하게 특정 지점과 타겟 지점을 지정하고 이동에 대한처리를 진행하고
눈과 귀를 통해서 탐지하는 기능으로 탐지를 진행한다.

탐지하는 과정과 장애물 등 여러가지를 고려해서 참고하면 될것 같다.

 

 

 

해당 로직은 Rule Base System에 가깝다.

간단하고 기본이되는 로직이다 보니 조금만 플레이를 해보면 로봇같은 느낌이 확실히 강하다.

추가로 성향, 특성에 대한 능력치에 대한 조절, 혹은 랜덤, 가중치에 대한 설정을 추가하면 좀 더 나이스해진다.

 

조건이 많으면 많을수록 세부적인 컨트롤이 가능하지만 그 만큼 구현이 복잡해진다.

 

 

원본 소스 : https://github.com/marianpekar/ai-senses-unity-example

 

GitHub - marianpekar/ai-senses-unity-example: An example project for series of blog posts about AI perception in Unity published

An example project for series of blog posts about AI perception in Unity published at blog.gamedev.tv - GitHub - marianpekar/ai-senses-unity-example: An example project for series of blog posts abo...

github.com

 

※모든 사진에 대한 저작권은 marianpekar 에 있습니다.

 

반응형

댓글