<?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>benbritten.com &#187; Unity</title>
	<atom:link href="http://benbritten.com/category/blog/unity/feed/" rel="self" type="application/rss+xml" />
	<link>http://benbritten.com</link>
	<description>Software should be simple.</description>
	<lastBuildDate>Wed, 09 May 2012 12:37:48 +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>Infinite Universe free on the app store!</title>
		<link>http://benbritten.com/2012/02/28/infinite-universe-free-on-the-app-store/</link>
		<comments>http://benbritten.com/2012/02/28/infinite-universe-free-on-the-app-store/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 00:26:15 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=1082</guid>
		<description><![CDATA[I have been neglecting this blog. I apologize to anyone of the very very few who used to follow me regularly. For the most part you should really be watching the Tin Man Games blog since that is where I &#8230; <a href="http://benbritten.com/2012/02/28/infinite-universe-free-on-the-app-store/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been neglecting this blog.  I apologize to anyone of the very very few who used to follow me regularly.  For the most part you should really be watching the Tin Man Games blog since that is where I spend most my time these days: <a href="http://tinmangames.com.au">http://tinmangames.com.au</a>.</p>
<p>However, I thought I would try to maybe post a few more things now and again, just to keep my writing chops a bit less rusty. </p>
<p>I have spent the last three months porting the <a href="http://tinmangames.com.au/blog/?p=1628">Gamebook Adventures engine to Android via Unity3D</a>. Once that is all done and on the various Android app stores I will have more to say on the journey from iOS to Android, and will probably do a few blogs posts about how I got the engine to work well in just about any resolution.</p>
<p>But for now, I just wanted to say that the latest book is out: <a href="http://gamebookadventures.com/gamebooks/infinite-universe/">Infinite Universe</a>.  It is a pretty fantastic scifi romp and is our longest and most replay-able book yet.  It is also free for the first 300 sections. (which is half as long as our first book, <a href="http://gamebookadventures.com/gamebooks/an-assassin-in-orlandes/">An Assassin in Orlandes</a>, which is still one of the best gamebooks around and eminently replay-able.)</p>
<p>Since it is free, everyone who reads this blog should go and download it!  It is a great book and if you like RPGs or tabletop gaming, you will really enjoy the gamebooks. Even if you never plan to read it, the downloads help our ranking and it is free, so why not? :-)</p>
<p>Thanks again!<br />
-B</p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2012/02/28/infinite-universe-free-on-the-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with Unity3d at Freeplay 10</title>
		<link>http://benbritten.com/2010/08/14/getting-started-with-unity3d-at-freeplay-10/</link>
		<comments>http://benbritten.com/2010/08/14/getting-started-with-unity3d-at-freeplay-10/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 11:58:15 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=1067</guid>
		<description><![CDATA[So. I gave a talk to day at Freeplay 10 all about Unity3d. I thought it was a bit scattered and I only got through about half of the stuff I wanted to get to (I didnt get to coroutines!! &#8230; <a href="http://benbritten.com/2010/08/14/getting-started-with-unity3d-at-freeplay-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So. I gave a talk to day at <a href="http://www.freeplay.net.au/">Freeplay 10</a> all about Unity3d. I thought it was a bit scattered and I only got through about half of the stuff I wanted to get to (I didnt get to coroutines!! they are very important!)  However, the audience was absolutely awesome and they ask really fantastic questions and it was a very interactive and fun session. Also, it was totally packed. </p>
<p>People were sitting on the floor and the room was about 35 degrees (that is 35 degrees C, for those of you in the states, that is approximately a million degrees fahrenheit).  But all in all it was pretty awesome.</p>
<p>For anyone just tuning in, the talk started out with a quick tour of the unity interface, then I basically dove right into building a game prototype from scratch, trying to get it done in just over an hour. It was a bit of a frenzy of code and components and general Unity awesomeness.  Well, I ended up only getting through the creation of a plane that you could fly around and shoot stuff and crash into things and exploding.  That is as far as I got :-) I did not make ti to enemy turrets, or procedural city generation. However, as I mentioned earlier, there were so many good questions that I probably covered more actual material than I had originally planned.</p>
<p><a href="http://benbritten.com/wp-content/uploads/2010/08/Screen-shot-2010-08-14-at-9.45.44-PM.png"><img src="http://benbritten.com/wp-content/uploads/2010/08/Screen-shot-2010-08-14-at-9.45.44-PM-300x225.png" alt="" title="Screen shot 2010-08-14 at 9.45.44 PM" width="300" height="225" class="aligncenter size-medium wp-image-1068" /></a><br />
(This is the prototype game using the frogames buildings, roads, textures and the plane)</p>
<p>Anyhow.  Since the talk was all about prototyping, I was using the totally fantastic and incredably inexpensive <a href="http://www.frogames.net/content-packs/protopack.html">protopack</a> from <a href="http://www.frogames.net/">frogames</a>.  These guys have a handful of unity compatible content packs that are absolutely worth every cent in terms of time saved and making it so easy to just grab a few prefabs, throw them into a scene attach a few scripts and you have your game idea outlined and ready to tweak.</p>
<p>However, I want to be able to give away the project, but I cannot give away the protopack&#8230; sooo I went in and stripped out the proto pack stuff and replaced it with primitives.  It doesnt look as nice, but it still does the job, and you can get to the scripts and have a play with all the stuff I talked about today.</p>
<p><a href="http://benbritten.com/wp-content/uploads/2010/08/Screen-shot-2010-08-14-at-9.42.36-PM.png"><img src="http://benbritten.com/wp-content/uploads/2010/08/Screen-shot-2010-08-14-at-9.42.36-PM-300x225.png" alt="" title="Screen shot 2010-08-14 at 9.42.36 PM" width="300" height="225" class="aligncenter size-medium wp-image-1069" /></a><br />
(this is the non-awesome looking primitives-only version of the project, which you can download)</p>
<p>So anyway, here is the <a href="http://benbritten.s3.amazonaws.com/FreeplayProject.zip">Freeplay project</a> sans protopack stuff.</p>
<p>SO: here is my advice:  go and buy the protopack, it is only like $15 or something stupidly cheap.  Then go and build your prototype game.</p>
<p>Let me know if you have questions or whatever!</p>
<p>Cheers!<br />
-B</p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2010/08/14/getting-started-with-unity3d-at-freeplay-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New uniTUIO CE scripts</title>
		<link>http://benbritten.com/2010/05/04/new-unituio-ce-scripts/</link>
		<comments>http://benbritten.com/2010/05/04/new-unituio-ce-scripts/#comments</comments>
		<pubDate>Mon, 03 May 2010 23:36:10 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[BBTouch]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[multitouch]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=989</guid>
		<description><![CDATA[Hello everyone! Thanks to anyone who stopped by the Unity3d booth at GDC and said howdy to Sandor and I and checked out the multi-touch table: the FishTish. As promised, the updated uniTUIO scripts have been made available on the &#8230; <a href="http://benbritten.com/2010/05/04/new-unituio-ce-scripts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello everyone!</p>
<p>Thanks to anyone who stopped by the Unity3d booth at GDC and said howdy to Sandor and I and checked out the multi-touch table: the FishTish.</p>
<p>As promised, the updated uniTUIO scripts have been made available on the <a href="http://xtuio.com">xtuio.com</a> site!</p>
<p>They have actually been up for quite some time now, but I ahve been (as usual) either too busy or too lazy to get a post up, so here it is:</p>
<p>Note: they have been pretty much fully redesigned to take advantage of the &#8216;iPhone Input&#8217; style of touch detection.  </p>
<p>What does this mean?  Well, the older scripts used a more centralized raycasting and distribution method.  There was one main event handler that took each touch point and checked to see if it collided with any registered &#8216;touchable&#8217; objects.  This is a perfectly good design, and it works very well when you have lots and lots of points (in other words, you are only raycasting once per touch per frame)</p>
<p>However, we decided to go away from that and create a fake iPhoneInput class that you can access from the desktop version of Unity.  </p>
<p>Why?</p>
<p>Well, the most compelling reason was so that we could quickly and easily port iPhone apps to the touch table.   Once I had the faux iPhoneInput class that was being populated with TUIO generated touch information, then it was trivial to take a few of the iPhone apps (and most all of the Unity iPhone tutorial projects) and simply drop them in and have them &#8216;just work&#8217;.</p>
<p>In fact, funny story:  On the first day of the GDC expo, I had another Unity/iPhone dev come up and he was excited about the FishTish and thought that his app: iPottery would work really well on it.  I grabbed the code from him with the intention of dropping in our scripts and installing it as one of the demo apps on the FishTish.  Well, that day was quite a long one and I did not have the energy to actually do anything with the script until the next morning.  I spent approximates 15 minutes with a totally unfamiliar code base (iPottery scripts are all in JS and the uniTUIO stuff is all in C#, so that also speaks to how simple it is to use them :-) and I had it working no problems.  I spent most of my time deleting the onGUI stuff (onGUI doesnt work with uniTUIO, soory!) and adding some guiText/guiTexture based buttons instead.  </p>
<p>For the next two days of the expo we showed off iPottery along with all the other demo apps and it worked great!</p>
<p>Ok, enough of my tangent, how does this actually work?</p>
<p>Well, grab the sample project from the link above, there are two scenes, one called &#8216;basic touch&#8217; and one called &#8216;buttons&#8217;.  Buttons actually contains the entirety of &#8216;basic touch&#8217;. (it just has more buttons in it)</p>
<p>Effectively what the new scripts provide is am iPhoneInput class that you can use in your TUIO enabled MT apps just like you would if you were writing an app for your iPhone or iPad.  I have provided a dozen or so scripts that show some examples of how to use the iPhoneInput to do things like basic drag/scale/rotate and build buttons using either GUIText/GUITextures or 3d objects.  </p>
<p>I havent had time to put together a video yet, but the code is pretty easy.  The only thing that you will need is to make sure that you have an active BBiPhoneInputManager script running somewhere in your scene.  </p>
<p>I use the BBTouchManagerStarter script to check to see if there is already an input manager and if not then make one.  This is good because if you switch scenes, the input manager does not get destroyed.  In an actual deployment, you can just instantiate one in your opening scene and be done with i, but during testing when you want to be able to just look at the scene you are in, this can become cumbersome, so I use the BBTouchManagerStarter in all my scenes instead.</p>
<p>Cheers!<br />
-Ben</p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2010/05/04/new-unituio-ce-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>it&#8217;s a uniTUIO Xmas</title>
		<link>http://benbritten.com/2009/12/25/its-a-unituio-xmas/</link>
		<comments>http://benbritten.com/2009/12/25/its-a-unituio-xmas/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 23:53:06 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[BBTouch]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[multitouch]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=946</guid>
		<description><![CDATA[It is xmas morning here in oz, so for those of you who celebrate that sort of thing, I hope you are having a fun one! For everyone else, I hope that the wintery holiday season is similarly lovely for &#8230; <a href="http://benbritten.com/2009/12/25/its-a-unituio-xmas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It is xmas morning here in oz, so for those of you who celebrate that sort of thing, I hope you are having a fun one! For everyone else, I hope that the wintery holiday season is similarly lovely for you as well.</p>
<p>In any case, I managed to stay up very very late a few nights ago and went through the Molecules codebase and extracted the essence into what we are calling the <a href="http://xtuio.com">uniTUIO community edition</a>.  </p>
<p>If you have not heard of this before, the basic idea behind uniTUIO is to have a nice set of scripts to allow you to easily implement TUIO based multi touch input into any Unity3d application.</p>
<p>If you dont have Unity3d or dont know what it is, then you really should go to www.unity3d.com and get a copy.  It is crossplatform and the basic version is free (and it really isn&#8217;t very basic, I built a couple complete games using that version (back when it was called the indie version)).</p>
<p>Anyhow, the home of uniTUIO is at the <a href="http://xtuio.com">xTUIO.com</a> website.  Ultimately I will be publishing posts like this one up there, but for now, since it is still early days and not that many people know about xTUIO.com I will post this here and have sandor crosspost it there.</p>
<p>Currently the uniTUIO CE is comprised of a unity project which has a couple basic scenes and a couple dozen scripts.  Also, I made a couple videos showing how to use the various scenes.</p>
<p>There are two basic methods to get at the TUIO event information.  </p>
<p>The first one, which is used by the BBCrosshairController and BB3dCrosshairController scripts, is a simple polling method.  These scripts have access to all of the touch information for the entire surface and can act accordingly.  </p>
<p>These scripts call up to a singleton script: BBTouchEventManager.  It is the touch event manager that actually takes the TUIO information and converts it into a BBEvent object, which basically means that it converts the information from TUIO form into a Unity friendly format.  </p>
<p>If you are building a &#8216;traditional&#8217; sort of unity game where you have a central character that you are controlling, then using this polling method makes sense.  This is basically the same thing as using the Input class in unity or the iPhoneInput class in Unity iPhone.</p>
<p>One example of this is the particles scene which uses a script called the BB3dCrosshairController which polls for all available events and spawns a particle system under any touch events.  using this method you can replicate all the fun &#8216;fire from the fingertips&#8217; sort of MT demos in about 3 minutes.  (or longer if you are like me and love to just tweak the particle systems for ever and ever to get them &#8216;just right&#8217;.  Note: the particle system that I did for the examples is not &#8216;just right&#8217;, i just threw some values at it so that you would have an idea of how to do it yourself)</p>
<p><a href="http://benbritten.com/wp-content/uploads/2009/12/Picture-4.png"><img src="http://benbritten.com/wp-content/uploads/2009/12/Picture-4-300x199.png" alt="Picture 4" title="Picture 4" width="300" height="199" class="aligncenter size-medium wp-image-949" /></a></p>
<p>However, in many multi-touch applications you tend to have dozens and dozens of objects in the scene that all need to be aware of any touch events that are interacting with them.  In this case it does not make good design sense to have each and every object grab a copy of all the events and try to figure out if any of them apply to that specific object. Instead we have a central distribution point that checks the incoming events against the scene full of objects and sends out event messages as appropriate.  </p>
<p>This is where the BBTouchable scripts come in.  The BBTouchEventManager takes the raw TUIO events and raycasts through the scene looking for any objects that are both in a special &#8216;touchableObjects&#8217; layer and have a BBTouchable script attached to them.</p>
<p>The BBTouchable script provides some overrideable abstract touch input handling methods.  For the most part, when doing MT apps that deal with lots and lots of different objects that need touch inputs, you will be subclassing BBTouchable to get your custom functionality.  </p>
<p>In the uniTUIO scripts I have made a few example subclasses of BBTouchable.  one is called BBBasicTouchManipulation, and it provides any object with the basic single touch to drag/double touch to scale and rotate gestures that are very common in MT apps.<br />
<a href="http://benbritten.com/wp-content/uploads/2009/12/Picture-2.png"><img src="http://benbritten.com/wp-content/uploads/2009/12/Picture-2-300x199.png" alt="Picture 2" title="Picture 2" width="300" height="199" class="aligncenter size-medium wp-image-951" /></a></p>
<p>The second one, BBTouchableButton shows how you can make a button that lives in 3d space and reacts to touch events.<br />
<a href="http://benbritten.com/wp-content/uploads/2009/12/Picture-3.png"><img src="http://benbritten.com/wp-content/uploads/2009/12/Picture-3-300x201.png" alt="Picture 3" title="Picture 3" width="300" height="201" class="aligncenter size-medium wp-image-950" /></a></p>
<p>You should have everything you need to get started with Unity and TUIO now.  If you have questions, dont hesitate to comment here or on the xtuio site, or email me directly, or pm me at the unity forums, or whatever.</p>
<p>Cheers!<br />
-b</p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2009/12/25/its-a-unituio-xmas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mole at GCAP: Very well received!</title>
		<link>http://benbritten.com/2009/12/09/mole-at-gcap-very-well-received/</link>
		<comments>http://benbritten.com/2009/12/09/mole-at-gcap-very-well-received/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 05:24:53 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=939</guid>
		<description><![CDATA[(Note: this is cross posted from Escape Factory) Chris and I just got back from the Global Connect Asia Pacific game dev conference here in Melbourne. We entered Mole into the GDAA Independent Games Awards 2009 and got selected as &#8230; <a href="http://benbritten.com/2009/12/09/mole-at-gcap-very-well-received/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>(Note: this is cross posted from <a href="http://escfactory.com/2009/12/mole-at-gcap-total-success/">Escape Factory</a>)</p>
<p><a href="http://designerwatts.com">Chris </a>and I just got back from the <a href="http://www.gameconnectap.com/">Global Connect Asia Pacific</a> game dev conference here in Melbourne.  We entered <a href="http://escfactory.com/mole">Mole</a> into the GDAA Independent Games Awards 2009 and got selected as one of the finalists.  </p>
<p>As a GDAA finalist we were invited to put up a table and show off our game at the conference.  Chris whipped up a few posters and I grabbed a couple of the stray laptops that I have laying around and we hit the expo.<br />
<a href="http://escfactory.com/mole"><br />
<img src="http://escfactory.com/wp-content/uploads/2009/12/Mole_Icon_125x125.png" alt="Mole_Icon_125x125" title="Mole_Icon_125x125" width="125" height="125" class="aligncenter size-full wp-image-318" /><br />
</a><br />
GCAP is not a gamer expo, it is a game developer expo, so all the people there are somehow involved in the creation of games.  Over the two day expo, we spoke to a zillion talented and creative people and they all played Mole, and let us know what they think.</p>
<p>The response was overwhelmingly positive.  We had people coming back two and three times to just sit and play Mole during the downtimes.  We had people who just sat down to have a quick look end up staying for 30 minutes trying to dig deeper and deeper.  </p>
<p>Best of all however was the ability to watch people play the game.  We spent a huge amount of time before the conference making sure that the core game play was solid and that the game was fun, and we were richly rewarded for that effort.  However, watching people play the game highlighted the areas of the user interface that were lacking.  It made apparent the places where we need to change the words on the menus or add new buttons.  For instance, when you go to the upgrade shop from the end-of-dig scorecard, it is not at all obvious how to get back.  Similarly, when people play it for the very first time, they run out of air and get back to the surface and don&#8217;t realize that they need to hit the &#8216;finish digging&#8217; button to end the dig so they can start a new one.  We even found a few gameplay bugs that we will iron out.</p>
<p>We are currently going through and tweaking all these little bits and pieces to try to hone the user experience before we release it to the app store.  But we want people to play the game so I have put up the GCAP version online so that anyone can play it for free. </p>
<p>If you are into it: head over to the <a href="http://escfactory.com/mole"><b>Mole page</b></a> and hit the &#8216;play now&#8217; link.  You will need the Unity3d player, and you can get it from the game page.</p>
<p><a href="http://escfactory.com/mole"><img src="http://escfactory.com/wp-content/uploads/2009/12/Mole_Icon_512x512-150x150.png" alt="Mole_Icon_512x512" title="Mole_Icon_512x512" width="150" height="150" class="aligncenter size-thumbnail wp-image-319" /></a></p>
<p>We are planning on keeping the online version free to use, and we will be updating it alongside the iPhone version, so if you come back and notice some new tweaks here and there, that is why.</p>
<p>We love to hear what you have to say about the game, so send me an email, or leave a comment here!</p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2009/12/09/mole-at-gcap-very-well-received/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uniTUIO coming soon! no, really!</title>
		<link>http://benbritten.com/2009/11/11/unituio-coming-soon-no-really/</link>
		<comments>http://benbritten.com/2009/11/11/unituio-coming-soon-no-really/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 23:55:53 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[BBTouch]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[multitouch]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=924</guid>
		<description><![CDATA[Hello everyone! Since we announced uniTUIO a few months ago, and entered a uniTUIO-enabled app into the Unite09 contest, there has been a flood of emails coming in asking me if we are releasing the uniTUIO source. So! Here is &#8230; <a href="http://benbritten.com/2009/11/11/unituio-coming-soon-no-really/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello everyone!</p>
<p>Since we announced <a href="http://xtuio.com/blog/2009/09/03/new-multi-touch-project-unituio/">uniTUIO</a> a few months ago, and entered a uniTUIO-enabled app into the Unite09 contest, there has been a flood of emails coming in asking me if we are releasing the uniTUIO source.</p>
<p>So!  Here is the answer:</p>
<p>Yes!</p>
<p>But I have to find a few free hours to rub together to get the code into a useable and clean form. We set out with the goal of having a nice framework of scripts to make using TUIO inputs in UNity3d trivially simple.  I think we succeeded. </p>
<p>uniTUIO was built during (and for) the Molecules project (which was really a half-dozen different media presentation applications).  As the project deadline began to loom, making the Molecules apps became a bigger priority than preserving the purity and re-usability of the uniTUIO framework.  As a result, I had to cut many corners in order to meet the deadline (which pretty much always happens) so the uniTUIO stuff is riddled with Molecules specific code which is neither generically useful, or particularly re-usable in any easy way.</p>
<p>So, I need to go back in and refactor the uniTUIO stuff to make it not suck basically.</p>
<p>However, I will explain to you what the uniTUIO stuff includes, so that you can at least not get your hopes up too much :-)</p>
<p>First off, at the low level, it starts with the c# TUIO/OSC implementation by Martin Kaltenbrunner, which everyone can get ahold of here:   <a href="http://reactivision.sourceforge.net/">http://reactivision.sourceforge.net/</a>.</p>
<p>On top of that is pretty much where uniTUIO starts.  It is a collection of about a dozen scripts.  There are a few static singleton &#8216;manager&#8217; style objects that start up the TUIO scripts and listen to the events as they come in.  These convert the TUIO data stream into some portable &#8216;event&#8217; objects that include the local Unity environment information. (in other words they convert from TUIO screen-space to Unity viewport space).</p>
<p>Also there is an event manager that does raycasting into the unity scene and picks out any objects that are in the right layer (a &#8216;touchable&#8217; layer) and passes the events onto those objects.</p>
<p>There are a few more scripts that are meant to be attached to touchable objects.<br />
One is a high level touch event handler that accepts touch events from the event manager and applies them to it&#8217;s gameObject in a generic fashion.<br />
Inherited from that object is a basic touch manipulation script that provides simple gesture support to handle the basics like dragging, rotating and scaling a gameObject.</p>
<p>That is what uniTUIO includes. It is meant to be a simple starting place for you to be able to build on for your own MT projects in unity.</p>
<p>So anyway, we will announce it when we release it (hopefully sometime this month) so keep an eye on the RSS feeds.  Cheers!<br />
-B</p>
<p>ps: for those of you who are very impatient, have a look at <a href="http://forum.unity3d.com/viewtopic.php?t=9755&#038;start=0&#038;postdays=0&#038;postorder=asc&#038;highlight=&#038;sid=d6d65845e8e6a41dd0965bf1ebc5b189">this thread</a> on the unity forums. User Jorgen posted a simple unity TUIO implementation project, which is a good place to get started.  </p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2009/11/11/unituio-coming-soon-no-really/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My thoughts on Unity Free</title>
		<link>http://benbritten.com/2009/10/29/my-thoughts-on-unity-free/</link>
		<comments>http://benbritten.com/2009/10/29/my-thoughts-on-unity-free/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 00:51:40 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=921</guid>
		<description><![CDATA[Just recently, like, very recently (maybe a few hours ago) Unity released their base-level product, Unity Indie for free. This is pretty huge news for the game development community. It is, as they say (and forgive the pun) a Game &#8230; <a href="http://benbritten.com/2009/10/29/my-thoughts-on-unity-free/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just recently, like, very recently (maybe a few hours ago) Unity released their base-level product, Unity Indie for <a href="http://unity3d.com/#freeunity">free.</a></p>
<p>This is pretty huge news for the game development community. It is, as they say (and forgive the pun) a Game Changer.</p>
<p>If you don&#8217;t already know, Unity is a very powerful tool for rapidly building games. (it is billed as a 3d game engine, but it also works quite well for <a href="http://escfactory.com/2009/10/mole-coming-soon-for-iphone-play-it-now-on-the-web/">2d games</a>) One of the many features of Unity is the ability to take the game project you have built, and with the click of the mouse, build a version for the mac, a version for the pc and a version that runs in a web browser.  This is excellent for distributing your game but it has other side benefits as well.  I collaborate with people all over the world, and we use the in browser games to share our ideas quickly and easily, not to mention it is much easier to get your testers to test out your prototypes if all they have to do is open a browser window.  </p>
<p>Before now, the indie version was not very expensive, less than $200 or so, but now that it is free, I think we will see a flood of new and interesting games come out in the coming months.  </p>
<p>What does this mean for indie game development?</p>
<p>Well, the obvious thing is that we will see a ton more web based titles, probably lots of crap, but there will always be a few gems in there.  </p>
<p>I think that Flash development will start to see a big challenge from the Unity guys.  I know a ton of flash guys who have been eyeing unity for awhile now and this will most likely push them over the edge.  dont get me wrong, flash is a great tool, and it is great for making games, but it is not a game-building-tool.  Unity is designed from the ground up to make games. Here is a good post to read if you a flash dev who is on the fence: <a href="http://diamondtearz.org/2009/01/14/10-reasons-for-flash-developers-to-learn-unity-3d/">http://diamondtearz.org/2009/01/14/10-reasons-for-flash-developers-to-learn-unity-3d/</a></p>
<p>The even bigger news for me as an iPhone developer is that I think many many more people will start to use unity to build games for the iPhone.  </p>
<p>Now, Unity iPhone Basic (the cheapest iPhone license) is still about $400.  And some of the zero budget indie developers might have to think twice about that kind of money (it is totally worth it, trust me) But now you can download the Unity Free and prototype your game, or release a web version or just get to know unity and then be ready to port it over to the iPhone version.  We are doing that right now with &#8216;Mole&#8217; and I will be blogging about what it takes to move a prototype level game from the desktop version of unity into a working iPhone version.</p>
<p>I will also be interested to see how this effects the other iPhone game-focused APIs like cocoas2d.  Cocoas2d and the like are still free (so still $400 cheaper than using unity to develop your game) and if you are building a 2d game it makes a lot of sense to start with cocoas2d, but I can tell you from my personal experience that building a 2d game with unity is very easy and if your time is worth anything to you then the $400 investment to upgrade to iPhone Basic is well worth the money.  Also, I cant stress this enough, you can now prototype your game in Unity for free.  Even if you then decide to use cocoas2d to build the deployment version (a few reasons you might want to do this, more on that in a second) you can still do a rapid prototype with Unity to figure out all your gameplay mechanics and decide if the game is fun or not.</p>
<p>So, Unity is great, but what are the downsides?</p>
<p>Well, in terms of desktop or web development, there aren&#8217;t any real downsides.  Go get a copy and start making games. </p>
<p>In terms of iPhone development there are a few caveats.  </p>
<p>First off, as i have mentioned, it is not free. But $400 is very cheap for what you get.</p>
<p>The biggest issue with using Unity Basic (and to some extent this applies to the pro version as well) to develop iPhone games is that your app size will not be under 10M (which is the size limit for apps to be able to be downloaded over the cell network).  For the most part this is not a big deal, most games with any amount of depth tend to be bigger than 10M no matter the development tools used.  </p>
<p>However, the casual games that you are trying to sell for $0.99 and you want to be an impulse buy, and so you want them to be less than 10M, these are nigh impossible to make with Unity.  Why is that? Well, the unity engine is very capable, comes with all sorts of great things like built in physics, scripting, shaders, and lots of other goodies, but all that comes at the cost of size.  If you spring for iPhone Advanced then you can strip out parts of the engine you are not using, and possibly get under the 10M mark, but this is a very hard thing to do.</p>
<p>My advice: even if you are looking to build small casual games for the iPhone, I would still suggest you get the now free Unity and prototype with it. Then once your game is working fall back on one of the other frameworks like cocoas2d to build it.  However, if you have even an inkling that your game will exceed the 10M limit, then just get the iPhone version.</p>
<p>Cheers!<br />
-B</p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2009/10/29/my-thoughts-on-unity-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UIWebview overlay for Unity3d on the iPhone</title>
		<link>http://benbritten.com/2009/09/24/uiwebview-overlay-for-unity3d-on-the-iphone/</link>
		<comments>http://benbritten.com/2009/09/24/uiwebview-overlay-for-unity3d-on-the-iphone/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 02:15:07 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=905</guid>
		<description><![CDATA[I just wrote a big post about how to open up a UIWebView overtop of the unity game engine. This is a good way to add Playhaven integration to your app, as we are doing with Snowferno. Anyway, I posted &#8230; <a href="http://benbritten.com/2009/09/24/uiwebview-overlay-for-unity3d-on-the-iphone/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just wrote a big post about how to open up a UIWebView overtop of the unity game engine.  This is a good way to add Playhaven integration to your app, as we are doing with Snowferno.  Anyway, I posted it on the Snowferno development blog:</p>
<p><a href="http://www.snowferno.com/2009/09/23/playhaven-unity-and-snowferno/">http://www.snowferno.com/2009/09/23/playhaven-unity-and-snowferno/</a></p>
<p>Check it out if that sounds like something you might want to do.</p>
<p>Cheers!<br />
-B</p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2009/09/24/uiwebview-overlay-for-unity3d-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xTUIO updates</title>
		<link>http://benbritten.com/2009/09/07/xtuio-updates/</link>
		<comments>http://benbritten.com/2009/09/07/xtuio-updates/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 06:11:28 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[multitouch]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=879</guid>
		<description><![CDATA[This last weekend I spent a ton of time with Unity3d and the uniTUIO project. One of these days I will figure out how to cross-post to all the various blogs and things I am currently contributing to, but for &#8230; <a href="http://benbritten.com/2009/09/07/xtuio-updates/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This last weekend I spent a ton of time with Unity3d and the <a href="http://xtuio.com/blog/2009/09/03/new-multi-touch-project-unituio/">uniTUIO</a> project. </p>
<p>One of these days I will figure out how to cross-post to all the various blogs and things I am currently contributing to, but for now I will just throw some links out there:</p>
<p>There is the link above, that goes to the initial blog post.</p>
<p><a href="http://xtuio.com/blog/2009/09/06/more-sneak-peeks/">http://xtuio.com/blog/2009/09/06/more-sneak-peeks/</a>  is a post about the two layout managers that are &#8216;done&#8217; so far.</p>
<p><a href="http://xtuio.com/blog/2009/09/07/unittuiomolecules-project-now-with-more-movies/">http://xtuio.com/blog/2009/09/07/unittuiomolecules-project-now-with-more-movies/</a>  shows the newly added movie support and the content switching buttons.  </p>
<p>In any case if you are into the multi-touch surface thing, then go check them out.  Otherwise, you can safely ignore them.</p>
<p>Cheers!<br />
-B&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2009/09/07/xtuio-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unity tip for the day #2: simple notification server</title>
		<link>http://benbritten.com/2009/09/06/unity-tip-for-the-day-2-simple-notification-server/</link>
		<comments>http://benbritten.com/2009/09/06/unity-tip-for-the-day-2-simple-notification-server/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 08:31:11 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://benbritten.com/?p=873</guid>
		<description><![CDATA[If you are used to writing code in cocoa like I am, then you have probably become quite addicted to much of the handy API features of cocoa, things like the NSNotificationCenter. .NET and c# might have something like this, &#8230; <a href="http://benbritten.com/2009/09/06/unity-tip-for-the-day-2-simple-notification-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are used to writing code in cocoa like I am, then you have probably become quite addicted to much of the handy API features of cocoa, things like the NSNotificationCenter.  .NET and c# might have something like this, but searches for &#8216;notifications&#8217; turn up a whole bunch unrelated stuff, so I wrote my own:</p>
<p><a href='http://benbritten.com/wp-content/uploads/2009/09/BBNotificationServer.cs.zip'>BBNotificationServer.cs.zip</a></p>
<p>Just attach this script to a Game Object ( I usually have at least one empty object that is just my holder for all the scene manager scripts.) and you can utilize the notification services.</p>
<p>Here is a quick rundown of how it works:</p>
<p>First off, we have a BBNotificationList class at the top of the file.</p>
<pre lang="c#">
public class BBNotificationList {

	private ArrayList objectList =  new ArrayList();

	public string notificationMessage = "";

	public void addObserver(GameObject obj)
	{
		if (!objectList.Contains(obj)) objectList.Add(obj);
	}

	public void removeObserver(GameObject obj)
	{
		if (!objectList.Contains(obj)) objectList.Remove(obj);
	}

	public void sendNotice()
	{
		if (notificationMessage == "") return;
		foreach ( GameObject obj in objectList ) {
			obj.SendMessage(notificationMessage,SendMessageOptions.DontRequireReceiver);
		}
	}
}
</pre>
<p>Just a very simple container object that holds a list of GameObjects and a &#8216;message&#8217;.  When the sendNotice() method is called, then each object in the list gets sent the message.  Simple.</p>
<p>Next we have the &#8216;server&#8217;  which is roughly analogous to the NSNotificationCenter.</p>
<pre lang="c#">

public class BBNotificationServer : MonoBehaviour {

	private static BBNotificationServer sharedInstance = null;
	private ArrayList notifications = new ArrayList();

	// This defines a static instance property that attempts to find the manager object in the scene and
    // returns it to the caller.
    public static BBNotificationServer instance {
        get {
            if (sharedInstance == null) {
                // This is where the magic happens.
                //  FindObjectOfType(...) returns the first AManager object in the scene.
                sharedInstance = FindObjectOfType(typeof (BBNotificationServer)) as BBNotificationServer;
                if (sharedInstance == null)
                    Debug.Log ("Could not locate a BBNotificationServer object. You have to have exactly one BBNotificationServer in the scene.");
            }
            return sharedInstance;
        }
    }
</pre>
<p>We are using a singleton pattern here, so you will need to have the script attached to something in your scene.  Once you have that then you can get a ref to the server from any other script in the scene like so:</p>
<pre lang="c#">
BBNotificationServer  theServer = BBNotificationServer.instance;
</pre>
<p>or just make calls on it directly like so:</p>
<pre lang="c#">
BBNotificationServer.instance.postNotification("DoSomethingNotification");
</pre>
<p>OK, so the first thing we need to do is be able to add and remove &#8216;observers&#8217;.  If you are unfamiliar with the notification center from the cocoa API, then an &#8216;observer&#8217; is simply an object that wants to be notified by a specific notification.  </p>
<pre lang="c#">

	public void addObserver(GameObject obj, string notificationMessage)
	{
		BBNotificationList theList = this.listForNotification(notificationMessage);
		theList.addObserver(obj);
	}

	public void removeObserver(GameObject obj, string notificationMessage)
	{
		BBNotificationList theList = this.listForNotification(notificationMessage);
		theList.removeObserver(obj);
	}
</pre>
<p>Again, fairly simple, we have a private method that returns the list for a specific message (and makes a new one if there is not already one) and then we just call the add/remove methods on that list.</p>
<p>Here is that private method:</p>
<pre lang="c#">
	private BBNotificationList listForNotification(string message) {
		foreach (BBNotificationList list in notifications) {
			if (list.notificationMessage == message) return list;
		}
		// we got here so there was no list, so make a new one
		BBNotificationList newList = new BBNotificationList();
		newList.notificationMessage = message;
		notifications.Add(newList);
		return newList;
	}
</pre>
<p>Right now I just implemented it as an arraylist and we just do a linear search through it.  Not super duper fast, but if you only have a handful of notification messages, then it will be plenty fast. If you feel the need for more speed, then just replace this method with something that uses a hashtable and you are all set.</p>
<p>finally, we need to be able to post messages.  We already had a look at the actual message posting code in the NotificationList object, and the post notification in the server object is pretty damn simple:</p>
<pre lang="c#">
	public void postNotification(string notificationMessage)
	{
		BBNotificationList theList = this.listForNotification(notificationMessage);
		theList.sendNotice();
	}
</pre>
<p>yep, that is it.</p>
<p>So how do we use this?  If we have a gameobject that we want to react in some way to a notification then we simply have to register as an observer and implement the method that we are observing.</p>
<pre lang="c#">
	void Start() {
		BBNotificationServer.instance.addObserver(gameObject,"FooAllWidgets");
	}

	public void FooAllWidgets()
	{
		this.widget.foo();
	}
</pre>
<p>And that is it.  Very simple!</p>
<p>Note: right after I finished this, I decided to check the one place I forgot to check in my earlier searches, and lo and behold, the Unity community has in fact beaten me to the punch (as usual :-) You can find a javascript implementation of a nice notification center at the <a href="http://www.unifycommunity.com/wiki/index.php?title=NotificationCenter">Unify Community Wiki</a>.  It is a bit different than my implementation, it offers a bit more functionailty, and some extra data handling.  Stuff that could be added to this one fairly easily if you needed a c# version.</p>
<p>Cheers!<br />
-B</p>
]]></content:encoded>
			<wfw:commentRss>http://benbritten.com/2009/09/06/unity-tip-for-the-day-2-simple-notification-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

