Chapter 10 AI Techniques in different game genres (SLG / Action / Fighting)

Post on 26-Mar-2015

226 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

Transcript

Chapter 10 AI Techniques in different game genres(SLG / Action / Fighting)

The general Game AI concept

AI Turn, Call AI to Think

AI Action

Player Turrn, Waiting Input

AI

Get RelateGame Data

Player

Player Action

Make Decision

Input Command

Look and Listen

Analysis

Make Decision

Return Action

Data Analysis

GameApplication

Device

Input / output

AI for Fighting

Object1 Input / Output deviceGame

Game Status

Update Read / Listen

Input Command

Action

Action

AI for Fighting - Analysis

Attack Point – High, Medium, Low Defense Point – High, Medium, Low Professional Attack Distance –

Long, Middle, Short Movement ability – Dash, Run,

Walk, Jump

AI for Fighting – Attack / Defense

Case HP / Status Attack Type Range: Short

Attack Type Range: Mid

Attack Type Range: Long

Rival Distance Output Action

1 High / Stand High DamageLong Idle

High DamageLong Idle

NIL Mid – Range 1. Dash front2. Attack in short distance

2 Low / Stand Low DamageVery Short Idle

Medium DamageLong Idle

Medium DamageLong Idle

Far 1. Stay2. Attack in long distance

3 Medium / Stand High DamageShort Idle

Low DamageShort Idle

Medium DamageVery Long Idle

Near 1. Dash Back2. Attack in mid distance

4 Medium / Be Attack

High DamageShort Idle

Low DamageShort Idle

Medium DamageVery Long Idle

Near 1. Blocking2. Combo Attack

AI for Action Game

Move Closer To Player

Dash Attack Combo Attack Tactic

Rank AI Skill Tactic

Big Boss Smart walk, run, dash attack, normal attack, combo attack, special attack

For example, move to player backward when player is fighting with others.

Small Boss Smart walk, run, dash attack, normal attack, combo attack

No

Normal Soldier Normal walk, normal attack, combo attack

No

Pathfinding

Dijkstra's Algorithm

Dijkstra's Algorithm

A* (A Star) Algorithm

Heuristic Estimation Weight of path Cost Comparing

Concept of A* (A Star) Add the starting node (tile) to the open list. Look for the lowest F cost node on the open list. We

refer this as the current node. The node move from open list to close list. For each of the 4 nodes, top, right, down and left

adjacent to this current node. If nodes note closed or not reachable then skip them. If the node is in the open list already, check the G cost. Select the linked note of lowest G with cost 1. If the node is not in the open list, then add to open list.

Repeat step 2 to step 4 until found the target node (tile) and return the path. But if the open list is empty and not reaching the target tile yet that means you can't reach the target node and return false.

A* (A Star) Algorithm

A* (A Star) Algorithm

SLG Analysis Component Goals Resource

Soldiers Workers Building

Current Team Format Map / Global Status Time Prediction

Making Decision

Movement Attack Healing

Fuzzy Logic

Degrees of value If True is 1, False is 0. We should have 0.1

fuzzy values, which near false but not absolutely false.

Fuzzy State Machine When design AI State machine, we shoul

d apply fuzzy values for state controlling and state presentation

Traditional fuzzy state machineNumber of Variable Number of value exist

in each variableTotal rules generation

2 5 52 = 25

3 5 53 = 125

4 5 54 = 625

5 5 55 = 3125

6 5 56 = 15625

Traditional fuzzy state machine (Example)My Team Scale Enemy Team Scale My Team Attacking Status

Strong Strong Attack Carefully

Strong Average Attack

Strong Weak Full Attack

Average Strong Runaway

Average Average Attack Carefully

Average Weak Attack

Weak Strong Runaway

Weak Average Runaway

Weak Weak Attack Carefully

Combs method

William E. Combs designed a method to prevent combinatorial explosion in fuzzy logic rules. The method describes the direct relationship between every variable and the fuzzy value of state. AI system then combines all results to generate the final result.

Combs method (Example)Variable : Value Attacking Status

My Team Scale: Strong Full Attack (90%)

My Team Scale: Average Attack (60%)

My Team Scale: Weak Attack Carefully (30%)

Enemy Team Scale : Strong Attack Carefully (30%)

Enemy Team Scale : Average Attack (60%)

Enemy Team Scale : Weak Full Attack (90%)

Combs method (Example)My Team Scale Enemy Team Scale My Team Attacking Status

Strong (90%) Strong (30%) Attack Carefully (27%)

Strong (90%) Average (60%) Attack (54%)

Strong (90%) Weak (90%) Full Attack (81%)

Average (60%) Strong (30%) Runaway (18%)

Average (60%) Average (60%) Attack Carefully (36%)

Average (60%) Weak (90%) Attack (54%)

Weak (30%) Strong (30%) Runaway (9%)

Weak (30%) Average (60%) Runaway (18%)

Weak (30%) Weak (90%) Attack Carefully (27%)

Thank You

top related