Using Emergent Behavior to Improve AI in Video Games



Similar documents
Pacman 3D. Suggestions Multiple levels Powerups that let Pacman chase and eat Ghosts; ghosts need to respawn

All sessions were observed at each of the Academy Venues

Drills to Improve Football Skills 1

Team Defending. Understand the terms that describe the roles of players and parts of the field. The person you are marking.

SIMPLE CROSSING - FUNCTIONAL PRACTICE

Chunking? Sounds like psychobabble!

Computer Game Programming Intelligence I: Basic Decision-Making Mechanisms

Last Team Standing Creator GUIDE

Fusion's runtime does its best to match the animation with the movement of the character. It does this job at three different levels :

Lottery Looper. User Manual

Principles of Soccer

Graphical Environment Tool for Development versus Non Graphical Development Tool

My Favorite Futures Setups. By John F. Carter

Themes. Best wishes. Michael Beale Youth Development Officer

Mobile Ad Injector User Guide

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 9 The Game Engine

H ello, I ll be demonstrating

Tutorial: Creating Platform Games

Topic: Passing and Receiving for Possession

ACL Soccer 4 v 4 Small Sided Games (SSG s)

HOW TO ATTACK THE ZONE DEFENSE

This puzzle is based on the following anecdote concerning a Hungarian sociologist and his observations of circles of friends among children.

Hockey IQ Quiz. player by answering a few multiple choice questions.

Introduction. Below is a list of benefits for the 4v4 method

Kodu Curriculum: Single Session Intro

AGES 8+ b e g g i n ʼ f o r t h e b e a t USER S GUIDE

United Church of God An International Association. Level 2 Unit 4 Week 4 EIGHTH COMMANDMENT AND TENTH COMMANDMENT

hockeyplayerdeveloper.com

BrainMaster Macromedia Flash Player

Playing in a (Diamond Midfield)

Analysis of Micromouse Maze Solving Algorithms

Role-Play Activities. Establishing Role-Play Groups. Preparing for the Role-Plays 1/7. Note: As written, these

UNIVERSAL REMOTE CONTROL GUIDE

Elliott-Wave Fibonacci Spread Trading

BSc in Artificial Intelligence and Computer Science ABDAL MOHAMED

Project 2: Character Animation Due Date: Friday, March 10th, 11:59 PM

Brain-in-a-bag: creating an artificial brain

How to increase Bat Speed & Bat Quickness / Acceleration

14 Day Speed Training Challenge! Instructions. by AthleticQuickness.com

Introduction to nonparametric regression: Least squares vs. Nearest neighbors

10 FREE BASKETBALL DRILLS

Chapter 1 Time-Lapse Introduction and theory By E.M (Ted) Kinsman Rochester, NY June 2006

THE GREEK YOUTH PROGRAM: OFFENSIVE PHILOsOPHY

How to Build a Simple Pac-Man Game

Web Forms for Marketers 2.3 for Sitecore CMS 6.5 and

understanding sensors

DM810 Computer Game Programming II: AI. Lecture 11. Decision Making. Marco Chiarandini

A Client-Server Interactive Tool for Integrated Artificial Intelligence Curriculum

INTRODUCTION TO COACHING TEACHING SKILLS TEACHING/LEARNING. September 2007 Page 1

Intermediate PowerPoint

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

Agile Notetaker & Scrum Reference. Designed by Axosoft, the creators of OnTime the #1 selling scrum software.

6.2.8 Neural networks for data mining

After you complete the survey, compare what you saw on the survey to the actual questions listed below:

MovieClip, Button, Graphic, Motion Tween, Classic Motion Tween, Shape Tween, Motion Guide, Masking, Bone Tool, 3D Tool

Improving the Performance of a Computer-Controlled Player in a Maze Chase Game using Evolutionary Programming on a Finite-State Machine

Level 2 Routing: LAN Bridges and Switches

How To Assess Soccer Players Without Skill Tests. Tom Turner, OYSAN Director of Coaching and Player Development

HE learning and teaching: vision

Learn How to Create and Profit From Your Own Information Products!

Fish Chomp. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

