<?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>DivNull Productions &#187; Software</title>
	<atom:link href="http://divnull.com/blog/topics/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://divnull.com/blog</link>
	<description>Undefinable.</description>
	<lastBuildDate>Wed, 16 May 2012 01:00:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>LDraw language grammar for TextMate</title>
		<link>http://divnull.com/blog/2012/textmate-ldraw/</link>
		<comments>http://divnull.com/blog/2012/textmate-ldraw/#comments</comments>
		<pubDate>Wed, 16 May 2012 01:00:12 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[LDraw]]></category>
		<category><![CDATA[TextMate]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=710</guid>
		<description><![CDATA[Data files for LDraw software, such as Bricksmith, are really just text files with a specific syntax, and it can be useful to treat these files as text by opening them in a text editor and manipulating the source directly. This is particularly true if you are using LPub to build instructions for the model, [...]]]></description>
			<content:encoded><![CDATA[<p>Data files for <a href="http://www.ldraw.org/">LDraw</a> software, such as <a href="http://bricksmith.sourceforge.net/">Bricksmith</a>, are really just text files with a specific syntax, and it can be useful to treat these files as text by opening them in a text editor and manipulating the source directly. This is particularly true if you are using <a href="http://sourceforge.net/projects/lpub4/">LPub</a> to build instructions for the model, as editing the text directly is the only way to add certain commands to the file.</p>
<p>My text editor of choice, <a href="http://macromates.com/">TextMate</a>, supports large numbers of <a href="http://manual.macromates.com/en/language_grammars.html">language grammars</a> to provide syntax coloring. It also allows you to add your own. I threw together this one to get a bit of coloring into <code>.ldr</code> files:</p>
<blockquote>
<pre>{
   scopeName = 'source.ldr';
   firstLineMatch = '^0 FILE .+\.ldr$';
   fileTypes = ( 'ldr' );
   patterns = (
      {
	name = 'comment.line.ldraw';
        match = '^0 [^!].*$\n?';
      },
      {
	name = 'constant.other.ldraw';
        match = '^0 !.*$\n?';
      },
   );
}</pre>
</blockquote>
<p>To install this, pick Bundles&rarr;Bundle Editor&rarr;Edit Languages&hellip; from the menu bar. Click the &plus; at the bottom of the window that comes up to create a new item. Then cut and paste the grammar. This should make your LDraw files go from what is shown on the left, to what is on the right:<br />
<img src="http://divnull.com/blog/wp-content/uploads/2012/05/textmate-ldraw.png" alt="Application of TextMate grammar" title="textmate-ldraw" width="553" height="340" class="aligncenter size-full wp-image-713" /></p>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=710&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2012/textmate-ldraw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DropUnlock, DropNuke and Lion</title>
		<link>http://divnull.com/blog/2012/dropunlock-dropnuke-and-lion/</link>
		<comments>http://divnull.com/blog/2012/dropunlock-dropnuke-and-lion/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 18:23:19 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[DropNuke]]></category>
		<category><![CDATA[DropScript]]></category>
		<category><![CDATA[DropUnlock]]></category>
		<category><![CDATA[Lion]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=658</guid>
		<description><![CDATA[DropNuke and DropUnlock were created solely to solve an odd hiccup in the early days of OS X, a problem that was fixed years ago. Since discontinuing DropNuke, however, I&#8217;ve received a handful of mails, replies and messages from people who used DropNuke beyond its original purpose. These have increased since Lion was released because, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://divnull.com/blog/products/software/#drop">DropNuke and DropUnlock</a> were created solely to solve an odd hiccup in the early days of OS X, a problem that was fixed years ago. Since <a href="http://divnull.com/blog/2011/dropnuke-discontinued/">discontinuing DropNuke</a>, however, I&#8217;ve received a handful of mails, replies and messages from people who used DropNuke beyond its original purpose. These have increased since Lion was released because, as PowerPC applications, neither DropNuke nor DropUnlock run under Lion.</p>
<p>Upgrading these applications, however, is not just a matter of recompiling them as Intel apps, because DropNuke and DropUnlock were not created in a traditional way. Creation of these applications took less than an hour, most of which was spent designing the icons. The actual &#8220;coding&#8221; took less time than it took to write this post. This rapid development time isn&#8217;t because I&#8217;m a fast coder; it&#8217;s because the apps are the output of Wilfredo S&aacute;nchez&#8217;s utility <a href="http://www.mit.edu/people/wsanchez/software/">DropScript</a>. What this application did is take Unix shell scripts (as well as Perl, Python, etc.) and wrap a Mac application around them that, when a file was dropped on the application, would execute the script passing the file as a parameter. Here is the complete code for DropNuke (which has been downloadable from the link at the top of this post since the apps were created):</p>
<pre><code class="bash">#!/bin/sh
# EXTENSIONS : "*"
# OSTYPES    : "****"

for file; do
  location=$(dirname "$file")
  cd "${location}"
  chflags -R nouchg "${file}"
  rm -Rf "${file}"
done</code></pre>
<p>The DropUnlock code is even simpler, eliminating the last <code>rm</code> call. Looking at the script now, I&#8217;m not even sure the first two lines in the loop even need to be there. In any case, you can see there isn&#8217;t much to these scripts. The real work is done by DropScript. </p>
<p>Alas, DropScript is a PowerPC application that produces PowerPC applications. Someone hell-bent on building Lion-compatible versions of DropNuke and DropUnlock would need to do the following:</p>
<ol>
<li>Download the <a href="http://thor.divnull.com/pub/divnull/droppedscripts.tar.gz">source of the scripts</a>.</li>
<li>Do one of the following:
<ol style="list-style-type: lower-alpha">
<li>Wait for Wilfredo S&aacute;nchez to update DropScript to support Intel applications.</li>
<li>Download the <a href="http://www.mit.edu/people/wsanchez/software/darwin/DropScript.tgz">source code to DropScript</a> and get it working on Intel machines yourself. This might be a simple matter of just getting it to compile and rebuilding it, but I suspect not. It is likely that creating Intel apps from code is quite different than creating PowerPC apps was, back in the day.</li>
</ol>
</li>
<li>Run the resulting Intel-enabled version of DropScript and use it to build DropNuke and DropUnlock.</li>
<li>Optionally, extract the icons from the original apps and apply them to the newly created versions.</li>
</ol>
<p>Since I consider DropNuke too dangerous to release in the wild again (no more email about stray alias resolution accidentally deleting several terabytes of server data, thank you), and DropUnlock no longer really serves a purpose, I won&#8217;t be doing any of the above. All this code is available to you though. If you get it working, please drop me a line.</p>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=658&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2012/dropunlock-dropnuke-and-lion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FUDGE d12 for Dicenomicon</title>
		<link>http://divnull.com/blog/2012/fudge-d12-for-dicenomicon/</link>
		<comments>http://divnull.com/blog/2012/fudge-d12-for-dicenomicon/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 15:15:04 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Roleplaying]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[dicenomicon]]></category>
		<category><![CDATA[fate]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=648</guid>
		<description><![CDATA[Since Dicenomicon, my preferred dice roller for iOS allows for the creation and (cumbersome) sharing of custom dice definitions, I threw together a definition for a d12 that can be used for FATE games. Odds are the same as standard FUDGE dice (equal chances of &#8220;&plus;&#8221;, &#8220;&#8722;&#8221; or &#8220;&#160;&#8221;). They look like this: You can [...]]]></description>
			<content:encoded><![CDATA[<p>Since <a href="http://www.gandreas.com/iphone/dicenomicon/">Dicenomicon</a>, my preferred dice roller for iOS allows for the creation and (cumbersome) sharing of custom dice definitions, I threw together a definition for a d12 that can be used for <a href="http://www.faterpg.com/resources/">FATE games</a>. Odds are the same as standard FUDGE dice (equal chances of &#8220;&plus;&#8221;, &#8220;&minus;&#8221; or &#8220;&nbsp;&#8221;). They look like this:</p>
<p><center><img src="http://divnull.com/blog/wp-content/uploads/2012/01/Fated12.png" alt="Fate d12" title="Fate d12" width="211" height="317" class="aligncenter size-full wp-image-649" /></center></p>
<p>You can grab the file here (might need to right click on the link and &#8220;Save URL as&hellip;&#8221;): <a href="http://thor.divnull.com/pub/dice/Fa12.dicenc">Fate d12 definition for Dicenomicon</a>.</p>
<p>How to use this file is not explained that well in the app and not that obvious. And way harder than it should be. I&#8217;d love to say &#8220;go to the obvious screen in Dicenomicon and type in this URL to download it&#8221;, but I can&#8217;t, because that inexplicably isn&#8217;t an option. There are supposed to be several ways to get the file there, but most of them don&#8217;t work (the &#8220;import from documents&#8221; route fails with a &#8220;stream had too few bytes&#8221; error). </p>
<ol>
<li>Download the definition file.</li>
<li>On your iOS device, launch Dicenomoicon and hit the info button in the top right.</li>
<li>Tap &#8220;Sharing&#8221;.</li>
<li>Tap &#8220;Web-based Editor&#8221;.</li>
<li>You are about to turn your device into a web server, briefly. Make up a username and password and tap &#8220;Start Server&#8221;.</li>
<li>At the bottom of the screen, your device will display a URL to use. Open a browser on your computer (assuming it is on the same network as the iOS device) and go to that URL. When asked for a username and password, enter the one you just made up.</li>
<li>In the page that comes up, click &#8220;Upload File&#8221;.</li>
<li>Choose the dice definition you downloaded. Select &#8220;Numeric Die&#8221; in the &#8220;Kind of Upload&#8221; popup. Click &#8220;Submit&#8221;.</li>
<li>Back in Dicenomicon, stop the server and go back to the main settings screen.</li>
<li>Tap &#8220;Customize&#8221;.</li>
<li>Tap &#8220;Custom Dice&#8221;. You should see the new &#8220;Fa12: Fate d12&#8243; in the list.</li>
<li>So back to the customize screen. Tap &#8220;Dice Bar&#8221;.</li>
<li>Tap &#8220;Edit&#8221;.</li>
<li>Scroll to the bottom on the list and tap &#8220;Add Die&hellip;&#8221;.</li>
<li>A &#8220;d6&#8243; will be added to the end of the list. In spite of being in Edit mode, you can&#8217;t edit this new die and this point. Tap &#8220;Done&#8221; instead, even though you are not.</li>
<li>Now tap the new &#8220;d6&#8243; at the end of the list.</li>
<li>In the screen that comes up, you will see a &#8220;d6&#8243; in a circle. Double-tap it.</li>
<li>In the dialog that comes up, choose &#8220;Custom Numeric Die&#8221;.</li>
<li>In the selector that comes up, choose &#8220;Fa12: Fate d12&#8243;.</li>
<li>Click Done. Go all the way back to the main screen.</li>
<li>At the end of your dice bar, you should see &#8220;Fa12&#8243;, which you can now use like any other die.</li>
</ol>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=648&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2012/fudge-d12-for-dicenomicon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3dConnexion support in Bricksmith 2.5</title>
		<link>http://divnull.com/blog/2011/3dconnexion-support-in-bricksmith/</link>
		<comments>http://divnull.com/blog/2011/3dconnexion-support-in-bricksmith/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 14:03:09 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[3dconnexion]]></category>
		<category><![CDATA[bricksmith]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=576</guid>
		<description><![CDATA[A few months ago, Allen Smith released Bricksmith 2.5, which contains my code contributions for supporting 3dConnexion three dimensional mice, such as the SpaceNavigator. This code is still a bit experimental, but it allows the faster, 3D positioning of bricks. The implementation uses Bricksmith&#8217;s &#8220;quantized&#8221; movement, where bricks move in discrete increments based on a [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago, Allen Smith released <a href="http://bricksmith.sourceforge.net/">Bricksmith 2.5</a>, which contains my <a href="http://bricksmith.svn.sourceforge.net/viewvc/bricksmith?view=revision&#038;revision=383">code contributions</a> for supporting <a href="http://www.3dconnexion.com/">3dConnexion</a> three dimensional mice, such as the <a href="http://www.3dconnexion.com/products/spacenavigator.html">SpaceNavigator</a>. This code is still a bit experimental, but it allows the faster, 3D positioning of bricks.</p>
<p>The implementation uses Bricksmith&#8217;s &#8220;quantized&#8221; movement, where bricks move in discrete increments based on a (frequently changing) user setting. While this is a bit unusual for 3d mouse control, it fits better with the way Bricksmith works, and how users typically will want bricks to move. A more typical 3d &#8220;full-motion&#8221; mode can also be used by holding down the control key while moving the 3d mouse. (This is slightly similar to applications that use &#8220;snap to grid&#8221; features, but allow the grid to be ignored by holding down the control key.)</p>
<p>I had intended to include a video in this post demonstrating how the mouse worked with Bricksmith; however, since 2.5 was released in April and I haven&#8217;t made such a video yet, it&#8217;s a good bet that I won&#8217;t in the next six months either. So, you&#8217;ll just have to trust me that it is totally awesome.</p>
<p>If you are one of the few that both uses a 3dConnexion mouse and Bricksmith, I&#8217;d love to hear how it works for you. Heck, I&#8217;d love to hear that you even exist.</p>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=576&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2011/3dconnexion-support-in-bricksmith/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DropNuke discontinued</title>
		<link>http://divnull.com/blog/2011/dropnuke-discontinued/</link>
		<comments>http://divnull.com/blog/2011/dropnuke-discontinued/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 18:15:09 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[DropNuke]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=160</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://divnull.com/blog/wp-content/uploads/2008/08/plate_drop.png" alt="DropUnlock" title="DropUnlock" width="300" height="150" class="size-full wp-image-34 plate alignright" align="right"" />When it was first released, Mac OS X had an odd problem: it allowed a user to <a href="http://forums.macosxhints.com/archive/index.php/t-50018.html">create files that they couldn&#8217;t delete</a>. This wound up having to do with a bug between way OS 9 could &#8220;lock&#8221; files colliding with the way OS X <a href="http://macos-x-server.com/wiki/index.php?title=Chflags_Intro">did something similar</a>. You could fix this on the command line, but I got sick of doing so, so built some quick utilities to handle this just by dragging and dropping.</p>
<p>One of these, <a href="http://divnull.com/blog/products/software/#drop">DropUnlock</a>, is still available, but today DivNull is officially discontinuing DropNuke. As you would expect with something named &#8220;DropNuke&#8221;, this version of the utility was pretty much the final option, a scorched earth way of permanently dealing with an undeletable file (using not only <code>chflags</code> calls, but also <code>rm -rf</code>). As you can tell by the warnings on its old download page, you could wreak a lot of havoc with DropNuke if you didn&#8217;t know what you are doing.</p>
<p>Since the &#8220;undeletable file&#8221; problem has been addressed in subsequent versions of OS X, and DropUnlock still exists for people still using the old version, it seems smarter to remove DropNuke, just in case.</p>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=160&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2011/dropnuke-discontinued/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Brookhaven recycling schedule in iCal</title>
		<link>http://divnull.com/blog/2011/brookhaven-recycling-schedule-in-ical/</link>
		<comments>http://divnull.com/blog/2011/brookhaven-recycling-schedule-in-ical/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 03:21:55 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[calendar]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=495</guid>
		<description><![CDATA[If, for some reason, you really need an iCal version of the recycling schedule in the north part of Brookhaven, New York, here it is: Brookhaven North Recycling. I&#8217;ll try to keep this updated each year. Note that the iCalendar format is compatible with most calendaring systems, including iCal, Google Calendar, Lotus Notes, Outlook, and [...]]]></description>
			<content:encoded><![CDATA[<p>If, for some reason, you really need an iCal version of the recycling schedule in the north part of Brookhaven, New York, here it is: <a href="webcal://icalx.com/public/Wordman/Brookhaven%20North%20Recycling.ics">Brookhaven North Recycling</a>.</p>
<p>I&#8217;ll try to keep this updated each year.</p>
<p>Note that the <a href="http://en.wikipedia.org/wiki/ICalendar">iCalendar format</a> is compatible with most calendaring systems, including iCal, Google Calendar, Lotus Notes, Outlook, and so on.</p>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=495&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2011/brookhaven-recycling-schedule-in-ical/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roleplaying dates calendar</title>
		<link>http://divnull.com/blog/2010/roleplaying-dates-calendar/</link>
		<comments>http://divnull.com/blog/2010/roleplaying-dates-calendar/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 04:47:21 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[calendar]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=300</guid>
		<description><![CDATA[The Roleplaying Dates calendar tracks important conventions and submission deadlines for players and designers of role-playing games. It is not intended to be an exhaustive list of all that is out there, but rather to track influential events. Please leave a comment if you want to see something added to it.]]></description>
			<content:encoded><![CDATA[<p>The <a href="webcal://icalx.com/public/Wordman/Roleplaying%20Dates.ics">Roleplaying Dates calendar</a> tracks important conventions and submission deadlines for players and designers of role-playing games. It is not intended to be an exhaustive list of all that is out there, but rather to track influential events.</p>
<p>Please leave a comment if you want to see something added to it.</p>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=300&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2010/roleplaying-dates-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Altering NFL Gamecenter to use entire screen</title>
		<link>http://divnull.com/blog/2009/altering-nfl-gamecenter-to-use-entire-screen/</link>
		<comments>http://divnull.com/blog/2009/altering-nfl-gamecenter-to-use-entire-screen/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 03:21:08 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[NFL]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=223</guid>
		<description><![CDATA[The NFL&#8217;s Gamecenter allows tracking of games that you can&#8217;t see on TV due to dumb networks or socialist rules. If you have more than one person viewing the game, what you might like to do is put a laptop on your coffee table to show one game, while everyone watches another. Unfortunately, the layout [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.nfl.com/gamecenter/">NFL&#8217;s Gamecenter</a> allows tracking of games that you can&#8217;t see on TV due to <a href="http://www.nfl.com/nflnetwork">dumb networks</a> or <a href="http://en.wikipedia.org/wiki/NFL_on_television#Television_policies">socialist rules</a>. If you have more than one person viewing the game, what you might like to do is put a laptop on your coffee table to show one game, while everyone watches another. Unfortunately, the layout of the page that tracks games does not lend itself to this. It has at least the following problems:</p>
<ul>
<li>Default fonts are too small.</li>
<li>Using the &#8220;larger font&#8221; menu choices improves some small fonts, but not others. Two of the main components of this screen are Flash files, so do not respond to this switch.</li>
<li>Advertisements take up a good portion of the prime real estate of the screen.</li>
<li>The screen doesn&#8217;t scale when you make your window wider, instead using a fixed-width, centered layout.</li>
<li>Large sections of the screen are essentially useless for tracking the game (such as the header), meaning you need to scroll carefully to optimize viewing of the interesting stuff.</li>
</ul>
<p>On a 15&#8243; MacBook Pro (1440&times;900), with a maximized screen (dock on the right), the result looks like this:</p>
<p><center><a href="http://divnull.com/blog/wp-content/uploads/2009/12/nfl-gamecenter.png" target="_blank"><img src="http://divnull.com/blog/wp-content/uploads/2009/12/nfl-gamecenter-half.png" alt="nfl-gamecenter" title="nfl-gamecenter" width="720" height="450" class="aligncenter size-medium wp-image-227" border="0" style="padding-bottom:10px;"/></a></center></p>
<p>Fortunately, the HTML markup of this page is reasonably good for altering (mostly because all the <code>div</code>s have ids), so it is possible to override the CSS for the page to fix most of these problems. Some browsers allow you to override the style of a page out of the box, but the process for doing this is <a href="http://kb.mozillazine.org/UserContent.css">fairly obscure</a> for Firefox. A much more user friendly method for overriding a sites CSS using Firefox is to use a plugin called <a href="https://addons.mozilla.org/en-US/firefox/addon/2108">Stylish</a>. This adds an icon in the lower right of your browser window that allows you to muck with the styles of the page you are viewing.</p>
<p>When you use CSS to alter a page, you are somewhat restricted by how good or bad the HTML of the page you are trying to alter is. While you can get extremely cute with CSS selectors, sometimes there just isn&#8217;t anything you can do. Fortunately, most of the things you&#8217;d like to do to the Gamecenter site are possible. There are a lot of ways you could hack it, but what follows will alter the game tracking pages to look something like this:</p>
<p><center><a href="http://divnull.com/blog/wp-content/uploads/2009/12/nfl-gamecenter-hack.png" target="_blank"><img src="http://divnull.com/blog/wp-content/uploads/2009/12/nfl-gamecenter-hack-half.png" alt="nfl-gamecenter-hack" title="nfl-gamecenter-hack" width="720" height="450" class="aligncenter size-medium wp-image-228" border="0" style="padding-bottom:10px;"/></a></center></p>
<p>To do this in Firefox, do the following:</p>
<ol>
<li>Install Stylish.</li>
<li>Navigate to the NFL Gamecenter page of the game you want to see.</li>
<li>Click on the Stylish icon in the lower right of the browser window.</li>
<li>In the menu that pops up, select &#8220;Write new style &rarr; For this URL&hellip;&#8221;.</li>
<li>In the dialog that comes up:
<ol>
<li>Name the style something like &#8220;NFL Gamecenter&#8221;.</li>
<li>Add some tags, such as &#8220;NFL&#8221;.</li>
<li><em>Replace</em> the script with the code below.</li>
</ol>
</li>
<li>Click &#8220;Save&#8221;.</li>
</ol>
<p>Now, any time you go to the Gamecenter part of the NFL site, you&#8217;ll see this hacked version. If you need to turn this off, you can click on the Stylish icon and select &#8220;Turn all styles off&#8221;. Also, unless you are using the exact screen size mentioned, you may need to tweak the CSS to match your screen. If you know CSS, there is nothing particularly surprising in the code of this alteration. Also, there is nothing in the code that is tied to Stylish itself; the same CSS should work for any other way of overriding the page style that you can come up with.</p>
<blockquote><pre><code>
@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document url-prefix('http://www.nfl.com/gamecenter/') {

/* Hide extra headers and stuff */
#hd-micro-nav-list, #hd-micro-nav-list, #tl, #header-content, div.tab-list-wrapper,
#gc-shop, #gc-discuss, #gc-track-search-ads, #gc-rr, div.w, div.t, #br, #gc-photos {
  display: none !important;
}

#hd {
  width: 1000px !important;
}

div.c {
  background: transparent !important;
}

/* Hide advertisements */
div#dc-header {
  display: none;
}

/* Left justify everything by default */
#com-nfl-doc, #hd {
  text-align: left !important;
}

#doc {
  margin: 0 0 !important;
}

#doc-wrap {
  padding-top: 0px !important;
}

#hd {
  height: 70px !important;
}

/* Scale the Flash file of the game scores, to make the font larger and
    reach across the screen. */
#hd-scorestrip-swf {
  height: 70px !important;
  width: 1380px !important;
}

#gc-team-stats {
  position: fixed !important;
  top: 70px !important;
  left: 990px !important;
  width: 380px !important;
  height: 280px !important;
  overflow: visible !important;
  z-index: 300 !important;
  padding: 5px !important;
  background-color: white !important;
  border: solid 1px #ddd !important;
  font-size: 14px;
}

#gc-last-score{
  position: fixed !important;
  top: 360px !important;
  left: 990px !important;
  width: 380px !important;
  height: 73px !important;
  overflow: visible !important;
  z-index: 300 !important;
  padding: 5px !important;
  background-color: white !important;
  border: solid 1px #ddd !important;
}

#gc-last-score h2 {
  width: 380px;
}

div.widget-inner {
  background-repeat: repeat-x !important;
}

#gc-current-drive {
  position: fixed !important;
  top: 450px !important;
  left: 6px !important;
  width: 760px !important;
  height: 335px !important;
  overflow: visible !important;
  z-index: 300 !important;
  padding: 5px !important;
  background-color: white !important;
  border: solid 1px #ddd !important;
  font-size: 16px !important;
}

#gc-current-drive-window {
  width: 750px !important;
  height: 320px !important;
}

#gc-current-drive-scroll-bar {
  height: 320px !important;
}

#gc-current-drive-scroll-track {
  height: 300px !important;
}

#gc-top-performers {
  position: fixed !important;
  top: 450px !important;
  left: 785px !important;
  width: 575px !important;
  height: 335px !important;
  overflow: visible !important;
  z-index: 300 !important;
  padding: 5px !important;
  background-color: white !important;
  border: solid 1px #ddd !important;
  font-size: 16px !important;
}

div.span-4 {
  width: 280px !important;
}

}
</code></pre>
</blockquote>
<p>The makers of Stylish allow uploading of scripts like this; <strike>however, their &#8220;new account&#8221; feature is broken as of this writing. Once this is corrected, this page will be updated with a link to the &#8220;official&#8221; version of this script, which should make installation even easier.</strike> It has been posted here: <a href="http://userstyles.org/styles/60277/nfl-gamecenter-use-more-of-the-screen">Stylish script for NFL Gamecenter</a></p>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=223&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2009/altering-nfl-gamecenter-to-use-entire-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analyzing a roll and keep system</title>
		<link>http://divnull.com/blog/2009/roll-and-keep/</link>
		<comments>http://divnull.com/blog/2009/roll-and-keep/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 16:42:42 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Roleplaying]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[Exalted]]></category>
		<category><![CDATA[probability]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[roll & keep]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=179</guid>
		<description><![CDATA[A &#8220;roll and keep&#8221; system can be tweaked by simple rules to provide some interesting probability distributions. This post will explain what a &#8220;roll and keep&#8221; system is, take a look at how one such system can be manipulated and provide some source code to experiment. Introduction Since the late 1980&#8242;s, certain roleplaying games have [...]]]></description>
			<content:encoded><![CDATA[<p>A &#8220;roll and keep&#8221; system can be tweaked by simple rules to provide some interesting probability distributions. This post will explain what a &#8220;roll and keep&#8221; system is, take a look at how one such system can be manipulated and provide some source code to experiment.</p>
<h3>Introduction</h3>
<p>Since the late 1980&#8242;s, certain roleplaying games have made use of &#8220;dice pool success&#8221; mechanics. Such systems roll a handful of similar dice (usually d6 or d10), with the number of dice usually determined by the traits of the character for whom the roll is being made. That is, typically someone with more skill in something will roll more dice, also referred to as having a &#8220;larger pool&#8221;. Usually, each die rolled is compared individually to some sort of target, and if the die meets or exceeds that number, the die is considered a &#8220;success&#8221;. The quality of the roll is determined by how many successes are generated (i.e. how many dice meet or exceed the target).</p>
<p>One appeal of this type of mechanic is that it allows many variables to affect the roll, using a number of different mechanisms. A system might allow the situation to alter to number of dice, the target number, the number of successes needed to reach a goal and so on. As a result, many variations on this the basic idea can be found in different games.</p>
<p>One type of variation is known as a &#8220;roll and keep&#8221; system. The idea here is that you roll your pool, but only get to keep some subset of the dice. For example, you might roll seven dice but only be able to keep three, selected after the roll is made. Obviously, players will typically pick the best three results.</p>
<p>While not many games use roll and keep systems, the appeal of them is twofold. First, it adds yet another variable into how the roll can be manipulated (i.e. changes to how many dice you keep). Second, and more importantly, it allows a game designer to exert some control over the maximum number of successes generated by a roll. That is, some pool-based systems can get intro trouble with &#8220;runaway successes&#8221;, where various imbalances between characters can get magnified, with some characters scoring ungodly numbers of successes. Using a roll and keep system allows a designer to focus on a &#8220;sweet spot&#8221; for the number of generate successes. This post aims to investigate what various rules variations do to a roll and keep system.</p>
<p>One caveat: this analysis starts with a very &#8220;crunchy&#8221; (rules-heavy) system, and mutates it into an even more crunchy system in some ways. The point is really to see what happens within the roll and keep system, rather than try to convince you that the result is somehow &#8220;good&#8221;. The system does what it does; it&#8217;s up to you to decide if that is <em>useful</em> to you.</p>
<h3>Start with an existing system</h3>
<p>To keep things slightly more focused, the starting point for this investigation will be a popular pool-based system from a game called <cite><a href="http://white-wolf.com/exalted/">Exalted</a></cite>. As written, this game does <em>not</em> use a roll and keep system, but it has a number of features that might be usefully implemented by changing it to a roll and keep system. Some of what follows might make a bit more sense if you know a bit about the world of <em>Exalted</em>, but you don&#8217;t really need to know the game to follow along. Some important ideas of the system, as written:</p>
<ul>
<li>It uses pools of d10s.</li>
<li>It uses a large number of &#8220;traits&#8221; rated (mostly) one through five. Some of these are called &#8220;Attributes&#8221;, some &#8220;Abilities&#8221;, but there are other kinds as well.</li>
<li>Pool size for any given test is based on one Attribute, one Ability and, optionally, one &#8220;specialty&#8221; (rated zero through three).</li>
<li>Dice that roll a seven or higher generate a &#8220;success&#8221;.</li>
<li>Dice that roll a ten count as two successes.</li>
<li>One important trait is called Essence and is a very rough measure of &#8220;power level&#8221; in the game. Mortals have an Essence of one. Very powerful gods have an Essence of ten.</li>
<li>Player characters in the game are superhuman, typically with an Essence of two to five.</li>
<li>Players have access to magic that allows them to (among other things) manipulate dice in various ways. For example, they might spend &#8220;points&#8221; of this magic (called motes) to buy extra dice for a roll, etc.</li>
<li>Player characters can be different <em>kinds</em> of superhuman, each kind having their own &#8220;style&#8221; of magic. These different kinds are explicitly not equal in the game, with some being &#8220;more powerful&#8221; than others.</li>
<li>Everything in the game that can use dice pools can gain a few additional dice for a roll just by giving a cool description of what they are doing. This is called &#8220;stunting&#8221;, and can provide from one to three dice.</li>
<li>Everything in the game that can use dice pools also has a set a traits called Virtues. If they are really desperate, anyone can &#8220;channel&#8221; a Virtue to gain dice for a roll. This is costly, and can only be done a limited number of times.
</ul>
<h3>Mutating into the roll and keep</h3>
<p>Changing this system to a roll and keep system requires answering two questions. First, what determines the basic limit on how many dice are kept? Second, how is this limit manipulated? The way the world of Exalted works suggests some choices here. After some experimentation, the key really comes back to the notion of the different &#8220;kinds&#8221; of character mentioned above and how these are intentionally not equal. Also important is that most rolling will be using magic, so what happens to the rolls when they are augmented matters more often than how rolls without magic work. While there are number of possibilities here, the following accentuates the differences of the kinds of characters. What seems to work is:</p>
<ul>
<li>As with the standard system, characters roll Attribute + Ability + Specialty.</li>
<li>Characters keep a number of dice equal to their Essence + 1. Note that this limit is intentionally on the low side, compared to the size of the pool. This has several ramifications but generally means that adjustments to the keep limit are more formidable than adjustments to pool size.</li>
<li>Stunting works as in the standard system, adding dice to the roll.</li>
<li>Virtue channeling adds to the number of dice you keep. (Also, for those who really know Exalted, in this system it does not cost Willpower.)</li>
<li>The different kinds of characters each have their own basic mechanism for manipulating a roll. (In Exalted terms, the following replace excellencies.) The names for the different types don&#8217;t matter so much, but are arranged by &#8220;power level&#8221;, from strongest to weakest:
<ul>
<li>Solars (and their offshoots) can spend 2m to buy one success, with a maximum of Ability successes added to a given roll.</li>
<li>Lunars, prior to rolling, can spend 1m to convert a pool die into a single success instead of rolling it, with a maximum of Attribute die so altered for a given roll.</li>
<li>Sidereals can pay a flat 3m to add one to the number of dice they roll, but count two successes for rolling 8 or 9 as well as 10.</li>
<li>Alchemicals can pay a flat 1m to raise the number of dice they keep by two. This can only be done once per test.</li>
<li>Terrestrials can pay 1m to add two dice to their pool. They may add up to Ability + Specialty dice to a given test.</li>
<li>Spirits, Fair Folk, Ghosts and other essence users can pay 1m to add one die to their pool, adding a maximum of Ability dice to a given test</li>
</ul>
</ul>
<h3>Example</h3>
<p>For a particular test, a character uses an Attribute rated at 2, an Ability rated at 4 and a specialty rated at 1. This provides a dice pool of seven dice. The character has an essence of 3, which means, after the roll, she will keep four of those dice.</p>
<p>Her roll is an extremely good one: 2, 5, 8, 9, 9, 10, 10. She obviously elects to keep the best four dice, which are 9, 9, 10, 10. Each 9 gives one success. The 10s give two successes each. Her total is six success.</p>
<p>Later she needs to make a very similar test (based on the same traits). This time, though, she describes her action in a really neat way, and is awarded two stunt die. While this makes the pool larger, it doesn&#8217;t change how many dice she can keep. This roll happens to turn out worse: 1, 2, 4, 5, 5, 5, 6, 8, 10. She still keeps four (5, 6, 8, 10), gaining three successes (one for the 8, two for the 10).</p>
<p>Even later, she has to make the same kind of test again. This time she is in real trouble. She describes well again, gaining two stunt dice. She also channels one of her virtues (rated 3), which allows her to keep three additional dice. She rolls well again: 3, 5, 6, 7, 7, 7, 8, 9, 10. Thanks to the channel, she keeps seven dice (6, 7, 7, 7, 8, 9, 10) giving seven successes.</p>
<h3>Running the numbers</h3>
<p>The various choices were analyzed using software simulation, written in Python (<a href="http://thor.divnull.com/pub/exalted/rollandkeep.py">source</a>). The simulation makes a million rolls using 30 dice each. For each roll, the stream of dice is used by a bunch of different &#8220;strategies&#8221;. Each strategy represents a type of character, adjusting its traits and, importantly, kind. The strategies are set up such that they cover all relevant combinations. Each of these is fed the 30 dice results, but how many they actually use depends on the strategy. If a strategy is supposed to have a pool size of 12 dice, it only takes the first 12 dice for its pool and ignores the rest. By working in this way, all of the strategies use roughly the &#8220;same&#8221; results for their million rolls. This is not exact, of course, as some strategies use more dice than others, but it provides a more &#8220;fair&#8221; comparison of the strategies (and is much faster than rolling pools independently for each strategy a million times each).</p>
<p>What turns out to be interesting here are graphs where the traits are kept constant, but the various magical effects are used <em>to the full extent allowed</em> (that is, solars always buy Ability successes, etc.). You can see from these how the magic works at each sort of &#8220;skill level&#8221;. (It is also illustrative to show how the &#8220;canon&#8221; system works. That is, the system that doesn&#8217;t use a roll and keep mechanism, but rather always keeps all dice.)</p>
<p>Consider characters at Essence 3, but with minimal traits. At this level, the results are fairly homogeneous, and the magic doesn&#8217;t change much:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-311000.png" alt="Essence 3, Att 1, Abl 1, Spec 0, Stunt 0, Virt 0" width="517" height="258"/></p>
<p>One thing to notice, though it doesn&#8217;t show on the graph very well, is that with their additional dice, terrestrials and spirits can occasionally get lucky enough to exceed the maximum achievable by a solar (about an 0.1% chance of getting six successes, while solars can only hit five), even though they do worse on average. This result will hold in any situation where the keep cap exceeds the standard pool size, which doesn&#8217;t happen that often. With traits this low, however, it still happens with virtue channeling/stunts:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-311023.png" alt="Essence 3, Att 1, Abl 1, Spec 0, Stunt 2, Virt 3" width="517" height="300"/></p>
<p>One oddity you see emerge here is that the because of the way sidereal magic works, they are more likely to get even numbers of successes than odd.</p>
<p>When traits move to 3 dots each, you can see another emergent behavior: when the base pool and the cap become close, without magic the basic &#8220;roll and keep&#8221; behaves very similarly to canon, but magic causes the various types of exalts to have much different expectations of success:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-333000.png" alt="Essence 3, Att 3, Abl 3, Spec 0, Stunt 0, Virt 0" width="517" height="300"/></p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-333023.png" alt="Essence 3, Att 3, Abl 3, Spec 0, Stunt 2, Virt 3" width="517" height="300"/></p>
<p>Also note the &#8220;canon&#8221; line in the graphs above. Bear in mind this is just a standard roll in the original system, without any magical augmentation. Since each die can possibly generate two successes (by rolling a 10), Exalted has a bigger issue with &#8220;runaway successes&#8221; than most other pool based games do. The &#8220;roll and keep&#8221; tends to keep runaway successes under the original system more constrained, with magic use having a bigger impact than luck.</p>
<p>Things get more interesting when you ignore the virtue channeling and add only some additional dice, say from a stunt or specialty. Since these two cases are mostly the same (the only difference being that three dice from a specialty help terrestrials more than three dice from a stunt would), we&#8217;ll look at the specialty case:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-333300.png" alt="Essence 3, Att 3, Abl 3, Spec 3, Stunt 0, Virt 0" width="517" height="300"/></p>
<p>Here, you can really see how the excellency differences play out:</p>
<ul>
<li>Solars are simply &#8220;more excellent&#8221; than the others, but since they are limited in how many successes they can buy, not overwhelmingly so. This is a departure from the canon rules, were the gap between solars and others can be severe.</li>
<li>Lunars have the same minimum and maximum successes as solars, but average one fewer success. Still they outshine other types.</li>
<li>Sidereals leave much more up to luck, but still regularly hit celestial levels of success. Their minimum is much lower than solar and lunars (they can still actually get zero successes), and their max is slightly lower, but they have a much flatter curve, that favors the high end.</li>
<li>Terrestrials, unlike celestials, can&#8217;t gain more with magic than without, but are much more likely to hit the high end of their range.</li>
<li>Alchemicals most closely match the canonical curve. They can do better than even solars, but not very often.</li>
<li>Spirits are similar to, but outmatched by, terrestrials.</li>
</ul>
<p>As the traits climb to five, all of these trends become more accentuated, and the higher powered exalts make better use of their increased skill:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-355300.png" alt="Essence 3, Att 5, Abl 5, Spec 3, Stunt 0, Virt 0" width="517" height="300"/></p>
<p>When you add stunts and channeling to mix, however, the odds tend to even out a bit, particularly for those in the mid power range:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-355323.png" alt="Essence 3, Att 5, Abl 5, Spec 3, Stunt 2, Virt 3" width="517" height="300"/></p>
<h3>Higher Essence</h3>
<p>As Essence increase to five (the realistic upper limit for PCs in most games), the keep limit becomes less relevant, particularly at average skill levels, because you are keeping nearly all of the dice you roll. You start to see a more canonical behavior of the magic:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-533000.png" alt="Essence 5, Att 3, Abl 3, Spec 0, Stunt 0, Virt 0" width="517" height="300"/></p>
<p>Once traits are maximized, however, the disparity between pool size and limit cap returns, and the difference between the types of characters become more pronounced:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-555300.png" alt="Essence 5, Att 5, Abl 5, Spec 3, Stunt 0, Virt 0" width="517" height="300"/></p>
<h3>The low end</h3>
<p>One thing that turns out to matter a lot in this analysis (and the reason Exalted is being used as a base) is the notion that rolling a 10 generates two successes. This mixes in interesting ways with the keep limit. Obviously, 10s are much more worth keeping but, more importantly, they allow the success count to exceed the keep limit. That is, even if you can only keep two dice, it&#8217;s possible to get four successes. Further, the more dice you roll, the more likely that outcome is.</p>
<p>For example, if you roll only two dice and keep both, the chance of getting four successes is only 1% (with a 34% chance of failure). If, however, you roll 12 dice and keep two, the chances of four successes is closer to 35% (with the chance of failure dropping to around 0.2%). So, the limit and the 10s rule combine to reign in the number of total possible successes, but yet still let skill matter.</p>
<p>This is easier to see when looking at the results for the low end of the power scale: Essence 1 characters. Since mortals can&#8217;t use magic (and everyone that can use magic has Essence 2 or more), graphs at this level are more simple. At this level, it is a bit more useful to look at how the roll and keep results change the dynamics of the game compared to the canonical system.</p>
<p>One twist here is that Exalted divides mortals into two groups: standard mortals and heroic mortals. The difference is that, for standard mortals, rolling a 10 only generates one success. This changes things a lot for them. (If you suspect that mortals are a bit screwed in the world of Exalted, you&#8217;d be totally right.)</p>
<p>Let&#8217;s look at a minimal mortal, with all traits at one. Since the keep limit equals the number of dice, this works just like canon, so is not particularly interesting, but consider when this character stunts:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-111020x.png" alt="Essence 1, Att 1, Abl 1, Spec 0, Stunt 2, Virt 0" width="519" height="267"/></p>
<p>Heroic mortals cannot do better than four successes here, even with the stunt, because stunting doesn&#8217;t change the cap. The standard mortal can only get two successes in this situation. Compared to not stunting, the difference for the standard mortal is a drastic increases the likelihood of getting two successes (from around 16% to 53%), and decrease the chance of failure (from 36% to 13%).</p>
<p>You can also see how, compared to canon, the 2+ success results are &#8220;compressed&#8221; into a lower range.</p>
<p>But what if, instead of stunting, they channel a virtue (rating 3)? Looks like this:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-111003x.png" alt="Essence 1, Att 1, Abl 1, Spec 0, Stunt 0, Virt 3" width="519" height="267"/></p>
<p>Under r&#038;k, the mortals <em>still</em> can&#8217;t crack four and two successes, respectively. In this case, the culprit is the size of their dice pool. Their keep limit is over twice the size of how many dice they actually can roll. The canon case has much different behavior here, as it is rolling five dice instead of just two.</p>
<p>Channeling a virtue in this situation is much worse for the mortal than a stunt. This turns out to be more of a fringe case, but it has an interesting effect: mortals simply cannot do &#8220;legendary&#8221; things, unless they both stunt <em>and</em> channel. Or, put another way, it is <em>possible</em> for even the weakest mortals to do awesome things if they stunt like hell and pour their heart into it:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-111023x.png" alt="Essence 1, Att 1, Abl 1, Spec 0, Stunt 2, Virt 3" width="519" height="267"/></p>
<p>You can really see the divergence from canon here. Compare standard mortals in canon to heroes in r&#038;k, for example. In this case, canon mortals gain 7 successes 3 times out of every two thousand rolls. Heroes in r&#038;k don&#8217;t do this as often, though they can get 8 successes while standard canon mortals can&#8217;t (meanwhile, canonical heroes can get as many as 14). Note that standard r&#038;k mortals <em>still</em> cannot achieve &#8220;legendary&#8221; successes, though they could with a higher virtue.</p>
<p>As mortal traits increase, the result of raising their attributes doesn&#8217;t affect their success caps, but moves their results more reliably to the higher end of that cap:</p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-133000x.png" alt="Essence 1, Att 3, Abl 3, Spec 0, Stunt 0, Virt 0" width="519" height="267"/></p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-133023x.png" alt="Essence 1, Att 3, Abl 3, Spec 0, Stunt 2, Virt 3" width="519" height="267"/></p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-155000x.png" alt="Essence 1, Att 5, Abl 5, Spec 0, Stunt 0, Virt 0" width="517" height="265"/></p>
<p style="text-align: center; margin-bottom: 3px"><img src="http://rpg.divnull.com/exalted/images/rollkeep-155023x.png" alt="Essence 1, Att 5, Abl 5, Spec 0, Stunt 2, Virt 3" width="517" height="265"/></p>
<p>So, on the low end, this system seems to at least function, and does a fairly good job of &#8220;keeping the man down&#8221;. Can&#8217;t have mortals get too uppity. With enough stunting and heart, they can still do &#8220;legendary&#8221; things.</p>
<h3>Conclusions</h3>
<p>While initially intended to be a somewhat generic look at how you might manipulate a roll and keep system, the results actually turn out to depend heavily on the specifics of the original system used, particularly the rule that awards two successes on a 10.</p>
<p>On the other hand, if you consider the specific flavor of the game in question, you actually can use roll and keep to make the game work a bit more like it is described. That is, with some minor mechanical changes, the success rate of the various kinds of exalted can be tinkered with until they match the relative power levels implied by the game&#8217;s descriptions, all in a way that minimizes the huge success disparity of the original system.</p>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=179&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2009/roll-and-keep/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making d20 SRD spell cards using XSL and FOP</title>
		<link>http://divnull.com/blog/2007/making-d20-srd-spell-cards-using-xsl-and-fop/</link>
		<comments>http://divnull.com/blog/2007/making-d20-srd-spell-cards-using-xsl-and-fop/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 00:42:34 +0000</pubDate>
		<dc:creator>wordman</dc:creator>
				<category><![CDATA[Roleplaying]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://divnull.com/blog/?p=163</guid>
		<description><![CDATA[Some popular, rules-heavy roleplaying games can benefit from reference cards, where all the information about a specific item is printed on a small card, allowing each player to have a stack of cards specifically for the rules she cares about. This post deals specifically with creating such cards for spells, one per card. While you [...]]]></description>
			<content:encoded><![CDATA[<p>Some <a href="http://en.wikipedia.org/wiki/D20_System">popular, rules-heavy roleplaying games</a> can benefit from reference cards, where all the information about a specific item is printed on a small card, allowing each player to have a stack of cards specifically for the rules she cares about. This post deals specifically with creating such cards for spells, one per card. While you can spend six bucks on a <a href="http://www.theothergamecompany.com/projects/spellcards.htm">spell card PDF</a> to print out at your own expense and cut with a paper cutter, why do this you can spend ten bucks to buy <a href="http://www.avery.com/us/products/landing/cards/">Avery&reg; business cards</a> and build the output yourself?</p>
<p>This post acts as a how-to describing how you can build such cards yourself, should the muse strike you. More generally, it demonstrates how you can use two different but complementary XML-based technologies (<a href="">XSLT</a> and <a href="http://xmlgraphics.apache.org/fop/">FOP</a>) to format output for Avery business cards, mailing labels, etc. from an XML data source. An assumption is made that you know what XML is and have enough technical chops to install and setup the various technologies involved.</p>
<h3>Formatting Objects Processor</h3>
<p>The Formatting Objects Processor (FOP) is a free, cross-platform technology from <a href="http://xmlgraphics.apache.org/fop/">Apache</a>. It claims to be &#8220;driven by XSL formatting objects (XSL-FO)&#8221;. All this really means is that it makes use of a specific XML format called XSL-FO, which is built to represent printed page layout. FOP can read in this format and render it into a wide variety of output, including text, PostScript and the format we&#8217;ll be using here, PDF. The <a href="http://www.w3schools.com/xslfo/default.asp">XSL-FO</a> standard has enough in common with HTML that its basics are fairly simple to pickup if you know that language; however, it is more complicated and much more accurate, capable of millimeter-level control over the output.</p>
<p>In principle, all you need to to use FOP is a source file written in XSL-FO markup. Nearly every demo you&#8217;ll find on the web uses the same mechanism of generating this source that we will (XSLT, see below); however, FOP really doesn&#8217;t care where it comes from. Keep in mind that it&#8217;s just an XML file, so you could just as easily, say, build the XSL-FO with a Perl script or even by hand. Typically, you will also have some source of data in hand, such as a database or text file. In our case, we have some XML data in a totally different format.</p>
<h3>The d20 Standard Reference Document in XML</h3>
<p>The d20 game uses a (mostly) open standard, based around the <a href="http://www.d20srd.org/">d20 Standard Reference Document</a>. Fortunately for us, an enterprising soul named Andargor has gone through the trouble of translating this <a href="http://www.andargor.com/">SRD into XML</a> and some other data-based formats. His XML files use a fairly straight-forward format of his invention. This format, of course, is pure data and nothing like the XSL-FO layout format. Nor should it be. So, what we need is something to translate the d20 XML into the XSL-FO markup describing the page layout we want.</p>
<h3>Extensible Stylesheet Language Transformations</h3>
<p>Many paths exist to convert the d20 XML into XSL-FO. Python scripts, Java, heck even sed. We&#8217;re using a technology meant to transform XML input into some other kind of output (usually XML, HTML or text) called the <a href="http://www.w3schools.com/xsl/">Extensible Stylesheet Language</a> (XSL). XSL is yet another special XML format geared towards matching XML data and transforming it. (It is, believe it or not, <a href="http://www.unidex.com/turing/utm.htm">turing complete</a>.) It makes heavy use of a standard called <a href="http://www.w3schools.com/xpath/">XPath</a>, which is a funky query language for specifying exact subsets of nodes within an XML document. Though XPath looks nothing like SQL, it is similar in purpose, except querying a hierarchy tree instead of relational tables.</p>
<p>An XSL transformation (XSLT) is specified in an <code>.xsl</code> file. Typically, such files are very specific, written exactly for the combination of data type being transformed and output format being written. That is, the XSL file we use here is specifically for turning the d20 SRD XML format into XSL-FO formatted for Avery business cards. If you need to change either end of this, you should make a copy of the file and mutate it into a new transformation that does what you need.</p>
<h3>Tools</h3>
<p>We need some kind of tool that allows a two-step workflow (or knows how to combine the two steps into one). First, we convert the d20 SRD XML data into XSL-FO using XSLT. (That&#8217;s a lot of acronyms.) Second, we take the result of that and feed it into FOP to build our PDF. The four files are involved are:</p>
<ol>
<li><code>spells.xml</code> &#8211; The d20 XML data containing all the spells in the SRD.</li>
<li><code>spellcards.xsl</code> &#8211; The XSLT to do the translation into XSL-FO.</li>
<li><code>temp.fo</code> &#8211; The XSL-FO generated by the transformation.</li>
<li><code>spellcards.pdf</code> &#8211; The final PDF file.</li>
</ol>
<p>A number of tools exist to do this. I happen to use <a href="http://www.oxygenxml.com/">oXygen</a>, as it combines everything needed to run this process into a single step, and also functions as a very good XML and XSLT editor. It&#8217;s a powerful tool, but pricey. <a href="http://www.stylusstudio.com/">Stylus Studio</a> costs even more. Some less feature-rich alternatives might be <a href="http://www.entropy.ch/software/macosx/#testxslt">TestXSLT</a>. If you want to go the Java route, your best bet is to download the recent <a href="http://xmlgraphics.apache.org/fop/download.html">FOP package</a>, which contains the <a href="http://xml.apache.org/xalan-j/">Xalan</a> XSLT engine and a command line to use it. If you know of other tools, leave a comment with a URL.</p>
<h3>Steps</h3>
<p>Once you have the tools picked out, download the <a href="http://www.andargor.com/">XML d20 SRD</a> and find the <code>spells.xml</code> file. Now, take a look at the <a href="/blog/images/spellcards.xsl" target="_blank">transformation</a> file. It is fairly well commented. Save a copy of it to your local drive as your <code>spellcards.xsl</code> file. Now tell your tools to use <code>spellcards.xsl</code> to transform <code>spells.xml</code> into <code>temp.fo</code>, then channel it into FOP. </p>
<p>If using oXygen, do the following (note, there may be some changes between versions of oXygen, so this may not be exact):</p>
<ol>
<li>Open the two files.</li>
<li>Make <code>spellcards.xsl</code> the active document and select the menu &#8220;Document &rarr; XML Document &rarr; Configure Transformation Scenario&#8221;.</li>
<li>In the dialog that comes up, click &#8220;New&#8221;.</li>
<li>Name the scenario &#8220;spellcards&#8221; or something similar</li>
<li>In the dialog&#8217;s &#8220;XSLT&#8221; tab, set the &#8220;XML URL&#8221; to your local copy of <code>spells.xml</code>. You should be able to leave the other settings alone on this tab.</li>
<li>In the dialog&#8217;s &#8220;FO Processor&#8221; tab, check &#8220;Perform FO Processing&#8221; and make sure the &#8220;XSLT result as input&#8221; is selected. You want to use the &#8220;pdf&#8221; method and the built-in FOP.</li>
<li>In the dialog&#8217;s &#8220;Output&#8221; tab, click the &#8220;Save As&#8221; radio button and provide a place to save the <code>spellcards.pdf</code> file. Click the &#8220;Open in browser&#8221; checkbox and the &#8220;Saved file&#8221; radio button.</li>
<li>Click OK to close the dialog.</li>
<li>Back in the &#8220;Configure Transformation Scenario&#8221; dialog, you can click &#8220;Transform Now&#8221; to test out your settings.</li>
<li>Hopefully, you should be looking at a PDF now. If you need to run the transformation again, you can hit the big red &#8220;play button&#8221; toolbar icon (which is called &#8220;Apply Transformation Scenario&#8221;).
</li>
</ol>
<p>If you are using the command line tool that comes with FOP instead of oXygen, the command you need should be something like this:</p>
<blockquote><pre><code>fop -xml spells.xml -xsl spellcards.xsl -pdf spellcards.pdf</code></pre>
</blockquote>
<h3>Printing</h3>
<p>Once you have the PDF created, make a test print of one of the pages. Put this page behind one of the Avery business card pages and hold it up to the light to see how it lines up. Every printer feeds slightly differently, so you may need to tweak the measurements slightly to align the cards just right. You do this by altering the <code>spellcards.xsl</code> file.</p>
<p>Search this file for the word &#8220;tweak&#8221;. You&#8217;ll find a couple, which identify spots in the file that measurements can be altered. One place is the margins for the whole page. The other is the padding within a table cell. Adjust these until your test page lines up with the Avery labels. Once this all works, print out a test page on the Avery label paper. Hopefully it will still match up. If not, tweak again. Once it works, print them all.</p>
<p>Note, the measurement tweaking locations (as well as some nearby tags) within <code>spellcards.xsl</code> can be altered more radically to support other types of Avery pages, such as index cards or mailing labels.</p>
<h3>Filtering</h3>
<p>You may not want to make cards of every single thing in the <code>spells.xml</code> file. You can use different XPath statements within the <code>spellcards.xsl</code> file to select subsets of the data. There are two logical places to do this in the file, both of which can be found by searching for &#8220;filter&#8221; in the text.</p>
<p>The primary location is the select of the main <code>apply-templates</code> tag. In the file, there are a half-dozen or so alternate examples for this statement that you can use. Just comment out the first one and uncomment the one you want. You should be able to find a statement close to what you want and alter it to taste.</p>
<p>For more exotic filtering, there is a very slim chance that you what you want can&#8217;t be done in the main select. You can, instead, examine each spell as it comes through and make more complicated tests. The transformation file contains a skeleton to do such filtering, but always lets everything through. You&#8217;d need to change this to set <code>include</code> to true.</p>
<p>Filtering this data is harder than it could be, because the <code>level</code> tag in the <code>spells.xml</code> file is a string that combines <em>all</em> of the level information into a single field, rather than more structured data. For example, if a line like:</p>
<blockquote><pre><code>&lt;level&gt;Cleric 6, Druid 6, Sorcerer/Wizard 6&lt;/level&gt;</code></pre>
</blockquote>
<p>&hellip;was instead&hellip;</p>
<blockquote><pre><code>&lt;level&gt;
&nbsp;&lt;class&gt;Cleric&lt;/class&gt;
&nbsp;&lt;classlevel&gt;6&lt;/classlevel&gt;
&lt;/level&gt;
&lt;level&gt;
&nbsp;&lt;class&gt;Druid&lt;/class&gt;
&nbsp;&lt;classlevel&gt;6&lt;/classlevel&gt;
&lt;/level&gt;
&lt;level&gt;
&nbsp;&lt;class&gt;Sorcerer/Wizard&lt;/class&gt;
&nbsp;&lt;classlevel&gt;6&lt;/classlevel&gt;
&lt;/level&gt;</code></pre>
</blockquote>
<p>&hellip;it would be a lot easier to do more powerful XSLT filtering and sorting.</p>
<img src="http://divnull.com/blog/?ak_action=api_record_view&id=163&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://divnull.com/blog/2007/making-d20-srd-spell-cards-using-xsl-and-fop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

