intelligent asteroid agents combining pathfinding and steering algorithms

16
INTELLIGENT ASTEROID AGENTS COMBINING PATHFINDING AND STEERING ALGORITHMS Carlos Barboza Kenny Barron Kevin Cherry Tung Le Daniel Lorio

Upload: damia

Post on 23-Feb-2016

22 views

Category:

Documents


0 download

DESCRIPTION

Carlos Barboza Kenny Barron Kevin Cherry Tung Le Daniel Lorio. Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms. Avoid enemy ships as they chase after you Every second alive adds points (10) Killing an enemy adds points (100) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

INTELLIGENT ASTEROID AGENTS COMBINING PATHFINDING AND STEERING ALGORITHMS

Carlos BarbozaKenny BarronKevin CherryTung LeDaniel Lorio

Page 2: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

ABOUT THE GAME Avoid enemy ships as they chase after

you Every second alive adds points (10) Killing an enemy adds points (100) Player can wrap around screen,

enemies can’t Enemy can only propel forward, player

can move forward and in reverse

Page 3: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

DEMONSTRATION

Page 4: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

OBJECTIVE Maximize agent’s performance in fully-

dynamic, multi-agent environment with limited knowledge of environment

Determine performance through the use of different AI algorithms and parameters

Performance is gauged by score at end of game

Page 5: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

ORIGINAL GAME“FRENZY SURVIVOR”

User controlled player

Limited ship following

Disorganized in pursuit of player ship http://

berfenfeldt.com/

Page 6: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

ENVIRONMENT

Partially Observable – Limited to set regions Strategic – Moves based on location of enemy Episodic – Experience based on perception of

enemy Dynamic – Enemy constantly moving/regenerating Discrete – Agent responds with set action based

on perception of enemies in viewed regions Multi-Agent – Steering algorithm applied to

enemies, and pathfinding for player

P – ScoreE – Grid A – Moves S - Grid Regions

Page 7: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

ADAPTING THE ENEMY

Adapted open source project OpenSteer in C#

Enemy determines velocity and direction based on players location

Steer for seek allows enemies to converge around player

Steer for flee allows enemies to distance themselves away from player in any direction

Page 8: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

ADAPTING THE PLAYER

Loosely based on A* Pathfinding

Combines heuristic, actual cost, and utility function to quantitate each move choice

Agent chooses maximum move value

Page 9: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

ALGORITHM EVOLUTION 1st Agent was a simple reflex agent, not

partially observable, random movements and actions, and it was not rational

2nd Environment was partially observable, agent was a simple reflex agent, and partially rational

3rd Agent was goal based agent, partially observable environment, and partially rational

Page 10: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

HEURISTIC FUNCTION (H)

Creates grid to discretize the game world

Each grid cell has bitmask that holds information on cell contents If enemy is in cell If cell is part of a region

Page 11: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

HEURISTIC FUNCTION (H)

Creates 5 regions from grid Multiplies enemy presence

with proximity to player in each region using a cubic scale. A – Accelerates Forward F – Flees Backward L – Turns Left R – Turns Right S – Shoots

L RS

F

A

Page 12: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

ACTUAL COST FUNCTION (G)

Concept of look ahead implemented as a move tree for actual score

1 point per move simulates survival time

Prune on dead state (count dead states)

Total dead states counted for each move’s subtree

Final move score: MaxDescendentScore * W1 -

TotalDescendentDeadStates * W2

root

L A S F R

L A S F R. . .

Page 13: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

UTILITY FUNCTION (U) Acts as a multiplier for move values,

and tilts the behavior of the player towards passive or aggressive A = 1.4 B = 1.0 F = 1.2 L = 0.8 R = 0.8 S = 1.2

Page 14: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

FORMULA f(m) = (h(m) + g(m)) * u(m)

where m = move Overview:

h(m): Evaluate for each move and choose the one with the largest value

g(m): Simulate gameState for each child, prune dead states, and select move with highest

u(m): Utility function adds custom factor to each value

Page 15: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

RESULTS1 2 3 4 5 6 7 8 9 10 AVG BEST

H,U(8) 1204 1303 1105 1305 1304 1305 1304 1209 1611 1205 1285.5 1611

H(8) 1204 1208 1203 110 1230 816 1212 1304 1304 1330 1092.1 1081

H,U - EC(4) 1806 1705 2810 1911 1606 1708 1906 1806 5316 2709 2328.3 5316

H,U - Double(8) 1004 2416 4814 2306 2606 2605 2307 4412 4923 2607 3000 4923

H - Double(8) 2708 1606 3710 2508 2609 5218 1009 1408 2506 1805 2508.7 5218

H - Double(4) 2507 1205 1509 1103 2309 2107 1707 1505 4315 2409 2067.6 4315

1 2 3 4 5 6 7 8 9 10 Avg Best0

1000

2000

3000

4000

5000H,U(8) H(8) H,U - EC(4) H,U - Double(8) H - Double(8) H - Double(4)

Page 16: Intelligent Asteroid Agents combining Pathfinding and Steering Algorithms

DEMONSTRATION