Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under...

25
Adaptive AI Engine for RTS Games Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al- Ogail Under Supervision of: Dr. Ibrahim Fathy

Transcript of Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under...

Page 1: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Adaptive AI Engine for RTS GamesIntroduction to AI Engine & Common Used AI

Techniques

Created by: Abdelrahman Al-OgailUnder Supervision of:Dr. Ibrahim Fathy

Page 2: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Agenda

What’s Game AI? Why AI Engine? Structure of AI Engine Elements That Need AI in RTS Games Areas That Need Improvement in RTS

AI Common Used Techniques in AI

Engine So why working on that project

(what’s new)?

Page 3: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

What’s Game AI?

Let the computer think

Goal of Game AI: Entertainment NOT perfection How that guy finds the right answer?

Deeper Blue Example

Page 4: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Why AI Engine

AIEngineAI

Engine

That’s our guy

Page 5: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Structure of AI Engine

Page 6: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Elements That Need AI in RTS Games

Workers (peons, gatherers)

Individual units (soldiers, tanks…)

Town building: how to build my town to max. benefits

Pathfinding What’s the best (not shortest) way to get

from A to B

Page 7: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Elements That Need AI in RTS Games

Low level strategies Which pathfinding algorithm I should

use?

Medium level strategies How to achieve high level strategies?

High level strategies What are my goals?

Page 8: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Elements That Need AI in RTS Games

Terrain Analysis (keep track of your enemy)

Opponent Modeling (know your enemy)

Resource Management (take the control)

Diplomacy Systems (always have allies)

Page 9: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Areas That Need Improvement in RTS AI

Determine when AI element is stuck

Opponent modeling

More strategies less tactics Construct consistent army (solders,

tanks, planes) Think about support lines How to retreat Setup and detect ambushes

Page 10: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Areas That Need Improvement in RTS AI

Learning Some areas of learning:▪ AI opponent get in the same trap repeatedly▪ Know safe map locations and get away from

kill zones▪ Know how human player attacks and which

units he favors▪ Does the player rushes ?▪ Does the player rely on units that require certain

resources?▪ Does he frequently build a number of critical

structures in a poorly defensive place?▪ Are his attacks balanced? ( rock, paper, scissors

example)

Page 11: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Common Used Techniques

Categories of Used Techniques: Decision Making Other Techniques▪ Data-Driven Techniques▪ Perception Techniques▪ Communication Techniques

Page 12: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Decision Making – Finite State Machine

When to use: to represent states

Page 13: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Decision Making – Fuzzy State Machine

When to use: to represent several states at the same time

Page 14: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Decision Making – Genetic Algorithms

Used to find best solutions to a given problems

Genetic Process Rely on the idea of reproduction

Example of using: finding best optimal # of peons working

in each areas (area = building, money, wood, stone…)

Page 15: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Decision Making – Neural Networks

Rely on simulating human brain Used in:

Classification Opponent modeling

Page 16: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Decision Making – Artificial Life

ALife is about searching to find “governing principles” to the life

Newton theorem

Alife Techniques: Cellular Automata Steering Behaviors

Add the creativity to the AI opponent

Page 17: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Decision Making – Steering Behaviors

Simple rules that produces emergent behaviors

Boids research by Craig Reynolds

Used: To simulate real life In producing emergent

behavior Provide autonomies agents

Page 18: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Decision Making – Planning

Planning is, deciding upon a course of action before acting

Usage in games: Pathfinding algorithms Set plans to high level strategies in RTS Games anticipating ambushes

Some of Planning Techniques: A*, Mean & Analysis, Patch Recalculation,

Minimax

Page 19: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Decision Making – Production Systems

As prolog Used techniques:

Forward changing Backward changing

Page 20: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Decision Making – Decision Trees

Complex IF-ELSE Statements represented as tree

Usage if games: Player modeling High level strategies

Page 21: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Other Techniques – Data Driven AI

Scripting Systems

Using an external resource (not coded) that controls the AI opponent

Advantage Add extendibility to the game

Page 22: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Other Techniques - Messaging

Supplies communication between game objects

Page 23: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Other Techniques – LBI Systems

LBI: Location Based Information Systems

It’s a perception technique

Keeps track of the world attributes

Common techniques: Influence Maps Terrain Analysis Smart Terrain

Page 24: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

Other Techniques – LBI Systems

Usage in games: Helps with obstacle avoidance Detecting player, resources places Danger specification (keep track of kill

zones) Discover critical points in the world (as

bridges)

Page 25: Introduction to AI Engine & Common Used AI Techniques Created by: Abdelrahman Al-Ogail Under Supervision of: Dr. Ibrahim Fathy.

What’s new?

Future of wars is going to be more robotic Sharing & validating plans

MIT asks for researches in this area (10-2008)

Alex J.C. said: “there’s no real learning and adaptation in commercial games”

Researches in this area is so active! One of the papers date 6-2008