<?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>Rachels Lab Notes &#187; Uncategorized</title>
	<atom:link href="http://www.rachelslabnotes.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rachelslabnotes.com</link>
	<description>Game Development as seen through the Blum Filter</description>
	<lastBuildDate>Thu, 17 Dec 2009 03:10:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>There are never enough render engines..</title>
		<link>http://www.rachelslabnotes.com/2009/11/there-are-never-enough-render-engines/</link>
		<comments>http://www.rachelslabnotes.com/2009/11/there-are-never-enough-render-engines/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 00:01:20 +0000</pubDate>
		<dc:creator>groby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rachelslabnotes.com/?p=50</guid>
		<description><![CDATA[After my post on the hidden cost of C++, Vince suggested I go write a small game in C, see how I like that.

While that&#8217;s an interesting idea &#8211; maybe for another day &#8211; I&#8217;m interested in looking at larger-scale problems than that. And since I&#8217;m lately itching to write a renderer again (the last [...]]]></description>
			<content:encoded><![CDATA[<p>After my post on the <a href="http://www.rachelslabnotes.com/2009/10/the-hidden-cost-of-c/">hidden cost of C++</a>, <a href="http://solid-angle.blogspot.com/">Vince</a> suggested I go write a <a href="http://www.rachelslabnotes.com/2009/10/the-hidden-cost-of-c/#comment-24">small game in C</a>, see how I like that.</p>

<p>While that&#8217;s an interesting idea &#8211; maybe for another day &#8211; I&#8217;m interested in looking at larger-scale problems than that. And since I&#8217;m lately itching to write a renderer again (the last one was 1998), that&#8217;s where I started.</p>

<p>The goal of this project is to explore the &#8220;pressure points&#8221; in writing games in C++<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>, to see if in some of these areas, the pain and delay can be alleviated. To make it as painful as possible, it&#8217;s of course going to be cross-platform. That means OS X and Windows, unless somebody wants to gift me a devkit for Xenon or PS3&#8230;</p>

<p>And even after that first bit of code, just hoisting out the most basic platform abstractions, a few lessons are to be had.</p>

<h3>Banned Forever</h3>

<p>I hope to keep the preprocessor mostly banned, except in some very limited areas where the libraries abstract actual hardware. It&#8217;s cause for a lot of confusion in real-world projects, so let&#8217;s try to keep it out. It is interesting to think if you could achieve the same effect without a preprocessor, just with language constructs &#8211; and what those would be.</p>

<h3>Too Useful to be banned</h3>

<p>Some C++ features are too useful to be banned. Writing a render engine in pure C, as Vince suggested, is possible, but tedious. So I guess I have to loosen my stance and allow some features to creep back in.</p>

<ul>
<li><p>namespaces</p>

<p>Sure, you <em>can</em> prefix every single function, but it&#8217;s a messy business. It carries no performance cost to have them, so they&#8217;re in.</p></li>
<li><p>limited classes</p>

<p>Mostly, to get the convenient syntax of member function invocations. On non-virtual members, this carries a predictable cost. (I.e. I can predict what code the compiler will generate without having to look up the class API). Casts and copy constructors are still out, since they can implicitly generate code that I won&#8217;t be aware of when examining code.</p>

<p>So, basically, C-style structs that have member functions and access protection are what&#8217;s allowed.</p></li>
</ul>

<p>With both of these, I&#8217;m curious about their impact on compilation time.</p>

<h3>Missing Features</h3>

<p>Some features are missing from C++ that would be extremely useful:</p>

<ul>
<li><p>Anonymous functions.</p>

<p>Yes, the new standard has them &#8211; but at a high readability price.</p></li>
<li><p>Headerless compilation</p>

<p>Header files are a completely pointless waste of time, a remnant from the late 70&#8217;s.
As a side effect, that would allow mapping platform-specific enums to abstraced enums without having to expose the platform-specific header that contains them.</p></li>
<li><p>Cleaner Syntax</p>

<p>Braces/semicolons do add a lot of noise. Can I get a whitespace-scoped language, like Python?</p></li>
</ul>

<h3>Don&#8217;t care</h3>

<p>There are many issues I don&#8217;t care about right now. Consequently, I&#8217;ll go &#8220;off the shelf&#8221; with them.</p>

<ul>
<li><p>math libraries.</p>

<p>I really don&#8217;t want to write the 22nd implementation of a vector class, thank you. I&#8217;ve written enough of that. Since they&#8217;re all owned by my employers, I&#8217;m opting for an open-source one. So far, <a href="http://cmldev.net">CML</a> is the chosen one.
It is, rather poignantly, making the point that this is a facility that&#8217;s sorely missing from C++ for game development.</p></li>
<li><p>Window System Code</p>

<p>While I really do want to examine the effects cross-platform code carries, some things are too gross to be touched by humans. I started out using GLUT, but its shortcomings meant native window handling. That&#8217;s not what really concerns me here, so I&#8217;ll be basing things on <a href="http://www.libsdl.org/">SDL</a> for now &#8211; at least for purposes of handling the windowing system.</p></li>
<li><p>Memory management</p>

<p>I didn&#8217;t need to touch that yet, but if it comes to that, there&#8217;s <a href="http://g.oswego.edu/">dlmalloc</a>, or Fluid Studios&#8217; memory system (no link, since their atrocious website doesn&#8217;t have links &#8211; it&#8217;s all Flash. But you can find it by starting <a href="http://www.paulnettle.com">here</a>), and probably many others. And unless I absolutely have to touch memory management, I don&#8217;t want to go there.</p></li>
</ul>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>I&#8217;m not sure if that&#8217;s even relevant for much longer. I see the number of teams writing entire engines definitely shrinking, since it&#8217;s very expensive. Often, off-the-shelf engines (or something another team in your company wrote) will be good enough. Since I&#8217;m a systems-level gal, I hope to stay on a team that works on an engine, though. Hence the focus on it.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rachelslabnotes.com/2009/11/there-are-never-enough-render-engines/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>EA, Playfish &amp; Layoffs</title>
		<link>http://www.rachelslabnotes.com/2009/11/ea-playfish-layoffs/</link>
		<comments>http://www.rachelslabnotes.com/2009/11/ea-playfish-layoffs/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 16:50:31 +0000</pubDate>
		<dc:creator>groby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rachelslabnotes.com/?p=46</guid>
		<description><![CDATA[To get the formalities out of the way: I work at EA, but this is my private blog. The views and opinions expressed here are mine, and mine alone. (Unless it&#8217;s something really stupid, then my cat typed it.)

Also, nothing in here reflects knowledge internal to EA. Not only am I a lowly peon in [...]]]></description>
			<content:encoded><![CDATA[<p>To get the formalities out of the way: I work at EA, but this is my private blog. The views and opinions expressed here are mine, and mine alone. (Unless it&#8217;s something really stupid, then my cat typed it.)</p>

<p>Also, nothing in here reflects knowledge internal to EA. Not only am I a lowly peon in a large machine who doesn&#8217;t get told anything of importance, I certainly wouldn&#8217;t share if I <em>was</em> told internal info either. Professional pride and all that.</p>

<p>With that out of the way, let&#8217;s look at Playfish first. Many critics claim it was done to <a href="http://playthisthing.com/ea-bends-over-wall-street">appease analysts</a> or, if they are analysts, that it <a href="http://www.gamasutra.com/php-bin/news_index.php?story=26006">dilutes EAs core business</a>.</p>

<p>While those are valid concerns, they miss a major fact that&#8217;s looming for video games: AAA games are getting expensive enough that they just might outgrow the size of their market, core video gamers. And even if they don&#8217;t, it is a rather crowded market, and revenue only arrives in bursts every 2-4 years for each title.</p>

<p>What EA is doing here is branching out into a market with a far larger customer base, lower costs, and monthly revenue. And, more importantly, server-based games can&#8217;t be pirated. EA just cut out a large threat that is in the process of killing the PC market and even has significant impact on the console market. (After all, Microsoft just killed almost <a href="http://www.pcworld.com/article/182010/microsoft_bans_up_to_one_million_users_from_xbox_live.html">a million accounts</a> on XBox live for hacking)</p>

<p>Furthermore &#8211; assuming Playfish indeed delivers on its revenue &amp; profit valuations &#8211; EA has traded cash-on-hand against a profitable revenue stream. And while it&#8217;s nice to sit on <a href="http://ycharts.com/companies/ERTS/cash_on_hand">$2.2B cash</a>, a positive cash-flow is a better choice in the long term.</p>

<p>And then there are the layoffs. While I appreciate the sentiment of many online commenters that &#8220;EA shafted their employees to buy Playfish&#8221;(paraphrased), that&#8217;s almost certainly not true. As I said above, EA has plenty of cash to go buy something. There was no need to cut jobs for that acquisition, and I don&#8217;t think there&#8217;s any relation.</p>

<p>Riccitello simply realizes that the console games market as is has matured and is saturated. There&#8217;s only room for so many titles, so it makes sense to focus on those with the best chances to make money.</p>

<p>Yes, gamers are now going to scream about the &#8220;evil EA&#8221; that just produces sequels &#8211; but I believe the sales numbers of all the excellent new IP EA has produced last year clearly tell the story. Vocal gamers profess a love for new IP, but what&#8217;s mostly getting bought is the sequel to the established title.</p>

<p>Leaving out Nintendo consoles &#8211; because they thrive on mostly first-partly titles &#8211; let&#8217;s look at the top titles for the year so far:</p>

<ul>
<li>Halo 3</li>
<li>Resident Evil 5</li>
<li>Killzone 2</li>
<li>Call of Duty: World at War</li>
<li>FIFA Soccer 10</li>
<li>Call of Duty: Modern Warfare 2</li>
</ul>

<p>Notice a trend there? Every single one is a sequel. Gamers buy what they perceive as &#8220;established quality&#8221;. And I can&#8217;t really blame them &#8211; $60 is a lot of money to invest for entertainment.</p>

<p>To be clear: I have <em>NO</em> insight what titles actually have been cancelled. EA remains tight-lipped about that. For all I know, we might have cancelled only sequels and focused on new IP, although I&#8217;d consider that unlikely.</p>

<p>And for analysts like Pachter, who now complain that EA &#8220;didn&#8217;t spot&#8221; the underperforming titles last year: It is incredibly hard to judge what a game will be until you&#8217;re at least a year or so into execution. Making games is not formulaic. It takes a great idea, an awesome team, and a spark of magic to make a good game happen. You can control the first two, but the last one is out of your control. You&#8217;ll see it manifest at some point, but it takes some work before you know it&#8217;s there or not.</p>

<p>So, even though I don&#8217;t like it on a personal level, I think EA has at least the right ideas. You can certainly debate the merit of the concrete steps taken, but I believe AAA console games will shrink in importance, while online gaming increases &#8211; so this seems a decent decision. Lots of things could have done better; we certainly have internal talent capable of building social games. But we missed the boat, and that means there was pressure to buy market share out of the box.</p>

<p>What I do have an issue with is the handling of this, though. If you have to lay off people, let them know. Then people at least know where they stand. There is <em>still</em> no official word on what studios and titles will be affected by those 1,500 layoffs &#8211; which means <em>everybody</em> is worried to some extent. It is incredibly hard to do good work if you don&#8217;t know you&#8217;ll still have a job the next day &#8211; and that endangers that spark of magic I mentioned, the one ingredient to a successful game that&#8217;s incredibly hard to come by in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rachelslabnotes.com/2009/11/ea-playfish-layoffs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Frames per second&#8221; is not relevant</title>
		<link>http://www.rachelslabnotes.com/2009/10/frames-per-second-is-not-relevant/</link>
		<comments>http://www.rachelslabnotes.com/2009/10/frames-per-second-is-not-relevant/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 15:43:54 +0000</pubDate>
		<dc:creator>labmistress</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rachelslabnotes.com/?p=39</guid>
		<description><![CDATA[Insomniacs Mike Acton created quite a stir when he claimed yesterday that keeping your game at 60fps doesn&#8217;t matter. Unfortunately, his article bases this only on correlation between frame rate and final score. While it&#8217;s of great importance to the business end of making games, there&#8217;s little reasoning on the technical side why 60fps and [...]]]></description>
			<content:encoded><![CDATA[<p>Insomniacs Mike Acton created quite a stir when he claimed yesterday that keeping your game at <a href="http://www.insomniacgames.com/blogcast/blog/mike_acton/1503082">60fps doesn&#8217;t matter</a>. Unfortunately, his article bases this only on correlation between frame rate and final score. While it&#8217;s of great importance to the business end of making games, there&#8217;s little reasoning on the technical side <em>why</em> 60fps and 30fps make so little difference.</p>

<p>(Based on what else I read from Mike, I&#8217;m sure he&#8217;s reasoned about it alright &#8211; it&#8217;s just not part of this particular article.)</p>

<p>The concept of frame rate matters at all because the update rate of the entire world is tied to the refresh rate &#8211; the game progresses &#8220;one frame&#8221; at a time. That, in turn, is done since the final draw that a world update triggers needs to be tied to the screen refresh to avoid <a href="http://en.wikipedia.org/wiki/Screen_tearing">screen tearing</a>)</p>

<p>But &#8220;the world&#8221; is not a monolithic block &#8211; games do many things, and the order in which you do them matters very much. Mick West has an <a href="http://www.gamasutra.com/view/feature/1942/programming_responsiveness.php">excellent article</a> on what he calls &#8220;response lag&#8221; &#8211; the time it takes for a button press to finally cause a result on screen. And effectively, you measure this lag time by stating how often you need to run &#8220;the world&#8221; (or the main game loop) until the input causes a visible effect.</p>

<p>That, in turn, means that with the same internal delay, a 30fps game takes twice as long to react to a button press as a 60fps game. Now, if your game is well engineered, that internal delay is &#8220;only&#8221; 3-4 frames. At 30fps, that&#8217;s <em>just</em> below the human reaction time &#8211; that&#8217;s why most gamers don&#8217;t complain about 30fps <em>if</em> it&#8217;s a well-engineered game engine.</p>

<p>Things start to get different once the gamer is not reacting, but planning ahead and trying to hit a button at an exact time. Music games, for example. Or FPS players who lead a shot. Here what matters is not so much the lag per se &#8211; we can learn to anticipate that. What matters is that that lag is constant, so there are no timing surprises.</p>

<p>So what matters is <em>predictable</em> lag that does not exceed the human reaction time &#8211; which is <em>just</em> so achievable with 30fps, and a monolithic step function.</p>

<p>And that&#8217;s the core assumption everybody was making for the &#8220;60fps or die&#8221; argument &#8211; your step function is monolithic. It was, for a long time, with a single core synced to the screen refresh. That argument simply isn&#8217;t true any more.</p>

<p>We have multiple cores available that can run completely decoupled from each other<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>. That means, for example, that I can sample the controller at a much higher rate than I refresh the screen. We might run the physics engine at a time step significantly shorter than the duration of a single frame. In other words, we can run components of the world at different speeds and only have the drawing synced to the screen.</p>

<p>The tricky issue here is that we are sampling &#8211; aliasing effects can be introduced along the way. Which is really all that &#8220;lag&#8221; is &#8211; it&#8217;s the result of discrete sampling of a continuous world.</p>

<p>And that is the part that surprises me most &#8211; while we have a ton of really smart guys working on keeping our lag small, <em>nobody</em> seems to treat it as an aliasing problem, bringing signal theory to bear on it. Am I missing something?</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Multi-core is not a panacea. Any fixed overhead you incur by frame compels you to lower framerates. If you have a fixed absolute overhead for distributing tasks, it takes a larger relative chunk of a 16ms frame than a 33ms frame.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rachelslabnotes.com/2009/10/frames-per-second-is-not-relevant/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Hello World</title>
		<link>http://www.rachelslabnotes.com/2009/10/hello-world/</link>
		<comments>http://www.rachelslabnotes.com/2009/10/hello-world/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 20:44:24 +0000</pubDate>
		<dc:creator>labmistress</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rachelslabnotes.com/?p=3</guid>
		<description><![CDATA[&#8230; &#8217;cause every good project starts with &#8220;Hello World&#8221;.

Welcome to my new blog!

What&#8217;s the point of this blog? It is, in a way, my lab notebook for everything concerning games development. That&#8217;s my profession and my craft, and I have a lot of things that I don&#8217;t want to get lost, so I&#8217;m keeping lab [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; &#8217;cause every good project starts with &#8220;Hello World&#8221;.</p>

<p>Welcome to my new blog!</p>

<p>What&#8217;s the point of this blog? It is, in a way, my lab notebook for everything concerning games development. That&#8217;s my profession and my craft, and I have a lot of things that I don&#8217;t want to get lost, so I&#8217;m keeping lab notes &#8211; like every other scientist.</p>

<p>You&#8217;ll hear a lot about scaling our game development process, cutting back development effort without impacting the quality, and the occasional other things that cross my mind. There&#8217;ll probably be some mumbling about graphics and AI, too, because I just like those two fields.</p>

<p>Anyway &#8211; welcome, and I hope you enjoy being here!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rachelslabnotes.com/2009/10/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
