<?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>mercuric.net &#187; programming</title>
	<atom:link href="http://www.mercuric.net/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mercuric.net</link>
	<description>At least 80% post-consumer content</description>
	<lastBuildDate>Tue, 12 Nov 2024 18:34:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Heatmap Generation</title>
		<link>http://www.mercuric.net/2010/08/heatmap-generation/</link>
		<comments>http://www.mercuric.net/2010/08/heatmap-generation/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 07:38:34 +0000</pubDate>
		<dc:creator>Zebranky</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.mercuric.net/?p=60</guid>
		<description><![CDATA[After seeing Georg Zoeller&#8217;s phenomenal talk on development telemetry at GDC, I had a bunch of ideas about data and interesting things to do with it.  I&#8217;m still working on my streamlined bug reporting tool for NWN2 (ran into a wall dealing with IPC between C# and C++).  This post, however, is about a much [...]]]></description>
			<content:encoded><![CDATA[<p>After seeing Georg Zoeller&#8217;s phenomenal <a href="http://gdc.gulbsoft.org/">talk on development telemetry</a> at GDC, I had a bunch of ideas about data and interesting things to do with it.  I&#8217;m still working on my streamlined bug reporting tool for NWN2 (ran into a wall dealing with IPC between C# and C++).  This post, however, is about a much flashier, much more finished project.</p>
<p>In the presentation above, there were several screenshots of useful, good-looking visualizations of data, including heatmaps of things like crash locations and gameplay activity.  I wanted to be able to make pictures like that!  Problem is, I couldn&#8217;t find any code or libraries to do quite what I wanted, and rather fighting with what was out there, I decided to roll my own.</p>
<p>I wrote the core code a while ago, so I don&#8217;t really remember enough to post-mortem that.  Much more recently, though, I felt unsatisfied with the &#8220;hacky&#8221; (to be generous) interface of one button in a form that ran the whole generation process when you clicked it.  It was time to revisit the project.</p>
<p>Most of the interface was just a matter of pulling several parameters to the HeatMap constructor out of code and into the GUI, but it makes me a lot happier to have a tool that other people can reasonably use.  At this point, it&#8217;s abstract enough to be used for many applications beyond the original use case of plotting deaths on a NWN area minimap.</p>
<div class="wp-caption alignright" style="width: 337px"><a href="http://www.mercuric.net/nwn/heatmap2.png"><img title="Heatmap GUI" src="http://www.mercuric.net/nwn/heatmap2.png" alt="" width="327" height="184" /></a><p class="wp-caption-text">The finished GUI.</p></div>
<p>Besides that, I&#8217;m very happy with my approach to scaling the gradient for maximum contrast over the map.  The data set mapped in this screenshot, for example, has a massive concentration of points at the gate near the bottom left, and relatively sparse concentrations almost everywhere else.  The simplest approach to scaling the gradient is a linear transition from minimum to maximum heat values, but this results in a hot point at the large concentration and cool-looking points over the rest of the map.</p>
<p>I fought with a few different approaches before I realized that I could approach most data sets as being vaguely normal distributions (albeit often skewed left or right).  This means percentiles are meaningful, and I can map them to particular points on the color gradient (e.g. dark blue is the 20th percentile, green the 60th, etc.).  Rather than some of my dead-end approaches, which required manual tweaking to get a map that looks good, this allows the program to calibrate automatically to the shape of the data set, leaving just a few intuitive parameters to twiddle until the user is satisfied.</p>
<p>In the interest of minimizing the number of times the wheel must be invented, the (C#) code is available <a href="http://www.mercuric.net/nwn/HeatMapSrc.7z">here</a>.  Do whatever you want with it, though I&#8217;d love to hear from you if you find it useful!</p>
<p>(As an aside, WordPress seems to change my C# tag to C++ whenever I save the post.  Suppose I&#8217;ll do without for now.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mercuric.net/2010/08/heatmap-generation/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
