<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<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/"
	>

<channel>
	<title>GameArchitect</title>
	<link>http://gamearchitect.net</link>
	<description>Musings on Game Engine Design</description>
	<pubDate>Sun, 20 Apr 2008 07:20:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>An Anatomy of Despair:  Orthogonal Views</title>
		<link>http://gamearchitect.net/2008/04/19/an-anatomy-of-despair-orthogonal-views/</link>
		<comments>http://gamearchitect.net/2008/04/19/an-anatomy-of-despair-orthogonal-views/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 01:26:31 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
		<category><![CDATA[Despair Engine]]></category>

		<category><![CDATA[Game Engine Design]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://gamearchitect.net/2008/04/19/an-anatomy-of-despair-orthogonal-views/</guid>
		<description><![CDATA[A frustrating feature of previous game engines we&#8217;d used was that they tended to overload hierarchy to mean multiple things.
The engine that we used at Cyan, for example, was a pure scene graph.  Every part of the game was represented by one or more nodes in a hierarchy.  But the hierarchy represented logical relationships in some [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Georgia">A frustrating feature of previous game engines we&#8217;d used was that they tended to overload hierarchy to mean multiple things.</span></p>
<p><span style="font-family: Georgia">The engine that we used at Cyan, for example, was a <img border="0" align="left" width="251" src="http://gamearchitect.net/wp-content/uploads/2008/04/tree.gif" alt="Tree" height="179" />pure scene graph.  Every part of the game was represented by one or more nodes in a hierarchy.  But the hierarchy represented logical relationships in some places and kinematic relationships in others.  Throughout the graph, ownership was conflated with update order:  children would be deleted when their parents were deleted and parents always updated before their children.  Kinematic attachment was performed by pruning and grafting trees in the graph, which had the effect of tying the lifetimes of attached objects to the lifetimes of their parents.</span></p>
<p><span style="font-family: Georgia">The engine used for MechAssault 2 was similar, except that it had separate game object and scene hierarchies.  In both hierarchies, graph relationships defined ownership and update order:  children would be deleted when their parents were deleted and parents were always updated before their children.  In the game object graph, hierarchy also defined logical relationships that varied based on the objects involved.  Triggers, for example, would treat certain of their child objects as inputs to be checked and others as objects to be acted on.  In principle, the entire game object hierarchy updated, then the entire scene hierarchy updated.  In practice, we needed to know the final animated positions of some objects so that we knew where to create effects, so some trees in the scene hierarchy got explicitly updated during the game object update.</span></p>
<p><span style="font-family: Georgia">All of this was very confusing.  It also meant that changes to the hierarchy motivated by one concern tended to have unforeseen side-effects in other areas.  And it necessitated odd hacks like the MechAssault&#8217;s explicit updating of sub-trees in the scene graph. In developing Despair, therefore, we decided to have one data-structure per purpose.  As mentioned <a href="http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-object-ownership/"><font color="#800080">previously</font></a>, we have a well-defined ownership hierarchy among our objects.  For example,</span></p>
<ul type="disc">
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">The streaming manager owns worlds<o:p></o:p></span></li>
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">Worlds own game objects<o:p></o:p></span></li>
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">Game objects own game components</span></li>
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">Game components own scene objects (and audio resources, and HUD elements, etc&#8230;)<o:p></o:p></span></li>
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">Scene objects own mesh nodes (and transform nodes, and light nodes, etc&#8230;)<o:p></o:p></span></li>
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">Mesh nodes own vertex groups and index lists<o:p></o:p></span></li>
</ul>
<p><span style="font-family: Georgia">In some cases ownership is shared and in some cases it isn&#8217;t, but each object has its level of the hierarchy.  <o:p></o:p></span><span style="font-family: Georgia">But in addition to the hierarchy that we use for ownership, we also have parallel data structures for<o:p></o:p></span></p>
<ul type="disc">
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">the object registry used for object look-up<o:p></o:p></span></li>
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">the dependency graph used for object update<o:p></o:p></span></li>
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">the physical representation of the world (stored in Havok&#8217;s internal hierarchy)<o:p></o:p></span></li>
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">the renderable representation of the world (stored in our own sphere tree of renderable objects)<o:p></o:p></span></li>
<li style="margin: 0in 0in 0pt; line-height: 15.6pt; tab-stops: list .5in" class="MsoNormal"><span style="font-family: Georgia">etc.<o:p></o:p></span></li>
</ul>
<p><span style="font-family: Georgia">This has been a big win in terms of clarity and flexibility.  It&#8217;s clear when looking at a component what its lifetime will be.  It&#8217;s easy to make a component update later in the frame, or not update at all, without having to worry that your change will affect when the object is deleted or whether it&#8217;s rendered.  Scene objects and game components are part of the same dependency hierarchy.  Therefore, the component that creates a fire effect can make itself dependent on the scene object for the player&#8217;s weapon.  That way the fire effect won&#8217;t be created until the weapon has determined its final position for the frame, and the fire effect will be created at the correct location.</span></p>
<p><span style="font-family: Georgia">The performance implications of orthogonal views are unclear.  One of the frustrations of building a game engine is that you never have the leisure of changing one architectural variable while keeping all others constant.  That means that you can never be sure you&#8217;ve made the best decision.  You can only be sure&#8211;sometimes&#8211;when you&#8217;ve made a very bad one.<o:p></o:p></span></p>
<p><span style="font-family: Georgia"><img border="0" align="right" width="244" src="http://gamearchitect.net/wp-content/uploads/2008/04/tree2.gif" alt="Trees" height="169" />Having orthogonal views of our data was clearly not a decision worthy of regret.  But it&#8217;s difficult to be certain whether it&#8217;s a net win in terms of performance.  On the negative side, all these different hierarchies are scattered at widely different locations in memory, and on modern hardware memory locality drives performance more than the number of instructions executed does.  But on the other hand, having independent views of the data means that each only needs to process what matters.  Our update pass only updates objects that are actually changing.  Our render pass doesn&#8217;t waste any overhead on objects that aren&#8217;t renderable.  And when those systems operate, they perform similar operations on sorted lists of similar objects, which is the sort of thing that modern hardware has gotten very good at.  So I think this idiom is a performance win, but the only hard data I have to back that up is that we&#8217;re spending less time waiting on cache misses than we were in MechAssault 2.  Given the other differences between Despair and the MechAssault 2 engine and between the Xbox 360 and the original Xbox, that evidence is suggestive but not conclusive.</span></p>
<p><span style="font-family: Georgia">The one area in which orthogonal views have a clear cost is memory.  As objects add themselves to all our different systems, they may have representations in the registry, in the dependency graph, the scene hierarchy, the physics hierarchy, the render hierarchy, and probably one or two other systems that I&#8217;m forgetting.  I&#8217;d estimate that this overhead adds up to somewhere between two and three megabytes for a typical level in Fracture.  On a console with 512 megabytes of memory that cost seems justifiable, but it would have been less practical on an Xbox or PlayStation 2 game.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://gamearchitect.net/2008/04/19/an-anatomy-of-despair-orthogonal-views/feed/</wfw:commentRss>
		</item>
		<item>
		<title>An Anatomy of Despair:  Object Ownership</title>
		<link>http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-object-ownership/</link>
		<comments>http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-object-ownership/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 05:16:29 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
		<category><![CDATA[Despair Engine]]></category>

		<category><![CDATA[Game Engine Design]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-object-ownership/</guid>
		<description><![CDATA[In every game engine that I worked on before Despair, I spent a lot of time tracking down memory leaks.  Some leaks were obvious and easy to find.  Some leaks involved complex patterns of ownership that thoroughly obscured what object was supposed to be responsible for deleting another.  And some leaks involved AddRef/Release mismatches that [...]]]></description>
			<content:encoded><![CDATA[<p>In every game engine that I worked on before Despair, I spent a lot of time tracking down memory leaks.  Some leaks were obvious and easy to find.  Some leaks involved complex patterns of ownership that thoroughly obscured what object was <em>supposed</em> to be responsible for deleting another.  And some leaks involved AddRef/Release mismatches that would create cycles of ownership or that would leak whole object hierarchies.</p>
<p> <a href="http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-object-ownership/#more-7" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-object-ownership/feed/</wfw:commentRss>
		</item>
		<item>
		<title>An Anatomy of Despair:  Introduction</title>
		<link>http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-introduction/</link>
		<comments>http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-introduction/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 05:15:28 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
		<category><![CDATA[Despair Engine]]></category>

		<category><![CDATA[Game Engine Design]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-introduction/</guid>
		<description><![CDATA[I&#8217;ve been working for a little more than three years on the Despair Engine, the game engine that Day 1 is using in Fracture and another, as-yet-unannounced, title.  In the beginning, there were two of us working on the technology, me and my longtime friend and collaborator Adrian Stone.  Now we&#8217;ve got thirty programmers working [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working for a little more than three years on the Despair Engine, the game engine that Day 1 is using in <a href="http://www.lucasarts.com/games/fracture/">Fracture</a> and another, as-yet-unannounced, title.  In the beginning, there were two of us working on the technology, me and my longtime friend and collaborator Adrian Stone.  Now we&#8217;ve got thirty programmers working in the same codebase.  Fracture&#8217;s getting close to shipping.  This seems like a good time to look back at the principles that shaped our initial architecture and at the decisions whose consequences we&#8217;re living with today.</p>
<p>The name started as a joke.  Adrian and I were out to lunch with our lead one day.  Somebody made a crack about naming the engine &#8220;Despair.&#8221;  One thing led to another, and by the end of the meal we&#8217;d plotted out a whole suite of despair-themed content creation tools, most of which never got made.  It was 2004.  We were starting from scratch on core technology for big-budget AAA games running on consoles that didn&#8217;t even exist yet.  We figured that &#8220;Despair&#8221; would work one way or the other, either as an imperative to our competitors if we succeeded or as a sadly accurate description of our own feelings if we failed.</p>
<p> <a href="http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-introduction/#more-6" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gamearchitect.net/2008/04/15/an-anatomy-of-despair-introduction/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GDC 2008</title>
		<link>http://gamearchitect.net/2008/03/12/gdc-2008/</link>
		<comments>http://gamearchitect.net/2008/03/12/gdc-2008/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 15:51:04 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
		<category><![CDATA[GDC]]></category>

		<guid isPermaLink="false">http://gamearchitect.net/?p=5</guid>
		<description><![CDATA[This year was the tenth anniversary of my first GDC.  It&#8217;s milestones like this that make one pause and take stock of one&#8217;s life.  Over the last decade, one of my college classmates was appointed United States Attorney for South Carolina; another lost a limb fighting in Iraq; another married actor Steve Martin (yes, that Steve [...]]]></description>
			<content:encoded><![CDATA[<p>This year was the tenth anniversary of my first GDC.  It&#8217;s milestones like this that make one pause and take stock of one&#8217;s life.  Over the last decade, one of my college classmates was appointed United States Attorney for South Carolina; another lost a limb fighting in Iraq; another married actor Steve Martin (yes, <em>that </em>Steve Martin).  And I&#8230; I have spent most of my waking hours contributing, in my own small way, to the <a href="http://www.dallasnews.com/sharedcontent/dws/dn/opinion/points/stories/DN-hymowitz_27edi.ART0.State.Edition1.378ca5b.html">perpetual adolescence of the American male</a>.</p>
<p>Like a career in game development, GDC is a mix of small rewards and great frustrations&#8211;and yet the two somehow balance each other out.  Back in 1998, the attendees were a small brash crowd, excited that gaming had finally arrived and enthusiastic about the future.  I think that was the first time somebody announced the oft-repeated canard about how we&#8217;re bigger than the movie industry.  My friends and I all made the crawl from room to room on Suite Night, availing ourselves of the free drinks and the catered food from the warming trays.  There was a party on the Queen Mary.  I got a thick pile of t-shirts and an Intel graphics card, and thought, <em>3dfx better watch out now that Intel&#8217;s getting into the market</em>.</p>
<p>Now GDC has become like SIGGRAPH.  The crowds are enormous&#8211;nearly 15,000 in attendance this year, I&#8217;m told.  But it&#8217;s not the size of the crowds that makes it less intimate.  It&#8217;s the fact that so many of the people there don&#8217;t really have much to say to each other:  there are indie game developers, console game developers, serious game developers, mobile phone game developers, people selling middleware and hardware and outsourcing to all of the above, recruiters, wannabes, publishers trying to sign developers, developers looking for a publisher, HR folks looking to hire artists and programmers and musicians, and press trying to cover the whole spectacle.  The death of E3 meant that this year there were more sessions than ever that could be summed up as, &#8221;look at my game and how awesome it is.&#8221;  I tried to avoid those.  I spent my three days at GDC looking for quiet places to talk to the people who do the same thing I do.  I didn&#8217;t go to any of the parties. <a href="http://gamearchitect.net/2008/03/12/gdc-2008/#more-5" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gamearchitect.net/2008/03/12/gdc-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WordPress</title>
		<link>http://gamearchitect.net/2008/03/09/wordpress/</link>
		<comments>http://gamearchitect.net/2008/03/09/wordpress/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 01:26:35 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
		<category><![CDATA[Admin]]></category>

		<guid isPermaLink="false">http://gamearchitect.net/?p=3</guid>
		<description><![CDATA[When I started GameArchitect, the word blog didn&#8217;t exist yet, and there was, therefore, a real shortage of decent blogging software.  I ended up buying Joel Spolsky&#8217;s CityDesk, mostly because it was what he used for Joel on Software and I like the look of his site.
CityDesk hasn&#8217;t had a lot of work over the [...]]]></description>
			<content:encoded><![CDATA[<p>When I started GameArchitect, the word blog didn&#8217;t exist yet, and there was, therefore, a real shortage of decent blogging software.  I ended up buying Joel Spolsky&#8217;s <a href="http://www.fogcreek.com/CityDesk/">CityDesk</a>, mostly because it was what he used for <a href="http://www.joelonsoftware.com/">Joel on Software</a> and I like the look of his site.</p>
<p>CityDesk hasn&#8217;t had a lot of work over the last couple of years, though, and I never have managed to figure out how to make it generate a proper RSS feed.  So I&#8217;m switching the site over to <a href="http://wordpress.com/">WordPress</a>, about which I&#8217;ve heard good things.  All old content is still available at <a href="http://www.gamearchitect.net/citydesk.html">http://www.gamearchitect.net/citydesk.html</a>.  Pardon the dust and plaster.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamearchitect.net/2008/03/09/wordpress/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
