22
Creating an intelligent agent for StarCraft: Brood War University of Liège Faculty of Applied Sciences 2009 – 2010 Firas Safadi Master in Computer Science Professional Focus

Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

Creating an intelligent agent for StarCraft: Brood War

University of Liège Faculty of Applied Sciences

2009 – 2010

Firas Safadi Master in Computer Science

Professional Focus

Page 2: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

Computers

Why artificial intelligence (AI)?

Video games

Why real-time strategy (RTS) games?

Introduction

Page 3: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

StarCraft: Brood War

Chapter I

Page 4: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

Developed by Blizzard Entertainment, Inc. and released in 1998

Proved successful as it continues to drive popular video game leagues even 10 years after its release, especially in South Korea

History

Page 5: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

3 races (Terran, Zerg and Protoss)

different (but balanced!) with unique abilities and characterized by a distinct play style

Rich resource mechanics

minerals, gas, supplies (reclaimable)

Lots of units with many attributes

Features

Page 6: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

Resource panel (overlay) [1]

Command panel [2]

Portrait [3]

Unit information [4]

Mini-map [5]

Interface

Page 7: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game
Page 8: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

Agent Design

Chapter II

Page 9: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

Orders travel from the strategy manager down to individual units. They start as abstract orders and are processed by the intermediate managers, eventually translating into concrete unit commands.

Design Overview

Operational

Tactical

Strategic Strategy Manager

Production Manager

Work Squads

Combat Manager

Military Squads

Page 10: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

• Simplified game state

• Trigger-based decisions

Strategy Manager

Operational

Tactical

Strategic Strategy Manager

Production Manager

Work Squads

Combat Manager

Military Squads

Page 11: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

• Build order management

• Worker assignment

Production Manager

Operational

Tactical

Strategic Strategy Manager

Production Manager

Work Squads

Combat Manager

Military Squads

Page 12: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

• Combat flags

• Military unit assignment

• Squad deployment

Combat Manager

Operational

Tactical

Strategic Strategy Manager

Production Manager

Work Squads

Combat Manager

Military Squads

Page 13: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

• Target selection

• Formation and behavior

Military Squads

Operational

Tactical

Strategic Strategy Manager

Production Manager

Work Squads

Combat Manager

Military Squads

Page 14: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

• Resource gathering

• Building construction

Work Squads

Operational

Tactical

Strategic Strategy Manager

Production Manager

Work Squads

Combat Manager

Military Squads

Page 15: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

Order Processing

Production Order

Train 8 marines

Build barracks

Acquire resources

Gather minerals

Combat Order

Attack

Create 2 squads

Destroy outpost

Kill a patrol unit

Page 16: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

Implementation

Chapter III

Page 17: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

StarCraft is not open source!

The Brood War Application Programming Interface (BWAPI) is an open source C++ “hacker” framework and provides hooks to access the game state and issue commands.

BWAPI add-ons: BWSAL, BWTA, etc.

BWAPI is not perfect!

Framework

Page 18: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

How does it work?

Normal flow

Take user commands

Compute next frame

Draw screen

Altered flow

Agent processing

Take agent commands

Compute next frame

Draw screen

Page 19: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

Results

Chapter IV

Page 20: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

0

20

40

60

80

100

120

Units produced Units killed Units lost

Game Statistics

Page 21: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

The project was successful!

Primary objective met

Very useful for the years to come

Final Words

Page 22: Creating an intelligent agent for StarCraft: Brood War · Developed by Blizzard Entertainment, Inc. and released in 1998 Proved successful as it continues to drive popular video game

The End Thanks for listening!