StrathPac - An Automated Player for Ms. Pac-Man L. Kelly, L. Dicken, J. Levine Department of Computer and Information Science University of Strathclyde Introduction This paper describes a software agent designed to play the arcade game Ms. Pac-Man. This game provides two major challenges in its environment which governed the approach taken in this agent, namely the consistent map layouts which allowed for application of search techniques to reason about the agents current situation and also the non-determinism and rapid change presented by ghost movements, which preclude a purely deterministic agent (for example, one with pre-set paths to follow, which would work well in the original Pac-Man), instead requiring a more intelligent approach.

Execution This agent was developed and tested using the implementation of Ms. Pac-Man found on http://www.webpacman.com and version 1.6 of the Sun SE JVM. To run the agent, ensure that a Ms. Pac-Man game is completely on screen and unobscured then run this command from PacAgent/bin: java Main The agent will then find the game, cause a mouse click event over it to give it keyboard focus, add coins and start the game. If for some reason the game does not have keyboard focus or loses it during operation it should be regained manually. The agent begins by analysing the layout of the map via a screen scraping technique and abstracting this to a grid of 28 by 31 squares each representing an 8 by 8 pixel area, offset such that each pill lies in the centre of a square. Every grid square which it is possible for Ms. Pac-Man to reach is then further abstracted to form a roughly 300 node graph which the agent uses to reason about its environment using the methods described below. It is worth noting that this graph structure treats the tunnels at the side of a map as it does any other connected nodes but does not account for the 'ghost-slowing' effect they have. Once this initial setup is complete, the agent then executes the following loop repeatedly:

• Screen scrape: The agent captures the section of the screen containing the Ms. Pac-Man game and •



examines it for the locations of the ghosts and Ms. Pac-Man as well as checking which grid squares still contain pills. This information is used to update the game state for use in the next section. Reason: The agent then uses the game state and the graph structure to apply an adapted breadth first search which accounts for distance from ghosts and the points value of game objects (edible ghosts have priority over pills for example) to create a path for the agent to follow in game. See fig 1. for an example of such a path. Actuate: Pass the resulting path to the actuator, which will control Ms. Pac-Man by triggering key press events.

Figure 1. - StrathPac's UI Highlighting the Path Planing System

Controller Logic The agent presented here was designed with the purpose of maximising its score in a single game of Ms. PacMan. To achieve this, it acts towards two occasionally conflicting goals:

1. Achieving an optimal score for each level. 2. Completing a level while avoiding capture by the ghosts. These goals offer two alternative approaches to collecting points in a game of Ms. Pac-Man, either taking risks to achieve high scores in early levels or playing it safe for as long as possible and hoping to gain points while doing so. The next sections will explain the extent to which these approaches were used and provide justifications for this design. As the levels of Ms. Pac-Man become progressively more difficult and because capturing ghosts offers so many points (in particular all four in a single power pill which will result in a total of 3000 points) in comparison to simple pill sweeping, it is clear that correct use of power pills is key to maximising score. However, achieving an optimal score - that is, by consuming all four ghosts on each power pill - is a difficult

and potentially risky task. An agent must choose to activate the power pill at the correct time so that it can reach all the ghosts before the effect wears off, but in doing so should not allow itself to be caught by a ghost while waiting for an ideal situation. For this reason the Ms. Pac-Man agent operates under 'modes' based on the current goal it is pursuing. These modes are:

1. Hunting Ghosts. 2. Progressing through level. The primary concern of mode 2 is survival and collecting pills is considered secondary to this. In this mode the agent will progress to the nearest safe pill using a modified breadth first search which accounts for the threat the ghosts pose to a given location based on their distance to it. Left permanently in this mode the agent will clear the map of pills and move onto the next, so while in this mode the agent is waiting for an opportunity to switch into hunting mode. The agent decides when best to do this based on its distance to the ghosts and the reachability of the nearest power pill. Based upon this information it may decide to 'pill-park', (that is wait near a power pill until it is ready to consume it.) to consume the power (possible after having spent some time parking) or to continue pill sweeping until the situation changes. In hunting mode the agent prioritises only consuming edible ghosts and avoiding non-edible ones (the result of a consumed ghost visiting the pen and re-entering the game). It does this because of the limited time in which it has before the effects of the power pill wear off and the high points value associated with capturing ghosts. As mentioned previously, there are risks in chasing ghosts and when the effects of the power pill do wear off the ghosts become dangerous again and potentially closer than they would normally be in mode 2 due to the fact the agent was previously chasing them. For this reason, the agent will switch back into mode 2 when it deems it unprofitable to continue to chase edible ghosts (when they are both distant and about to become inedible for example.)

Limitations Our approach suffers from a fundamental limitation at this point, in that it is not aggressive enough when it eats a power pill - it will frequently ignore a ghost that would have been easy to kill in favour of eating additional pills. This is a major deficiency since the majority of the score is gained by sequential killing of ghosts in a single power pill as noted above. This means that the importance of making such a clean sweep cannot be overstated, but at the current time our agent is unable to do this. This is largely due to the current tuning of the prioritisation of the goals, but also in part caused by the inability of the agent to accurately gauge where the ghosts are heading and intercept them efficiently, instead attempting to follow behind them until it has caught up to them. There is a trade-off here between runtime and quality of results - our current agent does not strike this balance appropriately.

Conclusions In this paper we have presented our approach to designing an intelligent and robust agent capable of playing Ms. Pac-Man. Although this system has certain weaknesses (detailed above), it has been developed from the ground up to provide an extensible, efficient player capable of making rational decisions in a fast-paced environment. In this we believe we have had a degree of success, although there remains considerable scope for improvement.

