Professional Documents
Culture Documents
Instituto Tecnol Ogico y de Estudios Superiores de Monterrey
Instituto Tecnol Ogico y de Estudios Superiores de Monterrey
Campus Monterrey
por
Los miembros del comité de tesis recomendamos que la presente propuesta de Claudio Bernardo Rodrı́guez
Rodrı́guez sea aceptada para desarrollar el proyecto de tesis como requisito parcial para obtener el grado
académico de Maestro en Ciencias, especialidad en:
Sistemas Inteligentes
Comité de Tesis:
Noviembre de 2010
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3 Investigation Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4 Justification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4.1 Convenience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4.2 Social Relevance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4.3 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4.4 Where and when will it be developed? . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
5 Variable Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
6 Reach & Limitations of the Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
7 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
7.1 StarCraft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
7.2 Buildings of StarCraft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
7.3 Units of Starcraft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.4 Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.5 Graphical Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.6 Data Mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7.7 The StarCraft Problem & Data Mining . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.8 Multi-Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.9 Advanced AI applied in Videogames . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8 Hypothesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.1 Data Mining State of the Art . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.2 Creating a Scout Class to gather information and put it in the database . . . . . . . . 27
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
List of Figures
1 Variable Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Terran Buildings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Zerg Buildings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Protoss Buildings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Terran Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6 Zerg Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7 Protoss Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
8 Representations Needed for the Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
9 Agent Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
10 Minimized Example: The StarCraft Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
11 Knowledge Discovery Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
12 Characteristics of Multiagent Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
13 Key Properties of an Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
14 Gantt Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Abstract
This document presents the thesis proposal for Intelligent Systems Master Degree, in which it is pre-
tended to solve the problem of creating a real simulation of the Army environment, including departments
like Resource Control, War Tactics, Unit Control, Base Construction, and a General. To do this, the problem
has to be divided into micro problems to be approached one by one. The first micro problem it’s to prove
that multiagent systems applied in Unit Control is factible in computer resources usage (CPU and RAM)
compared to using a simple selfish agent approach for each unit. After this is one it is important to provide
data comparing the results between managing the Units through a higher level class (Lieutenant) compared
to let them create their own tactics.
1 Introduction 1
1 Introduction
Artificial Intelligence is a branch of computer science, it attempts to understand the substance
of intelligence, and produce a new intelligent machine could make reactions similar to the human
intelligence. [1]
This paper will discuss AI, algorithms, methods to reach a solution and multi agents. Agents, the
brick & mortar of AI, are simply something that perceives and acts on the environment.[2] To build a better
agent we must have a complete knowledge of the subject and of the problem that we are going to solve.
Optimizing agents gets harder the more elements we include in our problem, thus an autonomous vehicle or
an android get harder to make since modifications of the agent have to be tested real time.
Videogames on the other hand provide a full environment rich in variables and possibilities; there-
fore allowing us to build agent programs and test them from the comfort of our office. For the purpose of
this paper we will be using StarCraft, and RTS (Real Time Strategy) videogame developed by Blizzard En-
tertainment and released on 1998.[3] The game’s system requirements are minimum compared to computer’s
current technology, thus allowing us to increase the AI’s CPU usage. Though AI is being researched for
videogames it is not the same as academic AI; game AI must be designed to be suboptimal, allowing the
player to win from time to time.[4] For the purpose of this paper, game AI must not lose. StarCraft has many
competitions worldwide, such as World Cyber Games, Ongamenet Starleague, and MBCgame Starleague.
What is the proper application of a Multiagent System where each type of unit is a standalone
agent and communicates with each other to reach a common goal? The purpose is only having instances of
certain agents when they are available. Intelligent processes like planning, problem solving, decision making,
and learning methods are also part of the problem.
To develop the program, we’ll use an Application Programming Interface (API) named Brood
War; which is based in C++ language. An agent will be needed to implement the data mining algorithms.
A standalone testing of the agent will be needed to use it as an appropriate testing tool. The API will
allow the programmer to concentrate on developing solid AI by contributing with information on units and
individuals.[5] Though there are different ways to analyze the efficiency of our program, we will concentrate
mainly in testing the program in real matches; keeping control and maintaining a history of the amount of
computational resources taken by the bot is paramount.
2 Objectives 2
2 Objectives
During the investigation new objectives may arise.
• Building a multiagent system that implements techniques of agent communication by giving each unit
type its own responsibilities.
• Determine the objectives and responsibilities of each type of unit in StarCraft, along with goals and
subtasks.
• Determine the best strategies for a certain given objective (king of the hill, free for all, capture the
flag, greed and sudden death) and how the type of map affects the battle.
• Determine the importance of communication for battle success by reducing the number of units lost.
3 Investigation Questions
Every question will be investigated considering that the implementation will be in StarCraft and the
different scenarios there could be in an RTS game.
1. What are the units in StarCraft? How are they produced? What are the values?
2. What are the advantages and disadvantages of each unit type in StarCraft?
8. How to collect data by every agent to a one central database that takes advantage of the best search
algorithms for data mining?
9. How to allow agents to negotiate objective based on their characteristics (power, number of units, wild
card)?
10. How to solve, plan, make decisions, and learn the next objective?
12. How to reduce the data to predicate logic and then make relations between those predicates?
17. Are multi agent systems and data mining implemented in defense systems nowadays?
4 Justification 3
4 Justification
4.1 Convenience
Andrew Carnegie once said ”Put all your eggs in one basket and then watch that basket,” sadly it isn’t
possible to observe an entire army every second to allocate orders and trust those orders will be carried out
perfectly in the heat of battle.
To allow the army to grow is to give each one their own responsibilities and trust in their capacity to
carry out what they must. This investigation is important to develop a structure of command in automated
warfare. By decentralizing tasks and empowering the elements with a certain amount of responsibilities then
we are less dependent on one central general.
Working in teams gives us the benefit of simultaneously making decisions and solutions were
each agent would make choices together with the rest instead of one main agent implementing solutions
sequentially.
4.3 Applications
This application can be transported to real life situations. Instead of unit types we would have real life
drones or androids performing the tasks at hand. Human issues like dishonesty, trust, respect, conflict, and
commitment present when working with teams are non-relevant in software since multiagents are instructed
to share the information.
5 Variable Definitions
• E-Commerce.
• Videogames.
The key factor of the applications were Multiagents are implemented is that in every application
there is inherent distribution. In our application there is as well inherent distribution of tasks; each unit
type in StarCraft has its own recommendations and alterations that are affected not only by space, but also
by time and opponents moves. Every unit can be treated as a centralized problem since tactics can differ,
for example, a group of Zerg Guardians can’t counterattack an enemy’s air unit; In case they encounter this
problem they should follow a certain strategy that only applies to that type of unit.
7 Background 5
7 Background
The art of war,then, is governed by five constant factors, . . . The Moral Law, Heaven, Earth,
The Commander and Method and Discipline[10]
Fortunately, amongst the benefits of using Technology and Artificial Intelligence, aspects such as
the Moral Law and Heaven do not apply to our study. We will focus mainly of taking advantage of the
battlefield (Earth), use the unit’s stats to calculate the possible winning outcome (Commander), and we will
micro manage each unit type group instead than each unit (Method and Discipline).
7.1 StarCraft
StarCraft is a real time strategy videogame developed by Blizzard entertainment. The user rep-
resents the military leader of one of three races: Terran (Humans), Zerg, and Protoss. Each unit has its
unique type of buildings and units.
In order to make units, each player must first have the building appropriate to train that specific
type of unit. To build units and buildings you need only two types of resources: mineral deposits and vespene
gas.
PC Requirements:
CPU: Pentium 90 MHz
MEMORY: 16MB RAM
HDD: 80 MB
.
7 Background 9
7 Background 10
.
7 Background 11
7 Background 12
Legends:
Cool is the time between the ending of the attack and the beginning of another.
Attack Mod is the Damage modifier for each level of upgrade.
Gnd is Ground attack for units with split Air/Ground Weapon Systems.
Air is Air attack for units with split Air/Ground Weapon Systems.
Upg is a stat change after getting an upgrade.
Attacks:
E indicates Explosive Attack (50% damage to Small Units 75% damage to Medium Units, full
damage to Large Units).
C indicates Concussive/Plasma damage Attack (50% damage to Medium Units 25% damage to
Large Units).
S indicates Splash damage, which affects all units in the blast area.
Notes:
B = Biological
D = Unit can Detect cloaked/burrowed units
SA = Unit has one or more Special Abilities (is a spell-caster)
T = Transport
W = Worker
[3]
7 Background 13
7 Background 14
7 Background 15
7 Background 16
-
7 Background 17
7 Background 18
7.4 Agents
An agent in this case is going to be a virtual entity that is going to be capable of acting in
the environment. For the purpose of this investigation, our agent must have the next definition:
• He must have only a partial representation of environment (no agent can handle everything).
• He has a unique set of skills and can offer things no other agent has.
• His behavior must tend into satisfying objectives, depending on the rest of the agent’s response.
Depending on the agent in the game is the level of learning we want to apply. The classification of
environment properties would be[2]:
• Deterministic (Each agent’s actions have a simple, certified effect on the environment)
• Non-episodic (Performance of the agent is independent of what happens, only depends on his actions)
Agent Examples
7 Background 20
Communication is a crucial part for reaching objectives in a team. One of the advantages when
dealing with machines is that as long as the logic is well implemented the Agents will work on it (and as
long as the pay is good).
• Message that each object has to communicate with the database system.
• Methods where each hold the code to implement those messages, this ones are provided by the Brood
War API.
Subclasses can be made to a Unit Class, then the Subclass Marine Unit could inherit the variables
pertaining to Unit. Currently we have the information on our units (and buildings), information on the
enemy, and the objective.
Using the example provided by Witten[13] the Data Mining concern will be represented as The
StarCraft Problem; It will consist of a dataset that could be encountered in any given game. The informa-
tion we’ll have on hostile forces depends entirely on the information collected by scouts and our forces. Intel
collection from our forces will depend on certain units (such as Ghosts, Wraiths, and ComSat Stations).
Suppose our Army of Agents is pitted against a Zerg Force, and then our information collected will look
something like this.
This example is minimal because it doesn’t include each unit’s statistics and because it does not
include the hostile buildings. After this information is collected it is converted to rules:
If Ultralisk > 0 then send Air Units else send ground units or send > 45 Firebats (Fully Upgraded)
If Mutalisk > 1 then send Marines
1
If unit behind tree = 2 damage
This is a basic example of a decision list; it is a set of rules that is meant to be applied one after
another. The rules (either classification or association) rules must always be true. Since there is a lot of
math data to be included in the problem it allows the use of Statistical analysis. Predictions can be made
based on resources and the hostile unit we are facing, for example, if we are fighting a zergling with a firebat
7 Background 22
our success rate is higher than doing it with a marine. The purpose of data mining in this case is let our
computer decide which unit to send based on our base information, our resource capability, and the hostile
unit(s).
Making predictions automated in Data Warehouses is an emerging science[11], which is done by
applying advanced algorithms to our problem. He lists the most commmon techniques in Data Mining
are: Artificial Neural Networks, Decision Trees, Genetic Algorithms, Nearest Neighbor Method, and Rule
Induction.
To make predictions possible it is necessary to implement a system of algorithms the perform the
following:
1. Definition of the goals of the end user and the understanding of possible applications.
2. Creation of a new database or a subset of the current database on which to perform the algorithm.
3. Cleaning and pre-processing of the new database.
4. Transformation of the data in order to reduce the number of variables in the database and to produce
results more meaningful to the user.
5. Selection of the data mining method (clustering, classification, regression).
6. Selection of the data mining algorithm.
7.8 Multi-Agents
The types of Agents are: Simple Reflex Agents with Stimulus, Simple Reflex Agents with State, Goal Based
Agents and Utility Based Agents. The Communication between them is capable thanks to:
To communicate, Agent 1 proposes a course of action to Agent 2, as in real life, Agent 2 will
respond to this proposal either with agreement, couterproposal or disagreement. Motivation to make the
Agents do the objectives we want them to.
The starting point to the problem is defining a distributed constraint satisfaction problem[15]. To
solve a constraint satisfaction problem we apply a constraint satisfaction algorithm.
A CSP has a set of Variables (Xn ) in a Domain Di (which may be discrete or continuous)[2];
the domain is the set of possible values that the variable can take on. Our variables in this case are Hit
Points, Armor, Plasma Shield, among others. Constraints are given by allowing certain values for any given
variable during any given domain. For the StarCraft Problem constraints cannot be enumerated one by one
(the domain is continuous and also the variables).
In the case of distributed CSP, variables are given to different agents. Since most variables are
global (every unit and building has hit points for example), it is necessary to assign values of these vari-
ables to certain units. [15] discuss two types of algorithms are discussed, Domain-pruning algorithm &
Heuristic search algorithm.
The steps required to build a Multiagent not only depend on the communication part. Each agent
needs their own selfish objectives, of course there has to be a countermeasure or loophole for some units, for
example marines can do anything in any given game and because of this a good paying system and constraint
system must be implemented so in case there are no other units besides marines available.
Steps to design the agent[15]:
3. Make selfish agents that make each performs their task optimally.
7 Background 24
4. Implement Learning
5. Implement Communication
8 Hypothesis
• Allowing the Unit Types to communicate with each other will improve their survival rate compared to
removing the communication between them.
• Applying Multiagent Systems is feasible in terms of CPU & RAM usage compared to using a single
agent per unit.
• Implementing a Tactician Class will improve the success rate as well as the survival rate of the Unit
Classes compared to just a multi agent system.
9 Method
9.1 Data Mining State of the Art
In 2006 the IEEE International Conference on Data Mining identified the top ten algorithms for
Data Mining. C4.5 came out as the prefered one; it is a suite of algorithms, which are going to help classifying
our information based on the agent’s needs and algo it’s going to facilitate learning.[17] These algorithms,
based entirely on usage, provided no help to choosing the right one for the application. Since research in any
algorithm is going to be needed, the decision on choosing one is paramount, not only because data mining
is crucial, but also because the agents will communicate through this data base. Fuzzy Logic was applied
successfully into a medical database consisting of more than 3000 patients.[18]
A Neural Networks in combination with Fuzzy Logic approach to the data mining shall be imple-
mented for this problem given that it provides the ability to self-organize and great traits of learning, and
also because of the plenty of documentation to help its programming.[19] [20] [11]
To develop and grow evidence for our first hypothesis the next steps are required:
1. Develop an agent for each unit in each type of unit as a class in C++.
The sample will be three unit types, in this case marines, firebats, and medics. These classes were
chosen for strategy since the medic has different capabilities than the rest of the units. Data will be collected
by measuring the amount of CPU & RAM Percentage used by the agents. Each time the agent is pitted
against an enemy would be only 1 simulation. At least 95% of reliability is needed, so simulations will be
made to reach that option.
9 Method 26
Data will be presented in graphs. of CPU usage % vs Number of Simulations and RAM usage %
vs Number of Simulations. Also there will be a Graph of Survival Rate vs Number of Simulations to see if
the survival rate improves or decreases during Multiagent Systems vs Standalone Agent Systems.
The sample was selected because during the game those units are among the most used and they
have multiple uses, also because firebats can’t attack air units, and because medics can’t attack, adding
different aspects to our problem. The geographic area of the problem is simply the environment of the game.
The Boodwar API is the method to obtaining units from the videogame StarCraft. Functions are made
for every unit and every building, it is an important tool for the project and it’s important to mine the
valuable methods provided by the tool. This is going to be learned during the experimentation with the rest
of the objectives.
Each unit must have an agent structure to respond to problems, have certain constraints and pursue
their own objectives.
9 Method 27
Testing of Agents
It’s important that the individual agents be as efficient as possible, because when comparing a well
implemented agent against a multi agent system the difference in performance could diminish. For the
purpose of this study we want to discover the difference between using one or the other in terms of computer
usage.
Constraints, reactiveness, goals of the agents must be tested thoroughly and carefully to make them as
efficient as possible.
The main goal of the game should be given to only one person as in real life. Orders aren’t given to
every soldier, they are given to the sergeant and the sergeant briefs his soldiers accordingly.
9.2 Creating a Scout Class to gather information and put it in the database
The scout class is the information collector. The most important factor in Data Mining is the existence
of Data.
• Test System
• Expand System
• Test System
• Documentation
Number Task Dates
Jan-May 2011 Aug-Dec 2011 Jan-May 2012
Testing and Familiarization of the Broodwar
9 Method
1 API
2 Applying Agents to Units
3 Testing of Agents
[1] S. Ning and M. Yan, “Discussion on research and development of artificial intelligence,” in Advanced
Management Science (ICAMS), 2010 IEEE International Conference on, vol. 1, pp. 110 –112, 2010.
[2] S. Russell and P. Norvig, Artificial intelligence: a modern approach. Prentice hall, 2009.
[9] G. Weiss, Multiagent systems: a modern approach to distributed artificial intelligence. The MIT press,
2000.
[10] S. Tzu and S. Griffith, The art of war. Oxford University Press, USA, 1971.
[12] J. Han and M. Kamber, Data mining: concepts and techniques. Morgan Kaufmann, 2006.
[13] I. Witten and E. Frank, Data Mining: Practical machine learning tools and techniques. Morgan Kauf-
mann Pub, 2005.
[14] H. Teodorescu, D. Mlynek, and A. Kandel, Intelligent systems and interfaces. Springer Netherlands,
2000.
[15] Y. Shoham and K. Leyton-Brown, Multiagent systems: algorithmic, game-theoretic, and logical founda-
tions. Cambridge Univ Pr, 2008.
[16] B. Weber and M. Mateas, “A data mining approach to strategy prediction,” in Computational Intelli-
gence and Games, 2009. CIG 2009. IEEE Symposium on, pp. 140–147, IEEE, 2009.
[17] X. Wu and V. Kumar, The top ten algorithms in data mining. Chapman & Hall/CRC, 2009.
[18] T. Vamos, “Why fuzzy in data mining?,” in Uncertainty Modeling and Analysis, 2003. ISUMA 2003.
Fourth International Symposium on, pp. 46–49, IEEE, 2005.
BIBLIOGRAPHY 30
[19] L. Veelenturf, Analysis and applications of artificial neural networks. Prentice-Hall, Inc. Upper Saddle
River, NJ, USA, 1995.
[20] V. Rao and H. Rao, C++ neural networks and fuzzy logic. BPB publications, 2003.
[21] B. Krose and P. Smagt, An introduction to neural networks. Amsterdam: The University of Amsterdam,
1996.
Carta Compromiso
He revisado el trabajo final del alumno Claudio Bernardo Rodríguez Rodríguez, con matrícula 902138,
que lleva como título Application of Multiagent Systems in combination with Data Mining techniques to
simulate a War environment using RTS videogame StarCraft y considero que desde el punto de vista de
contenido tiene la calidad necesaria para ser un anteproyecto de tesis. Con base en lo anterior me
comprometo a ser el asesor de tesis de (solamente el nombre del alumno).
Atentamente