<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ben McGraw's Egometry &#187; Games</title>
	<atom:link href="http://www.egometry.com/tags/games/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.egometry.com</link>
	<description>cogito ergo stfu</description>
	<lastBuildDate>Wed, 28 Jul 2010 20:12:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Experiments in rendering a Tiled Map in javascript/html&#8230;</title>
		<link>http://www.egometry.com/gruedorf/experiments-in-rendering-a-tiled-map-in-javascripthtml/</link>
		<comments>http://www.egometry.com/gruedorf/experiments-in-rendering-a-tiled-map-in-javascripthtml/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 09:53:38 +0000</pubDate>
		<dc:creator>mcgrue</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Gruedorf]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.egometry.com/?p=936</guid>
		<description><![CDATA[Sophia&#8217;s first tiles!Embrace the pixels! Sophia has been chomping at the bit to make more games. Since it&#8217;s been going on two years since I last flexed my gamemaking muscles fully, and since I rather adore Sophia, I&#8217;ve been chasing this rainbow. I&#8217;ve been ever more intrigued by the idea of a pure html/javascript game [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; padding: 4px; margin: 4px;">
<p><a title="Sophia Game mk1." rel="lightbox[pics936]" href="http://www.egometry.com/i/2010/07/SophiaGame.png"><img class="attachment wp-att-937 alignleft" src="http://www.egometry.com/i/2010/07/SophiaGame.thumbnail.png" alt="Sophia Game mk1." width="192" height="200" /></a></p>
<p>	<span style="color: silver; font-size: -1;"><br />
<br />Sophia&#8217;s first tiles!<br />Embrace the pixels!</span></div>
<p>Sophia has been chomping at the bit to make more games.  Since it&#8217;s been going on <a href="http://www.egometry.com/gruedorf/the-magical-meaning-of-m/">two years since I last flexed my gamemaking muscles fully</a>, and since I rather adore Sophia, I&#8217;ve been chasing this rainbow.</p>
<p>I&#8217;ve been ever more intrigued by the idea of a pure html/javascript game engine of late, and have started taking existing, established tools (like mapeditor.org&#8217;s tiled) and putting them into the browser.</p>
<p><a href="http://www.egometry.com/files/gruedorf_challenge/070/" target=_new>Here&#8217;s the result: (currently firefox-only)</a>. To fully get the pleasure, inspect elements on this example in firebug.</p>
<p>The idea is simple: html/js has affordances baked-in to parse xml documents.  This can handle traditional map data.  css sprite-sheet techniques have been used for years now, which directly mimic old tilset/vsp-style assets.  Combine the two&#8230; and you have a effen map.  Throw in browser optimizations for visible/hidden elements, and we should have a relatively cheap rendering method.</p>
<p>The above test is fairly simple: one 30&#215;30 map, one layer.  It loads instantaneously fast.  It&#8217;s tiles are a single gif sized 304&#215;144.  Fairly economical.  I decided to shove each of these boys into a div for now and use the background-image css spriting technique to get a &#8220;purist&#8221; tiling implementation going.</p>
<p>I opted against using canvas for now because I wanted to see how far I could get without it.  So far so good, but I&#8217;ve not yet really stressed the system.  The next jump will be to take some of my epic 6-layer maps from SotS, translate them into xml, and see how they fair in the browser.</p>
<p>Of the code I wrote, I suppose the &#8220;sauce&#8221; was a fairly common offset calculation.  Although this sort of endeavor may not be so common in the modern age, it&#8217;s pretty commonplace to those of us who labored in 320&#215;240 back in DOS.  Get off my lawn.</p>
<pre>
var tileset = {
    tileWidth: 16,
    tileHeight: 16,
    setWidth: 304,
    setHeight: 144,

    getCoordsfromIdx : function( idx ) {
        var idx = parseInt(idx);
        idx--; //tmx is 1-based, not 0-based.  We need to sub 1 to get to a proper mapping.
        //idx--;

        var perRow = this.setWidth / this.tileWidth;

        var x = idx % perRow;
        var y = (idx / perRow);

        return [
            -(parseInt(x)*parseInt(this.tileWidth)),
            -(parseInt(y)*parseInt(this.tileHeight))
        ];
    }
}
</pre>
<p>This is converting a single tile index into two coordinates for the renderer to consume.  For instance, if you want tile 2, it takes a &#8217;2&#8242; at the top, does some maths, and tells you that tile 2&#8242;s offset is 16 pixels in from the top-left corner, and 0 pixels down (ie, on the top row).  Some strange quirks of this code: I had to decrement the idx, because Tiled&#8217;s xml format is 1-based, not 0 (ie, the first tile, the one at (0,0), is index 1, not index 0); and I negate the two numbers I return because the consumer of these coordinates is a css background-position style, and that&#8217;s how they work.</p>
<p>Also of note was a small hiccup when I uploaded this to my server.  My sandbox had no trouble serving a .tmx file as Content-Type: text/xml, but my big-boy server threw a conniption about it.  I didn&#8217;t realize that was a problem until I threw some debugger statements into the code that &#8220;should&#8217;ve just worked&#8221; and found that all of the proper stuff was in the responseText attribute, but responseXML was null.  So I renamed the mapfile to .xml on the server and everything worked fine.</p>
<p>I guess next step, before trying to stress the system with a super macho map, is to figure out why this isn&#8217;t working in Safari/Chrome/IE/Opera/Whatever&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.egometry.com/gruedorf/experiments-in-rendering-a-tiled-map-in-javascripthtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who Watches the Watchmen&#8217;s Ads?</title>
		<link>http://www.egometry.com/games/who-watches-the-watchmens-ads/</link>
		<comments>http://www.egometry.com/games/who-watches-the-watchmens-ads/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 09:11:47 +0000</pubDate>
		<dc:creator>mcgrue</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[advertising]]></category>
		<category><![CDATA[watchmen]]></category>

		<guid isPermaLink="false">http://www.egometry.com/?p=710</guid>
		<description><![CDATA[So, I've been digging through a few watchmen videos from a few places, and there's one thing in common:

They all have survival horror video game ads in front.]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve been digging through a <a href=http://www.rottentomatoes.com/dor/objects/34260/watchmen/videos/watchmen_gibbons_071008.html target=_blank>few watchmen videos</a> from a few places, and there&#8217;s one thing in common:</p>
<p>They all have survival horror video game ads in front.</p>
<p><a href=http://en.wikipedia.org/wiki/Watchmen target=_blank>Watchmen</a> is an award-winning comic book of the same vintage as The Dark Knight Returns and Maus.  These are the books that <i>gave birth</i> to the term Graphic Novel.  </p>
<p>And the advertisers associate slasher games with it?</p>
<p>I suppose the movie is targeted at a young male demographic because it&#8217;s a superhero flick, but the source material doesn&#8217;t really seem to lend itself to being fully appreciated by the set.  </p>
<p>On the other hand, who doesn&#8217;t love zombies?</p>
<div align=center>
<embed src="http://cdn.springboard.gorillanation.com/storage/xplayer/co003.swf" type="application/x-shockwave-flash" width="500" height="407" swliveconnect="true" allowfullscreen="true" wmode="transparent" flashvars="e=4bffc0037b3a3a473a9a2f4e92ed7a23c70b2277d530099d1865f7dc06525b6c7b7d8e83cee9272d0968d8f9612b3924cdfe84b7b0bad2a4dddd4b8e4555dc1c69aecb7e2fa0df74ed93845242e67ccf574c9adc86f193a0a23c5be5fec70aa9a53caf8ce2ffbb16&#038;width=500&#038;height=407&#038;autostart=false&#038;allowscriptaccess=always&#038;usefullscreen=true&#038;autoscroll=true&#038;thumbsinplaylist=true&#038;esnapshot=4dfed81f&#038;trueurl=http://www.collider.com/entertainment/news/article.asp/aid/10997/tcid/1"></embed>
</div>
<p>In other news, this is egometry&#8217;s 100th post.  And there were 100 words in this post before this footnote (quite unplanned).  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.egometry.com/games/who-watches-the-watchmens-ads/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lego Star Wars 2</title>
		<link>http://www.egometry.com/games/lego-star-wars-2/</link>
		<comments>http://www.egometry.com/games/lego-star-wars-2/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 05:58:20 +0000</pubDate>
		<dc:creator>mcgrue</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[lego star wars]]></category>
		<category><![CDATA[platformer]]></category>
		<category><![CDATA[reviews]]></category>

		<guid isPermaLink="false">http://www.egometry.com/?p=637</guid>
		<description><![CDATA[I can't rid of the impression that Lego Han Solo prowls Lego Elementary Schools for unsupecting Duplos to molest...]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 20px; margin-bottom: 20px; color: silver; text-align: center;"><a href="http://www.egometry.com/i/2009/02/gordon.jpg"><img src="http://www.egometry.com/i/2009/02/gordon-250x300.jpg" alt="" title="gordon" width="250" height="300" class="alignnone size-medium wp-image-638" /></a><br />
This image is more interesting than<br />
<i>Lego Star Wars 2</i>.
</div>
<p>On the strength of Yahtzee&#8217;s <a href=http://www.escapistmagazine.com/videos/view/zero-punctuation/123-LEGO-Indy>You Might Enjoy Lego Indiana Jones</a> review, and the fact that I seem to have recalled hearing other people speak well of the Lego Star Wars games in the past, and (honestly) mostly the fact that I&#8217;ve started to become a bit of a Gamer Point whore, I decided to pick up Lego Star Wars 2 for my XBOX 360!</p>
<p>Oh, god it sucks.</p>
<h4>Pro:</h4>
<ul>
<li> You get to beat the ever-loving fuck out of your allies.</li>
</ul>
<h4>Con:</h4>
<ul>
<li> Your allies get in the way far too easily, especially in co-op mode. </li>
</ul>
<h4>Pro:</h4>
<ul>
<li> There&#8217;s an impressive amount of humor present, mostly of a slapstick/in-reference sort (Chewie can, for instance, pull the arms off of lego enemies as a melee attack.)</li>
</ul>
<h4>Con:</h4>
<ul>
<li> A lot of the expressions seem wrong to be very, very wrong (I can&#8217;t rid of the impression that Lego Han Solo prowls Lego Elementary Schools for unsupecting Duplos to molest.)</li>
</ul>
<h4>Pro:</h4>
<ul>
<li> A lot of shit to blow up, and that shit drops delicious money that you can collect with seratonin-emitting ching-ghing sounds.</li>
</ul>
<h4>Con:</h4>
<ul>
<li> &#8230;but there seems to be no real point to collecting all of the money.  Other than the high, that is.</li>
</ul>
<h4>Pro:</h4>
<ul>
<li> There are tons of meaningless collectable sets hidden within each of the sub-zones to find and make you feel rewarded when you procure them!</li>
</ul>
<h4>Con:</h4>
<ul>
<li> There are tons of <i>meaningless</i> collectable sets.</li>
</ul>
<h4>Pro:</h4>
<ul>
<li> The camera isn&#8217;t user-controllable and totally sucks.  <b>Oh wait, that&#8217;s not a pro at all</b>!</li>
</ul>
<h4>Con:</h4>
<ul>
<li> The game requires a large amount of platform jumping and is very finicky about edges.  It&#8217;s the jumping puzzle of Xenogears but the <i>entire game</i>.</li>
</ul>
<h4>Pro:</h4>
<ul>
<li> You can almost rape each other against the wall in co-op&#8230;</li>
</ul>
<h4>Con:</h4>
<ul>
<li> &#8230;but it turns out the walls and/or characters are too well lubricated, as they slip off of one another (these two suggested by Sophia.  Honest.).  </li>
</ul>
<p>My recommendation: avoid the game.</p>
<p>&#8230;I will, of course, still play it just to get my goddamned gamer points, though.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.egometry.com/games/lego-star-wars-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
