<?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>Sgt. Conker</title>
	<atom:link href="http://www.sgtconker.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sgtconker.com</link>
	<description>We are &#34;Absolutely Fine&#34;</description>
	<lastBuildDate>Thu, 26 Apr 2012 20:23:38 +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>XNA &#8211; The state of play</title>
		<link>http://www.sgtconker.com/2012/04/xna-the-state-of-play/</link>
		<comments>http://www.sgtconker.com/2012/04/xna-the-state-of-play/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 11:24:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA["Absolutely fine"]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://conks.xbligdb.com/?p=2032</guid>
		<description><![CDATA[The death bells have been wrung many times for XNA by the community but as they've been ringing for several years and XNA is still here what is happening? Is XNA a dead platform? And does it have any benefits - should you still be using it - or even learning it? Firstly - we [...]]]></description>
			<content:encoded><![CDATA[<p>The death bells have been wrung many times for XNA by the community but as they've been ringing for several years and XNA is still here what is happening? Is XNA a dead platform? And does it have any benefits - should you still be using it - or even learning it?</p>
<p>Firstly - we have to consider the platforms:</p>
<p><strong>XBOX:</strong></p>
<p>With the 360, the ONLY option for indie games is XNA. While support from Microsoft has been spotty at best, a few people - myself included - make a decent living from this platform alone. Even just as a platform to toy with to show your friends code running on consumer hardware, XNA on Xbox is valuable. Is it dying? Well, <a href="http://uk.xbox360.ign.com/articles/121/1210280p1.html">we are likely to see the NEW Xbox (720, loop, whatever) Holiday 2013</a>. That's nearly 2 years away. And the 360 wont die instantly - in fact, its likely for people who cant afford to upgrade - indie games may be the only outlet of new games after a while.</p>
<p>Its possible the new Xbox will run XBLIG games - and possible that you'll be able to publish new XBLIG games but in all likelihood it'll be a new SDK.</p>
<p><strong>WindowsPhone:</strong></p>
<p>Microsoft has already announced the death of Silverlight pretty much - and in the same announcement has either said WP8 will  support new XNA apps - or wont. It's hard to truly read between the <a title="While not explicitly called out, XNA is very much a part of Larry's statement 'today's Windows Phone applications and games will run on the next major version of Windows Phone.' XNA is fully supported in the next major version and remains part of the Windows Phone family. We remain committed to supporting our developers' existing skills and code as we move ahead - together." href="#">lines</a>. What we DO know is that <a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2012/04/05/windows-8-and-the-windows-phone-sdk-pt-2.aspx">everything in the store right now will run on WP8</a>. There is also a good chance that WP8 will not be rolled out to the old devices, meaning you've got a captive market.</p>
<p><strong>Windows:</strong></p>
<p>This platform is the home of most of the paranoia - yet its the easiest to answer. <a href="http://forums.create.msdn.com/forums/p/91616/549344.aspx#549344">Windows 8 will not support XNA within the metro environment</a>. Does this mean XNA is dead? Anything but. Firstly, XNA on PC can only be compiled for x86 (not ARM) meaning all machines capable of running it will have desktop mode. Desktop mode will always support XNA - for the same reasons it will always support VB6 and so on. The PC is an open platform and thus you cant place limits on what it can run.</p>
<p>The concern is more that, as its not supported under Metro, it cannot be sold under the new Win8 store. This doesn't mean XNA is more dead - it just means its not more alive. However, just because Microsoft hasn't given us the tools to make XNA run in metro doesn't mean they wont exist. Because native development is possible - and how open windows is - there is no limit to what you can do - and there are several teams working to bring XNA to metro. The earliest we are aware of is the <a href="http://anxframework.codeplex.com/">ANX Framework</a> which is a port of XNA to DirectX11 - and openGL for Linux. Also <a href="http://tirania.org/blog/archive/2012/Apr-19.html">announced recently</a> is that <a href="http://monogame.codeplex.com/">MonoGame </a>will be working towards a metro version.</p>
<p>If this new store is of no concern to you, such as you wish to release for free, or on another marketplace such as Steam or <a href="http://store.indiecity.com/">IndieCity </a>then the changes (or lack there of) in Windows8 are of no concern at all - XNA is as valid a platform as it was with Windows 7, Vista and XP.</p>
<p>There is also <a href="http://blogs.msdn.com/b/shawnhar/">Shawn H's </a>new toy - <a href="http://blogs.msdn.com/b/chuckw/archive/2012/03/02/directxtk.aspx">DirectXTK</a> - created with <a href="http://social.msdn.microsoft.com/profile/chuck%20walbourn%20-%20msft/">Chuck Walbourn</a> - a few little toys for c++ that are based on XNA ideals - so you can make the move to Metro smoother for yourself while learning a new language.</p>
<p><strong>iPhone:</strong></p>
<p>Iphone? Yes, thanks to <a href="http://xamarin.com/monotouch">MonoTouch</a>, c# apps can be run on ios, and thanks to the open sourcproject <a href="http://monogame.codeplex.com/">MonoGame</a> , porting XNA apps is a lot less work than you imagine. The MonoGame port gets stronger and stronger every day, with 3D support being added recently - and new platforms being added frequently. iPhone seems to be the primary platform for the MonoGame and probably the healthiest platform if you intend to at least cover costs. the iPhone is actually a platform where XNA support is getting STRONGER rather than weaker and there are some rather interesting facts. Due to the apple app store rules, c# cannot be JIT on the iPhone - it has to be compiled. This means XNA code on the iPhone runs fast. REALLY fast. Much faster than the same code on WP7 for instance. There were some early concerns about some small print in the developer T&amp;C's but apple has reverted these meaning using c# for iOS development is fully legit.</p>
<p><strong>Android:</strong></p>
<p>As above, MonoGame is allowing XNA dev on android.  While not as mature, progress is being made fast and is worth consideration.</p>
<p><strong>MacOS/Linux:</strong></p>
<p>Both MonoGame and ANX are targeting these platforms. ANX seems to be more solid graphically, MonoGame more solid in the nitty-gritty stuff.</p>
<p><strong>Playstation Vita:</strong></p>
<p>Sony's Playstation Suite is a c# (mono based) platform for indies to create games on the PSV and 'Plasystation' android devices. While nothing concrete yet, since it supports c# already, using MonoGame or something similar wouldn't be a huge stretch. Its early days yet, but its certainly on the radar.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><em>So what does it all mean?</em></strong></p>
<p>If you a WP7 developer, your future is unknown. If you develop for XBOX, the future is uncertain but you've got at least 2 years of marketplace left. However, XNA is far from dead - in fact, if you're willing to stray from MS platforms  - or at least non MS versions of  XNA at least - its more alive than its ever been. Us developers - especially in the XNA community do like a bit of doom and gloom but its just not warranted. MS may not be supporting XNA directly for a while, but its got a lot of legs left in it.</p>
<p>Not only that, if you are starting out, XNA is an amazing platform to cut your teeth on - and what you learn is applicable on pretty much every other platform out there.</p>
<p>Sgtconker.com will be covering all of the above tech and will cover issues of porting, multiplatform development and the like. XNA isn't at the end of its life, its just growing up and leaving home.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2012/04/xna-the-state-of-play/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Under new management</title>
		<link>http://www.sgtconker.com/2012/04/under-new-management/</link>
		<comments>http://www.sgtconker.com/2012/04/under-new-management/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 10:29:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA["Absolutely fine"]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://conks.xbligdb.com/?p=2030</guid>
		<description><![CDATA[The illustrious leader has stepped aside for the time being and I, madninjaskillz, have taken command until he returns from his globe trotting/domination. Some of you may know me already, many will not. I cut my teeth in XNA programming with an XBLIG app called 'ezmuze', which I followed up with the super successful 'ezmuze+'.  [...]]]></description>
			<content:encoded><![CDATA[<p>The illustrious leader has stepped aside for the time being and I, madninjaskillz, have taken command until he returns from his globe trotting/domination.</p>
<p>Some of you may know me already, many will not. I cut my teeth in XNA programming with an XBLIG app called 'ezmuze', which I followed up with the super successful 'ezmuze+'.  In that time I went from decent zero to hero somewhat, so I think I'm rather well positioned to know what articles the noobs need and also, what the pros need too.</p>
<p>I hope under my command, the site will shake its reputation for not so many updates. I hope to expand the scope slightly, with tutorials and news on alternative XNA platforms such as monoGame, technologies such as DirectXTK (the spritebatch like c++ libs from Shawn H) and maybe even a little bit of WinRT/Metro.</p>
<p>My expertise are most certainly in the audio realm so I will be looking to others for other articles as you can only discuss iPad ports and DSP so much. If you want to contribute, please <a href="mailto:james@ezmuze.co.uk">contact me</a> with an article.</p>
<p>Hopefully we can restore Sgt.Conker to its former glory and help and inform a few people along the way.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2012/04/under-new-management/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ignoring a Hidden Clingerman to Visit Germany</title>
		<link>http://www.sgtconker.com/2011/07/ignoring-a-hidden-clingerman-to-visit-germany/</link>
		<comments>http://www.sgtconker.com/2011/07/ignoring-a-hidden-clingerman-to-visit-germany/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 13:29:44 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[#BoatForGeorge]]></category>
		<category><![CDATA[Jim Perry]]></category>
		<category><![CDATA[Roland Rosenkranz]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2011/07/ignoring-a-hidden-clingerman-to-visit-germany/</guid>
		<description><![CDATA[Looks like there were a new addition to the league of XNA/DirectX (didn’t that read DirectX/XNA once?) MVPs: the German Roland “Glatzemann” Rosenkranz, who is running amokcausing havockeeping posting on the XNA.mag and our beloved AppBuh forums. Congratulations, chap! Meanwhile, in Jim “So Evil That Even George Ducks and Covers” Perry-land the Overlocker himself continues [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like there were a new addition to the league of <a href="https://mvp.support.microsoft.com/communities/mvp.aspx?product=1&amp;competency=XNA%2fDirectX">XNA/DirectX (didn’t that read DirectX/XNA once?) MVPs</a>: the German <a href="http://www.mitohnehaare.de/">Roland “Glatzemann” Rosenkranz</a>, who is <strike>running amokcausing havoc</strike>keeping posting on the <a href="http://www.xnamag.de/">XNA.mag</a> and our beloved <a href="http://forums.create.msdn.com/forums/">AppBuh forums</a>. Congratulations, chap!</p>
<p>Meanwhile, in <a href="http://machxgames.com/blog/">Jim “So Evil That Even George Ducks and Covers” Perry</a>-land the Overlocker himself continues to spam his blog. This time, he covers <a href="http://machxgames.com/blog/?p=50">Spy Game Design – Multiplatform Issues/Capability</a> and <a href="http://machxgames.com/blog/?p=51">Spy Game Design – Character Training</a>. Lets see if he can keep up the pace while <a href="http://www.xnadevelopment.com/">The Hidden One</a> continues to, well, hide.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/07/ignoring-a-hidden-clingerman-to-visit-germany/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Replacement Clingerman</title>
		<link>http://www.sgtconker.com/2011/07/the-replacement-clingerman/</link>
		<comments>http://www.sgtconker.com/2011/07/the-replacement-clingerman/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 19:06:51 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[George W. Clingerman]]></category>
		<category><![CDATA[Jim Perry]]></category>
		<category><![CDATA[VoteForGeorge]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2011/07/the-replacement-clingerman-2/</guid>
		<description><![CDATA[As George W. “Father of an Army” Clingerman went quite quiet recently (conspiracy theorists claim he’s the XNA/XBLIG community manager now and hence is as quiet as the void that wasn’t a community manager…) we have to turn our head to the Evil MVP Jim “The Replacement Clingerman” Perry, who replaced locking with blogging what [...]]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://www.xnadevelopment.com/">George W. “Father of an Army” Clingerman</a> went quite quiet recently (<em>conspiracy theorists claim he’s the XNA/XBLIG community manager now and hence is as quiet as the void that wasn’t a community manager…</em>) we have to turn our head to the Evil MVP Jim “The Replacement Clingerman” Perry, who replaced locking with blogging what seems to be some sort of <a href="http://machxgames.com/blog/?tag=spy-game">The Spy Game Design Series</a>:</p>
<ul>
<li><a href="http://machxgames.com/blog/?p=35">Spy Game Design – Agent Specialties</a> </li>
<li><a href="http://machxgames.com/blog/?p=37">Spy Game Design – Inventory and Related Areas</a> </li>
<li><a href="http://machxgames.com/blog/?p=38">Spy Game Design – Assignments/Missions</a> </li>
<li><a href="http://machxgames.com/blog/?p=39">Spy Game Design–Death</a> </li>
<li><a href="http://machxgames.com/blog/?p=40">Spy Game Design – Advancement</a> </li>
<li><a href="http://machxgames.com/blog/?p=41">Spy Game Design – Combat</a> </li>
<li><a href="http://machxgames.com/blog/?p=48">Spy Game Design – Identities</a> </li>
</ul>
<p>And, compared to the AppBuh Forums mess <a href="http://www.gpwiki.org/forums/viewforum.php?f=11">his forums</a> are alive and kicking.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/07/the-replacement-clingerman/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Catalin on 2D Skeletal Animations</title>
		<link>http://www.sgtconker.com/2011/06/catalin-on-2d-skeletal-animations/</link>
		<comments>http://www.sgtconker.com/2011/06/catalin-on-2d-skeletal-animations/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 19:15:16 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Catalin Zima]]></category>
		<category><![CDATA[Skeletons]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2011/06/catalin-on-2d-skeletal-animations/</guid>
		<description><![CDATA[Catalin “Too Proud To Self-promote” Zima (you might know him as our local XNA MVP Captain ZSquare) has a nice write-up of 2D Skeletal Animations over at his blog. So, if you ever wondered what the benefits of skeletal animations in the 2D world as compared to our beloved sprite sheets are, his post would [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.catalinzima.com/">Catalin “Too Proud To Self-promote” Zima</a> (you might know him as our local XNA MVP Captain ZSquare) has a nice write-up of <a href="http://www.catalinzima.com/2011/06/2d-skeletal-animations/">2D Skeletal Animations over at his blog</a>. So, if you ever wondered what the benefits of skeletal animations in the 2D world as compared to our beloved sprite sheets are, <a href="http://www.catalinzima.com/2011/06/2d-skeletal-animations/">his post would be your starting point</a> to explore this very topic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/06/catalin-on-2d-skeletal-animations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Joplin Tornado Fund for DeathmatchGames</title>
		<link>http://www.sgtconker.com/2011/05/the-joplin-tornado-fund-for-deathmatchgames/</link>
		<comments>http://www.sgtconker.com/2011/05/the-joplin-tornado-fund-for-deathmatchgames/#comments</comments>
		<pubDate>Sat, 28 May 2011 10:00:25 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2011/05/the-joplin-tornado-fund-for-deathmatchgames/</guid>
		<description><![CDATA[Via The Dead Pixel Society comes the word about the impact of the Joplin Tornado on the XNA community: As you may or may not know (until now) a fellow XNA developer @DeathmatchGames and his family were victims of the May 22nd tornado that ravaged Joplin, MO. You can find extensive coverage of the tornado [...]]]></description>
			<content:encoded><![CDATA[<p>Via <a href="http://www.thedeadpixelsociety.com/">The Dead Pixel Society</a> comes the word about the impact of the Joplin Tornado on the XNA community:</p>
<blockquote cite="http://www.thedeadpixelsociety.com/joplin.html"><p>As you may or may not know (until now) a fellow XNA developer <a href="http://twitter.com/#!/DeathmatchGames">@DeathmatchGames</a> and his family were victims of the May 22nd tornado that ravaged Joplin, MO. You can find extensive coverage of the tornado and the devestation [sic] it's caused at <a href="http://www.cnn.com/search/?query=joplin%20tornado&amp;primaryType=mixed&amp;sortBy=date&amp;intl=false">CNN.com</a>, <a href="http://www.google.com/search?q=joplin+tornado&amp;hl=en&amp;safe=active&amp;prmd=ivnsum&amp;source=univ&amp;tbm=nws&amp;tbo=u&amp;ei=UIveTdWOCYqDtgeGtIHxCQ&amp;sa=X&amp;oi=news_group&amp;ct=title&amp;resnum=1&amp;ved=0CCAQqAIwAA">Google</a>, and everywhere else.</p>
</blockquote>
<p>Head over to the <a href="http://www.thedeadpixelsociety.com/joplin.html">DeathmatchGames - Joplin Tornado Fund</a> to read more and to learn about the ways to help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/05/the-joplin-tornado-fund-for-deathmatchgames/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>High End Performance Optimizations on the Xbox 360 and Windows Phone 7</title>
		<link>http://www.sgtconker.com/2011/05/high-end-performance-optimizations-on-the-xbox-360-and-windows-phone-7/</link>
		<comments>http://www.sgtconker.com/2011/05/high-end-performance-optimizations-on-the-xbox-360-and-windows-phone-7/#comments</comments>
		<pubDate>Sun, 15 May 2011 06:21:19 +0000</pubDate>
		<dc:creator>Captain ZSquare</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[UberGeekGames]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1996</guid>
		<description><![CDATA[Ian Nicolades Technical Director, UberGeekGames For the Xbox or Windows Phone 7 programmer, performance is something that should always be kept in mind. For any moderately complex game, it can be very easy for framerate issues to crop up, and seeing as those pesky gamers insist on having a smooth playing experience, it can quickly [...]]]></description>
			<content:encoded><![CDATA[<h4 style="text-align: center;">Ian Nicolades</h4>
<h4 style="text-align: center;">Technical Director, UberGeekGames</h4>
<p>For the Xbox or Windows Phone 7 programmer, performance is something that should always be kept in mind. For any moderately complex game, it can be very easy for framerate issues to crop up, and seeing as those pesky gamers insist on having a smooth playing experience, it can quickly become problematic.</p>
<p>Having had quite a bit of experience in this area with our last few games, this article will be a “missing manual” of sorts; the kind of cheat sheet that would have saved me more than one headache! <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-1996"></span></p>
<h2>The target audience</h2>
<p>I’m going to make a couple of reasonable assumptions to guide us. First, you either have a game that currently has performance issues, or you’re planning a game that will most likely run into performance issues later on in development. Second, you’ve already read through Shawn’s blog posts on performance. If you haven’t, go read them now: <a href="http://msdn.com/blogs/shawnhar">http://msdn.com/blogs/shawnhar</a> I’ll wait.</p>
<p>Back? Excellent. You should already be familiar with the basic principles of profiling, how to use a profiler, rig up an FPS counter, and how to determine if you’re CPU or GPU bound. Without further ado, we will now dive into the deep end of the performance pool, so to speak. Each of the following sections will cover a technique that can help improve your game’s performance.</p>
<h2>Quadtrees, Grid Registration, and spatial partitioning</h2>
<p>Quadtrees are an oft-recommended improvement, and with good reason – they can vastly improve the performance of many different systems, the most popular being collision detection and view space culling.</p>
<p>For example, let’s say you’re building a shooter and will have a large number of bullets colliding with an even larger number of enemies. A naive approach would be to run your collision detection algorithm on every bullet against every enemy. This will take exponentially longer as the number of enemies and bullets increases.</p>
<p>By implementing a quadtree, you break the game world up into smaller chunks. Enemies, bullets, and anything else that needs to be collided with will be added to whichever chunk contains them. This way, you only need to check collisions against the bullets and enemies in the same chunk.</p>
<p>Quadtrees can be built in both 2D and 3D worlds. In 3D, they can also be used for efficient view space culling. They are typically known as “octrees” in 3D space.</p>
<h2>Garbage collection</h2>
<p>The CLR on the Xbox and WP7 have much slower garbage collectors than on the PC (soon this won’t be the case for WP7: <a href="http://blogs.msdn.com/b/abhinaba/archive/2011/04/13/generational-gc-in-windows-phone-mango.aspx">http://blogs.msdn.com/b/abhinaba/archive/2011/04/13/generational-gc-in-windows-phone-mango.aspx</a> – huzzah!). If your game has frequent stuttering or pauses, then you most likely have a garbage collection issue. This has been covered in Shawn’s blog, but here are a few additional tips I’ve picked up:</p>
<p>-          Beware of boxing. This can come from odd places, such as adding maintaining a list of interfaces; the following code will generate garbage:</p>
<p>[code]</p>
<p>interface ISomethingOrOther</p>
<p>{<br />
    void Something();<br />
}</p>
<p>struct Something : ISomethingOrOther<br />
{<br />
    public void Something()<br />
   {<br />
   }<br />
}</p>
<p>List&lt;ISomethingOrOther&gt; ListOfInterfaces = new List&lt;ISomethingOrOther&gt;();</p>
<p>ListOfInterfaces.Add(new Something()); // boxing!</p>
<p>[/code]</p>
<p>-          Boxing can also occur when you use an enum as a key in a Dictionary&lt;Enum, something&gt;. I usually use a Dictionary&lt;int, something&gt; and cast to int when indexing into it like so:</p>
<p>[code]<br />
enum YourEnum</p>
<p>{</p>
<p>    A, B, C</p>
<p>}</p>
<p>//adding elements will cause boxing.</p>
<p>Dictionary&lt;YourEnum, string&gt; dictionaryWithBoxing = new Dictionary&lt;YourEnum, string&gt;()</p>
<p>{</p>
<p>    { YourEnum.A, &quot;a&quot; },</p>
<p>    { YourEnum.B, &quot;b&quot; },</p>
<p>    { YourEnum.C, &quot;c&quot; },</p>
<p>}</p>
<p>//no boxing!</p>
<p>Dictionary&lt;int, string&gt; yourDictionaryWithoutBoxing = new Dictionary&lt;int, string&gt;()</p>
<p>{</p>
<p>    { (int)YourEnum.A, &quot;a&quot; },</p>
<p>    { (int)YourEnum.B, &quot;b&quot; },</p>
<p>    { (int)YourEnum.C, &quot;c&quot; },</p>
<p>}<br />
[/code]</p>
<p>Nick has more info in this blog post: <a href="http://blog.nickgravelyn.com/2009/04/net-misconceptions-part-1/">http://blog.nickgravelyn.com/2009/04/net-misconceptions-part-1/</a></p>
<p>-          Make liberal use of pooling to avoid creating new objects at runtime. A simple template that I use:</p>
<p>[code]</p>
<p>class SomeObject<br />
{<br />
    //stuff<br />
    public void Spawn(Vector2 position)<br />
    {<br />
    }<br />
}</p>
<p>class SomeObjectPool</p>
<p>{<br />
    public static bool[] isAlive;<br />
    public static SomeObject[] pool;<br />
    public static SomeObjectPool()<br />
    {<br />
        pool = new SomeObject[100];<br />
        isAlive = new bool[100];<br />
        for(int i=0;i&lt;pool.Length;i++)<br />
        {<br />
            isAlive[i] = false;<br />
            pool[i] = new SomeObject();<br />
        }<br />
    }</p>
<p>public static void Spawn(Vector2 position)<br />
{<br />
    for(int i=0;i&lt;pool.Length;i++)<br />
    {<br />
        If(!isAlive[i])<br />
        {<br />
            isAlive[i] = true;<br />
            pool[i].Spawn(position);<br />
            break;<br />
        }<br />
    }<br />
}<br />
}</p>
<p>[/code]</p>
<p>Nick also has a template for this: <a href="http://forums.create.msdn.com/forums/t/3375.aspx">http://forums.create.msdn.com/forums/t/3375.aspx</a></p>
<p>-          Pooling classes is almost always a better solution than switching to structs, unless you know exactly why you need them. Classes behave very differently from structs, sometimes in unintuitive ways if you are not familiar with the difference between value and reference types. This page contains a good primer on the differences: <a href="http://www.albahari.com/valuevsreftypes.aspx">http://www.albahari.com/valuevsreftypes.aspx</a></p>
<h2>Draw that 2D content most efficiently with Spritesheets</h2>
<p>If you draw sprites individually, loading them one at a time and drawing them, you will prevent the GPU from batching its draw calls in the most efficient manner. By using spritesheets, the GPU will not need to switch textures in between draw calls and can batch your drawing more efficiently. This post by Shawn succinctly explains the general idea: <a href="http://forums.create.msdn.com/forums/p/24254/131437.aspx#131437">http://forums.create.msdn.com/forums/p/24254/131437.aspx#131437</a></p>
<p>The spritesheet sample is here: <a href="http://create.msdn.com/en-US/education/catalog/sample/sprite_sheet">http://create.msdn.com/en-US/education/catalog/sample/sprite_sheet</a></p>
<p>And I’ve personally been using Nick’s SpriteSheetPacker tool to automate the packaging process, with great success: <a href="http://spritesheetpacker.codeplex.com/">http://spritesheetpacker.codeplex.com/</a></p>
<h2>Batch your SpriteBatches</h2>
<p>Efficient rendering is all about batching. Remember the elf in a box model: <a href="http://blogs.msdn.com/b/shawnhar/archive/2008/03/31/an-elf-in-a-box.aspx">http://blogs.msdn.com/b/shawnhar/archive/2008/03/31/an-elf-in-a-box.aspx</a></p>
<p>If you want to maximize GPU performance, use as few SpriteBatch batches as possible. There are, of course, many cases where you just have to end and begin a new SpriteBatch in order to switch renderstates or blend states, but for all other cases – use a single spritebatch!</p>
<h2>Multithreading</h2>
<p>On the Xbox 360, you have three separate processor cores and six hardware threads, four of which are available for you to use (one on core one, one on core two, and the two on core three; see this MSDN article <a href="http://msdn.microsoft.com/en-us/library/system.threading.thread.setprocessoraffinity.aspx">http://msdn.microsoft.com/en-us/library/system.threading.thread.setprocessoraffinity.aspx</a>).</p>
<p>If you are CPU bound, you might gain some performance by threading. Common tasks that are likely candidates for threading:</p>
<p>-          Particles; if your particles are updated on the CPU and take a significant amount of processing time, they will likely be one of the easiest things to multithread.</p>
<p>-          Collision detection; while this can be tricky to synchronize depending on what you’re it can work well.</p>
<p>-          The sky is the limit when it comes to what you can offload. With enough work you could theoretically offload most any system to another thread. The key is making sure that the performance gains will be high enough to warrant the overhead of managing the thread, and how easy it will be to synchronize data between threads.</p>
<p>On WP7, you are limited to a single core, 1GHz processor. Multithreading is unlikely to see any wins here, as it will just add overhead.</p>
<h2>Manually inlining high frequency code</h2>
<p>You may get to the point where you still have performance trouble but there are no more big wins left, or all the low hanging fruit has been picked, so to speak. At this point, manually inlining methods that are called at a high frequency could be the next best step. Manually inlining is nothing more than avoiding excess method calls when possible. Take the following piece of code:</p>
<p>[code]</p>
<p>foreach(Particle particle in ParticleList)<br />
{<br />
    particle.Update();<br />
}</p>
<p>class Particle<br />
{<br />
    public void Update()<br />
    {<br />
        Position += Velocity<br />
    }<br />
}</p>
<p>[/code]</p>
<p>There is a small amount of overhead when calling a method. This alternate version will be faster:</p>
<p>[code]</p>
<p>void Update()<br />
{<br />
    foreach(Particle particle in ParticleList)<br />
    {<br />
        particle.Position += particle.Velocity; //slightly faster<br />
    }<br />
}</p>
<p>[/code]</p>
<p>The gains here are relatively small, but can make a difference in with lots of values such as particle engines.</p>
<h2>Cache values wherever possible</h2>
<p>Optimization, at its core, is just figuring out how to get the same or similar results while doing less work. Caching values is a perfect example of this. When drawing a texture, for example, how many times do you do this?</p>
<p>[code]</p>
<p>void Draw()<br />
{<br />
    Rectangle drawingRect = new Rectangle(foo, bar, foobar, barfoo);<br />
    spriteBatch.Draw(Texture, drawingRectangle, Color);<br />
}<br />
[/code]</p>
<p>What’s the point of recreating the rectangle each frame if the value doesn’t change? Define that outside of the loop like this:</p>
<p>[code]<br />
Rectangle drawingRect = new Rectangle(foo, bar, foobar, barfoo);<br />
void Draw()<br />
{<br />
    spriteBatch.Draw(Texture, drawingRectangle, Color);<br />
}<br />
[/code]</p>
<h2>Properties</h2>
<p>Properties are roughly equivalent to a JIT method call. And we’ve already established that method calls take a nontrivial amount of time to execute. Therefore, properties are best to be avoided unless necessary.</p>
<p>“But, kind sir, all the C# style guides tell me to use properties! Why would they recommend such a thing if it’s so bad?”</p>
<p>Simply put, most guides I’ve seen which recommend this assume that you are either going for maximum readability and maintainability, and/or performance isn’t of much concern (eg, a winforms tool). And on the PC, you’re almost certainly not going to run into issues stemming from properties, as the latest processor can chew through them with ease. On hardware such as the WP7 or the Xbox 360, every cycle can count.</p>
<p>In other words, if you want to look at pretty code all day, you should stay far away from game development. <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Array indexing</h2>
<p>Another subtle improvement in tight loops is how you index into an array’s elements. An array index costs about the same as a JIT method call, plus some overhead for bounds checking. Take this code for example:</p>
<p>[code]</p>
<p>SomeObject[] objectArray;</p>
<p>Void DoSomeStuff()<br />
{<br />
    for(int i=0;i&lt;objectArray.Length;i++)<br />
    {<br />
        objectArray[i].Position += something;<br />
        objectArray[i].Velocity *= whatever;<br />
        objectArray[i].Counter++;<br />
    }<br />
}</p>
<p>[/code]</p>
<p>You can cache the variable to avoid this overhead:</p>
<p>[code]</p>
<p>SomeObject[] objectArray;</p>
<p>Void DoSomeStuff()<br />
{<br />
    for(int i=0;i&lt;objectArray.Length;i++)<br />
    {<br />
        SomeObject obj = objectArray[i];<br />
        obj.Position += something;<br />
        obj.Velocity *= whatever;<br />
        obj.Counter++;<br />
    }<br />
}</p>
<p>[/code]</p>
<h2>Dictionaries vs Arrays</h2>
<p>Dictionaries are great. They are an invaluable coding tool that makes efficiently organizing data easy. However, it is quite possible for them to become a performance bottleneck, as they are about twice as slow as an array index, and can be even slower if you’re unnecessarily indexing into them more than once. Here’s some example code to explain this:</p>
<p>[code]</p>
<p>Dictionary&lt;int, Texture2D&gt; textureDictionary;<br />
…</p>
<p>//this is the slowest way to use a Dictionary, as we are effectively doing two lookups for the same object. Slowness!</p>
<p>if(textureDictionary.ContainsKey(textureKey))<br />
{<br />
    Texture2D texture = textureDictionary[textureKey];<br />
    //do something with texture<br />
}</p>
<p>//this is faster as we are only doing one lookup.<br />
Texture2D texture = null;<br />
if(textureDictionary.TryGetValue(textureKey, out texture)<br />
{<br />
    //do something with texture here<br />
}</p>
<p>[/code]</p>
<h2>Vector operations</h2>
<p>When possible, use the Vector2.Whatever() methods that pass their arguments by reference and use out to supply their output. This will be faster than using the normal C# addition/subtract/multiplication/division operators. Take this example code:</p>
<p>[code]</p>
<p>//Easy to read, but slow!<br />
someVector += anotherVector * someFloat;</p>
<p>//More verbose, yet faster<br />
Vector2 tmp = new Vector2();<br />
Vector2.Multiply(ref anotherVector, someFloat, out tmp);<br />
Vector2.Add(ref someVector, ref tmp, out someVector);<br />
[/code]</p>
<p>Soon, this will be even faster on WP7: <a href="http://blogs.msdn.com/b/abhinaba/archive/2011/04/10/simd-support-in-netcf.aspx">http://blogs.msdn.com/b/abhinaba/archive/2011/04/10/simd-support-in-netcf.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/05/high-end-performance-optimizations-on-the-xbox-360-and-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 Unleashed Hackathon</title>
		<link>http://www.sgtconker.com/2011/05/windows-phone-7-unleashed-hackathon/</link>
		<comments>http://www.sgtconker.com/2011/05/windows-phone-7-unleashed-hackathon/#comments</comments>
		<pubDate>Fri, 13 May 2011 00:30:48 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[Chris G. Williams]]></category>
		<category><![CDATA[Hackathon]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[WP7Dev]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2011/05/windows-phone-7-unleashed-hackathon/</guid>
		<description><![CDATA[Via Chris G. Williams comes the word of an upcoming Windows Phone 7 hackathon in Atlanta, Georgia. Quotes the Chris: This is a &#34;hands on&#34; hackathon where you will learn from Windows Phone 7, XNA and Azure experts how to build, scale and publish your Windows Phone 7 app or game. If you are just [...]]]></description>
			<content:encoded><![CDATA[<p>Via <a href="http://geekswithblogs.net/cwilliams/Default.aspx">Chris G. Williams</a> comes the word of an upcoming <a href="http://geekswithblogs.net/cwilliams/archive/2011/05/11/145274.aspx">Windows Phone 7 hackathon</a> in Atlanta, Georgia. Quotes the Chris:</p>
<blockquote cite="http://geekswithblogs.net/cwilliams/archive/2011/05/11/145274.aspx"><p>This is a &quot;hands on&quot; hackathon where you will learn from Windows Phone 7, XNA and Azure experts how to build, scale and publish your Windows Phone 7 app or game. If you are just a beginner, or already have apps in the Marketplace this event will should not be missed. BYO Laptop!</p>
<p>RSVP early, space is limited to 300 attendees: <a href="http://bit.ly/RegWP7Hackathon">http://bit.ly/RegWP7Hackathon</a> <em>[Ed.: <a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032486873&amp;Culture=en-US">The unshortened URL for the event details is here</a>]</em></p>
<p><strong>(YOU DON'T HAVE TO BE A TECHED ATTENDEE TO COME TO THIS!)</strong></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/05/windows-phone-7-unleashed-hackathon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiding a Clingerman to Talk Natively</title>
		<link>http://www.sgtconker.com/2011/04/hiding-a-clingerman-to-talk-natively/</link>
		<comments>http://www.sgtconker.com/2011/04/hiding-a-clingerman-to-talk-natively/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 13:00:25 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Direct3D]]></category>
		<category><![CDATA[Direct3D 11]]></category>
		<category><![CDATA[George W. Clingerman]]></category>
		<category><![CDATA[SharpDX]]></category>
		<category><![CDATA[SlimDX]]></category>
		<category><![CDATA[VoteForGeorge]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1988</guid>
		<description><![CDATA[In Benchmarking C#/.Net Direct3D 11 APIs vs native C++ (a post from March 14, I wonder why I did not share this already…) Alexandre Mutel explores the cost of calling native APIs from managed code (AKA interop) via micro benchmarking various managed Direct3D 11 APIs. He does this because: Hopefully, in SharpDX unlike any other [...]]]></description>
			<content:encoded><![CDATA[<p><img style="background-image: none; border-right-width: 0px; margin: 0px 8px 8px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Hiding a Clingerman" border="0" alt="Hiding a Clingerman" align="left" src="http://conks.xbligdb.com/wp-content/uploads/2011/04/Hiding-a-Clingerman.jpg" width="244" height="184" /> In <a href="http://code4k.blogspot.com/2011/03/benchmarking-cnet-direct3d-11-apis-vs.html">Benchmarking C#/.Net Direct3D 11 APIs vs native C++</a> (a post from March 14, I wonder why I did not share this already…) <a href="http://www.blogger.com/profile/05096938106073079832">Alexandre Mutel</a> explores the cost of calling native APIs from managed code (AKA interop) via micro benchmarking various managed Direct3D 11 APIs. He does this because:</p>
<blockquote cite="http://code4k.blogspot.com/2011/03/benchmarking-cnet-direct3d-11-apis-vs.html"><p>Hopefully, in SharpDX unlike any other DirectX .NET APIs, this code has been written to be consistent over the whole generated code, and was carefully designed to be quite efficient… but still, It has obviously a cost, and we need to know it!</p>
</blockquote>
<p><strong>Spoiler:</strong> The offerings Microsoft has in store are, by far, slower than SlimDX/SharpDX.</p>
<p>In other news: There is <a href="http://forums.create.msdn.com/forums/t/81418.aspx">a thread over in the AppBuhAppHub forums praising the XNA MVPs</a>. We here in the barracks fully support that effort – mostly due to the fact that Captain ZSquare has access to various arms here and <em title="We means the Sarg">we</em> lost the keys to lock up the arsenal… – so you might head over to add to the +1 (none of the Google +1 stuff) choir.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/04/hiding-a-clingerman-to-talk-natively/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recommendations on Resuming</title>
		<link>http://www.sgtconker.com/2011/04/recommendations-on-resuming/</link>
		<comments>http://www.sgtconker.com/2011/04/recommendations-on-resuming/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 12:14:37 +0000</pubDate>
		<dc:creator>Captain ZSquare</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Bob Taco Ind]]></category>
		<category><![CDATA[Michael B. McLaughlin]]></category>
		<category><![CDATA[resuming games]]></category>
		<category><![CDATA[tombstoning]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1985</guid>
		<description><![CDATA[Coming hot from the freshly-awarded MVP Michael B. McLaughlin, a set of no less than eight (8= 2*4 = 3+5 = 10-2) tips to improve the experience of users when they need to close and resume your XNA game on Windows Phone 7. The article is a must read for everyone who doesn't want to [...]]]></description>
			<content:encoded><![CDATA[<p>Coming hot from the freshly-awarded MVP Michael B. McLaughlin, a set of no less than eight (8= 2*4 = 3+5 = 10-2) tips to improve the experience of users when they need to close and resume your XNA game on Windows Phone 7. The article is a must read for everyone who doesn't want to annoy their customers.</p>
<p>Go ahead and <a href="http://geekswithblogs.net/mikebmcl/archive/2011/04/14/wp7-games-recommendations-on-resuming.aspx">read it now</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/04/recommendations-on-resuming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

