<?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>Patrick Hebron</title>
	<atom:link href="http://blogs.hebali.com/itp/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blogs.hebali.com/itp</link>
	<description>CG &#38; Simulation Software</description>
	<lastBuildDate>Thu, 30 Aug 2012 00:18:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>ofxGoneWild</title>
		<link>http://blogs.hebali.com/itp/?p=645</link>
		<comments>http://blogs.hebali.com/itp/?p=645#comments</comments>
		<pubDate>Mon, 23 Apr 2012 17:58:06 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[ITP Residency]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Cinder]]></category>
		<category><![CDATA[openFrameworks]]></category>
		<category><![CDATA[Polycode]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=645</guid>
		<description><![CDATA[I&#8217;ve been a Cinder devotee for about two years (almost as long as Cinder has been publicly available). I officially switched from openFrameworks because a project I was working on as a student at ITP made heavy use of GLSL shaders, which at the time were much easier to work with in Cinder. openFrameworks GLSL [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I&#8217;ve been a <a href="http://libcinder.org">Cinder</a> devotee for about two years (almost as long as Cinder has been publicly available). I officially switched from <a href="http://openframeworks.cc">openFrameworks</a> because a project I was working on as a student at ITP made heavy use of GLSL shaders, which at the time were much easier to work with in Cinder. openFrameworks GLSL support has since improved greatly, but I&#8217;ve maintained my loyalty to Cinder because of its clean architecture, extensive core feature set and impressive sample projects.</p>
<p style="text-align: justify;">Every few weeks, though, I find myself porting an openFrameworks addon to Cinder. And now that there&#8217;s <a href="http://ofxaddons.com">ofxAddons</a>, a site that tracks every addon on GitHub, my porting has become even more frequent. Some of these are easy enough. Vec3f becomes ofVec3f, ColorA becomes ofColor, etc. But more complex addons like ofxOpenNi or ofxAssimpModelLoader are time-consuming or difficult to port. Of course, the Cinder community has its own &#8220;addons&#8221; (which are instead called &#8220;Blocks&#8221;). But there are fewer of them, they often take longer to reach the community and in some cases they are harder to wrangle. Cinder&#8217;s OpenNi block in particular is a nightmare to get setup.</p>
<p style="text-align: justify;">I believe the greatest strength of each framework is also its greatest weakness. openFrameworks is extensively documented and supported by a large and active community. This means a constant stream of new features, but also that the tools themselves sometimes feel like a disorganized hodgepodge. Cinder is supported by a smaller community, which is rigorous about API standards and best practices. However, this often translates to month-long forum debates that do not result in any new features.  So we beat on.</p>
<p style="text-align: justify;">I&#8217;ve learned a great deal about programming by reading the Cinder source code and that nagging feeling of wanting to do things properly and efficiently keeps me a Cinder devotee. But this week, something happened that changed my attitude: I met <a href="http://polycode.org">Polycode</a>.</p>
<p style="text-align: justify;">I&#8217;d been aware of Polycode since it first surfaced, but only gave it proper attention for the first time this week. I was looking for inspiration while implementing the 3D environment and scenegraph components of my software project, <a href="http://thinkfoil.com">Foil</a>. I was impressed with Polycode&#8217;s Assimp-based 3D model loader, scenegraph structure, Bullet-based physics simulation and overall architecture. For a moment, I considered making the switch. But then, I began to find that Polycode was extremely slow in loading large skeletal animation files and  started looking elsewhere for solutions.</p>
<p style="text-align: justify;">This brought me back to openFrameworks, which unsurprisingly has a very nice Assimp loader addon. My first impulse was to port ofxAssimpModelLoader to Cinder. After a bit of frustration and wasted time, I decided to put Cinder aside temporarily and try working in openFrameworks instead.</p>
<p style="text-align: justify;">Within a day, I had connected ofxAssimpModelLoader, ofxBullet and ofxTimeline with openFramework&#8217;s built-in ofLight, ofCamera, etc classes to reproduce the majority of Polycode&#8217;s 3D model/skeleton, physics and animation functionality. Over the course of the next few days, I will integrate addons including ofxTerminal, ofxAssimpOpenNISkeletonSync, ofxOpenSteer/ofxPathfinding/ofxFlock, ofxParticleSystem, ofxFaceTracker and ofxOpenNi to produce a scriptable 3D modeling/animation/gaming environment, potentially called &#8220;ofxGoneWild&#8221; or maybe &#8220;ofxKitchenSink.&#8221; ofxAddons galore! There is some work in connecting these pieces and without a fair amount of C++ as well as Xcode experience, it would be difficult. Yet, given the volume of features that comes with these addons, it&#8217;s a pretty quick process.</p>
<p style="text-align: justify;">I still love Cinder and will continue to work in it. But the draw of openFrameworks&#8217; vast collection of addons is immense. The ability to build a custom physics-simulating, keyframe-animated 3D environment in a week is earth-shattering. It&#8217;s not Maya, but it&#8217;s an extremely good start. With the support of Assimp and Bullet, openFrameworks provides access to the same model loader and physics engine that are available in Maya 2013. So, for this project at least, I&#8217;m with openFrameworks.</p>
<p style="text-align: center;"><a href="http://blogs.hebali.com/itp/wp-content/uploads/2012/04/FoilCgiScreenshot_test.png"><img class="alignnone size-medium wp-image-649" title="FoilCgi screenshot" src="http://blogs.hebali.com/itp/wp-content/uploads/2012/04/FoilCgiScreenshot_test-300x225.png" alt="" width="300" height="225" /></a></p>
<p style="text-align: center;">(A very early screenshot of ofxGoneWild.)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=645</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controlling a Virtual Camera with FaceTracker</title>
		<link>http://blogs.hebali.com/itp/?p=616</link>
		<comments>http://blogs.hebali.com/itp/?p=616#comments</comments>
		<pubDate>Sun, 25 Sep 2011 17:52:11 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[ITP Residency]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[Cinder]]></category>
		<category><![CDATA[FaceTracker]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[openFrameworks]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[virtual reality]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=616</guid>
		<description><![CDATA[A preliminary test using FaceTracker to control a virtual camera within a 3D gaming or design environment. With some tuning, the effect could be made pretty convincing. The biggest obstacle is that FaceTracker looses non-front-facing faces. Perhaps the face detection training model could be extended. Failing this, it might be helpful to supplement the FaceTracker [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/29568839" width="400" height="225" frameborder="0"></iframe></p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/29563209" width="400" height="225" frameborder="0"></iframe></p>
<p style="text-align: left;">A preliminary test using FaceTracker to control a virtual camera within a 3D gaming or design environment. With some tuning, the effect could be made pretty convincing. The biggest obstacle is that FaceTracker looses non-front-facing faces. Perhaps the face detection training model could be extended. Failing this, it might be helpful to supplement the FaceTracker data with Kinect skeletal tracking to smooth or approximate the head position when necessary.</p>
<p style="text-align: left;">For this version, I ported ofxFaceTracker to Cinder and wrote a simple camera control system to interface with FaceTracker data. By shifting control of the camera position towards a motion vector rather than pure position-driven approach, it should be possible to diminish the apparentness of brief drops in face tracking. Some turbulence forces might also mask a freeze in face-controlled camera data.</p>
<p>Using Jason Saragih&#8217;s FaceTracker library:</p>
<p style="text-align: left;"><a href="http://web.mac.com/jsaragih/FaceTracker/FaceTracker.html" rel="nofollow" target="_blank">web.mac.com/​jsaragih/​FaceTracker/​FaceTracker.html</a></p>
<p>Adapted for Cinder from Kyle McDonald&#8217;s ofxFaceTracker:</p>
<p style="text-align: left;"><a href="http://github.com/kylemcdonald/ofxFaceTracker" rel="nofollow" target="_blank">github.com/​kylemcdonald/​ofxFaceTracker</a></p>
<p style="text-align: left;">My Cinder port of ofxFaceTracker is now available at:</p>
<p style="text-align: left;">https://github.com/Hebali/ciFaceTracker</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=616</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Digital Technicolor</title>
		<link>http://blogs.hebali.com/itp/?p=596</link>
		<comments>http://blogs.hebali.com/itp/?p=596#comments</comments>
		<pubDate>Thu, 07 Apr 2011 21:10:32 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Digital Imaging]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=596</guid>
		<description><![CDATA[I think 3-Strip Technicolor films deserve as much of nostalgia’s warm embrace as vinyl records. Webcams and mp3s are completely ubiquitous, but their predecessors (and distant ancestors) still hold a certain charm. So, for Eric Rosenthal’s Digital Imaging class I created a few digital images using a process similar in spirit to that of old [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I think 3-Strip Technicolor films deserve as much of nostalgia’s warm embrace as vinyl records. Webcams and mp3s are completely ubiquitous, but their predecessors (and distant ancestors) still hold a certain charm.  So, for Eric Rosenthal’s Digital Imaging class I created a few digital images using a process similar in spirit to that of old Technicolor films.</p>
<p><a href="http://blogs.hebali.com/itp/wp-content/uploads/2011/04/technicolor-camera-0609-lg.jpg"><img class="size-medium wp-image-597 aligncenter" title="technicolor-camera-0609-lg" src="http://blogs.hebali.com/itp/wp-content/uploads/2011/04/technicolor-camera-0609-lg-225x300.jpg" alt="" width="135" height="180" /></a></p>
<p style="text-align: justify;"><span id="more-596"></span></p>
<p style="text-align: justify;">As the name suggests, a 3-strip film process is one in which the red, green and blue component images are recorded onto three separate sheets of black &amp; white film. Actually the first version of this process, innovated by Technicolor in 1916, was a two-color system (red and green). The basic idea is the same for both systems: an image enters the camera’s lens and passes through a beam-splitter. The beam-splitter is directed towards two or three color filters, through which the component beams pass onto a film emulsion. Naturally, this process made for a bulky camera and used 2x or 3x as much film stock as a B&amp;W film. Nonetheless, it was an incredible innovation and Walt Disney and others quickly put it to good use. This, of course, was later replaced by color film that allowed the color components to be layered on top of one another on a single sheet of film. In the digital era, this 3-strip idea found new life. Many high-quality digital motion picture cameras still use 3 component image sensors and a beam-splitter. These are commonly called 3CCD cameras.</p>
<p style="text-align: justify;">To imitate this process, I set up my camera on a steady tripod and obtained three sheets of color filter material: red, green and blue. As Eric told us, the color filters that are generally used in digital image sensors tend not to be rich, saturated reds, greens and blues, but instead more pastel so as to not produce true color separations and instead have some channel blending at the sub-pixel level. In this process, I used saturated filters that I hoped would produce stark color separations. I put the camera on a timer and shot a very still scene (an empty room) three times in succession, each time with a new color filter in front of the lens. I repeated this process twice and the second time included a gray card in the shot so that I could do some calibration later. Here are the results:</p>
<p><a href="http://blogs.hebali.com/itp/wp-content/uploads/2011/04/combinedRGB.png"><img class="size-large wp-image-601 aligncenter" title="combinedRGB" src="http://blogs.hebali.com/itp/wp-content/uploads/2011/04/combinedRGB-500x1024.png" alt="" width="500" height="1024" /></a></p>
<p style="text-align: justify;">The bottom image is much better than the top. This is largely because the gray card allowed me to better calibrate but also because the original component exposures for the bottom image are better. Overall, the color accuracy to the original scene is pretty good and could certainly be fine-tuned further with more extensive testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=596</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MeandriCA by Morgen Fleisig &amp; Patrick Hebron</title>
		<link>http://blogs.hebali.com/itp/?p=573</link>
		<comments>http://blogs.hebali.com/itp/?p=573#comments</comments>
		<pubDate>Wed, 15 Dec 2010 22:11:28 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Big Screens]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=573</guid>
		<description><![CDATA[This project was developed for and presented at the ITP Big Screens 2010 event @ the IAC Video Wall in Chelsea, NY. The aspect ratio of the IAC wall is 10.625:1, which is not very conducive to the web. This video represents the middle third of that screen. Evaluating the state of each of the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/17859695" width="400" height="225" frameborder="0"></iframe></p>
<p style="text-align: justify;">This project was developed for and presented at the ITP Big Screens 2010 event @ the IAC Video Wall in Chelsea, NY.</p>
<p style="text-align: justify;">The aspect ratio of the IAC wall is 10.625:1, which is not very conducive to the web. This video represents the middle third of that screen.</p>
<p style="text-align: justify;">Evaluating the state of each of the eight neighbors of the center pixel in a nine-square grid for every one of the 8,160 x 768 pixels on the wall of the IAC, algorithms are employed to generate such natural behavior as the flooding of lowland areas by rising water levels, and the reformation of new land masses by sedimentary deposition. The same pattern of behavior exists at multiple scales, and can be seen in chemical reactions, culture growth, spillage, and lava flows, to name a few. The algorithms themselves can be modified to simulate any variation. To operate in real-time, our algorithm must compute a baseline of 150,994,944 pixel comparisons every frame. To achieve this, we have designed our algorithm to take advantage of the computer&#8217;s standard processor (CPU) as well as its hardware-accelerated graphics processor (GPU).</p>
<p style="text-align: justify;">MeandriCA was created using C++, OpenGL, GLSL and Cinder.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=573</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GLSL Generated Aerial Imagery.</title>
		<link>http://blogs.hebali.com/itp/?p=568</link>
		<comments>http://blogs.hebali.com/itp/?p=568#comments</comments>
		<pubDate>Thu, 18 Nov 2010 01:52:13 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Big Screens]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=568</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/Meandrica_testRender0_title.jpg"><img class="alignnone size-full wp-image-569" title="Meandrica_testRender0_title" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/Meandrica_testRender0_title.jpg" alt="" width="516" height="258" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=568</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scape</title>
		<link>http://blogs.hebali.com/itp/?p=560</link>
		<comments>http://blogs.hebali.com/itp/?p=560#comments</comments>
		<pubDate>Tue, 02 Nov 2010 14:13:31 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Thesis]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=560</guid>
		<description><![CDATA[I am exploring natural simulations, terrain generators, evolutionary and genetic algorithms as starting points for interactive or gaming experiences. Here are a few images that have come out of my early programming work on the project: In all stages of this project&#8217;s development, I believe it will be important to consistently reconcile the visual and [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I am exploring natural simulations, terrain generators, evolutionary and genetic algorithms as starting points for interactive or gaming experiences. Here are a few images that have come out of my early programming work on the project:</p>
<p><a href="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/scapeScreen_nov2.png"><img class="alignnone size-large wp-image-561" title="scapeScreen_nov2" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/scapeScreen_nov2-1024x586.png" alt="" width="368" height="211" /></a></p>
<p><a href="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/Meandrica000swirl_Screenshot.png"><img class="alignnone size-large wp-image-562" title="_Meandrica000swirl_Screenshot" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/Meandrica000swirl_Screenshot-1024x592.png" alt="" width="368" height="213" /></a></p>
<p><a href="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/Meandrica005a_Screenshot.png"><img class="alignnone size-large wp-image-563" title="_Meandrica005a_Screenshot" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/Meandrica005a_Screenshot-1024x593.png" alt="" width="368" height="214" /></a></p>
<p><a href="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/Meandrica005aa_Screenshot.png"><img class="alignnone size-large wp-image-564" title="_Meandrica005aa_Screenshot" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/11/Meandrica005aa_Screenshot-1024x578.png" alt="" width="368" height="208" /></a></p>
<p style="text-align: justify;">In all stages of this project&#8217;s development, I believe it will be important to consistently reconcile the visual and conceptual elements to one another. I am hoping to strike a delicate balance between a light-hearted, playful tone found in Disney or Pixar animated films and the understated presentation of natural wonder that can be found in few good nature documentaries. At the same time, I am building the system as an interactive one. For this purpose, I am looking to the books <em>Theory of Games and Economic Behavior </em>by John von Neumann and Oskar Morgenstern and <em>Evolution and the Theory of Games</em> by John Maynard Smith. Through these books, I am exploring how concepts of evolutionarily stable systems could be applied to the gameplay mechanics of my project. A few more visual and conceptual influences are depicted here:</p>
<p><a href="http://blogs.hebali.com/files/Fall2010/Thesis/MoodBoard1.jpg">Mood Board #1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=560</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GLSL Game of Life</title>
		<link>http://blogs.hebali.com/itp/?p=545</link>
		<comments>http://blogs.hebali.com/itp/?p=545#comments</comments>
		<pubDate>Thu, 28 Oct 2010 03:34:58 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Big Screens]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=545</guid>
		<description><![CDATA[Click to enlarge. Conway&#8217;s Game of Life being computed on the graphics card for 8160&#215;768 pixels at 60 frames per second. The full frame is rendering to a frame buffer, only the left 1360&#215;768 is drawing to the screen.]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.hebali.com/itp/wp-content/uploads/2010/10/Shader_GameOfLife_firstImage.png"><img class="alignnone size-full wp-image-546" title="Shader_GameOfLife_firstImage" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/10/Shader_GameOfLife_firstImage.png" alt="" width="617" height="59" /></a></p>
<p style="text-align: justify;">Click to enlarge. Conway&#8217;s Game of Life being computed on the graphics card for 8160&#215;768 pixels at 60 frames per second. The full frame is rendering to a frame buffer, only the left 1360&#215;768 is drawing to the screen.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=545</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aluminum Foil: My work as a child</title>
		<link>http://blogs.hebali.com/itp/?p=539</link>
		<comments>http://blogs.hebali.com/itp/?p=539#comments</comments>
		<pubDate>Sun, 10 Oct 2010 00:58:04 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Patrick]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=539</guid>
		<description><![CDATA[aluminumfoil.hebali.com Here is a slideshow of some of my childhood work. Though I primarily focus on software development in my &#8220;adulthood,&#8221; my interests have remained much the same. The above image is of a design model for a virtual reality headset I constructed when I was nine or ten. This collection covers a sample of [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://aluminumfoil.hebali.com"><img class="size-full wp-image-540 aligncenter" title="cardboardHeadsetA1" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/10/cardboardHeadsetA1.jpg" alt="" width="480" height="360" /></a></p>
<p style="text-align: center;"><a href="http://aluminumfoil.hebali.com"><strong>aluminumfoil.hebali.com</strong></a></p>
<p style="text-align: justify;">Here is a slideshow of some of my childhood work. Though I primarily focus on software development in my &#8220;adulthood,&#8221; my interests have remained much the same. The above image is of a design model for a virtual reality headset I constructed when I was nine or ten.</p>
<p style="text-align: justify;">This collection covers a sample of works from ages 5 to 13.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=539</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GoSort!</title>
		<link>http://blogs.hebali.com/itp/?p=535</link>
		<comments>http://blogs.hebali.com/itp/?p=535#comments</comments>
		<pubDate>Mon, 04 Oct 2010 13:22:30 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Games and Art]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=535</guid>
		<description><![CDATA[GoSort! is a human sorting algorithm game with mechanics similar to Go Fish. It can be played by two to four players. The object of the game is to hold the complete, sorted deck in your hand. I developed this for my Games &#38; Art class. It is still in its infancy. Here are the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">GoSort! is a human sorting algorithm game with mechanics similar to Go Fish. It can be played by two to four players. The object of the game is to hold the complete, sorted deck in your hand. I developed this for my Games &amp; Art class. It is still in its infancy.</p>
<p style="text-align: center;"><a href="http://blogs.hebali.com/itp/wp-content/uploads/2010/10/poker_card_suits.png"><img class="alignnone size-full wp-image-536" title="poker_card_suits" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/10/poker_card_suits.png" alt="" width="300" height="300" /></a></p>
<p style="text-align: justify;">Here are the rules:</p>
<ul>
<li>Each player receives seven cards, the rest remain in the deck.</li>
<li>Turns go clockwise around the circle.</li>
<li>The game ends when one player holds a complete sorted deck. If something prevents this from happening, the game should be replayed from the beginning.</li>
<li>During a player&#8217;s turn, he/she may ask one other player if that player holds a particular card (the 5 of Hearts, for instance). If the other player holds the desired card, they must hand it over along with any other cards that are &#8220;sequential&#8221; with the one that was requested. (See more on &#8220;sequential&#8221; cards below). If the other player does not hold the requested card, the player takes one card from the deck. In either case, the player does not go again until every other player has had a turn.</li>
<li>SEQUENTIAL CARDS: Players should order the cards in their hand in the following manner: Hearts then Diamonds then Clubs then Spades and from Two to Ace within each suit. Sequential cards are ones that touch one another within this ordering. So if a player is asked for a 4-D (4 of Diamonds) and their hand contains: J-H, K-H, A-H, 2-D, 3-D, 4-D, 6-D, they would have to hand over everything except for J-H and 6-D.</li>
</ul>
<p style="text-align: justify;">That&#8217;s how GoSort! is played. This sorting algorithm isn&#8217;t nearly as efficient as a computational sorting algorithm such as MergeSort or QuickSort, but hopefully it is more fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=535</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rock Paper Scissors – Genetic Optimization Visualization</title>
		<link>http://blogs.hebali.com/itp/?p=479</link>
		<comments>http://blogs.hebali.com/itp/?p=479#comments</comments>
		<pubDate>Wed, 15 Sep 2010 20:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Games and Art]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://blogs.hebali.com/itp/?p=479</guid>
		<description><![CDATA[Week 1: &#8220;Genetic Optimization Visualization&#8221; For our first session of Games &#38; Art, we looked at Rock Paper Scissors (RPS) as well as at strategies for winning this time-honored game. In the standard game, one point is awarded for rock beating scissors, paper beating rock or scissors beating paper. With this point assignment, there is [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/14974154" width="400" height="225" frameborder="0"></iframe></p>
<p style="text-align: justify;">Week 1: &#8220;Genetic Optimization Visualization&#8221;</p>
<p style="text-align: justify;">For our first session of Games &amp; Art, we looked at Rock Paper Scissors (RPS) as well as at strategies for winning this time-honored game.</p>
<p style="text-align: justify;">In the standard game, one point is awarded for rock beating scissors, paper beating rock or scissors beating paper. With this point assignment, there is no numerical strategy that will create a distinct advantage. Basically, the best way to win is to try to psyche the other player out or, to go a bit further, to make your rock, paper or scissors choices be as random as possible. In other words, R, P and S should each have a 33.3% chance of being chosen in each round. This makes sense given that RPS is generally thought of being more along the lines of a coin toss than a game.</p>
<p style="text-align: justify;">If we change the point distributions awarded to a winning R, P or S, however, the possibility of numerical strategies for winning begins to emerge.</p>
<p style="text-align: justify;"><span id="more-479"></span>One variation we considered in class was the following set of point assignments:  R:+10, P:+3, S:+1</p>
<p style="text-align: justify;">In this variation, the reward for winning with an S is only +1, which is much less than R or P. To make matters worse, if the other player happens to choose R, then the effective cost of choosing S can be thought of as -11 since the other player has gained 10 while you have also lost the opportunity to gain 1. Therefore, we can see that an optimal strategy for winning at this variation of the game would not be an even 33%/33%/33% distribution between R, P and S. Instead, we should favor our choices towards R or P. But to what extent?</p>
<p style="text-align: justify;">To find this out, I looked towards genetic algorithms. With the help of Dan Shiffman&#8217;s excellent <a href="http://www.shiffman.net/teaching/nature/ga/">genetic algorithm</a> text, I devised the following model for an algorithm that could be used to determine the optimal choice-probability distribution for any particular point distribution:</p>
<p style="text-align: justify;">First, I defined a Player class of objects, which contains four data points: a R, P, and S choice-probability value as well as the number of points the player has scored. Next, an initial population of players is generated. The choice-probabilities for each player are initially random, but hover somewhere close to an even 33%/33%/33% distribution. Once the population has been generated, the players are put into matches against one another. In each match, each player chooses an R, P or S in accordance with its choice-probability model. The winner of each match is awarded with the appropriate number of points. After the players have played a sufficient number of games against one another, their fitness for mating is determined by the number of points they have scored. So if one player has scored 10 points, the probability of its being selected for mating is ten times that of a player who has scored only 1 point.</p>
<p style="text-align: justify;">The mating process consists of pairing two players together and using some of each of their &#8220;genetic&#8221; traits to form a child player. I had to experiment with the best way to go about this mating process. Since the R, P and S choice probabilities for each player must add up to a total of 100%, we cannot disassociate these values from one another. My first thought was to simply average the two parents&#8217; choice-probability values to form the child&#8217;s values, but this turned out to produce somewhat muddy results and does not always come out to 100% probability total. The approach I eventually implemented was to take a number line between 0 and 1 and insert two barriers into it: one barrier separating R from P and one separating P from S. These two barriers can be moved anywhere in the number line and so long as they don&#8217;t cross one another or go above 1 or below 0, we will end up with positive R, P and S probability values that sum to 1.0 (or 100%). Using this way of the dividing the probability space works well for the mating process. Once two parents have been chosen for mating, the algorithm randomly decides whether to take one barrier value from each parent or both from one. Finally, to ensure that the gene pool does not get too incestuous, each child is given a 10% chance of mutating. If a child is chosen for mutation, it&#8217;s barrier values are moved randomly  in either direction by a small amount.</p>
<p style="text-align: justify;">With this genetic algorithm, the program is able to automatically find an optimal choice-probability model for a given RPS point distribution by using a survival of the fittest approach where fitness is determined by the player&#8217;s accumulated winnings over many games. The size of the population, the number opponents each player plays against, the number of matches that each pair of plays against one another and the number of generations over which the algorithm is run all have an effect on the accuracy of the algorithm&#8217;s determination of what constitutes an &#8220;optimal&#8221; choice-probability model.</p>
<p style="text-align: justify;">Next, I set about the task of creating a visualization that would present the optimal choice-probability distribution for a group of RPS point distribution variations. For visualization purposes, I had the good fortune of RPS being a three-dimensional system, which maps well to both 3D coordinates and RGB values.</p>
<p style="text-align: justify;">I assigned Rock to the X axis, Paper to the Y axis and Scissors to the Z axis. As we move along the X from 0 to 9, for instance, we add one to the value of winning with a rock and so forth for each of the axises and its respective R, P or S point value.</p>
<p style="text-align: center;"><a href="http://blogs.hebali.com/itp/wp-content/uploads/2010/09/colorAssignments.jpg"><img class="alignnone size-full wp-image-499" title="colorAssignments" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/09/colorAssignments.jpg" alt="" width="520" height="170" /></a></p>
<p style="text-align: justify;">At each coordinate in the grid, I represent the choice-probability distribution with a color. Rock is associated with the Red color dimension, Paper with Green and Scissors with Blue. So, if for instance, Rock was worth 9 and Paper and Scissors were both worth 0, the color of that grid coordinate should in theory be bright Red as an optimal strategy for this point distribution would presumably bias towards the choice of Rock.</p>
<p style="text-align: justify;">To show how the number of players, opponents, matches and generations affect the successfulness of the optimization process, I ran my visualization using varied parameters for these variables and recorded the results. Here are a few samples:</p>
<p style="text-align: center;">
<div id="_mcePaste" style="text-align: center;"><iframe src="http://player.vimeo.com/video/14972691" width="400" height="225" frameborder="0"></iframe></div>
<div id="_mcePaste" style="text-align: center;"><iframe src="http://player.vimeo.com/video/14973234" width="400" height="225" frameborder="0"></iframe></div>
<div id="_mcePaste" style="text-align: center;"><iframe src="http://player.vimeo.com/video/14973690" width="400" height="225" frameborder="0"></iframe></div>
<div id="_mcePaste" style="text-align: center;"><iframe src="http://player.vimeo.com/video/14974154" width="400" height="225" frameborder="0"></iframe></div>
<p style="text-align: justify;">Notice that with a small number of players, opponents and matches, the arrangement of color values is relatively unordered. With a larger number of players, opponents and matches, the color arrangements take on a linear gradient quality. This shows that greater optimization (or accuracy if you prefer) has been achieved with the larger population. If the smaller population were allowed to run for a much larger number of generations, it&#8217;s accuracy would begin to approach that of the larger population.</p>
<p>I wrote the genetic algorithm in C++ and the visualization uses openFrameworks.</p>
<p>WEEK 2: &#8220;Genetic RPS Newsfeed&#8221;</p>
<p style="text-align: center;"><a href="http://blogs.hebali.com/itp/wp-content/uploads/2010/09/live_feed.jpg"><img class="alignnone size-full wp-image-527" title="live_feed" src="http://blogs.hebali.com/itp/wp-content/uploads/2010/09/live_feed.jpg" alt="" width="394" height="524" /></a></p>
<p style="text-align: justify;">For last week&#8217;s assignment, I was interested in exploring the aesthetics of RPS as a type of zero-player game. In the book, <em>Evolution and the Theory of Games</em>, John Maynard Smith considers the ways in which game theory or the investigation of strategic advantage can be applied to our understanding of individual fitness and evolution within a population. For instance, with the Hawk-Dove game, he demonstrates how the aggressiveness of an individual&#8217;s strategy in competing for food affects population balance and, in turn, how evolutionarily stable populations can emerge from the proper mix of strategies utilized by individuals as part of an ecosystem. To call RPS a zero-player game is in some respects counter intuitive. There are, of course, two players. In a statistical sense, though, these two individuals are merely playing out the probabilities. Though each run of the aforementioned genetic algorithm is likely to produce slightly different optimal probability distributions for a given point distribution, the results vary only slightly and therefore indicate that to a large extent, there can be little individual differentiation in the numerical aspect of choosing a winning strategy.</p>
<p style="text-align: justify;">What remains, then, is a sort of mating dance. If no individual is truly more fit than any other, competition must be about the extent to which an individual is able to purport him or herself as more fit than another. That is to say, RPS is about psyching the other player out. The best way to win seems to be to focus on executing the steps of your own dance while trying remain undistracted by that of your opponent. It is hard to conjure random or statistically-weighted choices while in the midst of a mating dance. So for this week, I was interested in testing whether strategic advantage could be achieved by enhancing a player&#8217;s ability to do so.</p>
<p style="text-align: justify;">Using my genetic algorithm, I precompiled a list of R,P or S choices for a particular point distribution (R:10 P:3 S:1) and converted this list to an audio feed. Before entering a game of RPS with a human opponent, I donned a TV news anchor-style earpiece, which would be used to feed me a stream of R, P or S&#8217;s during game play. I then played a number of games against opponents who were not given any technological aid. After playing several opponents over a number of games, it was clear that this aid was indeed giving me an advantage over my opponents. Of course, RPS remains a game of probability and so I found that this device created an advantage but did not lead to a complete domination of all opponents in all cases.</p>
<p style="text-align: justify;">Is RPS a zero-player game? Understanding, of course, that I am using this term metaphorically and not by the technical definition (which is intended to describe dynamics more like Conway&#8217;s Game of Life, etc), I submit that RPS is a game of narrow margins. But so too is the mating game. If RPS falls somewhat short in meeting the criteria required by Smith&#8217;s comprehension of evolutionary advantage, perhaps it forms a better metaphor for the evolutionary state of humankind. That is to say, the availability of technology and the complexity of our society is such that the fitness criteria for an individual human cannot be clearly named. Rather, we live and die by something far more ephemeral, with all the same technologies, medicines, etc at our disposal, we have only the slight bias of our mating dance, our swagger, to put us ahead. In the end, this seems to make all the difference or possibly none at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.hebali.com/itp/?feed=rss2&#038;p=479</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
