<?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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Pádraic Brady &#187; PHP Game Development</title>
	<atom:link href="http://blog.astrumfutura.com/category/PHP-Game-Development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.astrumfutura.com</link>
	<description>PHP, Zend Framework and Other Crazy Stuff</description>
	<lastBuildDate>Wed, 25 Jan 2012 11:12:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>		<item>
		<title>Kicking The Bad Habit Of Being An Overworked Paddy</title>
		<link>http://blog.astrumfutura.com/2008/01/kicking-the-bad-habit-of-being-an-overworked-paddy/</link>
		<comments>http://blog.astrumfutura.com/2008/01/kicking-the-bad-habit-of-being-an-overworked-paddy/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 19:58:42 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[Irishisms]]></category>
		<category><![CDATA[Openid and Yadis]]></category>
		<category><![CDATA[PHP Game Development]]></category>
		<category><![CDATA[PHP General]]></category>
		<category><![CDATA[PHP Security]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[irishisms]]></category>
		<category><![CDATA[openid and yadis]]></category>
		<category><![CDATA[php game development]]></category>
		<category><![CDATA[php general]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=337</guid>
		<description><![CDATA[It&#8217;s hard to believe we are already almost 1/12 of the distance into 2008. By now all of you have broken your new year resolutions. I know I&#8217;ve broken several at a minimum! After some months of desperate oft-despairing struggling with work schedules I&#8217;ve finally once and for all conquered my lack of free time.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2008%2F01%2Fkicking-the-bad-habit-of-being-an-overworked-paddy%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2008%2F01%2Fkicking-the-bad-habit-of-being-an-overworked-paddy%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=irishisms,openid+and+yadis,php+game+development,php+general,php+security,zend+framework&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>It&#8217;s hard to believe we are already almost 1/12 of the distance into 2008. By now all of you have broken your new year resolutions. I know I&#8217;ve broken several at a minimum!</p>
<p>After some months of desperate oft-despairing struggling with work schedules I&#8217;ve finally once and for all conquered my lack of free time. It&#8217;s an ingenious solution &#8211; I&#8217;m taking a small break from work before rekindling an interest in financial services in these doubtful times (ask Société Générale if you want to know how doubtful, or the US Federal Rserve).</p>
<p>The outcome of this reorganisation of my career direction is twofold. Firstly I get extra bags of cash. Secondly, I get slightly more vacation time. Thirdly, it won&#8217;t require as much overtime. Fourthly, there&#8217;s less chance of last-minute-scrambling which became exceptionally evident over the last few months as the Irish market continues to swell (in defiance of the laws of EU Economics). Of course added together this provides more of my most sought after commodity &#8211; personal time.</p>
<p>All that&#8217;s left is how to use this new-found wealth. In between the extra pub-crawling exercises, engagements as the designated baggage mule on shopping excursions, and the other things an average 20-something is inclined to do, I want to enjoy some travel, take up writing again, and commit some completion time to the open source projects I contribute to.</p>
<p>I&#8217;ve been a very bad boy in that regard in the last six months and at one point I became an absolute nightmare for anyone who needed to contact me by email. It was not my finest hour, and I seriously doubt I escaped with a pristine reputation for being dependable. C&#8217;est la vie. A few of these &#8220;instances&#8221; shall we call them, have since been resolved to my satisfaction so I&#8217;m 95% back to nominal form as a powerhouse of innovation, inspiration and ingenuity (see, even my ego is back rockin&#8217; at full throttle!). Yep, you can always measure the normality of an Irishman by his level of self-directed sarcasm <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>Anyways, enough self-critical analysis &#8211; it weakens the ego &#8211; since I&#8217;m back in fine form after two extremes (a two month vacation, and a four month chaotic period of non-stop work) I have the luxury of directing some of this time where it was always supposed to be: in supplementing my PHP experience with some open source doodling and manic self-promotion <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . The first target of my ire is a small project with Till Klampaeckel (Seek. Kill. Destroy.). After that is PHPSpec 0.3.0 (Exterminate! Exterminate! Exterminate!). After that is that frickin&#8217; promise-but-never-effing-do component for implementing a Yadis service (Off With His Head! Off With His Head!). I swear that thing has been sitting in a personal subversion repo begging for a few final hours of attention!</p>
<p>After that I&#8217;m taking a long breather, attending oodles of conferences, and finding something with a lot of words to write.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2008/01/kicking-the-bad-habit-of-being-an-overworked-paddy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Astrum Futura Redux</title>
		<link>http://blog.astrumfutura.com/2007/12/astrum-futura-redux/</link>
		<comments>http://blog.astrumfutura.com/2007/12/astrum-futura-redux/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 16:01:10 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[Astrum Futura]]></category>
		<category><![CDATA[PHP Game Development]]></category>
		<category><![CDATA[PHP General]]></category>
		<category><![CDATA[PHP Security]]></category>
		<category><![CDATA[astrum futura]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php game development]]></category>
		<category><![CDATA[php general]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[quantum star se]]></category>
		<category><![CDATA[solar empire]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=324</guid>
		<description><![CDATA[For the cool folk who have followed the Solar Empire legacy through thick and thin since 1999, those cute .php3 file suffixes, Moriarty&#8217;s continuing denegration of all other developers, the revolution that open source brought, the sudden push towards OOP, and the&#8230;err&#8230;security and bug population&#8230; Working on anything hitting it&#8217;s 9th anniversary in PHP is]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F12%2Fastrum-futura-redux%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F12%2Fastrum-futura-redux%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=astrum+futura,php,php+game+development,php+general,php+security,quantum+star+se,solar+empire&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>For the cool folk who have followed the Solar Empire legacy through thick and thin since 1999, those cute .php3 file suffixes, Moriarty&#8217;s continuing denegration of all other developers, the revolution that open source brought, the sudden push towards OOP, and the&#8230;err&#8230;security and bug population&#8230; Working on anything hitting it&#8217;s 9th anniversary in PHP is really interesting &#8211; 9 times the fun and games <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>Astrum Futura was envisaged as a desperately needed update to the long running open source Solar Empire franchise, where players engage each other across a galaxy of 500+ star systems mining resources, building colonies, and generally screaming bloody murder at each other. It&#8217;s not the most impressive or ambitious of online games, but it&#8217;s always been tenacious and attracted roaming users who like a quick dash of destruction in their daily diet.</p>
<p>In January 2008, the oft delayed development process will once again creak into action. The current tracer code was built originally using the Zend Framework 0.2-0.6 and famously led that Spring to my long running &#8220;Complex Views With The Zend Framework&#8221; blog series that gave birth to the Zend_View Enhanced proposal, and maybe gave Ralph Schindler a few headaches <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Building anything more complex than a login page was pure heart ache previously.</p>
<p>Now that time is available, the Zend Framework significantly more mature, and we have a lot of legwork carried over from 2006 in the Quantum Game Library (thanks to Jacob Santos), it&#8217;s about time we got something concrete done. The usual suspects, if interest levels are high enough, can report to the shiny updated phpBB3 forums at <a href="http://forums.astrumfutura.com" >http://forums.astrumfutura.com</a> &#8211; same domain as this blog you&#8217;re reading.</p>
<p>And we will be applying XP this time &#8211; the random running process that usually prevails just doesn&#8217;t work out well. So get your Selenium gear in place.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2007/12/astrum-futura-redux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Complex Views with the Zend Framework &#8211; Part 5: The Two-Step View Pattern</title>
		<link>http://blog.astrumfutura.com/2007/05/complex-views-with-the-zend-framework-part-5-the-two-step-view-pattern/</link>
		<comments>http://blog.astrumfutura.com/2007/05/complex-views-with-the-zend-framework-part-5-the-two-step-view-pattern/#comments</comments>
		<pubDate>Wed, 23 May 2007 18:35:00 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[PHP Game Development]]></category>
		<category><![CDATA[PHP General]]></category>
		<category><![CDATA[PHP Security]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php game development]]></category>
		<category><![CDATA[php general]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[zf proposal]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=288</guid>
		<description><![CDATA[It&#8217;s been a while since I continued this series. Unfortunately real life workloads are unforgiving of the best of intentions . Part 5 of our series takes a small time-out from approaching a Composite View solution to reusable Views to take a peek at a simpler approach useful for simpler types of web applications. As]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F05%2Fcomplex-views-with-the-zend-framework-part-5-the-two-step-view-pattern%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F05%2Fcomplex-views-with-the-zend-framework-part-5-the-two-step-view-pattern%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=design+patterns,php,php+game+development,php+general,php+security,zend+framework,zf+proposal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>It&#8217;s been a while since I continued this series. Unfortunately real life workloads are unforgiving of the best of intentions <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Part 5 of our series takes a small time-out from approaching a Composite View solution to reusable Views to take a peek at a simpler approach useful for simpler types of web applications. As we&#8217;ve discussed previously Composite Views allow the nesting of reusable View elements, effectively building a View based on a hierarchy of Views. But often there are simpler solutions to simpler problems. One such solution is the Two-Step View pattern, sometimes called Layouts if implemented in a specific way (as we do below!).</p>
<p>Imagine a simple website. You have hundreds of pages of unique content, but the header and footer for each page is identical. Applying the Composite View approach has the same problem as applying a standard PHP include or Zend_View::render() call to including these common elements &#8211; the calls themselves are scattered across each and every template. This is the hallmark of a Layout &#8211; duplicated includes/renders across multiple views:</p>
<p>[geshi lang=php]<?php echo $this->render(&#8216;standard_header.phtml&#8217;); ?></p>
<p>Here is our unique content! But look, all unique templates<br />
now have the same &#8220;standard&#8221; headers and footers defined by a<br />
render() call. How do we remove these completely and apply them<br />
automatically instead?</p>
<p><?php echo $this->render(&#8216;standard_footer.phtml&#8217;); ?>[/geshi]<br />
The key is to take the duplicated calls and other duplicated markup and stick them in a Layout template which will encapsulate all Views automatically. Then the only thing our templates contain is unique content!</p>
<p>[geshi lang=php]
<p>Here is our unique content template! But where have the<br />
standard header and footer includes vanished to?</p>
<p>[/geshi]<br />
All the Layout file needs to do is provide a &#8220;hook&#8221;, a method placement which signifies where the main View output (which is generated by the current dispatch cycle) should be placed. Since we define two parts the View here we&#8217;ll refer to them as the &#8220;Layout&#8221; and the &#8220;Main&#8221;. A Layout might look like:</p>
<p>[geshi lang=php]<?php echo $this->render(&#8216;standard_header.phtml&#8217;); ?></p>
<p><?php echo $this->main(); ?></p>
<p><?php echo $this->render(&#8216;standard_footer.phtml&#8217;); ?>[/geshi]<br />
The new Zps_View::main() method (Zps_View is a subclass of Zend_View to which we can add customised behaviour) simply tells the View to render its output at this location in the template. This assumes the default Zend_View::render() method now takes a two step approach to rendering (this is where the Two-Step View Pattern comes into play).</p>
<p>1. Render a Layout if one is defined<br />
2. Render the Main template into the Layout</p>
<p>The only funky logic is that the presence of a Layout forces our View object&#8217;s render method to take a detour so that Layouts are rendered first. This is a pretty simple change to Zend_View. Here&#8217;s our Zps_View class with the revised logic.</p>
<p>Please forgive the lack of proper phpDoc comments &#8211; Serendipity won&#8217;t play nice with them.</p>
<p>[geshi lang=php]// Zend_View */<br />
require_once &#8216;Zend/View.php&#8217;;</p>
<p>// Zps_View_Interface */<br />
require_once &#8216;Zps/View/Interface.php&#8217;;</p>
<p>class Zps_View extends Zend_View implements Zps_View_Interface<br />
{</p>
<p>    //<br />
    // The Main Template (i.e. the template file a Controller wishes<br />
    // to render).<br />
    // _mainFile cannot be set by a public setter so it doubles as<br />
    // as a safety valve to prevent unwarranted use of main().<br />
    //<br />
    // @var string<br />
    //<br />
    protected $_mainFile = null;</p>
<p>    //<br />
    // The Layout Template<br />
    //<br />
    // @var string<br />
    //<br />
    protected $_layoutFile = null;</p>
<p>    //<br />
    // Overrides Zend_View::render() to introduce a two step view approach when<br />
    // a Layout template has been defined. The two steps are handled using<br />
    // separate calls to parent::render() which calls the Zend_View render()<br />
    // method without overriding.<br />
    //<br />
    // @param string $name The script script name to process.<br />
    // @return string The script output.<br />
    //<br />
    public function render($name)<br />
    {<br />
        if ($this->hasLayout() &#038;&#038; !isset($this->_mainFile)) {<br />
            $this->_mainFile = $name;<br />
            return parent::render( $this->getLayout() );<br />
        }<br />
        return parent::render($name);<br />
    }</p>
<p>    //<br />
    // Set the filename of a Layout template to be used. The existence of a<br />
    // Layout filename will force the over-ridden render() method to detour<br />
    // and render the Layout, only rendering the Main template when a main()<br />
    // call is issued in the Layout template.<br />
    //<br />
    // @param $file string<br />
    // @return void<br />
    //<br />
    public function setLayout($file = &#8216;layout.phtml&#8217;)<br />
    {<br />
        $this->_layoutFile = $file;<br />
    }</p>
<p>    //<br />
    // Return the filename of the Layout. Layouts are like any<br />
    // other template script and are located in the same place in<br />
    // application filesystem.<br />
    //<br />
    // @return string<br />
    //<br />
    public function getLayout()<br />
    {<br />
        return $this->_layoutFile;<br />
    }</p>
<p>    //<br />
    // Returns true if a Layout has been set for this View.<br />
    //<br />
    // @return bool<br />
    ///<br />
    public function hasLayout()<br />
    {<br />
        return isset($this->_layoutFile);<br />
    }</p>
<p>    //<br />
    // Inform the View object that it should render the Main View, i.e.<br />
    // render the template handed to the render() method by a Controller.<br />
    // This method is only useful if a Layout is being used, otherwise<br />
    // expect an Exception.<br />
    //<br />
    // @return string<br />
    // @throws Zps_View_Exception<br />
    //<br />
    public function main()<br />
    {<br />
        if (isset($this->_mainFile)) {<br />
            return parent::render($this->_mainFile);<br />
        }<br />
        require_once &#8216;Zps/View/Exception.php&#8217;;<br />
        throw new Zps_View_Exception(&#8216;Invalid call: There is no primary View template to render&#8217;);<br />
    }</p>
<p>    //<br />
    // Method to clone this View assuming the sub-View (the clone) is from<br />
    // the same application Module as the original.<br />
    // Here we are simply getting rid of the inherited public variables which<br />
    // represent the ancestor View&#8217;s model.<br />
    // We also disable any Layouts (the inheritance would lead to infinite<br />
    // looping otherwise &#8211; Apache would bark and die on the spot!)<br />
    //<br />
    // @return null<br />
    //<br />
    public function __clone()<br />
    {<br />
        foreach(get_object_vars($this) as $key=>$value) {<br />
            $this->__unset($key);<br />
        }<br />
        $this->setLayout(null);<br />
    }</p>
<p>}[/geshi]<br />
So there we go, functional code for allowing Layouts in a Two-Step View approach. Notice how the render() and main() methods interact. Because it&#8217;s both have very specific uses, main() is only useable within templates when injecting the main template into a Layout.</p>
<p>Sample usage is pretty simple &#8211; I won&#8217;t delve into any details since you just need two additional pieces of work when instantiating a View object:</p>
<p>1. Create a Layout template (you&#8217;ll notice a setLayout() default is &#8220;layout.phtml&#8221; but you&#8217;re not bound to that convention by any means.<br />
2. Set the Layout on a View object, e.g.</p>
<p>[geshi lang=php]$view = new Zps_View;<br />
$view->setBasePath(&#8216;/path/to/default/view/directory&#8217;);<br />
$view->setLayout(&#8216;layout.phtml&#8217;); // this will force render() to perform a Two-Step<br />
$view->render(&#8216;sometemplate.phtml&#8217;);[/geshi]<br />
If you followed my previous posts you&#8217;ll be able to integrate the Two-Step View/Layout approach pretty easily into your Views. Of course, as usual, a key observation is that in using a Zend_View subclass be sure not to rely on Zend_Controller_Action::initView(). You&#8217;ll need to override that method in your own application specific Zend_Controller_Action subclass.</p>
<p>If the lack of a Zps_View_Interface worries you it&#8217;s just a declaration of all the public methods above. I won&#8217;t post it here, this entry is long enough <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>Any final words? A similar system is also possible using an alternate implementation. Matthew Weier O&#8217;Phinney, when I originally started asking about complex views in the Zend Framework, posted a Two-Step View implementation using a dispatchLoopShutdown() plugin. You can read more about this over at the mailing list archives &#8211; here&#8217;s the exact link to Matthew&#8217;s email.</p>
<p><a href="http://framework.zend.com/wiki/display/ZFMLGEN/mail/27145"  title="Two-Step View Email">http://framework.zend.com/wiki/display/ZFMLGEN/mail/27145</a></p>
<p>Finally, this is completely compatible with using a Composite View system. You can imagine creating a component full of widgets or plugin output. Each of these would be aggregated into a Composite View. But that doesn&#8217;t mean they don&#8217;t all share one thing &#8211; a common layout. So Layouts (Two-Step View) and Composite Views play quite nicely together.</p>
<p>Have fun! <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  If anyone comes up more bright ideas throw them into a comment for the hordes of blog readers to consume!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2007/05/complex-views-with-the-zend-framework-part-5-the-two-step-view-pattern/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Alien Assault Traders 0.30 Released!</title>
		<link>http://blog.astrumfutura.com/2007/04/alien-assault-traders-0-30-released/</link>
		<comments>http://blog.astrumfutura.com/2007/04/alien-assault-traders-0-30-released/#comments</comments>
		<pubDate>Wed, 04 Apr 2007 16:33:13 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[PHP Game Development]]></category>
		<category><![CDATA[aatraders]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php game development]]></category>
		<category><![CDATA[php games]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=278</guid>
		<description><![CDATA[Congratulations to Mark Dickenson (aka Panama Jack) and Rick Thomson (aka Tarnus) on their recent release of Alien Assault Traders 0.30. It&#8217;s been in development for a while now and it&#8217;s cool to see the end product finally let loose . Alien Assault Traders is an online browser-based space strategy trading game written in PHP.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F04%2Falien-assault-traders-0-30-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F04%2Falien-assault-traders-0-30-released%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=aatraders,games,php,php+game+development,php+games&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Congratulations to Mark Dickenson (aka Panama Jack) and Rick Thomson (aka Tarnus) on their recent release of <a href="http://www.aatraders.com" >Alien Assault Traders 0.30</a>. It&#8217;s been in development for a while now and it&#8217;s cool to see the end product finally let loose <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Alien Assault Traders is an online browser-based space strategy trading game written in PHP. It&#8217;s a fork of Blacknova Traders. If you&#8217;re looking for a free open source web game then here&#8217;s one to take a peek at. PJ is well known for focusing more than the usual effort on optimisation (he wrote the ADOdb Lite and Template Lite libraries) so it&#8217;s a bit easier on your hardware than many alternatives.</p>
<p>I haven&#8217;t been tracking development as much as I used to (busy with Astrum Futura, QGL and my Zend Framework proposals) but the new version has a significant overhaul of the previous 0.2x code. Have fun! <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2007/04/alien-assault-traders-0-30-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Magazine: PHP Game Poll</title>
		<link>http://blog.astrumfutura.com/2007/02/php-magazine-php-game-poll/</link>
		<comments>http://blog.astrumfutura.com/2007/02/php-magazine-php-game-poll/#comments</comments>
		<pubDate>Wed, 21 Feb 2007 08:46:42 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[PHP Game Development]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=269</guid>
		<description><![CDATA[http://www.php-mag.net/magphpde/magphpde_news/psecom,id,26905,nodeid,5.html The International PHP Magazine has started a new poll asking readers to votes for their favourite PHP game. Judging by the list it looks like the top 10 Sourceforge registered open source games. I listed these a while back and noted phpDiplomacy in particular was doing really well. Somehow though I doubt the voting]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F02%2Fphp-magazine-php-game-poll%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F02%2Fphp-magazine-php-game-poll%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=php&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.php-mag.net/magphpde/magphpde_news/psecom,id,26905,nodeid,5.html" >http://www.php-mag.net/magphpde/magphpde_news/psecom,id,26905,nodeid,5.html</a></p>
<p>The International PHP Magazine has started a new poll asking readers to votes for their favourite PHP game. Judging by the list it looks like the top 10 Sourceforge registered open source games. I listed these a while back and noted phpDiplomacy in particular was doing really well. Somehow though I doubt the voting will be brisk. Should I tell them the QGL is not actually a game but a PHP game-oriented library? <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2007/02/php-magazine-php-game-poll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quantum_Db: The QGL Data Access Object Implementation</title>
		<link>http://blog.astrumfutura.com/2007/02/quantum_db-the-qgl-data-access-object-implementation/</link>
		<comments>http://blog.astrumfutura.com/2007/02/quantum_db-the-qgl-data-access-object-implementation/#comments</comments>
		<pubDate>Tue, 13 Feb 2007 14:25:02 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[Astrum Futura]]></category>
		<category><![CDATA[PHP Game Development]]></category>
		<category><![CDATA[PHP General]]></category>
		<category><![CDATA[astrum futura]]></category>
		<category><![CDATA[dao]]></category>
		<category><![CDATA[data access object]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php game development]]></category>
		<category><![CDATA[php general]]></category>
		<category><![CDATA[qgl]]></category>
		<category><![CDATA[quantum game library]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=267</guid>
		<description><![CDATA[Back in 2005, the Quantum Star SE project caught the Object Relational Mapping (ORM) bug and I took a first stab at implementing something that was simple, fast and easy to use. Until this stage I was a regular user of the Data Mapper pattern (among others) but since switching to PHP and developing open]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F02%2Fquantum_db-the-qgl-data-access-object-implementation%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F02%2Fquantum_db-the-qgl-data-access-object-implementation%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=astrum+futura,dao,data+access+object,design+patterns,php,php+game+development,php+general,qgl,quantum+game+library&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Back in 2005, the Quantum Star SE project caught the Object Relational Mapping (ORM) bug and I took a first stab at implementing something that was simple, fast and easy to use. Until this stage I was a regular user of the Data Mapper pattern (among others) but since switching to PHP and developing open source projects found it to be largely unnecessary. The root problem is akin to hammering nails with a sledgehammer &#8211; too much complexity being implemented for a simple underwhelming task.</p>
<p>Here in 2007, with the QGL in development I found myself re-assessing my previous experiences and finding it attractive to develop something less complex and hopefully faster than a full scale ORM solution. Taking some previous work I did, I opened a branch in the QGL subversion repository and set to work. The results are slowly coming to fruition &#8211; the DAO, Row and part of the Driver families are shaping up going by the unit tests.</p>
<p>So what is Quantum_Db (in practice)? It will be a family of classes which form a Data Access Object (DAO) Framework when complete. This post is largely a ramble about current progress and intentions &#8211; so if looking for a complete solution you&#8217;re in the wrong place as the current code is strictly in-progress. For reference though, the source code is under the New BSD License. It&#8217;s incomplete, but available from its subversion branch at: <a href="http://quantumstar.svn.sourceforge.net/viewvc/quantumstar/branches/Quantum_Db/">http://quantumstar.svn.sourceforge.net/viewvc/quantumstar/branches/Quantum_Db/</a> and the forums can be found for the QGL in general at <a href="http://forums.astrumfutura.com/viewforum.php?f=25">http://forums.astrumfutura.com/viewforum.php?f=25</a>.</p>
<p>In this specific implementation of Quantum_Db, the DAO class (Quantum_Db_Access) is a Singleton which attempts to offer relatively basic CRUD methods capable of use on any valid database table record. A large part of its responsibility is generating CRUD type SQL. So you could have a User record, which could be saved by passing it to a DAO save() method. It&#8217;s not quite as clear cut, since to reduce the mass of code a DAO implementation often needs the &#8220;record&#8221; is encapsulated in a container called Quantum_Db_Row. This Row class can represent a single table record, but also doubles as a data container for setting up SQL conditions (think of WHERE, IN and INSERT clauses).</p>
<p>One of the goals intentionally targets simplicity, so there is no Propel-style Criteria object to mess about with. There will be in the future, but for simple needs, a simple DAO framework is sufficient as an initial start. A simplistic use case is adding a new User record. Some code showing this task:</p>
<p>[geshi lang=php]require_once &#8216;Models/User.php&#8217;;</p>
<p>// Fields are public properties handled by __get/__set in the<br />
// Quantum_Db_Row class. The User class is actually a simple<br />
// subclass defining valid fields and primary key(s).<br />
//<br />
// We do not specify an Id value for new Users. The DAO class will<br />
// assign this assuming Id is an auto-incrementing value for MySQL<br />
// or a Sequence for PostgreSQL.</p>
<p>$user = new User;<br />
$user->name = &#8216;Pádraic&#8217;;<br />
$user->email = &#8216;padraic.brady@example.com&#8217;;<br />
$user->password = sha1(&#8216;password&#8217;);<br />
$user->country = &#8216;ie&#8217;;</p>
<p>// Call on DAO to save this record to the database. Obviously any<br />
// database errors will result in Exceptions thrown by the DAO so<br />
// the database table rules (primary key, unique key, etc.) all apply.</p>
<p>$user->save();[/geshi]</p>
<p>The first thing you can note is that the DAO class (called Quantum_Db_Access is not directly called. Instead all Row objects carry a reference to the Quantum_Db_Access singleton so Quantum_Db_Row::save() proxies to Quantum_Db_Access::save() &#8211; we only need one generic DAO object. If one desperately needed the DAO they could just place a call to Quantum_Db_Access::getInstance().</p>
<p>[geshi lang=php]$dao = Quantum_Db_Access::getInstance();<br />
$dao->save($user);[/geshi]</p>
<p>In fact, you can equally access the underlying database extension driver to run queries directly using the following. Of course Singletons have their own evil uses, so ideally you&#8217;d pass around the object reference instead of litering source code with static getInstance() calls which explicitly refer to the class name.</p>
<p>[geshi lang=php]// Example of accessing the driver to drop the User table</p>
<p>$driver = Quantum_Db_Access::getInstance->getDriver()->exec(&#8220;DROP TABLE user&#8221;);[/geshi]</p>
<p>Retrieving records is more interesting. It&#8217;s relatively simple to extract a record based on a primary key:</p>
<p>[geshi lang=php]$user = new User;<br />
$user->getByPk(1);</p>
<p>var_dump($user->asArray()); // echo array of User (Id=1) data[/geshi]</p>
<p>It&#8217;s much more complex to fetch rows of a very specific nature. Even worse, without a Criteria object using the MySQL IN clause is a challenge. However for those where the SQL values depend solely on simple field values a neat solution is &#8220;named queries&#8221;. A Named Query (check the excellent introduction at: <a href="http://www.tonybibbs.com/article.php/PropelDAO">http://www.tonybibbs.com/article.php/PropelDAO</a> regarding something similar for Propel) is an SQL string containing value placeholders (e.g. for use in a PDO::prepare()) stored in some central file. This has a few benefits and disadvantages.</p>
<p>The main benefit is the centralisaton &#8211; like OOP, centralising logic (in this case non-generated SQL strings) reduces duplication and encourages reuse. Allowing the named queries to be indexed (for example, within an XML hierarchy) by a name and model allows them to be easily located and prepared by the Data Access Object. The disadvantages are of course that it&#8217;s still limited. For example, use of a MySQL &#8220;SELECT id, name, email FROM user_table WHERE id IN(1,2,3,4)&#8221; isn&#8217;t likely a storeable named query since the IN() range of id values is too variable. But for many queries it&#8217;s a good fit in the absence of some form of Criteria class.</p>
<p>Enough of the DAO class however. After beating it to death, there are still pieces to be completed when it comes to allowing complex SQL clauses. The main point is that for simple use cases it is a good match &#8211; and simple use cases are extremely common in many of my open source endeavors.</p>
<p>To backup the Data Access Class Quantum_Db also implements a Driver and Results class family. Again simplicity is key, so it&#8217;s being written under the presumption that PHP5&#8242;s PDO extension is available. The Quantum_Db_Driver_Interface file actually mirrors the PDO interface for this reason. Of course we can&#8217;t forget mysqli (the most popular PHP5 database extension) or pgsql and the rest. Quantum_Db_Driver defines an interface to enable additional extension type support. Personally I only intend adding a light abstraction over ADOdb-Lite &#8211; it&#8217;s not worth duplicating Mark&#8217;s already existing library.</p>
<p>The Results class, the one part no code exists for yet &#8211; don&#8217;t be worried I develop using TDD and unit testing so it&#8217;s perfectly normal <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Quantum_Db_Results will aggregate the results of queries into a class implementing PHP5&#8242;s SPL Iterator. To be specific, the Iterator methods will be tied to each underlying Driver&#8217;s fetch* methods. This should allow continued use of Lazy Loading during iterations, and allow continued use of foreach() etc.</p>
<p>Here ends my ramble for now. For those working on the QGL or similar code maybe it will provide a few of my thoughts on the topic &#8211; assuming you can summarise the rambling of course <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2007/02/quantum_db-the-qgl-data-access-object-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iamsure Blogs about a new project</title>
		<link>http://blog.astrumfutura.com/2007/02/iamsure-blogs-about-a-new-project/</link>
		<comments>http://blog.astrumfutura.com/2007/02/iamsure-blogs-about-a-new-project/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 11:16:39 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[PHP Game Development]]></category>
		<category><![CDATA[iamsure]]></category>
		<category><![CDATA[php game development]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=265</guid>
		<description><![CDATA[Iamsure appears to found a sense of the dramatic. So his new blog entry very successfully piques my interest! Most of all, the end result should be a fun, entertaining, and groundbreaking game. Its massive, it will scale, it will be internet based, and it will be both similar and totally different from other games]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F02%2Fiamsure-blogs-about-a-new-project%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F02%2Fiamsure-blogs-about-a-new-project%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=iamsure,php+game+development&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Iamsure appears to found a sense of the dramatic. So <a href="http://kabal-invasion.blogspot.com/2007/02/whats-next.html">his new blog entry</a> very successfully piques my interest!</p>
<blockquote><p>Most of all, the end result should be a fun, entertaining, and groundbreaking game. Its massive, it will scale, it will be internet based, and it will be both similar and totally different from other games I&#8217;ve worked on and spoken about.</p></blockquote>
<p>It&#8217;s going to be a commercial project I gather so no open source goodies to examine, but these days I&#8217;m often less interested in the code, then the approach to execution. I guess once you&#8217;ve been using PHP since 2000 you eventually find that your reading leans heavily to theory and the experiences of other developers facing a unique challenge (whether PHP, Ruby or other). I for one look forward to reading more!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2007/02/iamsure-blogs-about-a-new-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QGL under the New BSD License</title>
		<link>http://blog.astrumfutura.com/2007/02/qgl-under-the-new-bsd-license/</link>
		<comments>http://blog.astrumfutura.com/2007/02/qgl-under-the-new-bsd-license/#comments</comments>
		<pubDate>Fri, 02 Feb 2007 10:47:57 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[Astrum Futura]]></category>
		<category><![CDATA[PHP Game Development]]></category>
		<category><![CDATA[astrum futura]]></category>
		<category><![CDATA[php game development]]></category>
		<category><![CDATA[qgl]]></category>
		<category><![CDATA[quantum game library]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=264</guid>
		<description><![CDATA[The Quantum Game Library (&#8220;QGL&#8221;) is a PHP5 library aimed at creating a bunch of reuseable classes for use in PHP games. We&#8217;re still in early days but with two dedicated developers, lots of feedback and suggestions we&#8217;ve already put together a few starting solid components and have others in progress. Over the last few]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F02%2Fqgl-under-the-new-bsd-license%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F02%2Fqgl-under-the-new-bsd-license%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=astrum+futura,php+game+development,qgl,quantum+game+library&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The Quantum Game Library (&#8220;QGL&#8221;) is a PHP5 library aimed at creating a bunch of reuseable classes for use in PHP games. We&#8217;re still in early days but with two dedicated developers, lots of feedback and suggestions we&#8217;ve already put together a few starting solid components and have others in progress.</p>
<p>Over the last few months the QGL has evolved from a minor offshoot of the Astrum Futura project into a fully independent library. I guess everyone on the team saw a generic game library as something really useful; we&#8217;re all game developers on varying projects.</p>
<p>To reflect the library status, as well as to widen the net for potential users and developers we have decided to move from the GNU General Public License (which rules Astrum Futura) to the far more liberal <a href="http://doc.astrumfutura.com/license.html">New BSD License</a>. We&#8217;ve also provisionally determined that copyrights should be centralised to a degree, this currently is not in operation since the number of contributors remains manageable but may be (pending contributor feedback obviously) in the future.</p>
<p>Given licensing is now decided, file header updates in progress (if gradual), and some useful components are hitting stable, it&#8217;s likely we&#8217;ll make a public preview release in the near future. Given out focus on doing things right, this will only occur once documentation is completed and our unit tests verified for good measure.</p>
<p>As a summary (feel free to request details on the <a href="http://forums.astrumfutura.com/index.php?c=7">QGL Forum Section</a>) the current near-stable component list includes:<br />
    &#8211; Quantum_Db<br />
    &#8211; Quantum_Coordinate<br />
    &#8211; Ai_Pathfinding<br />
    &#8211; Quantum_Map_Measure<br />
    &#8211; Quantum_Map_Grid<br />
    &#8211; Quantum_Turing</p>
<p>This is far from complete, and there are literally dozens of possible additions. Those in planning are already shaping up to offer some cool second iteration functionality. That&#8217;s not even including the planned ext/qgl PHP extension&#8230;;).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2007/02/qgl-under-the-new-bsd-license/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Factions: Social Control on Newbie Bashing</title>
		<link>http://blog.astrumfutura.com/2007/01/factions-social-control-on-newbie-bashing/</link>
		<comments>http://blog.astrumfutura.com/2007/01/factions-social-control-on-newbie-bashing/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 16:37:04 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[Astrum Futura]]></category>
		<category><![CDATA[PHP Game Development]]></category>
		<category><![CDATA[Quantum Star SE]]></category>
		<category><![CDATA[astrum futura]]></category>
		<category><![CDATA[factions]]></category>
		<category><![CDATA[newbie bashing]]></category>
		<category><![CDATA[php game development]]></category>
		<category><![CDATA[qgl]]></category>
		<category><![CDATA[quantum star se]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=263</guid>
		<description><![CDATA[A recent discussion was sparked on the Astrum Futura forums regarding player retention and new player protection. It was one of those times when the discussion branched to a higher view &#8211; a wider look at how players interact on a large scale. The current suggestions called for players to be penalised for undesireable actions,]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F01%2Ffactions-social-control-on-newbie-bashing%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F01%2Ffactions-social-control-on-newbie-bashing%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=astrum+futura,factions,newbie+bashing,php+game+development,qgl,quantum+star+se&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>A recent discussion was sparked on the <a href="http://forums.astrumfutura.com">Astrum Futura forums</a> regarding player retention and new player protection. It was one of those times when the discussion branched to a higher view &#8211; a wider look at how players interact on a large scale.</p>
<p>The current suggestions called for players to be penalised for undesireable actions, e.g. attacking a new player who is incapable of defending him/her self. This remains a long standing issue in many online games. AF could resort to enforced levelling &#8211; limited who a player can attack, and be attacked by. But this is all artificial &#8211; in the real world it&#8217;s open season on anyone.</p>
<p>Cyberlot (Richard) raised the question of penalising through a Karma rating. As a player attacked newcomers they would attract negative Karma marking them out to other players. I can see the rank of &#8220;Newbie Basher&#8221; emerging as an undesireable outcome for many players. But Karma while adding some measure, does not address enforcement. Exactly who enforces what and when? Who set&#8217;s the standard for interacting with other players?</p>
<p>From there we hit the subject of Factions. A Faction would be a specific group of players sharing a common interest. This obviously includes Races, but is also extendable to a Merchant Guild or a Pirate Clan. The point is to give players an instant group they are a member of. Now where it gets interesting in how the player and game logic would respond in the presence of Factions.</p>
<p>Say you have a Faction, Earth Humans United (go Terrans!). What happens if a member of this Faction attacks a new player who is joining the Earth Humans United Faction? Can&#8217;t have allies killing each other off (even if it might reflect reality <img src='http://blog.astrumfutura.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ). The answer is in the Karma. Killing a new member of your own faction is stupid, damaged the Faction, and makes other players less likely to join it. That member should sur be paying tax to the Faction, which is needed. Such a player would immediately get negative Karma.</p>
<p>So we have Karma, and we have Factions &#8211; how do they relate?</p>
<p>Karma is a measure of one&#8217;s standing within a Faction. If your Karma falls below a minimal level you&#8217;ll be declared an enemy of the Faction, and then its time to start running before you&#8217;re hunted down by your peers. Where do you flee? If you&#8217;re lucky, some other Faction still has you as Neutral. </p>
<p>But this is where Newbie Protection get&#8217;s interesting. It&#8217;s not Faction specific &#8211; your bad Karma is classified when killing a new player as a &#8220;Stigma&#8221;. It decreases Karma for *ALL* Factions. It&#8217;s the ultimate punishment &#8211; imagine playing when nearly all the Factions refuse to grant you trade access, when your planets are penalised with &#8220;special tax charges&#8221;, when other players are unable to maintain an Alliance with you once you become Factionless (Outcast). In short, if you gain a reputation for killing new players, you&#8217;ll be kicked, booted and sent to Hell with a one way express ticket. No Admin interference or funny AI fleets required. Society will put you straight or else&#8230;</p>
<p>More on this later as details are worked out, but it looks like it&#8217;s a feasible and supported suggestion.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2007/01/factions-social-control-on-newbie-bashing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Thoughts on a Unit Testing and Test-Driven Design Experience</title>
		<link>http://blog.astrumfutura.com/2007/01/thoughts-on-a-unit-testing-and-test-driven-design-experience/</link>
		<comments>http://blog.astrumfutura.com/2007/01/thoughts-on-a-unit-testing-and-test-driven-design-experience/#comments</comments>
		<pubDate>Mon, 29 Jan 2007 16:58:53 +0000</pubDate>
		<dc:creator>Pádraic Brady</dc:creator>
				<category><![CDATA[Astrum Futura]]></category>
		<category><![CDATA[PHP Game Development]]></category>
		<category><![CDATA[PHP General]]></category>
		<category><![CDATA[astrum futura]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php game development]]></category>
		<category><![CDATA[php general]]></category>
		<category><![CDATA[qgl]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://blog.astrumfutura.com/?p=262</guid>
		<description><![CDATA[Creeping closer to Spring; it&#8217;s 1 February if you follow my calendar. One of the things which stand out in my online activities as it touches on PHP is the 3 month period spent working on the QGL (Quantum Game Library). The library is just reaching its 200th commit, and should pass that barrier later]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F01%2Fthoughts-on-a-unit-testing-and-test-driven-design-experience%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.astrumfutura.com%2F2007%2F01%2Fthoughts-on-a-unit-testing-and-test-driven-design-experience%2F&amp;source=padraicb&amp;style=normal&amp;service=bit.ly&amp;service_api=padraic%3AR_94101570b7e190f3de921bc15bb9438d&amp;hashtags=astrum+futura,php,php+game+development,php+general,qgl,tdd,unit+testing&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Creeping closer to Spring; it&#8217;s 1 February if you follow my calendar. One of the things which stand out in my online activities as it touches on PHP is the 3 month period spent working on the QGL (Quantum Game Library). The library is just reaching its 200th commit, and should pass that barrier later this evening when I get around to a small class naming change.</p>
<p>Sticking with the QGL, it&#8217;s a small side project which sprung up from a vague idea. Those of us working on the related Astrum Futura game project, knew a standard game library of some description would pay dividends for future projects by centralising a general set of useful classes. It was shortly after this concept was solidifying when Jacob Santos joined the team with his imaginative vision of implementing AI algorithms.</p>
<p>The one thing that really stands out from the usual project hustle and flow, was our shared wish to use Test Driven Design and Unit Testing. It&#8217;s very difficult to use it on anything more than personal projects at work where developer resistance (though falling) is still an obstacle. So the QGL was an all too rare opportunity to cooperate in a team led effort focused around the test-first approach.</p>
<p>So how did we fare?</p>
<p>Personally, I think a lot of what we accomplished to date (bearing in mind the time limitations) was a result of TDD, and of course Unit Testing&#8217;s benefits in general. There were times where we were working on complementary components such as Jacob on Ai_Pathfinding, and myself on Quantum_Map_Measure where TDD led to simpler more maneageable classes. Of course the unit tests supported our efforts with style. Throughout the process we were both refactoring code, and tweaking interfaces. Without the unit tests we would have reached deep treacherous waters as our respective efforts slowly drifted apart.</p>
<p>I also think poor Jacob may have become test infected. He seems to be recovering, so I&#8217;ll have to wind him up later over the current two failing tests he introduced! I haven&#8217;t heard any rumours of a bald Jacob Santos so presumably that odd side symptom has yet to rear its ugly head.</p>
<p>Back on track&#8230; The most visible benefits of the TDD + UT approach during the last three months can be summarised as:</p>
<p>- Easier Refactoring (perform a refactor, check tests still pass, rinse and repeat)<br />
- Immediate Feedback when code goes wrong (big fat red bars in the testing results. Hard to ignore!)<br />
- Enforcement of Standards (tests discourage questionable hacks/shortcuts)<br />
- Regression Testing (if something goes wrong, we add test(s) to prevent repeats)<br />
- Force Feedback (not just a console controller type, failed unit tests spark attention from other developers)<br />
- Code To An Interface (TDD and unit testing teach you why if you&#8217;re a quick study)<br />
- Testable Code is Better Code (adherence to practices which generate clean, focused, flexible classes)</p>
<p>I&#8217;m sure there are others, but these were the most obvious over three months of development across 200 commits to subversion from two developers. If the immediate benefits are not a motivation to become test-infected the future benefits might. The one thing I know from past experience is that unit tested code tends to be easier to maintain and generates fewer bug reports.</p>
<p>Now of only someone miraculously removed the initial pain a developer experiences when starting to learn TDD and Unit Testing (the pain that explains why many quit before the summit of the learning curve is reached) we could get more folk on the TDD bandwagon. One unfortunate fallout from following a test-first approach is that it necessitates any new developers becoming educated. No easy task when dealing with a vast population of wannabe programmers taking their first few running jumps with PHP by showing interest in open source projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.astrumfutura.com/2007/01/thoughts-on-a-unit-testing-and-test-driven-design-experience/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

