GA 를 활용한 게임 에이전트 동작 -CIG Competition PacMan- Yonsei Univ Soft Computing Lab
Preview:
Citation preview
- Slide 1
- GA -CIG Competition PacMan- Yonsei Univ Soft Computing Lab
- Slide 2
- 1/34 NOT YOUR FAULT!
- Slide 3
- 2/34 7 GA ?
- Slide 4
- 3/34 1. ! 2. !
- Slide 5
- 4/34 DO YOU BELIEVE IN GA?
- Slide 6
- 5/34 ?
- Slide 7
- 6/34
- Slide 8
- ( ) 7/34 Time(1.5 sec) Joint Degree(38) Angular motor . Motor 5
(-2, -1, 0, 1, 2 ) . (-) .
- Slide 9
- 8/34 01101110000100010011 64 361 169 576 ?
- Slide 10
- 9/34
- Slide 11
- 10/34 !
- Slide 12
- 11/34 !
- Slide 13
- CIG IEEE Symposium on Computational Intelligence and Games
Tutorial Session Presentation Competition
http://www.ieee-cig.org/competitions/ Competitions Chair: Simon M.
Lucas 12/34
- Slide 14
- CIG Competition 13/34
- Slide 15
- Unreal Tournament Sponsored by 2K Australia2K Australia The
competition task is to create a computer game bot Indistinguishable
from a human player major prize of A$7,000 cash Trip to 2K
Australia's studio DeathMatch game type for the FPS Chatting will
be disabled. Some aspects of the game play will be modified in a
way not known to competitors. 14/34
- Slide 16
- TORCS Car Racing Daniele Loiacono, Julian Togelius and Pier
Luca Lanzi Learn (or otherwise develop) a controller The distance
raced in a fixed amount of time Best few controllers will race
against each other Mac OS X, Windows and Linux, using Java and C++
Neural networks, Fuzzy logic, Force fields, Expression trees
15/34
- Slide 17
- Ms Pac-Man Non-deterministic game The world record for a human
player currently stands at 921,360 Can anyone develop a software
agent to beat that? the best software controller for the game of Ms
Pac-Man Screen-capture to get the current state of the game
16/34
- Slide 18
- AI for CS different than AI for Games 17/34 Must be smart, but
purposely flawed Loose in a fun, challenging way No unintended
weaknesses No golden path to defeat Must not look dumb Must perform
in real time (CPU) Configurable by designers Not hard coded by
programmer Amount and type of AI for game can vary RTS needs global
strategy, FPS needs modeling of individual units at footstep level
RTS most demanding: 3 full-time AI programmers Puzzle, street
fighting: 1 part-time AI programmer
- Slide 19
- Goals Games are entertainment Important that things behave
naturally Not necessarily perfect things are not always creature
Follow(the games) natural laws And avoid cheating Characters should
be aware 18/34
- Slide 20
- Game Agents 19/34 Most AI focuses around game agent think of
agent as NPC, enemy, ally or neutral Loops through: sense-think-act
cycle Acting is event specific, so talk about sense and think
first, then a bit on act SenseThink Act
- Slide 21
- Game Agents Sensing (1 of 2) Gather current world state:
barriers, opponents, objects, Needs limitations: avoid cheating by
looking at game data Typically, same constraints as player (vision,
hearing range, etc.) Vision Can be quite complicated (CPU
intensive) to test visibility (ie- if only part of an object
visible) Compute vector to each object Check magnitude (ie- is it
too far away?) Check angle (dot product) (ie- within 120 viewing
angle?) Check if obscured. Most expensive, so do last.
- Slide 22
- Game Agents Sensing (2 of 2) Hearing Ex- tip-toe past, enemy
doesnt hear, but if run past, enemy hears (stealth games, like
Thief) Implement as event-driven When player performs action,
notify agents within range Rather than sound reflection
(complicated) usually distance within bounded area Can enhance with
listen attributes by agent (if agent is keen eared or paying
attention) Communication Model sensing data from other agents Can
be instant (ie- connected by radio) Or via hearing (ie- shout)
Reaction times Sensing may take some time (ie- dont have agent
react to alarm instantly, seems unrealistic) Build in delay.
Implement with simple timer.
- Slide 23
- Game Agents Thinking (1 of 3) Evaluate information and make
decision As simple or elaborate as required Generally, two ways:
Pre-coded expert knowledge Typically hand-crafted if-then rules +
randomness to make unpredictable Search algorithm for best
(optimal) solution Ex- MinMax 22/34
- Slide 24
- Game Agents Thinking (2 of 3) 23/34 Expert Knowledge Finite
State Machines, decision trees, (FSM most popular, details next)
Appealing since simple, natural, embodies common sense and
knowledge of domain Ex: See enemy weaker than you? Attack. See
enemy stronger? Go get help Trouble is, often does not scale
Complex situations have many factors Add more rules, becomes
brittle Still, often quite adequate for many AI tasks Many agents
have quite narrow domain, so doesnt matter
- Slide 25
- Game Agents Thinking (3 of 3) 24/34 Search Look ahead and see
what move to do next Ex: piece on game board (MinMax), pathfinding
(A*) Works well with known information (ie- can see obstacles,
pieces on board) Machine learning Evaluate past actions, use for
future action Techniques show promise, but typically too slow
- Slide 26
- Game Agents Acting (1 of 2) 25/34 Learning and Remembering May
not be important in many games where agent short-lived (ie- enemy
drone) But if alive for 30+ seconds, can be helpful ie- player
attacks from right, so shield right Implementation - too avoid too
much information, can have fade from memory (by time or by queue
that becomes full)
- Slide 27
- Game Agents Acting (2 of 2) 26/34 Making agents stupid Many
cases, easy to make agents dominate Ex: FPS bot always makes
head-shot Dumb down by giving human conditions, longer reaction
times, make unnecessarily vulnerable, have make mistakes Agent
cheating Ideally, dont have unfair advantage (such as more
attributes or more knowledge) But sometimes might cheat to make a
challenge Remember, thats the goal, AI lose in challenging way Best
to let player know
- Slide 28
- Game Agents AI Deterministic AI Preplanned, predictable events
Set by rules Walk forward ten steps then backwards If player is
within 5 squares move closer Go to town take the shortest path
using shortest path algorithm Attack player with least health/most
damage potential/etc Non deterministic AI Unpredictable movement
Random selection of directions React to environment to learn
movement Player nearby, go slower Got shot going around corner last
time, then take a wider path this time 27/34
- Slide 29
- Base Environment
http://cswww.essex.ac.uk/staff/sml/pacman/PacManContest.html Java
Image Detector, Simulator, Game
http://sclab.yonsei.ac.kr/courses/09AgentGame/Reference_Code.zip
- Slide 30
- 29/34 IF then If then. If then SensingThinkingActing
- Slide 31
- 30/34 1. 2. 3. ? 4. !
- Slide 32
- 31/34 ? 256
- Slide 33
- 32/34 Evaluating! ! !
- Slide 34
- 33/34 Expert Rule Based System(High Priority) GA Rule(Middle
Priority) Expert Rule Based System(Low Priority)
- Slide 35
- 34/34 1. GA 2. CIG Competition 3. AI 4. Pac_man AI 5. Pac_man
AI GA