Multi-Agent Systems in Starcraft
Total Page:16
File Type:pdf, Size:1020Kb
Multi-Agent Systems in StarCraft by H.J. Griffioen and D. Plenge Project duration: April 18, 2016 – July 17, 2016 Supervisors: Dr. K. V. Hindriks, TU Delft, supervisor Ir. V. J. Koeman, TU Delft, client Dr. M. A. Larson, TU Delft, Bachelor project coordinator An electronic version of this thesis is available at http://repository.tudelft.nl/. Preface This report is submitted in partial fulfillment of the requirement for the degree of Bachelor in Technical Com- puter Science at the Technical University of Delft. This report concludes the Bachelor project for third year students. The project was coached by Dr. K. V. Hindriks, from the Delft University of Technology. All re- search and development took place at the Delft University of Technology, department of Electrical Engineer- ing, Mathematics and Computer Science. The project started at April 18th 2016 and finished at June 17th 2016. We would like to thank our coach Dr. K. V. Hindriks, for giving us this opportunity in helping out in improving the MAS-Project course and giving us good structural feedback over the course of the project. We would also like to thank our client Ir. V. J. Koeman, for helping us out when needed and for also providing us with very detailed feedback over the course of the project. H.J. Griffioen and D. Plenge Delft, June 2016 iii Summary The department Interactive Intelligence of the TU Delft offer the Multi-Agent Systems (MAS) project to first year computer science students. The goal of this project is for computer science students to learn about multi-agent systems by creating such a system for the game Unreal Tournament. The system is created by using GOAL, which is an agent programming language developed by the TU Delft. Unreal Tournament, the game that is currently being used in the project, does not challenge the computer science students enough to create a interesting strategy for the MAS. To encourage the computer science students to implement interesting strategies, it would be optimal to change the game to something more strategic. Therefore the department of Interactive Intelligence would like to switch the game for the course from Unreal Tournament to StarCraft. StarCraft is a real-time strategy game in which the player controls units which are used to defeat the opponent. During the project, the creation of a MAS for StarCraft using GOAL was made possible. In addition to the connector that was made to make this possible, a course manual was created that holds information about the learning goals of the course and the product that computer science students should achieve. Another interesting thing that puts StarCraft above Unreal Tournament is the Student StarCraft AI tourna- ment. Computer science students that excel would have the opportunity to join this tournament with their MAS and compete in the yearly battles. At the end of this project a fully functioning connector with all necessary tools and manuals is delivered. As well as a review of the robustness of the system. iv Contents 1 Introduction 1 2 Methodology 2 2.1 Workflow.............................................2 2.2 Quality Assurance.........................................2 2.3 Testing..............................................3 2.4 Agreements............................................3 2.5 Definition of done........................................3 I Research 4 3 Project 5 3.1 Problem Analysis.........................................5 3.1.1 Project Problem......................................5 3.1.2 Aim of the Project.....................................5 3.1.3 Challenges in the project..................................6 3.2 Why StarCraft Broodwar.....................................6 3.2.1 Why not StarCraft 2....................................6 3.3 Project Definition.........................................7 3.4 Existing solutions.........................................7 3.5 Requirements...........................................7 4 Education AND ABSTRACTION 10 4.1 Educational value......................................... 10 4.2 GOAL............................................... 10 4.3 Connector............................................ 10 4.4 Abstraction level......................................... 11 4.4.1 SSCAIT versus abstraction................................. 11 4.4.2 Abstractions........................................ 11 4.5 Conclusion............................................ 12 5 EnVIRONMENT 13 5.1 An API for StarCraft........................................ 13 5.2 Existing EIS connector...................................... 14 5.3 Existing bots........................................... 14 5.3.1 Protoss bot by Andrew Smit................................ 14 5.3.2 Zerg bot by Marian Devecka................................ 14 5.3.3 Terran bot by ICELab.................................... 15 5.3.4 Conclusion......................................... 15 II Design 16 6 Connector 17 6.1 Architecture............................................ 17 6.1.1 EIS............................................. 17 6.1.2 JNIBWAPI......................................... 18 6.2 Design.............................................. 19 v vi Contents 7 PERCEPTS AND ACTIONS 20 7.1 Percepts.............................................. 20 7.1.1 Types of percepts..................................... 20 7.1.2 Factors that influence the percept structure........................ 20 7.1.3 Optimisation........................................ 21 7.1.4 Problems.......................................... 21 7.1.5 Percepts for StarCraft................................... 22 7.2 Actions.............................................. 22 7.2.1 Considerations....................................... 22 7.2.2 Problems.......................................... 23 7.2.3 Set of actions for StarCraft................................. 23 7.3 Conclusion............................................ 24 8 DeVELOPMENT TOOLS 25 8.1 Features.............................................. 25 8.2 Design.............................................. 25 8.2.1 Robustness......................................... 26 III Implementation 28 9 System 29 9.1 Thread structure......................................... 29 9.2 Problems and solutions...................................... 29 9.3 Final system........................................... 30 9.3.1 Connector......................................... 30 9.3.2 Development tools..................................... 30 9.4 Abstraction level......................................... 30 9.5 Multi-agent systems....................................... 32 IV Education 34 10 Education 35 10.1 The MAS-Project......................................... 35 10.2 The learning goals........................................ 35 10.3 The StarCraft Course....................................... 36 10.3.1 Why StarCraft?....................................... 36 10.3.2 Individual assignment................................... 36 10.3.3 Performance targets.................................... 36 10.3.4 The end competition.................................... 37 V Quality 38 11 PERFORMANCE TESTING 39 11.1 Concurrent Agents........................................ 39 11.1.1 Test setup......................................... 39 11.1.2 Test results......................................... 39 11.2 Agent behaviour versus game speed............................... 40 11.2.1 Test setup......................................... 40 11.2.2 Test results......................................... 41 11.3 System run-time......................................... 41 11.3.1 Test setup......................................... 41 11.3.2 Test results......................................... 41 11.4 System and specifications..................................... 41 12 Code Quality 42 12.1 First SIG feedback......................................... 42 12.2 Improvements.......................................... 42 12.3 Second SIG feedback....................................... 42 Contents vii VI Conclusion AND RECOMMENDATIONS 43 13 Conclusion 44 14 FUTURE WORK AND Recommendations 45 14.1 Future work............................................ 45 14.2 Recommendations........................................ 45 VII Evaluation AND REflECTION 46 15 Evaluation 47 16 ReflECTION 48 16.1 Danny Plenge........................................... 48 16.2 Harm Griffioen.......................................... 48 VIII Appendix 49 A Project MANAGEMENT 50 A.1 Planning............................................. 50 B TERMINOLOGY 51 B.1 Micro............................................... 51 B.2 Macro............................................... 51 B.3 Kiting............................................... 51 B.4 Splitting.............................................. 51 B.5 Scouting............................................. 51 B.6 Proxy............................................... 51 B.7 Splash Damage.......................................... 52 C StarCrAFT 53 C.1 What is StarCraft......................................... 53 C.2 Real-Time Strategy........................................ 53 D EnVIRONMENT Manual 54 E Course MANUAL 100 F Original PROJECT DESCRIPTION 124 F.1 Project description........................................ 124 F.1.1 Final products....................................... 124 F.2 Company description....................................... 124 G UML 125 H SIG 129 H.1 First feedback........................................... 129 H.2 Second feedback......................................... 129 I Infosheet 130 BibliogrAPHY