<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Mitch Walker : XNA Game Studio</title><link>http://blogs.msdn.com/mitchw/archive/tags/XNA+Game+Studio/default.aspx</link><description>Tags: XNA Game Studio</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Finish the...</title><link>http://blogs.msdn.com/mitchw/archive/2008/11/28/finish-the.aspx</link><pubDate>Sat, 29 Nov 2008 01:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9153681</guid><dc:creator>mitchw</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mitchw/comments/9153681.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mitchw/commentrss.aspx?PostID=9153681</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mitchw/rsscomments.aspx?PostID=9153681</wfw:comment><description>&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;When we shipped &lt;/FONT&gt;&lt;A href="http://creators.xna.com/en-us/xnags_islive"&gt;&lt;FONT face=Calibri color=#800080&gt;XNA Game Studio 3.0&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri&gt; last month, and then turned on &lt;/FONT&gt;&lt;A href="http://creators.xna.com/en-US/XBLCG_is_Live"&gt;&lt;FONT face=Calibri color=#800080&gt;Xbox LIVE Community Games&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri&gt; this month, that, to me, really completed our initial vision for XNA Game Studio, the changes in the way games are made, and creating opportunities for a new class of game developers.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;While there will always be a list of things to be added or improved to XNA Game Studio and the XNA Framework, I was having trouble finding tough, interesting problems to solve, which is what motivates me.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;So I’ve taken my love of games, of creating platforms and tools, and of a particular game series and found my next big challenge to tackle.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A couple of weeks ago, I started as a Program Manager on the &lt;/FONT&gt;&lt;A href="http://kotaku.com/5048500/halo-studio-seeks-next-gen-program-manager"&gt;&lt;FONT face=Calibri color=#800080&gt;Microsoft Halo Studio&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri&gt; team.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’m joining a(nother) team filled with very talented people and I’m excited about the possibilities.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;Unfortunately, what I’ll be working on won’t lend itself to public blogging much anymore…not that I’ve been a regular blogger anyway.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;And I usually don’t post (or twitter) about day to day stuff.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Me getting another Diet Dew from the fridge just doesn’t seem that interesting. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’ll keep this blog around for a bit and see how it goes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;I’ll still be involved in the XNA Game Studio community, but now from the “other” side…a creator…as I continue to learn, create, and wait to see what the team comes up with next.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;-Mitch&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9153681" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mitchw/archive/tags/Game+Programming/default.aspx">Game Programming</category><category domain="http://blogs.msdn.com/mitchw/archive/tags/General/default.aspx">General</category><category domain="http://blogs.msdn.com/mitchw/archive/tags/XNA+Game+Studio/default.aspx">XNA Game Studio</category></item><item><title>The One About Storage</title><link>http://blogs.msdn.com/mitchw/archive/2008/10/15/the-one-about-storage.aspx</link><pubDate>Thu, 16 Oct 2008 06:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9001378</guid><dc:creator>mitchw</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/mitchw/comments/9001378.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mitchw/commentrss.aspx?PostID=9001378</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mitchw/rsscomments.aspx?PostID=9001378</wfw:comment><description>&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;So I’ve played quite a few XNAGS games, and quite a few that have been released to Xbox LIVE Marketplace as part of the Xbox LIVE Community Games beta.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Based on the types of issues we’ve seen and feedback in general about good development practices, we set out to create the “best practices” for creating Community Games document.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This will be a living document that is continuously updated and expanded upon as we find out what works, what doesn’t work, what is difficult, and what are some things most games should attempt to do.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There is one issue, however, that I’ve seen crop up quite often and I figure it’s worth discussing in more depth what it is, what causes it, and how to prevent it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Let’s call it the “Storage API Hang of Fun”.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You’ve probably run across it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You build your game, add save game or high score support and being a good XNAGS citizen, use the Storage APIs to get a hold of a proper &lt;B style="mso-bidi-font-weight: normal"&gt;StorageContainer&lt;/B&gt; so you can read and write the files to the correct place.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Everything seems to be working well; it’s time to beta test!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So you package up your game and hand it out to a few people to try.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;“Your game freezes my Xbox 360”&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;What? How can this be? It was working perfectly on my machine! I thought the purpose of a console was that it is a fixed hardware platform that is easy to develop against since everyone will have the same hardware!&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Except there is one area that each console can be slightly different: Storage devices, or more specifically, the number of devices available.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Ask the person who is having trouble if they have a HDD and a Memory Unit plugged in.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Most likely they do.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Have them remove the Memory Unit and I bet the game starts to function properly.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Problem solved!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;But why did it happen? Let’s take a look into a couple of areas that have led you down this path.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face=Calibri size=3&gt;The Guide&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;In XNA Game Studio 2.0 we provided access to Gamer Profiles and the Guide functionality of the Xbox 360.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The &lt;B style="mso-bidi-font-weight: normal"&gt;Guide&lt;/B&gt; is a system service that is running in the background of your game.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is the UI that is displayed when the user hits the silver Xbox 360 button on their controllers, want to create a Friend request, view their messages, etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The system “hooks” our call to &lt;B style="mso-bidi-font-weight: normal"&gt;GraphicsDevice.Present&lt;/B&gt; (which gets called for you inside of &lt;B style="mso-bidi-font-weight: normal"&gt;Game.EndDraw&lt;/B&gt;).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Inside of this, it performs any input processing and drawing, which is how it can draw on top of your game without you needing to do anything.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;The only thing you need to do is to make sure your game is running, i.e. having &lt;B style="mso-bidi-font-weight: normal"&gt;Update&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;Draw&lt;/B&gt; called into (and you allowing them to return) at least 15 times a second (the recommended minimum).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;As long as your game isn’t blocked on the main thread, the Guide will be able to come and go as it pleases and everyone is happy.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Unless you block the main thread.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is why we designed many of the &lt;B style="mso-bidi-font-weight: normal"&gt;Guide&lt;/B&gt; APIs to use the .NET asynchronous call pattern.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If the particular &lt;B style="mso-bidi-font-weight: normal"&gt;Guide&lt;/B&gt; API you are calling requires user input and expects data to return, then you have to call the &lt;B style="mso-bidi-font-weight: normal"&gt;Guide&lt;/B&gt; API such that it occurs on a background thread…this allows your main thread to continue to run, which will eventually call &lt;B style="mso-bidi-font-weight: normal"&gt;GraphicsDevice.Present&lt;/B&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face=Calibri size=3&gt;Storage APIs&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Guide.BeginShowStorageDeviceSelector&lt;/B&gt; is one such API.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The purpose of this API is to allow the user to choose what storage device they would like the game to read and write from.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Since the Xbox 360 can have any combination of a HDD and up to two Memory Units, a “well behaved” game will allow the user to choose whichever device that is present.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;When we released XNA Game Studio Express, we provided a non-asynchronous &lt;B style="mso-bidi-font-weight: normal"&gt;Guide.ShowStorageDeviceSelector&lt;/B&gt; API, knowing that on the Xbox 360, calling this on the main thread would instantly lock your console.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We provided for those that would like to call this blocking version from a background thread.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In XNAGS 2.0 we introduced many more Guide APIs and we wanted to clean things up a bit and make them more consistent.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We realized that the &lt;I style="mso-bidi-font-style: normal"&gt;correct&lt;/I&gt; way to call this API was to call it asynchronously, so we removed the blocking version and helped those unfamiliar with the pattern to move their code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The native APIs that we call by default won’t display the selection UI if there is only one storage device available.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Instead it will return instantly with the “default” device.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In our first release, we passed in a flag that basically says “always show the UI”.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In another effort to help make this easier, we stopped passing this flag in XNAGS 2.0 so that if only one device is available, the call will return immediately.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Unfortunately the combination of these two changes (requiring you to call it asynchronously and not display the UI if there is only one device), led many people to write the following code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 border=1 class="MsoTableGrid"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.65in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-background-themecolor: background1; mso-background-themeshade: 242" vAlign=top width=638&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;IAsyncResult&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt; result = &lt;SPAN style="COLOR: #2b91af"&gt;Guide&lt;/SPAN&gt;.BeginShowStorageDeviceSelector(...);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;while&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;(result.IsCompleted == &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;StorageDevice&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt; device = &lt;SPAN style="COLOR: #2b91af"&gt;Guide&lt;/SPAN&gt;.EndShowStorageDeviceSelector(result);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;If you call this piece of code on the main thread…what will happen?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The Begin call will succeed, we’ll then sit there and spin until the user has selected the device they want to use and the operation is “complete”.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We’ll then call the End method and get the device.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;But if we’re spinning on IsCompleted, then that means GraphicsDevice.Present is not getting called, which means the user won’t be able to select a device, so that while condition will never complete.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;The game is now deadlocked.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The user will have to reboot their Xbox 360.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Unless…they only have one storage device available.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In which case, IsCompleted will immediately be true, you’ll get down to the End call and everything will return normally!&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;So, a long description of a relatively simple problem and one that is easy to get yourself into.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;How do we fix it?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;By handling the async pattern correctly.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You have two choices and they are both valid.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;One is to store the &lt;B style="mso-bidi-font-weight: normal"&gt;IAsyncResult&lt;/B&gt; as a member variable in your game and check &lt;B style="mso-bidi-font-weight: normal"&gt;IsCompleted&lt;/B&gt; inside of your &lt;B style="mso-bidi-font-weight: normal"&gt;Update&lt;/B&gt; call.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The other is to pass in a callback method to &lt;B style="mso-bidi-font-weight: normal"&gt;BeginShowStorageDeviceSelector&lt;/B&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Once the operation is completed, your method will get called, the &lt;B style="mso-bidi-font-weight: normal"&gt;IAsyncResult&lt;/B&gt; will get passed to you, and you can use it to complete the operation.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I generally prefer the callback method, but again, either pattern is equally correct.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Here’s a simple example of how you can call this API so that it behaves correctly regardless of the number of storage devices the user has.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 border=1 class="MsoTableGrid"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.65in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-background-themecolor: background1; mso-background-themeshade: 242" vAlign=top width=638&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyGameState&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;StorageDevice&lt;/SPAN&gt; Device;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyGame&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;Game&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; LoadContent()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Some object you want to have passed into the callback&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MyGameState&lt;/SPAN&gt; myGameState = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyGameState&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Guide&lt;/SPAN&gt;.BeginShowStorageDeviceSelector(StorageCompletedCallback, myGameState);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; StorageCompletedCallback(&lt;SPAN style="COLOR: #2b91af"&gt;IAsyncResult&lt;/SPAN&gt; result)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Retrieve the state you passed in&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MyGameState&lt;/SPAN&gt; myGameState = (&lt;SPAN style="COLOR: #2b91af"&gt;MyGameState&lt;/SPAN&gt;)result.AsyncState;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Complete the call and retrieve the selected StorageDevice&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;myGameState.Device = &lt;SPAN style="COLOR: #2b91af"&gt;Guide&lt;/SPAN&gt;.EndShowStorageDeviceSelector(result);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Hopefully if you’ve run into this problem with your games, you now have a better understanding of what is occurring, and how to fix it.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9001378" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mitchw/archive/tags/Game+Programming/default.aspx">Game Programming</category><category domain="http://blogs.msdn.com/mitchw/archive/tags/XNA+Game+Studio/default.aspx">XNA Game Studio</category></item><item><title>Audio Compression using XACT</title><link>http://blogs.msdn.com/mitchw/archive/2007/04/27/audio-compression-using-xact.aspx</link><pubDate>Sat, 28 Apr 2007 03:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2306410</guid><dc:creator>mitchw</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mitchw/comments/2306410.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mitchw/commentrss.aspx?PostID=2306410</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mitchw/rsscomments.aspx?PostID=2306410</wfw:comment><description>&lt;P class=style2&gt;There are two pieces of feedback that I hear quite a bit related to the audio support in XNA Game Studio Express.&lt;/P&gt;
&lt;UL&gt;
&lt;LI class=style2&gt;It only supports WAV files. All of my sounds are in a different format, such as WMA.&lt;/LI&gt;
&lt;LI class=style2&gt;Audio binaries are too large. WAV isn't compressed, so my music tracks are huge!&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=style2&gt;We're investigating what we can do for the first issue, which would obviously help the second issue at the same time. But there is some support for compressing your audio files in the current product, using the XACT tool; it's just not easy to discover. XACT supports ADPCM compression on Windows and XMA compression on the Xbox 360. You can get about 4:1 compression with ADPCM and even better with XMA. So while perhaps not as high as some other encodings, such as WMA, it does offer quite a substantial savings.&lt;/P&gt;
&lt;P class=style2&gt;So how do you enable compression for your Wavebanks? Let's take a look:&lt;/P&gt;
&lt;UL&gt;
&lt;LI class=style2&gt;&lt;STRONG&gt;Create an XACT project and a Wave Bank&lt;/STRONG&gt;&lt;BR&gt;Start the XACT editor by using the Start menu shortcut Microsoft XNA Game Studio Express -&amp;gt; Tools -&amp;gt; Microsoft Cross-Platform Audio Creation Tool (XACT).&amp;nbsp; Create a new project and add a new Wave Bank to the project.&lt;/LI&gt;&lt;/UL&gt;
&lt;UL&gt;
&lt;LI class=style2&gt;&lt;STRONG&gt;Add some WAV files to the Wave Bank&lt;/STRONG&gt;&lt;BR&gt;While we won't be playing any sounds during this, we do want to see the results of the compression.&amp;nbsp; Once your done with this, you should see something like the below screenshot.&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=style6&gt;&lt;IMG height=452 src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step1.png" width=809 mce_src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step1.png"&gt;&lt;/P&gt;
&lt;P class=style6 mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class=style2&gt;&lt;STRONG&gt;Create a new Compression Preset&lt;/STRONG&gt;&lt;BR&gt;You can create a group of compression settings via a Compression Preset.&amp;nbsp; This allows you to reuse the settings across multiple Wave Banks.&amp;nbsp; This is also why it's a bit hidden.&amp;nbsp; Rather than adjusting the compression settings on the sounds themselves or the Wave Bank, we do it here.&amp;nbsp; You can create a new Compression Preset easily by right-clicking on the Compression Presets item in the explorer.&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=style6&gt;&lt;IMG height=452 src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step2_small.png" width=320 mce_src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step2_small.png"&gt;&lt;/P&gt;
&lt;P class=style6 mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class=style4&gt;&lt;STRONG&gt;&lt;SPAN class=style5&gt;Tweak Settings&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class=style5&gt;&lt;BR&gt;After you've created it, you can see the default compression settings for ADPCM and XMA. You do have the ability to change some of these settings, although we'll just leave the defaults for this exercise.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=style6&gt;&lt;IMG height=452 src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step3_small.png" width=312 mce_src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step3_small.png"&gt;&lt;/P&gt;
&lt;P class=style6 mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class=style4&gt;&lt;STRONG&gt;&lt;SPAN class=style5&gt;Apply the Compression Preset to the Wave Bank.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class=style5&gt;&lt;BR&gt;This is as easy as selecting the Wave Bank we created earlier, and then selecting the Compression Preset we just created in the Properties window for the Wave Bank. This tells the XACT compiler that we would like it to compress the WAV files using the preset settings when it builds the Wave Bank binaries.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=style6&gt;&lt;IMG height=459 src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step4_small.png" width=306 mce_src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step4_small.png"&gt;&lt;/P&gt;
&lt;P class=style6 mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class=style4&gt;&lt;STRONG&gt;&lt;SPAN class=style5&gt;Done!&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class=style5&gt;&lt;BR&gt;If we look at the details for the WAV files that are in the Wave Bank, we see that they now indicate they are compressed and how much space is saved.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=style6&gt;&lt;IMG height=459 src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step5.png" width=809 mce_src="http://www.mitchw.net/blogs.msdn.com/Audio%20Compression%20using%20XACT_files/step5.png"&gt;&lt;/P&gt;
&lt;P class=style6 mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=style2&gt;I hope this was helpful for those that didn't know about the ability to compress your audio binaries using XACT.&amp;nbsp; While not as compressed as some other formats, it should provide for smaller game sizes, especially when including audio assets for background music.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2306410" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mitchw/archive/tags/Game+Programming/default.aspx">Game Programming</category><category domain="http://blogs.msdn.com/mitchw/archive/tags/XNA+Game+Studio/default.aspx">XNA Game Studio</category></item><item><title>XNA Happenings</title><link>http://blogs.msdn.com/mitchw/archive/2006/10/26/xna-happenings.aspx</link><pubDate>Thu, 26 Oct 2006 19:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:876254</guid><dc:creator>mitchw</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mitchw/comments/876254.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mitchw/commentrss.aspx?PostID=876254</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mitchw/rsscomments.aspx?PostID=876254</wfw:comment><description>&lt;P&gt;You've probably seen the post announcing we're releasing a &lt;A class="" href="http://blogs.msdn.com/xna/archive/2006/10/23/announcing-xna-game-studio-express-beta-2.aspx" target=_blank mce_href="http://blogs.msdn.com/xna/archive/2006/10/23/announcing-xna-game-studio-express-beta-2.aspx"&gt;Beta 2 of XNA Game Studio Express&lt;/A&gt;.&amp;nbsp;&amp;nbsp;This release contains lots of fixes and tweaks based on feedback and it includes the much anticipated Content Pipeline!&amp;nbsp; As we get closer to release, I'll have a post that explains some of the changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you want to get a sneak peak at what's coming in the beta, then you should stop by the &lt;A class="" href="http://seattle.techevents.info/codecamp/2/agenda.aspx" target=_blank mce_href="http://seattle.techevents.info/codecamp/2/agenda.aspx"&gt;Seattle Code Camp v2.0&lt;/A&gt; that is happening this weekend.&amp;nbsp; There are a lot of great sessions, including 3 XNA related sessions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Making an XNA Game for the Xbox 360&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Introduction to the Programmable Pipeline in XNA&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Exploring the XNA Framework&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I'm giving the last session where we'll be looking at new features and changes in the XNA Framework, a little peak into the Content Pipeline and our&amp;nbsp;support for the Xbox 360!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=876254" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mitchw/archive/tags/Game+Programming/default.aspx">Game Programming</category><category domain="http://blogs.msdn.com/mitchw/archive/tags/XNA+Game+Studio/default.aspx">XNA Game Studio</category></item></channel></rss>