{"id":338,"date":"2015-10-19T22:13:31","date_gmt":"2015-10-19T22:13:31","guid":{"rendered":"http:\/\/magiteker.com\/?post_type=jetpack-portfolio&#038;p=338"},"modified":"2015-10-24T08:17:23","modified_gmt":"2015-10-24T08:17:23","slug":"ms-pac-man-ai","status":"publish","type":"jetpack-portfolio","link":"https:\/\/magiteker.com\/index.php\/portfolio\/ms-pac-man-ai\/","title":{"rendered":"Ms. Pac-man AI"},"content":{"rendered":"<p style=\"text-align: justify;\">Utilizing the Java framework provided by the <a href=\"http:\/\/www.aisb.org.uk\/news\/138-mspacman2012\">pacman vs ghosts competition<\/a> myself and a teammate wrote AI controllers for both the player and ghost agents. In order to control the player agent a state machine architecture was employed. The states defining player behavior were divided between keeping the player alive, by avoiding the ghost enemies, and seeking out remaining pellets on the game grid. The transition between these two strategies depended largely on the Euler distance between the player agent and ghosts, as the distance increased the player AI would increase its threat level and switch to its survival states. Once the threat level was low enough the player AI would then revert back to seeking out pellets.<\/p>\n<p style=\"text-align: justify;\">The next page contains a sample of the controller and state machine classes used to direct the player agent.<br \/>\n<!--nextpage--><\/p>\n<p style=\"text-align: justify;\"><strong>Player Controller Class:<\/strong><\/p>\n<p style=\"text-align: justify;\">[snippet id=&#8221;42&#8243;]<\/p>\n<hr \/>\n<p style=\"text-align: justify;\"><strong>State Machine Class:<\/strong><\/p>\n<p style=\"text-align: justify;\">[snippet id=&#8221;45&#8243;]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Utilizing the Java framework provided by the pacman vs ghosts competition myself and a teammate wrote AI controllers for both the player and ghost agents. In order to control the player agent a state machine architecture was employed. The states defining player behavior were divided between keeping the player alive, by avoiding the ghost enemies, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":342,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"jetpack-portfolio-type":[46,38],"jetpack-portfolio-tag":[44,43,35],"class_list":["post-338","jetpack-portfolio","type-jetpack-portfolio","status-publish","format-standard","has-post-thumbnail","hentry","jetpack-portfolio-type-ai","jetpack-portfolio-type-project","jetpack-portfolio-tag-ai","jetpack-portfolio-tag-java","jetpack-portfolio-tag-project"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":344,"url":"https:\/\/magiteker.com\/index.php\/portfolio\/book-of-math\/","url_meta":{"origin":338,"position":0},"title":"Book of Math","author":"Frank O'Hanlon","date":"October 22, 2015","format":false,"excerpt":"Book of Math is a game where the player uses their math skills to attack and defend. The quicker the player solves the math problem the greater their chances will be during combat. This was a team project for CS160: Game AI, taught by Professor Michael Mateas. The game concept\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/magiteker.com\/wp-content\/uploads\/2015\/10\/BOM3.png?fit=796%2C457&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/magiteker.com\/wp-content\/uploads\/2015\/10\/BOM3.png?fit=796%2C457&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/magiteker.com\/wp-content\/uploads\/2015\/10\/BOM3.png?fit=796%2C457&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/magiteker.com\/wp-content\/uploads\/2015\/10\/BOM3.png?fit=796%2C457&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":183,"url":"https:\/\/magiteker.com\/index.php\/portfolio\/blast-orbz\/","url_meta":{"origin":338,"position":1},"title":"Blast Orbz","author":"Frank O'Hanlon","date":"October 8, 2015","format":false,"excerpt":"Blast Orbz is a billiards style puzzle game. The player must collide colored balls into each other in order to eliminate them. The faster the player eliminates the balls the better their score will be. Players scores are saved using Google Play leader boards. This is currently free for download\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/magiteker.com\/wp-content\/uploads\/2015\/10\/blast_orbz_logo.png?fit=519%2C210&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":45,"url":"https:\/\/magiteker.com\/index.php\/portfolio\/siegebreakers\/","url_meta":{"origin":338,"position":2},"title":"Siegebreakers: Level Editor","author":"Frank O'Hanlon","date":"September 26, 2015","format":false,"excerpt":"\u00a0\u00a0 Siegebreakers is a multiplayer hack and slash base defense game implemented in C-Sharp. This project represents the total work of myself and eleven other UCSC students. The core mechanic that makes this game so engaging is the AI Director system that is responsible for scaling game difficulty for the\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio"}],"about":[{"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/types\/jetpack-portfolio"}],"author":[{"embeddable":true,"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/comments?post=338"}],"version-history":[{"count":1,"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/338\/revisions"}],"predecessor-version":[{"id":341,"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/338\/revisions\/341"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/media\/342"}],"wp:attachment":[{"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/media?parent=338"}],"wp:term":[{"taxonomy":"jetpack-portfolio-type","embeddable":true,"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-type?post=338"},{"taxonomy":"jetpack-portfolio-tag","embeddable":true,"href":"https:\/\/magiteker.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-tag?post=338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}