<?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; java</title>
	<atom:link href="http://raelifin.com/tag/java/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>First GoiD Task</title>
		<link>http://raelifin.com/code/first-goid-task/</link>
		<comments>http://raelifin.com/code/first-goid-task/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 20:40:52 +0000</pubDate>
		<dc:creator>Raelifin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[GoiD]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://raelifin.com/?p=304</guid>
		<description><![CDATA[In case anyone&#8217;s wondering what I&#8217;m up to, my first task on the Game of Intelligent Design was published today. If you&#8217;re familiar with javascript and like the the idea of programming virtual robots, go play!]]></description>
			<content:encoded><![CDATA[<p><img style="float: right; margin: 10px;" src="http://raelifin.com/files/screenshots/GoiDMaze.png" alt="GoiD Maze Screenshot" />In case anyone&#8217;s wondering what I&#8217;m up to, my first task on the <a href="http://gameofid.com/">Game of Intelligent Design</a> was published today. If you&#8217;re familiar with javascript and like the the idea of programming virtual robots, <a href="http://gameofid.com/play/maze">go play</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://raelifin.com/code/first-goid-task/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Genetic Programming in 24 Hours</title>
		<link>http://raelifin.com/code/genetic-programming-in-24-hours/</link>
		<comments>http://raelifin.com/code/genetic-programming-in-24-hours/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 01:45:00 +0000</pubDate>
		<dc:creator>Raelifin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Genetic Programming]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://raelifin.com/?p=190</guid>
		<description><![CDATA[I don&#8217;t know why I named it &#8220;Tide Pool&#8221;; there aren&#8217;t any tides. Oddly enough though, the creatures learn to move as if there were. Yesterday I decided to play with some genetic programming. Though I found a neat GP resource, I decided to work from scratch and build a simulated tide-pool with algae/plants and [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know why I named it &#8220;Tide Pool&#8221;; there aren&#8217;t any tides. Oddly enough though, the creatures learn to move as if there were.</p>
<p><a href="http://raelifin.com/files/tidepool.png"><img style="float: right; margin: 0px 0px 10px 10px; width: 300px;" src="http://raelifin.com/files/tidepool.png" alt="Tide Pool screenshot" /></a>Yesterday I decided to play with some genetic programming. Though I found <a href="http://jgap.sourceforge.net/">a neat GP resource</a>, I decided to work from scratch and build a simulated tide-pool with algae/plants and animals of indeterminate form. Truth be told, I&#8217;m not even sure what I did really &#8220;counts&#8221; as genetic programming because the only evolved feature is the behavior for the animals. Regardless, I wrote the thing in a single day and got some neat emergent behavior and a screen-saver-wannabe. Green dots are &#8220;plants&#8221; and yellow/white/red/black are &#8220;animals&#8221;.</p>
<p><span id="more-190"></span></p>
<p><a href="http://raelifin.com/files/TidePool.zip">The code and runnable Jar are here.</a> Everything is public domain, though I humbly request you don&#8217;t try to pass the work off as your own. The pulsing brightness is supposed to be day &#038; night. The source code is really sloppy, so keep in mind that this was a quick, shoot-from-the-hip sort of project and please have forgiveness.</p>
<p>Controls:<br />
Minus/Underline = Slower<br />
Plus/Equals = Faster</p>
]]></content:encoded>
			<wfw:commentRss>http://raelifin.com/code/genetic-programming-in-24-hours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gravitation</title>
		<link>http://raelifin.com/code/gravitation/</link>
		<comments>http://raelifin.com/code/gravitation/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 22:04:11 +0000</pubDate>
		<dc:creator>Raelifin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[gravity]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[kepler]]></category>
		<category><![CDATA[newton]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[simulation]]></category>

		<guid isPermaLink="false">http://raelifin.com/?p=161</guid>
		<description><![CDATA[One weekend, about a month ago, I threw together a quick simulation of the solar system because I was studying gravitation in school. Since I have some time now I went back and polished it to allow user interaction and remove various glitches. It&#8217;s still quite crude, but I&#8217;m done dealing with it, so I [...]]]></description>
			<content:encoded><![CDATA[<p><a style="float: right; margin: 0px 0px 5px 5px;" href="http://raelifin.com/files/sol.png"><img src="http://raelifin.com/files/sol.png" alt="Sol" height="200" /></a>One weekend, about a month ago, I threw together a quick simulation of the solar system because I was studying gravitation in school. Since I have some time now I went back and polished it to allow user interaction and remove various glitches. It&#8217;s still quite crude, but I&#8217;m done dealing with it, so I figured that I&#8217;d throw it up here. One of the coolest things it does (IMO) is show the paths of the planets from a non-heliocentric viewpoint. </p>
<p><span id="more-161"></span></p>
<p>Everything (code and images) is public domain. Credit is nice, but not necessary. <a href="http://raelifin.com/files/kepler.zip">Download code (and runnable jar) here.</a> Created using <a href="http://slick.cokeandcode.com/">Slick</a> (Build #266) with <a href="http://lwjgl.org/">LWJGL</a> (2.0b1).</p>
<p><a href="http://raelifin.com/files/kepler.png"><img style="margin-bottom: 0px" src="http://raelifin.com/files/kepler.png" alt="Geocentric Perspective" title="Geocentric" width="300" height="186"/></a><br />
A Geocentric View of the Universe.</p>
<p><a href="http://raelifin.com/files/kepler2.png"><img style="margin-bottom: 0px" src="http://raelifin.com/files/kepler2.png" alt="Geocentric Perspective 2" title="Geocentric2" width="300" height="186"/></a><br />
Another Geocentric Perspective.</p>
<p><a href="http://raelifin.com/files/jupiter.png"><img style="margin-bottom: 0px" src="http://raelifin.com/files/jupiter.png" alt="Jupiter Perspective" title="Jupiter" width="300" height="186"/></a><br />
View from Jupiter.</p>
<p>Oh, and I almost forgot! One of the other neat things I did with the simulation was &#8220;experimentally&#8221; measure the speeds of the planets (except Neptune). I looked up average orbital distances and the mass of the sun on Wikipedia and then tweaked the initial velocity of each planet until the orbit looked roughly circular. I did this mostly out of laziness, but I was shocked at how close I had gotten to the real values.</p>
<table>
<tr>
<th></th>
<th>Estimated Speed <small>(km/s)</small></th>
<th>Observed Speed (Average) <small>(km/s)</small></th>
</tr>
<tr>
<th>Mercury</th>
<td>48</td>
<td>47.87</td>
</tr>
<tr>
<th>Venus</th>
<td>34.5</td>
<td>35.02</td>
</tr>
<tr>
<th>Earth</th>
<td>29.5</td>
<td>29.783</td>
</tr>
<tr>
<th>Moon</th>
<td>30.5</td>
<td>30.805<br/><small>= 29.783 (earth) + 1.022 (relative speed of luna)</small></td>
</tr>
<tr>
<th>Mars</th>
<td>24</td>
<td>24.077</td>
</tr>
<tr>
<th>Jupiter</th>
<td>13</td>
<td>13.07</td>
</tr>
<tr>
<th>Saturn</th>
<td>9.5</td>
<td>9.69</td>
</tr>
<tr>
<th>Uranus</th>
<td>6.8</td>
<td>6.81</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://raelifin.com/code/gravitation/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>