StrathPac - An Automated Player for Ms. Pac-Man

layouts which allowed for application of search techniques to reason about the agents ... square. Every grid square which it is possible for Ms. Pac-Man to reach is then further abstracted to form a ... a power pill until it is ready to consume it.

99KB Sizes 3 Downloads 115 Views

Recommend Documents

Majas pacman man.pdf
Page 1 of 2. Majas pacman-hat (man). Sizes: Man (Fits head circumference 56 to 61). Yarn: Dalegarn Freestyle / Drops Nepal (100g main color, 50g other ...

using simio for the specification of an integrated automated weighing ...
This paper focuses on the use of a discrete simulation tool (SIMIO) in the logistic system design of a ce- ment plant. ... This specification will then help the design phase of the whole plant and will contribute for the ra- ... more than 50 tons of

Majas pacman man.pdf
Page 1 of 2. Majas pacman-hat (man). Sizes: Man (Fits head circumference 56 to 61). Yarn: Dalegarn Freestyle / Drops Nepal (100g main color, 50g other color/colors). Needles: circular needles 4 mm and 4.5 mm. Double pointed needles 4.5 mm. Worked in

An Automated Method for Circular-Arc Metro Maps
Email: [email protected]. †. TU Eindhoven, The Netherlands. Email: 1a.i.v.goethem,w.meulemans,[email protected]. ‡. Universität Osnabrück, Germany. Email: [email protected]. I. INTRODUCTION ... places two arcs

An automated environment for soils- and terrain-dependent applications
applications dependent on information related to soil types and terrain of the project site. ... The user may also develop cross sections of soil layers in any.

An Automated Interaction Application on Twitter - GitHub
select the responses which are best matches to the user input ..... the last response when the bot talked about free ... User> go and take control the website that I.

Improving English Pronunciation: An Automated ... - Semantic Scholar
have set up call centers in India, where telephone operators take orders for American goods from. American customers, who are unaware that the conversation ...

Automated Methods for Evolutionary Pavé Jewellery Design
Jan 15, 2006 - Keywords Jewellery design, evolutionary algorithm, aesthetics, ..... Whilst the more natural application of this algorithm might appear to be in ...... to aid in the automated construction of Pavé jewellery exist, although at a price.

Automated Device Pairing for Asymmetric Pairing Scenarios
5. Prior Work. ▫ Seeing-is-Believing by McCune et al. [Oakland'05] o Based on protocol by Balfanz et al. [NDSS'02]. A. B pk. A pk. B. H(pk. A. ) H(pk. B. ) Insecure Channel. ▫. Secure with: o. A weakly CR H() o. An 80 bit permanent key o. A 48 bi

Evaluation of an automated furrow irrigation system ...
crop (63.14 kg/ha/cm) was considerably higher than of conventional method (51.43 kg/ha/cm). Key words ... no need to go to the field at night or any other ...

An automated GPS-based prompted recall survey with learning ...
of automated activity type, location, timing and travel mode identification routines, GPS-based prompted recall surveys allow a larger number of more complex ...

Automated Device Pairing for Asymmetric Pairing Scenarios
10. Notations- Adversarial Model. Adopted from Canetti and Krawczyk [EUROCRYPT, 2001]. .... Receiver functionality is implemented on the laptop computer.

Automated Architecture Consistency Checking for ...
implementation, design documents, and model transformations. .... of the same stage of a software development process, e.g., comparing UML sequence.

Automated Screening System For Acute Myelogenous Leukemia.pdf ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Automated ...

Automated Screening System For Acute Myelogenous Leukemia ...
Loading… Whoops! There was a problem loading more pages. Whoops! There was a problem previewing this document. Retrying... Download. Connect more apps... Automated Sc ... mia ieee.pdf. Automated Scr ... emia ieee.pdf. Open. Extract. Open with. Sign

Im2Calories: towards an automated mobile ... - Research at Google
“DeepLab” system from [6].10 This model uses a CNN to provide the unary potentials .... tectors (the multi-label classifiers) to the Android mobile phone system.

Automated indicators for behavior interpretation
of carried objects. The contribution of this article is two-fold: • Trajectory-based behavioral indicators. We deduce automatically group trajectories and interac- tions between ... Moving objects are detected automatically from range-. Doppler pro

Digital and Automated Ebulliometer for wines_29jan11 compr.pdf ...
Digital and Automated Ebulliometer for wines_29jan11 compr.pdf. Digital and Automated Ebulliometer for wines_29jan11 compr.pdf. Open. Extract. Open with.

An Automated Behavioral Measure of Mind Wandering during ...
This research was supported by the National Science Foundation (NSF) (DRL 1235958 ..... applications, particularly in human-computer interaction, where the goal is for intelligent ...... AttentiveLearner: Improving Mobile MOOC Learning via.

Design and Fabrication of an Automated Microchip ...
Jan 19, 2007 - [email protected] or [email protected]. Analytical ... also provided an automated process for cell motion measurements, based on.

An Automated Behavioral Measure of Mind Wandering during ...
This research was supported by the National Science Foundation (NSF) (DRL .... be more congruous with the course of naturalistic reading than probing. 1.2. ... consistency of the gaze-based mind wandering detector by computing .... Eye gaze data was

Jaya Holdings An interesting player to watch
Ontario: Blakes Extra-Provincial Services Inc., Suite 2800, 199 Bay Street, Toronto, Ontario M5L 1A9. Prince Edward Island: Stewart McKelvey, 65 Grafton Street, ...

Finding Sensitive Accounts on Twitter: An Automated ...
Web and Social Media (ICWSM 2016). 655 ... our data sets all accounts that have no friends and followers or haven't posted a .... after our initial data gathering.