<?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>Mostly Tigerproof &#187; Technology</title>
	<atom:link href="http://blog.mostlytigerproof.com/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mostlytigerproof.com</link>
	<description>Craig Timpany&#039;s weblog</description>
	<lastBuildDate>Fri, 16 Jul 2010 22:08:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.mostlytigerproof.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/e6a89796dd1931fbd10f6c2d65e07e00?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Mostly Tigerproof &#187; Technology</title>
		<link>http://blog.mostlytigerproof.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.mostlytigerproof.com/osd.xml" title="Mostly Tigerproof" />
	<atom:link rel='hub' href='http://blog.mostlytigerproof.com/?pushpress=hub'/>
		<item>
		<title>Gathering statistics using Google Analytics and Unity 3D</title>
		<link>http://blog.mostlytigerproof.com/2009/10/06/gathering-statistics-using-google-analytics-and-unity-3d/</link>
		<comments>http://blog.mostlytigerproof.com/2009/10/06/gathering-statistics-using-google-analytics-and-unity-3d/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 02:54:54 +0000</pubDate>
		<dc:creator>Craig Timpany</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.mostlytigerproof.com/?p=138</guid>
		<description><![CDATA[As a game developer I&#8217;m terribly jealous of the data-gathering schemes that companies like Valve and Bungie have going. Take Valve for example: they have detailed stats of where players get killed in their games. This is invaluable stuff for creating a consistent level of difficulty. I decided that I wanted a system like this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mostlytigerproof.com&blog=180258&post=138&subd=wildgeese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>As a game developer I&#8217;m terribly jealous of the data-gathering schemes that companies like Valve and Bungie have going. Take Valve for example: they have <a href="http://www.steampowered.com/status/ep2/ep2_stats.php">detailed stats of where players get killed in their games</a>. This is invaluable stuff for creating a consistent level of difficulty. I decided that I wanted a system like this of my own.</p>
<p>I started designing a database and looking at server-side programming languages. After I&#8217;d been working on this for a couple of days, I thought &#8220;logging events and aggregating statistics is  incredibly common, someone must&#8217;ve done this already. If only I could use their code&#8230;&#8221;</p>
<p>Then I realised, <strong>Google Analytics</strong>. Duh!</p>
<p><span id="more-138"></span></p>
<p><a href="http://www.google.com/analytics/">Google Analytics</a> logs web traffic numbers and gives you a nice user interface for slicing and dicing the data. Not only had they already written the server code, they also run the server for you! It&#8217;s free for the first 5 million page-views per month. I&#8217;d been reinventing the wheel.</p>
<p>All I had to do was trick Google, by feeding them a special fake page view whenever a player dies. I soon discovered that Google was way ahead of me. They already have an API for tracking &#8216;events&#8217; that happen on a page. People seem to mostly use these for integrating e-commerce sale figures into their web traffic reports, but it&#8217;s equally suitable for tracking in-game events.</p>
<h2>Setting Up</h2>
<p>If you sign up for Google Analytics and put their Javascript snippet in the page with the game, you&#8217;re all set. You&#8217;ll need your own domain name, or a subdomain at the least to sign up.</p>
<p>Here&#8217;s the code you need to run in Unity whenever something happens:</p>
<pre>Application.ExternalCall("pageTracker._trackEvent", new object[] { category, action, label, value} );
</pre>
<p>Um, that&#8217;s all of it. This is a non-blocking call to run a Javascript function in the page that holds the Unity Player. I haven&#8217;t investigated triggering events from a standalone app yet.</p>
<p>The line above will work with the standard Javascript that Google hand out upon signing up. Note that you won&#8217;t be able to test it locally &#8211; it needs to run on a page hosted at your domain. If you run it locally, you&#8217;ll get an error in the Javascript console saying &#8216;O not defined&#8217;.</p>
<h2>Data Model</h2>
<p>By now you&#8217;re probably wondering what the 4 parameters are to our function call:</p>
<ul>
<li><strong>Category</strong>. This is a free-form string used to categorise your events. It&#8217;s the highest level of organisation applied to your events. I&#8217;ve been storing a concatenation of the game name, version number and level ID in here.</li>
<li><strong>Action</strong>. Another free-form string which represents the type of event. I&#8217;ve been using actions such as &#8220;killed&#8221; and &#8220;game_start&#8221;.</li>
<li><strong>Label</strong>. This is an optional string parameter to the action. For example, the killed action uses the label to store the cause of death.</li>
<li><strong>Value</strong>. This is an optional fractional number parameter to the action. For example, I keep the length of the game session in here when I send the &#8216;game_end&#8217; action.</li>
</ul>
<h2 style="text-align:left;">Analysis</h2>
<p style="text-align:left;">So what&#8217;s all this look like from inside Google Analytics? It&#8217;s a batch processing system, so first you need to wait overnight for your data to come through. Next, log in, pick your site and select &#8216;Event Tracking&#8217;.</p>
<p style="text-align:left;"><img class="size-full wp-image-141 aligncenter" title="analytics1" src="http://wildgeese.files.wordpress.com/2009/10/analytics1.png?w=250&#038;h=234" alt="analytics1" width="250" height="234" /></p>
<p>You&#8217;ll see a hierarchy of categories and actions, like so:</p>
<p style="text-align:center;"><img class="size-full wp-image-142 aligncenter" title="analytics2" src="http://wildgeese.files.wordpress.com/2009/10/analytics2.png?w=489&#038;h=234" alt="analytics2" width="489" height="234" /></p>
<p style="text-align:left;">Yes, those are real numbers. Some day I&#8217;ll get around to promoting this site. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="text-align:left;">If I want a breakdown of causes of death in Glob Arena, I hit the &#8216;killed&#8217;  link and get this moneyshot:</p>
<p style="text-align:left;"><img class="aligncenter size-full wp-image-145" title="analytics3" src="http://wildgeese.files.wordpress.com/2009/10/analytics31.png?w=538&#038;h=251" alt="analytics3" width="538" height="251" /></p>
<p style="text-align:left;">Glorious.</p>
<h2 style="text-align:left;">Limitations</h2>
<p>Thankfully, collecting personally identifiable information via Google Analytics is not allowed. Not only is it a sleazy thing to do to your customers, it&#8217;ll get your account banned.</p>
<p>This means that you&#8217;ll only get aggregate information on player behaviour. You can split the statistics up into sub-populations using the Advanced Segments tool, but it won&#8217;t ever show you a log of some individual&#8217;s actions. Google Analytics is no substitute for asking someone to test your game, while you look over their shoulder.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wildgeese.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wildgeese.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wildgeese.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wildgeese.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wildgeese.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wildgeese.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wildgeese.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wildgeese.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wildgeese.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wildgeese.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mostlytigerproof.com&blog=180258&post=138&subd=wildgeese&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mostlytigerproof.com/2009/10/06/gathering-statistics-using-google-analytics-and-unity-3d/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0341601dd0aa0eda5e683a816dcbad8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">craigtimpany</media:title>
		</media:content>

		<media:content url="http://wildgeese.files.wordpress.com/2009/10/analytics1.png" medium="image">
			<media:title type="html">analytics1</media:title>
		</media:content>

		<media:content url="http://wildgeese.files.wordpress.com/2009/10/analytics2.png" medium="image">
			<media:title type="html">analytics2</media:title>
		</media:content>

		<media:content url="http://wildgeese.files.wordpress.com/2009/10/analytics31.png" medium="image">
			<media:title type="html">analytics3</media:title>
		</media:content>
	</item>
		<item>
		<title>The scent of coin-op</title>
		<link>http://blog.mostlytigerproof.com/2009/09/07/the-scent-of-coin-op/</link>
		<comments>http://blog.mostlytigerproof.com/2009/09/07/the-scent-of-coin-op/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 04:11:17 +0000</pubDate>
		<dc:creator>Craig Timpany</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://wildgeese.wordpress.com/?p=77</guid>
		<description><![CDATA[Today I was walking along Courtenay Place and caught a scent that I hadn&#8217;t smelled in a long time. It brought back the strongest memories of old video arcades, Ghosts &#8216;n&#8217; Goblins and pinball machines. It was like MAME had come to roost in my head for a moment. When I tried to figure out [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mostlytigerproof.com&blog=180258&post=77&subd=wildgeese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Today I was walking along Courtenay Place and caught a scent that I hadn&#8217;t smelled in a long time. It brought back the strongest memories of old video arcades, Ghosts &#8216;n&#8217; Goblins and pinball machines. It was like <a href="http://www.mamedev.org">MAME</a> had come to roost in my head for a moment.</p>
<p>When I tried to figure out what I was smelling, I realised it had come from the pokies machines in a pool hall that&#8217;d walked past. I still can&#8217;t pin down exactly what it was. Pine chipboard cabinets riddled with borer and marinated in tobacco smoke? Maybe I can just smell the coin-op?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wildgeese.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wildgeese.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wildgeese.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wildgeese.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wildgeese.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wildgeese.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wildgeese.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wildgeese.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wildgeese.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wildgeese.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mostlytigerproof.com&blog=180258&post=77&subd=wildgeese&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mostlytigerproof.com/2009/09/07/the-scent-of-coin-op/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0341601dd0aa0eda5e683a816dcbad8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">craigtimpany</media:title>
		</media:content>
	</item>
		<item>
		<title>Unity 3D</title>
		<link>http://blog.mostlytigerproof.com/2009/09/02/unity-3d/</link>
		<comments>http://blog.mostlytigerproof.com/2009/09/02/unity-3d/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 00:40:16 +0000</pubDate>
		<dc:creator>Craig Timpany</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://wildgeese.wordpress.com/?p=53</guid>
		<description><![CDATA[One of the things I&#8217;ve been screwing around with is Unity 3D. Unity is a heavily data-driven game engine with an integrated level editor. It&#8217;s so heavily data-driven that all the game code is written in script and the native code layer is almost entirely hidden (only in the pro version C++ plug-ins can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mostlytigerproof.com&blog=180258&post=53&subd=wildgeese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>One of the things I&#8217;ve been screwing around with is Unity 3D. Unity is a heavily data-driven game engine with an integrated level editor.</p>
<p>It&#8217;s so heavily data-driven that all the game code is written in script and the native code layer is almost entirely hidden (only in the pro version C++ plug-ins can be created). The engine contains most of the systems you&#8217;re likely to need for a game: 3D rendering with shaders, a level editor, a 3D asset pipeline, a physics engine, a rudimentary GUI system, network state synchronisation and RPC.</p>
<p>Unity is the subject of all kinds of hyperbole around the web. Back when I first heard about it, I wondered how much of the praise was down to Mac-heads who were simply delighted that the authoring tools were Mac-only. Since then, they&#8217;ve ported the tools to Windows and I&#8217;ve discovered that it really is pretty damn nice. It&#8217;s extremely quick to learn &#8211; I had a playable prototype of the game mechanic that I was trying out on Day 2 of using it.</p>
<p>Unity&#8217;s greatest asset is its clean design. It has a beautiful component architecture where you write update methods and event handlers in script, encapsulate them into component objects and then assemble them into game objects via drag &#8216;n&#8217; drop. Exposing tweakable parameters is merely a case of declaring a component member public.</p>
<p>Unity is my first choice for prototyping, but I&#8217;m doubtful it&#8217;d be flexible enough to ship a full-scale game based on it. The drawbacks are:</p>
<ul>
<li>No script debugger. The editor offers excellent facilities for inspecting and changing object properties in a running game session, but there&#8217;s no line-by-line script debugging.</li>
<li>No load/save framework. In spite of all the network serialisation stuff, you&#8217;re on your own when it comes to writing out a save game. There&#8217;s Dot-Net&#8217;s object serialisation and I/O though, so it&#8217;s not completely low level.</li>
<li>The GUI framework looks to be somewhat bare in places. No modal dialogs for example.</li>
<li>The physics API is an intelligently chosen 80% solution. It caters to the common uses of physics. If you&#8217;re in the weird 20% like Portal or Braid, you&#8217;ll probably spend more time fighting Unity than worthwhile.</li>
</ul>
<p>That said, it&#8217;s superb for what it is and it&#8217;s been getting more flexible with every release. It&#8217;s a taste of the future of game development. Ideally, the only code required for a game should be gameplay-specific. Middleware has been getting steadily more and more comprehensive, and I can see the day when the only folks working on engine-level stuff work at Unity, Autodesk, Epic and Intel.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wildgeese.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wildgeese.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wildgeese.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wildgeese.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wildgeese.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wildgeese.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wildgeese.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wildgeese.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wildgeese.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wildgeese.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mostlytigerproof.com&blog=180258&post=53&subd=wildgeese&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mostlytigerproof.com/2009/09/02/unity-3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0341601dd0aa0eda5e683a816dcbad8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">craigtimpany</media:title>
		</media:content>
	</item>
	</channel>
</rss>