Web Mining using Artificial Ant Colonies : A Survey

Key #1 - Walk into twenty businesses per day.

PUSD High Frequency Word List

20-30 minutes, can be used within a longer activity

Welcome to The Grid 2

A Framework of Context-Sensitive Visualization for User-Centered Interactive Systems

Tryout Drills. Feb 2014 v3 CORA. = goalie assessment drill

YMCA Basketball Games and Skill Drills for 3 5 Year Olds

Page 1 of 10. Fantastic Four Table Guide By ShoryukenToTheChin

Why use Cross-ice or Small-area games in practice?

Make your own Temple Run game

The fairy tale Hansel and Gretel tells the story of a brother and sister who

hockeyplayerdeveloper.com

News Writing: Lead Paragraphs

Helpful Information. The MK14 on MW3 requires the "rapid fire attachment" equipped on the weapon, without it you wont get the fastest speed possible.

Evaluating Software Products - A Case Study

After that you can log in and start creating games or playing existing games.

COACHING GOALS FOR U7 TO U10 PLAYERS

ios 9 Accessibility Switch Control - The Missing User Guide Updated 09/15/15

THE SME S GUIDE TO COST-EFFECTIVE WEBSITE MARKETING

Action settings and interactivity

Code Kingdoms Learning a Language

Learning Object-Oriented Design by Creating Games 1

AVOIDING FANSTASY GUNFIGHT TRAINING

Differentiation and Competition 13

Chapter 1 Introduction to Correlation

CATIA Tubing and Piping TABLE OF CONTENTS

Design Analysis of Everyday Thing: Nintendo Wii Remote

Scheduling. Getting Started. Scheduling 79

QUICK SETUP GUIDE: USB-MIDI Cubase AI4 / Motif XS Editor / Windows

FAQ Exodus Proxima Centauri 07/2013

Caring for the Stroke Patient from a patient perspective. Amy L. Heyden, RN, MS, ANP-BC, CNRN, SCRN

7 Ways To Explode Your Profits as a Tint Professional and Change your Life Forever!

Scratch Primary Lesson 4

Escalator to Pips Pipping Your Way to The Top

LEVEL II LEADERSHIP BENCH MANAGEMENT. January 2008 Page 1

Transcription:

Noname manuscript No. (will be inserted by the editor) Using Emergent Behavior to Improve AI in Video Games Janne Parkkila Received: 21.01.2011 / Accepted: date Abstract Artificial Intelligence is becoming more and more important in commercial video games. There are many different approaches on how to create intelligently behaving non-player characters. As mobile phone gaming is also gaining a lot of developers, the resource limitation of the platform make creation of the AI a little more complicated. In this paper is proposed and implemented a solution for creating intelligent behavior for simple alien-like enemies. The aliens itself follow a set of simple rules, but through these rules a somewhat intelligent behavior emerges. The approach is both easy to implement and does not require a lot of processing power, although the game AI works quite well. Keywords Emergent Behavior Video Games Artificial Intelligence 1 Introduction For a long time the game companies in video game industry have been competing with each other for paying customers. During the last few decades the most competed trick has been improving the graphics of the games. However, as the tools for making more realistic and visually stunning graphics have become more common, the industry needs to find new ways to gain interest of the customers as noted by Cass (2002). One topic that has been spoken about for a long time in the industry has been artificial intelligence. Although there have been different approaches and tries, the game industry still has not found a solution to the perfect game AI. As mobile phone game markets are on the rise, this brings new problems to the developers. Many of the AI techniques used are planned for fast computers or game consoles that are specialized only to games. To dodge the limitation of computational resources, this paper implements an AI that is based on emergent behavior, causing the enemies to display intelligent behavior with just few simple rules. The goal of this paper is to implement a swarming -type enemies for a shooter game that pose a threat for the player through the use of emergent behavior. The method for Janne Parkkila Universidad Polytcnica de Madrid E-mail: janne.parkkila@lut.fi

