<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tinker Tanks blog</title>
	<atom:link href="http://diceattack.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://diceattack.wordpress.com</link>
	<description>The blog about the game</description>
	<lastBuildDate>Fri, 02 Dec 2011 08:19:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='diceattack.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/69b046e67cfa3f9202fbe2784a89613e?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Tinker Tanks blog</title>
		<link>http://diceattack.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://diceattack.wordpress.com/osd.xml" title="Tinker Tanks blog" />
	<atom:link rel='hub' href='http://diceattack.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Showing this to Helen</title>
		<link>http://diceattack.wordpress.com/2011/02/13/showing-this-to-helen/</link>
		<comments>http://diceattack.wordpress.com/2011/02/13/showing-this-to-helen/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 15:52:18 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=287</guid>
		<description><![CDATA[Hi Helen!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=287&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi Helen!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/287/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=287&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2011/02/13/showing-this-to-helen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>
	</item>
		<item>
		<title>Allright: single-player campaign has arrived!</title>
		<link>http://diceattack.wordpress.com/2011/01/03/allright-single-player-campaign-has-arrived/</link>
		<comments>http://diceattack.wordpress.com/2011/01/03/allright-single-player-campaign-has-arrived/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 23:55:42 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=282</guid>
		<description><![CDATA[&#8230; I am quite excited about this because it has been on my to-do list for like a year, and also I think the absence of this feature is the main reason nobody ever stays on Tinker Tanks longer than 3 minutes. I am talking about a single player campaign of course. So you start [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=282&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&#8230; I am quite excited about this because it has been on my to-do list for like a year, and also I think the absence of this feature is the main reason nobody ever stays on Tinker Tanks longer than 3 minutes. I am talking about a <strong>single player campaign</strong> of course.</p>
<p>So you start with an easy level and some basic instructions, once you finish that you see some new instructions to guide you with the next level etc &#8230; After all, you wouldn&#8217;t play something Red Alert or Age Of Kings in multiplayer right away would you? (No you wouldn&#8217;t, because William Wallace rocks <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).</p>
<p>Two other tweaks in the code also made campaigns a bit better:</p>
<ul>
<li>Bots do not move so unreasonably fast anymore if they have only few units. (this made it really hard to beat a bot, especially if you are not used to the &#8216;speed matters&#8217; principle)</li>
<li>I can now edit existing maps in the map editor, so it is easy to make small tweaks to campaign levels based on how they feel. This was long overdue anyway.</li>
</ul>
<p>Here are the first few &#8216;episode intro&#8217; panes. First you get introduced to &#8216;moving and attacking&#8217; and &#8216;ending a turn&#8217;:</p>
<p><a href="http://diceattack.files.wordpress.com/2011/01/picture-23.png"><img class="aligncenter size-medium wp-image-283" title="Picture 23" src="http://diceattack.files.wordpress.com/2011/01/picture-23.png?w=300&#038;h=206" alt="" width="300" height="206" /></a></p>
<p>Then we proceed to the rock-paper-scissors principle, how it is important to be aware of each unit&#8217;s different strengths and weaknesses relative to one another:</p>
<p><a href="http://diceattack.files.wordpress.com/2011/01/picture-24.png"><img class="aligncenter size-medium wp-image-284" title="Picture 24" src="http://diceattack.files.wordpress.com/2011/01/picture-24.png?w=300&#038;h=243" alt="" width="300" height="243" /></a></p>
<p>&#8230; Then there&#8217;s earning money and buying new units:</p>
<p><a href="http://diceattack.files.wordpress.com/2011/01/picture-25.png"><img class="aligncenter size-medium wp-image-285" title="Picture 25" src="http://diceattack.files.wordpress.com/2011/01/picture-25.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>There&#8217;s more, but I do not want to give everything away of course, so you&#8217;ll have to <a title="Tinker Tanks" href="http://www.tinkertanks.com">go play the game</a> to find out <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/282/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=282&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2011/01/03/allright-single-player-campaign-has-arrived/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2011/01/picture-23.png?w=300" medium="image">
			<media:title type="html">Picture 23</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2011/01/picture-24.png?w=300" medium="image">
			<media:title type="html">Picture 24</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2011/01/picture-25.png?w=300" medium="image">
			<media:title type="html">Picture 25</media:title>
		</media:content>
	</item>
		<item>
		<title>Combining multiple images using PHP (and GD)</title>
		<link>http://diceattack.wordpress.com/2011/01/03/combining-multiple-images-using-php-and-gd/</link>
		<comments>http://diceattack.wordpress.com/2011/01/03/combining-multiple-images-using-php-and-gd/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 23:42:40 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=266</guid>
		<description><![CDATA[I made a rather quick&#38;dirty script to do automatically combine many images into one &#8211; saves a great deal of time in showing maps! I used to take screenshots manually until now, crazy I know. Now, since this is the kind of thing I typically stitch together after googling and then getting the info from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=266&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I made a rather quick&amp;dirty script to do automatically combine many images into one &#8211; saves a great deal of time in showing maps! I used to take screenshots manually until now, crazy I know.</p>
<p>Now, since this is the kind of thing I typically stitch together after googling and then getting the info from blog posts of kind people, I thought I&#8217;d give back for a change.</p>
<p>The most common application of combining images with PHP is <strong>adding a watermark</strong> to a picture. I had to do a little bit more than that though, namely stitching many identically sized images together on one &#8216;background&#8217;. In essence I am combining 144 of these:</p>
<p style="text-align:center;"><a href="http://diceattack.files.wordpress.com/2011/01/tile_e_o_fh.png"><img class="alignnone size-full wp-image-273" title="tile_e_o_fh" src="http://diceattack.files.wordpress.com/2011/01/tile_e_o_fh.png?w=450" alt=""   /></a><a href="http://diceattack.files.wordpress.com/2011/01/tile_e_g_fh.png"><img class="alignnone size-full wp-image-272" title="tile_e_g_fh" src="http://diceattack.files.wordpress.com/2011/01/tile_e_g_fh.png?w=450" alt=""   /></a><a href="http://diceattack.files.wordpress.com/2011/01/tile_e_b_fh.png"><img class="alignnone size-full wp-image-271" title="tile_e_b_fh" src="http://diceattack.files.wordpress.com/2011/01/tile_e_b_fh.png?w=450" alt=""   /></a><a href="http://diceattack.files.wordpress.com/2011/01/tile_b_q_fh.png"><img class="alignnone size-full wp-image-269" title="tile_b_q_fh" src="http://diceattack.files.wordpress.com/2011/01/tile_b_q_fh.png?w=450" alt=""   /></a><a href="http://diceattack.files.wordpress.com/2011/01/tile_b_c_fh.png"><img class="alignnone size-full wp-image-267" title="tile_b_c_fh" src="http://diceattack.files.wordpress.com/2011/01/tile_b_c_fh.png?w=450" alt=""   /></a></p>
<p>&#8230; into something like this:</p>
<p><a href="http://diceattack.files.wordpress.com/2011/01/map_3.png"><img class="aligncenter size-full wp-image-274" title="map_3" src="http://diceattack.files.wordpress.com/2011/01/map_3.png?w=450" alt=""   /></a></p>
<p>So basically we will be putting many different images all together on one big &#8216;canvas&#8217; image. If you need to do that for some reason, read on to find out how.</p>
<p>Note: you need to have the <strong>GD</strong> module for PHP enabled or the functions used will throw &#8216;undefined&#8217; errors. Run a php script that has <a href="http://php.net/manual/en/function.phpinfo.php">phpinfo()</a> to find out if you have GD installed yet. If not, here is some <a href="http://php.net/manual/en/book.image.php">more info on GD</a>.</p>
<p>Anyway, here&#8217;s (a slightly simplified version of) my code to combine many images into one.</p>
<h3>Step 1: get an array with source image locations</h3>
<p>This step is different for anybody, but in its easiest form you would define something like this:</p>
<p><pre class="brush: plain;">

$srcImagePaths = Array('http://diceattack.files.wordpress.com/2011/01/tile_e_o_fh.png',
'http://diceattack.files.wordpress.com/2011/01/tile_e_g_fh.png',
'http://diceattack.files.wordpress.com/2011/01/tile_e_b_fh.png',
'http://diceattack.files.wordpress.com/2011/01/tile_b_q_fh.png');

</pre></p>
<h3>Step 2: define some measures and initialize a blank &#8216;background&#8217; image</h3>
<p>Here we use the first GD functions: <a href="http://php.net/manual/en/function.imagecreatetruecolor.php">imagecreatetruecolor()</a> creates a generic &#8216;base&#8217; image, <a href="http://php.net/manual/en/function.imagecolorallocate.php">imagecolorallocate()</a> to define an RGB color and <a href="http://php.net/manual/en/function.imagefill.php">imagefill()</a> to fill our generic image with that color.</p>
<p><pre class="brush: plain;">

$tileWidth = $tileHeight = 28;
$numberOfTiles = 12;
$pxBetweenTiles = 1;

$mapWidth = $mapHeight = ($tileWidth + $pxBetweenTiles) * $numberOfTiles;

$mapImage = imagecreatetruecolor($mapWidth, $mapHeight);
$bgColor = imagecolorallocate($mapImage, 50, 40, 0);
imagefill($mapImage, 0, 0, $bgColor);

</pre></p>
<h3>Step 3:  think at which coordinates you want your source images to end up</h3>
<p>There are some different ways to specify this, but if you are dealing with many images of the same size it makes sense to write a small function that maps an (array) index to a set of X,Y coordinates. Here is mine which arranges them all in a 12&#215;12 square grid:</p>
<p><pre class="brush: plain;">

function indexToCoords($index)
{
 global $tileWidth, $pxBetweenTiles, $leftOffSet, $topOffSet, $numberOfTiles;

 $x = ($index % $numberOfTiles) * ($tileWidth + $pxBetweenTiles) + $leftOffSet;
 $y = floor($index / $numberOfTiles) * ($tileWidth + $pxBetweenTiles) + $topOffSet;
 return Array($x, $y);
}

</pre></p>
<h3>Step 4: loop over the source images and copy them on the base image</h3>
<p>We use function<a href="http://php.net/manual/en/function.imagecopy.php"> imagecopy()</a> to do this, like this:</p>
<p><pre class="brush: plain;">

/*
* COPY SOURCE IMAGES TO MAP
*/

foreach ($srcImagePaths as $index =&gt; $srcImagePath)
{
 list ($x, $y) = indexToCoords($index);
 $tileImg = imagecreatefrompng($srcImagePath);

 imagecopy($mapImage, $tileImg, $x, $y, 0, 0, $tileWidth, $tileHeight);
 imagedestroy($tileImg);
}

</pre></p>
<p>&#8230; Note how we used the indexToCoords() function in there &#8211; we do not want all the source images on the same position of course.</p>
<h3>Step 5 (intermezzo): resizing an image with PHP</h3>
<p>The same imagecopy() function we used to put our source images on the base image can also be used to <em>resize </em>images. Handy if you want to generate thumbnails automatically! Here&#8217;s how you can do that:</p>
<p><pre class="brush: plain;">

/*
 * RESCALE TO THUMB FORMAT
 */
$thumbSize = 200;
$thumbImage = imagecreatetruecolor($thumbSize, $thumbSize);
imagecopyresampled($thumbImage, $mapImage, 0, 0, 0, 0, $thumbSize, $thumbSize, $mapWidth, $mapWidth);

</pre></p>
<h3><strong>Final step: set header to tell the browser there&#8217;s an image coming, and output the final image</strong></h3>
<p><pre class="brush: plain;">

/*
* OUTPUT THUMBNAIL IMAGE
*/

header (&quot;Content-type: image/png&quot;);
imagepng($thumbImage); //change argument to $mapImage to output the original size image

</pre></p>
<p>And that&#8217;s it!  Note that you may not want a uniformly filled background but rather a real background image &#8211; you can easily do this by using imagecreatefrompng() in step 2.</p>
<p>Here&#8217;s all the code once more together for convenience.</p>
<p><pre class="brush: plain;">

&lt;?php

//Source image paths (DISCLAIMER: this is just to demonstrate, to generate a real TT map you need 144 of these)
&lt;pre&gt;$srcImagePaths = Array('http://diceattack.files.wordpress.com/2011/01/tile_e_o_fh.png',
'http://diceattack.files.wordpress.com/2011/01/tile_e_g_fh.png',
'http://diceattack.files.wordpress.com/2011/01/tile_e_b_fh.png',
'http://diceattack.files.wordpress.com/2011/01/tile_b_q_fh.png');
&lt;/pre&gt;
/*
 * INIT BASE IMAGE FILLED WITH BACKGROUND COLOR
 */

$tileWidth = $tileHeight = 28;
$numberOfTiles = 12;
$pxBetweenTiles = 1;
$leftOffSet = $topOffSet = 1;

$mapWidth = $mapHeight = ($tileWidth + $pxBetweenTiles) * $numberOfTiles;

$mapImage = imagecreatetruecolor($mapWidth, $mapHeight);
$bgColor = imagecolorallocate($mapImage, 50, 40, 0);
imagefill($mapImage, 0, 0, $bgColor);

/*
 *  PUT SRC IMAGES ON BASE IMAGE
 */

function indexToCoords($index)
{
 global $tileWidth, $pxBetweenTiles, $leftOffSet, $topOffSet, $numberOfTiles;

 $x = ($index % 12) * ($tileWidth + $pxBetweenTiles) + $leftOffSet;
 $y = floor($index / 12) * ($tileWidth + $pxBetweenTiles) + $topOffSet;
 return Array($x, $y);
}

foreach ($srcImagePaths as $index =&gt; $srcImagePath)
{
 list ($x, $y) = indexToCoords($index);
 $tileImg = imagecreatefrompng($srcImagePath);

 imagecopy($mapImage, $tileImg, $x, $y, 0, 0, $tileWidth, $tileHeight);
 imagedestroy($tileImg);
}

/*
 * RESCALE TO THUMB FORMAT
 */
$thumbSize = 200;
$thumbImage = imagecreatetruecolor($thumbSize, $thumbSize);
imagecopyresampled($thumbImage, $mapImage, 0, 0, 0, 0, $thumbSize, $thumbSize, $mapWidth, $mapWidth);

header (&quot;Content-type: image/png&quot;);
imagepng($thumbImage);

?&gt;

</pre></p>
<p>If there are any errors here or you have other suggestions, feel free to let me know in the comments!</p>
<p>Also if anybody would be interested, the next thing I do is of course store this resulting image somewhere (generating them dynamically each time would cost ridiculous amounts of time); perhaps that would make for a nice follow-up post?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/266/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=266&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2011/01/03/combining-multiple-images-using-php-and-gd/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2011/01/tile_e_o_fh.png" medium="image">
			<media:title type="html">tile_e_o_fh</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2011/01/tile_e_g_fh.png" medium="image">
			<media:title type="html">tile_e_g_fh</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2011/01/tile_e_b_fh.png" medium="image">
			<media:title type="html">tile_e_b_fh</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2011/01/tile_b_q_fh.png" medium="image">
			<media:title type="html">tile_b_q_fh</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2011/01/tile_b_c_fh.png" medium="image">
			<media:title type="html">tile_b_c_fh</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2011/01/map_3.png" medium="image">
			<media:title type="html">map_3</media:title>
		</media:content>
	</item>
		<item>
		<title>Guest login and straight to portal</title>
		<link>http://diceattack.wordpress.com/2010/11/02/guest-login-and-straight-to-portal/</link>
		<comments>http://diceattack.wordpress.com/2010/11/02/guest-login-and-straight-to-portal/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 11:44:47 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=258</guid>
		<description><![CDATA[I had done it before but I am doing it again, and I think I&#8217;ll really stick to it this time: skipping the intro screen and going straight to the portal on first land on the site. Previously you would first land on this screen: And then, if somehow you were convinced signing up for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=258&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had done it before but I am doing it again, and I think I&#8217;ll really stick to it this time: skipping the intro screen and going straight to the portal on first land on the site.</p>
<p>Previously you would first land on this screen:</p>
<p><a href="http://diceattack.files.wordpress.com/2010/11/ttold2.png"><img class="aligncenter size-medium wp-image-260" title="ttold2" src="http://diceattack.files.wordpress.com/2010/11/ttold2.png?w=300&#038;h=238" alt="" width="300" height="238" /></a></p>
<p>And then, if somehow you were convinced signing up for a <em>game </em>would be worth it (never mind the 123040234230 games you can just play instantly), you landed here:</p>
<p><a href="http://diceattack.files.wordpress.com/2010/11/ttold1.png"><img class="aligncenter size-medium wp-image-259" title="ttold1" src="http://diceattack.files.wordpress.com/2010/11/ttold1.png?w=300&#038;h=242" alt="" width="300" height="242" /></a></p>
<p>&#8230; Where the button I want you to press is one of those three in the upper left corner. Yuk, how could I ever expect somebody to make it all the way trough <em>that</em>?</p>
<p>In the shiny new version, everybody who lands is logged on automatically as a &#8216;guest&#8217; account, lands in the portal, and will probably be able to figure out which button to press:</p>
<p><a href="http://diceattack.files.wordpress.com/2010/11/ttnew.png"><img class="aligncenter size-medium wp-image-261" title="ttnew" src="http://diceattack.files.wordpress.com/2010/11/ttnew.png?w=300&#038;h=214" alt="" width="300" height="214" /></a></p>
<p>Other changes:</p>
<ul>
<li>On the left you now have some basic game play instructions.</li>
<li>The quick challenge box below the chat is gone, but I never made it to work anyway. The sad news is that it also had the currently online users, which was nice for knowing who you can chat with or challenge.</li>
<li>The <em>Start Game </em>button takes you to campaign mode, which is designed to &#8216;ease in&#8217; players into the game. I still need to work on that a lot though, for example level 0 which starts with just 2 soldiers is nearly unbeatable for beginners because the bot moves too fast <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>Logging in with your account is moved discretely to the top</li>
<li>Multiplayer / practice / guide are also more visible, but still obviously less important than campaign mode.</li>
</ul>
<p>The only thing I don&#8217;t like that much is that you cannot see who is online anymore in the portal. So I think I should look for a way to get that information somewhere in the portal I think. Perhaps using some kind of dropout, so that it does not clutter the layout even more? (I want to keep the amount of text to a minimum at all costs)</p>
<p>As of this writing the web site is down btw and this change is not deployed live yet.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=258&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2010/11/02/guest-login-and-straight-to-portal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2010/11/ttold2.png?w=300" medium="image">
			<media:title type="html">ttold2</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2010/11/ttold1.png?w=300" medium="image">
			<media:title type="html">ttold1</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2010/11/ttnew.png?w=300" medium="image">
			<media:title type="html">ttnew</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick video tour</title>
		<link>http://diceattack.wordpress.com/2010/07/14/videotour/</link>
		<comments>http://diceattack.wordpress.com/2010/07/14/videotour/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 14:22:25 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=252</guid>
		<description><![CDATA[I made a small promo or &#8216;quick tour&#8217; video to show people how the game looks so they can decide if they like it before having to sign up or whatever: Of course it&#8217;s just another excuse to use my own soundtrack of which I am so proud<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=252&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I made a small promo or &#8216;quick tour&#8217; video to show people how the game looks so they can decide if they like it before having to sign up or whatever:</p>
<span style="text-align:center; display: block;"><a href="http://diceattack.wordpress.com/2010/07/14/videotour/"><img src="http://img.youtube.com/vi/f3LHNK7xV8k/2.jpg" alt="" /></a></span>
<p>Of course it&#8217;s just another excuse to use my own soundtrack of which I am so proud <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/252/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=252&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2010/07/14/videotour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>
	</item>
		<item>
		<title>Building big social games</title>
		<link>http://diceattack.wordpress.com/2010/02/09/building-big-social-games/</link>
		<comments>http://diceattack.wordpress.com/2010/02/09/building-big-social-games/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 09:51:30 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=246</guid>
		<description><![CDATA[Interesting presentation from Farmville&#8217;s lead developer: Building big social games. Especially the &#8216;incremental new features&#8217; thing seems insteresting. Perhaps TT could be built up a lot more &#8216;unlocking features&#8217; way, where players start out with only few units (like really, just tanks+soldiers or something) but gain new ones the more they play and/or the more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=246&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Interesting presentation from Farmville&#8217;s lead developer: <a href="http://www.slideshare.net/amittmahajan/building-big-social-games">Building big social games</a>. Especially the &#8216;incremental new features&#8217; thing seems insteresting.</p>
<p>Perhaps TT could be built up a lot more &#8216;unlocking features&#8217; way, where players start out with only few units (like really, just tanks+soldiers or something) but gain new ones the more they play and/or the more friends they get into the game?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/246/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=246&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2010/02/09/building-big-social-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>
	</item>
		<item>
		<title>Rating stars, harmonica menus, submarine sounds and boat-buying bots</title>
		<link>http://diceattack.wordpress.com/2010/01/12/rating-stars-harmonica-menus-submarine-sounds-and-boat-buying-bots/</link>
		<comments>http://diceattack.wordpress.com/2010/01/12/rating-stars-harmonica-menus-submarine-sounds-and-boat-buying-bots/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 23:22:07 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=242</guid>
		<description><![CDATA[Well, I guess the title says it all&#8230; First of all, I did some more household cleaning this weekend, sorting pictures neatly in folders by category, separating out frontend files by page, etc. Nothing fancy, just the kind of stuff that needed to be done sometime and you can&#8217;t ignore forever or your code becomes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=242&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well, I guess the title says it all&#8230; First of all, I did some more household cleaning this weekend, sorting pictures neatly in folders by category, separating out frontend files by page, etc. Nothing fancy, just the kind of stuff that needed to be done sometime and you can&#8217;t ignore forever or your code becomes unworkable.</p>
<p>Now for the fun stuff. I got sick of the boring map <strong>2 player basic </strong>always showing up first when creating a game. I am sure that puts a lot of people of because it&#8217;s so boring compared to, say, <strong>Chokehole! </strong>or <strong>Treasure Island</strong>. So I wanted a better way to sort the presented maps in, and as usual the tweak came with a feature: map ratings!</p>
<p>Obviously you have seen these a thousand times and ignored them, which is fine because I just wanted them as an excuse to place my favourite maps on top of the cue:</p>
<div id="attachment_243" class="wp-caption aligncenter" style="width: 310px"><a href="http://diceattack.files.wordpress.com/2010/01/screenshot_stars.png"><img class="size-medium wp-image-243" title="Map ratings" src="http://diceattack.files.wordpress.com/2010/01/screenshot_stars.png?w=300&#038;h=137" alt="Map ratings" width="300" height="137" /></a><p class="wp-caption-text">Map ratings</p></div>
<p>I don&#8217;t take any credit since I <a href="http://www.beauscott.com/2006/08/26/ajax-rating-stars/">took them from Beau Scot</a>, and that file is really a good example of a simple, clean, efficient and maximum reusable little javaScript class (thx to Prototype of course).</p>
<p>Next, I revamped the menu in the portal a bit, including a subtle but (I believe) gigantic useability step forward: allowing the user to choose between single- or multiplayer <em>before </em>creating a game. Number of bots is chosen automatically now, and even better: when you start a multiplayer game an invitation is posted in the portal chat for the others!</p>
<p><a href="http://diceattack.files.wordpress.com/2010/01/screenshot-newgame.png"><img class="aligncenter size-full wp-image-244" title="screenshot newgame" src="http://diceattack.files.wordpress.com/2010/01/screenshot-newgame.png?w=450" alt=""   /></a></p>
<p>The portal is still traditionally ugly, but I can&#8217;t believe it took me so long to make that part of the experience a bit more pleasant. There was really no excuse for the earlier game creation process (i.e. creating game, leaving it to come back at the portal to tell the others the game id &#8230;).</p>
<p>And finally, as usual these days, some more bot enhancing: they can now also buy naval units, the code behind them is a bit cleaner with even more &#8216;behavior&#8217; parameters separated out.</p>
<p>Among the tweakable bot-settings we now have these two: <strong>landUnitCountBeforeConsideringNaval </strong>and <strong>unitCountBeforeConsideringBuilding</strong>. Of course in a later phase it would be neat to make these depend both on bot &#8216;character&#8217;  and on the map and/or the number of enemy units.</p>
<p>But the best of all is of course that the submarine now makes bubble sounds when moving/firing!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=242&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2010/01/12/rating-stars-harmonica-menus-submarine-sounds-and-boat-buying-bots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2010/01/screenshot_stars.png?w=300" medium="image">
			<media:title type="html">Map ratings</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2010/01/screenshot-newgame.png" medium="image">
			<media:title type="html">screenshot newgame</media:title>
		</media:content>
	</item>
		<item>
		<title>More bot tweaks and while we&#8217;re automating anyway: auto-firing towers!</title>
		<link>http://diceattack.wordpress.com/2010/01/04/more-bot-tweaks-and-while-were-automating-anyway-auto-firing-towers/</link>
		<comments>http://diceattack.wordpress.com/2010/01/04/more-bot-tweaks-and-while-were-automating-anyway-auto-firing-towers/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 00:37:47 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=240</guid>
		<description><![CDATA[More tweaking on the bots this weekend! I created lots of auxiliary functions, moved some bits and pieces around, and also tweaked the bot&#8217;s core logic a bit more,  to achieve the following: If there&#8217;s no candidate enemy units within attack range, scan in a wider perimeter and moveTowards() the interesting target if one is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=240&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>More tweaking on the bots this weekend! I created lots of auxiliary functions, moved some bits and pieces around, and also tweaked the bot&#8217;s core logic a bit more,  to achieve the following:</p>
<ul>
<li>If there&#8217;s no candidate enemy units within attack range, scan in a wider perimeter and <em>moveTowards() </em>the interesting target if one is found. Since the natural &#8216;enemy&#8217; of an ore truck is the ore field, this means ore trucks will find and occupy nearby ore fields now.</li>
<li>Some parameters are centralized in a <strong>botSettings</strong> object, such as: avgTimePerMove, maxMovesPerRound, buyProbability &#8230; This allows for easy tweaking and experimenting with bot behavior and &#8216;difficulty setting&#8217;.</li>
<li>With those new helping functions (scanning for enemy units nearby &#8230;) it was straightforward to add as a bonus: <strong>auto-firing towers</strong>, hooray! Towers will now automatically attack <em>all </em>nearby enemies: these are extra moves appended without even a timing penalty. This instant multi-move behaviour may make towers a bit <em>too </em>powerful actually, we&#8217;ll see.<br />
In any case we may have an interesting new &#8216;construction engineer plus tower rush&#8217; added to the possible strategies now&#8230;.</li>
</ul>
<p>All this &#8216;automated movement&#8217; code opens up another interesting gameplay approach, beyond bots and towers: in principle it isn&#8217;t too easy to make <em>all </em>units auto-attack nearby enemies now (and use some random generator for &#8216;move time&#8217; or whatever). This is something that&#8217;s come up as a suggestion from testers sometimes. After all, &#8216;regular&#8217; RTS games behave like this, you just send hordes of units in the right direction but when a unit is near an enemy it will automatically attack. This would make the game more &#8216;overview&#8217; and less &#8216;move by move&#8217; in a way. More like Age Of Kings, less like chess.</p>
<p>I have a feeling this would make the most sense when combined with larger playing fields, whereas with the current small board the &#8216;placing moves&#8217; aspect is still rather central and nice. But still an interesting thing to keep in mind for later.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/240/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=240&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2010/01/04/more-bot-tweaks-and-while-were-automating-anyway-auto-firing-towers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>
	</item>
		<item>
		<title>On the path to bots &#8216;understanding&#8217; the situation better: round analysis</title>
		<link>http://diceattack.wordpress.com/2009/12/30/on-the-path-to-bots-understanding-the-situation-better-round-analysis/</link>
		<comments>http://diceattack.wordpress.com/2009/12/30/on-the-path-to-bots-understanding-the-situation-better-round-analysis/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 23:00:57 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=235</guid>
		<description><![CDATA[As I was thinking about how to have my bots make good decisions, I realised something crucial was missing: a 'high-level overview of the map.
<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=235&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As I was thinking about how to have my bots make good decisions, I realised something crucial was missing: a &#8216;high-level overview of the map.</p>
<p>Early AI researchers trying to build a chess computer were faced with the same problem: how can we quantify how strong a position is? Given a position, who has the so-called &#8216;strategic&#8217; advantage? (as opposed to small-scale short-term &#8216;tactical&#8217; advantage)</p>
<p>In Tinker Tanks there&#8217;s a lot obvious stuff we humans can grasp from just a glance at the map in any given round: in what corner are most of a player&#8217;s units? Where are the mines to be found? Who seems to be winning this game, anyway?</p>
<p>So I created a small php function that tries to summarize some indicators about each player&#8217;s situation, based solely on the map. Here&#8217;s how it looks for now:</p>
<div id="attachment_236" class="wp-caption aligncenter" style="width: 460px"><a href="http://diceattack.files.wordpress.com/2009/12/screenshot_roundanalysis.png"><img class="size-full wp-image-236" title="Player analysis pane, based on current round situation" src="http://diceattack.files.wordpress.com/2009/12/screenshot_roundanalysis.png?w=450&#038;h=168" alt="Player analysis pane, based on current round situation" width="450" height="168" /></a><p class="wp-caption-text">Player analysis pane, based on current round situation</p></div>
<p>(only visible in debug mode for now)</p>
<p>True to Age Of Empires, &#8216;environment&#8217; (they called it <em>Gaia</em>) is also a &#8216;player&#8217;.</p>
<p><strong>Avg. X</strong> and <strong>Avg. Y</strong> measure where all units are &#8216;on average&#8217;, expressed in grid tiles. I am also playing with the idea of adding a &#8216;schematic&#8217; green square with an &#8216;average&#8217; dot for each player, where dot size is proportional to score (see below).</p>
<p>For the Environment player, XY position is calculated taking only the <em>ore fields</em> into account. So if a truck has no obvious ore field nearby he can have an idea where to go explore for the goodies!</p>
<p>I also (finally) took a first pass at defining a meaningful <strong>score</strong>: it is the sum of price*health over al units currently on the map. This can be refined of course, just as with chess strategy we might incorporate a &#8216;position advantage&#8217; or something like that later on. Or factor attack bonuses into the equation.</p>
<p>Currently, the buildings/units available at game start are included in the score calculation, so even at round 0 score is quite high because homebases, war factories and ore trucks cost so much.</p>
<p>If I ever show this to players during a game I may have it start on zero for everybody, but I am not really sure if that&#8217;s the best approach for guiding a bot&#8217;s judgement yet.</p>
<p>In any case, I feel this &#8217;round analysis&#8217; is a nice pass towards giving bots a better &#8216;understanding&#8217; of what is going on in the game. Soon all that will be left for them is to sense emotions based on your mouse gestures so they can use some psychological warfare&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/235/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=235&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2009/12/30/on-the-path-to-bots-understanding-the-situation-better-round-analysis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2009/12/screenshot_roundanalysis.png" medium="image">
			<media:title type="html">Player analysis pane, based on current round situation</media:title>
		</media:content>
	</item>
		<item>
		<title>Captchas and caches with PHP</title>
		<link>http://diceattack.wordpress.com/2009/12/28/captchas-and-caches-with-php/</link>
		<comments>http://diceattack.wordpress.com/2009/12/28/captchas-and-caches-with-php/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 22:27:40 +0000</pubDate>
		<dc:creator>wauter</dc:creator>
				<category><![CDATA[Dice Attack]]></category>

		<guid isPermaLink="false">http://diceattack.wordpress.com/?p=222</guid>
		<description><![CDATA[Just added two thingies every single dynamic website out there has, but Tinker Tanks still hadn&#8217;t: captchas in submitted forms, and some caching. As usual, what I ended up with is rough, more a playful exercise and starting point than actual production-worthy code. A colleague of mine suggested to use memcached to do the heavy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=222&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just added two thingies every single dynamic website out there has, but Tinker Tanks still hadn&#8217;t: <strong>captchas </strong>in submitted forms, and some <strong>caching</strong>. As usual, what I ended up with is rough, more a playful exercise and starting point than actual production-worthy code.</p>
<p>A colleague of mine suggested to use memcached to do the heavy reading/writing needed to make a game advance. However, as memcached is key-value based and my round mechanism depends rather heavily on id lookups and things like that, I am not entirely sure yet how I would make that work. Also, I don&#8217;t own the server so it&#8217;s easier to play around with the php code then with the server stuff.</p>
<p>So, while reading up on caching anyway, I implemented a super basic PHP caching mechanism, more to get a feeling for it then for actual practical purpose (I am pretty sure it actually slows me down now). It is time based, with a &#8216;time to live&#8217;.</p>
<p>When fetching data from the database I can now opt to do a &#8216;cached call&#8217;,  and pass on a timeout parameter for how long a cache remains valid: e.g. calling $db-&gt;<em>getResults(true, 3600)</em><strong> </strong>would cache results with a time-to-live of an hour.</p>
<p>The cache itself is a bunch of <strong>serialize()</strong>d .txt files. The lookup key for individual cache results is simply the filename which has a hash of the exact SQL query in it.</p>
<p>So, say we fetch data with a function that queries for &#8216;SELECT * FROM users WHERE userid=35&#8242; the cache-enabled way, here&#8217;s what happens:</p>
<ul>
<li>Look trough the caches and see if we find a file which has a matching filename <em>and </em>(if it has non-infinit TTL) is modified recently enough.</li>
<li>If we find a match, unserialize() it and return that as query result.</li>
<li>If we find no match, do a &#8216;normal&#8217; query in the database and (over)write the text file.</li>
</ul>
<p>And that&#8217;s it. Many users will also typically mean many cache files, but we can live with that.</p>
<div id="attachment_226" class="wp-caption aligncenter" style="width: 460px"><a href="http://diceattack.files.wordpress.com/2009/12/forum-screenie.png"><img class="size-full wp-image-226" title="The forum a bit more polished" src="http://diceattack.files.wordpress.com/2009/12/forum-screenie.png?w=450&#038;h=324" alt="The forum a bit more polished" width="450" height="324" /></a><p class="wp-caption-text">The forum is a tad more polished (but still ugly)</p></div>
<p>Poking around with the forum a bit (I admit it, I felt too tired to plunge in the descent-bot bee hive again) also led me to create a captcha. I never read about them or downloaded one or whatever, but giving how they are I guess my mechanism is the &#8216;usual one&#8217;.</p>
<p>Here&#8217;s a the mechanism in its barest form &#8211; it&#8217;s three steps:</p>
<ul>
<li>In the php controlling the page that has the form to be submitted, generate some random captcha string that the user will have to type. Put this string in the <em>$_SESSION</em>.</li>
</ul>
<p><pre class="brush: plain;">
function generateCaptcha()
{
   $captcha = (string) rand (0,999);
   $_SESSION['latestCaptcha'] = $captcha; //store for checking on next submit
}
</pre></p>
<ul>
<li>In the page itself, insert a dynamically generated image (using <a href="http://php.net/manual/en/book.image.php">GD</a>) with this string in it (in my case the src of an IMG points directly to a <em>captcha.php</em> file that gets the needed string from the session and sticks it on a fixed image). Something like this:</li>
</ul>
<p><pre class="brush: plain;">
&lt;?php
$im = imagecreatefrompng('http://mydomain.com/img/background_g.png');
$color = imagecolorallocate($im, 255, 255, 255);

session_start();

$captcha = $_SESSION['latestCaptcha'];
$x = 2;
$y = 4;
imagestring($im, 4, $x, $y, $captcha, $color);

header('Content-type: image/png');
imagepng($im);
imagedestroy($im);

?&gt;

</pre></p>
<ul>
<li>Finally, among the checks that happen on a submitted form, add one that checks if the submitted captcha matches the latest generated one.</li>
</ul>
<p><pre class="brush: plain;">

function checkCaptcha($submitted)
{
   $isValid = ($submitted == $_SESSION['latestCaptcha']);
   unset($_SESSION['latestCaptcha']); //so there's no confusion with the next captcha check

   return $isValid;
}
</pre></p>
<p>Now, even with the function parameter checks I left out this is obviously not a very good captcha: my string is just a number, extracting those non-disorted characters out of my decoy-less background violates the <a href="http://en.wikipedia.org/wiki/CAPTCHA#Characteristics">basic captcha characteristics</a>, so the captcha string could easily be extracted by software. But it was still interesting putting it in there, and surely it will do while my site is still unknown &#8211; that&#8217;s becoming a recurring theme <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Oh, I am also tinkering with another one of those everybody-has-it things: an automated welcome mail that has markup <em>and</em> makes it trough spam filters (hint: not there yet).</p>
<p>That&#8217;s it for today folks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diceattack.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diceattack.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diceattack.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diceattack.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diceattack.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diceattack.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diceattack.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diceattack.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diceattack.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diceattack.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diceattack.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diceattack.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diceattack.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diceattack.wordpress.com/222/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diceattack.wordpress.com&amp;blog=6061774&amp;post=222&amp;subd=diceattack&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diceattack.wordpress.com/2009/12/28/captchas-and-caches-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">wauter</media:title>
		</media:content>

		<media:content url="http://diceattack.files.wordpress.com/2009/12/forum-screenie.png" medium="image">
			<media:title type="html">The forum a bit more polished</media:title>
		</media:content>
	</item>
	</channel>
</rss>
