<?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>Raelifin.com &#187; rapid-prototype</title>
	<atom:link href="http://raelifin.com/tag/rapid-prototype/feed/" rel="self" type="application/rss+xml" />
	<link>http://raelifin.com</link>
	<description>Deus ex Machina</description>
	<lastBuildDate>Sun, 04 Jul 2010 01:45:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Mini-Project: Autocell</title>
		<link>http://raelifin.com/code/mini-project-autocell/</link>
		<comments>http://raelifin.com/code/mini-project-autocell/#comments</comments>
		<pubDate>Thu, 20 May 2010 06:12:27 +0000</pubDate>
		<dc:creator>Raelifin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Autocell]]></category>
		<category><![CDATA[cellular automata]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rapid-prototype]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://raelifin.com/?p=356</guid>
		<description><![CDATA[My latest quick project was to write a basic scripting language for building cellular automata. The framework is built on javascript, and I made a nice little interface to go with it. As long as you&#8217;re using a browser that isn&#8217;t terrible, you can check it out here. All the code on that page except [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 0 0 10px 10px; float: right;" src="http://raelifin.com/files/screenshots/autocell_screenshot.png"/>My latest quick project was to write a basic scripting language for building <a href="http://en.wikipedia.org/wiki/Cellular_automata">cellular automata</a>. The framework is built on javascript, and I made a nice little interface to go with it. As long as you&#8217;re using a browser that isn&#8217;t terrible, you can <a href="http://raelifin.com/files/autocell1.html">check it out here</a>. All the code on that page except the utility functions is public domain, but please give credit where credit is due. If you end up examining the source, I apologize for the mess; I was trying to fit everything in one file, and not use jQuery or other libraries.</p>
<p><span id="more-356"></span></p>
<p>For those interested in writing your own automata, here is a quick guide to the syntax:<br />
An automaton is composed of rules. Each rule is designated by a new line. Double slash (//) or pound (#) designate a commented line.<br />
Each rule looks something like <strong>BLACK->WHITE: 1 = 2</strong><br />
BLACK is the type of cell that the rule applies to, WHITE is the type of cell that it will become. After the colon is a statement that must resolve to a single value, or &#8220;noun&#8221;.<br />
Nouns can be strings, numbers, true/false, JSON arrays, &#8220;neighbors&#8221;, or any of the cardinal directions (lower-case). The noun &#8220;neighbors&#8221; is a special noun which is a JSON array with values equal to the types of the surrounding tiles (in eight directions). The special nouns &#8220;west&#8221;, &#8220;north&#8221;, &#8220;south&#8221; and &#8220;east&#8221; are equal to the type in that direction, or &#8220;NULL&#8221; if at the edge.<br />
Nouns can be acted upon by the following &#8220;verbs&#8221;:
<ul>
<li><strong>=</strong>, <strong>></strong>, <strong><</strong> &#8212; Basic comparison operators. They behave like their counterparts in javascript (except for =, which is comparison, not assignment). &#8212; example: &#8220;1 > 2 = false&#8221; (returns true)</li>
<li><strong>or</strong>, <strong>and</strong> &#8212; Low-priority logic operators. These behave like || and &#038;&#038; in most languages. Low-priority means they are evaluated after other verbs. &#8212; example: &#8220;true and false or true&#8221; (returns true)</li>
<li><strong>not</strong> &#8212; Inverts the boolean value to the right. If the value to the right is non-boolean, it is cast to a boolean just like ! in javascript. &#8212; example: &#8220;not true&#8221; (returns false)</li>
<li><strong>contains</strong>, <strong>isIn</strong> &#8212; Check if a value is contained in an array. The two verbs are identical except in the order of their parameters (&#8220;value isIn array&#8221;, or &#8220;array contains value&#8221;). &#8212; example: &#8220;[1,2,3] contains 0&#8243; (returns false)</li>
<li><strong>count</strong> &#8212; Changes the noun on the right from an array to an integer. &#8212; example: &#8220;count [0,1,2]&#8221; (returns 3)</li>
<li><strong>ofType</strong> &#8212; Filters an array on the left to only contain the value on the right. &#8212; example: &#8220;[0,0,0,1,2,3] ofType 0&#8243; (returns [0,0,0])</li>
<li><strong>echo</strong> &#8212; Makes a popup containing the value on the right. Does not change the data. This verb isn&#8217;t very useful, and can flood your browser with popups if you aren&#8217;t careful.</li>
</ul>
<p>Verbs are evaluated from left-to-right, but you can use parentheses to change the order of operations. More examples can be found by loading the prebuilt automata.</p>
<p>I know the interface is a bit hard to use, but if you make anything (even if it&#8217;s pretty trivial) please leave a comment! You can export boards as well, so feel free to share interesting formations in <a href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life">Conway&#8217;s Game of Life</a>, <a href="http://en.wikipedia.org/wiki/Wireworld">Wireworld</a>, or others.</p>
<p>On a related note, this talk by Wolfram is not to be missed:<br />
<object width="446" height="326"><param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"></param><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"></param><param name="bgColor" value="#ffffff"></param><param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/StephenWolfram_2010-medium.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/StephenWolfram-2010.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=843&#038;introDuration=15330&#038;adDuration=4000&#038;postAdDuration=830&#038;adKeys=talk=stephen_wolfram_computing_a_theory_of_everything;year=2010;theme=tales_of_invention;theme=bold_predictions_stern_warnings;theme=what_s_next_in_tech;theme=new_on_ted_com;theme=a_taste_of_ted2010;theme=unconventional_explanations;theme=art_unusual;theme=inspired_by_nature;event=TED2010;&#038;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" allowScriptAccess="always" flashvars="vu=http://video.ted.com/talks/dynamic/StephenWolfram_2010-medium.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/StephenWolfram-2010.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=843&#038;introDuration=15330&#038;adDuration=4000&#038;postAdDuration=830&#038;adKeys=talk=stephen_wolfram_computing_a_theory_of_everything;year=2010;theme=tales_of_invention;theme=bold_predictions_stern_warnings;theme=what_s_next_in_tech;theme=new_on_ted_com;theme=a_taste_of_ted2010;theme=unconventional_explanations;theme=art_unusual;theme=inspired_by_nature;event=TED2010;"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://raelifin.com/code/mini-project-autocell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zombie Corp.</title>
		<link>http://raelifin.com/code/zombie-corp/</link>
		<comments>http://raelifin.com/code/zombie-corp/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 15:51:18 +0000</pubDate>
		<dc:creator>Raelifin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rapid-prototype]]></category>

		<guid isPermaLink="false">http://raelifin.com/?p=8</guid>
		<description><![CDATA[During my first year of college I showed up one Friday for my C++ class only to find that it was canceled. Not wanting to simply go home quite yet, I talked one of the other teachers into letting me sit in and participate in one of the upper level game-development classes. We were broken [...]]]></description>
			<content:encoded><![CDATA[<p>During my first year of college I showed up one Friday for my C++ class only to find that it was canceled. Not wanting to simply go home quite yet, I talked one of the other teachers into letting me sit in and participate in one of the upper level game-development classes. We were broken into teams and instructed to design a game to work on for the rest of the quarter. I, of course, didn&#8217;t have to code anything, being in the class just for that day, but I jumped in anyway.</p>
<p>Most of the class was thinking of making an obscenely huge strategy game akin to Risk meets Monopoly, which just so happens to be the sort of design which I despise. Having spent many long years learning the hard way to design as small as possible, I helped my team brainstorm a small, grid-based, strategy game based on resource management and simple unit-movement. My hope was that the project would be basic enough that it could be running with an initial rule-set within the week and that the remainder of the term could be devoted to polishing the interface/graphics and working on the rules. (I was only vaguely aware of it at the time, but this sort of thinking would expand into rapid-prototyping, playtest-heavy, and iterative design philosophies in my own work.)</p>
<p><span id="more-8"></span></p>
<p>We decided on a zombie theme, with the twist that the zombies were actually corporate pawns, and the necromancers were CEOs. It&#8217;s kinda vanilla, but it was a 1-hour design within a group of relative strangers. We presented our designs for the class and they decided to work on Risk-Monopoly. That weekend, in about 8 hours*, I built a working alpha for the game:</p>
<p>EDIT: If the images aren&#8217;t working, you may need to <a href="http://raelifin.com/code/zombie-corp/">view this post by itself</a>.<br />
<applet code="master.CoreApplet.class" archive="http://raelifin.com/files/corperateZombies.jar" width="575" height="575"></applet><br />
<blockquote><strong>Rules:</strong><br />
The player on the left (pink/green) goes first. And then blue player takes a turn, and so on.<br />
To move an army, drag them to an adjacent square. (They move like kings in chess.)<br />
Armies are composed of undead: zombies, lawyers, or both.</p>
<p>Each space is commercial, residential or corporate (Starbucks, house or building). At the beginning of each turn, you get cash to buy lawyers with and new interns to turn into zombies. The goal of the game it to capture your opponent&#8217;s skyscraper. The income is as follows:<br />
Corporate Space: +$5,000 &#038; +5 interns / turn<br />
Commercial Space +$2,000 / turn<br />
Residential Space +2 interns / turn</p>
<p>Each turn you get one action (upper-right), in addition to moving each unit. Select a board space then chose:<br />
PROMOTE: Turn all interns into zombies at the selected space.<br />
HIRE: Hire lawyers for $5,000 each at the selected space.<br />
DEVELOP: Selected commercial or residential space now produces 2N+2, where N = current production. (Units are single interns or thousands of dollars.) Each space can only be developed twice.</p>
<p>If you move into a space that has an enemy army, you deal damage to them, killing a number of units. If you defeat all units in a space, you capture it. An army with both lawyers and zombies loses its zombies first. Lawyers deal roughly 5x<br />
more damage to zombies (I forget the actual multiplier).</p></blockquote>
<p>It&#8217;s really a very boring game, but the idea is that it&#8217;s playable and (mostly) bug free. Additional rules and features can easily be added onto the skeleton in an attempt to make it more engaging. At the end of the week you&#8217;ll have a game, though, and you&#8217;ll have a good impression of roughly how fun it is. This last part is vital, I think, to good game design.<br />
<strong>Rapid-prototyping lets me play a game with very little time investment. This lets me determine whether it is worth making.</strong></p>
<p><small>* This amount of time is actually quite excessive for such a simple game. At the time I wasn&#8217;t using <a href="http://slick.cokeandcode.com/">Slick</a>, and I didn&#8217;t have much experience with applets.</p>
<p>Disclaimer: I do not own any of the graphics used in the game, but I feel that they are <a href="http://en.wikipedia.org/wiki/Fair_use">used fairly</a>. Unlike most of my work, this game is not open source, and I ask that you do not redistribute it without permission. Its sole intent is to showcase what I did one weekend, and maybe talk a little about game-programming. <img src='http://raelifin.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </small></p>
]]></content:encoded>
			<wfw:commentRss>http://raelifin.com/code/zombie-corp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