2 the creation of the behavior is similar to Lewis and Bekey (1992). The self-organization is used to search for the player, gather more enemies to team-up against the player and cause more trouble this way. A 2D shooter game is implemented for demonstration purposes of this emergent intelligence. The source-code for the game is available from http://japskua.wordpress.com The section two has a short insight on the literature on emergent behavior and game design. Section three contains the description of the game and the implementation of the artificial intelligence for the enemies. The section four contains short discussion on what happened and what could have been done otherwise. 2 Previous knowledge One of the problems related to realistic artificial intelligence in games is the implementation of more cognitive believable of the characters Dignum et al. (2009). One important part mentioned by Orkin (2006) is the implementation of believable and natural communication between characters. In F.E.A.R this was done by giving the AI information that is not available to the player. Also the use of special environmental characteristics can provide the illusion of cooperating characters, although they are only reacting to some environmental cue. However, this trick requires well defined environment and a decent amount of pre-programming. An interesting approach to emergent behavior was presented by Steels (1990) already some twenty years ago. In this approach the agents leave breadcrumbs to make a trail to the mineral deposits they are trying to find. The trail gets strengthened as more and more robots find the deposit and once the deposit has been harvested empty, the trail will also disappear. This approach leads to a good solution considering that the mineral deposit is stationary and the robots have to find the same route multiple times. Perhaps better approach towards emergent behavior in games was also presented around same time by Lewis and Bekey (1992). The proposal presented in that paper has same kind of problem as in a game situation. The multiple agents are trying to find a tumor which location is unknown in the start. They start with searching randomly and once an agent sees the tumor it starts to emit pheromone that draws other agents towards the source of the pheromone. Unlike in the approach by Steels (1990) in this case there is no need to travel between two locations - the only requirement is to find the tumor once and destroy it. This kind of approach was used for example in Half-Life 2 by Valve software. 3 The Game The game was implemented using python programming language (available from www.python.org) and pygame library (available from www.pygame.org) that contains different kinds of functions that are needed for game programming. The game was programmed completely from the scratch. The main goal of the program is to demonstrate the behavior of the aliens, so not much time was spent on the graphics. The game itself features a player controlled character, that can move around the screen and shoot with a gun. The enemies come in form of green aliens, that try to find the player and attack him by biting. The way they communicate, is by leaving

3 pheromones (blue dots) to the game area, that contains information about the location of the player character. 3.1 The AI The idea of the Artificial Intelligence is to create a simple emergent behavior for the aliens. They are considered to be quite simple and the method used is somewhat based on ideas presented by Steels (1990) and Lewis and Bekey (1992). One important thing to notice here is that the aliens cannot use direct communication to talk with each other. Because they are simple critter-like creatures, they cannot have telepathic abilities, as that could be felt cheating by the player. Thus the aliens should use pheromones to leave information to the environment and use this indirect way of communicating instead of telepathy. This approach also makes the AI easier to implement and probably less resource intensive. The Aliens have three modes: Search, Flee and Attack. In search mode the alien is trying to find the player in the game area. The alien has no knowledge of the environment around it and it does not gather any information about the level. Because of this, the alien is implemented to walk randomly until it sees anything of interest. If the alien in search state sees pheromones on the ground, it will start to follow the trail. In case the enemy sees the player, it will attack or flee, depending on the situation. There is a threshold related to the attack/flee behavior (as seen in the figure 1, points 3 and 4). If the alien sees other aliens nearby it will attack the player, but if it is alone, it will flee. The behind this kind of behavior is to make the aliens attack in pairs or groups. This way the player will have to fight a bigger bunch of aliens and has the sensation of challenge. In flee mode the alien is running away from the player. This might be triggered for example because of being outnumbered or heavy loss of health (in the implementation here, the fleeing depends solely on the number of aliens nearby). In flee mode the alien leaves pheromones behind, so that other aliens might find the player (or that the alien itself might find the way back to the player). The pheromones contain a direction, which points towards the player in order for the aliens to know which way to follow the trail. As the alien is running away from the player, the pheromones left point always to the opposite direction the alien is facing. In the attack mode the alien is charging towards the player, trying to attack it. This is done by getting to a close distance to player so the alien will be able to bite the player and deal damage in that way. The algorithm shown in figure 1 portrays the behavior of the aliens. The initial level is shown in the figure 2. It is just a plain level, with only the player and the aliens. The red circle around the aliens portrays the field of view of the enemies. However, as can be seen from the figure 2, the player has actually too much room to move around as well as the search space is too great a challenge for the aliens. It takes a significant amount of time for the aliens to find the player (but because of the randomness, this is not always true). Also, the pheromone trail stayed alive for a very long time and once the aliens found the trails, they did not point to the current location of the player anymore and tended to be quite long. As a solution to these problems, there had to be a time-out on the pheromones. A timer was added, that would make the pheromones to disappear after certain amount of seconds had passed. This way the pheromones no longer led to empty places nor

