<?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>Zachernuk.com &#187; simulation</title>
	<atom:link href="http://www.zachernuk.com/tag/simulation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zachernuk.com</link>
	<description>The desk of Brandel Zachernuk</description>
	<lastBuildDate>Thu, 02 Feb 2012 22:36:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Javascript physics!</title>
		<link>http://www.zachernuk.com/2011/01/30/javascript-physics/</link>
		<comments>http://www.zachernuk.com/2011/01/30/javascript-physics/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 05:12:29 +0000</pubDate>
		<dc:creator>Brandel Zachernuk</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[doodles]]></category>
		<category><![CDATA[balls]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[simulation]]></category>

		<guid isPermaLink="false">http://www.zachernuk.com/?p=747</guid>
		<description><![CDATA[A few years ago my friends Bill and Aidan and I started mucking about with the new javascript canvas class, and this is what we came up with. While there are other more robust physics engines out there &#8211; even in Javascript &#8211; it&#8217;s good to know how straightforward it is to get some of [...]]]></description>
			<content:encoded><![CDATA[<p>A few years ago my friends <a href="http://www.billsbooze.com" target="_blank" >Bill</a> and <a href="http://aidan.rfm.co.nz/blog" target="_blank" >Aidan</a> and I started mucking about with the new javascript canvas class, and this is what we came up with. While there are other more robust physics engines out there &#8211; even in <a href="http://box2d-js.sourceforge.net/" target="_blank" >Javascript</a> &#8211; it&#8217;s good to know how straightforward it is to get some of that behaviour working.  If for any reason you want to use this, please do!<br />
<br/></p>
<p><b>Usage:</b> Click and hold inside the grey square to create a ball.  The longer you hold down the mouse, the bigger the ball.  Click, drag around, and release a ball to &#8216;throw&#8217; it. You can change gravity and the drag coefficients by changing the numbers in the boxes below. Gravity can be any number, negative, positive or zero. Drag coefficient is only going to make sense as a number between 0 and 1. Greater than 1 means that energy is added to the system and things get a little crazy! <br/><br />
<b> Note: </b> to see this you will need to be using Firefox, Chrome or Opera. </p>
<p><script language="JavaScript" src="/wp-content/2011/01/ball.js"> </script><br />
 <canvas id="canvas" width="500" height="500" ></canvas></p>
<div id="debug"  style="background-color:#f0f0f0; width:300px;"> Click and drag inside this box to make a ball<br /> drag and release to move and throw a  ball.</div>
<div id="inputcontainers" style="border:thin solid black; width:200px;"> </div>
<p><b>Disclaimer:</b> Given that this was such a casual collaboration, please excuse the messiness of the code.  It was just the fastest way to get this kind of thing happening.  If you want a more coherent mechanism for control, Box2DJS is the way to go. </p>
<p><img src="http://www.zachernuk.com/wp-content/2011/01/2809594459_f716be8f5d_o.jpg" /><br />
<br/>(this is just so that a link to this post has a pretty picture to show!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachernuk.com/2011/01/30/javascript-physics/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Digital sand</title>
		<link>http://www.zachernuk.com/2010/03/17/digital-sand/</link>
		<comments>http://www.zachernuk.com/2010/03/17/digital-sand/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 03:07:20 +0000</pubDate>
		<dc:creator>Brandel Zachernuk</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[doodles]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[doodle]]></category>
		<category><![CDATA[emergent]]></category>
		<category><![CDATA[generative]]></category>
		<category><![CDATA[sand]]></category>
		<category><![CDATA[simulation]]></category>

		<guid isPermaLink="false">http://www.zachernuk.com/?p=400</guid>
		<description><![CDATA[As I have mentioned earlier, what excites me most about gaming &#8211; and computers in general &#8211; is the capability for simulation. If we create a system that obeys the same rules as reality, we can use that system to better understand reality. Not only that, it allows us to test out new theories and [...]]]></description>
			<content:encoded><![CDATA[<p>As I have mentioned earlier,  what excites me most about gaming &#8211; and computers in general &#8211; is the capability for simulation. If we create a system that obeys the same rules as reality, we can use that system to better understand reality.  Not only that, it allows us to test out new theories and ask  &#8220;what would happen if things were a little different?&#8221;</p>
<p>The complexity of the thing you simulate doesn&#8217;t have to be much either.  The term &#8220;computer simulation&#8221; often evokes imagery of simulating enormous and complex systems &#8211; weather patterns or the turbulence flow from a large-scale atomic detonation &#8211; but simulation can be useful on a more modest scale too.  In University, a friend of mine threw together a blackjack simulation.  He wanted to see the patterns of how well a virtual player does when it follows hard-and-fast rules &#8211; refusing cards over a total of 16, 18 and so on.* The first programmable computer, the Z3, ran at a staggering 10 Hertz &#8211; roughly one <em>billionth </em>of the speed of a modern computer.  Even at that speed, though, it brought the science of aviation forward by a decade through simulating wing flutter at rates of execution that were previously impossible to reach.</p>
<p>The example I often use to explain my fascination with simulation is this:  Imagine a child&#8217;s sand-pail at a beach.  Imagine the light dusting of sand it gets from a long day of use.  The smoothness at the joints, the build-up inside any detailing and under the lip.  Now imagine taking the bucket away and leaving the sand &#8211; the suggestion of form but not the form itself.  Next to impossible in reality, but in a simulation, once you have the base action down, setting things to on or off is the easiest thing in the world.</p>
<p><a href="http://www.zachernuk.com/wp-content/2010/03/sandy.PNG"><img class="alignnone size-full wp-image-407" title="sandy" src="http://www.zachernuk.com/wp-content/2010/03/sandy.PNG" alt="sandy" width="293" height="274" /></a></p>
<p>I&#8217;ve been using this example of the sand and the bucket for years now, and recently I decided to actually do something about it &#8211; make a sand simulation that can show you what I mean, rather than just telling people about it.  Here it is! Just move the mouse around on the play field to shift the sand.  If you want extra options for playing with the sand fall or changing the pen size, open the options panel.  Many thanks to Aidan of <a href="http://aidan.rfm.co.nz/blog/">Shade and Prime</a> for the fantastic elevation visualizer.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SandDisplacer_1724839488"
			class="flashmovie"
			width="400"
			height="600">
	<param name="movie" value="http://www.zachernuk.com/wp-content/2010/03/SandDisplacer.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.zachernuk.com/wp-content/2010/03/SandDisplacer.swf"
			name="fm_SandDisplacer_1724839488"
			width="400"
			height="600">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>iPhone app, anyone?</p>
<p>*  While it might seem like this is a less-than-useful endeavour to use computers for, I&#8217;m sure we can all agree that it is better to test a virtual player losing virtual money than trying it at your local casino.  In fact, after finding that there is no foolproof approach to blackjack, he gave up on it altogether and started putting his money in the stock market&#8230; you win some, you lose some.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachernuk.com/2010/03/17/digital-sand/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>On the crappy lessons that games teach us &#8211; and an Opticks update!</title>
		<link>http://www.zachernuk.com/2009/07/05/crappy-lessons/</link>
		<comments>http://www.zachernuk.com/2009/07/05/crappy-lessons/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 19:34:20 +0000</pubDate>
		<dc:creator>Brandel Zachernuk</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Incidental Learning]]></category>
		<category><![CDATA[bandwagon]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[opticks]]></category>
		<category><![CDATA[youtuber]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[lessons]]></category>
		<category><![CDATA[Opticks]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[simulation]]></category>

		<guid isPermaLink="false">http://www.zachernuk.com/?p=242</guid>
		<description><![CDATA[The lessons that we learn from a lot of entertainment can be really, really bad.  I don&#8217;t just mean moral or ethical lessons (though Cracked magazine makes light of those to great result), but lessons about how the world literally works.  When every punch is a knockout, and every bullet into a car creates an [...]]]></description>
			<content:encoded><![CDATA[<p>The lessons that we learn from a lot of entertainment can be really, really bad.  I don&#8217;t just mean moral or ethical lessons (though <a href="http://www.cracked.com/article_16905_7-classic-disney-movies-that-taught-us-terrible-lessons.html" target="_blank">Cracked magazine makes light of those to great result</a>), but lessons about how the world literally works.  When every punch is a knockout, and every bullet into a car creates an explosion we do ourselves a disservice.  The defense &#8220;it&#8217;s not important, because entertainment is supposed to be a diversion from the real world&#8221; is often used as rebuttal here, but I think it misses a crucial point.  Movies and books can be a great way to allow people to think about new ideas &#8211; what happens if the sun goes dark, whether there could be a space elevator etc. &#8211; but games actually let people test some of these ideas out.  What happens when I take a corner in a bus at a hundred miles an hour?  How many crates can I stack on top of each other before the bottom one collapses?</p>
<p>There are countless videos on Youtube of people trying these things out &#8211; stacking barrels in Farcry or balancing helicopters on top of other helicopters in Battlefield: Vietnam.  Constance Steinkuehler, an academic in the field of Educational Communications &amp; Technology, asserts that kids in <em>Lineage </em>and <em>World of Warcraft</em> have been unwittingly <a href="http://www.wired.com/gaming/gamingreviews/commentary/games/2008/09/gamesfrontiers_0908" target="_blank">conducting experiments according to the scientific method</a> in order to understand the world around them!  This behaviour seems to be quite common.  If you look through any forum dedicated to a game  you&#8217;ll find extensive write-ups of all the units, power-ups and a weigh-in on whether something is worth having or doing.  <a href="http://strategy.diii.net">Http://strategy.diii.net,</a> a site for <em>Diablo II</em>, h0as links to strategy guides which outline the principles of experiment design. A site dedicated to <em>World of Warcraft</em>,  <a href="http://www.thottbot.com">thottbot.com</a>, calculates the probability of a monster dropping an item to three significant figures!</p>
<p>In one respect, this is a wonderful development.  People are using rigorous, principled methods of investigation in order to understand the worlds they find themselves in.  On the other hand, those environments are not only artificial &#8211; video games are necessarily artificial &#8211; but worlds with such a feeble resemblance to reality that no relevant knowledge can be gleaned through experimentation.  This is tragic.</p>
<p>This is not an attack on all games, though.  This frustration is aimed at worlds that purport to some degree of realism &#8211; racing games where an autopilot takes control when you spin out (<em>Ridge Racer</em>), or momentum values that are tweaked with no justification to make a spacecraft more maneuverable as a game progresses. I don&#8217;t think all games have to have Newton-perfect calculations of mass and velocity, but I think there ought to be games that at least try.</p>
<p>Towards that end, here&#8217;s another update of what I&#8217;ve been working on.  It&#8217;s really hard to resist holding off on an update because I&#8217;m so close to a breakthrough, but I&#8217;ve found that after one breakthrough is made, it always seems &#8216;close enough&#8217; to the next to hold off again. Consequently, there&#8217;s a lot in now that wasn&#8217;t in the last build. The list of what&#8217;s new is probably less interesting than the thing itself, so here it is:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_opticks-20090704_56403764"
			class="flashmovie"
			width="400"
			height="600">
	<param name="movie" value="http://www.zachernuk.com/wp-content//opticks-20090704.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.zachernuk.com/wp-content//opticks-20090704.swf"
			name="fm_opticks-20090704_56403764"
			width="400"
			height="600">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<ul>
<li><strong>Colour sliders:</strong> Now, rather than relying on the colour of a mirror being made on the fly, you can select the colour of all the elements, setting a laser to beam only red light, or a mirror to reflect only yellow light etc.</li>
<li><strong>Rotation:</strong> Works now.  You click to select a pivot to rotate the selection about, and drag around to place &#8216;em.</li>
<li><strong>Tooltips: </strong> Finally, there is a little feedback about what things are and what to do with them!</li>
<li><strong>Cirlces: </strong>Only work with lasers at the moment, but they are solid, circular mirrors that could be considered to have a &#8220;mass&#8221;.  One day.</li>
<li><strong>Polygons: </strong>These do work with beams and lasers, but do some silly things with beams (when you point the beam on to an angle less than 180º) . These could also be considered to have mass one day.</li>
</ul>
<p>What&#8217;s next?  Remote loading and saving (I&#8217;m going to need some help with PHP for that), and then Box2D!  I&#8217;ve been messing around with some ideas for games that could actually <em>use</em> this engine, and I&#8217;ve come up with one idea, which I&#8217;ve sketched out on <a href="http://www.flickr.com/photos/brandelf/3635546314/">my Flickr page</a>, but that&#8217;s as far as it goes right now.  When I have more, I will show it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachernuk.com/2009/07/05/crappy-lessons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

