<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Master Baboon &#187; Python</title>
	<atom:link href="http://www.masterbaboon.com/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.masterbaboon.com</link>
	<description>The sea of the simulation</description>
	<lastBuildDate>Wed, 16 Jun 2010 22:50:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PacMan capture-the-flag: a fun game for artificial intelligence development and education</title>
		<link>http://www.masterbaboon.com/2009/09/pacman-capture-the-flag-a-fun-game-for-artificial-intelligence-development-and-education/</link>
		<comments>http://www.masterbaboon.com/2009/09/pacman-capture-the-flag-a-fun-game-for-artificial-intelligence-development-and-education/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 17:55:03 +0000</pubDate>
		<dc:creator>pietro</dc:creator>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[PacMan capture-the-flag]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[PacMan]]></category>

		<guid isPermaLink="false">http://www.masterbaboon.com/?p=260</guid>
		<description><![CDATA[At the beginning of September I&#8217;ve been invited to teach at a summer school about scientific programming. The whole experience has been really rewarding, but it was the student&#8217;s project that got me going: we had the students write artificial intelligence algorithms for the agents of a PacMan-like game, and organized a tournament for them [...]]]></description>
			<content:encoded><![CDATA[<p>At the beginning of September I&#8217;ve been invited to teach at a<a href="http://www.g-node.org/python-summerschool-2009" target="_blank"> summer school about scientific programming</a>. The whole experience has been really rewarding, but it was the student&#8217;s project that got me going: we had the students write artificial intelligence algorithms for the agents of a PacMan-like game, and organized a tournament for them to compete against each other.</p>
<p>The <strong>PacMan capture-the-flag game</strong> has been written originally by John DeNero, and has been used to teach an artificial intelligence course <a href="http://inst.eecs.berkeley.edu/~cs188/sp09/information.html" target="_blank">by him at Berkley</a> and by Hal Daume III at <a href="http://www.cs.utah.edu/~hal/courses/2009S_AI/" target="_blank">University of Utah</a>. Very often, this kind of games have a single strategy that dominates all others, and once you find it the interest fizzles out. In this case, I was impressed by how rich this game is. The game offers a lot of opportunities to develop and test complex learning and planning algorithms, including cooperation strategies for games with multiple agents.</p>
<p><img class="aligncenter size-large wp-image-264" title="capture_the_flag" src="http://www.masterbaboon.com/wp-content/uploads/2009/09/capture_the_flag-1024x397.png" alt="capture_the_flag" width="516" height="200" /></p>
<p>The rules of the game are quite simple: the board is a PacMan maze, divided in a red and a blue half. The two halves belong to two teams of agents, who are controlled by computer programs to eat the opponent&#8217;s food and protect their own. When in the opponent&#8217;s half, the agents are <strong>PacMan</strong> (PacMen?), while in their own half, the agents are <strong>ghosts</strong> and can kill the opponent&#8217;s PacMan agents, in which case these are returned to their initial position. The players get one point for each food dot they eat; no points are assigned for eating the other team&#8217;s agents. The game ends when one of the two teams eats all of the opponent&#8217;s food, or after 3000 moves; the team with the highest score wins.</p>
<p>To make the game more interesting, one can only observe the position of the other team&#8217;s agents when they are very close to one&#8217;w own agents (5 squares away); otherwise, one can only obtain a noisy estimate of their distance.</p>
<p>The game is written in Python, my programming language of choice, which allows to write rapidly even sophisticated algorithms. I recommend the game to anyone wanting to organize an artificial intelligence course, or simply have fun writing AI agents. I plan to dedicate a couple of posts to the basic strategies to write successful agents in this game.</p>
<p>Here&#8217;s a video of the best students&#8217; agents (red team) playing against the best tutors&#8217; agents (blue team). The tutors won, saving our reputation!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/E82IrVhVaVc&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/E82IrVhVaVc&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>Update:</strong> The authors of the PacMan capture-the-flag game decided to keep the game close-source, and in particular would prefer not to publish the code of agents playing their game, fearing that it might interfere with their course. It&#8217;s a shame because I was planning to write some Genetic Programming agents for the game, but of course I respect their decision. I guess there will be no series of posts re:PacMan&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masterbaboon.com/2009/09/pacman-capture-the-flag-a-fun-game-for-artificial-intelligence-development-and-education/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
