Miss PacMan AI Controller For IEEE CIG 2010 – Ms.PacMan Competition AmirHossein Sojoodi, Mahsa Asadi Shiraz University Introduction This Agent, Miss PacMan is developed in Java to play Ms. PacMan, presented in http://www.webpacman.com . U U Figure 1. Sample shot of web Pac-Man How to run? To run the controller double click on the .jar file and you will see two windows (board window and Direction window). Figure 3. Sample processed board 1 By running web Pac-Man, if parameter setting is performed properly the controller will show the board containing pills, power pills, ghosts, Miss PacMan and all the walls. Figure 3 shows a sample of a processed board of the game. Figure 3. Sample processed board NOTE: position of the game window shouldn't change during the game. If any object is not recognized in the game it means that the colors are not set correctly. We have set the colors based on the specified game controller as follow: black = -16777216; blinky = -65536; pinky = -18689; // pinky = -18210 inky = -16711681; // inky = -16711714 sue = -18859; // sue = -18316 pacMan = -256; edible1 = -14605858;// edible1 = -14408449; edible2 = -1776412; scoreColor = 14342911; pill[] = { -2434305 /* -2171170*/, -2434305 /*-2171170*/, -256, -256, -256, -65536, -65536, -65536}; walls[] = { -18281 /* Level 1*/, -18281/* Level 2*/, -12076834, -12076834,-12076834, -2189497, -2189497, -2189497}; Please try to modify those parameters in red if any change occurred in the color set of the game. In order to change these parameters you can modify file named "colors.txt" which is next to the main jar file. They are in the same order as set above. 2 Software Agent: We have two parts which are Image processing and action selection. They are combined in main (In MissPacMan class) by using a loop and doing image processing and Action selecting one after each other. Image Processing Part We used the provided Connected set implementation and added some required parts. The processor searches in the whole board to find one of the known objects and updates the whole board (an array) after each screen shot. Selecting Action Miss PacMan acts greedy! Three states are defined for Miss PacMan and she evaluates all possible moves according to its current state and chooses the best among them. • Escape: The condition in which Miss PacMan tries to escape from the ghosts. • Hunting: In this state Miss PacMan has eaten the Power Pill and can chase the ghosts; therefore, she tries to eat as many ghosts as possible. • Safe: when ghosts are not very closed to Miss PacMan and she is not in hunting state. She thus tries to eat more and more pills to reach next level. We have used Floyd-Warshall algorithm to compute distance between each couple of nodes in the board. Results: We have reach maximum of 24890 with the average of 12000 till now and the agent is improving. Acknowledgements: Special Thanks to Ms.Fateme Torabi Asr for her great contributions in the work and also Dr.Zohreh Azimifar for her wonderful supports. 3
© Copyright 2024 Paperzz