<?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>Cold Constructs</title>
	<atom:link href="http://coldconstructs.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://coldconstructs.com</link>
	<description>Creations of Corey Birnbaum</description>
	<lastBuildDate>Wed, 22 Feb 2012 20:06:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Board game review: 7 Wonders</title>
		<link>http://coldconstructs.com/2012/01/board-game-review-7-wonders/</link>
		<comments>http://coldconstructs.com/2012/01/board-game-review-7-wonders/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 09:35:08 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Board games]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=764</guid>
		<description><![CDATA[I couldn't find any help on how to play this game with my family when we played it, so I decided to write a review and fill in the missing info. ]]></description>
			<content:encoded><![CDATA[<p>Over the holidays I got the chance to play a bunch of cool new games with family and I was so impressed with them that I thought I&#8217;d start a new aspect of my site for board game reviews. My secondary goal was to patch the web where information on these games was sorely missing.</p>
<p><a href="http://boardgamegeek.com/boardgame/68448/7-wonders">7 Wonders</a> is a card-based game about resource management and building up your city to maximize Victory Point collection by picking an optimal strategy from among a variety of point types.</p>
<h2>Game overview</h2>
<ul class="checklist">
<li>Fast yet deep gameplay</li>
<li>Variety of play styles to choose from</li>
<li>Flexible number of players (3-7 with special rules for 2)</li>
</ul>
<ul class="badlist">
<li>Steep learning curve</li>
<li>Poor instructions</li>
</ul>
<p>The basic flow of the game appears rather complex and unfortunately we couldn&#8217;t play the first two times we tried because 1) we couldn&#8217;t figure it out and 2) we kept disagreeing over the interpretation of the rules. After a couple of us sat down&#8211;away from the party&#8211;to grok the damn rules, we were able to grasp the concepts and play an actual game&#8230; after about half of the family already left. Basically, <strong>the instructions are poorly written</strong> and do not provide a good sense of how the game should flow. Example scenarios would have been great. The most lacking aspect was how to handle resources, which is the fundamental aspect of the game. So how they managed to screw that up, I have no idea.</p>
<p><a class="lightbox" href="http://coldconstructs.com/wp-content/uploads/2011/12/7wonders_cards.jpg"><img title="" src="http://coldconstructs.com/wp-content/uploads/2011/12/7wonders_cards.jpg" alt="" /></a></p>
<p>As you can see, there&#8217;s a lot of stuff&#8211;but don&#8217;t fret, once we figured it out, it&#8217;s a really fast game with a lot of options for playing different ways.</p>
<p>There are 7 types of wonders for players to choose from (surprise!), although the game calls for players to shuffle the wonder cards (seen above, under the boards) and choose randomly. We liked choosing our wonders and it worked out well for us, so whatever floats your boat. Each wonder has a number of advantages that can be &#8220;unlocked&#8221; by building your wonder in stages. For the A side (the &#8220;easy&#8221; side), it&#8217;s always three.</p>
<p>Besides building up your wonder (which is optional), you can build structures by laying down the card for it and paying the cost (usually regular resources, sometimes it&#8217;s gold). Structures get you all sorts of different things like additional resources, straight Victory Points, discounts on trading with certain neighbors, military advantage, and so on.</p>
<p>What&#8217;s interesting about this game is that all players choose one card from their hand, set it down on the table face-down, then reveal their choice when everyone has their picked <em>simultaneously</em>. After you resolve the card (pay for it by buying resources from your neighbors is typical), <strong>you give your hand to the player next to you.</strong> So through the whole game your swapping hands with the other players, which is an interesting strategic mechanic&#8211;knowing what the other players have and having the option to deny them what they probably want by using that card is certainly a fun twist.</p>
<p>You swap hands with your neighbors until all the cards are gone (you start with 7 for each player). After the cards are gone, you progress an Age&#8211;and there are three Ages. <strong>So the whole game is over in 21 turns!</strong> If you know the rules, you can finish a game in under 30 minutes.<br />
<a class="lightbox" href="http://coldconstructs.com/wp-content/uploads/2012/01/7wonders_game.jpg"><img class="alignright size-medium wp-image-807" title="7wonders_game" src="http://coldconstructs.com/wp-content/uploads/2012/01/7wonders_game-300x225.jpg" alt="" width="300" height="225" /></a></p>
<h2>Presentation</h2>
<p>The cards look and feel great&#8211;the art is an interesting, painterly style while the material they&#8217;re made of is a pretty standard glossy finish. The &#8220;City Boards&#8221; are thick, polished cardboard with some cryptic but pretty icons all over them (same with cards).</p>
<p>Thankfully, they didn&#8217;t rely too much on color to distinguish between important gameplay artifacts, although it is an obvious identification device used. Unfortunately, they used cryptic symbols everywhere, even in places that should (<em>could</em>) have been text instead (and would have made it easier to understand in the process). Once we got used to the game though, it wasn&#8217;t too hard to navigate the board at a glance. However there were some resource symbols that looked too similar, but it didn&#8217;t distract me too much.</p>
<p>Overall it was polished and a pleasure to use the provided hardware.</p>
<h2>Gameplay</h2>
<p>The game is all about gathering resources to build your city. Buildings earn you different kinds of points (such as science, war, commerce, and straigh victory points), so by building different types of structures you will earn either bonuses or points from them that you tally at the end of the game.</p>
<h4>Rules</h4>
<p>The quickrules that come with the game is a good reference, but it does a poor job of explaining the game. I&#8217;ll lay down the basics, then go into how a game actually plays.</p>
<ol>
<li>Each player gets a City Board, 7 cards, and 3 coins at start.</li>
<li>Players either put a card down in their board (a resource or structure), or burn the card for 3 coins.</li>
<li>Some cards cost something to play, be it resources or coins&#8211;either way, you have to be sure you have the required amount before playing them.</li>
<li>After ALL players decide what they&#8217;re going to do, <em>everyone</em> puts down the card they&#8217;re going to play <em>at the same time.</em></li>
<li>Repeat 2-4 until all 7 cards have been played, at which point the game progresses to the next stage. Also, it is at this point that military points are resolved.</li>
</ol>
<h4>Flow</h4>
<p>You start by randomly selecting a City Board&#8211;each one has a unique strength, so try to play to it to get the most Victory Points. After the cards are dealt, everyone decides what they&#8217;re going to do.</p>
<p><a href="http://www.rprod.com/images/7W_cartes_brunes.jpg" class="lightbox"><img class="alignnone" title="Resource cards" src="http://www.rprod.com/images/7W_cartes_brunes.jpg" alt="" /></a></p>
<p>For Resources, you simply place them at the top left of your City Board and they stay there for the duration of the game. Some cost coins to play, like the four of those above. Resources are critical to the game, as they are required to play most of the structures (and structures get you points). If you play 2 bricks (add it to your inventory), then you will be able to purchase structures that require 2 or less bricks. You need to have all of the required resources for a card at the time that you play it. When you &#8220;use&#8221; a resource it doesn&#8217;t move or anything, you just have to keep count. On your next turn, you can use any of your resources again to play the next card.</p>
<p>The rest is explained fairly well in the rulebook. You can focus on building resources so you can get any card you want, or you can buy resources from your neighbors using commerce bonuses that make purchasing resources cheaper. Note that players don&#8217;t have a choice as to whether you get the resource&#8211;you simply put the money on their City Board and you are granted the resource you&#8217;re paying for, for the current card/turn only.</p>
<p>For a game called 7 Wonders, the Wonders are surprisingly low key&#8211;you don&#8217;t need to build all three stages of your Wonder if you don&#8217;t want to (but you probably should, as they&#8217;re easy points). There are a lot of <a href="http://www.rprod.com/en/7WONDERS.html">different ways</a> to victory, and the Wonder only helps a little. Personally, I prefer stacking resources (get a lot of money from other players that way, which count as Victory Points at the end of the game) and military dominance.</p>
<h4>Conclusion</h4>
<p>What impressed me the most was how they got a game of this depth into play sessions of 30 minutes or less. You get a lot of choices for paths to victory, and you don&#8217;t even have to choose one&#8211;in fact you should probably choose two, like Science and Commerce, or Military and Victory Points. The designers tried to balance it, but it becomes clear that certain strategies are futile, like strict Science (which, in order to tally the points, requires a strange amount of math to figure out). Science yields a lot of points if you play it right (which is difficult because you need to horde certain cards)&#8230; but only if you don&#8217;t completely ignore the other aspects. </p>
<p>The biggest reason for the fast gameplay was the simultaneous turns, but in order to make that work, they made all trading obligatory (in that anyone who wants to buy something, gets it). I find haggling pretty annoying so I think this is a fine trade-off. Beyond that you have a solid city-building game that isn&#8217;t too cryptic (despite their best efforts with all the iconography) once you get familiar with it (a single full game will do). Highly recommended for a friendly group of 4 or 5, but part of the beauty is that the game scales extremely well, since the more players you have, the more cards you use (each card has a &#8220;minimum number of players&#8221; requirement at the very bottom).</p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=764&amp;md5=66366be57a268adefc9f58ee39f501e7" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2012/01/board-game-review-7-wonders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=vonWolfehaus&amp;url=http%3A%2F%2Fcoldconstructs.com%2F2012%2F01%2Fboard-game-review-7-wonders%2F&amp;language=sq_AL&amp;category=text&amp;title=Board+game+review%3A+7+Wonders&amp;description=Over+the+holidays+I+got+the+chance+to+play+a+bunch+of+cool+new+games+with+family+and+I+was+so+impressed+with+them+that+I+thought+I%27d+start+a+new+aspect+of+my+site+for+board+game+reviews.+My+secondary+goal+was+to+patch+the+web+where+information+on+these+games+was+sorely+missing.%0D%0A%0D%0A7+Wonders+is+a+card-based+game+about+resource+management+and+building+up+your+city+to+maximize+Victory+Point+collection+by+picking+an+optimal+strategy+from+among+a+variety+of+point+types.%0D%0AGame+overview%0D%0A%5Bchecklist%5D%0D%0A%0D%0A%09Fast+yet+deep+gameplay%0D%0A%09Variety+of+play+styles+to+choose+from%0D%0A%09Flexible+number+of+players+%283-7+with+special+rules+for+2%29%0D%0A%0D%0A%5B%2Fchecklist%5D%0D%0A%0D%0A%5Bbadlist%5D%0D%0A%0D%0A%09Steep+learning+curve%0D%0A%09Poor+instructions%0D%0A%0D%0A%5B%2Fbadlist%5D%0D%0A%0D%0AThe+basic+flow+of+the+game+appears+rather+complex+and%C2%A0unfortunately%C2%A0we+couldn%27t+play+the+first+two+times+we+tried+because+1%29+we+couldn%27t+figure+it+out+and+2%29+we+kept+disagreeing+over+the+interpretation+of+the+rules.+After+a+couple+of+us+sat+down--away+from+the+party--to+grok+the+damn+rules%2C+we+were+able+to+grasp+the+concepts+and+play+an+actual+game...+after+about+half+of+the+family+already+left.+Basically%2C+the+instructions+are+poorly+written+and+do+not+provide+a+good+sense+of+how+the+game+should+flow.+Example+scenarios+would+have+been+great.+The+most+lacking+aspect+was+how+to+handle+resources%2C+which+is+the%C2%A0fundamental%C2%A0aspect+of+the+game.+So+how+they+managed+to+screw+that+up%2C+I+have+no+idea.%0D%0A%0D%0A%0D%0A%0D%0AAs+you+can+see%2C+there%27s+a+lot+of+stuff--but+don%27t+fret%2C+once+we+figured+it+out%2C+it%27s+a+really+fast+game+with+a+lot+of+options+for+playing+different+ways.%0D%0A%0D%0AThere+are+7+types+of+wonders+for+players+to+choose+from+%28surprise%21%29%2C+although+the+game+calls+for+players+to+shuffle+the+wonder+cards+%28seen+above%2C+under+the+boards%29+and+choose+randomly.+We+liked+choosing+our+wonders+and+it+worked+out+well+for+us%2C+so+whatever+floats+your+boat.+Each+wonder+has+a+number+of+advantages+that+can+be+%22unlocked%22+by+building+your+wonder+in+stages.+For+the+A+side+%28the+%22easy%22+side%29%2C+it%27s+always+three.%0D%0A%0D%0ABesides+building+up+your+wonder+%28which+is+optional%29%2C+you+can+build+structures+by+laying+down+the+card+for+it+and+paying+the+cost+%28usually+regular+resources%2C+sometimes+it%27s+gold%29.+Structures+get+you+all+sorts+of+different+things+like+additional+resources%2C+straight+Victory+Points%2C+discounts+on+trading+with+certain+neighbors%2C+military+advantage%2C+and+so+on.%0D%0A%0D%0AWhat%27s+interesting+about+this+game+is+that+all+players+choose+one+card+from+their+hand%2C+set+it+down+on+the+table+face-down%2C+then+reveal+their+choice+when+everyone+has+their+picked%C2%A0simultaneously.+After+you+resolve+the+card+%28pay+for+it+by+buying+resources+from+your+neighbors+is+typical%29%2C+you+give+your+hand+to+the+player+next+to+you.+So+through+the+whole+game+your+swapping+hands+with+the+other+players%2C+which+is+an+interesting+strategic+mechanic--knowing+what+the+other+players+have+and+having+the+option+to+deny+them+what+they+probably+want+by+using+that+card+is+certainly+a+fun+twist.%0D%0A%0D%0AYou+swap+hands+with+your+neighbors+until+all+the+cards+are+gone+%28you+start+with+7+for+each+player%29.+After+the+cards+are+gone%2C+you+progress+an+Age--and+there+are+three+Ages.+So+the+whole+game+is+over+in+21+turns%21+If+you+know+the+rules%2C+you+can+finish+a+game+in+under+30+minutes.%0D%0A%0D%0APresentation%0D%0AThe+cards+look+and+feel+great--the+art+is+an+interesting%2C+painterly+style+while+the+material+they%27re+made+of+is+a+pretty+standard+glossy+finish.+The+%22City+Boards%22+are+thick%2C+polished+cardboard+with+some+cryptic+but+pretty+icons+all+over+them+%28same+with+cards%29.%0D%0A%0D%0AThankfully%2C+they+didn%27t+rely+too+much+on+color+to+distinguish+between+important+gameplay+artifacts%2C+although+it+is+an+obvious+identification+device+used.+Unfortunately%2C+they+used%C2%A0cryptic%C2%A0symbols+everywhere%2C+even+in+places+that+should+%28could%29+have+been+text+instead+%28and+would+have+made+it+easier+to+understand+in+the+process%29.+Once+we+got+used+to+the+game+though%2C+it+wasn%27t+too+hard+to+navigate+the+board+at+a+glance.+However+there+were+some+resource+symbols+that+looked+too+similar%2C+but+it+didn%27t+distract+me+too+much.%0D%0A%0D%0AOverall+it+was+polished+and+a+pleasure+to+use+the+provided+hardware.%0D%0AGameplay%0D%0AThe+game+is+all+about+gathering+resources+to+build+your+city.+Buildings+earn+you+different+kinds+of+points+%28such+as+science%2C+war%2C+commerce%2C+and+straigh+victory+points%29%2C+so+by+building+different+types+of+structures+you+will+earn+either+bonuses+or+points+from+them+that+you+tally+at+the+end+of+the+game.%0D%0ARules%0D%0AThe+quickrules+that+come+with+the+game+is+a+good+reference%2C+but+it+does+a+poor+job+of+explaining+the+game.+I%27ll+lay+down+the+basics%2C+then+go+into+how+a+game+actually+plays.%0D%0A%0D%0A%09Each+player+gets+a+City+Board%2C+7+cards%2C+and+3+coins+at+start.%0D%0A%09Players+either+put+a+card+down+in+their+board+%28a+resource+or+structure%29%2C+or+burn+the+card+for+3+coins.%0D%0A%09Some+cards+cost+something+to+play%2C+be+it+resources+or+coins--either+way%2C+you+have+to+be+sure+you+have+the+required+amount+before+playing+them.%0D%0A%09After+ALL+players+decide+what+they%27re+going+to+do%2C+everyone+puts+down+the+card+they%27re+going+to+play+at+the+same+time.%0D%0A%09Repeat+2-4+until+all+7+cards+have+been+played%2C+at+which+point+the+game+progresses+to+the+next+stage.+Also%2C+it+is+at+this+point+that+military+points+are+resolved.%0D%0A%0D%0AFlow%0D%0AYou+start+by+randomly+selecting+a+City+Board--each+one+has+a+unique+strength%2C+so+try+to+play+to+it+to+get+the+most+Victory+Points.+After+the+cards+are+dealt%2C+everyone+decides+what+they%27re+going+to+do.%0D%0A%0D%0A%0D%0A%0D%0AFor+Resources%2C+you+simply+place+them+at+the+top+left+of+your+City+Board+and+they+stay+there+for+the+duration+of+the+game.+Some+cost+coins+to+play%2C+like+the+four+of+those+above.+Resources+are+critical+to+the+game%2C+as+they+are+required+to+play+most+of+the+structures+%28and+structures+get+you+points%29.+If+you+play+2+bricks+%28add+it+to+your+inventory%29%2C+then+you+will+be+able+to+purchase+structures+that+require+2+or+less+bricks.+You+need+to+have+all+of+the+required+resources+for+a+card+at+the+time+that+you+play+it.+When+you+%22use%22+a+resource+it+doesn%27t+move+or+anything%2C+you+just+have+to+keep+count.+On+your+next+turn%2C+you+can+use+any+of+your+resources+again+to+play+the+next+card.%0D%0A%0D%0AThe+rest+is+explained+fairly+well+in+the+rulebook.+You+can+focus+on+building+resources+so+you+can+get+any+card+you+want%2C+or+you+can+buy+resources+from+your+neighbors+using+commerce+bonuses+that+make+purchasing+resources+cheaper.+Note+that+players+don%27t+have+a+choice+as+to+whether+you+get+the+resource--you+simply+put+the+money+on+their+City+Board+and+you+are+granted+the+resource+you%27re+paying+for%2C+for+the+current+card%2Fturn+only.%0D%0A%0D%0AFor+a+game+called+7+Wonders%2C+the+Wonders+are+surprisingly+low+key--you+don%27t+need+to+build+all+three+stages+of+your+Wonder+if+you+don%27t+want+to+%28but+you+probably+should%2C+as+they%27re+easy+points%29.+There+are+a+lot+of+different+ways+to+victory%2C+and+the+Wonder+only+helps+a+little.+Personally%2C+I+prefer+stacking+resources+%28get+a+lot+of+money+from+other+players+that+way%2C+which+count+as+Victory+Points+at+the+end+of+the+game%29+and+military+dominance.%0D%0AConclusion%0D%0AWhat+impressed+me+the+most+was+how+they+got+a+game+of+this+depth+into+play+sessions+of+30+minutes+or+less.+You+get+a+lot+of+choices+for+paths+to+victory%2C+and+you+don%27t+even+have+to+choose+one--in+fact+you+should+probably+choose+two%2C+like+Science+and+Commerce%2C+or+Military+and+Victory+Points.+The+designers+tried+to+balance+it%2C+but+it+becomes+clear+that+certain+strategies+are+futile%2C+like+strict+Science+%28which%2C+in+order+to+tally+the+points%2C+requires+a+strange+amount+of+math+to+figure+out%29.+Science+yields+a+lot+of+points+if+you+play+it+right+%28which+is+difficult+because+you+need+to+horde+certain+cards%29...+but+only+if+you+don%27t+completely+ignore+the+other+aspects.+%0D%0A%0D%0AThe+biggest+reason+for+the+fast+gameplay+was+the+simultaneous+turns%2C+but+in+order+to+make+that+work%2C+they+made+all+trading+obligatory+%28in+that+anyone+who+wants+to+buy+something%2C+gets+it%29.+I+find+haggling+pretty+annoying+so+I+think+this+is+a+fine+trade-off.+Beyond+that+you+have+a+solid+city-building+game+that+isn%27t+too+cryptic+%28despite+their+best+efforts+with+all+the+iconography%29+once+you+get+familiar+with+it+%28a+single+full+game+will+do%29.+Highly+recommended+for+a+friendly+group+of+4+or+5%2C+but+part+of+the+beauty+is+that+the+game+scales+extremely+well%2C+since+the+more+players+you+have%2C+the+more+cards+you+use+%28each+card+has+a+%22minimum+number+of+players%22+requirement+at+the+very+bottom%29.&amp;tags=Board+games%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Where personal computing is going</title>
		<link>http://coldconstructs.com/2011/08/where-personal-computing-is-going/</link>
		<comments>http://coldconstructs.com/2011/08/where-personal-computing-is-going/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 22:54:57 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Discussions]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[augrecon]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=598</guid>
		<description><![CDATA[Computers have been evolving quickly, yet many people don't think they're getting much easier. I have an idea how we will develop the computing system that will be even more powerful than today's computers, yet so much simpler to use. We're heading towards augmented reality.]]></description>
			<content:encoded><![CDATA[<p>For the longest time, people around the world have been trying to build better software interfaces to make computers stop sucking, from touch screens to voice control to motion sensors and various forms of haptic feedback. On the backend of things we have the mass exodus to <abbr title="giant server farms that host web-based apps and user data">the cloud</abbr>, granting the average user redundant backups, realtime collaboration/communication, and less hassle by managing the mundane for them. We see that more and more people are taking their work and play with them on netbooks and smartphones, but those devices still can&#8217;t do what desktops can.</p>
<p>So how do we get the power of a desktop system into our mobile systems? <strong>Streaming.</strong> All we need is a screen and a fast connection (4G is probably the tipping point) to bring the computing power and storage capacity of servers into our hands, wherever we are. But streaming isn&#8217;t enough&#8211;we still need the interactive capacity of a full keyboard and mouse, along with the screenspace of multiple monitors in order to fully realize the power of computing in portable gadgets. What kind of device can make all of this mobile?</p>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/augrecon_vuzix_raptor.jpg" width="200px" class="alignright"/>Enter <strong>augmented reality</strong>. With a new kind of head-mounted display that&#8217;s essentially special eyewear with built-in microcameras and projectors or transparent LED screens, we can turn our entire field of vision into a fully interactive computing environment. (<a href="http://www.techtree.com/India/News/Vuzix_STAR_1200_Promises_Augmented_Reality/551-115347-615.html">Here&#8217;s some promising tech</a> in that arena&#8211;pictured right.) We will be able to take reality and enhance it with digital information pulled from the servers that are processing our input in realtime. And because this augmented environment is completely digital, we can interact with it in any way imaginable. We could use hand gestures (think <a href="http://www.xbox.com/en-US/kinect">Kinect</a>, but from the first person perspective), voice recognition, virtual keyboards and other buttons either &#8220;floating&#8221; or projected onto any surface, and completely new ways we have yet to think of.</p>
<p>The possibilities are endless because we don&#8217;t need to manufacture new hardware&#8211;it&#8217;s all in the software. It would be a lot like the Iron Man interface, except everything will only be displayed through our glasses so no one else can see what we&#8217;re doing&#8211;unless we want them to. Check it out:</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/-hFjzKEobOc?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>We can bring all the benefits of digital collaboration together with the benefits of physical collaboration with <strong>shared virtual spaces</strong>. We could choose which information others see and what they can&#8217;t. Using advanced image recognition software we can get rid of clunky special objects (like <a href="http://www.artag.net/">AR markers/tags</a>) and place virtual reality over real objects. There&#8217;s been <a href="http://www.hvrl.ics.keio.ac.jp/~julien/polyora/index.php">a lot</a> of progress in this area and <a href="http://info.ee.surrey.ac.uk/Personal/Z.Kalal/">huge steps</a> are being made every year. Indeed, we may see the augrecon sooner than you may expect:</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/qrDgFjBSVuE?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>So this is the essence of the <strong>Augmented Reality Controller</strong> concept, or <em>augrecon </em>for short. I will be detailing this idea further, providing others with ideas for how, exactly, we can build this with today&#8217;s technology. The augrecon is a disruptive technology on the scale of the internet itself, ie a MASSIVE shift in direction. It&#8217;s going to be interesting.</p>
<p><strong>Update 2/22/2012:</strong> I&#8217;ve been thinking about this concept for almost a decade now, and I honestly thought it would take at least 5 more years to really see it come through. It seems it&#8217;ll be here much sooner. As in, <em>this year</em>. Apparently, <a href="http://www.smartplanet.com/blog/science-scope/by-years-end-google-glasses-to-stream-info-to-eyeballs/12190?tag=nl.e660">Google will be the first</a> to deploy it&#8217;s Android-based glasses. What&#8217;s really interesting is that <a href="http://penny-arcade.com/report/editorial-article/valves-gabe-newell-talks-wearable-computers-rewarding-players-and-whether-w/all">game developers like Valve</a> and <a href="https://twitter.com/#!/ID_AA_Carmack/status/172391595637870594">id Software</a> are already creating content for these devices, which only makes sense considering games are a primary driver of platform adoption. The specific server-to-HUD design I outlined in this article is fast approaching as well I think, but not as quickly as the HUD itself.</p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=598&amp;md5=f6b10537257e42d28b5cd06b3ca55997" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2011/08/where-personal-computing-is-going/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=vonWolfehaus&amp;url=http%3A%2F%2Fcoldconstructs.com%2F2011%2F08%2Fwhere-personal-computing-is-going%2F&amp;language=en_GB&amp;category=text&amp;title=Where+personal+computing+is+going&amp;description=For+the+longest+time%2C+people+around+the+world+have+been+trying+to+build+better+software+interfaces+to+make+computers+stop+sucking%2C+from+touch+screens+to+voice+control+to+motion+sensors+and+various+forms+of+haptic+feedback.+On+the+backend+of+things+we+have+the+mass+exodus+to+the+cloud%2C+granting+the+average+user+redundant+backups%2C+realtime+collaboration%2Fcommunication%2C+and+less+hassle+by+managing+the+mundane+for+them.+We+see+that+more+and+more+people+are+taking+their+work+and+play+with+them+on+netbooks+and+smartphones%2C+but+those+devices+still+can%27t+do+what+desktops+can.%0D%0A%0D%0ASo+how+do+we+get+the+power+of+a+desktop+system+into+our+mobile+systems%3F+Streaming.+All+we+need+is+a+screen+and+a+fast+connection+%284G+is+probably+the+tipping+point%29+to+bring+the+computing+power+and+storage+capacity+of+servers+into+our+hands%2C+wherever+we+are.+But+streaming+isn%27t+enough--we+still+need+the+interactive+capacity+of+a+full+keyboard+and+mouse%2C+along+with+the+screenspace+of+multiple+monitors+in+order+to+fully+realize+the+power+of+computing+in+portable+gadgets.+What+kind+of+device+can+make+all+of+this+mobile%3F%0D%0A%0D%0AEnter+augmented+reality.+With+a+new+kind+of+head-mounted+display+that%27s+essentially+special+eyewear+with+built-in+microcameras+and+projectors+or+transparent+LED+screens%2C+we+can+turn+our+entire+field+of+vision+into+a+fully+interactive+computing+environment.+%28Here%27s+some+promising+tech+in+that+arena--pictured+right.%29+We+will+be+able+to+take+reality+and+enhance+it+with+digital+information+pulled+from+the+servers+that+are+processing+our+input+in+realtime.+And+because+this+augmented+environment+is+completely+digital%2C+we+can+interact+with+it+in+any+way+imaginable.+We+could+use+hand+gestures+%28think+Kinect%2C+but+from+the+first+person+perspective%29%2C+voice+recognition%2C+virtual+keyboards+and+other+buttons+either+%22floating%22+or+projected+onto+any+surface%2C+and+completely+new+ways+we+have+yet+to+think+of.%0D%0A%0D%0AThe+possibilities+are+endless+because+we+don%27t+need+to+manufacture+new+hardware--it%27s+all+in+the+software.+It+would+be+a+lot+like+the+Iron+Man+interface%2C+except+everything+will+only+be+displayed+through+our+glasses+so+no+one+else+can+see+what+we%27re+doing--unless+we+want+them+to.+Check+it+out%3A%0D%0A%0D%0A%5Bembed+width%3D%22560%22+height%3D%22349%22%5Dhttp%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-hFjzKEobOc%5B%2Fembed%5D%0D%0A%0D%0AWe+can+bring+all+the+benefits+of+digital+collaboration+together+with+the+benefits+of+physical+collaboration+with+shared+virtual+spaces.+We+could+choose+which+information+others+see+and+what+they+can%27t.+Using+advanced+image+recognition+software+we+can+get+rid+of+clunky+special+objects+%28like+AR+markers%2Ftags%29+and+place+virtual+reality+over+real+objects.+There%27s+been+a+lot+of+progress+in+this+area+and+huge+steps+are+being+made+every+year.+Indeed%2C+we+may+see+the+augrecon+sooner+than+you+may+expect%3A%0D%0A%0D%0A%5Bembed+width%3D%22560%22+height%3D%22349%22%5Dhttp%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqrDgFjBSVuE%5B%2Fembed%5D%0D%0A%0D%0ASo+this+is+the+essence+of+the+Augmented+Reality+Controller+concept%2C+or+augrecon+for+short.+I+will+be+detailing+this+idea+further%2C+providing+others+with+ideas+for+how%2C+exactly%2C+we+can+build+this+with+today%27s+technology.+The+augrecon+is+a+disruptive+technology+on+the+scale+of+the+internet+itself%2C+ie+a+MASSIVE+shift+in+direction.+It%27s+going+to+be+interesting.%0D%0A%0D%0AUpdate+2%2F22%2F2012%3A+I%27ve+been+thinking+about+this+concept+for+almost+a+decade+now%2C+and+I+honestly+thought+it+would+take+at+least+5+more+years+to+really+see+it+come+through.+It+seems+it%27ll+be+here+much+sooner.+As+in%2C+this+year.+Apparently%2C+Google+will+be+the+first+to+deploy+it%27s+Android-based+glasses.+What%27s+really+interesting+is+that+game+developers+like+Valve+and+id+Software+are+already+creating+content+for+these+devices%2C+which+only+makes+sense+considering+games+are+a+primary+driver+of+platform+adoption.+The+specific+server-to-HUD+design+I+outlined+in+this+article+is+fast+approaching+as+well+I+think%2C+but+not+as+quickly+as+the+HUD+itself.&amp;tags=augmented+reality%2Caugrecon%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Memory management in Flixel</title>
		<link>http://coldconstructs.com/2011/03/memory-management-in-flixel/</link>
		<comments>http://coldconstructs.com/2011/03/memory-management-in-flixel/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 22:37:13 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flixel]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=553</guid>
		<description><![CDATA[I was helping a fellow out in the Flixel forums with memory management before I realized this issue is serious enough to warrant a proper blogging. I hope Adam Atomic (creator of Flixel) will take note and include these fixes in the main branch (I posted a new issue on Flixel&#8217;s github). This information is... <a href="http://coldconstructs.com/2011/03/memory-management-in-flixel/">Read More &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I was <a href="http://flixel.org/forums/index.php?topic=3213.0">helping a fellow out</a> in the <a href="http://flixel.org/">Flixel</a> forums with memory management before I realized this issue is serious enough to warrant a proper blogging. I hope Adam Atomic (creator of Flixel) will take note and include these fixes in the main branch (I posted <a href="https://github.com/AdamAtomic/flixel/issues/122">a new issue on Flixel&#8217;s github</a>). This information is also for other Flixel programmers who are deeply familiar with the framework and not afraid to get intimate with it.</p>
<p>The problem with Flixel&#8217;s memory management system is that <strong>it doesn&#8217;t exist.</strong> However, every time you switch states, it <em>does </em>call <code>destroy()</code> on almost every object. The problem is that most of the <code>destroy()</code> functions are <em>completely empty</em>. Obviously, this is not enough.</p>
<p>UPDATE: I got onto github and <a href="https://github.com/vonWolfehaus/flixel">forked flixel</a>, wrote a patch, and did a <a href="https://github.com/AdamAtomic/flixel/pull/124">pull request</a>. I can&#8217;t solve the biggest problem though, which is that FlxQuadTree is being completely recreated on every frame. This is extremely terrible practice and causing the Flash GC to bust ass. I don&#8217;t use FlxQuadTree and I recommend building a persistent static grid to handle collisions instead (MUCH simpler and faster than quadtrees anyway). I&#8217;m pretty sure the quadtree is causing a huge performance hit alongside the memory thrashing, since my games don&#8217;t experience what I see in vanilla Flixel. Good luck!</p>
<p><span id="more-553"></span></p>
<p>You will need to go through every class yourself and override (or fill in) the <code>destroy()</code> method to nullify any significant variable in the class itself. Remember to call <code>super.destroy()</code> so that it chains through all super-classes too. Here&#8217;s what the <code>FlxObject.destroy()</code> should look <em>something</em> like:</p>
<p><code class="block">public function destroy():void {<br />
&nbsp;&nbsp;velocity = acceleration = drag = maxVelocity = null;<br />
&nbsp;&nbsp;origin = scrollFactor = null;<br />
&nbsp;&nbsp;_point = null;<br />
&nbsp;&nbsp;_rect = null;<br />
&nbsp;&nbsp;_flashPoint = null;<br />
&nbsp;&nbsp;colHullX = colHullY = colVector = colOffsets = null;<br />
}</code></p>
<p>Don&#8217;t actually use the code in this post&#8211;none of it compiles without errors, it&#8217;s merely an example (I will be submitting a tested patch for this whole thing to the trunk soon). Also, I&#8217;m using the latest build I got from the Flixel homepage&#8211;v2.43.</p>
<p>What I&#8217;m showing here is pretty straightforward. It just nullifies all object variables so the Flash GC will pick it up. We do the same thing in <code>FlxSprite.destroy()</code>, but we&#8217;re going to have to add the function ourselves because for some reason it doesn&#8217;t exist. So put this function at the end of <code>FlxSprite</code>:</p>
<p><code class="block"><br />
override public function destroy():void {<br />
&nbsp;&nbsp;super.destroy();<br />
&nbsp;&nbsp;offset = scale = null;<br />
&nbsp;&nbsp;_curAnim = null;<br />
&nbsp;&nbsp;_callback = null;<br />
&nbsp;&nbsp;_flashRect = _flashRect2 = null;<br />
&nbsp;&nbsp;_flashPointZero = null;<br />
&nbsp;&nbsp;//_pixels.dispose(); // only do this if you don't use FlxG.addBitmap()<br />
&nbsp;&nbsp;//_pixels = null;<br />
&nbsp;&nbsp;_framePixels.dispose();<br />
&nbsp;&nbsp;_bbb.dispose();<br />
&nbsp;&nbsp;_framePixels = _bbb = null;<br />
&nbsp;&nbsp;_ct = null;<br />
&nbsp;&nbsp;_mtx = null;<br />
&nbsp;&nbsp;for (var i:int = 0; i < _animations.length; ++i) _animations[i] = null;<br />
&nbsp;&nbsp;_animations.length = 0;<br />
&nbsp;&nbsp;_animations = null;<br />
}</code></p>
<p>So those are the first classes to hit. But there are dozens more. Other ones you should get to include (but not limited to) <code>FlxQuadTree, FlxGroup, FlxButton, FlxEmitter, and FlxTilemap</code>. There are a bunch more in <code>flixel.data</code> that you need to do too, in addition to adding destroy code to <code>FlxGame</code> itself.</p>
<h3>FlxG._cache and what it does</h3>
<p>An important thing to note is <code>FlxG._cache</code>. Whenever you create a new sprite, it stores the bitmapData in that Object. Adam&#8217;s reasoning for this was so that only one instance of the BitmapData object remains in memory, so new sprites just reference that one instead of creating new instances. I think this is a pretty solid idea, but I&#8217;m not sure how much it actually helps. If anyone has tested this, please post your results in the comments.</p>
<p>Anyway, if you loop through it like I did with <code>FlxSprite._animations</code> though, you will get a ton of null reference errors because you already nullified most of it by disposing of <code>_framePixels</code> in <code>FlxSprite</code>. I recommend adding a new destroy function to FlxG itself and going through <code>_cache</code> and running dispose on each object regardless (IF it&#8217;s BitmapData AND not already null)&#8230; just to be sure. Don&#8217;t forget to null the <code>_cache </code>Object itself.</p>
<h3>Cleaning up your own mess</h3>
<p><strong>It is very important to override <code>destroy()</code> in ALL of your custom classes to nullify any new variables you added in them.</strong> In every class you create, add a <code>destroy()</code> override that also calls <code>super.destroy()</code> in order to ensure that the GC picks up everything. <em>Don&#8217;t forget to remove any event listeners as well!</em></p>
<p>So that&#8217;s the memory problem in Flixel and how to fix it. Please retweet this post and share it with others. I think this is an important issue that needs to address in a future version of Flixel, as others are always finding out about it and posting their troubles in the forums. Let&#8217;s do our part to keep Flash from crashing everyone&#8217;s browser <img src='http://coldconstructs.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Thanks!</p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=553&amp;md5=31ed203c754feda80712f0137caaf596" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2011/03/memory-management-in-flixel/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=vonWolfehaus&amp;url=http%3A%2F%2Fcoldconstructs.com%2F2011%2F03%2Fmemory-management-in-flixel%2F&amp;language=en_GB&amp;category=text&amp;title=Memory+management+in+Flixel&amp;description=I+was+helping+a+fellow+out+in+the+Flixel+forums+with+memory+management+before+I+realized+this+issue+is+serious+enough+to+warrant+a+proper+blogging.+I+hope+Adam+Atomic+%28creator+of+Flixel%29+will+take+note+and+include+these+fixes+in+the+main+branch+%28I+posted+a+new+issue+on+Flixel%27s+github%29.+This+information+is+also+for+other+Flixel+programmers+who+are+deeply+familiar+with+the+framework+and+not+afraid+to+get+intimate+with+it.%0D%0A%0D%0AThe+problem+with+Flixel%27s+memory+management+system+is+that+it+doesn%27t+exist.+However%2C+every+time+you+switch+states%2C+it+does+call+destroy%28%29+on+almost+every+object.+The+problem+is+that+most+of+the+destroy%28%29+functions+are+completely+empty.+Obviously%2C+this+is+not+enough.%0D%0A%0D%0AUPDATE%3A+I+got+onto+github+and+forked+flixel%2C+wrote+a+patch%2C+and+did+a+pull+request.+I+can%27t+solve+the+biggest+problem+though%2C+which+is+that+FlxQuadTree+is+being+completely+recreated+on+every+frame.+This+is+extremely+terrible+practice+and+causing+the+Flash+GC+to+bust+ass.+I+don%27t+use+FlxQuadTree+and+I+recommend+building+a+persistent+static+grid+to+handle+collisions+instead+%28MUCH+simpler+and+faster+than+quadtrees+anyway%29.+I%27m+pretty+sure+the+quadtree+is+causing+a+huge+performance+hit+alongside+the+memory+thrashing%2C+since+my+games+don%27t+experience+what+I+see+in+vanilla+Flixel.+Good+luck%21%0D%0A%0D%0A%0D%0A%0D%0AYou+will+need+to+go+through+every+class+yourself+and+override+%28or+fill+in%29+the+destroy%28%29+method+to+nullify+any+significant+variable+in+the+class+itself.+Remember+to+call+super.destroy%28%29+so+that+it+chains+through+all+super-classes+too.+Here%27s+what+the+FlxObject.destroy%28%29+should+look+something+like%3A%0D%0A%0D%0Apublic+function+destroy%28%29%3Avoid+%7B%0D%0A%26nbsp%3B%26nbsp%3Bvelocity+%3D+acceleration+%3D+drag+%3D+maxVelocity+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3Borigin+%3D+scrollFactor+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_point+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_rect+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_flashPoint+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3BcolHullX+%3D+colHullY+%3D+colVector+%3D+colOffsets+%3D+null%3B%0D%0A%7D%0D%0A%0D%0ADon%27t+actually+use+the+code+in+this+post--none+of+it+compiles+without+errors%2C+it%27s+merely+an+example+%28I+will+be+submitting+a+tested+patch+for+this+whole+thing+to+the+trunk+soon%29.+Also%2C+I%27m+using+the+latest+build+I+got+from+the+Flixel+homepage--v2.43.%0D%0A%0D%0AWhat+I%27m+showing+here+is+pretty+straightforward.+It+just+nullifies+all+object+variables+so+the+Flash+GC+will+pick+it+up.+We+do+the+same+thing+in+FlxSprite.destroy%28%29%2C+but+we%27re+going+to+have+to+add+the+function+ourselves+because+for+some+reason+it+doesn%27t+exist.+So+put+this+function+at+the+end+of+FlxSprite%3A%0D%0A%0D%0A%0D%0Aoverride+public+function+destroy%28%29%3Avoid+%7B%0D%0A%26nbsp%3B%26nbsp%3Bsuper.destroy%28%29%3B%0D%0A%26nbsp%3B%26nbsp%3Boffset+%3D+scale+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_curAnim+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_callback+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_flashRect+%3D+_flashRect2+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_flashPointZero+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B%2F%2F_pixels.dispose%28%29%3B+%2F%2F+only+do+this+if+you+don%27t+use+FlxG.addBitmap%28%29%0D%0A%26nbsp%3B%26nbsp%3B%2F%2F_pixels+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_framePixels.dispose%28%29%3B%0D%0A%26nbsp%3B%26nbsp%3B_bbb.dispose%28%29%3B%0D%0A%26nbsp%3B%26nbsp%3B_framePixels+%3D+_bbb+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_ct+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_mtx+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3Bfor+%28var+i%3Aint+%3D+0%3B+i+%3C+_animations.length%3B+%2B%2Bi%29+_animations%5Bi%5D+%3D+null%3B%0D%0A%26nbsp%3B%26nbsp%3B_animations.length+%3D+0%3B%0D%0A%26nbsp%3B%26nbsp%3B_animations+%3D+null%3B%0D%0A%7D%0D%0A%0D%0ASo+those+are+the+first+classes+to+hit.+But+there+are+dozens+more.+Other+ones+you+should+get+to+include+%28but+not+limited+to%29+FlxQuadTree%2C+FlxGroup%2C+FlxButton%2C+FlxEmitter%2C+and+FlxTilemap.+There+are+a+bunch+more+in+flixel.data+that+you+need+to+do+too%2C+in+addition+to+adding+destroy+code+to+FlxGame+itself.%0D%0A%0D%0AFlxG._cache+and+what+it+does%0D%0AAn+important+thing+to+note+is+FlxG._cache.+Whenever+you+create+a+new+sprite%2C+it+stores+the+bitmapData+in+that+Object.+Adam%27s+reasoning+for+this+was+so+that+only+one+instance+of+the+BitmapData+object+remains+in+memory%2C+so+new+sprites+just+reference+that+one+instead+of+creating+new+instances.+I+think+this+is+a+pretty+solid+idea%2C+but+I%27m+not+sure+how+much+it+actually+helps.+If+anyone+has+tested+this%2C+please+post+your+results+in+the+comments.%0D%0A%0D%0AAnyway%2C+if+you+loop+through+it+like+I+did+with+FlxSprite._animations+though%2C+you+will+get+a+ton+of+null+reference+errors+because+you+already+nullified+most+of+it+by+disposing+of+_framePixels+in+FlxSprite.+I+recommend+adding+a+new+destroy+function+to+FlxG+itself+and+going+through+_cache+and+running+dispose+on+each+object+regardless+%28IF+it%27s+BitmapData+AND+not+already+null%29...+just+to+be+sure.+Don%27t+forget+to+null+the+_cache+Object+itself.%0D%0A%0D%0ACleaning+up+your+own+mess%0D%0AIt+is+very+important+to+override+destroy%28%29+in+ALL+of+your+custom+classes+to+nullify+any+new+variables+you+added+in+them.+In+every+class+you+create%2C+add+a+destroy%28%29+override+that+also+calls+super.destroy%28%29+in+order+to+ensure+that+the+GC+picks+up+everything.+Don%27t+forget+to+remove+any+event+listeners+as+well%21%0D%0A%0D%0ASo+that%27s+the+memory+problem+in+Flixel+and+how+to+fix+it.+Please+retweet+this+post+and+share+it+with+others.+I+think+this+is+an+important+issue+that+needs+to+address+in+a+future+version+of+Flixel%2C+as+others+are+always+finding+out+about+it+and+posting+their+troubles+in+the+forums.+Let%27s+do+our+part+to+keep+Flash+from+crashing+everyone%27s+browser+%3B%29+Thanks%21&amp;tags=ActionScript+3%2CFlixel%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Why SWF protection matters; Review of the current options</title>
		<link>http://coldconstructs.com/2010/07/swf-protection/</link>
		<comments>http://coldconstructs.com/2010/07/swf-protection/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 10:00:38 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Discussions]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[content protection]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=468</guid>
		<description><![CDATA[The one (and only) counter-argument I&#8217;ve heard against SWF protection goes something like this: It doesn&#8217;t matter what you do, thieves will always be able to steal your work, so don&#8217;t bother with SWF protection. This is a textbook example of the &#8220;perfect solution&#8221; fallacy. Thieves will always be able to crack safes, so why... <a href="http://coldconstructs.com/2010/07/swf-protection/">Read More &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><!--TOC-->The one (and only) counter-argument I&#8217;ve heard against SWF protection goes something like this:</p>
<blockquote><p>It doesn&#8217;t matter what you do, thieves will <em>always </em>be able to steal your work, so don&#8217;t bother with SWF protection.</p></blockquote>
<p>This is a textbook example of the <a href="http://en.wikipedia.org/wiki/Perfect_solution_fallacy">&#8220;perfect solution&#8221; fallacy</a>. Thieves will always be able to crack safes, so why bother storing your money and valuables in them? And of course encryption can always be cracked, so why bother using it when transferring valuable information? <em>Why not just release all your work and hard-earned assets out to the wild for anyone to plunder, since apparently it will be plundered regardless of whatever you do to protect it?</em></p>
<h4>Why try?</h4>
<p>Obviously we use safes and encryption <em>&#038;c</em> to minimize the chances of bad things happening to our precious stuff. It&#8217;s just the same for people like me who make money with SWF files&#8211;I don&#8217;t want anyone stealing my Intellectual Property and posting it elsewhere, claiming it as their own, so I do everything I can to make the process of stealing my SWF files as difficult as possible.<strong> The more difficult a thing is to steal, the less chance there is of it being stolen&#8211;and less often.</strong></p>
<p><span id="more-468"></span><br />
<h4>The tools</h4>
<p>Right now there are several tools, some even free, that allow you to decompile a SWF file to take a look at everything it contains. This is usually pretty easy because the SWF format is an <a href="http://www.adobe.com/devnet/swf/">open specification</a>. This means there&#8217;s no way to fully protect anything contained in the file, such as code, graphics, sounds, or videos. However, there are applications that take precautions against decompiling using a variety of methods. </p>
<h5>Protectors</h5>
<p>I&#8217;ll review the biggest names in that market today:</p>
<ul>
<li>Amayeta <a href="http://www.amayeta.com/software/swfencrypt/">SWF Encrypt</a> 6.0.8</li>
<li>DComSoft <a href="http://www.dcomsoft.com/">SWF Protector</a> 3.0.1 (on <a href="http://twitter.com/SWF_Protector">twitter</a>)</li>
<li>Kindisoft <a href="http://www.kindisoft.com/">secureSWF</a> 3.5 (on <a href="http://twitter.com/secureswf/">twitter</a>)</li>
<li>Ambiera <a href="http://www.ambiera.com/irrfuscator/index.html">irrFuscator</a> 2.1.2 (on <a href="http://twitter.com/ambiera">twitter</a>)</li>
</ul>
<h5>Decompilers</h5>
<p>I&#8217;ll be using a combination of <a href="http://www.swfdecrypt.com/">SWF Decrypt 1.2</a> and Eltima&#8217;s Decompiler v4.1 to test the effectiveness of these applications. (Side note: Eltima&#8217;s Decompiler and Sothink&#8217;s are <em>freakishly</em> similar.) SWF Decrypt really upset the industry when Magus (the author who wishes to remain anonymous) released it completely for free. It apparently decompiles any SWF file &#8220;protected&#8221; by Amayeta&#8217;s and DComSoft&#8217;s applications. He&#8217;s very loud about it too, calling them out on their &#8220;tricks&#8221;, such as <a href="http://blog.swfdecrypt.com/2010/07/swf-protector-3-0-are-you-kidding-me/">their latest releases</a> (which I&#8217;m reviewing here). You&#8217;ll notice he left Kindisoft and Ambiera alone, and he claims that&#8217;s because they offer real protection schemes, such as renaming functions and variables in the code. But the others claim they also use renaming, so we&#8217;ll see who&#8217;s right.</p>
<h4>The SWF files</h4>
<p>I&#8217;m a Flash game developer so that&#8217;s all I&#8217;m going to focus on here&#8211;single SWF files containing AS3 code compiled to run on Flash Player 9 and 10+. The files contain references to the Stage object, multiple event listeners, very high frame rates (60fps usually), and numerous computationally expensive operations such as pixel-level manipulations and heavy math functions. Here are the files I&#8217;ll be using:</p>
<ul>
<li><a href="http://flixel.org/flxcollisions/">FlxCollisions</a></li>
<li><a href="http://www.adamatomic.com/mode/">Mode</a></li>
<li>My pixel-level collision <a href="http://coldconstructs.com/2009/11/pixel-perfect-collision-detection-with-5000-particles/">demo</a></li>
</ul>
<p>These are free with source code available so that I can alter it if the protector requires it. The first two use <a href="http://flixel.org/">Flixel</a> (an old and new version), but if you have any (or know where to find some) non-Flixel open sourced Flash games then I&#8217;ll try that too. The third is a demo I wrote a while ago that has some heavy computation and sensitive optimizations that could trip up the protectors. Now, let&#8217;s get into the apps and see how they perform.</p>
<h4>Amayeta SWF Encrypt</h4>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/amayeta_logo.jpg" class="alignright" />Amayeta is a subsidiary focused solely on the Flash platform. It used to have a single product, SWF Encrypt, but now also provides a SWF compression utility. Magus, author of SWF Decrypt, provides <a href="http://www.gareth-jones.co.uk/2010/04/28/are-dcomsoft-and-eltima-the-same-company/">a deeper look</a> at their history and he isn&#8217;t kind about it.</p>
<p>The problem I have with Amayeta right off the bat is that its flagship product&#8217;s name is completely misleading since it&#8217;s not possible to <a href="http://en.wikipedia.org/wiki/Encryption">encrypt</a> a SWF. I mean you <em>can</em>, but then the Flash Player <em>wouldn&#8217;t be able to run it</em> because the player doesn&#8217;t have a way to decrypt it at runtime&#8211;that&#8217;s just not how the player was engineered. So they are being deceitful.</p>
<h5>Interface</h5>
<p>SWF Encrypt has two main areas in the window: on the left is a file explorer where you pick your SWFs to protect, and on the right is the main area where you check the ones to protect (again) and view their properties.</p>
<div id="postgallery"><a href="http://coldconstructs.com/siteFiles/blogImages/swf-protect_amayeta1.jpg" rel="prettyPhoto[amayeta]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protect_amayeta1.jpg" alt="The only screen" /></a> </div>
<p>It has an &#8220;encryption&#8221; setting with the values of &#8220;high&#8221;, &#8220;recommended&#8221;, &#8220;low&#8221;, and &#8220;custom&#8221;. If custom is selected you only have the option to set the &#8220;minimum data length&#8221;, which apparently just lets you put in a number that represents the level of &#8220;encryption&#8221; to use, with lower values being more protection.</p>
<h5>Effectiveness</h5>
<p>First using the recommended settings, the SWFs worked fine, no performance hit that I could tell. When I tried to open them up in Trillix, I could get to all the assets, but when I tried to access the scripts, it gave me an &#8220;out of memory&#8221; error. I tried to put it through SWF Decrypt but then the SWF wouldn&#8217;t play at all. I told Magus about this and he&#8217;s going to release a new version of Decrypt next week that should break Amayeta&#8217;s latest patch. It appears that the junk code Amayeta put into the SWFs actually worked this time.</p>
<p>SWF Encrypt has the options to &#8220;encrypt names&#8221; which I think is their way of saying they rename indentifiers like variables and functions. But because I couldn&#8217;t look into the scripts, post-protection, I could not verify this. I have conflicting reports about whether or not they truly obfuscate code, so I&#8217;m going to wait to see if Magus can break their patch, then revisit them again later.</p>
<h5>Overall</h5>
<p>It appears this latest version actually keeps Trillix from being able to look through it. However, I can&#8217;t check to see if there&#8217;s any actual renaming going on. Without true indentifier renaming, your SWFs will never be guaranteed to stay safe since the arms race between decompilers and protectors escalates endlessly. So for now, I can&#8217;t say one way or another if SWF Encrypt is solid. I can say that the level of control provided by the app is extremely limited, so even if they did do renaming, the user can&#8217;t fix a problem if the protection is too aggressive. An option to comb through your SWF and control protection on a per-object basis (ideally, per-variable and -function basis) is needed.</p>
<h4>DComSoft SWF Protector</h4>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/dcomsoft_logo.jpg" class="alignright" />DComSoft has a much bigger catalog than Amayeta, all focused on Flash. Better, but the company history doesn&#8217;t appear very legitimate. According to research done by <a href="http://blog.swfdecrypt.com/2010/04/dcomsoft-and-eltima-are-the-same-company/">this dude</a> and <a href="http://www.gareth-jones.co.uk/2010/04/28/are-dcomsoft-and-eltima-the-same-company/">this dude</a>, DComSoft is the same company as Eltima, a company that creates a SWF decompiler (one that I&#8217;m using for these reviews actually). That, my friends, is called &#8220;bad business practice&#8221;, if true. Besides that though, what the hell is up with the logo? If anyone has any idea what a tire has to do with Flash file protection, please let me know.</p>
<h5>Interface</h5>
<p>Protector has two modes: Simple and Advanced. Switch between modes using the tabs at the top of the application window. In Simple mode you can batch protect files but there are zero options. In Advanced mode though you can only protect one file at a time, but you can comb through each object and variable and check the boxes next to them, which are &#8220;Obfuscate&#8221; and &#8220;Protect&#8221;.</p>
<div id="postgallery"><a href="http://coldconstructs.com/siteFiles/blogImages/swf-protection_dcom1.png" rel="prettyPhoto[dcomsoft]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protection_dcom1.png" alt="The Simple section" /></a> <a href="http://coldconstructs.com/siteFiles/blogImages/swf-protection_dcom2.png" rel="prettyPhoto[dcomsoft]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protection_dcom2.png" alt="The Advanced section" /></a></div>
<p>According to the help file:</p>
<blockquote><p>Obfuscate renames variables, features etc. in a definite way. It doesn&#8217;t prevent from decompilation, but makes the subsequent compilation impossible.</p></blockquote>
<p>And &#8220;protect&#8221; means</p>
<blockquote><p>Protect modifies ActionScript in such a way that a SWF file can be played, but it is impossible to decompile it.</p></blockquote>
<p>Right, we&#8217;ll see about that.</p>
<h5>Effectiveness</h5>
<p>The protected SWFs ran normally with no noticeable framerate drop. When I loaded it into Trillix though, everything appeared just fine with ZERO obfuscation&#8211;no renaming except for what Flash does automatically, no junk code/characters that would trip up the decompiler, nothing. All scripts I opened were very readable. I&#8217;d like to note however that I&#8217;m using an old version of Trillix (4.1), because the newest version would just crash if I tried to open the scripts (well, sometimes it&#8217;d work, but most of the time not). Anyway, really nothing else I can say here, just &#8220;epic fail&#8221;.</p>
<h5>Overall</h5>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/bad.png" class="alignleft" alt="WHAT" />The interface is clean but offers very few options. If it actually worked I&#8217;d be ok with that, but maybe they need to add more granular controls so we can pick what we want obfuscated and by how much. It would also help if they added real obfuscation. Regardless, SWF Protector has a few licensing options. The Personal license ($40) doesn&#8217;t allow any of the SWFs protected by it to make money, while the Business license ($60) does. There&#8217;s other types for companies and OEMs too, but who cares&#8211;the software doesn&#8217;t work, end of story.</p>
<h4>Kindisoft secureSWF</h4>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/kindisoft_logo.jpg" class="alignright" />Kindisoft doesn&#8217;t mess around. When I emailed them about reviewing their app, they sent back this:</p>
<blockquote><p>While I definitely love to hear your opinion of secureSWF, we&#8217;re not interested to see a comparison with SWF Encrypt and SWF Protector. We think of secureSWF as a professional level ActionScript obfuscator while SWF Encrypt and SWF Protector as single purpose tools that might prevent some decompilers from working for a while.</p></blockquote>
<p>Ok then. So we start out on a completely different footing with Kindisoft than the others already. But while Kindisoft doesn&#8217;t have dirt on it like Amayeta and DComSoft do, it&#8217;s still a niche-based company providing only one product. Although that should mean they make a really great product, right?</p>
<p>I&#8217;d like to note that the free web-based version of secureSWF that is available to developers who put their games up at FlashGameLicense.com is apparently a different product. When I tried to add its protection to my first game, it broke it. When I brought this up with Kindisoft, they replied saying:</p>
<blockquote><p>secureSWF is a completely different solution than FGL encryption feature. We built this complementary encryption feature for FGL community to help avoid more thief incidents. It does not use the same technology or techniques as secureSWF.</p></blockquote>
<p>I just hope their software is better than their grammar.</p>
<h5>Interface</h5>
<p>SecureSWF is a bit more complicated but makes up for it in options. There are 5 tabs:</p>
<div id="postgallery"><a href="http://coldconstructs.com/siteFiles/blogImages/swf-protector_kindisoft1.png" rel="prettyPhoto[kindisoft]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protector_kindisoft1.png" alt="File browser" /></a> <a href="http://coldconstructs.com/siteFiles/blogImages/swf-protector_kindisoft2.png" rel="prettyPhoto[kindisoft]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protector_kindisoft2.png" alt="Indentifiers renaming" /></a> <a href="http://coldconstructs.com/siteFiles/blogImages/swf-protector_kindisoft3.png" rel="prettyPhoto[kindisoft]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protector_kindisoft3.png" alt="Protection options" /></a> <a href="http://coldconstructs.com/siteFiles/blogImages/swf-protector_kindisoft4.png" rel="prettyPhoto[kindisoft]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protector_kindisoft4.png" alt="Configuration rules" /></a></div>
<p>The fifth one is just a summary of what it did after you hit the big &#8220;Protect SWF Files&#8221; button. The GUI is pretty much self-explanatory and gives you a fine level of control. Hovering your mouse over any option will bring up a tooltip that further explains what the option does. So far, looks great.</p>
<h5>Effectiveness</h5>
<p>The real meat of the app is in the renaming, since eventually all SWF files can be cracked open to reveal their code. SecureSWF does a great job in this area. By default it will leave alone most public functions, probably because they&#8217;re usually used by other classes, so renaming them inconsistently would break the SWF.</p>
<p>When I protected the SWF files with the default settings, I was able to play my collision demo and Mode (which uses the old version of Flixel). I could not run FlxCollisions though, instead I got back this error: <code>ReferenceError: Error #1056: Cannot create property D on _-9l._-68</code>. Obviously the renaming was set a little too aggressively for it to work (and the &#8220;strength&#8221; was only at 20% with most advanced options turned off). When I tried to open the working SWFs with the decompiler, I got an access violation and the program crashed.</p>
<h5>Overall</h5>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/good.png" class="alignleft" alt="Good" />secureSWF only offers variable renaming in their Standard and Professional editions ($200 and $400 respectively), leaving it out in the Personal edition ($100). Considering the functionality SWF protectors provide (and how difficult they are to produce) these prices seem too high to me. The Pro edition (the version I&#8217;m using) does provide some nice additional features though, such as removing unused code (it happens), literal string encryption, and solid domain locking controls). </p>
<p>SecureSWF provides users with a lot of options and it would take me all day to go through them all. But the point is that secureSWF utilizes true obfuscation by renaming variables, encrypting literal strings (which Flash Player <em>can</em> deal with), and inserting illegal characters that will trip up decompilers&#8230; and sometimes the Flash Player too. So it takes some effort to get working, but the point is that <strong>it works</strong>. But is it good enough to justify the price? Let&#8217;s see what irrFuscator provides for its price to compare.</p>
<h4>Ambiera irrFuscator</h4>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/ambiera_logo.jpg" class="alignright" />Ambiera comes out of the gate with significant reputation points for having developed irrLicht and related creation tools&#8211;quality open source tools for the indie game developer. Ambiera got into the Flash scene when they decided to extend their game tools to the web via the Flash platform with their own 3D engine and creation apps. They figured developers will want to protect their games and, as the irrFuscator author told me via email, the current offerings in that market &#8220;sucked&#8221;, so he built his own. With this excellent history of software already under their collective belt, I had high hopes for irrFuscator.</p>
<h5>Interface</h5>
<p>A quick glance at irrFuscator&#8217;s interface will bring a sigh a relief, since the layout is dead simple but all the options are there and well-explained.</p>
<div id="postgallery"><a href="http://coldconstructs.com/siteFiles/blogImages/swf-protection_irr1.png" rel="prettyPhoto[ambiera]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protection_irr1.png" alt="SWF File mode" /></a> <a href="http://coldconstructs.com/siteFiles/blogImages/swf-protection_irr2.png" rel="prettyPhoto[ambiera]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protection_irr2.png" alt="Flex Project mode" /></a></div>
<p>If you still have trouble figuring out what&#8217;s what, the online docs are helpful and there&#8217;s even an active forum for it at Ambiera if you&#8217;re still having trouble. Very nice.</p>
<h5>Effectiveness</h5>
<p>irrFuscator sets itself apart by allowing you to rename all variables BEFORE you compile your project, so you can see exactly what it did and, if it messed up somewhere, you can go in and manually fix it before compiling again. This is the best method of obfuscation since you know it works, you know what it does, and you know you can fix it easily with your debugger. ALL classes and variables can be renamed, plus it removes whitespaces&#8211;even Vectors were retyped to the renamed classes, and all packages were also renamed (Flash built-ins as well). The resulting code was impossible to read.</p>
<div id="postgallery"><a href="http://coldconstructs.com/siteFiles/blogImages/swf-protection_irrs2.png" rel="prettyPhoto[ambierasrc]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protection_irrs2.png" alt="Unprotected code" /></a> <a href="http://coldconstructs.com/siteFiles/blogImages/swf-protection_irrs1.png" rel="prettyPhoto[ambierasrc]" title=""><img src="http://coldconstructs.com/siteFiles/blogImages/swf-protection_irrs1.png" alt="After irrFuscator, preserving whitespaces" /></a></div>
<p>I did run into a few problems though. I tried obfuscating my game, which references an SWC, but when I added it to the list, I got an error saying it couldn&#8217;t open it. I just removed it and it continued fine. Also, while it does encrypt literal strings (it replaces them with a function call to irrcrpt() to decrypt at runtime, which will impact performance a bit) it can&#8217;t encrypt them when they&#8217;re inside an Array or similar data structure. Not a big deal, but I was thrown off by that. The other thing is just a small UI annoyance, which is that it uses Windows&#8217; &#8220;browse folders&#8221; dialog to pick out your SWF (in &#8220;SWF File&#8221; mode). This dialog doesn&#8217;t remember where you last looked and it always starts you back at your computers root, so it takes me a while to drill down to the proper folder, which wastes a lot of time. Those are the only issues I found though, which is saying a lot.</p>
<p>Using the SWF File mode is nice, but it didn&#8217;t work for me; I got back this error when trying to run the protected version of FlxCollisions (again): <code>VerifyError: Error #1053: Illegal override of _iq39 in org.flixel.FlxEmitter</code>. Since this also happened with Kindisoft&#8217;s secureSWF, there&#8217;s something going on in the latest version of Flixel (v2.35) that gives them grief. Both packages give you ways to work around them though with their fine-grained controls. For irrFuscator, you just have to use the Flex Project option. In secureSWF you can just uncheck that file&#8230; if you knew which file that was, but there&#8217;s no way to find that out. irrFuscator wins that one.</p>
<h5>Overall</h5>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/good.png" class="alignleft" alt="IT'S GOOD" />irrFuscator has Standard and Professional editions (~$100 and ~$200 respectively&#8211;original prices are in Euros). The difference is that the Pro edition has <em>comment directives</em>, which means you can be extremely precise in telling the app which portions of your code NOT to obfuscate using specially formated comments. This is because code obfuscation sometimes results in worse performance or breaks it completely, depending on the code, so this is a great feature. You decide whether or not the comment directives are worth $100 for your projects. Still, these prices are far more reasonable than Kindisoft&#8217;s&#8211;you get everything secureSWF does at a quarter of the price. Not bad.</p>
<h4>Conclusion</h4>
<p>I&#8217;m bummed that I couldn&#8217;t determine how effective Amayeta was, but maybe some of you will think the fact that it can&#8217;t be decompiled yet is good enough. Not for me though, because SWFs will eventually be cracked&#8211;we need better protection than that. What I did determine though is that Kindisoft&#8217;s secureSWF and Ambiera&#8217;s irrFuscator offer true obfuscation for sure and therefore true protection of your code. Assets cannot be encrypted and can always be wrestled out of a SWF, unfortunately, so obfuscation is really a Flash developer&#8217;s best weapon.</p>
<p>Overall I&#8217;d say irrFuscator takes the cake for being reasonably-priced and offering that Flex Project option which makes it very powerful, yet it still retains simplicity of use through an easy user experience, plus the program itself was fast to load and responsive. The others were written in Java or were otherwise slow to start, so they were a bit sluggish.</p>
<p>That&#8217;s it for now, but I will be updating this article later if/when we can determine if Amayeta&#8217;s obfuscation methods are valid. Thanks for reading <img src="http://coldconstructs.com/random/pint.gif" /></p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=468&amp;md5=a089fdc24906d7060506f2c507cd1c89" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2010/07/swf-protection/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=vonWolfehaus&amp;url=http%3A%2F%2Fcoldconstructs.com%2F2010%2F07%2Fswf-protection%2F&amp;language=sq_AL&amp;category=text&amp;title=Why+SWF+protection+matters%3B+Review+of+the+current+options&amp;description=The+one+%28and+only%29+counter-argument+I%27ve+heard+against+SWF+protection+goes+something+like+this%3A%0AIt+doesn%27t+matter+what+you+do%2C+thieves+will+always+be+able+to+steal+your+work%2C+so+don%27t+bother+with+SWF+protection.%0AThis+is+a+textbook+example+of+the+%22perfect+solution%22+fallacy.+Thieves+will+always+be+able+to+crack+safes%2C+so+why+bother+storing+your+money+and+valuables+in+them%3F+And+of+course+encryption+can+always+be+cracked%2C+so+why+bother+using+it+when+transferring+valuable+information%3F+Why+not+just+release+all+your+work+and+hard-earned+assets+out+to+the+wild+for+anyone+to+plunder%2C+since+apparently+it+will+be+plundered+regardless+of+whatever+you+do+to+protect+it%3F%0AWhy+try%3F%0AObviously+we+use+safes+and+encryption+%26c+to+minimize+the+chances+of+bad+things+happening+to+our+precious+stuff.+It%27s+just+the+same+for+people+like+me+who+make+money+with+SWF+files--I+don%27t+want+anyone+stealing+my+Intellectual+Property+and+posting+it+elsewhere%2C+claiming+it+as+their+own%2C+so+I+do+everything+I+can+to+make+the+process+of+stealing+my+SWF+files+as+difficult+as+possible.+The+more+difficult+a+thing+is+to+steal%2C+the+less+chance+there+is+of+it+being+stolen--and+less+often.%0A%0AThe+tools%0ARight+now+there+are+several+tools%2C+some+even+free%2C+that+allow+you+to+decompile+a+SWF+file+to+take+a+look+at+everything+it+contains.+This+is+usually+pretty+easy+because+the+SWF+format+is+an+open+specification.+This+means+there%27s+no+way+to+fully+protect+anything+contained+in+the+file%2C+such+as+code%2C+graphics%2C+sounds%2C+or+videos.+However%2C+there+are+applications+that+take+precautions+against+decompiling+using+a+variety+of+methods.+%0AProtectors%0AI%27ll+review+the+biggest+names+in+that+market+today%3A%0AAmayeta+SWF+Encrypt+6.0.8%0ADComSoft+SWF+Protector+3.0.1+%28on+twitter%29%0AKindisoft+secureSWF+3.5+%28on+twitter%29%0AAmbiera+irrFuscator+2.1.2+%28on+twitter%29%0A%0ADecompilers%0AI%27ll+be+using+a+combination+of+SWF+Decrypt+1.2+and+Eltima%27s+Decompiler+v4.1+to+test+the+effectiveness+of+these+applications.+%28Side+note%3A+Eltima%27s+Decompiler+and+Sothink%27s+are+freakishly+similar.%29+SWF+Decrypt+really+upset+the+industry+when+Magus+%28the+author+who+wishes+to+remain+anonymous%29+released+it+completely+for+free.+It+apparently+decompiles+any+SWF+file+%22protected%22+by+Amayeta%27s+and+DComSoft%27s+applications.+He%27s+very+loud+about+it+too%2C+calling+them+out+on+their+%22tricks%22%2C+such+as+their+latest+releases+%28which+I%27m+reviewing+here%29.+You%27ll+notice+he+left+Kindisoft+and+Ambiera+alone%2C+and+he+claims+that%27s+because+they+offer+real+protection+schemes%2C+such+as+renaming+functions+and+variables+in+the+code.+But+the+others+claim+they+also+use+renaming%2C+so+we%27ll+see+who%27s+right.%0A%0AThe+SWF+files%0AI%27m+a+Flash+game+developer+so+that%27s+all+I%27m+going+to+focus+on+here--single+SWF+files+containing+AS3+code+compiled+to+run+on+Flash+Player+9+and+10%2B.+The+files+contain+references+to+the+Stage+object%2C+multiple+event+listeners%2C+very+high+frame+rates+%2860fps+usually%29%2C+and+numerous+computationally+expensive+operations+such+as+pixel-level+manipulations+and+heavy+math+functions.+Here+are+the+files+I%27ll+be+using%3A%0AFlxCollisions%0AMode%0AMy+pixel-level+collision+demo%0AThese+are+free+with+source+code+available+so+that+I+can+alter+it+if+the+protector+requires+it.+The+first+two+use+Flixel+%28an+old+and+new+version%29%2C+but+if+you+have+any+%28or+know+where+to+find+some%29+non-Flixel+open+sourced+Flash+games+then+I%27ll+try+that+too.+The+third+is+a+demo+I+wrote+a+while+ago+that+has+some+heavy+computation+and+sensitive+optimizations+that+could+trip+up+the+protectors.+Now%2C+let%27s+get+into+the+apps+and+see+how+they+perform.%0A%0AAmayeta+SWF+Encrypt%0AAmayeta+is+a+subsidiary+focused+solely+on+the+Flash+platform.+It+used+to+have+a+single+product%2C+SWF+Encrypt%2C+but+now+also+provides+a+SWF+compression+utility.+Magus%2C+author+of+SWF+Decrypt%2C+provides+a+deeper+look+at+their+history+and+he+isn%27t+kind+about+it.%0A%0AThe+problem+I+have+with+Amayeta+right+off+the+bat+is+that+its+flagship+product%27s+name+is+completely+misleading+since+it%27s+not+possible+to+encrypt+a+SWF.+I+mean+you+can%2C+but+then+the+Flash+Player+wouldn%27t+be+able+to+run+it+because+the+player+doesn%27t+have+a+way+to+decrypt+it+at+runtime--that%27s+just+not+how+the+player+was+engineered.+So+they+are+being+deceitful.%0A%0AInterface%0ASWF+Encrypt+has+two+main+areas+in+the+window%3A+on+the+left+is+a+file+explorer+where+you+pick+your+SWFs+to+protect%2C+and+on+the+right+is+the+main+area+where+you+check+the+ones+to+protect+%28again%29+and+view+their+properties.%0A+%0AIt+has+an+%22encryption%22+setting+with+the+values+of+%22high%22%2C+%22recommended%22%2C+%22low%22%2C+and+%22custom%22.+If+custom+is+selected+you+only+have+the+option+to+set+the+%22minimum+data+length%22%2C+which+apparently+just+lets+you+put+in+a+number+that+represents+the+level+of+%22encryption%22+to+use%2C+with+lower+values+being+more+protection.%0AEffectiveness%0AFirst+using+the+recommended+settings%2C+the+SWFs+worked+fine%2C+no+performance+hit+that+I+could+tell.+When+I+tried+to+open+them+up+in+Trillix%2C+I+could+get+to+all+the+assets%2C+but+when+I+tried+to+access+the+scripts%2C+it+gave+me+an+%22out+of+memory%22+error.+I+tried+to+put+it+through+SWF+Decrypt+but+then+the+SWF+wouldn%27t+play+at+all.+I+told+Magus+about+this+and+he%27s+going+to+release+a+new+version+of+Decrypt+next+week+that+should+break+Amayeta%27s+latest+patch.+It+appears+that+the+junk+code+Amayeta+put+into+the+SWFs+actually+worked+this+time.%0A%0ASWF+Encrypt+has+the+options+to+%22encrypt+names%22+which+I+think+is+their+way+of+saying+they+rename+indentifiers+like+variables+and+functions.+But+because+I+couldn%27t+look+into+the+scripts%2C+post-protection%2C+I+could+not+verify+this.+I+have+conflicting+reports+about+whether+or+not+they+truly+obfuscate+code%2C+so+I%27m+going+to+wait+to+see+if+Magus+can+break+their+patch%2C+then+revisit+them+again+later.%0AOverall%0AIt+appears+this+latest+version+actually+keeps+Trillix+from+being+able+to+look+through+it.+However%2C+I+can%27t+check+to+see+if+there%27s+any+actual+renaming+going+on.+Without+true+indentifier+renaming%2C+your+SWFs+will+never+be+guaranteed+to+stay+safe+since+the+arms+race+between+decompilers+and+protectors+escalates+endlessly.+So+for+now%2C+I+can%27t+say+one+way+or+another+if+SWF+Encrypt+is+solid.+I+can+say+that+the+level+of+control+provided+by+the+app+is+extremely+limited%2C+so+even+if+they+did+do+renaming%2C+the+user+can%27t+fix+a+problem+if+the+protection+is+too+aggressive.+An+option+to+comb+through+your+SWF+and+control+protection+on+a+per-object+basis+%28ideally%2C+per-variable+and+-function+basis%29+is+needed.%0A%0ADComSoft+SWF+Protector%0ADComSoft+has+a+much+bigger+catalog+than+Amayeta%2C+all+focused+on+Flash.+Better%2C+but+the+company+history+doesn%27t+appear+very+legitimate.+According+to+research+done+by+this+dude+and+this+dude%2C+DComSoft+is+the+same+company+as+Eltima%2C+a+company+that+creates+a+SWF+decompiler+%28one+that+I%27m+using+for+these+reviews+actually%29.+That%2C+my+friends%2C+is+called+%22bad+business+practice%22%2C+if+true.+Besides+that+though%2C+what+the+hell+is+up+with+the+logo%3F+If+anyone+has+any+idea+what+a+tire+has+to+do+with+Flash+file+protection%2C+please+let+me+know.%0AInterface%0AProtector+has+two+modes%3A+Simple+and+Advanced.+Switch+between+modes+using+the+tabs+at+the+top+of+the+application+window.+In+Simple+mode+you+can+batch+protect+files+but+there+are+zero+options.+In+Advanced+mode+though+you+can+only+protect+one+file+at+a+time%2C+but+you+can+comb+through+each+object+and+variable+and+check+the+boxes+next+to+them%2C+which+are+%22Obfuscate%22+and+%22Protect%22.%0A+%0AAccording+to+the+help+file%3A%0AObfuscate+renames+variables%2C+features+etc.+in+a+definite+way.+It+doesn%27t+prevent+from+decompilation%2C+but+makes+the+subsequent+compilation+impossible.%0AAnd+%22protect%22+means%0AProtect+modifies+ActionScript+in+such+a+way+that+a+SWF+file+can+be+played%2C+but+it+is+impossible+to+decompile+it.%0ARight%2C+we%27ll+see+about+that.%0AEffectiveness%0AThe+protected+SWFs+ran+normally+with+no+noticeable+framerate+drop.+When+I+loaded+it+into+Trillix+though%2C+everything+appeared+just+fine+with+ZERO+obfuscation--no+renaming+except+for+what+Flash+does+automatically%2C+no+junk+code%2Fcharacters+that+would+trip+up+the+decompiler%2C+nothing.+All+scripts+I+opened+were+very+readable.+I%27d+like+to+note+however+that+I%27m+using+an+old+version+of+Trillix+%284.1%29%2C+because+the+newest+version+would+just+crash+if+I+tried+to+open+the+scripts+%28well%2C+sometimes+it%27d+work%2C+but+most+of+the+time+not%29.+Anyway%2C+really+nothing+else+I+can+say+here%2C+just+%22epic+fail%22.%0AOverall%0AThe+interface+is+clean+but+offers+very+few+options.+If+it+actually+worked+I%27d+be+ok+with+that%2C+but+maybe+they+need+to+add+more+granular+controls+so+we+can+pick+what+we+want+obfuscated+and+by+how+much.+It+would+also+help+if+they+added+real+obfuscation.+Regardless%2C+SWF+Protector+has+a+few+licensing+options.+The+Personal+license+%28%2440%29+doesn%27t+allow+any+of+the+SWFs+protected+by+it+to+make+money%2C+while+the+Business+license+%28%2460%29+does.+There%27s+other+types+for+companies+and+OEMs+too%2C+but+who+cares--the+software+doesn%27t+work%2C+end+of+story.%0A%0AKindisoft+secureSWF%0AKindisoft+doesn%27t+mess+around.+When+I+emailed+them+about+reviewing+their+app%2C+they+sent+back+this%3A%0AWhile+I+definitely+love+to+hear+your+opinion+of+secureSWF%2C+we%27re+not+interested+to+see+a+comparison+with+SWF+Encrypt+and+SWF+Protector.+We+think+of+secureSWF+as+a+professional+level+ActionScript+obfuscator+while+SWF+Encrypt+and+SWF+Protector+as+single+purpose+tools+that+might+prevent+some+decompilers+from+working+for+a+while.%0AOk+then.+So+we+start+out+on+a+completely+different+footing+with+Kindisoft+than+the+others+already.+But+while+Kindisoft+doesn%27t+have+dirt+on+it+like+Amayeta+and+DComSoft+do%2C+it%27s+still+a+niche-based+company+providing+only+one+product.+Although+that+should+mean+they+make+a+really+great+product%2C+right%3F%0A%0AI%27d+like+to+note+that+the+free+web-based+version+of+secureSWF+that+is+available+to+developers+who+put+their+games+up+at+FlashGameLicense.com+is+apparently+a+different+product.+When+I+tried+to+add+its+protection+to+my+first+game%2C+it+broke+it.+When+I+brought+this+up+with+Kindisoft%2C+they+replied+saying%3A%0AsecureSWF+is+a+completely+different+solution+than+FGL+encryption+feature.+We+built+this+complementary+encryption+feature+for+FGL+community+to+help+avoid+more+thief+incidents.+It+does+not+use+the+same+technology+or+techniques+as+secureSWF.%0AI+just+hope+their+software+is+better+than+their+grammar.%0AInterface%0ASecureSWF+is+a+bit+more+complicated+but+makes+up+for+it+in+options.+There+are+5+tabs%3A%0A+++%0AThe+fifth+one+is+just+a+summary+of+what+it+did+after+you+hit+the+big+%22Protect+SWF+Files%22+button.+The+GUI+is+pretty+much+self-explanatory+and+gives+you+a+fine+level+of+control.+Hovering+your+mouse+over+any+option+will+bring+up+a+tooltip+that+further+explains+what+the+option+does.+So+far%2C+looks+great.%0AEffectiveness%0AThe+real+meat+of+the+app+is+in+the+renaming%2C+since+eventually+all+SWF+files+can+be+cracked+open+to+reveal+their+code.+SecureSWF+does+a+great+job+in+this+area.+By+default+it+will+leave+alone+most+public+functions%2C+probably+because+they%27re+usually+used+by+other+classes%2C+so+renaming+them+inconsistently+would+break+the+SWF.%0A%0AWhen+I+protected+the+SWF+files+with+the+default+settings%2C+I+was+able+to+play+my+collision+demo+and+Mode+%28which+uses+the+old+version+of+Flixel%29.+I+could+not+run+FlxCollisions+though%2C+instead+I+got+back+this+error%3A+ReferenceError%3A+Error+%231056%3A+Cannot+create+property+D+on+_-9l._-68.+Obviously+the+renaming+was+set+a+little+too+aggressively+for+it+to+work+%28and+the+%22strength%22+was+only+at+20%25+with+most+advanced+options+turned+off%29.+When+I+tried+to+open+the+working+SWFs+with+the+decompiler%2C+I+got+an+access+violation+and+the+program+crashed.%0AOverall%0AsecureSWF+only+offers+variable+renaming+in+their+Standard+and+Professional+editions+%28%24200+and+%24400+respectively%29%2C+leaving+it+out+in+the+Personal+edition+%28%24100%29.+Considering+the+functionality+SWF+protectors+provide+%28and+how+difficult+they+are+to+produce%29+these+prices+seem+too+high+to+me.+The+Pro+edition+%28the+version+I%27m+using%29+does+provide+some+nice+additional+features+though%2C+such+as+removing+unused+code+%28it+happens%29%2C+literal+string+encryption%2C+and+solid+domain+locking+controls%29.+%0A%0ASecureSWF+provides+users+with+a+lot+of+options+and+it+would+take+me+all+day+to+go+through+them+all.+But+the+point+is+that+secureSWF+utilizes+true+obfuscation+by+renaming+variables%2C+encrypting+literal+strings+%28which+Flash+Player+can+deal+with%29%2C+and+inserting+illegal+characters+that+will+trip+up+decompilers...+and+sometimes+the+Flash+Player+too.+So+it+takes+some+effort+to+get+working%2C+but+the+point+is+that+it+works.+But+is+it+good+enough+to+justify+the+price%3F+Let%27s+see+what+irrFuscator+provides+for+its+price+to+compare.%0A%0AAmbiera+irrFuscator%0AAmbiera+comes+out+of+the+gate+with+significant+reputation+points+for+having+developed+irrLicht+and+related+creation+tools--quality+open+source+tools+for+the+indie+game+developer.+Ambiera+got+into+the+Flash+scene+when+they+decided+to+extend+their+game+tools+to+the+web+via+the+Flash+platform+with+their+own+3D+engine+and+creation+apps.+They+figured+developers+will+want+to+protect+their+games+and%2C+as+the+irrFuscator+author+told+me+via+email%2C+the+current+offerings+in+that+market+%22sucked%22%2C+so+he+built+his+own.+With+this+excellent+history+of+software+already+under+their+collective+belt%2C+I+had+high+hopes+for+irrFuscator.%0AInterface%0AA+quick+glance+at+irrFuscator%27s+interface+will+bring+a+sigh+a+relief%2C+since+the+layout+is+dead+simple+but+all+the+options+are+there+and+well-explained.%0A+%0AIf+you+still+have+trouble+figuring+out+what%27s+what%2C+the+online+docs+are+helpful+and+there%27s+even+an+active+forum+for+it+at+Ambiera+if+you%27re+still+having+trouble.+Very+nice.%0AEffectiveness%0AirrFuscator+sets+itself+apart+by+allowing+you+to+rename+all+variables+BEFORE+you+compile+your+project%2C+so+you+can+see+exactly+what+it+did+and%2C+if+it+messed+up+somewhere%2C+you+can+go+in+and+manually+fix+it+before+compiling+again.+This+is+the+best+method+of+obfuscation+since+you+know+it+works%2C+you+know+what+it+does%2C+and+you+know+you+can+fix+it+easily+with+your+debugger.+ALL+classes+and+variables+can+be+renamed%2C+plus+it+removes+whitespaces--even+Vectors+were+retyped+to+the+renamed+classes%2C+and+all+packages+were+also+renamed+%28Flash+built-ins+as+well%29.+The+resulting+code+was+impossible+to+read.%0A+%0AI+did+run+into+a+few+problems+though.+I+tried+obfuscating+my+game%2C+which+references+an+SWC%2C+but+when+I+added+it+to+the+list%2C+I+got+an+error+saying+it+couldn%27t+open+it.+I+just+removed+it+and+it+continued+fine.+Also%2C+while+it+does+encrypt+literal+strings+%28it+replaces+them+with+a+function+call+to+irrcrpt%28%29+to+decrypt+at+runtime%2C+which+will+impact+performance+a+bit%29+it+can%27t+encrypt+them+when+they%27re+inside+an+Array+or+similar+data+structure.+Not+a+big+deal%2C+but+I+was+thrown+off+by+that.+The+other+thing+is+just+a+small+UI+annoyance%2C+which+is+that+it+uses+Windows%27+%22browse+folders%22+dialog+to+pick+out+your+SWF+%28in+%22SWF+File%22+mode%29.+This+dialog+doesn%27t+remember+where+you+last+looked+and+it+always+starts+you+back+at+your+computers+root%2C+so+it+takes+me+a+while+to+drill+down+to+the+proper+folder%2C+which+wastes+a+lot+of+time.+Those+are+the+only+issues+I+found+though%2C+which+is+saying+a+lot.%0A%0AUsing+the+SWF+File+mode+is+nice%2C+but+it+didn%27t+work+for+me%3B+I+got+back+this+error+when+trying+to+run+the+protected+version+of+FlxCollisions+%28again%29%3A+VerifyError%3A+Error+%231053%3A+Illegal+override+of+_iq39+in+org.flixel.FlxEmitter.+Since+this+also+happened+with+Kindisoft%27s+secureSWF%2C+there%27s+something+going+on+in+the+latest+version+of+Flixel+%28v2.35%29+that+gives+them+grief.+Both+packages+give+you+ways+to+work+around+them+though+with+their+fine-grained+controls.+For+irrFuscator%2C+you+just+have+to+use+the+Flex+Project+option.+In+secureSWF+you+can+just+uncheck+that+file...+if+you+knew+which+file+that+was%2C+but+there%27s+no+way+to+find+that+out.+irrFuscator+wins+that+one.%0AOverall%0AirrFuscator+has+Standard+and+Professional+editions+%28%7E%24100+and+%7E%24200+respectively--original+prices+are+in+Euros%29.+The+difference+is+that+the+Pro+edition+has+comment+directives%2C+which+means+you+can+be+extremely+precise+in+telling+the+app+which+portions+of+your+code+NOT+to+obfuscate+using+specially+formated+comments.+This+is+because+code+obfuscation+sometimes+results+in+worse+performance+or+breaks+it+completely%2C+depending+on+the+code%2C+so+this+is+a+great+feature.+You+decide+whether+or+not+the+comment+directives+are+worth+%24100+for+your+projects.+Still%2C+these+prices+are+far+more+reasonable+than+Kindisoft%27s--you+get+everything+secureSWF+does+at+a+quarter+of+the+price.+Not+bad.%0A%0AConclusion%0AI%27m+bummed+that+I+couldn%27t+determine+how+effective+Amayeta+was%2C+but+maybe+some+of+you+will+think+the+fact+that+it+can%27t+be+decompiled+yet+is+good+enough.+Not+for+me+though%2C+because+SWFs+will+eventually+be+cracked--we+need+better+protection+than+that.+What+I+did+determine+though+is+that+Kindisoft%27s+secureSWF+and+Ambiera%27s+irrFuscator+offer+true+obfuscation+for+sure+and+therefore+true+protection+of+your+code.+Assets+cannot+be+encrypted+and+can+always+be+wrestled+out+of+a+SWF%2C+unfortunately%2C+so+obfuscation+is+really+a+Flash+developer%27s+best+weapon.%0A%0AOverall+I%27d+say+irrFuscator+takes+the+cake+for+being+reasonably-priced+and+offering+that+Flex+Project+option+which+makes+it+very+powerful%2C+yet+it+still+retains+simplicity+of+use+through+an+easy+user+experience%2C+plus+the+program+itself+was+fast+to+load+and+responsive.+The+others+were+written+in+Java+or+were+otherwise+slow+to+start%2C+so+they+were+a+bit+sluggish.%0A%0AThat%27s+it+for+now%2C+but+I+will+be+updating+this+article+later+if%2Fwhen+we+can+determine+if+Amayeta%27s+obfuscation+methods+are+valid.+Thanks+for+reading+&amp;tags=content+protection%2CFlash%2Creview%2Cblog" type="text/html" />
	</item>
		<item>
		<title>5 ways to make bank on Flash games</title>
		<link>http://coldconstructs.com/2010/06/5-ways-to-make-bank-on-flash-games/</link>
		<comments>http://coldconstructs.com/2010/06/5-ways-to-make-bank-on-flash-games/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 10:00:27 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Discussions]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[commerce]]></category>
		<category><![CDATA[game industry]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=427</guid>
		<description><![CDATA[This is a quick run-down on the status of the financial options that are available to independent developers who don&#8217;t have massive marketing budgets or corporate support. Please post a comment below and let us know how your experience has been with these options (or others I&#8217;ve missed). Flattr The latest option is a general-purpose... <a href="http://coldconstructs.com/2010/06/5-ways-to-make-bank-on-flash-games/">Read More &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><!--TOC-->This is a quick run-down on the status of the financial options that are available to independent developers who don&#8217;t have massive marketing budgets or corporate support. Please post a comment below and let us know how your experience has been with these options (or others I&#8217;ve missed).</p>
<h4>Flattr</h4>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/flttr_logo.png" class="alignleft"/>The latest option is a general-purpose micro-donation system called <a href="http://flattr.com/">Flattr</a>. It takes the &#8220;like&#8221;/&#8221;retweet&#8221; interactive device and applies it micro-funding. <a href="http://www.youtube.com/watch?v=9zrMlEEWBgY" rel="prettyPhoto">Watch this video</a> (1.8 minutes; opens a lightbox) to see how it works; or here&#8217;s a summary:</p>
<ol>
<li>Once invited/registered, you fill your monthly &#8220;means&#8221; account with some money. The devs like to call this account <em>cake</em>.</li>
<li>Whenever you click on a Flattr button, a slice of your cake is given to the thing associated with that button.</li>
<li>At the end of every month, your cake is sliced evenly and distributed among all the things you flattr&#8217;d that month.</li>
<li>Likewise, you will receive money from people who flattr&#8217;d YOUR content.</li>
</ol>
<p>You always have to have some cake to give in order to get some cake yourself. That&#8217;s the gist, and so far <a href="http://blog.flattr.com/2010/06/money-calculation-done/">it&#8217;s working well</a>. Of the 15k or so users, many got &euro;100 for a month and thousands more got more Euros than they spent (other currencies forthcoming&#8211;Flattr is still in invite-only beta). Pretty good considering this service just launched last month (March 2010) <em>and</em> it&#8217;s still in private/invite-only beta.</p>
<p><span id="more-427"></span>The relevance this service has to Flash games is obvious. Someday soon you will be able to put a Flattr button anywhere in your games and people will be able to easily support you&#8211;with <strong>all revenue going to you, the developer.</strong> It usually isn&#8217;t much per click, but it&#8217;s still a LOT more than anything ads could give you.</p>
<p>At the moment, you submit your game/post/whatever to the Flattr feed, or create a post for your game in your blog (like I did), and people will be able to flattr you that way. Still pretty easy, but the real deal is when you can directly embed a button in your game (coming soon, whenever they release their REST API and someone writes a Flash implementation of it).</p>
<h4>Microtransactions</h4>
<p>Microtransactions (aka <em>MTX</em> or <em>micropayments</em>) are not as bad as ads because you get more money per click, but not as good as Flattr because you still have to share your revenue with the MTX service(s) you&#8217;re using. MTX are also the most difficult option. Not in terms of coding skill but rather design skill. You have to ensure correct usage/placement of MTX items within your game. Besides that, there&#8217;s <strong>choosing which service works best for you.</strong> You MUST read Lost Garden&#8217;s <a href="http://www.lostgarden.com/2009/07/flash-love-letter-2009-part-1.html">Flash Love Letter</a> that explains both of these factors in great detail.</p>
<p>Here&#8217;s the current most prominent micropayment services in no particular order:</p>
<table class="general" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>Service name</th>
<th width="100px">Dev cut</th>
<th>Legally usable with other services?</th>
<th>Dual currency?</th>
<th>Game extras?</th>
<th>Usable on any website?</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="http://www.nonoba.com/developers">nonoba</a></td>
<td>70%</td>
<td class="yes"></td>
<td class="no"></td>
<td class="yes"></td>
<td class="yes"></td>
</tr>
<tr class="alt">
<td><a href="http://www.mochimedia.com/developers/coins.html">MochiMedia</a></td>
<td>60%</td>
<td class="no"></td>
<td class="no"></td>
<td class="yes"></td>
<td class="yes"></td>
</tr>
<tr>
<td><a href="http://www.heyzap.com/developers">HeyZap</a></td>
<td>70%</td>
<td class="yes"></td>
<td class="yes"></td>
<td class="yes"></td>
<td class="yes"></td>
</tr>
<tr class="alt">
<td><a href="https://www.gamersafe.com/index.php">GamerSafe</a></td>
<td>70%</td>
<td class="yes"></td>
<td class="yes"></td>
<td class="yes"></td>
<td class="yes"></td>
</tr>
<tr>
<td><a href="http://www.jambool.com/">SocialGold</a></td>
<td>90%</td>
<td class="yes"></td>
<td class="no"></td>
<td class="no"></td>
<td class="no"></td>
</tr>
<tr class="alt">
<td><a href="http://www.come2play.com/developer.asp">come2play</a></td>
<td>50%</td>
<td class="no"></td>
<td class="no"></td>
<td class="yes"></td>
<td class="yes"></td>
</tr>
<tr>
<td><a href="http://www.facebook.com/credits">Facebook</a></td>
<td>70%</td>
<td class="no"></td>
<td class="no"></td>
<td class="no"></td>
<td class="no"></td>
</tr>
</tbody>
</table>
<p><span class="small">come2play took 3 months to respond. For that and they&#8217;re disappointing services, they get my infamous &#8220;Shit Eater&#8221; Award.</span></p>
<p>&#8220;Game extras&#8221; means the service provides an API for things like leaderboards, achievements, and other little things that increase player retention and increases general interest and replayability, as well as the all-important analytics tools. Ease of implementation for each service varies, but they&#8217;re all pretty careful to make it quite simple. I don&#8217;t have any personal experience with any of these but if YOU do then please leave a comment telling us how it went for you.</p>
<p>Note that <strong>nonoba</strong> is evolving their tools into <a href="http://playerio.com/">PlayerIO</a>, a full-blown multiplayer framework built specifically for Flash games, based on a subscription fee (there&#8217;s a free version). I&#8217;m not sure how their Payments system will handle the move and they haven&#8217;t gotten back to me yet. I&#8217;d like to mention that the crews at HeyZap, MochiMedia, and GamerSafe were by far the most responsive of the bunch. HeyZap kept my game The Last Evasion in indefinite &#8220;awaiting approval&#8221;, so they can go fuck themselves.</p>
<p>It looks like a combination of services would be best, but that leaves you with HeyZap, GamerSafe, nonoba&#8230; and SocialGold, although SocialGold requires you to have complete control over the page your game is embedded in (ie you can&#8217;t post it on any portals) so that really isn&#8217;t much of an option (and you should read <a href="https://www.mochimedia.com/community/forum/topic/gamersafe-mochiads">this thread</a> that explains its serious security flaw).</p>
<p>In choosing the service(s), be sure to take a look at their developer forums and see how often they get answers too. Send them an email with some questions to find out how helpful they are. You can ask other devs about it, but my forum questions <a href="http://www.actionscript.org/forums/showthread.php3?t=241428">went</a> <a href="http://www.kirupa.com/forum/showthread.php?t=350305">unanswered</a>. You&#8217;ll have a bit more luck if you are more sociable than me <img src='http://coldconstructs.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<h4>Sponsorships</h4>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/fgl_logo.png" class="alignleft"/>Sponsorships are an excellent choice, if you have a game good enough to attract sponsors. Just beware of bad/dickish sponsors. Be sure to read <a href="http://www.gamasutra.com/view/news/27924/InDepth_Behind_Flash_Game_SteamBirds_Revenue_Deals.php">SteamBirds dev&#8217;s experience</a> vetting sponsors on <a href="http://www.flashgamelicense.com/">FGL</a> and check out FGL&#8217;s <a href="http://www.flashgamelicense.com/blog/2010/01/looking-back-at-2009-trends-and-statistics/">informative 2009 report</a>.</p>
<p>Remember that, besides FGL, there&#8217;s thousands of other sites that don&#8217;t check FGL that will be willing to sponsor your game with varying terms. Just shoot them an email and ask. You can charge more for one that requires you to completely re-brand your game, or for an exclusive (or time-sensitive exclusive) license to your game, or it could be as simple as putting in a logo somewhere and a link or two. Ask around, work out a good deal and see what happens.</p>
<h4>Shareware</h4>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/sharify_logo.png" class="alignleft"/>With the advent of Adobe Integrated Runtime (aka AIR) and tools like <a href="http://www.sharify.it/how-it-works">Sharify</a>, we can actually package our games as downloadable apps that can be played on just about ANY platform (thanks to Flash Player 10.1, this includes Androids and holy shit <em>TVs</em>). While Sharify and similar services can lock your game, <strong>you can do that part yourself</strong> and just use an MTX service to handle the money part.</p>
<h4>Ads</h4>
<p><img src="http://coldconstructs.com/siteFiles/blogImages/mochi_logo.png" class="alignleft"/>If your game is small and shitty (like my first one, and like the vast majority of Flash games), ads are a good option since MTX requires more time and skill implement. I&#8217;ve heard a few developers who have made a good amount of bank with ads, but they are few and far in-between. However, they do offer us a quick and easy way to earn (tiny amounts of) cash.</p>
<p>But there remains some pretty nasty problems with ads:</p>
<ol>
<li>Clicks or impressions (whatever the ad provider does) provide a microscopic amount of revenue in the first place.</li>
<li>You get little more than half of the revenue generated by the ads. (Most do a 60/40 split.)</li>
<li>Each big-name portal has their own rules on which ads you can use.</li>
</ol>
<p>Regarding that last one, as an example: you can&#8217;t show Mochi Ads on Kongregate; Newgrounds has their own ad system; Armor Games, the same. <em>We have to make a different version of our games for each portal.</em> This, my friends, is bullshit.</p>
<h4>Conclusion</h4>
<p>To get the most revenue from your games, you will need to decide what your business model is before you even write one line of code. Banking on the general goodwill of your audience? Use Flattr, add a PayPal donations button, and maybe an ad for a preloader. Have a multiplayer game? MTX is the way to go. Have an amazing single player experience? You&#8217;re probably better off with the shareware model. But in all cases, you should at least ask around for sponsorships, because the terms can be so flexible with good payoff. Also, don&#8217;t forget Twitter/Facebook/etc. share links!</p>
<p>So, all in all, I&#8217;m really happy to see people taking Flash games seriously and throwing some genuinely useful financial tools at developers. And as always, things will keep changing and we&#8217;ll see better ways to bake our cake and eat it too. Good luck and have fun!</p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=427&amp;md5=c99b4591127a403a079e0c87599f4e93" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2010/06/5-ways-to-make-bank-on-flash-games/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=vonWolfehaus&amp;url=http%3A%2F%2Fcoldconstructs.com%2F2010%2F06%2F5-ways-to-make-bank-on-flash-games%2F&amp;language=sq_AL&amp;category=text&amp;title=5+ways+to+make+bank+on+Flash+games&amp;description=This+is+a+quick+run-down+on+the+status+of+the+financial+options+that+are+available+to+independent+developers+who+don%27t+have+massive+marketing+budgets+or+corporate+support.+Please+post+a+comment+below+and+let+us+know+how+your+experience+has+been+with+these+options+%28or+others+I%27ve+missed%29.%0A%0AFlattr%0AThe+latest+option+is+a+general-purpose+micro-donation+system+called+Flattr.+It+takes+the+%22like%22%2F%22retweet%22+interactive+device+and+applies+it+micro-funding.+Watch+this+video+%281.8+minutes%3B+opens+a+lightbox%29+to+see+how+it+works%3B+or+here%27s+a+summary%3A%0AOnce+invited%2Fregistered%2C+you+fill+your+monthly+%22means%22+account+with+some+money.+The+devs+like+to+call+this+account+cake.%0AWhenever+you+click+on+a+Flattr+button%2C+a+slice+of+your+cake+is+given+to+the+thing+associated+with+that+button.%0AAt+the+end+of+every+month%2C+your+cake+is+sliced+evenly+and+distributed+among+all+the+things+you+flattr%27d+that+month.%0ALikewise%2C+you+will+receive+money+from+people+who+flattr%27d+YOUR+content.%0AYou+always+have+to+have+some+cake+to+give+in+order+to+get+some+cake+yourself.+That%27s+the+gist%2C+and+so+far+it%27s+working+well.+Of+the+15k+or+so+users%2C+many+got+%26euro%3B100+for+a+month+and+thousands+more+got+more+Euros+than+they+spent+%28other+currencies+forthcoming--Flattr+is+still+in+invite-only+beta%29.+Pretty+good+considering+this+service+just+launched+last+month+%28March+2010%29+and+it%27s+still+in+private%2Finvite-only+beta.%0A%0AThe+relevance+this+service+has+to+Flash+games+is+obvious.+Someday+soon+you+will+be+able+to+put+a+Flattr+button+anywhere+in+your+games+and+people+will+be+able+to+easily+support+you--with+all+revenue+going+to+you%2C+the+developer.+It+usually+isn%27t+much+per+click%2C+but+it%27s+still+a+LOT+more+than+anything+ads+could+give+you.%0A%0AAt+the+moment%2C+you+submit+your+game%2Fpost%2Fwhatever+to+the+Flattr+feed%2C+or+create+a+post+for+your+game+in+your+blog+%28like+I+did%29%2C+and+people+will+be+able+to+flattr+you+that+way.+Still+pretty+easy%2C+but+the+real+deal+is+when+you+can+directly+embed+a+button+in+your+game+%28coming+soon%2C+whenever+they+release+their+REST+API+and+someone+writes+a+Flash+implementation+of+it%29.%0A%0AMicrotransactions%0AMicrotransactions+%28aka+MTX+or+micropayments%29+are+not+as+bad+as+ads+because+you+get+more+money+per+click%2C+but+not+as+good+as+Flattr+because+you+still+have+to+share+your+revenue+with+the+MTX+service%28s%29+you%27re+using.+MTX+are+also+the+most+difficult+option.+Not+in+terms+of+coding+skill+but+rather+design+skill.+You+have+to+ensure+correct+usage%2Fplacement+of+MTX+items+within+your+game.+Besides+that%2C+there%27s+choosing+which+service+works+best+for+you.+You+MUST+read+Lost+Garden%27s+Flash+Love+Letter+that+explains+both+of+these+factors+in+great+detail.%0A%0AHere%27s+the+current+most+prominent+micropayment+services+in+no+particular+order%3A%0A%0A%0AService+nameDev+cutLegally+usable+with+other+services%3FDual+currency%3FGame+extras%3FUsable+on+any+website%3F%0A%0Anonoba%0A70%25%0AMochiMedia%0A60%25%0AHeyZap%0A70%25%0AGamerSafe%0A70%25%0ASocialGold%0A90%25%0Acome2play%0A50%25%0AFacebook%0A70%25%0Acome2play+took+3+months+to+respond.+For+that+and+they%27re+disappointing+services%2C+they+get+my+infamous+%22Shit+Eater%22+Award.%0A%0A%22Game+extras%22+means+the+service+provides+an+API+for+things+like+leaderboards%2C+achievements%2C+and+other+little+things+that+increase+player+retention+and+increases+general+interest+and+replayability%2C+as+well+as+the+all-important+analytics+tools.+Ease+of+implementation+for+each+service+varies%2C+but+they%27re+all+pretty+careful+to+make+it+quite+simple.+I+don%27t+have+any+personal+experience+with+any+of+these+but+if+YOU+do+then+please+leave+a+comment+telling+us+how+it+went+for+you.%0A%0ANote+that+nonoba+is+evolving+their+tools+into+PlayerIO%2C+a+full-blown+multiplayer+framework+built+specifically+for+Flash+games%2C+based+on+a+subscription+fee+%28there%27s+a+free+version%29.+I%27m+not+sure+how+their+Payments+system+will+handle+the+move+and+they+haven%27t+gotten+back+to+me+yet.+I%27d+like+to+mention+that+the+crews+at+HeyZap%2C+MochiMedia%2C+and+GamerSafe+were+by+far+the+most+responsive+of+the+bunch.+HeyZap+kept+my+game+The+Last+Evasion+in+indefinite+%22awaiting+approval%22%2C+so+they+can+go+fuck+themselves.%0A%0AIt+looks+like+a+combination+of+services+would+be+best%2C+but+that+leaves+you+with+HeyZap%2C+GamerSafe%2C+nonoba...+and+SocialGold%2C+although+SocialGold+requires+you+to+have+complete+control+over+the+page+your+game+is+embedded+in+%28ie+you+can%27t+post+it+on+any+portals%29+so+that+really+isn%27t+much+of+an+option+%28and+you+should+read+this+thread+that+explains+its+serious+security+flaw%29.%0A%0AIn+choosing+the+service%28s%29%2C+be+sure+to+take+a+look+at+their+developer+forums+and+see+how+often+they+get+answers+too.+Send+them+an+email+with+some+questions+to+find+out+how+helpful+they+are.+You+can+ask+other+devs+about+it%2C+but+my+forum+questions+went+unanswered.+You%27ll+have+a+bit+more+luck+if+you+are+more+sociable+than+me+%3AP%0A%0ASponsorships%0ASponsorships+are+an+excellent+choice%2C+if+you+have+a+game+good+enough+to+attract+sponsors.+Just+beware+of+bad%2Fdickish+sponsors.+Be+sure+to+read+SteamBirds+dev%27s+experience+vetting+sponsors+on+FGL+and+check+out+FGL%27s+informative+2009+report.%0A%0ARemember+that%2C+besides+FGL%2C+there%27s+thousands+of+other+sites+that+don%27t+check+FGL+that+will+be+willing+to+sponsor+your+game+with+varying+terms.+Just+shoot+them+an+email+and+ask.+You+can+charge+more+for+one+that+requires+you+to+completely+re-brand+your+game%2C+or+for+an+exclusive+%28or+time-sensitive+exclusive%29+license+to+your+game%2C+or+it+could+be+as+simple+as+putting+in+a+logo+somewhere+and+a+link+or+two.+Ask+around%2C+work+out+a+good+deal+and+see+what+happens.%0A%0AShareware%0AWith+the+advent+of+Adobe+Integrated+Runtime+%28aka+AIR%29+and+tools+like+Sharify%2C+we+can+actually+package+our+games+as+downloadable+apps+that+can+be+played+on+just+about+ANY+platform+%28thanks+to+Flash+Player+10.1%2C+this+includes+Androids+and+holy+shit+TVs%29.+While+Sharify+and+similar+services+can+lock+your+game%2C+you+can+do+that+part+yourself+and+just+use+an+MTX+service+to+handle+the+money+part.%0A%0AAds%0AIf+your+game+is+small+and+shitty+%28like+my+first+one%2C+and+like+the+vast+majority+of+Flash+games%29%2C+ads+are+a+good+option+since+MTX+requires+more+time+and+skill+implement.+I%27ve+heard+a+few+developers+who+have+made+a+good+amount+of+bank+with+ads%2C+but+they+are+few+and+far+in-between.+However%2C+they+do+offer+us+a+quick+and+easy+way+to+earn+%28tiny+amounts+of%29+cash.%0A%0ABut+there+remains+some+pretty+nasty+problems+with+ads%3A%0AClicks+or+impressions+%28whatever+the+ad+provider+does%29+provide+a+microscopic+amount+of+revenue+in+the+first+place.%0AYou+get+little+more+than+half+of+the+revenue+generated+by+the+ads.+%28Most+do+a+60%2F40+split.%29%0AEach+big-name+portal+has+their+own+rules+on+which+ads+you+can+use.%0ARegarding+that+last+one%2C+as+an+example%3A+you+can%27t+show+Mochi+Ads+on+Kongregate%3B+Newgrounds+has+their+own+ad+system%3B+Armor+Games%2C+the+same.+We+have+to+make+a+different+version+of+our+games+for+each+portal.+This%2C+my+friends%2C+is+bullshit.%0A%0AConclusion%0ATo+get+the+most+revenue+from+your+games%2C+you+will+need+to+decide+what+your+business+model+is+before+you+even+write+one+line+of+code.+Banking+on+the+general+goodwill+of+your+audience%3F+Use+Flattr%2C+add+a+PayPal+donations+button%2C+and+maybe+an+ad+for+a+preloader.+Have+a+multiplayer+game%3F+MTX+is+the+way+to+go.+Have+an+amazing+single+player+experience%3F+You%27re+probably+better+off+with+the+shareware+model.+But+in+all+cases%2C+you+should+at+least+ask+around+for+sponsorships%2C+because+the+terms+can+be+so+flexible+with+good+payoff.+Also%2C+don%27t+forget+Twitter%2FFacebook%2Fetc.+share+links%21%0A%0ASo%2C+all+in+all%2C+I%27m+really+happy+to+see+people+taking+Flash+games+seriously+and+throwing+some+genuinely+useful+financial+tools+at+developers.+And+as+always%2C+things+will+keep+changing+and+we%27ll+see+better+ways+to+bake+our+cake+and+eat+it+too.+Good+luck+and+have+fun%21&amp;tags=commerce%2Cgame+industry%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Is content still king? @UntoldEnt</title>
		<link>http://coldconstructs.com/2010/03/is-content-still-king/</link>
		<comments>http://coldconstructs.com/2010/03/is-content-still-king/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 00:33:11 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Discussions]]></category>
		<category><![CDATA[commerce]]></category>
		<category><![CDATA[game industry]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=301</guid>
		<description><![CDATA[Ultimately, content is a banana and we&#8217;re all a bunch of monkeys :: photo by hvhe1 :: Some loud dude (Ryan Creighton of Untold Entertainment fame) recently posted this article, claiming that content is actually &#8220;peasant&#8221; (rather vehemently) and that meta-aggregators (he simply calls them aggregators of aggregators) and advertisers are the ones at the... <a href="http://coldconstructs.com/2010/03/is-content-still-king/">Read More &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><img class="header" src="http://coldconstructs.com/siteFiles/blogImages/monkey_hvhe1.jpg" /><span class="desc">Ultimately, content is a banana and we&#8217;re all a bunch of monkeys :: photo by <a href="http://www.flickr.com/photos/hvhe1/707212944/in/set-72157594337954023/">hvhe1</a> ::</span></p>
<p>Some loud dude (Ryan Creighton of <em>Untold Entertainment</em> fame) recently posted <a href="http://www.untoldentertainment.com/blog/2010/03/30/content-is-peasant/">this article</a>, claiming that content is actually &#8220;peasant&#8221; (rather vehemently) and that meta-aggregators (he simply calls them <em>aggregators of aggregators</em>) and advertisers are the ones at the top of the commerce chain. I&#8217;m going to question that conclusion here.</p>
<p>So. Why would people say content is king in the first place? I think it&#8217;s because advertisers, aggregators, meta-aggregators, and, uhm, salesmen (whom Sir Creighton says are the <em>real </em>kings, which we&#8217;ll simply call the 3 Horsemen&#8211;yes I ignored salesmen) would all be dead without content. That&#8217;s a pretty well-established fact. I mean, Creighton is right in that the 3 Horsemen are essentially clever leeches and content producers rather strong-headed asses, but it&#8217;s telling how he calls content the &#8220;vehicle&#8221;&#8211;<strong>without the vehicle, nobody moves.</strong> So there&#8217;s definitely some meat to the idea that content is, in fact, king because everything else feeds off of it, and it&#8217;s not possible to run it the other way around&#8230; unless you want to advertise <em>ads</em>&#8230; but then the ads would become content by definition.</p>
<p><span id="more-301"></span></p>
<p>Let&#8217;s turn this around by asking this: <em>would content be dead without the 3 Horsemen?</em> The obvious answer is <strong>&#8220;No&#8221;</strong>. There will always be content regardless of whether or not there&#8217;s a way to monetize it. Why? Because humans have a fundemental [sic] need to create. It&#8217;s in our species&#8217; best interest to create&#8211;it&#8217;s how we got to the top of the natural food chain and it&#8217;s how we&#8217;re going to stay there.</p>
<p>The sad news is that, even from King Content&#8217;s perspective, <strong>consumers are still at the bottom of the pile.</strong> For one, it&#8217;s because we will still make things even if nobody pays us to (and that&#8217;s still often the case, just take a look at any indie scene), so it doesn&#8217;t matter if consumers exist at all. However, I hope they&#8217;ll evolve into <em>prosumers</em>; that they actually become more useful in the grand scheme of things than just being &#8220;eyeballs&#8221;. I think we&#8217;re starting to see that trend with crowdsourcing and such&#8211;we just have to build the tools that can compile and analyze the data they create in their everyday lives as patterns. We also need to enable them to make meaningful decisions and connections in the things they do in order to steer content to the whims of the people. That way content producers can stay sharp by navigating the dynamic environment that is social trends and consumers will stay interested and support fresh content. I wanted to get into why we should be socially responsible by making content actually <em>useful </em>to people rather than mere <em>consumables</em> (you are what you eat!), but that&#8217;s a topic for another day.</p>
<p>I don&#8217;t understand why Creighton mentions microtransactions&#8211;which replaces ads quite nicely&#8211;and still insists ads are going to continue to fuel the heist, when they&#8217;re actually on their way out. The ecosystem won&#8217;t die, as he claims, but rather evolve, which is nice. Also, he groups TV networks into the meta-aggregator category, rather erroneously I think. They&#8217;re content producers with direct access to vast distribution channels (actual channels piped to TVs), which makes them a naughty mix of content producer and aggregator. I don&#8217;t think the meta-aggregator category even exists outside of things like feed aggregators like Google Reader as such, but I think that&#8217;s delving into the deep, dark caverns of semantics. So let&#8217;s just slowly step away from that one.</p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=301&amp;md5=a0d3c33c28fc4db8dd6f26495439f8dd" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2010/03/is-content-still-king/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=vonWolfehaus&amp;url=http%3A%2F%2Fcoldconstructs.com%2F2010%2F03%2Fis-content-still-king%2F&amp;language=en_GB&amp;category=text&amp;title=Is+content+still+king%3F+%40UntoldEnt&amp;description=Ultimately%2C+content+is+a+banana+and+we%27re+all+a+bunch+of+monkeys+%3A%3A+photo+by+hvhe1+%3A%3A%0A%0ASome+loud+dude+%28Ryan+Creighton+of+Untold+Entertainment+fame%29+recently+posted+this+article%2C+claiming+that+content+is+actually+%22peasant%22+%28rather+vehemently%29+and+that+meta-aggregators+%28he+simply+calls+them+aggregators+of+aggregators%29+and+advertisers+are+the+ones+at+the+top+of+the+commerce+chain.+I%27m+going+to+question+that+conclusion+here.%0A%0ASo.+Why+would+people+say+content+is+king+in+the+first+place%3F+I+think+it%27s+because+advertisers%2C+aggregators%2C+meta-aggregators%2C+and%2C+uhm%2C+salesmen+%28whom+Sir+Creighton+says+are+the+real+kings%2C+which+we%27ll+simply+call+the+3+Horsemen--yes+I+ignored+salesmen%29+would+all+be+dead+without+content.+That%27s+a+pretty+well-established+fact.+I+mean%2C+Creighton+is+right+in+that+the+3+Horsemen+are+essentially+clever+leeches+and+content+producers+rather+strong-headed+asses%2C+but+it%27s+telling+how+he+calls+content+the+%22vehicle%22--without+the+vehicle%2C+nobody+moves.+So+there%27s+definitely+some+meat+to+the+idea+that+content+is%2C+in+fact%2C+king+because+everything+else+feeds+off+of+it%2C+and+it%27s+not+possible+to+run+it+the+other+way+around...+unless+you+want+to+advertise+ads...+but+then+the+ads+would+become+content+by+definition.%0A%0A%0A%0ALet%27s+turn+this+around+by+asking+this%3A+would+content+be+dead+without+the+3+Horsemen%3F+The+obvious+answer+is+%22No%22.+There+will+always+be+content+regardless+of+whether+or+not+there%27s+a+way+to+monetize+it.+Why%3F+Because+humans+have+a+fundemental+%5Bsic%5D+need+to+create.+It%27s+in+our+species%27+best+interest+to+create--it%27s+how+we+got+to+the+top+of+the+natural+food+chain+and+it%27s+how+we%27re+going+to+stay+there.%0A%0AThe+sad+news+is+that%2C+even+from+King+Content%27s+perspective%2C+consumers+are+still+at+the+bottom+of+the+pile.+For+one%2C+it%27s+because+we+will+still+make+things+even+if+nobody+pays+us+to+%28and+that%27s+still+often+the+case%2C+just+take+a+look+at+any+indie+scene%29%2C+so+it+doesn%27t+matter+if+consumers+exist+at+all.+However%2C+I+hope+they%27ll+evolve+into+prosumers%3B+that+they+actually+become+more+useful+in+the+grand+scheme+of+things+than+just+being+%22eyeballs%22.+I+think+we%27re+starting+to+see+that+trend+with+crowdsourcing+and+such--we+just+have+to+build+the+tools+that+can+compile+and+analyze+the+data+they+create+in+their+everyday+lives+as+patterns.+We+also+need+to+enable+them+to+make+meaningful+decisions+and+connections+in+the+things+they+do+in+order+to+steer+content+to+the+whims+of+the+people.+That+way+content+producers+can+stay+sharp+by+navigating+the+dynamic+environment+that+is+social+trends+and+consumers+will+stay+interested+and+support+fresh+content.+I+wanted+to+get+into+why+we+should+be+socially+responsible+by+making+content+actually+useful+to+people+rather+than+mere+consumables+%28you+are+what+you+eat%21%29%2C+but+that%27s+a+topic+for+another+day.%0A%0AI+don%27t+understand+why+Creighton+mentions+microtransactions--which+replaces+ads+quite+nicely--and+still+insists+ads+are+going+to+continue+to+fuel+the+heist%2C+when+they%27re+actually+on+their+way+out.+The+ecosystem+won%27t+die%2C+as+he+claims%2C+but+rather+evolve%2C+which+is+nice.+Also%2C+he+groups+TV+networks+into+the+meta-aggregator+category%2C+rather+erroneously+I+think.+They%27re+content+producers+with+direct+access+to+vast+distribution+channels+%28actual+channels+piped+to+TVs%29%2C+which+makes+them+a+naughty+mix+of+content+producer+and+aggregator.+I+don%27t+think+the+meta-aggregator+category+even+exists+outside+of+things+like+feed+aggregators+like+Google+Reader+as+such%2C+but+I+think+that%27s+delving+into+the+deep%2C+dark+caverns+of+semantics.+So+let%27s+just+slowly+step+away+from+that+one.&amp;tags=commerce%2Cgame+industry%2Cblog" type="text/html" />
	</item>
		<item>
		<title>The Last Evasion &#8212; released!</title>
		<link>http://coldconstructs.com/2010/02/last-evasion-released/</link>
		<comments>http://coldconstructs.com/2010/02/last-evasion-released/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 11:25:26 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Introductions]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=258</guid>
		<description><![CDATA[Here&#8217;s a game I made for this Newgrounds contest. It&#8217;s an endurance game where you&#8217;re trying to escape some mean aliens in a rocket ship, but you will fail. Please give it a shot though and let me know what you think in the comments (or if you&#8217;re a Newgrounds member, please rate/review it here).... <a href="http://coldconstructs.com/2010/02/last-evasion-released/">Read More &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a game I made for <a href="http://www.newgrounds.com/bbs/topic/1126830">this Newgrounds contest</a>. It&#8217;s an endurance game where you&#8217;re trying to escape some mean aliens in a rocket ship, but you will fail. Please give it a shot though and let me know what you think in the comments (or if you&#8217;re a Newgrounds member, please rate/review it here). Click the image below to open the game in a lightbox.</p>
<p><a href="http://www.newgrounds.com/portal/view/529037" />Play it at Newgrounds.</a></p>
<p>I had been prototyping 4 or 5 game designs over the past several months and during that time I hacked out the core code blocks that eventually made it into TLE. The game itself took me about two weeks of off-on work, with the last few days being pretty intense to meet the deadline. I built it using the Flixel framework.</p>
<p>There is absolutely nothing original about this game. It is not going to win awards, though if I won that contest I would be super-stoked. I mean, you fly a rocket ship and dodge asteroids and alien gunfire. That&#8217;s it. Remember SkiFree for Windows 3.1? It&#8217;s like that, but in space. I didn&#8217;t mean for that to happen, it just did. Coincidently, I hated SkiFree as much as I hate TLE.</p>
<p>NOTE: I am aware of the slowdowns. I upgraded Flixel to the latest version at the last minute due to some unforeseen requirements and it&#8217;s been bad since then. I&#8217;ll look into it when I&#8217;ve had more sleep.</p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=258&amp;md5=9009984da3a6cac973d4c07fba5f4b99" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2010/02/last-evasion-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="" type="text/html" />
	</item>
		<item>
		<title>Pixel-perfect collision detection with 5000+ particles</title>
		<link>http://coldconstructs.com/2009/11/pixel-perfect-collision-detection-with-5000-particles/</link>
		<comments>http://coldconstructs.com/2009/11/pixel-perfect-collision-detection-with-5000-particles/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 19:39:49 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[collision detection]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[particles]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=172</guid>
		<description><![CDATA[UPDATE: This post is here for historical purposes. The SWF has been moved to a new location. And yes, it runs perfectly fine. I&#8217;ve run it at 60+ FPS with 7,000 particles, but that actually isn&#8217;t the limitation (unless your particles are crunching heavy math for eg movement). Rather it&#8217;s the size and number of... <a href="http://coldconstructs.com/2009/11/pixel-perfect-collision-detection-with-5000-particles/">Read More &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>UPDATE: This post is here for historical purposes. The SWF has been moved to <a href="http://coldconstructs.com/?interactives=particle-collision-detection">a new location</a>.</p>
<p>And yes, it runs perfectly fine. I&#8217;ve run it at 60+ FPS with 7,000 particles, but that actually isn&#8217;t the limitation (unless your particles are crunching heavy math for eg movement). Rather it&#8217;s the size and number of sprites that we&#8217;re colliding with the particles.</p>
<p><img src="http://labs.coldconstructs.com/i/vonlocalcd.jpg" alt="vonLocal Collision Detection" class="centered" /></p>
<p>To squeeze all the juice out of Flash I employed a couple tricks. <strong>The first</strong> was the particles themselves&#8211;they&#8217;re blitted to a single bitmap which is used as the source image for grabbing collision data from. The particles are also drawn with the raster engine in Flash (multiple <code>setPixel32()</code> ops to give the illusion of a line&#8230; a choppy one anyway) instead of the vector renderer (<code>lineTo()</code>). <strong>The second trick</strong> was to only grab a Vector of pixels from the regions we cared about (within sprite boundaries) every so often, then to loop through the Vector and test it against our desired conditions. Also, since the particle bitmap is more sparse than our sprites as far as opaque pixels go, we test the particle bitmap first, resulting in a lot fewer passes on the first round of conditional statements.</p>
<p><span id="more-172"></span></p>
<p>So my poor man&#8217;s method of making lines is done by interpolating the position of a particle from the previous to the current frame, for a total of 3 <code>setPixel32()</code> operations per iteration. (We can use <code>setPixel()</code> for a solid performance gain, but at a different kind of cost that I&#8217;ll explain later.) To give the particles a long tail we simply decrease the alpha of the particle bitmap a little bit every frame, making older particles fade more as time goes by. This means we can skip <code>fillRect()</code> to clear the bitmap every frame, but I&#8217;m wondering if that&#8217;s faster or slower than <code>ColorTransform</code>. Haven&#8217;t tested, for shame.</p>
<p>I&#8217;ll admit that I haven&#8217;t tried this method with bitmap-based particles but those would work just as well, in theory (using blitted rendering). One of my current projects demands those trailing things so I didn&#8217;t look into it. If you try it, please comment on this post below with your findings <img src="http://coldconstructs.com/random/pint.gif"></img></p>
<p><code class="block">particleMap.lock();<br />
for (i = 0; i < _numParticles; ++i) {<br />
&nbsp;&nbsp;p = particles[i];<br />
&nbsp;&nbsp;// get our velocity from the perlin noise map<br />
&nbsp;&nbsp;vel = noiseMap.getPixel(p.x>>3, p.y>>3); // because noiseMap is 1/9 the size of particleMap<br />
&nbsp;&nbsp;var brightness:Number = vel / 0xFFFFFF;<br />
&nbsp;&nbsp;var speed:Number = 0.1 + brightness * p.speed;<br />
&nbsp;&nbsp;var angle:Number = 360 * (brightness * p.wander) * 0.0175; // roughly PI / 180 to convert to radians<br />
&nbsp;&nbsp;p.vx = Math.cos(angle) * speed;<br />
&nbsp;&nbsp;p.vy = Math.sin(angle) * speed;<br />
&nbsp;&nbsp;// absolute value for velocity calculations<br />
&nbsp;&nbsp;var pvx:Number = p.vx < 0 ? -p.vx : p.vx; // use bitwise sign flippage<br />
&nbsp;&nbsp;var pvy:Number = p.vy < 0 ? -p.vy : p.vy;<br />
&nbsp;&nbsp;// poor man's lineTo ENGAGED<br />
&nbsp;&nbsp;var nx:Number = p.x + (p.vx >> 1); // where we are now + half the distance to where we will be<br />
&nbsp;&nbsp;var ny:Number = p.y + (p.vy >> 1);<br />
&nbsp;&nbsp;var mx:Number = nx - p.x; // then half THAT distance for a third position...<br />
&nbsp;&nbsp;var my:Number = ny - p.y;<br />
&nbsp;&nbsp;// actually apply velocity to pixel<br />
&nbsp;&nbsp;p.x += p.vx;<br />
&nbsp;&nbsp;p.y += p.vy;<br />
&nbsp;&nbsp;// bounds-check<br />
&nbsp;&nbsp;if (p.y < 0) p.y = h - 1;<br />
&nbsp;&nbsp;else if (p.y > h) p.y = 1;<br />
&nbsp;&nbsp;if (p.x < 0) p.x = w - 1;<br />
&nbsp;&nbsp;else if (p.x > w) p.x = 1;<br />
&nbsp;&nbsp;// pick our color based on speed<br />
&nbsp;&nbsp;speed *= 60;<br />
&nbsp;&nbsp;if (speed > 255) speed = 255;<br />
&nbsp;&nbsp;color = 255 << 24 | speed << 16 | speed << 8 | speed;<br />
&nbsp;&nbsp;// render the particle three times, each in different places to get a line-ish thing going<br />
&nbsp;&nbsp;particleMap.setPixel32(p.x, p.y, color);<br />
&nbsp;&nbsp;particleMap.setPixel32(mx, my, color);<br />
&nbsp;&nbsp;particleMap.setPixel32(nx, ny, color);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;// and we're done. release the pixels!<br />
&nbsp;&nbsp;particleMap.unlock(_r);</code></p>
<p>So that gives us some spotty-but-close-enough trails to help with our collision detection. It works like this: We create a single bitmap to use as a canvas for our particles. We render those particles using <code>setPixel32()</code> as mentioned above. <strong>Sprites will use this bitmap as a source for collision data.</strong> Every other frame or so (more on this later) the sprites will grab a section of pixels from the particle bitmap using something like <code>getVector()</code> (>= Flash 10) or <code>getPixels()</code> (< Flash 10), using their own position and dimensions for the <code>sourceRect</code> parameter.</p>
<p><code class="block">shipVec = buffer.getVector(_rc); // get an array of pixels from the whole sprite<br />
_rc.x = int(this.x); // change rect to particleBMD's coordinate space<br />
_rc.y = int(this.y);<br />
pixVec = _particlebmd.getVector(_rc); // grab an array of the same area of pixels that our sprite is occupying<br />
var a:uint;<br />
var i:int = 0;<br />
buffer.lock();<br />
for (i; i < _l; ++i) {<br />
&nbsp;&nbsp;_pval = pixVec[int(i)]; // first look at the particle's image for opaque pixels<br />
&nbsp;&nbsp;a = _pval >> 24;<br />
&nbsp;&nbsp;if (a < 100) continue;<br />
&nbsp;&nbsp;// it found an opaque-ish pixel, so let's see if there's an opaque pixel in the ship there too<br />
&nbsp;&nbsp;_sval = shipVec[int(i)];<br />
&nbsp;&nbsp;a = _sval >> 24;<br />
&nbsp;&nbsp;if (a < 100) continue;<br />
&nbsp;&nbsp;/* if we get this far then we have a collision because one<br />
&nbsp;&nbsp;&nbsp;&nbsp;* of the ship's pixels is overlapping a particle's pixel.<br />
&nbsp;&nbsp;&nbsp;&nbsp;* we're only going to collide with red-colored particles though */<br />
&nbsp;&nbsp;_pval = _pval >> 16 &#038; 0xFF; // red channel extraction<br />
&nbsp;&nbsp;if (_pval > 100) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;var px:int = int(i % w); // translate 1d array coordinate to 2d grid coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;var py:int = int(i / h);<br />
&nbsp;&nbsp;&nbsp;&nbsp;buffer.setPixel32(px,py,0xFF4e88c9); // colliding pixels are painted on the top of our sprite in a cold blue-ish color<br />
&nbsp;&nbsp;}<br />
}<br />
buffer.unlock();</code></p>
<p>As you can see on line 133 and 136, each sprite has a block of pixels ready to examine on each tick. The sprite loops through that block and compares every pixel of its own with the pixels in the Vector it got. If there's a match (eg both pixels are opaque) then look at the particle's pixel in detail to see if it's the <del datetime="2009-10-10T20:40:55+00:00">droid</del> one we're looking for and record its findings. </p>
<p>So you can alter line 151 so that the sprites check for specific colors in the particle bitmap, like anything brighter than dark grey (which I did here, or anything with an alpha greater than <code>0.1</code> or... use your imagination I guess?).</p>
<p>Because grabbing a new Vector from the particle bitmap can be so expensive (depending on the size of the sprite), you can time limit the collection so it only samples the particle bitmap once in a short while. In the demo SWF above I sample it once every 100 milliseconds or so, which comes out to about 24 samples a second (given 25 milliseconds per frame at 60 FPS)... as opposed to 2400 samples a second. The casual human eye can't tell the difference but it yields a significant increase in performance. Most performance tricks I've learned are based are smoke and mirror stuff like this.</p>
<p>You can use <code>setPixel()</code> (no alpha) but you'll <em>have</em> to test for color--obviously for a color that isn't what the background of the particle bitmap is, so it's a little more tricky. It's also totally possible to use other sprites as particles as long as you blit them (using <code>copyPixels()</code> or <code>setVector()</code>) to a single bitmap that can be checked by other sprites that collide with them. If you don't know what blitting is, 8bitRocket <a href="http://www.8bitrocket.com/newsdisplay.aspx?newspage=13430">has a good rundown</a> (it's where I first learned about it actually).</p>
<p>And that's pretty much it. You can download the example files/source below.</p>
<p><a title="download source" href="http://labs.coldconstructs.com/e/vonLocalCD.zip"><img class="centered" src="http://coldconstructs.com/siteFiles/download_button.png" alt="download source" /></a></p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=172&amp;md5=d882953187532fd2fba4e97e6a3bc125" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2009/11/pixel-perfect-collision-detection-with-5000-particles/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=vonWolfehaus&amp;url=http%3A%2F%2Fcoldconstructs.com%2F2009%2F11%2Fpixel-perfect-collision-detection-with-5000-particles%2F&amp;language=en_GB&amp;category=software&amp;title=Pixel-perfect+collision+detection+with+5000%2B+particles&amp;description=UPDATE%3A+This+post+is+here+for+historical+purposes.+The+SWF+has+been+moved+to+a+new+location.%0D%0A%0D%0AAnd+yes%2C+it+runs+perfectly+fine.+I%27ve+run+it+at+60%2B+FPS+with+7%2C000+particles%2C+but+that+actually+isn%27t+the+limitation+%28unless+your+particles+are+crunching+heavy+math+for+eg+movement%29.+Rather+it%27s+the+size+and+number+of+sprites+that+we%27re+colliding+with+the+particles.%0D%0A%0D%0A%0D%0A%0D%0ATo+squeeze+all+the+juice+out+of+Flash+I+employed+a+couple+tricks.+The+first+was+the+particles+themselves--they%27re+blitted+to+a+single+bitmap+which+is+used+as+the+source+image+for+grabbing+collision+data+from.+The+particles+are+also+drawn+with+the+raster+engine+in+Flash+%28multiple+setPixel32%28%29+ops+to+give+the+illusion+of+a+line...+a+choppy+one+anyway%29+instead+of+the+vector+renderer+%28lineTo%28%29%29.+The+second+trick+was+to+only+grab+a+Vector+of+pixels+from+the+regions+we+cared+about+%28within+sprite+boundaries%29+every+so+often%2C+then+to+loop+through+the+Vector+and+test+it+against+our+desired+conditions.+Also%2C+since+the+particle+bitmap+is+more+sparse+than+our+sprites+as+far+as+opaque+pixels+go%2C+we+test+the+particle+bitmap+first%2C+resulting+in+a+lot+fewer+passes+on+the+first+round+of+conditional+statements.%0D%0A%0D%0A%0D%0A%0D%0ASo+my+poor+man%27s+method+of+making+lines+is+done+by+interpolating+the+position+of+a+particle+from+the+previous+to+the+current+frame%2C+for+a+total+of+3+setPixel32%28%29+operations+per+iteration.+%28We+can+use+setPixel%28%29+for+a+solid+performance+gain%2C+but+at+a+different+kind+of+cost+that+I%27ll+explain+later.%29+To+give+the+particles+a+long+tail+we+simply+decrease+the+alpha+of+the+particle+bitmap+a+little+bit+every+frame%2C+making+older+particles+fade+more+as+time+goes+by.+This+means+we+can+skip+fillRect%28%29+to+clear+the+bitmap+every+frame%2C+but+I%27m+wondering+if+that%27s+faster+or+slower+than+ColorTransform.+Haven%27t+tested%2C+for+shame.%0D%0A%0D%0AI%27ll+admit+that+I+haven%27t+tried+this+method+with+bitmap-based+particles+but+those+would+work+just+as+well%2C+in+theory+%28using+blitted+rendering%29.+One+of+my+current+projects+demands+those+trailing+things+so+I+didn%27t+look+into+it.+If+you+try+it%2C+please+comment+on+this+post+below+with+your+findings+%0D%0A%0D%0AparticleMap.lock%28%29%3B%0D%0Afor+%28i+%3D+0%3B+i+%3C+_numParticles%3B+%2B%2Bi%29+%7B%0D%0A%26nbsp%3B%26nbsp%3Bp+%3D+particles%5Bi%5D%3B%0D%0A%26nbsp%3B%26nbsp%3B%2F%2F+get+our+velocity+from+the+perlin+noise+map%0D%0A%26nbsp%3B%26nbsp%3Bvel+%3D+noiseMap.getPixel%28p.x%3E%3E3%2C+p.y%3E%3E3%29%3B+%2F%2F+because+noiseMap+is+1%2F9+the+size+of+particleMap%0D%0A%26nbsp%3B%26nbsp%3Bvar+brightness%3ANumber+%3D+vel+%2F+0xFFFFFF%3B%0D%0A%26nbsp%3B%26nbsp%3Bvar+speed%3ANumber+%3D+0.1+%2B+brightness+%2A+p.speed%3B%0D%0A%26nbsp%3B%26nbsp%3Bvar+angle%3ANumber+%3D+360+%2A+%28brightness+%2A+p.wander%29+%2A+0.0175%3B+%2F%2F+roughly+PI+%2F+180+to+convert+to+radians%0D%0A%26nbsp%3B%26nbsp%3Bp.vx+%3D+Math.cos%28angle%29+%2A+speed%3B%0D%0A%26nbsp%3B%26nbsp%3Bp.vy+%3D+Math.sin%28angle%29+%2A+speed%3B%0D%0A%26nbsp%3B%26nbsp%3B%2F%2F+absolute+value+for+velocity+calculations%0D%0A%26nbsp%3B%26nbsp%3Bvar+pvx%3ANumber+%3D+p.vx+%3C+0+%3F+-p.vx+%3A+p.vx%3B+%2F%2F+use+bitwise+sign+flippage%0D%0A%26nbsp%3B%26nbsp%3Bvar+pvy%3ANumber+%3D+p.vy+%3C+0+%3F+-p.vy+%3A+p.vy%3B%0D%0A%26nbsp%3B%26nbsp%3B%2F%2F+poor+man%27s+lineTo+ENGAGED%0D%0A%26nbsp%3B%26nbsp%3Bvar+nx%3ANumber+%3D+p.x+%2B+%28p.vx+%3E%3E+1%29%3B+%2F%2F+where+we+are+now+%2B+half+the+distance+to+where+we+will+be%0D%0A%26nbsp%3B%26nbsp%3Bvar+ny%3ANumber+%3D+p.y+%2B+%28p.vy+%3E%3E+1%29%3B%0D%0A%26nbsp%3B%26nbsp%3Bvar+mx%3ANumber+%3D+nx+-+p.x%3B+%2F%2F+then+half+THAT+distance+for+a+third+position...%0D%0A%26nbsp%3B%26nbsp%3Bvar+my%3ANumber+%3D+ny+-+p.y%3B%0D%0A%26nbsp%3B%26nbsp%3B%2F%2F+actually+apply+velocity+to+pixel%0D%0A%26nbsp%3B%26nbsp%3Bp.x+%2B%3D+p.vx%3B%0D%0A%26nbsp%3B%26nbsp%3Bp.y+%2B%3D+p.vy%3B%0D%0A%26nbsp%3B%26nbsp%3B%2F%2F+bounds-check%0D%0A%26nbsp%3B%26nbsp%3Bif+%28p.y+%3C+0%29+p.y+%3D+h+-+1%3B%0D%0A%26nbsp%3B%26nbsp%3Belse+if+%28p.y+%3E+h%29+p.y+%3D+1%3B%0D%0A%26nbsp%3B%26nbsp%3Bif+%28p.x+%3C+0%29+p.x+%3D+w+-+1%3B%0D%0A%26nbsp%3B%26nbsp%3Belse+if+%28p.x+%3E+w%29+p.x+%3D+1%3B%0D%0A%26nbsp%3B%26nbsp%3B%2F%2F+pick+our+color+based+on+speed%0D%0A%26nbsp%3B%26nbsp%3Bspeed+%2A%3D+60%3B%0D%0A%26nbsp%3B%26nbsp%3Bif+%28speed+%3E+255%29+speed+%3D+255%3B%0D%0A%26nbsp%3B%26nbsp%3Bcolor+%3D+255+%3E+16+%26+0xFF%3B+%2F%2F+red+channel+extraction%0D%0A%26nbsp%3B%26nbsp%3Bif+%28_pval+%3E+100%29+%7B%0D%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bvar+px%3Aint+%3D+int%28i+%25+w%29%3B+%2F%2F+translate+1d+array+coordinate+to+2d+grid+coordinates%0D%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bvar+py%3Aint+%3D+int%28i+%2F+h%29%3B%0D%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bbuffer.setPixel32%28px%2Cpy%2C0xFF4e88c9%29%3B+%2F%2F+colliding+pixels+are+painted+on+the+top+of+our+sprite+in+a+cold+blue-ish+color%0D%0A%26nbsp%3B%26nbsp%3B%7D%0D%0A%7D%0D%0Abuffer.unlock%28%29%3B%0D%0A%0D%0AAs+you+can+see+on+line+133+and+136%2C+each+sprite+has+a+block+of+pixels+ready+to+examine+on+each+tick.+The+sprite+loops+through+that+block+and+compares+every+pixel+of+its+own+with+the+pixels+in+the+Vector+it+got.+If+there%27s+a+match+%28eg+both+pixels+are+opaque%29+then+look+at+the+particle%27s+pixel+in+detail+to+see+if+it%27s+the+droid+one+we%27re+looking+for+and+record+its+findings.+%0D%0A%0D%0ASo+you+can+alter+line+151+so+that+the+sprites+check+for+specific+colors+in+the+particle+bitmap%2C+like+anything+brighter+than+dark+grey+%28which+I+did+here%2C+or+anything+with+an+alpha+greater+than+0.1+or...+use+your+imagination+I+guess%3F%29.%0D%0A%0D%0ABecause+grabbing+a+new+Vector+from+the+particle+bitmap+can+be+so+expensive+%28depending+on+the+size+of+the+sprite%29%2C+you+can+time+limit+the+collection+so+it+only+samples+the+particle+bitmap+once+in+a+short+while.+In+the+demo+SWF+above+I+sample+it+once+every+100+milliseconds+or+so%2C+which+comes+out+to+about+24+samples+a+second+%28given+25+milliseconds+per+frame+at+60+FPS%29...+as+opposed+to+2400+samples+a+second.+The+casual+human+eye+can%27t+tell+the+difference+but+it+yields+a+significant+increase+in+performance.+Most+performance+tricks+I%27ve+learned+are+based+are+smoke+and+mirror+stuff+like+this.%0D%0A%0D%0AYou+can+use+setPixel%28%29+%28no+alpha%29+but+you%27ll+have+to+test+for+color--obviously+for+a+color+that+isn%27t+what+the+background+of+the+particle+bitmap+is%2C+so+it%27s+a+little+more+tricky.+It%27s+also+totally+possible+to+use+other+sprites+as+particles+as+long+as+you+blit+them+%28using+copyPixels%28%29+or+setVector%28%29%29+to+a+single+bitmap+that+can+be+checked+by+other+sprites+that+collide+with+them.+If+you+don%27t+know+what+blitting+is%2C+8bitRocket+has+a+good+rundown+%28it%27s+where+I+first+learned+about+it+actually%29.%0D%0A%0D%0AAnd+that%27s+pretty+much+it.+You+can+download+the+example+files%2Fsource+below.%0D%0A%0D%0A&amp;tags=ActionScript+3%2Ccollision+detection%2CFlash%2Cparticles%2Csource%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Beware the rounding error (or &#8220;Avoiding Out of Range errors&#8221;)</title>
		<link>http://coldconstructs.com/2009/10/beware-the-rounding-error/</link>
		<comments>http://coldconstructs.com/2009/10/beware-the-rounding-error/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 20:00:35 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ActionScript 3]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=223</guid>
		<description><![CDATA[When iterating through an array that was generated by some built-in function (such as getVector()), check to make sure you&#8217;re rounding the input first. If you get an &#8220;out of range&#8221; error but your code is fucking perfect, then it&#8217;s probably because the rectangle used as input by getVector is skipping a row of pixels... <a href="http://coldconstructs.com/2009/10/beware-the-rounding-error/">Read More &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>When iterating through an array that was generated by some built-in function (such as <code>getVector()</code>), check to make sure you&#8217;re rounding the input first. If you get an &#8220;out of range&#8221; error but your code is fucking perfect, then it&#8217;s probably because the rectangle used as input by <code>getVector</code> is skipping a row of pixels because the x,y of said rectangle is being rounded UP. For example, <code>12.51</code> becomes <code>13</code> but since the rectangle is limited by certain dimensions it simply (stupidly, moronically, fucking ridiculously) truncates the dimensions by one row or column. So when it turns the pixel data into a 1D array it&#8217;s missing a whole chunk of data which causes your pre-computed (with the correct dimensions) array length to be <em>too high</em>&#8230; hence the iterator will hit a number outside the array&#8217;s range.</p>
<p>Judging by the number of results Google returns, this is a pretty fringe case (that or I&#8217;m exceptionally stupid&#8230; hush). Regardless, it&#8217;s a problem that has been plaguing me for the past few months. If it weren&#8217;t for my genius programmery brother I would have never found it either. But thanks to him I&#8217;m now savvy to what&#8217;s termed as &#8220;rounding errors&#8221;. They even <em>sound</em> evil.</p>
<p>Here&#8217;s an example with code&#8230;<br />
<span id="more-223"></span><br />
Below we define our dimensions grabbed from pixels (raw <code>bitmapData</code> from some loaded file elsewhere). We just want to analyze a quarter of the image, hence we&#8217;re dividing both dimensions by 2. We also instantiate the array (a fixed-length <code>Vector</code>) we&#8217;ll be iterating through:</p>
<p><code class="block">var w:int = pixels.width / 2;<br />
var h:int = pixels.height / 2;<br />
var _l:int = w * h;<br />
var _rc:Rectangle = new Rectangle(0, 0, w, h);<br />
array = new Vector.<uint>(_l, true);</code></p>
<p>Awesome. Now somewhere else in the code (say, an update method) we want to assign a chunk of pixel data to the array so we can pick through them one by one:</p>
<p><code class="block">_rc.x = pixels.x;<br />
_rc.y = pixels.y;<br />
array = pixels.getVector(_rc);<br />
for (i; i < _l; ++i) {<br />
&nbsp;&nbsp;_pixel = array[i];<br />
&nbsp;&nbsp;var alpha:uint = _pixel >> 24;<br />
}</code></p>
<p>Alright, looks mighty fine. We&#8217;re just checkin&#8217; out the alpha value in those pixels, you know whatever. BUT WAIT. While we&#8217;re running this code, the values for <code> pixels.x</code> and <code> pixels.y</code> are changing because our source image is moving around the stage. And guess what? Without pixel snapping on, we&#8217;re getting floating point values for those coordinates <strong>even though they&#8217;re typed as <code>int</code>s</strong>. This wouldn&#8217;t normally be a problem but since we&#8217;re extracting other pixel data using those values, they need to be floored or else we&#8217;ll get the rounding error I discussed above.</p>
<p>So to fix this bitch we simply change lines 6 and 7 to:</p>
<p><code class="block">_rc.x = int(pixels.x);<br />
_rc.y = int(pixels.y);</code></p>
<p>&#8230;and viola, no more error. (I used <code>int()</code> instead of <code>Math.floor()</code> because it&#8217;s hella faster). So I hope that helped someone out there because I sure as hell needed it <img src='http://coldconstructs.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Good luck and have fun.</p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=223&amp;md5=c996a6492e38365c6737bcfc63fb5d10" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2009/10/beware-the-rounding-error/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=vonWolfehaus&amp;url=http%3A%2F%2Fcoldconstructs.com%2F2009%2F10%2Fbeware-the-rounding-error%2F&amp;language=en_GB&amp;category=text&amp;title=Beware+the+rounding+error+%28or+%26%238220%3BAvoiding+Out+of+Range+errors%26%238221%3B%29&amp;description=When+iterating+through+an+array+that+was+generated+by+some+built-in+function+%28such+as+getVector%28%29%29%2C+check+to+make+sure+you%27re+rounding+the+input+first.+If+you+get+an+%22out+of+range%22+error+but+your+code+is+fucking+perfect%2C+then+it%27s+probably+because+the+rectangle+used+as+input+by+getVector+is+skipping+a+row+of+pixels+because+the+x%2Cy+of+said+rectangle+is+being+rounded+UP.+For+example%2C+12.51+becomes+13+but+since+the+rectangle+is+limited+by+certain+dimensions+it+simply+%28stupidly%2C+moronically%2C+fucking+ridiculously%29+truncates+the+dimensions+by+one+row+or+column.+So+when+it+turns+the+pixel+data+into+a+1D+array+it%27s+missing+a+whole+chunk+of+data+which+causes+your+pre-computed+%28with+the+correct+dimensions%29+array+length+to+be+too+high...+hence+the+iterator+will+hit+a+number+outside+the+array%27s+range.%0D%0A%0D%0AJudging+by+the+number+of+results+Google+returns%2C+this+is+a+pretty+fringe+case+%28that+or+I%27m+exceptionally+stupid...+hush%29.+Regardless%2C+it%27s+a+problem+that+has+been+plaguing+me+for+the+past+few+months.+If+it+weren%27t+for+my+genius+programmery+brother+I+would+have+never+found+it+either.+But+thanks+to+him+I%27m+now+savvy+to+what%27s+termed+as+%22rounding+errors%22.+They+even+sound+evil.%0D%0A%0D%0AHere%27s+an+example+with+code...%0D%0A%0D%0ABelow+we+define+our+dimensions+grabbed+from+pixels+%28raw+bitmapData+from+some+loaded+file+elsewhere%29.+We+just+want+to+analyze+a+quarter+of+the+image%2C+hence+we%27re+dividing+both+dimensions+by+2.+We+also+instantiate+the+array+%28a+fixed-length+Vector%29+we%27ll+be+iterating+through%3A%0D%0A%0D%0Avar+w%3Aint+%3D+pixels.width+%2F+2%3B%0D%0Avar+h%3Aint+%3D+pixels.height+%2F+2%3B%0D%0Avar+_l%3Aint+%3D+w+%2A+h%3B%0D%0Avar+_rc%3ARectangle+%3D+new+Rectangle%280%2C+0%2C+w%2C+h%29%3B%0D%0Aarray+%3D+new+Vector.%28_l%2C+true%29%3B%0D%0A%0D%0AAwesome.+Now+somewhere+else+in+the+code+%28say%2C+an+update+method%29+we+want+to+assign+a+chunk+of+pixel+data+to+the+array+so+we+can+pick+through+them+one+by+one%3A%0D%0A%0D%0A_rc.x+%3D+pixels.x%3B%0D%0A_rc.y+%3D+pixels.y%3B%0D%0Aarray+%3D+pixels.getVector%28_rc%29%3B%0D%0Afor+%28i%3B+i+%3C+_l%3B+%2B%2Bi%29+%7B%0D%0A%26nbsp%3B%26nbsp%3B_pixel+%3D+array%5Bi%5D%3B%0D%0A%26nbsp%3B%26nbsp%3Bvar+alpha%3Auint+%3D+_pixel+%3E%3E+24%3B%0D%0A%7D%0D%0A%0D%0AAlright%2C+looks+mighty+fine.+We%27re+just+checkin%27+out+the+alpha+value+in+those+pixels%2C+you+know+whatever.+BUT+WAIT.+While+we%27re+running+this+code%2C+the+values+for++pixels.x+and++pixels.y+are+changing+because+our+source+image+is+moving+around+the+stage.+And+guess+what%3F+Without+pixel+snapping+on%2C+we%27re+getting+floating+point+values+for+those+coordinates+even+though+they%27re+typed+as+ints.+This+wouldn%27t+normally+be+a+problem+but+since+we%27re+extracting+other+pixel+data+using+those+values%2C+they+need+to+be+floored+or+else+we%27ll+get+the+rounding+error+I+discussed+above.%0D%0A%0D%0ASo+to+fix+this+bitch+we+simply+change+lines+6+and+7+to%3A%0D%0A%0D%0A_rc.x+%3D+int%28pixels.x%29%3B%0D%0A_rc.y+%3D+int%28pixels.y%29%3B%0D%0A%0D%0A...and+viola%2C+no+more+error.+%28I+used+int%28%29+instead+of+Math.floor%28%29+because+it%27s+hella+faster%29.+So+I+hope+that+helped+someone+out+there+because+I+sure+as+hell+needed+it+%3A%28+Good+luck+and+have+fun.&amp;tags=ActionScript+3%2Cblog" type="text/html" />
	</item>
		<item>
		<title>AS3 to Pixel Bender guide</title>
		<link>http://coldconstructs.com/2009/10/pixel-bender-gap-guide/</link>
		<comments>http://coldconstructs.com/2009/10/pixel-bender-gap-guide/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 22:00:23 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Discussions]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Pixel Bender]]></category>

		<guid isPermaLink="false">http://coldconstructs.com/?p=134</guid>
		<description><![CDATA[When I set out to write a very simple Pixel Bender (PB) kernel/script thingy, I expected it to be relatively straight-forward, mostly because Adobe has been so good writing quality documentation for its products and/or there is a wealth of info on their products produced by their users. Unfortunately I didn&#8217;t find the dev guide... <a href="http://coldconstructs.com/2009/10/pixel-bender-gap-guide/">Read More &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><!--TOC-->When I set out to write a very simple Pixel Bender (<em>PB</em>) kernel/script thingy, I expected it to be relatively straight-forward, mostly because Adobe has been so good writing quality documentation for its products and/or there is a wealth of info on their products produced by their users. Unfortunately I didn&#8217;t find the dev guide in the Help menu and I missed some key AS3 bits from the links I&#8217;ll post below, but even so I still had a lot of trouble finding some info that really should already have been out on the interwebs. So this post is to fill in the gaps when going from AS3 to Pixel Bender.<br />
Hope it helps <img src="http://coldconstructs.com/random/pint.gif"></p>
<h4>Best resources for beginners</h4>
<p>Here&#8217;s the best tutorials and explanations I&#8217;ve found so far:</p>
<ul>
<li><a href="http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS3E659D01-10C0-479d-8175-B40950BBC223.html">The official guide</a> and <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/index.html">reference</a>. Slap that F1 key! Also, don&#8217;t forget the Help menu in the toolkit like I did (there&#8217;s the PB-specific language spec and dev guide there).</li>
<li><a href="http://www.flashmagazine.com/tutorials/detail/using_pixel_bender_to_calculate_information/">Using PB as a calculator</a>. Completes the official tutorial.</li>
<li><a href="http://www.kaourantin.net/2008/05/adobe-pixel-bender-in-flash-player-10.html">Great in-depth article</a> with general+performance tips.</li>
<li>Very <a href="http://blog.gamingyourway.com/default.aspx">straight-forward examples</a> + comedy. Can&#8217;t go wrong there.</li>
<li><a href="http://www.derschmale.com/2009/07/23/some-flash-pixel-bender-performance-tips-benchmarks/">Nice user article</a> on optimizations and some speed tests (turns out, for input <code>bitmapData</code> beats <code>ByteArray </code>beats <code>Vector.<T></code>)</li>
</ul>
<h4>Syntax overview</h4>
<p>As a casual programmer of high-level languages and no mid- to low-level ones, I was thrown off by PB&#8217;s awkward syntax. It&#8217;s strongly typed, which is fine, except I&#8217;m not familiar with low-level languages like C or any previous shader language (PB is based on GLSL from what I hear). Here&#8217;s a basic difference:</p>
<blockquote><p>AS3: <code>var i:Number = 12;</code><br />
&#8230;in PB is: <code>float i = 12.0;</code><br />
The decimal in <code>12.0</code> tells PB it&#8217;s a floating point number. If it was just <code>12</code> PB would think it&#8217;s an <code>int</code>.</p></blockquote>
<p>When dealing with &#8220;vectors&#8221; (which are arrays, as in Flash 10&#8242;s odd use of the word &#8220;vector&#8221;) it&#8217;s <code>float2 i = float2(12.0, 2.0)</code>. Notice there&#8217;s no brackets or anything suggesting any type of array present. It&#8217;s simply the type + how big the array is, eg <code>float3</code>. It goes up to 4, for the 4 channels in images: Red, Green, Blue, Alpha). Then, as you can see, intializing the array is a simple matter of putting in the numbers you said would be there. So <code>float4(1.0, 24.2, 0.1, 3.4)</code> is valid whereas <code>float2(1.0, 24.2, 2)</code> is not, because there&#8217;s an extra number in there and it&#8217;s an <code>int</code> (adding insult to injury).</p>
<p><span id="more-134"></span></p>
<p>An important thing to keep in mind is that Pixel Bender sees channels in the order described above (RGBA). This little detail cost me a bit of time because I&#8217;m used to AS3&#8242;s order of ARGB&#8211;the alpha channel is first in AS3 while it&#8217;s <em>last</em> in PB.</p>
<p>To use any of the built-in functions you simply call them as they appear in the reference doc: <code>all(x); atan(x,y);</code> etc., no <code>Math</code> calls like we have to do in Flash (this through me for a loop, lemme tell ya).</p>
<p>For those of you who use the shortcut operations like <code>var i:int = foo < bar ? foo : bar;</code>, then you'll be pleased to hear they're supported in PB too. Just about the only thing "Hydra" (formally the codename for Pixel Bender, now--I guess--the name of the PB Flash implementation) does not support is loops of any kind<strong> and their related break/continue statements</strong>. That last bit is bad because there are times when I want to stop the filter if a certain condition is met. You just have to design your logic to take this into account from the start.</p>
<p>That's the basics but take special note that <code>shader.data</code> is actually an array, so you can do some naughty stuff like iterate through some kinky data and set the input as <code>shader.data['whatever'+i].input = kinky[i]</code>. Also note that in order to set the input for a shader in AS3 you <strong>must</strong> set it to <code>shader.data.vdipb.INPUT = inputImage</code> where <code>vdipb</code> is the variable name you declared in the PB shader itself.</p>
<h4>More performance tips</h4>
<p>Turns out that after I converted my kernel from using boolean methods (like <code>boolean4()</code> etc.) to <code>if</code> statements, it consistently executed faster. I also got some fractional FPS increases by using the age-old optimization of putting real values (eg 1.2) in the evaluation statement instead of references (eg pixel.r). See the last blog I linked above for some other obvious and not-so-obvious performance tips.</p>
<p>PB math is much faster than straight AS3 math but it's slightly brighter (I wouldn't say it <em>shines</em> per se...) when it runs in asynchronous mode, which is enabled by using <code>ShaderJob</code>. You use <code>addEventListener(Event:ShaderEvent...)</code> and then run <code>start(false</code>) to put it in asynchronous mode (the param is <code>waitForCompletion</code> and it's already <code>false</code> by default). See <a href="http://www.boostworthy.com/blog/?p=243">Ryan's post</a> for a great example of how the <code>ShaderJob</code> has to be setup (<a href="http://blog.gamingyourway.com/default.aspx">Squize's post</a>, linked above, is an even clearer example).</p>
<h4>Realtime use of Pixel Bender</h4>
<h5>Asynchronous mode</h5>
<p>Reading the above linked performance tips for PB you, like me, might be thinking "OH MAN I can rule the universe with ShaderJob doing bitchwork like heavy collision solving" and you'd be <em>totally wrong</em>. You only have to set the input for a shader once, but you <em>do</em> have to create <strong>a new ShaderJob per computation of the filter every frame/tick</strong>. This is the depressing because <strong>ShaderJob takes a LONG time to start up</strong> and it, unlike the job itself, <em>does</em> use CPU from Flash's main thread--you do not get the asynchronous hotness until the actual job is started. And it is <em>sloooooowwwww</em>. Unless you're doing some serious number crunching or temporary special effect, you will not see a huge benefit from using PB in your game.</p>
<p>To be clear, ShaderJob works well enough for realtime usage but my experiments have shown that it's not fast enough to be executed every frame (unless you're SWF is running at 20 FPS or so). I tried to get it to fulfill my game's collision detection system by processing the entire map, but PB just couldn't handle the job. Still, I do recommend you try it (using Squize's recursive implementation) and see if it works for you. Just keep your hopes down <img src='http://coldconstructs.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h5>Synchronous mode</h5>
<p>You can set <code>ShaderJob.start(true)</code> but if you're going the synchronous route, I suggest applying your Pixel Bender kernel by using the filter method. It starts up much faster than ShaderJob and doesn't have to be restarted every time you want to update the input. You do have to wait for it to finish processing before it will move to the next line in your code though, but as I mentioned above, PB math is a lot faster than AS3's Math library. So if you're doing something intense(r) like severe image distortion then PB is definitely worth a shot, but if it's just conditionals then you're probably better off in pure AS3 land.</p>
<h4>Conclusion</h4>
<p>Besides doing complex calculations, another place where PB would really help though is processing large (like 600 or 10000 pixels wide or bigger) images. It loops through each pixel faster than AS3 does. But remember that in AS3 you can do loops, so easily skipping pixels (using the <code>continue</code> statement) can result in some significant performance gains if you're not processing all the pixels in the input data (eg skipping transparent pixels). There's a lot of pro/cons so experimenting is, as always, the way to go (if you can afford it).</p>
<p>So there it is, all the info I wish was out there when I started learning PB (<em>I can't stop thinking of Peanut Butter!</em>). Hope some of it was helpful and of course I could be wrong about something (except about declaring input once, I've heard otherwise but in practice it worked fine) so please don't hesitate to correct me if so. Good luck and have fun <img src="http://coldconstructs.com/random/pint.gif"></p>
 <p><a href="http://coldconstructs.com/?flattrss_redirect&amp;id=134&amp;md5=1412335ae83d891892c78fc14eff22d3" title="Flattr" target="_blank"><img src="http://coldconstructs.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coldconstructs.com/2009/10/pixel-bender-gap-guide/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=vonWolfehaus&amp;url=http%3A%2F%2Fcoldconstructs.com%2F2009%2F10%2Fpixel-bender-gap-guide%2F&amp;language=en_GB&amp;category=text&amp;title=AS3+to+Pixel+Bender+guide&amp;description=When+I+set+out+to+write+a+very+simple+Pixel+Bender+%28PB%29+kernel%2Fscript+thingy%2C+I+expected+it+to+be+relatively+straight-forward%2C+mostly+because+Adobe+has+been+so+good+writing+quality+documentation+for+its+products+and%2For+there+is+a+wealth+of+info+on+their+products+produced+by+their+users.+Unfortunately+I+didn%27t+find+the+dev+guide+in+the+Help+menu+and+I+missed+some+key+AS3+bits+from+the+links+I%27ll+post+below%2C+but+even+so+I+still+had+a+lot+of+trouble+finding+some+info+that+really+should+already+have+been+out+on+the+interwebs.+So+this+post+is+to+fill+in+the+gaps+when+going+from+AS3+to+Pixel+Bender.+%0AHope+it+helps+%0A%0ABest+resources+for+beginners%0AHere%27s+the+best+tutorials+and+explanations+I%27ve+found+so+far%3A%0AThe+official+guide+and+reference.+Slap+that+F1+key%21+Also%2C+don%27t+forget+the+Help+menu+in+the+toolkit+like+I+did+%28there%27s+the+PB-specific+language+spec+and+dev+guide+there%29.%0AUsing+PB+as+a+calculator.+Completes+the+official+tutorial.%0AGreat+in-depth+article+with+general%2Bperformance+tips.%0AVery+straight-forward+examples+%2B+comedy.+Can%27t+go+wrong+there.%0ANice+user+article+on+optimizations+and+some+speed+tests+%28turns+out%2C+for+input+bitmapData+beats+ByteArray+beats+Vector.%29%0A%0ASyntax+overview%0AAs+a+casual+programmer+of+high-level+languages+and+no+mid-+to+low-level+ones%2C+I+was+thrown+off+by+PB%27s+awkward+syntax.+It%27s+strongly+typed%2C+which+is+fine%2C+except+I%27m+not+familiar+with+low-level+languages+like+C+or+any+previous+shader+language+%28PB+is+based+on+GLSL+from+what+I+hear%29.+Here%27s+a+basic+difference%3A%0AAS3%3A+var+i%3ANumber+%3D+12%3B%0A...in+PB+is%3A+float+i+%3D+12.0%3B%0AThe+decimal+in+12.0+tells+PB+it%27s+a+floating+point+number.+If+it+was+just+12+PB+would+think+it%27s+an+int.%0AWhen+dealing+with+%22vectors%22+%28which+are+arrays%2C+as+in+Flash+10%27s+odd+use+of+the+word+%22vector%22%29+it%27s+float2+i+%3D+float2%2812.0%2C+2.0%29.+Notice+there%27s+no+brackets+or+anything+suggesting+any+type+of+array+present.+It%27s+simply+the+type+%2B+how+big+the+array+is%2C+eg+float3.+It+goes+up+to+4%2C+for+the+4+channels+in+images%3A+Red%2C+Green%2C+Blue%2C+Alpha%29.+Then%2C+as+you+can+see%2C+intializing+the+array+is+a+simple+matter+of+putting+in+the+numbers+you+said+would+be+there.+So+float4%281.0%2C+24.2%2C+0.1%2C+3.4%29+is+valid+whereas+float2%281.0%2C+24.2%2C+2%29+is+not%2C+because+there%27s+an+extra+number+in+there+and+it%27s+an+int+%28adding+insult+to+injury%29.%0A%0A%0A%0AAn+important+thing+to+keep+in+mind+is+that+Pixel+Bender+sees+channels+in+the+order+described+above+%28RGBA%29.+This+little+detail+cost+me+a+bit+of+time+because+I%27m+used+to+AS3%27s+order+of+ARGB--the+alpha+channel+is+first+in+AS3+while+it%27s+last+in+PB.%0A%0ATo+use+any+of+the+built-in+functions+you+simply+call+them+as+they+appear+in+the+reference+doc%3A+all%28x%29%3B+atan%28x%2Cy%29%3B+etc.%2C+no+Math+calls+like+we+have+to+do+in+Flash+%28this+through+me+for+a+loop%2C+lemme+tell+ya%29.%0A%0AFor+those+of+you+who+use+the+shortcut+operations+like+var+i%3Aint+%3D+foo+%3C+bar+%3F+foo+%3A+bar%3B%2C+then+you%27ll+be+pleased+to+hear+they%27re+supported+in+PB+too.+Just+about+the+only+thing+%22Hydra%22+%28formally+the+codename+for+Pixel+Bender%2C+now--I+guess--the+name+of+the+PB+Flash+implementation%29+does+not+support+is+loops+of+any+kind+and+their+related+break%2Fcontinue+statements.+That+last+bit+is+bad+because+there+are+times+when+I+want+to+stop+the+filter+if+a+certain+condition+is+met.+You+just+have+to+design+your+logic+to+take+this+into+account+from+the+start.%0A%0AThat%27s+the+basics+but+take+special+note+that+shader.data+is+actually+an+array%2C+so+you+can+do+some+naughty+stuff+like+iterate+through+some+kinky+data+and+set+the+input+as+shader.data%5B%27whatever%27%2Bi%5D.input+%3D+kinky%5Bi%5D.+Also+note+that+in+order+to+set+the+input+for+a+shader+in+AS3+you+must+set+it+to+shader.data.vdipb.INPUT+%3D+inputImage+where+vdipb+is+the+variable+name+you+declared+in+the+PB+shader+itself.%0A%0AMore+performance+tips%0ATurns+out+that+after+I+converted+my+kernel+from+using+boolean+methods+%28like+boolean4%28%29+etc.%29+to+if+statements%2C+it+consistently+executed+faster.+I+also+got+some+fractional+FPS+increases+by+using+the+age-old+optimization+of+putting+real+values+%28eg+1.2%29+in+the+evaluation+statement+instead+of+references+%28eg+pixel.r%29.+See+the+last+blog+I+linked+above+for+some+other+obvious+and+not-so-obvious+performance+tips.%0A%0APB+math+is+much+faster+than+straight+AS3+math+but+it%27s+slightly+brighter+%28I+wouldn%27t+say+it+shines+per+se...%29+when+it+runs+in+asynchronous+mode%2C+which+is+enabled+by+using+ShaderJob.+You+use+addEventListener%28Event%3AShaderEvent...%29+and+then+run+start%28false%29+to+put+it+in+asynchronous+mode+%28the+param+is+waitForCompletion+and+it%27s+already+false+by+default%29.+See+Ryan%27s+post+for+a+great+example+of+how+the+ShaderJob+has+to+be+setup+%28Squize%27s+post%2C+linked+above%2C+is+an+even+clearer+example%29.%0A%0ARealtime+use+of+Pixel+Bender%0AAsynchronous+mode%0AReading+the+above+linked+performance+tips+for+PB+you%2C+like+me%2C+might+be+thinking+%22OH+MAN+I+can+rule+the+universe+with+ShaderJob+doing+bitchwork+like+heavy+collision+solving%22+and+you%27d+be+totally+wrong.+You+only+have+to+set+the+input+for+a+shader+once%2C+but+you+do+have+to+create+a+new+ShaderJob+per+computation+of+the+filter+every+frame%2Ftick.+This+is+the+depressing+because+ShaderJob+takes+a+LONG+time+to+start+up+and+it%2C+unlike+the+job+itself%2C+does+use+CPU+from+Flash%27s+main+thread--you+do+not+get+the+asynchronous+hotness+until+the+actual+job+is+started.+And+it+is+sloooooowwwww.+Unless+you%27re+doing+some+serious+number+crunching+or+temporary+special+effect%2C+you+will+not+see+a+huge+benefit+from+using+PB+in+your+game.%0A%0ATo+be+clear%2C+ShaderJob+works+well+enough+for+realtime+usage+but+my+experiments+have+shown+that+it%27s+not+fast+enough+to+be+executed+every+frame+%28unless+you%27re+SWF+is+running+at+20+FPS+or+so%29.+I+tried+to+get+it+to+fulfill+my+game%27s+collision+detection+system+by+processing+the+entire+map%2C+but+PB+just+couldn%27t+handle+the+job.+Still%2C+I+do+recommend+you+try+it+%28using+Squize%27s+recursive+implementation%29+and+see+if+it+works+for+you.+Just+keep+your+hopes+down+%3B%29%0A%0ASynchronous+mode%0AYou+can+set+ShaderJob.start%28true%29+but+if+you%27re+going+the+synchronous+route%2C+I+suggest+applying+your+Pixel+Bender+kernel+by+using+the+filter+method.+It+starts+up+much+faster+than+ShaderJob+and+doesn%27t+have+to+be+restarted+every+time+you+want+to+update+the+input.+You+do+have+to+wait+for+it+to+finish+processing+before+it+will+move+to+the+next+line+in+your+code+though%2C+but+as+I+mentioned+above%2C+PB+math+is+a+lot+faster+than+AS3%27s+Math+library.+So+if+you%27re+doing+something+intense%28r%29+like+severe+image+distortion+then+PB+is+definitely+worth+a+shot%2C+but+if+it%27s+just+conditionals+then+you%27re+probably+better+off+in+pure+AS3+land.%0A%0AConclusion%0ABesides+doing+complex+calculations%2C+another+place+where+PB+would+really+help+though+is+processing+large+%28like+600+or+10000+pixels+wide+or+bigger%29+images.+It+loops+through+each+pixel+faster+than+AS3+does.+But+remember+that+in+AS3+you+can+do+loops%2C+so+easily+skipping+pixels+%28using+the+continue+statement%29+can+result+in+some+significant+performance+gains+if+you%27re+not+processing+all+the+pixels+in+the+input+data+%28eg+skipping+transparent+pixels%29.+There%27s+a+lot+of+pro%2Fcons+so+experimenting+is%2C+as+always%2C+the+way+to+go+%28if+you+can+afford+it%29.%0A%0ASo+there+it+is%2C+all+the+info+I+wish+was+out+there+when+I+started+learning+PB+%28I+can%27t+stop+thinking+of+Peanut+Butter%21%29.+Hope+some+of+it+was+helpful+and+of+course+I+could+be+wrong+about+something+%28except+about+declaring+input+once%2C+I%27ve+heard+otherwise+but+in+practice+it+worked+fine%29+so+please+don%27t+hesitate+to+correct+me+if+so.+Good+luck+and+have+fun+&amp;tags=ActionScript+3%2CFlash%2CPixel+Bender%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

