<?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>Maxime Preaux&#039;s Code Den</title>
	<atom:link href="http://deammer.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://deammer.com</link>
	<description></description>
	<lastBuildDate>Thu, 18 Oct 2012 05:21:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Procedural Floating Islands</title>
		<link>http://deammer.com/code-2/procedural-floating-islands/</link>
		<comments>http://deammer.com/code-2/procedural-floating-islands/#comments</comments>
		<pubDate>Thu, 18 Oct 2012 04:59:34 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[generation]]></category>
		<category><![CDATA[island]]></category>
		<category><![CDATA[procedural]]></category>

		<guid isPermaLink="false">http://deammer.com/?p=232</guid>
		<description><![CDATA[I&#8217;ve been roaming blogs and wikis about the fascinating topic of procedural generation of terrain, and tonight I finally decided to give it a go. After a couple hours, here&#8217;s where I&#8217;m at: Press any key to generate a new &#8230; <a href="http://deammer.com/code-2/procedural-floating-islands/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been roaming blogs and wikis about the fascinating topic of procedural generation of terrain, and tonight I finally decided to give it a go. After a couple hours, here&#8217;s where I&#8217;m at:</p>
<p>
<object width="300" height="320">
<param name="movie" value="http://deammer.com/wp-content/uploads/2012/10/Islands.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<param name="allowScriptAccess" value="always"></param>
<embed type="application/x-shockwave-flash" width="300" height="320" src="http://deammer.com/wp-content/uploads/2012/10/Islands.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
</p>
<p>Press any key to generate a new floating island. It&#8217;s fast enough that you can keep the key down and it&#8217;ll draw 30 islands per second. Fuck yeah bitmap data.</p>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/code-2/procedural-floating-islands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 tricks</title>
		<link>http://deammer.com/code-2/as3-tricks/</link>
		<comments>http://deammer.com/code-2/as3-tricks/#comments</comments>
		<pubDate>Thu, 11 Oct 2012 04:51:20 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://deammer.com/?p=222</guid>
		<description><![CDATA[Here are some handy tricks I&#8217;ve found and come across while working in ActionScript. 1. with Sometimes, we need to write some very repetitive code to set the properties of an object, like a TextField or a Sprite. Instead of &#8230; <a href="http://deammer.com/code-2/as3-tricks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here are some handy tricks I&#8217;ve found and come across while working in ActionScript.</p>
<p>1. <strong>with</strong></p>
<p>Sometimes, we need to write some very repetitive code to set the properties of an object, like a TextField or a Sprite. Instead of this:</p>
<pre class="brush:as3">graphics.beginFill(0x00ccff);
graphics.drawCircle(0, 0, 12);
graphics.endFill();</pre>
<p><strong> </strong>&#8230; you could write this:</p>
<pre class="brush:as3">with (graphics)
{
	beginFill(0x00ccff);
	drawRect(0, 0, 12);
	endFill();
}</pre>
<p>While I&#8217;m not avoiding a bajillion lines of code in this particular example, it should be enough to illustrate my point and get you thinking about all the possibilities of such a keyword!</p>
<p>2. <strong>Event Listeners</strong></p>
<p>Sure, you may not be able to pass arguments when an Event is triggered, but don&#8217;t forget that Events themselves have various properties, including a &#8220;<strong>type</strong>&#8220;. This can be useful to avoid writing a function for every event.</p>
<pre class="brush:as3">// event handlers
function handler(event:MouseEvent):void
{
	if(event.type == "mouseDown")
		trace("Down");
	else
		trace("Up");
}

movieClip.addEventListener(MouseEvent.MOUSE_DOWN, handler);
movieClip.addEventListener(MouseEvent.MOUSE_UP, handler);</pre>
<p>Bonus trick: if you have a lot of EventListeners, you could put them all in an Array/Vector and remove them all easily when the time comes. Yay efficient garbage collection!</p>
<p>3. <strong>Setting properties</strong></p>
<p>Ever wanted to set more than one property at once, instead of each of them individually? Lookie here:</p>
<pre class="brush:as3">// this function sets multiple properties of an Object
function setProps(item:*, props:Object):void
{
	for (each var s:String in props)
		item[key] = props[key];
}

// for instance, to set the properties of a Sprite:
var s:Sprite = new Sprite();
setProps(s, {x:100, y:50, scaleX:2, scaleY:2, rotation:45});</pre>
<p>&nbsp;</p>
<p>Happy coding <img src='http://deammer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/code-2/as3-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UTD Game Jam!</title>
		<link>http://deammer.com/game-design/utd-game-jam/</link>
		<comments>http://deammer.com/game-design/utd-game-jam/#comments</comments>
		<pubDate>Thu, 11 Oct 2012 04:28:49 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Flashpunk]]></category>
		<category><![CDATA[game jam]]></category>
		<category><![CDATA[kongregate]]></category>
		<category><![CDATA[ogmo]]></category>

		<guid isPermaLink="false">http://deammer.com/?p=225</guid>
		<description><![CDATA[Hey internet! About two weeks ago, I participated in game jam at UTD, which went absolutely great. The theme was &#8220;eight&#8221;, so after spending a couple hours designing a game of gigantic scale, we settled on the more reasonable idea &#8230; <a href="http://deammer.com/game-design/utd-game-jam/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hey internet! About two weeks ago, I participated in game jam at UTD, which went absolutely great. The theme was &#8220;eight&#8221;, so after spending a couple hours designing a game of gigantic scale, we settled on the more reasonable idea of &#8220;you crash-land on a planet and only have eight bullets to gtfo&#8221;. We used <a href="http://chevyray.com/" target="_blank">ChevyRay</a>&#8216;s <a href="http://flashpunk.net/" target="_blank">FlashPunk</a> and <a href="http://www.mattmakesgames.com/" target="_blank">Matt Thorson</a>&#8216;s <a href="http://www.ogmoeditor.com/" target="_blank">Ogmo Editor</a> and crafted a <a href="http://supermeatboy.com/" target="_blank">SuperMeatBoy</a>/<a href="http://kayin.pyoko.org/iwbtg/downloads.php" target="_blank">IWBTG</a>-esque game in thirty-six hours.</p>
<div id="attachment_228" class="wp-caption aligncenter" style="width: 360px"><a href="http://deammer.com/wp-content/uploads/2012/10/countdown_small.png"><img class=" wp-image-228 " title="Jam Countdown" src="http://deammer.com/wp-content/uploads/2012/10/countdown_small.png" alt="" width="350" height="383" /></a><p class="wp-caption-text">This thing is stressful as hell.</p></div>
<p>Having worked with <a href="https://twitter.com/snave333" target="_blank">Spencer</a> in the past, the whole thing went even more smoothly than I thought it would &#8211; we didn&#8217;t encounter any major issues. The game is <a title="Play Eight Bullets!" href="http://www.kongregate.com/games/Deammer/eight-bullets" target="_blank">up on Kongregate</a>, so you should have a look! And make sure to login, if you want your score saved <img src='http://deammer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a title="Play Eight Bullets!" href="http://www.kongregate.com/games/Deammer/eight-bullets" target="_blank">Play it here!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/game-design/utd-game-jam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Fourth :)</title>
		<link>http://deammer.com/code-2/happy-fourth/</link>
		<comments>http://deammer.com/code-2/happy-fourth/#comments</comments>
		<pubDate>Thu, 05 Jul 2012 11:14:39 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[explosions]]></category>
		<category><![CDATA[fireworks]]></category>
		<category><![CDATA[particles]]></category>

		<guid isPermaLink="false">http://deammer.com/?p=215</guid>
		<description><![CDATA[Haven&#8217;t posted in a while, job hunting and learning UnrealScript have taken up most of my time. However, a programmer is never too busy to make particle systems, and since some of my friends were out of the country and &#8230; <a href="http://deammer.com/code-2/happy-fourth/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Haven&#8217;t posted in a while, job hunting and learning UnrealScript have taken up most of my time. However, a programmer is never too busy to make particle systems, and since some of my friends were out of the country and could not see the fireworks, i took the opportunity to make this.</p>
<p>
<object width="400" height="300">
<param name="movie" value="http://deammer.com/wp-content/uploads/2012/10/Fireworks.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<param name="allowScriptAccess" value="always"></param>
<embed type="application/x-shockwave-flash" width="400" height="300" src="http://deammer.com/wp-content/uploads/2012/10/Fireworks.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
</p>
<p>Click the movie to set focus on it, click outside to stop firing, or look at the full-screen version <a title="Fireworks!" href="http://deammer.com/flashMovies/Fireworks/fireworks.html" target="_blank">right here</a>.</p>
<p>Happy Independence Day, American friends <img src='http://deammer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/code-2/happy-fourth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flux 112 Trailer</title>
		<link>http://deammer.com/game-design/flux-112-trailer/</link>
		<comments>http://deammer.com/game-design/flux-112-trailer/#comments</comments>
		<pubDate>Tue, 01 May 2012 06:59:09 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[112]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[atec]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Flashpunk]]></category>
		<category><![CDATA[flux]]></category>
		<category><![CDATA[flux 112]]></category>
		<category><![CDATA[gamelab]]></category>

		<guid isPermaLink="false">http://deammer.com/?p=195</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<span style="text-align:center; display: block;"><a href="http://deammer.com/game-design/flux-112-trailer/"><img src="http://img.youtube.com/vi/5PRleWCtaPU/2.jpg" alt="" /></a></span>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/game-design/flux-112-trailer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lightning Effect in AS3</title>
		<link>http://deammer.com/code-2/lightning/</link>
		<comments>http://deammer.com/code-2/lightning/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 01:25:19 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[lightning]]></category>

		<guid isPermaLink="false">http://deammer.com/?p=133</guid>
		<description><![CDATA[Working on Flux, I was tasked with implementing the Electrolaser, which basically shoots a lightning arc at the target, and branches out to enemies around the target&#8230; fun stuff! I thought I would share with the interwebz the logic behind &#8230; <a href="http://deammer.com/code-2/lightning/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Working on Flux, I was tasked with implementing the Electrolaser, which basically shoots a lightning arc at the target, and branches out to enemies around the target&#8230; fun stuff! I thought I would share with the interwebz the logic behind lightning generation (or the way <em>I</em> do it at least). But first, a demo of what it looks like!</p>
<address>
<object width="400" height="400">
<param name="movie" value="http://deammer.com/wp-content/uploads/2012/04/Lightning.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<param name="allowScriptAccess" value="always"></param>
<embed type="application/x-shockwave-flash" width="400" height="400" src="http://deammer.com/wp-content/uploads/2012/04/Lightning.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
<br />
The example above features only 2 bolts so you can get a basic idea of the system. <strong>Click anywhere in the movie</strong> to start the generation. The bolts will strike the mouse!</address>
<p>The basic idea behind creating those lightning bolts is to start with a single line, or more accurately a segment. If you spent your geometry classes playing Snake on your graphing calculators (unlike me, of course), here&#8217;s a short reminder: a segment is a part of a line bounded by two points. It&#8217;s that simple. So first, you create the segment:</p>
<p style="text-align: center;"><a href="http://deammer.com/wp-content/uploads/2012/04/lightning1.png"><img class="aligncenter size-full wp-image-178" title="Create a segment" src="http://deammer.com/wp-content/uploads/2012/04/lightning1.png" alt="Create a segment" width="400" height="99" /></a></p>
<p>Then, the trick is to get the middle point of that segment and to offset it perpendicularly a short amount, like so:</p>
<p style="color: #333333; font-style: normal; line-height: 24px; text-align: center;"><a href="http://deammer.com/wp-content/uploads/2012/04/lightning2.png"><img class="aligncenter size-full wp-image-179" title="Offset the middle point, creating 2 segments" src="http://deammer.com/wp-content/uploads/2012/04/lightning2.png" alt="Offset the middle point, creating 2 segments" width="399" height="76" /></a></p>
<p>And then, you guessed it: keep going until you get enough subdivisions to suit your needs.</p>
<p style="color: #333333; font-style: normal; line-height: 24px; text-align: center;"><a href="http://deammer.com/wp-content/uploads/2012/04/lightning3.png"><img class="aligncenter size-full wp-image-180" title="Create ALL the segments!" src="http://deammer.com/wp-content/uploads/2012/04/lightning3.png" alt="Create ALL the segments!" width="400" height="208" /></a></p>
<p>Now on to the code side. First, i recommend creating a Segment class, which i outlined below:</p>
<pre class="brush:as3">public class Segment
{
	private var start_point:Point;
	private var end_point:Point;

	public function Segment(start:Point, end:Point)
	{
		start_point = start;
		end_point = end;
	}
	public function getStart():Point { return start_point; }
	public function getEnd():Point { return end_point; }
	public function getMiddle():Point
	{
		var middle:Point = new Point();
		middle.x = (start_point.x + end_point.x) / 2;
		middle.y = (start_point.y + end_point.y) / 2;
		return middle;
	}
}</pre>
<p>Then , create a vector of Segments to store all your lightning bolts, and create the main bolt (in the example above, it goes from the top of the movie to the position of the mouse).</p>
<pre class="brush:as3">var bolts:Vector.&lt;Segment&gt; = new Vector.&lt;Segment&gt;();
bolts.push(new Segment(start_point, end_point));</pre>
<p>Then, you create two segments out of the first one, while offsetting the middle a little:</p>
<pre class="brush:as3">bolts.push(new Segment(bolts[0].getStart(), bolts[0].getMiddle()));

// offset the end of the previous bolt
bolts[1].setEnd(offsetTangeant(getAngle(bolts[0].getStart(), bolts[0].getEnd()), bolts[1].getEnd(), (Math.random() - 0.5) * 10);

// create the second part of the bolt
bolts.push(new Segment(bolts[1].getEnd(), bolts[0].getEnd());</pre>
<p>My offsetting function looks like this:</p>
<pre class="brush:as3">// offset a point orthogonally to the tangent
private function offsetTangeant(tan_angle:Number, point:Point, offset:Number):Point
{
	point.x += Math.cos(tan_angle + Math.PI / 2) * offset;
	point.y += Math.sin(tan_angle + Math.PI / 2) * offset;

	return point;
}
// get the angle between two points (radians)
private function getAngle(p1:Point, p2:Point):Number
{
	return Math.atan2(p2.y - p1.y, p2.x - p1.x);
}</pre>
<p>And keep going until you have enough bolts! I find that 4-6 iterations is usually enough. After you have populated the &#8220;bolts&#8221; Vector, all you have to do is draw a line between all those segments, and voila.</p>
<p>Stay tuned for part 2, where we will see how to add branches to that main lightning bolt!</p>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/code-2/lightning/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3 and PHP</title>
		<link>http://deammer.com/code-2/as3-and-php/</link>
		<comments>http://deammer.com/code-2/as3-and-php/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 21:40:55 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[send]]></category>

		<guid isPermaLink="false">http://deammer.com/wordpress/?p=88</guid>
		<description><![CDATA[Been spending most of my time on Flux 112 lately, and one of my duties is to track data in real time within Flash. After much trial-and-error, i&#8217;ve found that getting data from PHP is actually really easy, but there &#8230; <a href="http://deammer.com/code-2/as3-and-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Been spending most of my time on Flux 112 lately, and one of my duties is to track data in real time within Flash. After much trial-and-error, i&#8217;ve found that getting data from PHP is actually really easy, but there aren&#8217;t many great tutorials out there, so here is how i do it.</p>
<p>First use this function to send a query to the PHP script:</p>
<pre class="brush:as3">private function sendQuery():void
{
	var variables:URLVariables = new URLVariables();
		variables.username = "Bruce Willis";

	var request:URLRequest = new URLRequest("http://yoursite.com/the_script.php");
		request.method = URLRequestMethod.POST;
		request.data = variables;

	var loader:URLLoader = new URLLoader();
		loader.dataFormat = URLLoaderDataFormat.TEXT;
		loader.addEventListener(Event.COMPLETE, querySent);

	try
	{
		loader.load(request);
	}
	catch (error:Error)
	{
		trace("Upload failed.");
	}
}</pre>
<p class="brush:as3">URLVariables are what you send to the PHP script. I am sending a String here, but you can send Numbers, pictures, etc.</p>
<p class="brush:as3">Next, we create the URLRequest, which we will send through a URLLoader. Set the URLRequestMethod to &#8220;POST&#8221; (i will explain why later) and give the request whatever data it should send (our previously created variables).</p>
<p class="brush:as3">Then, create the URLLoader (you can send the request to the constructor, or leave it blank and load it like i did below). I like to set the DataFormat to &#8220;TEXT&#8221;, but this is not always necessary. Add an EventListener to that loader, so that you can execute a function when the request was completed. And finally, load the request! I use a &#8220;try / catch&#8221; statement in case there is an issue, and trace out whatever error message you want.</p>
<p class="brush:as3">Then comes the function that is called when the loader is complete:</p>
<pre class="brush:as3">private function querySent(e:Event):void
{
	if (!e.target.data)
		trace("No data back");

	else
		trace("The most awesome actor is: " + e.target.data);
}</pre>
<p class="brush:as3"> This one is simple: when the loader is complete, it first checks to see if any data came back from the request (line 3). If so, it traces the data you sent (in this case, &#8220;Bruce Willis&#8221;).</p>
<p class="brush:as3">Here is the PHP script, called &#8220;the_script.php&#8221; and saved on your website.</p>
<pre class="brush:php">&lt;?php
/**
* @author: Maxime Preaux
*/

// get the variable from AS3
$name = $_POST["username"];

if (!$name)
{
	echo("no data sent from Flash");
}
else
{
	echo($name);
}

?&gt;</pre>
<p class="brush:as3">First, a PHP script starts with &#8220;&lt;?php&#8221; and ends by closing that tag: &#8220;?&gt;&#8221;.</p>
<p class="brush:as3">Then, I declare the variable like so: &#8220;$name&#8221;. It&#8217;s that simple. Then, I assign the value of $_POST["username"] to that variable. In PHP, you can either use &#8220;GET&#8221; or &#8220;POST&#8221; to send data to a script. The &#8220;GET&#8221; method actually writes the data in the browser bar, whereas the &#8220;POST&#8221; method keeps it hidden. In our case, either method would work.</p>
<p class="brush:as3">Make sure that ["username"] matches the variable sent from AS3 (see line 4. of the first AS3 script).</p>
<p class="brush:as3">After that, we check to see if $name has a value. If it got the data from AS3 correctly, it should! Otherwise, it will send &#8220;no data sent from Flash&#8221; back to your program. But if all works correctly, it will send the value of username back to you using the &#8220;echo()&#8221; function.</p>
<p class="brush:as3">And that&#8217;s it! You now know how to send and get data from AS3 and PHP!</p>
<p class="brush:as3">If you have any questions or better ways to do this, please post in the comments below <img src='http://deammer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/code-2/as3-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why AC:Revelations let me down.</title>
		<link>http://deammer.com/game-design/why-acrevelations-let-me-down/</link>
		<comments>http://deammer.com/game-design/why-acrevelations-let-me-down/#comments</comments>
		<pubDate>Mon, 19 Mar 2012 21:24:57 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[assassin's creed]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://deammer.com/wordpress/?p=71</guid>
		<description><![CDATA[I was hooked on the Assassin&#8217;s Creed series since the first game. Free-roaming through Masyaf, Jerusalem, Damascus and the kingdom in-between was a breath of fresh air. The fact that you could jump from rooftop to rooftop, climb towers and &#8230; <a href="http://deammer.com/game-design/why-acrevelations-let-me-down/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was hooked on the Assassin&#8217;s Creed series since the first game. Free-roaming through Masyaf, Jerusalem, Damascus and the kingdom in-between was a breath of fresh air. The fact that you could jump from rooftop to rooftop, climb towers and jump on haystacks like a reckless badass was so sweet. Then came AC2, and that was, in my opinion, the best AC game Ubisoft ever released. The amout of details in the world, the fact that NPCs have different things to say when they notice your actions, how you could get income by buying businesses, all the weapons, paintings and upgrades available to unlock, and even Leonardo Da Vinci? Win in my book. I played through it in 3 days and got all the achievements (first game I ever did that!)</p>
<p>Brotherhood was a bit of a let-down on the solo side: at various points throughout the campaign I had no clue what was going on in the storyline, because I was busy doing side missions and increasing my income, and I had to play the game twice to understand the plot. The multiplayer, though, was incredible. Totally mind-blowing. But I&#8217;d like to focus on the solo experience rather than the multiplayer.</p>
<p>AC:Revelations is freaking beautiful. The graphics of Istanbul and its inhabitants are breathtaking. Gone are the days when there were a limited number of skins the NPCs could have; now I don&#8217;t even recall seeing twice the same person. You can swim, you can jump higher and farther, you can grab weapons from enemies and cave their face in with maces and warhammers, you can craft bombs of your own choosing, you can send your assassins abroad to level them up, and call upon them when in need. There are so many tiny details, side-stories and character biographies that game feels historically accurate and Ezio seems to belong to this believable world.</p>
<p>But Revelations could and should have learned from the series&#8217; past mistakes, like AC2 did. The first thing that bothers me is the combat system. All you ever have to do is parry, and sometimes shoot from your handcannon to kill those Janissaries. Sure, you can kick, grab, headbut, through sand in the enemies&#8217; faces, but nothing is as effective as parrying a blow and slicing the enemy&#8217;s throat. This has not changed since the very first game, and in my opinion makes Ezio/Desmond/Altair feel very week. I have been playing a lot of Arkham City recently, and that got me thinking that if AC drew some ideas from the Free Flow combat system, the game would be twice better immediately.</p>
<p>Next up: the HUD and the way information is presented to us, the players. The fact that we know the game is a simulation of Desmond&#8217;s ancestors&#8217; memories gives Ubisoft the freedom to give us in-game information through white-over-black text. This does not bother me, and I think it is a clever piece of game design that gives them a lot of options and freedom without sacrificing immersion. But when I see that the game talks to me about NPCs and &#8220;resume the game&#8221; and similar pieces of (sometimes useless) information, it immediately takes me out of the experience. Why would you talk about NPCs? I don&#8217;t want to be reminded I&#8217;m playing a game when I&#8217;m fully immersed in the story and the incredible details of the city!</p>
<p>Third thing that bothers me (and a lot of my friends) is the freaking Tower Defense mini-game Ubisoft put in. Like, seriously, what the hell? Don&#8217;t take me wrong, I LOVE TD, I still have Warcraft 3 installed just so I play TD on Battle.net. But the way they implemented TD in AC:R is just lame. First, the camera sucks, and it&#8217;s really hard to get a good notion of what is going on. Second, where the hell do you get all those assassins with all this cool gear, when you can only call upon say ten of them to go on missions and all? To win this mini-game, all you have to do is spam assassins all over the rooftops and then spam some more. No depth, no fun. It really feels like an unfinished experience that Ubisoft threw in just to say &#8220;hey look, we can do that!&#8221;.</p>
<p>Fourth, and that&#8217;s not new from AC:R but from Brotherhood, is the &#8220;memory-completion percentage&#8221; bullshit. Basically, if you don&#8217;t complete the missions EXACTLY like the game tells you to, you&#8217;ll only get 50% completion. What I think they tried to do with that is make you feel like you had to complete the memories exactly like your ancestor did, and I guess this is an okay argument. But what is so thrilling about this series is that you have a shit-ton of options to deal with each situations: you can rush in recklessly and take out all opposition with your sword and dagger, you can kill each guard silently and finally get your target when it is isolated and alone (so gratifying!), and all the things that go in-between (poison darts, calling assassins, using mercenaries/thieves, hiding on benches/haystacks, etc.) So why would Ubisoft give us all those amazing options and then tell us that we only use one?! It&#8217;s like giving a kid Legos and telling him he is only allowed to build one thing!</p>
<p>All in all, Revelations is a great game, and the amount of work involved in it is just phenomenal. I am not trying to hate on the studios and the people that made this game happen, I just someone at Ubisoft will read this and take my humble opinion into consideration when working on AC3. Ubisoft learned from their mistakes and the progress made between the first and the second game in the series blew my mind at the time, and I don&#8217;t think any game has ever evolved that fast.</p>
<p>So Ubisoft, please make AC3 as great as AC2 was in comparison to AC, and I will love you eternally.</p>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/game-design/why-acrevelations-let-me-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 Optimization</title>
		<link>http://deammer.com/code-2/as3-optimization/</link>
		<comments>http://deammer.com/code-2/as3-optimization/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 01:55:40 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://deammer.com/?p=103</guid>
		<description><![CDATA[Optimization is a tricky-yet-important part of a project. You don&#8217;t want to sacrifice the clarity fo your code, but it&#8217;s essential to strike the correct balance between OOP and performance. First, ask yourself: is your project fast enough? Do you &#8230; <a href="http://deammer.com/code-2/as3-optimization/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Optimization is a tricky-yet-important part of a project. You don&#8217;t want to sacrifice the clarity fo your code, but it&#8217;s essential to strike the correct balance between OOP and performance.</p>
<p>First, ask yourself: is your project fast enough? Do you really need to make it faster? Computers keep getting faster, and while books teach you that using a float instead of a double will make a world of difference, it is not really the case unless you go through countless iterations of a loop.</p>
<p>Final advice before we get to the juicy part: do not optimize until you are close to being done and everything works correctly, or it will be a pain to make changes later. That being said, here is what I know about AS3 optimization.</p>
<p>1. Use <strong>uints </strong>and <strong>numbers </strong>only when you have to! With the current version of the player, <strong>integers</strong> are almost twice as fast as unsigned ints. Numbers are just slightly slower than uints.</p>
<p>2. Stacked operators are slow!</p>
<pre class="brush:as3">if (a &amp;&amp; b &amp;&amp; c) // slower</pre>
<pre class="brush:as3">// faster
if (a)
{
	if (b)
	{
		if (c)
		{
		}
	}
}</pre>
<p>3. &#8220;for each&#8221; is really convenient&#8230; and hundred of times slower than &#8220;for&#8221;</p>
<pre class="brush:as3">// slow...
for each (var s:String in array)

// fast!
for (var i:int = 0; i &lt; array.length; i++)</pre>
<p class="brush:as3">4. Declare variables before loops! For instance, if you use a &#8220;for&#8221; loop to go through a large array or vector, you should avoid accessing that array&#8217;s &#8220;length&#8221; property more than once, like below. Also, avoid declaring variables within a loop.</p>
<pre class="brush:as3">var max:int = array.length
var i:int;
for (i = 0; i &lt; max; i++)
{
	// do stuff
}</pre>
<p class="brush:as3">5. Point.distance() is slower than computing the Euclidian distance between two points (see below). Also, using Math.pow() is slower that multiplying a number by itself.</p>
<pre class="brush:as3">d = Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));</pre>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/code-2/as3-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Future is Exciting</title>
		<link>http://deammer.com/game-design/68/</link>
		<comments>http://deammer.com/game-design/68/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 16:59:33 +0000</pubDate>
		<dc:creator>deammer</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[flux 112]]></category>
		<category><![CDATA[game design]]></category>

		<guid isPermaLink="false">http://deammer.com/wordpress/?p=68</guid>
		<description><![CDATA[This coming semester looks really exciting. Graduation is looming ahead, and I have no job to keep my fridge populated, and thus no idea what will happen when my lease ends in May. But trivial matters aside, this semester is &#8230; <a href="http://deammer.com/game-design/68/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This coming semester looks really exciting. Graduation is looming ahead, and I have no job to keep my fridge populated, and thus no idea what will happen when my lease ends in May.</p>
<p>But trivial matters aside, this semester is indeed promising, as I have begun to work on a new game! I can’t release many details as of now, but know that it features “a system that procedurally generates and modifies the game level at runtime to better match players’ varying skill levels and playstyles.”</p>
<p>Sounds smart, eh? It is a really abstract system that may well turn HAL9000 on us!</p>
<p>Keep checking back for updates…</p>
]]></content:encoded>
			<wfw:commentRss>http://deammer.com/game-design/68/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
