Application and Evaluation of Artificial Intelligence Algorithms for StarCraft

Application and Evaluation of Artificial Intelligence Algorithms for StarCraft

Luke Deshotels (University of Louisiana at Lafayette, USA)
DOI: 10.4018/978-1-4666-1634-9.ch006


This chapter will discuss several algorithms and techniques used in artificial intelligence that can be applied to StarCraft (Blizzard, 2009) and other similar real-time strategy (RTS) games. A significant section of the chapter is devoted to teaching the reader how to use the Brood War API (Heinermann, 2011), BWAPI. This API allows developers to create agents that can play StarCraft with or without human interaction. Each section after the tutorial introduces an algorithm or technique, explains the relevant concepts, shows an example of its implementation in StarCraft, and evaluates its performance and applications. The algorithms and techniques covered include swarm intelligence, gathering algorithms, expert systems, and hill climbing. The example implementations are kept simple to allow readers to follow along and implement them as practice.
Chapter Preview


Overview of StarCraft

By allowing programmers to see algorithms come to life in challenging scenarios StarCraft makes an excellent environment for learning new algorithms. This game is over a decade old and is still played throughout the world. It is treated like a national sport in South Korea with competitors making hundreds of thousands of dollars each year. An application programmer interface, Brood War API that allows the programming of intelligent agents to play StarCraft has recently been released. These factors make StarCraft a prime platform for developing an RTS AI.

For readers planning to create an AI that plays competitive StarCraft the first step is learning to play the game. As with any AI, the developer should have a firm understanding of the environment his agent will act in, the tasks it must accomplish, and any obstacles or noise that could prevent the task from being accomplished. In this case the environment is an alien planet, the task is world domination, and the noise is caused by monsters that want to eat the agent. Unfortunately a tutorial on playing StarCraft is beyond the scope of this chapter. However there are numerous StarCraft guides (Team Liquid, 2010) and video tutorials on the Internet.

Opportunities for AI

StarCraft and real-time strategy games in general offer new challenges for AI that chess could not. By vastly expanding possible actions, introducing time as a new dimension, and making the environment more realistic, StarCraft is a perfect environment for intelligent agents to grow, learn, and compete. At the time of this writing even the best AI could not beat professional human players at StarCraft, but this is likely to change in a few years.

A vast variety of AI algorithms and techniques can be applied to StarCraft including swarm tactics, expert systems, gathering algorithms, hill climbing, and more. By applying such algorithms intelligent agents are able to use their superior speed to produce uncanny behavior with the game’s units. It is truly fascinating what sort of behaviors can emerge as an agent fights for its life.



The best way to learn StarCraft is to play the game, but a brief overview may help prepare the reader for references made in this chapter. The game takes place in a science fiction universe where space travel is trivial, but survival is not. StarCraft puts players in the position of a military leader that must decide how to manage a small colony and an army of up to 200 units in order to defeat an opponent with similar resources.

Complete Chapter List

Search this Book: