<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Pitcher's Duel : A game simulating the sport of Baseball</title>
	<atom:link href="http://pitchersduel.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pitchersduel.wordpress.com</link>
	<description>Commentary on the development of a computer game in Python</description>
	<lastBuildDate>Thu, 14 Aug 2008 17:08:57 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='pitchersduel.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/de6feb99453731fb07c0d39516057fd0?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Pitcher's Duel : A game simulating the sport of Baseball</title>
		<link>http://pitchersduel.wordpress.com</link>
	</image>
			<item>
		<title>The odd behaviour of a pop fly</title>
		<link>http://pitchersduel.wordpress.com/2008/08/14/the-odd-behaviour-of-a-pop-fly/</link>
		<comments>http://pitchersduel.wordpress.com/2008/08/14/the-odd-behaviour-of-a-pop-fly/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 17:08:11 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/?p=86</guid>
		<description><![CDATA[http://webusers.npl.uiuc.edu/~a-nathan/pob/AJP-Aug2008.pdf
When I was testing the batter demo on pitcher&#8217;s duel, I observed some behaviour that seemed very odd.  The ball when hit sharply up, would seem to wander around.  Tracking it via its shadow directly below the ball, it would move back and forth over the foul line.  I thought at first this must be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=86&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="color:#800080;text-decoration:underline;"><a href="http://webusers.npl.uiuc.edu/~a-nathan/pob/AJP-Aug2008.pdf">http://webusers.npl.uiuc.edu/~a-nathan/pob/AJP-Aug2008.pdf</a></span></p>
<p>When I was testing the batter demo on pitcher&#8217;s duel, I observed some behaviour that seemed very odd.  The ball when hit sharply up, would seem to wander around.  Tracking it via its shadow directly below the ball, it would move back and forth over the foul line.  I thought at first this must be a bug, but the realized that is how popups behave.  The ball leaving the bat is severely undercut, and has a lot of backspin; the ball with backspin curves back toward the backstop as it rises.  When it  reaches its apex, though, it reverses direction without reversing spin.  As it falls, what was backspin is  now topspin, and pushes the ball towards the pitchers mound.  The path is thus a loop, and the shadow moves backward, then forward.  Follow the link for a much more detailed explanation.</p>
<p>The ball behaviour explains the way fielders, observed in MLB games, seem to wander back and forth tracking a pop fly.  They aren&#8217;t lost, they are just tracking the ball.</p>
<p>David</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/86/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/86/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=86&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2008/08/14/the-odd-behaviour-of-a-pop-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
		<item>
		<title>Nate Robins &#8211; OpenGL &#8211; Tutors</title>
		<link>http://pitchersduel.wordpress.com/2008/03/04/nate-robins-opengl-tutors/</link>
		<comments>http://pitchersduel.wordpress.com/2008/03/04/nate-robins-opengl-tutors/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 16:17:58 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/?p=83</guid>
		<description><![CDATA[Nate Robins &#8211; OpenGL &#8211; Tutors
 These are &#8216;Tutors&#8217;, not &#8216;Tutorials&#8217;.  More accurately, they are little laboratories for experimenting with OpenGL parameters.  Each laboratory has a graphic pane showing an object, and a pane showing the key functions for that aspect of OpenGL.  You can change the parameter values by dragging, and see immediately what is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=83&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.xmission.com/~nate/tutors.html">Nate Robins &#8211; OpenGL &#8211; Tutors</a></p>
<p> These are &#8216;Tutors&#8217;, not &#8216;Tutorials&#8217;.  More accurately, they are little laboratories for experimenting with OpenGL parameters.  Each laboratory has a graphic pane showing an object, and a pane showing the key functions for that aspect of OpenGL.  You can change the parameter values by dragging, and see immediately what is the visual effect of a parameter value change.</p>
<p>I just yesterday found the fog tutor very helpful in understanding why my own fog generation was not looking as it should (and in making it right).   Take a look.</p>
<p> David</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/83/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/83/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=83&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2008/03/04/nate-robins-opengl-tutors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
		<item>
		<title>HitTracker :: Home run tracking and distance measurement</title>
		<link>http://pitchersduel.wordpress.com/2008/02/28/hittracker-home-run-tracking-and-distance-measurement/</link>
		<comments>http://pitchersduel.wordpress.com/2008/02/28/hittracker-home-run-tracking-and-distance-measurement/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 18:36:14 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[baseball]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/?p=82</guid>
		<description><![CDATA[Home runs can be as slow as 90 mph off the bat.   This suprised me, at first, as that is the speed of a pitched fastball, and we do not imagine that someone can throw a baseball over the outfield fence from home plate.  However, a good strong arm can reach home plate on a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=82&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Home runs can be as slow as 90 mph off the bat.   This suprised me, at first, as that is the speed of a pitched fastball, and we do not imagine that someone can throw a baseball over the outfield fence from home plate.  However, a good strong arm can reach home plate on a throw from mid center field, and the nearest fence portions, of small ballparks such as Fenway, are as close as 325 ft.</p>
<p>There were two home runs at under 89.5 mph off the bat, but both were in-the-park home runs. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
<p>The fastest home runs were slightly over 122 mph, off the bat.</p>
<p><a href="http://www.hittrackeronline.com/">HitTracker :: Home run tracking and distance measurement</a> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/82/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/82/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=82&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2008/02/28/hittracker-home-run-tracking-and-distance-measurement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
		<item>
		<title>/branches/Lamina/</title>
		<link>http://pitchersduel.wordpress.com/2008/01/22/brancheslamina/</link>
		<comments>http://pitchersduel.wordpress.com/2008/01/22/brancheslamina/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 13:32:35 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/2008/01/22/brancheslamina/</guid>
		<description><![CDATA[This weekend was mildly productive.  I resolved the memory leak in Pitchers Duel, which was actually a memory leak in Lamina.   So I put a corrected version of Lamina in subversion; I also updated the demos to fail more politely in the absence of necessary GUI libraries.
I will try to get a new release packaged [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=81&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This weekend was mildly productive.  I resolved the memory leak in Pitchers Duel, which was actually a memory leak in Lamina.   So I put a corrected version of Lamina in subversion; I also updated the demos to fail more politely in the absence of necessary GUI libraries.</p>
<p>I will try to get a new release packaged up and put on Pypi this week, but the current code is available at the link below.</p>
<p><a href="http://pitchersduel.python-hosting.com/browser/branches/Lamina/">/branches/Lamina/Pitchers Duel</a></p>
<p>David</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/81/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/81/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=81&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2008/01/22/brancheslamina/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
		<item>
		<title>Maybe &#8216;Pitchers Duel&#8217; is not the best name.</title>
		<link>http://pitchersduel.wordpress.com/2007/12/11/maybe-pitchers-duel-is-not-the-best-name/</link>
		<comments>http://pitchersduel.wordpress.com/2007/12/11/maybe-pitchers-duel-is-not-the-best-name/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 15:33:48 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[baseball]]></category>
		<category><![CDATA[game-play]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/2007/12/11/maybe-pitchers-duel-is-not-the-best-name/</guid>
		<description><![CDATA[I like the term &#8216;Pitchers Duel&#8217;, because it describes a type of game that I enjoy thinking about.  Low score, few baserunners, many strikeouts.  Baserunning doesn&#8217;t matter much in these games, because rarely does a runner get on base.  The consistency of out-getting makes the contest look like a pure contest between pitchers:  Which pitcher will slip [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=76&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I like the term &#8216;Pitchers Duel&#8217;, because it describes a type of game that I enjoy thinking about.  Low score, few baserunners, many strikeouts.  Baserunning doesn&#8217;t matter much in these games, because rarely does a runner get on base.  The consistency of out-getting makes the contest look like a pure contest between pitchers:  Which pitcher will slip up first, and allow a run to score?</p>
<p>Most baseball fans, to the contrary, like high scoring games.  Baseball game attendence has increased in eras with high-scoring and dropped in low-scoring eras.   So I am considering alternative names for this computer game, that will appeal more to baseball fans.</p>
<p>The pitcher &#8211; catcher combo is known as the &#8216;battery&#8217;:</p>
<p><strong>      Battery plus</strong></p>
<p>Various phrases that emphasise the hitting aspect of the game:</p>
<p>       <strong>Bat and Ball / Ball and Bat</strong></p>
<p>       <strong>Batter Up</strong></p>
<p>       <strong>Ball and Stick</strong></p>
<p>A more balanced title that includes both sides of the contest: </p>
<p><strong>        Hit and Pitch</strong></p>
<p>This title represents the &#8216;moment of truth&#8217; in each at-bat, where you know you may get only one more pitch. </p>
<p>        <strong>Strike Two</strong></p>
<p>Both batters and pitchers are very concerned about the strikezone, its extents, whether a given pitch is in or out, and how the player fares in the balance of strikes vs balls.</p>
<p>       <strong>Strike Zone</strong></p>
<p>       <strong>Balls and Strikes</strong></p>
<p>      <strong>Ahead of the Count</strong></p>
<p>      <strong>Full Count</strong></p>
<p>A facetious, but sorta mean-spirited, option: </p>
<p>      <strong>NOT Barry Bonds</strong></p>
<p>Let me know what you feel is a good choice.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/76/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/76/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=76&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2007/12/11/maybe-pitchers-duel-is-not-the-best-name/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
		<item>
		<title>pausingreactor.py</title>
		<link>http://pitchersduel.wordpress.com/2007/12/09/pausingreactorpy/</link>
		<comments>http://pitchersduel.wordpress.com/2007/12/09/pausingreactorpy/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 12:23:54 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/2007/12/09/pausingreactorpy/</guid>
		<description><![CDATA[ This subclass of Twisted&#8217;s selectreactor has methods to yield control of the reactor to its caller, and resume control later.
The guts of mainLoop have been moved to a generator method, and mainLoop instantiates the generator and calls .next() on it.
There are new methods for new functionality.
.release() causes the mainLoop to yield at the end [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=80&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p> This subclass of Twisted&#8217;s <code>selectreactor</code> has methods to yield control of the reactor to its caller, and resume control later.</p>
<p>The guts of <code>mainLoop</code> have been moved to a generator method, and <code>mainLoop</code> instantiates the generator and calls <code>.next() </code>on it.</p>
<p>There are new methods for new functionality.</p>
<p><code>.release()</code> causes the <code>mainLoop</code> to <code>yield</code> at the end of its current iteration.</p>
<p><code>.resume()</code> transfers control back into the reactor.  A <code>.resume</code> call is like <code>.run</code>, in that it does not yield control until the next <code>.release</code> or <code>.stop</code>.</p>
<p><code>.isRunning()</code> tells you whether the reactor is running.</p>
<pre><code>

from twisted.python import log, failure, util
from twisted.internet.selectreactor import SelectReactor

class PausingReactor(SelectReactor):
    """Implement selectreactor that can be exited and resumed. """

    def __init__(self, *args):
        SelectReactor.__init__(self, *args)
        self._releaseRequested = False
        self._mainLoopGen = None

    def _mainLoopGenerater(self):
        """Generater that acts as mainLoop, but yields when
        requested.
        """
        while self.running:
            try:
                while self.running:
                    # Advance simulation time in delayed event
                    # processors.
                    self.runUntilCurrent()
                    t2 = self.timeout()
                    t = self.running and t2
                    self.doIteration(t)

                    if self._releaseRequested:
                        self._releaseRequested = False
                        yield None
            except:
                log.msg("Unexpected error in main loop.")
                log.deferr()
            else:
                log.msg('Main loop terminated.')

    def mainLoop(self):
        """Setup mainLoop generater, and initiate looping. """
        self._mainLoopGen = self._mainLoopGenerater()
        self.resume()

    def resume(self):
        """Resume mainLoop looping after interruption. """
        try:
            self._mainLoopGen.next()
        except StopIteration:
            pass

    def release(self):
        """Request main loop pause and reacter yield to caller. """
        self._releaseRequested = True

    def isRunning(self):
        """Is reactor running? """
        return self.running

def install():
    """Configure the twisted mainloop to be run using the pausingreactor.
    """
    reactor = PausingReactor()
    from twisted.internet.main import installReactor
    installReactor(reactor)

__all__ = ['install']

</code></pre>
<p>To use the module,<br />
<code>import pausingreactor; pausingreactor.install()</code></p>
<p>The pausingreactor module, and a couple of files to test it, are linked.  The stresstest.py sends increasing long strings to an echo type server &#8216;uppercaser_ns.py&#8217;, reads them back and checks them for intactness.  It also pauses a couple times per second for a fraction of a second.</p>
<p><a href="http://pitchersduel.python-hosting.com/file/branches/network/pausingreactor.py" target="_blank">pausingreactor.py</a><br />
<a href="http://pitchersduel.python-hosting.com/file/branches/network/stresstest.py"><br />
stresstest.py</a></p>
<p><a href="http://pitchersduel.python-hosting.com/file/branches/network/uppercaser_ns.py">uppercaser_ns.py</a></p>
<p>Enjoy.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/80/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/80/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=80&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2007/12/09/pausingreactorpy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
		<item>
		<title>Pausing Reactor</title>
		<link>http://pitchersduel.wordpress.com/2007/12/07/pausing-reactor/</link>
		<comments>http://pitchersduel.wordpress.com/2007/12/07/pausing-reactor/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 17:50:18 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/2007/12/07/pausing-reactor/</guid>
		<description><![CDATA[I have been considering networking options for months, and over the last couple of weeks have had time to explore specific options. I initially made exploratory forays into two disparate implementations: One approach was to write the game logic in &#8216;inside-out&#8217; form so that everything could be done by callback; the other approach was to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=79&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have been considering networking options for months, and over the last couple of weeks have had time to explore specific options. I initially made exploratory forays into two disparate implementations: One approach was to write the game logic in &#8216;inside-out&#8217; form so that everything could be done by callback; the other approach was to put the network code into another process, and pipe data to and from it via os pipes.</p>
<p>The &#8216;inside-out&#8217; approach would add significant burden to coding the game logic, and was abandoned after an evenings work. The separate process approach was making some headway, but I have put it aside as well, for yet another approach.</p>
<p>What I want(1) is a twisted reactor that can be exited and reentered. I could then use the substantial asset of proven twisted code for various high and low level operations, but use a conventional subroutine-oriented code structure. When an engine needs to exit, it can have the reactor <code>yield</code> to its caller; the caller then follows game logic to set up another engine, which <em>resumes</em> the reactor operation. The timing constraints would be the same as for a call-back, (ie: don&#8217;t delay the reactor more than necessary), but the game logic would be more readable and more writable without having to put <strong>everything</strong> in callbacks.</p>
<p>The usage would be like:</p>
<pre>
<code>
class Engine()
   def iterate(self):
       # do per frame stuff
       if self._done:  reactor.release() # yield to engine's caller
       else:   reactor.callLater(0, self.iterate)
   def run(self):
       # init stuff
       reactor.callLater(0, self.iterate)
       if reactor.isRunning(): reactor.resume()
       else:  reactor.run()    

def intro():
   # set up intro pages
   eng = Engine()
   eng.add(intro_pages)
   eng.run()   

def room(room_context):
   eng = Engine()
   eng.add(room_context)
   eng.run()
   return eng.retval   

def main():
   intro()
   # set up lobby context
   next = room(lobby_context)
   while next != GAME_EXIT:
        # set up context for next room
        next = room(room_context)           

</code></pre>
<p>The code is fairly readable, with more specialized function in specialized subroutines.  Calls to the engine can be from main(),  or from a subroutine a few calls deep.  </p>
<p>See my next post for the reactor subclass itself.</p>
<blockquote><p>1)<br />
OK, what I <em>really</em> want is a file-like connection object:<br />
con = Connection(&#8216;gameserver.org&#8217;)<br />
con.write(&#8216;game update data&#8217;, game_data)<br />
news = con.read()<br />
check = con.read_non_blocking()<br />
But I am not going to find (or write) that, so I&#8217;ll settle for an pause-able reactor.</p></blockquote>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/79/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/79/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=79&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2007/12/07/pausing-reactor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
		<item>
		<title>APRESS.COM : Beginning Game Development with Python and Pygame: Book Review</title>
		<link>http://pitchersduel.wordpress.com/2007/11/22/apresscom-beginning-game-development-with-python-and-pygame-from-novice-to-professional-9781590598726/</link>
		<comments>http://pitchersduel.wordpress.com/2007/11/22/apresscom-beginning-game-development-with-python-and-pygame-from-novice-to-professional-9781590598726/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 19:11:32 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[game-play]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/2007/11/22/apresscom-beginning-game-development-with-python-and-pygame-from-novice-to-professional-9781590598726/</guid>
		<description><![CDATA[APRESS.COM : Beginning Game Development with Python and Pygame: From Novice to Professional 
by Will McGugan
This book seems well fitted for a beginner, as it starts with a basic Python tutorial, and steps up gradually to more sophisticated material.  The book is more useful as a tutorial, describing a tank game with increasing complexity, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=75&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.apress.com/book/view/1590598725">APRESS.COM : Beginning Game Development with Python and Pygame: From Novice to Professional </a></p>
<p>by Will McGugan</p>
<p>This book seems well fitted for a beginner, as it starts with a basic Python tutorial, and steps up gradually to more sophisticated material.  The book is more useful as a tutorial, describing a tank game with increasing complexity, from interactive text to 2D animation, to 3D in OpenGL, than as a reference.</p>
<p>The chapter titles are meaningful, but task oriented, &#8216;making things move&#8217;, &#8216;user input&#8217;, &#8230;. &#8216;making things go boom&#8217;.   Once you&#8217;ve identified the chapter that might answer your question, you have to skim to find the material, though the material does have abundant subheadings, at least one per page, to help you in skimming.   There is a nice index of 20 pages, which seemed thorough, in that the half dozen items I looked up were all there.</p>
<p>Will covers a pretty good range of topics, including packaging, sound, openGL, artificial intelligence, and inputs.   The only section that surprised me in its presence was the &#8216;Moving into the third dimension&#8217;, in that he discusses the calculations involved in mapping 3D space to the 2D display.  Most 3D programmers, I suspect, just offload that calculation burden onto the OpenGL (or DirectX) engine, and do not do such translations ourselves.  Maybe the skills might be useful for people who want 3D effects in straight pygame, and the chapter may serve as a transition from the 2D material presented prior, to the OpenGL material to follow.   I just skimmed through briefly, as I was already familiar with OpenGL.</p>
<p>The only substantial omission I found was that networking was not addressed.  He may consider the networking options too unsettled at this point to be able to recommend a specific approach.</p>
<p>I was disappointed to not find any advice on determining which joystick button or mouse button is which.  Pygame recognizes buttons 1, 2, 3, etc.., but there is no firm rule on which number belongs to a given button on the input device.  The right mouse button is button 2, or button 3, depending on whether scroll-wheel is present, and I don&#8217;t know a systematic way to determine what buttons the user&#8217;s mouse has, and what numbers thy hold.  Maybe this problem doesn&#8217;t have a clear resolution.</p>
<p>I cant complete a review of a book on game programming in python without a comparison with the other book on the topic. Sean Riley&#8217;s &#8216;Game Programming with Python&#8217;.  GPwP is a bigger, more involved work, that is less tied to Pygame, and less approachable for beginners.  If you are a beginner looking to ease your learning curve, get BGDwP.   If your question isn&#8217;t answered by BGDwP, it might be by GPwP.  For what it&#8217;s worth, &#8216;Game Programming with Python&#8217; does discuss networking, but did not help me with my joystick button interpretation.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/75/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/75/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=75&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2007/11/22/apresscom-beginning-game-development-with-python-and-pygame-from-novice-to-professional-9781590598726/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
		<item>
		<title>TT continued</title>
		<link>http://pitchersduel.wordpress.com/2007/11/20/tt-continued/</link>
		<comments>http://pitchersduel.wordpress.com/2007/11/20/tt-continued/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 19:01:42 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/2007/11/20/tt-continued/</guid>
		<description><![CDATA[The sequence above was flat, not involving any subroutines. Any significant game is going to make a *very* long main generator, without subroutines. However, any subroutine called from the generator cannot chain to an engine or other functionality via the reactor. Returning control to the reactor is done by yielding. If the sub-generator yields, it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=74&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The sequence above was flat, not involving any subroutines. Any significant game is going to make a *very* long <code>main</code> generator, without subroutines. However, any subroutine called from the generator cannot chain to an engine or other functionality via the reactor. Returning control to the reactor is done by <code>yield</code>ing. If the sub-generator <code>yield</code>s, it <code>yield</code>s to its caller, which needs in turn to <code>yield</code>, recursively all the way to the reactor.</p>
<p><span id="more-74"></span>The code can be subdivided for organizational purposes, but not necessarily by functions. A sub-generator can provide encapsulation to local variables, while maintaining the ability to <code>yield</code> to the reactor repeatedly for different stages.</p>
<pre>
<code>
<blockquote>

def intro(engine):  # generator
    res = 0
    engine.interface = intro_iface
    while res != 'quit':
        if res == 0:
            engine.objects = [intro_pic0]
            engine.interface.buttons = (None,1)
        elif res == 1:
            engine.objects = [intro_pic1]
            engine.interface.buttons = (0,2)
        elif res == 2:
            engine.objects = [intro_pic2]
            engine.interface.buttons = (1,None)
        yield None
        reactor.callLater(0, engine.go)
        res = engine.retval  

def main():  # generator
    engine = Engine()
    # iterate over intro, while intro shows
    #    its various page pics
    for i in intro(engine):
         yield i    

    # execution resumes here after intro
    # set up stage 1
    engine.interface = stage1_iface
    .....
    # done
    reactor.stop()
    yield None    

continue_main = main().next   # creates iterator  

continue_main()   # runs to first yield, installing first engine (via first .callLater) in reactor
reactor.run()</blockquote>

</code></pre>
<p>As you see, isolating the multiple stages of introduction into a generator makes the <code>main</code> a bit simpler, but the calling syntax: <code>for i in intro(engine): yield i;</code> is ugly.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/74/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/74/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=74&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2007/11/20/tt-continued/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
		<item>
		<title>About networking in a Pygame application</title>
		<link>http://pitchersduel.wordpress.com/2007/11/20/about-networking-in-a-pygame-application/</link>
		<comments>http://pitchersduel.wordpress.com/2007/11/20/about-networking-in-a-pygame-application/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 18:15:37 +0000</pubDate>
		<dc:creator>dkeeney</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://pitchersduel.wordpress.com/2007/11/20/about-networking-in-a-pygame-application/</guid>
		<description><![CDATA[This post was originally posted to a mailing list, but it summarizes my recent thought on the question, so it is copied here.
The python sockets library is probably *not* the place to start.  It is very primitive,  and most references you will read will recommend using a  higher level library such as asyncore or (higher yet) asynchat.  Unfortunately, these higher [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=73&subd=pitchersduel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h6>This post was originally posted to a mailing list, but it summarizes my recent thought on the question, so it is copied here.</h6>
<p>The python sockets library is probably *not* the place to start.  It is very primitive,  and most references you will read will recommend using a  higher level library such as asyncore or (higher yet) asynchat.  Unfortunately, these higher level libraries share the same weakness as Twisted, in that that they expect to own the main loop.  I have identified five general approaches to integrating networking with a pygame application.  I have not fully implemented a game with any of them, .. but soon.</p>
<ol>
<li>Use the iterate method of the Twisted reactor.  This is the easiest approach, and the one that Mr Wittber&#8217;s library uses.  Use of reactor.iterate is unfortunately deprecated by the Twisted developers, and will, presumably, be removed from Twisted in some future release.<span id="more-73"></span></li>
<li>Use the Twisted reactor *as* your main loop, and implement all game logic as call-backs from there.  This is the approach that the Twisted people will recommend.   This approach is quite burdensome, in that structuring your game into a series of callbacks can be difficult.  Using generators as coroutines provides some relief, in that you can pass the generators &#8216;next&#8217; method as a callback to Twisted, and maintain game state within the generator.  Using subroutines or nested generators involve their own awkwardnesses.</li>
<li>Run the Twisted reactor in its own thread, and use ThreadedSelectReactor to move data to the pygame event queue.  Bob Ippolito has blogged on how to use this with Pygame (GIYF).  Unfortunately, ThreadedSelectReactor is unmaintained and deprecated.</li>
<li>Run the Twisted reactor in its own thread, and use thread-safe queues to move data to and from the main thread.  Alternatively, if you wish to use the perspective-broker features or use Twisted code beyond mere message passing, there are tools in Twisted for safely invoking methods in other threads.  Hmm. maybe these were deprecated with the TSR?</li>
<li>Run the Twisted reactor in its own process, and use pipes or sockets to pass data between it and the main loop/process.  This has the merit of using the OS&#8217;s CPU allocation management rather than that of Python&#8217;s thread manager.</li>
</ol>
<p>Most of these approaches could use asyncore/asynchat as an alternative to Twisted. My own efforts lately have been along approaches 2 and 5.   My engine &#8216;Spyre&#8217; will run under Twisted&#8217;s reactor now, but the getting the whole multi-engine game logic sequence working in the &#8217;inside-out&#8217; callback style is an imposing prospect. </p>
<table bgColor="#dddddd" align="center" width="75%">
<tr>
<td>Update:<br />
Add an option 6. Create a Twisted reactor subclass that can be exited and resumed. See <a href="http://pitchersduel.wordpress.com/2007/12/07/pausing-reactor/">later</a> <a href="http://pitchersduel.wordpress.com/2007/12/09/pausingreactorpy/">blogposts</a> here for details.</td>
</tr>
</table>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pitchersduel.wordpress.com/73/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pitchersduel.wordpress.com/73/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pitchersduel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pitchersduel.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pitchersduel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pitchersduel.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pitchersduel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pitchersduel.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pitchersduel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pitchersduel.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pitchersduel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pitchersduel.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pitchersduel.wordpress.com&blog=923618&post=73&subd=pitchersduel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pitchersduel.wordpress.com/2007/11/20/about-networking-in-a-pygame-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/572b4e16b50deb0c0a7950bb650eaad4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dkeeney</media:title>
		</media:content>
	</item>
	</channel>
</rss>