An Evolutionary Algorithm Approach for a Real Time Strategy Game

An Evolutionary Algorithm Approach for a Real Time Strategy Game

SBC - Proceedings of SBGames 2012 Computing Track – Full Papers AN EVOLUTIONARY ALGORITHM APPROACH FOR A REAL TIME STRATEGY GAME Rodrigo de Freitas Pereira Claudio Fabiano Motta Toledo Marcio Kassouf Crocomo Eduardo do Valle Simões University of São Paulo, SSC, ICMC, São Carlos, SP, Brazil Figure 1: The user interface of the BOS War game Abstract engines that lead players closer to the game environment [Bittencourt and Osório 2006]. The present paper reports the preliminary results of the Another factor about the realism in games that has application of an evolutionary algorithm developed to received special attention in the last years is the adjust artificial intelligence scripts in a real time artificial intelligence (AI) [Millington 2007]. And, strategy game. The evolutionary algorithm (EA) is more specifically, intelligent scripts responsible to embedded in the game engine of the Bos Wars, which control the decision-making process for non-player is a real time strategy game coded in C++ and LUA characters (NPCs). A well planned AI script should be language. The proposed algorithm is an adaptation of a able to provide gaming experiences against NPCs that similar approach introduced in [Crocomo 2008], which are more similar to playing against other human was applied to the battle system of a Role Playing players. In that case, real time adaptation of the NPCs Game. A tailor-made representation of the individual behavior to player strategies can increase the level of chromosomes is proposed, as well as a set of new entertainment [Ponsen et al. 2007]. genetic operators. The computational results indicate a In [Sweetser 2002], several AI techniques applied superior performance of the scripts produced by the to programming game scripts are reported, such as presented evolutionary algorithm when playing against fuzzy logic, flocking, decision tree, finite state the set of the standard scripts available in Bos Wars machines, artificial neural network and evolutionary [2010]. algorithms. The finite state machines (FSM) have been most frequently used to implement AI in games, since Keywords: Artificial Intelligence, Evolutionary they are relatively easy to code and understand, and Algorithm, Real Time Strategy Games usually they are able to hit the objective proposed in the game [Sweetser 2002]. However, FSM can make Authors’ contact: the game strategy predictable leading the players to [email protected], [email protected], lose interest early. [email protected], [email protected]. The use of evolutionary algorithms (EAs) to provide AI scripts, in the other hand, is advantageous according to Lucas and Kendal [2006] due to its 1. Introduction natural adaptability that allows them to generate different and unpredictable strategies. For this reason, The game industry innovates constantly to satisfy its the motivation for using EAs as the game AI goes customers. It is already possible to play using sensors beyond making the computer win or lose. Since EAs that detect movement and a lot of effort has been spent give the computer the ability to create strategies that to allow massive multiplayer matches. There have been sometimes outperform the player current abilities, it also advances in the degree of realism with the forces the player to create new strategies, improving development of sophisticated audio and graphics the overall ability to entertain of the game. XI SBGames – Brasiliá – DF – Brazil, November 2nd - 4th, 2012 56 SBC - Proceedings of SBGames 2012 Computing Track – Full Papers The skills of the human player can also be many variations of AI whereas it is impossible by a improved by evolutionary algorithms as reported by human in a short amount of time [Posen et al. 2007]. Smith et al. [2010]. The authors argue that the use of The on-line learning makes possible the adaptation evolutionary algorithms as AI by NPC improved the of behaviors used by NPCs during the gameplay, human player abilities more than playing against other according to the actions performed by a player humans. [Spronck et al. 2004]. In this context, the present paper proposes a novel An EA is also applied by Smith et al. [2010] on a EA that can be used to program scripts to control the RTS game. The aim of this EA is to define simple AI for a Real Time Strategy (RTS) game called Bos tactics spatially oriented to control the overall strategy Wars. This is a game that demands resource of game NPCs. The authors verified that players were management and action planning to attack other able to develop creative strategies that were effective opponents. A screenshot of the Bos Wars game is against these tactics when playing against the presented in Figure 1. evolutionary algorithm. They argue that the learning The developed EA is an adaptation of the process was more effective in this way than playing evolutionary algorithm presented in Crocomo [2008] against human opponents. that was applied to optimize NPC behavior in a Role- The behavior of NPCs was also improved by Jang Playing Game (RPG). However, this algorithm was et al. [2009] using an evolutionary algorithm in a RTS modified to incorporate a tailor-made representation of game. The algorithm is used to make decisions about individuals, as well as specific initialization, mutation what actions should be executed. The authors and crossover operators. developed a game called Conqueror, where the The paper is organized as follows. The related computational tests showed a superior performance of works are presented in Section 2 and the RTS game the proposed method. Bos Wars is described in Section 3. The proposed EA Crocomo [2008] proposed an EA as the AI for a is detailed in Section 4 and the results found are Role Playing Game (RPG) based on the Baldur’s Gate reported in Section 5. The conclusions follow in game. The EA individuals (or chromosomes) encode Section 6. rules that have to be executed by the NPC through the matches. These actions are selected from a data base of 2. Related Works rules previously defined. The implemented EA presented good results in the game online learning, Appolinario and Pereira [2007] developed a game despite the statements presented by Spronck et al where a tank must reach a target avoiding randomly [2006]. inserted obstacles. The authors applied an EA to In this paper, we use an EA based on the one execute actions for this tank. An individual is coded as developed in [Crocomo 2008], where the EA was a sequence of actions which are defined by several divided in three steps: generate initial population, possibilities of tank rotation. This is different from the evaluate individuals and generate the next population. proposal of this paper, since our objective in the Bos In the former EA, each individual has a chromosome Wars game is to generate strategies for controlling that stores game rules. These rules are executed during multiple individuals, considering that basic individual the battles by the NPCs and they are chosen from a set behaviors, such as path finding, is solved by the game of rules previously defined. The rules consist of basic engine. actions such as attack, move, drink potion or cast spell. Spronck et al [2006] proposed a method called The initial population was formed by 4 individuals Dynamic Scripting (DS) to be used in online learning generated by a tournament, where the best individual for games. The authors say that EAs lack the necessary was always kept in the next population. The other 3 qualities needed by an algorithm to be applied in the individuals of the next population were obtained online learning of commercial games. executing a uniform crossover between the best Ponsen et al. [2007] proposed an EA as a learning individual and each one of the other individuals. routine in a RTS game called Wargus1. Each individual The EA approach in the present paper is is represented by 20 building states and a set of actions responsible for the game online learning. In doing so, is determined from each construction type defined by we aim to expand the results from [Crocomo 2008], each state. Although an EA is used by the proposed AI, showing that EAs can also be successfully applied to it is responsible for off-line learning in the game, the online learning of RTS games. This is also a meaning that the evolutionary process occurs before different approach than the EA developed in [Ponsen et the game begins. The Dynamic Scripting algorithm is al. 2007], which does not deal with online learning. used for online learning, i.e., during the match. Another goal of this project is to create a new AI The off-line learning consists in the acquisition of strategy for the Bos Wars Game, which is an open knowledge by the NPCs without contact with a player, source RTS game. In doing so, we intend to contribute it can be done before the game release and it can test to other academic researches, which will be able to test other learning strategies against the one reported on this paper. 1 Wargus. Available in :< To sumarize the main contributions of this paper, we https://launchpad.net/wargus>.[Accessed 16 December may highlight: i) the generalization of the EA proposed 2011] in [Crocomo 2008] to a different type of game (from XI SBGames – Brasiliá – DF – Brazil, November 2nd - 4th, 2012 57 SBC - Proceedings of SBGames 2012 Computing Track – Full Papers RPG to RTS) and ii) the creation of an AI for the Bos repeated times in a loop until the game is over. This Wars game, which is an open source game that can be looping is used to keep the NPCs executing different used as a test platform for new AI techniques actions during the gameplay.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us