4 Fig. 1 The initial algorithm Fig. 2 The intial game were dozens of pheromones long. Another addition that can be seen from the figure 3 was the addition of the walls. Because this kind of shooter games usually happen in tight, closed spaces, the playing area was divided into smaller rooms. The rooms reduce the search space for the aliens significantly, so they were able to find the player within the room quite quickly. The running movement of the player is also restricted within the rooms and there are only few doorways leading out from each of the rooms. The changes led to faster search times for the aliens and better challenge for the player. However, as the alien fled from one room to another leaving a trail of pheromones behind the player was still able to run away. Once the aliens came back, the trail was a dead-end. Also in cases when the aliens attacked the player, other aliens nearby still just kept searching and did not react to the attacking aliens nearby. To fix the problem, another type of pheromone was added to the game. These red pheromones are left when the alien switches to attack behavior. In attack mode it leaves pheromones that point towards the way it is moving (as opposite to the fleeing pheromones). Now when the alien goes into attack mode, it gather other aliens on it s route to also attack the player. In the case where the player decides to run away, the enemies keep following and leave a trail that gathers even more aliens to join the

5 Fig. 3 The game after adding walls Fig. 4 The final version of the game attack. This means, that if the player runs around the whole game level with only one alien pursuing in the beginning, the player will end up with all the aliens in the current level following him. The final version of the implementation can be seen from the figure 4. 4 Conclusion A good aspect of emergent behavior is it s simplicity to implement. With just a couple of simple rules it is possible to create intelligently performing agents. However, as can be seen well in this paper, the design stage is somewhat complicated. Even though the end goal was clear in the beginning, the behavior rules had to be adjusted a little. The aliens behaved less smartly than they were supposed to. The positive thing was

6 that adjusting the behavior was quiet easy, because of the simplicity of the behavior rules. One good side of the emergent behavior and the simplicity is the low amount of processing power required. Dozens of aliens can be running at the same time on the screen without the loss of frame rate (one thing to remember though is that the graphics are not that complicated either). With some optimization it would probably be possible to gain even better performance than there currently is. However there still remains more tweaking possibilities to be done for the aliens. They don t seem to recognize the pheromones really well so there could be a bigger area effect on the pheromones. Other possible implementation could be to make the aliens scream when they attack the player. This way the scream might attract other aliens nearby (for example within the same room) to join the attackers. References S. Cass, Mind games [computer game ai]. Spectrum, IEEE 39(12), 40 44 (2002). doi:10.1109/mspec.2002.1088444 F. Dignum, J. Westra, W.a. van Doesburg, M. Harbers, Games and Agents: Designing Intelligent Gameplay. International Journal of Computer Games Technology 2009, 1 19 (2009). doi:10.1155/2009/837095. http://www.hindawi.com/journals/ijcgt/2009/837095.html M.A. Lewis, G.A. Bekey, The Behavioral Self-organization Of Nanorobots Using Local Rules, in Intelligent Robots and Systems, 1992., Proceedings of the 1992 leee/rsj International Conference on, vol. 2, 1992, pp. 1333 1338. doi:10.1109/iros.1992.594558 J. Orkin, Three states and a plan: the AI of FEAR. Game Developers Conference, 1 18 (2006) L. Steels, Cooperation Between Distributed Agents Through Self-organisation, in Intelligent Robots and Systems 90. Towards a New Frontier of Applications, Proceedings. IROS 90. IEEE International Workshop on, 1990, pp. 8 14. doi:10.1109/iros.1990.262534