<?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>Crown and Cutlass Blog &#187; Protocce</title>
	<atom:link href="http://www.crownandcutlass.com/blog/category/protocce/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.crownandcutlass.com/blog</link>
	<description>The Crown and Cutlass Developer's Blog</description>
	<lastBuildDate>Sat, 20 Jun 2009 21:20:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Introducing Broad Shoulder Development</title>
		<link>http://www.crownandcutlass.com/blog/2009/06/20/introducing-broad-shoulder-development/</link>
		<comments>http://www.crownandcutlass.com/blog/2009/06/20/introducing-broad-shoulder-development/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 21:20:45 +0000</pubDate>
		<dc:creator>David Thulson</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Protocce]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/?p=46</guid>
		<description><![CDATA[We are excited to announce a new project of ours, Broad Shoulder Development.  Our initial focus is to publish iPhone games.  We have a pretty complete 2D engine, and are hoping to get a simple game published soon. You can follow our progress using twitter @BroadShoulder.  Eventually, we would like to publish a version of [...]]]></description>
			<content:encoded><![CDATA[<p>We are excited to announce a new project of ours, <a id="c475" title="Broad Shoulder Development" href="http://www.broadshoulder.com/">Broad Shoulder Development</a>.  Our initial focus is to publish iPhone games.  We have a pretty complete 2D engine, and are hoping to get a simple game published soon. You can follow our progress using twitter @<a href="http://twitter.com/broadshoulder">BroadShoulder</a>.  Eventually, we would like to publish a version of Crown and Cutlass for the iPhone but we want to get a feel for the platform first.</p>
<p>Now, this raises questions about what is going on with Crown and Cutlass and how Broad Shoulder Development will relate to the Crown and Cutlass project.  We don&#8217;t have all the details ironed out, but really this is just a way for us to focus our development efforts.  None of the Crown and Cutlass source will be closed, none of the artwork licenses will change.  Unfortunately, in order to recover the cost of Apple&#8217;s developer program and other business expenses, we are planning to charge for the iPhone games we develop.  We will have to see exactly how this works out, but we&#8217;d like to do something along the lines of Ogre&#8217;s dual-license (perhaps GPL?) with commercial support.</p>
<p>Our current 2D iPhone engine is really a port of the work we did for Protocce, our new Crown and Cutlass engine.  We have simplified a lot due to the hardware restrictions, but I&#8217;m hoping that we can use the experience we gain actually using the engine on the iPhone to improve Crown and Cutlass itself.  As I said, we would love to get a version of Crown and Cutlass running on the iPhone too.  While the gameplay might have to be rethought a little, I think that would be very doable and really fun to play!  Anyway, all that is to say, we are branching out and trying some new stuff, but don&#8217;t worry Crown and Cutlass isn&#8217;t going away.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2009/06/20/introducing-broad-shoulder-development/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Python and Crown and Cutlass</title>
		<link>http://www.crownandcutlass.com/blog/2008/06/17/python-and-crown-and-cutlass/</link>
		<comments>http://www.crownandcutlass.com/blog/2008/06/17/python-and-crown-and-cutlass/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 16:00:32 +0000</pubDate>
		<dc:creator>collin</dc:creator>
				<category><![CDATA[Protocce]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/?p=43</guid>
		<description><![CDATA[David has posted a couple times now about python. We certainly had a good time going to PyCon and had a good time doing PyWeek. I really am a fan of Python. I think it worked really well for us during PyWeek and the other times I&#8217;ve used it. I have other thoughts on both items, [...]]]></description>
			<content:encoded><![CDATA[<p id="rmf3">David has posted a <a href="http://www.crownandcutlass.com/blog/2008/04/17/pyweek-6/">couple times</a> now about <a href="http://www.crownandcutlass.com/blog/2008/02/28/pycon-2008/">python</a>. We certainly had a good time going to PyCon and had a good time doing PyWeek. I really am a fan of Python. I think it worked really well for us during PyWeek and the other times I&#8217;ve used it. I have other thoughts on both items, but I think they&#8217;re better left for another day. What I want to focus on is how is all this affects our work on Crown and Cutlass.  </p>
<p id="w9di">If anyone is still with us, watching the blog or the forums for activity, you probably have noticed a considerable slowdown in work. This has been caused by a couple things. First, and I think most importantly, is that fact that David went <a href="http://www.crownandcutlass.com/blog/2007/06/14/quick-update/">back to school</a> 8 months ago. Since we work together on Crown and Cutlass quite a bit, our motivation often ebbs and flows together. Since David has less time to work on it, I find myself with less motivation. The other issue I have, is that when I take time off from Crown and Cutlass, I have a very hard time jumping back into the code. Getting back into a C++ mindframe from Delphi (which I use at work) is really difficult.  </p>
<p id="oc2v">Based on that, we&#8217;re going to be writing as much of the game play code as possible in Python. By exposing our Protocce engine to Python, we&#8217;ll be taking advantage of the rewrite work we&#8217;ve been doing as well as moving to a more hospitable development environment. I think this will speed up development on Crown and Cutlass by removing <a href="http://en.wikipedia.org/wiki/Accidental_complexity">accidental complexity</a>.</p>
<p id="qov9">We&#8217;ve long talked about scripting as a major component to our game engine, but have always put it off for another day. Now, by using Python, all (or most) of our actual game code will be done in script. It gains us the flexibility of Python, while maintaining the speed of C++ in the engine. Anything that needs to be sped up can be implemented in C++.</p>
<p id="xmp_">I think is an exciting development for Crown and Cutlass. It gives us more opportunity to think about the gameplay and avoid the problems we&#8217;ve had at times in C++. You should be seeing more exciting developments over the summer as we make more progress on Crown and Cutlass.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2008/06/17/python-and-crown-and-cutlass/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PyCon 2008</title>
		<link>http://www.crownandcutlass.com/blog/2008/02/28/pycon-2008/</link>
		<comments>http://www.crownandcutlass.com/blog/2008/02/28/pycon-2008/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 00:38:37 +0000</pubDate>
		<dc:creator>David Thulson</dc:creator>
				<category><![CDATA[Protocce]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/2008/02/28/pycon-2008/</guid>
		<description><![CDATA[Collin and I are both signed up to go to PyCon 2008. While we don&#8217;t use Python in the Crown and Cutlass code itself, we have used it for several utilities to support our development. For example, we wrote a script to update CMake build numbers that gets used in the Protocce build (here is [...]]]></description>
			<content:encoded><![CDATA[<p>Collin and I are both signed up to go to <a href="http://us.pycon.org/2008/about/">PyCon 2008</a>.  While we don&#8217;t use Python in the Crown and Cutlass code itself, we have used it for several utilities to support our development.  For example, we wrote a <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/cmake/IncBuildNumber.py?view=markup">script to update CMake build numbers</a> that gets used in the Protocce build (here is the <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/src/CMakeLists.txt?view=markup">CMake file that uses it</a>).  We also have a <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/copyright.py?view=markup">script that updates the year in the license text</a> in all of our source code.  None of that is too complicated and none of it took very long to develop, but Python has made it pretty easy.  I&#8217;ve done a few other little odd scripts in Python, and I use it at work whenever I need to do quick one-time text munging for some reason.  Basically, I use Python for everything I used to do with Perl except it doesn&#8217;t take me an hour to remember how to get started and when I return to the code a few weeks/months later it still makes some sense to me.</p>
<p>Anyway, we are excited about PyCon.  I am looking forward to learning about <a href="http://www.stackless.com">Stackless</a> and there is a talk about embedding Python in Counter-Strike: Source which should be really interesting.  Plus there is a bunch of stuff about <a href="http://www.jython.org/Project/index.html">Jython</a> (&#8220;Jython on the Joint Strike Fighter&#8221;, how cool is that?!?), <a href="http://www.codeplex.com/IronPython">IronPython</a>, and a many other talks that look good.  Unfortunately, it doesn&#8217;t look like you can link to descriptions of individual talks, but if you are interested you should be able to find what I have mentioned in the <a href="http://us.pycon.org/2008/conference/talks/">complete list of scheduled talks</a> without much effort.</p>
<p>If anyone reading this wants to get together at the conference, let us know.  I&#8217;d enjoy meeting some people who have interest in Crown and Cutlass, and you could give us a hard time about not making more progress on the game!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2008/02/28/pycon-2008/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Semester done</title>
		<link>http://www.crownandcutlass.com/blog/2007/12/10/semester-done/</link>
		<comments>http://www.crownandcutlass.com/blog/2007/12/10/semester-done/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 21:59:38 +0000</pubDate>
		<dc:creator>David Thulson</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Protocce]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/2007/12/10/semester-done/</guid>
		<description><![CDATA[I finished the first semester of my MS program.  It was interesting in some ways, frustrating in some ways, and overall just kind of weird to be back in school.  I may write more about my thoughts of coming back into academia (while also trying to stay in the business world and keep a small [...]]]></description>
			<content:encoded><![CDATA[<p>I finished the first semester of my MS program.  It was interesting in some ways, frustrating in some ways, and overall just kind of weird to be back in school.  I may write more about my thoughts of coming back into academia (while also trying to stay in the business world and keep a small open-source project running) at some point.  But for now, I&#8217;m excited to finally have time to work on getting Protocce to build in osx.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2007/12/10/semester-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I made the switch (or I am trying to)&#8230;</title>
		<link>http://www.crownandcutlass.com/blog/2007/10/31/i-made-the-switch-or-i-am-trying-to/</link>
		<comments>http://www.crownandcutlass.com/blog/2007/10/31/i-made-the-switch-or-i-am-trying-to/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 21:04:50 +0000</pubDate>
		<dc:creator>David Thulson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Ogre]]></category>
		<category><![CDATA[Protocce]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/2007/10/31/i-made-the-switch-or-i-am-trying-to/</guid>
		<description><![CDATA[I have finally done it, I bought a Mac. A few weekends ago, I bought a MacBook Pro and then last weekend I upgraded to Leopard. The computer was expensive (I got an academic discount and the upgrade to Leopard was basically free, but still&#8230;) but it sure is a nice machine. I now have [...]]]></description>
			<content:encoded><![CDATA[<p>I have finally done it, I bought a Mac. A few weekends ago, I bought a MacBook Pro and then last weekend I upgraded to Leopard. The computer was expensive (I got an academic discount and the upgrade to Leopard was basically free, but still&#8230;) but it sure is a nice machine.  I now have a video card with decent shader support, so I am excited to play around with that.  It is also nice to have a unix-based machine with decent driver support out of the box.  The wireless card actually works!  Amazing!  However, I really feel lost trying to do development in OS X and in some ways I feel lost just trying to use the computer.</p>
<p>I really have not quite gotten used to the way the filesystem is arranged.  I guess I am comfortable with it not being like Windows, but I want it to be like linux.  In Windows, there is no &#8220;/usr/lib/&#8221; or &#8220;/usr/local/lib/&#8221; for libraries so you put them somewhere else (like &#8220;C:\OgreSDK&#8221; or in program files or something).  In OS X there is a &#8220;/usr/lib/&#8221; and &#8220;/usr/local/lib/&#8221; but it looks like the preferred place to install libraries is into &#8220;/Libraries/&#8221; which is just weird. Which should I use?  Should I treat it as a unix machine, or embrace the weird OS X stuff?</p>
<p>The keyboard also is a little annoying.  I want a &#8220;home&#8221; and an &#8220;end&#8221; key.  I want a &#8220;del&#8221; key that is separate from the backspace key.  I guess you can do &#8220;command-right&#8221; to get to the end of the line, but that does not seem to work consistently in all applications. I also really think only putting one mouse button on the laptops is a poor decision.  And no, I don&#8217;t buy the argument that using modifier keys for things like that or to get a right-click is somehow more efficient.</p>
<p>I am also trying to figure out how to get dependencies for Protocce installed.  Ogre was really easy since they provide a framework. If I remember correctly from his blog, Steve Streeting got a Mac recently so OS X has a higher priority on the Ogre team.  The ogg and vorbis packages came with XCode projects to make frameworks, so building and installing them was really easy.  I couldn&#8217;t find a binary boost distribution, so I built/installed it just like I would have in linux (&#8220;./configure &amp;&amp; make &amp;&amp; make install&#8221;). That is what boost recommends, but I&#8217;m not sure that is the OS X way to do things.  At this point though, I don&#8217;t think there is reason to go through the trouble of making a framework (and really figuring out what frameworks are all about, how they differ from bundles, what a bundle is, etc.).  Unfortunately, OS X support in CEGUI seems to be lagging behind.  CEGUI seems to be kind of quiet lately anyway (Crazy Eddie appears to have left the project, hopefully it can rise from the ashes and continue strongly eventually).  I am going to try building it from SVN where I hope the OS X support is a little better.</p>
<p>XCode seems like it will be nice.  I need to try a &#8220;hello world&#8221; project in it, but it looks like CMake can generate XCode projects.  That will be save a lot of work, since it will shield me from having to set up a project manually until after I see how Xcode handles projects a little.  I&#8217;m sure it&#8217;ll still take some getting used to, but I&#8217;m interested to see how it compares to Eclipse with the CDT and Visual Studio.</p>
<p>Anyway, if you have tips on getting started with development is OS X, let me know. I found Apple&#8217;s <a href="http://developer.apple.com/gettingstarted/">getting started</a> page and it seems there could be some good stuff in there., but I have a lot to learn.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2007/10/31/i-made-the-switch-or-i-am-trying-to/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Unit Test Framework</title>
		<link>http://www.crownandcutlass.com/blog/2007/08/30/unit-test-framework/</link>
		<comments>http://www.crownandcutlass.com/blog/2007/08/30/unit-test-framework/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 20:51:28 +0000</pubDate>
		<dc:creator>David Thulson</dc:creator>
				<category><![CDATA[Protocce]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/2007/08/30/unit-test-framework/</guid>
		<description><![CDATA[In my previous post about why I&#8217;m excited for our rewrite, I forgot to mention our unit test framework. It is really quick and dirty, and we don&#8217;t do anything fancy to get around the fact that certain things are just hard to deal with (e.g. &#8220;did that sound right?&#8221; or &#8220;did that draw correctly [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous <a href="http://www.crownandcutlass.com/blog/2007/08/23/why-im-excited-about-the-rewrite/">post about why I&#8217;m excited for our rewrite</a>, I forgot to mention our <a href="http://en.wikipedia.org/wiki/Unit_test">unit test</a> framework.  It is really quick and dirty, and we don&#8217;t do anything fancy to get around the fact that certain things are just hard to deal with (e.g. &#8220;did that sound right?&#8221; or &#8220;did that draw correctly on screen?&#8221;).  However, the unit test framework has really allowed us to be sure what we are building on is solid and behaves as we expect it.  It has also great been really great for testing a change quickly.  For example, the other day <a href="http://www.crownandcutlass.com/blog/2007/08/22/sound-system-progress/">I gutted our LoadOgg helper function</a>, but since we had tests written for it it was really easy to be sure I had not broken it.  Before our rewrite, we would have to run the whole game, get to the place in-game where our change came into play, and then see if it was right.  Now we can just write a test or two for the new change and if we want to we can disable all the other tests.  That really speeds up debugging.</p>
<p>Also, because we are making heavy use of the event system, we can test the event sender and the receiver separately.  For example, the SoundBuffer and SoundStream classes basically just send events to the sound system telling it to play/pause/stop a sound.  In the test, I set my own listener for those events and verified that they are being sent correctly.  Another place where the event system was useful was in the initialization of the input system.  The input system needs some kind of window handle to give to OIS.  Collin set it up so that the input system sends an event with a Variant window handle field.  If it is initialized, the render subsystem receives that event and sets the window handle value.  However, if you do not have the render system running for whatever reason (like in the input test), you can just register your own handler for that event.  So in the input test, Collin creates a simple little window just to get input with raw X11 or Win32 code, and his test receives the event and returns the proper handle.  The input system doesn&#8217;t care whether the render system created the window, or you did yourself.  All it cares about is that something provided it with a window handle.  That is pretty slick.</p>
<p>As I mentioned earlier, we aren&#8217;t doing anything fancy for user input/output tests for things like sound, graphics, or input.  We basically do what we want and then ask the user &#8220;did that seem right?&#8221;  That can get annoying if you are working on something like the sound system.  Testing it is a lot of &#8220;did the music start?&#8221;, &#8220;did it stop?&#8221;, &#8220;did it start again?&#8221; kind of questions.  It&#8217;s not perfect, but it is a simple way to verify that the code works.  Compared to what we had it is a huge step forward.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2007/08/30/unit-test-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I&#8217;m Excited About the Rewrite</title>
		<link>http://www.crownandcutlass.com/blog/2007/08/23/why-im-excited-about-the-rewrite/</link>
		<comments>http://www.crownandcutlass.com/blog/2007/08/23/why-im-excited-about-the-rewrite/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 19:31:22 +0000</pubDate>
		<dc:creator>David Thulson</dc:creator>
				<category><![CDATA[Ogre]]></category>
		<category><![CDATA[Protocce]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/2007/08/23/why-im-excited-about-the-rewrite/</guid>
		<description><![CDATA[I have mentioned that I am really excited about our rewrite several times, but I haven&#8217;t ever gone into much detail about why that is. I hope that we have learned from what worked and what didn&#8217;t work in the old Crown and Cutlass code, and applied those lessons to the new Protocce code. I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>I have mentioned that I am really excited about our rewrite <a href="http://www.crownandcutlass.com/blog/2007/06/14/quick-update/">several</a> <a href="http://www.crownandcutlass.com/blog/2006/12/16/reasons-for-a-rewrite/">times</a>, but I haven&#8217;t ever gone into much detail about why that is.  I hope that we have learned from what worked and what didn&#8217;t work in the old Crown and Cutlass code, and applied those lessons to the new <span class="misspell" suggestions="Protocol,Proteges,Protocols,Produce,Protege">Protocce</span> code.  I&#8217;m sure there are still things that we will realize are not well done, but this is a much more stable base for future work.  Here are several specific things I&#8217;m excited about:</p>
<p><a href="http://crownandcutlass.com/protocce/doc/classpcce_1_1Exception.html">Exception</a> &#8211; We implemented the <span class="misspell" suggestions="Pace,pace,puce,PC,PCs">pcce</span>::Exception class which we now use consistently for error reporting.  Coupled with our greater focus on <span class="misspell" suggestions="RA II,RA-II,RADII,RABI,RAFI">RAII</span> (see below), I think we have made some serious progress.  We used to use error codes sometimes and throw other times.  Unfortunately, sometimes we threw strings, sometimes we threw char *&#8217;s, sometimes we threw <span class="misspell" suggestions="in ts,in-ts,Inst,inst,nits">ints</span>, etc.  This is much better.  It does not descend from std::exception at the moment, but we are thinking about doing that.</p>
<p>Greater focus on <a href="http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization"><span class="misspell" suggestions="RA II,RA-II,RADII,RABI,RAFI">RAII</span></a> &#8211; <span class="misspell" suggestions="RA II,RA-II,RADII,RABI,RAFI">RAII</span> is really a great idiom for resource management in C++, especially when coupled with smart pointers like <a href="http://boost.org/libs/smart_ptr/shared_ptr.htm">boost::shared_<span class="misspell" suggestions="Petr,PR,PT,Pr,Pt">ptr</span></a>.  We have design for <span class="misspell" suggestions="RA II,RA-II,RADII,RABI,RAFI">RAII</span> from the start, so that should make things much more manageable.  Again, I&#8217;m sure we have more to do in this area, but we have a good start.</p>
<p><a href="http://crownandcutlass.com/protocce/doc/classpcce_1_1Variant.html">Variant</a> &#8211; At work, I have gotten used to using the Win32 Variant class in Delphi.  While it certainly has its drawbacks, it sure can be helpful for doing things like reading text from a <span class="misspell" suggestions="con fig,con-fig,Cong,confide,confine">config</span> file.  Our variant class is cross platform, and based on boost::variant.  I think it will change a little as we use it, but I&#8217;m pretty happy with it now.  You wouldn&#8217;t want to use it when a statically typed variable will do, but for example the <span class="misspell" suggestions="con fig,con-fig,Cong,confide,confine">config</span> system was really easy to do using Variant.</p>
<p><a href="http://crownandcutlass.com/protocce/doc/classpcce_1_1PropertyBag.html"><span class="misspell" suggestions="Property Bag,Property-Bag,Peripatetic">PropertyBag</span></a> &#8211; Again, at work I got used to using &#8220;property bags&#8221; which are basically just a map from a string to a variant value.  You wouldn&#8217;t want to replace all of your normal classes with a property bag (static typing can be nice!), but it can be really useful.  For example, our configuration system is an <span class="misspell" suggestions="UNI,IN,INRI,INTI,NI">INI</span> file.  That gets loaded into a property bag.  When you initialize a subsystem, you pass its settings as a property bag.  That way, you can change the <span class="misspell" suggestions="con fig,con-fig,Cong,confide,confine">config</span> options around without changing the <span class="misspell" suggestions="con fig,con-fig,Cong,confide,confine">config</span> object or the method signature.  We have also used property bags to create &#8220;game objects&#8221; which are just property bags with a couple of predetermined fields for model name, texture, etc.  The game programmer can put whatever else he wants in there.</p>
<p>Consistent use of <a href="http://boost.org/libs/smart_ptr/shared_ptr.htm">shared_<span class="misspell" suggestions="Petr,PR,PT,Pr,Pt">ptr</span></a> &#8211; I really don&#8217;t mind managing my own memory, but once you start talking about exceptions and <span class="misspell" suggestions="RA II,RA-II,RADII,RABI,RAFI">RAII</span>, using some kind of smart pointers really makes sense.  We are making pretty serious use of boost::shared_<span class="misspell" suggestions="Petr,PR,PT,Pr,Pt">ptr</span>, which has made a lot of things easy.  No need to worry about who owns an object, as long as you have a shared_<span class="misspell" suggestions="Petr,PR,PT,Pr,Pt">ptr</span> to it, it will stay valid.  Of course, we have to think about circular references, but overall I think using smart pointers is a big win.</p>
<p><a href="http://www.ogre3d.org/">OGRE</a> &#8211; I think it&#8217;s pretty clear why I am excited about OGRE.  Originally, the project was just an excuse to do <span class="misspell" suggestions="Openly,Encl,Spengler,Spangle,Spangly">OpenGL</span> programming.  I enjoyed that, but now I am more interested in other things.  I&#8217;m a little sad not to get to try that from the ground up, but eventually we can revamp <span class="misspell" suggestions="Protocol,Proteges,Protocols,Produce,Protege">Protocce</span> to use a custom engine if we want.  Until then, using OGRE will simplify our code, standardize our models (our old model loading code was really picky), and open up the doors to easily implementing graphical improvements.  It will also allow us to focus on the game itself, rather than the details of the graphics.</p>
<p><a href="http://crownandcutlass.com/protocce/doc/classpcce_1_1EventSystem.html">EventSystem</a> &#8211; Our old code used to be <a href="http://en.wikipedia.org/wiki/Coupling_%28computer_science%29">very tightly coupled</a> (see the <a href="http://crownandcutlass.com/doc/classStateSailing.html"><span class="misspell" suggestions="Sailing State,Sailing-State,Silentest,Solicitude,Slanted">SailingState</span></a> for an example), so minor changes could not only cause a large number of units to need to be rebuilt, but also end up causing a large number of code changes.  The event system is based on what is mentioned in Game Coding Complete and allows us to significantly decouple our code.  Once an event is defined, you can register a boost::function to receive that event.  Events can be dispatched immediately, or queued to be dispatched once per frame.  I expect the way that will work is that game events will be queued, while internal &#8220;plumbing&#8221; type stuff will be sent immediately.  As an example, the input subsystem needs a window handle to receive input.  Rather than connecting it directly to the render subsystem (which would force you to initialize the entire render subsystem if you wanted to use the input subsystem), the input subsystem just sends an event that the render system receives.  If you don&#8217;t want to use the render subsystem for some reason, you could just register a different handler for that event.  Collin actually does that in the input test.  As I mentioned in <a href="http://www.crownandcutlass.com/blog/2007/08/22/sound-system-progress/">my previous post</a>, the sound system is also event driven.  It is running in its own thread, and all the main thread does is send an event that says &#8220;play sound X&#8221; or &#8220;stop sound Y&#8221;.  That data is easily sent out to the other thread, where the actual sound code handles it.  We can totally revamp the sound implementation and not touch client code at all.  I think the event system is a much more flexible system and I think it will open up a lot of doors for us.</p>
<p>Improved resource management &#8211; I mentioned this a little in my last post too.  Between the release of Alpha 1.4 and the decision to start the rewrite, I wrote a resource management system.  It was pretty good.  It would make sure that only one copy of a texture, sound file, or model was loaded at a time and used reference counting to automatically unload the model when it was finished.  I have further refined it (partially based on the OGRE resource system) and posted a reply on <span class="misspell" suggestions="gamed,gamete,gametes,gamete's,gametic">gamedev</span> <a href="http://www.gamedev.net/community/forums/viewreply.asp?ID=2955465">explaining the <span class="misspell" suggestions="Protocol,Proteges,Protocols,Produce,Protege">Protocce</span> resource system</a>.</p>
<p>Anyway, there are other things but that is a decent explanation of the things that I am excited about.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2007/08/23/why-im-excited-about-the-rewrite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sound System Progress</title>
		<link>http://www.crownandcutlass.com/blog/2007/08/22/sound-system-progress/</link>
		<comments>http://www.crownandcutlass.com/blog/2007/08/22/sound-system-progress/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 20:06:23 +0000</pubDate>
		<dc:creator>David Thulson</dc:creator>
				<category><![CDATA[Protocce]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/2007/08/22/sound-system-progress/</guid>
		<description><![CDATA[I have been working on the sound system lately, which has been pretty enjoyable. I based the design on the old sound system. I&#8217;m not sure if many people saw that, because I implemented it (along with resource management) between the release of Alpha 1.4 and our decision to rework the code from the ground [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on the sound system lately, which has been pretty enjoyable.  I based the design on the old sound system.  I&#8217;m not sure if many people saw that, because I implemented it (along with resource management) between the release of Alpha 1.4 and our decision to rework the code from the ground up.  It was pretty slick from the end user&#8217;s perspective.  The user could create a new <a href="http://crownandcutlass.com/doc/classSoundEffect.html">SoundEffect</a> object and that would acquire a pointer to the shared AL buffer automatically.  That buffer was shared, so there was never more than 1 copy of &#8220;cannon.ogg&#8221; or whatever in memory at one time.  It would also automatically unload the buffer when the last SoundEffect using it was deleted.  The sound system also managed your OpenAL sources so that only a given number of sources would be created.  If you tried to play more sounds than that, it would revoke the source from the oldest sound to play the most recent.  That was pretty nice, but it was a little ugly behind the scenes because when I originally wrote it I was not yet aware of boost&#8217;s smart pointers.  I had a feature where you could &#8220;lock&#8221; a source so it would not be revoked, but I never used that because I never updated the code to stream ogg files from the disk to use the sound system.  As a result, the source management was much more complicated than it needed to be and it was still possible to run out OpenAL sources if you played too many sounds at one time.</p>
<p>I have gotten a good chunk of the way through moving the sound system into our new codebase.  I think in general the sound system is much better now.  It is a little ugly because it is running on its own thread, but I think that will be worth it.  I have renamed the SoundEffect class to <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/include/SoundBuffer.h?revision=871&amp;view=markup">SoundBuffer</a> (since it is a sound that is played from a single buffer in memory as opposed to one that is streamed from disk, which is done with the <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/include/SoundStream.h?revision=910&amp;view=markup">SoundStream</a> class).  It has basically the same interface as it used to, but now all the SoundBuffer does is fire off events to the SoundSubSystem (as you can see in the <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/src/SoundBuffer.cpp?revision=880&amp;view=markup">SoundBuffer implementation</a>).  Sources are still revoked just like they were, but now I am positioned to combine the source allocation for the SoundStream class too.  I wrote a really simple <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/include/OggFile.h?revision=909&amp;view=markup">class for reading ogg/vorbis files</a> in a more C++ friendly manner.  It allows us to use RAII and hide some of the oddities of the vorbis lib.  I reworked our LoadOgg function that loads the entire contents of an ogg/vorbis file into a single OpenAL buffer so that it used the new OggFile wrapper, and it resulted in <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/src/soundutil.cpp?r1=902&amp;r2=909">this diff</a>.  That is way more readable, so I&#8217;m pretty pleased with that.  Now, I&#8217;m working on using that ogg/vorbis wrapper to implement streaming music off the disk.  It&#8217;s nice to have all of my ogg/vorbis code in a single place instead of duplicating it like we used to.  Maybe I should do something similar for WAV files.  I also probably should rename all of our *Ogg* classes, functions and methods to *Vorbis*&#8230;</p>
<p>Anyway, it has been fun to rework the sound stuff using our improved resource management code and just the general better code base we have now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2007/08/22/sound-system-progress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simplified Protocce (no more &#8220;triscene&#8221;)</title>
		<link>http://www.crownandcutlass.com/blog/2007/06/29/simplified-protocce-cut-out-the-triscene/</link>
		<comments>http://www.crownandcutlass.com/blog/2007/06/29/simplified-protocce-cut-out-the-triscene/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 23:43:52 +0000</pubDate>
		<dc:creator>David Thulson</dc:creator>
				<category><![CDATA[Protocce]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/2007/06/29/simplified-protocce-cut-out-the-triscene/</guid>
		<description><![CDATA[We had this idea in the rewrite to split the scene into (at least) 3 parts: a physics scene, a render scene, and a game logic scene. The different parts would all run on different threads and run at independent speeds (e.g. the scene is rendered as fast as it can, but the physics is [...]]]></description>
			<content:encoded><![CDATA[<p>We had this idea in the rewrite to split the scene into (at least) 3 parts: a physics scene, a render scene, and a game logic scene.  The different parts would all run on different threads and run at independent speeds (e.g. the scene is rendered as fast as it can, but the physics is only updated 30 times a second).  The threads would stay in sync with each other by passing events like &#8220;move node X to &#8230;&#8221; and &#8220;set material of node Y to &#8230;&#8221;.  Our plan was to treat the render system as a sink, so it only ever received events.  To avoid the physics and game logic scenes getting in each other&#8217;s ways, we were going to have objects be moved either by the game logic (for scripted camera movement, etc.) or by the physics system (moving around boats, etc).  That way a node would only be modified by a single thread.  I think that might work (maybe not), but we have decided to abandon all that and go with a more or less straight OGRE scene instead.</p>
<p>As I was implementing it, it seemed like there was just going to be too much overhead for it to really be worthwhile.  All of the scene nodes were identified by name, so in my unoptimized first-shot implementation there was a lot of lookups in maps of strings.  I think we could have improved that to the point where it might still be workable, but the real kicker was 3rd party libraries&#8230;  We decided to do this &#8220;per-subsystem&#8221; sort of threading instead of something more like a work queue with worker threads because we wanted to leverage mature, 3rd party libraries.  We are excited to get all of the power of OGRE without having to implement all of that ourselves.  However, most of the 3rd party libs are not thread-safe or multi-threaded.  We thought if we controlled the updates to events that got passed to the thread, that would be ok.  CEGUI really killed that idea, though.  It is not thread-safe, and in our system it would need to be accessed by both the render thread (to display the buttons) and also the input thread (to handle input events).  From what I read on the CEGUI forums and saw in their code, that just isn&#8217;t safe.</p>
<p>We had to decide basically whether to continue with our &#8220;it might work&#8221; idea for multi-threading and possibly implement our own GUI system, or just cut out all of that extra work and use the libs more directly.  We decided to abandon our triscene idea. The sound system will probably still be threaded, but the input, physics, rendering, and game logic will all happen on the main thread.  That clearly isn&#8217;t the best way to go with multi-core processors becoming with more and more common, but I think trying to use non-thread-safe 3rd party libs in a multi-threaded way is just a loosing battle.  The only real alternative is to write all of our own subsystems (i.e. no CEGUI, no OGRE, no ODE), but at some point we have to just focus on getting a simple, well structured, singled-threaded (and actually running!) version of Crown and Cutlass instead of diving off into all that.</p>
<p>Actually, we decided to abandon the &#8220;game view&#8221; idea for now as well.  We couldn&#8217;t really map that onto the rest of our design.  Rather than continuing to bat ideas around that I think sound good but can&#8217;t quite get pinned down, I am going to focus more on getting what we have running.  I guess that&#8217;s 2 fewer cool things I am excited about that, but at least we are getting close to working in Crown and Cutlass again for the first time in almost a year and a half!</p>
<p>PS We tagged the SVN repo before we deleted all this code.   You can see the tag <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/tags/triscene-dead/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2007/06/29/simplified-protocce-cut-out-the-triscene/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Update</title>
		<link>http://www.crownandcutlass.com/blog/2007/06/14/quick-update/</link>
		<comments>http://www.crownandcutlass.com/blog/2007/06/14/quick-update/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 22:46:52 +0000</pubDate>
		<dc:creator>David Thulson</dc:creator>
				<category><![CDATA[Protocce]]></category>

		<guid isPermaLink="false">http://www.crownandcutlass.com/blog/2007/06/14/quick-update/</guid>
		<description><![CDATA[It&#8217;s been a little while since I posted anything about what we are doing, so I thought I&#8217;d give a quick update. First off, I applied to some Computer Science grad programs for this fall. I applied to three PhD programs and one MS program, and only got into the MS program. While that was [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a little while since I posted anything about what we are doing, so I thought I&#8217;d give a quick update.  First off, I applied to some Computer Science grad programs for this fall.  I applied to three PhD programs and one MS program, and only got into the MS program.  While that was pretty disappointing, the good news is that it made the decision of where to go really easy!  I was a little concerned about not having enough time to continue working on Crown and Cutlass in a PhD program, but I think I&#8217;ll still be able to contribute and take my classes (and continue working part-time).  I&#8217;m really excited about this program and going back to school.  It even looks like there may be some classes that may help me figure out how in the world you actually write a game!</p>
<p>In other news, Collin and I talked today about what we still need to do before we can start rewriting Crown and Cutlass game code using our new Protocce engine.  That&#8217;s a significant milestone!  I mean, it&#8217;s not as big a deal as actually using Protocce in Crown and Cutlass, but at least we are talking realistically about it.  We are getting close to having something workable, and we are both really excited about the foundation Protocce will provide.  If you are interested, you can take a look for yourself at our (slightly outdated at the moment) <a href="http://www.crownandcutlass.com/protocce/doc/">Protocce doxygen docs</a> or at the <a href="http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/">Protocce SVN repository</a> directly.  If you really want to keep an eye on what we are doing, you could even subscribe to our <a href="https://lists.sourceforge.net/lists/listinfo/crownandcutlass-svn">SVN commit mailing list</a>.  I&#8217;ll try to boil some of that down into some specific things we are excited about in a future post when I have a little more time&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crownandcutlass.com/blog/2007/06/14/quick-update/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.497 seconds -->
