1 / 5

Chapter 6-6. Artificial Intelligence

Chapter 6-6. Artificial Intelligence. Demo 06 실행. Code file Bmp.h Bmp.cpp, Timer.h, Timer.cpp Defines.h, Bsprite.h, Bsprite.cpp, objects.h, objects.cpp, Sbmp.h, Sbmp.cpp Ddsetup.cpp, CSprite.h, Csprite.cpp, View.h(cpp) Main.cpp, Objects.h, Objects.cpp Objman.h(cpp), Random.h(cpp) : 수정

Download Presentation

Chapter 6-6. Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 6-6. Artificial Intelligence • Demo 06 실행 • Code file • Bmp.h Bmp.cpp, Timer.h, Timer.cpp • Defines.h, Bsprite.h, Bsprite.cpp, • objects.h, objects.cpp, Sbmp.h, Sbmp.cpp • Ddsetup.cpp, CSprite.h, Csprite.cpp, View.h(cpp) • Main.cpp, Objects.h, Objects.cpp • Objman.h(cpp), Random.h(cpp) : 수정 • Ai.h(cpp) : 추가 • Media file • Sprite.bmp,Bckgnd.bmp, Farm.bmp • Lib file • Ddraw.lib, Winmm.lib

  2. Here’s what you’ll learn • Rule based system의 정의와 구현방법 • 사물 개체의 코드위에 개체 지능 구축하는 방법 • 타이머와 의사 랜덤 수 생성기를 사용하여 지능형 개체들이 동일하게 작동하지 못하게 하는 방법 • 게임중에 생성 및 소멸되는 개체 관리하는 방법 • 단순 형태의 충돌 감지 구현하는 방법

  3. Artificial Intelligence • Rule based system을 이용한 인공지능구현 방법 • 까마귀의 동작을 예측하기 쉽지 않고, 보다 무질서한 개체구현

  4. 지능형 개체구현(1) • Cobject에서 CIntelligentObject 유도 • Simple Rule-based system을 이용하여 지능형 개체 구현 • CIntelligentObject의 특성 • 추적 : 까마귀 개체 달아남, 높이 변경 • 계속추적 시 : 지쳐서 속도를 낮춤 • 비행기속도를 낮춤 : 까마귀 무리 형성(비행기 앞, 뒤)

  5. 지능형 개체 구현(2) //defined in Ai.h(cpp) enum StateType{CRUISING_STATE,AVOIDING_STATE}; #include "objects.h" class CIntelligentObject: public CObject{ private: StateType m_eState; //state int m_nDesiredHeight; //desired altitude int m_nHeightTime; //time between height changes int m_nHeightDelayTime; //time to next height change int m_nSpeedVariationTime; //last time speed varied int m_nSpeedVariationDuration; //time to next speed vrn int m_nLastAiTime; //last time AI was used int m_nAiDelayTime; //time until AI next used int m_nDistance; //distance to plane int m_nVerticalDistance; //vertical distance from plane int m_nHorizontalDistance; //hor. distance from plane void ai(); //artificial intelligence void cruising_ai(); //ai for cruising along void avoiding_ai(); //ai for avoiding plane void set_state(StateType state); //change state public: CIntelligentObject(ObjectType object,int x,int y, int xspeed,int yspeed); //constructor virtual void move(); //move depending on time and speed void plane(int x,int y,int d); //relationship w/plane };

More Related