<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9026666720801508897</id><updated>2011-12-09T16:31:44.277-08:00</updated><category term='bitwise'/><category term='Portability'/><category term='Compiler'/><category term='OutOfVideoMemory'/><category term='unpack'/><category term='Performance'/><category term='Game'/><category term='bugs'/><category term='Errors'/><category term='Bug'/><category term='new'/><category term='HLSL'/><category term='converting'/><category term='Load Paradigm'/><category term='pack'/><category term='Current Technique Pass'/><category term='XACT'/><category term='Ragnarok'/><category term='XNA 4.0'/><category term='World'/><category term='Billboard'/><category term='The Sphere'/><category term='shift'/><category term='List'/><category term='PC'/><category term='stencil buffer'/><category term='Direct Depth Buffer Access'/><category term='Visual Stuido'/><category term='WinForms'/><category term='freeze'/><category term='Bejeweled Twist'/><category term='Glitch'/><category term='foreach'/><category term='Clear'/><category term='Game Engine'/><category term='Platforming Block'/><category term='Input'/><category term='Nut Harvest'/><category term='Video Game'/><category term='Resolved'/><category term='XNA 3.1'/><category term='undocumented'/><category term='XACT not setting IsPlaying Property'/><category term='Objects'/><category term='Pygame'/><category term='Metod Sharing'/><category term='Development'/><category term='Array'/><category term='build'/><category term='Copy'/><category term='UnloadContent'/><category term='color'/><category term='Graphics Card'/><category term='fix'/><category term='Indie Games'/><category term='#include'/><category term='broke'/><category term='uint'/><category term='.NET'/><category term='IsPlaying'/><category term='RenderTarget'/><category term='Python'/><category term='Introduction'/><category term='TicTacToe'/><category term='premultiplied alpha'/><category term='Sprite'/><category term='Text Box'/><category term='Initing'/><category term='360'/><category term='Dev Blog'/><category term='Xbox 360'/><category term='MaxVertexIndex'/><category term='DirectX 10'/><category term='Tutorial'/><category term='Ford'/><category term='Keyboard'/><category term='PackedValue'/><category term='XNA'/><category term='doesSupport32Bit'/><category term='ToArray'/><category term='Clone'/><category term='QuadTrix'/><category term='Garbage'/><category term='SetWindowsHookEx'/><category term='BeginShowMessageBox'/><category term='ADPCM'/><category term='xWMA'/><category term='sound'/><category term='Effect.Apply'/><category term='Didgery'/><category term='IMessageFilter'/><category term='An unexpected error has occured'/><category term='Components'/><category term='preprocessor'/><category term='DDBA'/><category term='TranslateMessage'/><category term='Sample'/><category term='Design Decisions'/><category term='Custom'/><category term='LoadContent'/><category term='guide'/><category term='Depth Buffer'/><category term='IndexElementSize'/><category term='Game Component'/><category term='XMA'/><category term='music'/><category term='website'/><category term='Generics'/><category term='indices'/><category term='C#'/><category term='Effect'/><category term='DeVry'/><category term='limitation'/><category term='Platformer'/><category term='Linq'/><category term='WM_CHAR'/><category term='PopCap'/><category term='256'/><category term='DirectX'/><title type='text'>Enigmatic Fish</title><subtitle type='html'>A place where stuff happens and information is occasionally shared. Find tutorials on GIMP, XNA, Blender and other various entities. More importantly, read about the life of an independent video game developer.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-702442964132008318</id><published>2011-08-29T14:59:00.000-07:00</published><updated>2011-08-29T14:59:43.031-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Keyboard'/><category scheme='http://www.blogger.com/atom/ns#' term='Text Box'/><category scheme='http://www.blogger.com/atom/ns#' term='Sample'/><category scheme='http://www.blogger.com/atom/ns#' term='Input'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='TranslateMessage'/><category scheme='http://www.blogger.com/atom/ns#' term='WM_CHAR'/><category scheme='http://www.blogger.com/atom/ns#' term='SetWindowsHookEx'/><category scheme='http://www.blogger.com/atom/ns#' term='IMessageFilter'/><title type='text'>Getting True Keyboard Input into your XNA Games</title><content type='html'>One of the things that PC games often need is a form of in-game keyboard text input. In my case, I needed a login screen that allows the user to type in their username and password before the game continues on. The process turns out to be more complicated than I would have wished it to be in XNA, so I post my solution here in hopes that it may help others with a similar need.&lt;br /&gt;&lt;br /&gt;The first solution that comes to mind is to use the KeyboardState.GetPressedKeys() method to get all the keys currently pressed on the keyboard. Running this each frame will, in theory, enable us to get all the keys the player pressed, right? While this seems simple enough, this method will not work for several reasons. Firstly, GetPressedKeys() is not buffered, meaning if you type keys faster than the update rate of your game you will get missing keys. In simple terms, a user typing faster than 60wpm (if your game runs at 60fps) will have issues. Another issue it that the return array does not give any&amp;nbsp;indication&amp;nbsp;of the order in which the keys were pressed, so that gives you no idea on how to construct the final string if two or more keys were pressed&amp;nbsp;simultaneously. The biggest problem is that you have to do all the key to char translation yourself. GetPressedKeys does not return a nice char or string array that contains the actual value you typed. No, it returns an array of the&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.input.keys.aspx"&gt;Keys&lt;/a&gt; enumeration. This forces the programmer to either build a huge Dictionary&lt;keys, char=""&gt; that maps each Key to a character value, or build a huge switch(Keys) statement that checks through some 50+ odd cases and handles each one. But even with all this work this method will not function, because Keys does not&amp;nbsp;differentiate&amp;nbsp;between case, meaning you have to handle additional translation if you want the character to be lowercase. Add that to the fact that the Shift key combinations (e.g. Shift+1 = !) and&amp;nbsp;localization&amp;nbsp;are not supported leaves you in some seriously rough waters.&lt;/keys,&gt;&lt;br /&gt;&lt;keys, char=""&gt;&lt;br /&gt;&lt;/keys,&gt;&lt;br /&gt;That method being&amp;nbsp;wrought&amp;nbsp;with issues, we have to look for another method to resolve the problem. The next logical solution is to hook into the KeyDown, KeyPress, and KeyUp events on the XNA form. Alas, this too is filled with issues. For one, the XNA form will never get the KeyDown or KeyPress events. It appears that the form eats them up before you can use them. The other issue is that the KeyUp event passes a Keys enum...which gives us the same translation and&amp;nbsp;localization&amp;nbsp;problems as using the KeyboardState.GetPressedKeys() method.&lt;br /&gt;&lt;br /&gt;So...where can we go from here? After doing some research I heard mention of the&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.imessagefilter.aspx"&gt;IMessageFilter&lt;/a&gt; interface. This interface allows messages to be intercepted before they are dispatched to the form, meaning we can grab the KeyDown and KeyPressed messages before the form&amp;nbsp;devours&amp;nbsp;them. Better yet, the messages are not transformed into the Keys enum, thus we can get the true translated key (WM_CHAR) that the user pressed as a character.&lt;br /&gt;&lt;br /&gt;There is another alternative that involves creating a low level keyboard hook using &lt;a href="http://msdn.microsoft.com/en-us/library/ms644990(v=vs.85).aspx"&gt;SetWindowsHookEx &lt;/a&gt;and grabbing the key events from there, but that involves more pInvoked native calls and more complexity in general then the solution I came up with.&lt;br /&gt;&lt;br /&gt;The solution I ended up using involves a bit of unsafe code and a pInvoked call to the user32.dll function &lt;a href="http://msdn.microsoft.com/en-us/library/ms644955(v=vs.85).aspx"&gt;TranslateMessage&lt;/a&gt;. I would have preferred to avoid native or unsafe calls, but I couldn't get anything to work without them. The basic rundown is this: there is a classes called KeyFilter that inherits from the IMessageFilter interface. This class watches for two &lt;a href="http://www.autoitscript.com/autoit3/docs/appendix/WinMsgCodes.htm"&gt;Window Message Code&lt;/a&gt;'s. The first,&amp;nbsp;0x0100, is a key event. If the message has this ID we use the Marshal class to grab us some unmanaged memory, store the message in a pointer, and pass the message to the unmanaged TranslateMessage function. This function will translate the message into the true character that was pressed and post the 0x0102 (WM_CHAR) message to the form's message queue. The WM_CHAR message happens to be the second message that KeyFilter looks for. Stored in this message's &lt;a href="http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&amp;amp;l=EN-US&amp;amp;k=k(SYSTEM.WINDOWS.FORMS.MESSAGE.WPARAM);k(DevLang-CSHARP)&amp;amp;rd=true"&gt;WParam &lt;/a&gt;is the transformed char we have been wanting all along! All that needs done is to convert the thing from a unsigned to a char with a simple cast and we can use it!&lt;br /&gt;&lt;br /&gt;So that is basically the process necessary to get true Keyboard input into your XNA game. All that needs done now is to set up some events in a class that will fire when a new character is inbound. I wrote a sample that goes along with this post. &lt;a href="http://www.mediafire.com/?tdjy0udmkyd9g9y"&gt;You can find it here.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-702442964132008318?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/702442964132008318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2011/08/getting-true-keyboard-input-into-your.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/702442964132008318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/702442964132008318'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2011/08/getting-true-keyboard-input-into-your.html' title='Getting True Keyboard Input into your XNA Games'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-1072467911677333662</id><published>2011-05-20T12:53:00.000-07:00</published><updated>2011-05-20T12:53:36.724-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sample'/><category scheme='http://www.blogger.com/atom/ns#' term='HLSL'/><category scheme='http://www.blogger.com/atom/ns#' term='The Sphere'/><category scheme='http://www.blogger.com/atom/ns#' term='DDBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Direct Depth Buffer Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Depth Buffer'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectX 10'/><title type='text'>Getting Direct Access to the Depth Buffer in DirectX 10</title><content type='html'>There was a comment on The Sphere blog recently that requested a sample be made on &lt;a href="http://bitwisegames.wordpress.com/2011/03/25/getting-direct-access-to-the-depthbuffer-in-directx10/#comments"&gt;how to get direct access to the depth buffer in DirectX 10&lt;/a&gt;. So I figured I would slap together a sample that attempts to show how the basic setup is&amp;nbsp;done. For anyone who has used DirectX before, you know that the 'basic setup' isn't really all that basic or trivial. So to attempt to keep the sample a bit more clean, I leveraged &lt;a href="http://www.libsdl.org/"&gt;SDL &lt;/a&gt;to do all the window work and event looping stuff. It wasn't quite as easy as using SDL with OpenGL, but it was still tons more easier than using Win32 directly. The sample is filled with bunches of comments, so I'm not going to reiterate then here. Instead you can just go &lt;a href="http://www.mediafire.com/?n1j0fv52vb5ljjg"&gt;download the sample and check it out&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Note that the solution was built this using Visual Studio 2010 and the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba"&gt;June 2010 DirectX SDK&lt;/a&gt;. If you don't have the June 2010 SDK this sample won't be able to link in all the necessary libraries.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-1072467911677333662?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/1072467911677333662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2011/05/getting-direct-access-to-depth-buffer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/1072467911677333662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/1072467911677333662'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2011/05/getting-direct-access-to-depth-buffer.html' title='Getting Direct Access to the Depth Buffer in DirectX 10'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-6768141663647301773</id><published>2011-03-19T13:42:00.000-07:00</published><updated>2011-03-19T14:29:13.721-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='The Sphere'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectX'/><title type='text'>A new dev blog</title><content type='html'>A friend of mine and I are working on our first 3D game using DirectX. It's a simple platformer/puzzler where you play a sphere and try to beat the levels as quickly as possible, kinda like Marble Blast Ultra. We have a dev blog over at&amp;nbsp;&lt;a href="http://bitwisegames.wordpress.com/"&gt;http://bitwisegames.wordpress.com/&lt;/a&gt;. Check it out sometime!&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-zE0B7So3rcA/TYUameSPuMI/AAAAAAAAADg/tdMTKXqeoaE/s1600/TheSphere+2011-03-07+23-58-02-71.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="180" src="https://lh6.googleusercontent.com/-zE0B7So3rcA/TYUameSPuMI/AAAAAAAAADg/tdMTKXqeoaE/s320/TheSphere+2011-03-07+23-58-02-71.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-6768141663647301773?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/6768141663647301773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2011/03/new-dev-blog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/6768141663647301773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/6768141663647301773'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2011/03/new-dev-blog.html' title='A new dev blog'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh6.googleusercontent.com/-zE0B7So3rcA/TYUameSPuMI/AAAAAAAAADg/tdMTKXqeoaE/s72-c/TheSphere+2011-03-07+23-58-02-71.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-3262271044118345831</id><published>2011-03-16T11:23:00.000-07:00</published><updated>2011-03-16T11:23:51.221-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UnloadContent'/><category scheme='http://www.blogger.com/atom/ns#' term='Load Paradigm'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='PC'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='LoadContent'/><category scheme='http://www.blogger.com/atom/ns#' term='OutOfVideoMemory'/><title type='text'>Understanding the XNA LoadContent/UnloadContent Paradigm</title><content type='html'>An alternative title to this could be "Prefer&amp;nbsp;separating&amp;nbsp;the loading of graphical content (Textures, Vertex Buffers, Render Targets) from the loading of non graphical content." The reason for this is not immediately obvious to beginners (or even those intermediate with XNA) but&amp;nbsp;the&amp;nbsp;purpose&amp;nbsp;becomes clear when the possibility of a reset graphics device comes into the picture (when developing for the PC for example.) If you don't do proper cleanup when a reset is triggered, the data will remain inside the graphics device and will build up with each reset. If this happens enough times the graphics card will run out of memory and your application will throw an &lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;OutOfVideoMemory&lt;/span&gt;&amp;nbsp;exception.&lt;br /&gt;&lt;br /&gt;It doesn't take all that much to trigger a reset either. On PC games it is typical to provide the user with an option to set the resolution of the game. Guess what? If you change the resolution you effectively trigger a graphics device reset! This explains&amp;nbsp;why some games take a long time to apply the resolution change; they have to unload everything from the graphics device, and then load it all back in! This is also why some games force you to restart the game in order for the option to be applied, as it is easier to force the user to take some action than to retrofit their engine design to get all the loading and unloading internals correct.&lt;br /&gt;&lt;br /&gt;But what if you don't want the user to have to exit and then restart the game? Perhaps you are one of them fancy-pants people and you want the resolution change to be applied in-game. This is easily possible IF you design your game from the get-go to expect this sort of&amp;nbsp;behavior. Basically, follow the rule above. If you need to load some sort of graphical content, &lt;b&gt;don't do it in the constructor.&lt;/b&gt;&amp;nbsp;Instead, place it in the LoadContent() method if you are using the GameComponent structure. Make sure to also override the UnloadContent() method. This is where you will call Dispose() on all the content you loaded in LoadContent. Now here is what will happen. If a graphics device reset occurs, XNA will call all your UnloadContent methods (which frees all the data from the graphics device.) It will then call all the LoadContent methods to load all the graphics material back into the graphics device. Since everything has been unloaded, the stray data won't be hanging around on the device and you won't have to worry about that nasty OutOfVideoMemory exception! Effectively handling device resets also brings your game closer to the PC realm of things, as that is one of the mainstay worries you need to keep in mind when developing for the PC.&lt;br /&gt;&lt;br /&gt;Happy coding!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-3262271044118345831?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/3262271044118345831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2011/03/understanding-xna-loadcontentunloadcont.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3262271044118345831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3262271044118345831'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2011/03/understanding-xna-loadcontentunloadcont.html' title='Understanding the XNA LoadContent/UnloadContent Paradigm'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-3128054357805922418</id><published>2010-09-22T07:58:00.000-07:00</published><updated>2010-09-22T07:58:35.602-07:00</updated><title type='text'>Didgery is Live on XBOX LIVE!</title><content type='html'>&lt;div class="entry-content"&gt;     YES!&lt;br /&gt;After a year of work, I am proud to announce that Didgery has been released onto&amp;nbsp; XBOX LIVE Indie.&lt;br /&gt;&lt;a href="http://marketplace.xbox.com/en-US/games/media/66acd000-77fe-1000-9115-d80258550665/?did=00000001-0000-4000-8000-000058550665&amp;amp;bt=0&amp;amp;sb=1&amp;amp;mt=32&amp;amp;gu=66acd000-77fe-1000-9115-d80258550665&amp;amp;partner=RSS&amp;amp;p=1&amp;amp;of=6"&gt;Download Didgery onto your XBox now!&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.didgerycardgame.com/Pages/About.html"&gt;What is Didgery?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Watch our release trailer below:&lt;br /&gt;&lt;object height="385" width="640"&gt;&lt;param name="movie" value="http://www.youtube.com/v/EgOtgLEgD-c&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xd0d0d0&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/EgOtgLEgD-c&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xd0d0d0&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="entry-content"&gt;        &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-3128054357805922418?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/3128054357805922418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/09/didgery-is-live-on-xbox-live.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3128054357805922418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3128054357805922418'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/09/didgery-is-live-on-xbox-live.html' title='Didgery is Live on XBOX LIVE!'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-5452912739433703234</id><published>2010-07-21T11:30:00.000-07:00</published><updated>2010-07-21T11:30:23.730-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dev Blog'/><category scheme='http://www.blogger.com/atom/ns#' term='Didgery'/><category scheme='http://www.blogger.com/atom/ns#' term='Indie Games'/><title type='text'>Didgery has a dev-blog folks</title><content type='html'>That's right, you can now stalk my progress over at &lt;a href="http://www.didgerycardgame.com/DevBlog"&gt;www.didgerycardgame.com/DevBlog&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-5452912739433703234?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/5452912739433703234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/07/didgery-has-dev-blog-folks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5452912739433703234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5452912739433703234'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/07/didgery-has-dev-blog-folks.html' title='Didgery has a dev-blog folks'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-3167035956393022119</id><published>2010-07-14T19:04:00.000-07:00</published><updated>2010-07-14T19:04:25.154-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Resolved'/><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><category scheme='http://www.blogger.com/atom/ns#' term='Xbox 360'/><category scheme='http://www.blogger.com/atom/ns#' term='Didgery'/><title type='text'>Sniping's a good job mate</title><content type='html'>YES! I just uncovered a severe bug that has been haunting me ever since I took a vacation about a month ago! It appears the code that detects row/col chains was broken when applied under a certain scenario. Now all I have to do is fix the thing! Thank the Lord for random-chanced bug discovering.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-3167035956393022119?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/3167035956393022119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/07/snipings-good-job-mate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3167035956393022119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3167035956393022119'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/07/snipings-good-job-mate.html' title='Sniping&apos;s a good job mate'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-2849899763824217821</id><published>2010-07-13T17:40:00.000-07:00</published><updated>2010-07-13T17:41:38.031-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><category scheme='http://www.blogger.com/atom/ns#' term='Bejeweled Twist'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='website'/><category scheme='http://www.blogger.com/atom/ns#' term='PopCap'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Xbox 360'/><category scheme='http://www.blogger.com/atom/ns#' term='Didgery'/><title type='text'>Didgery</title><content type='html'>&lt;div class="MsoNormal"&gt;Ahhh yes…&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Didgery is a game I have been working on for quite some time now. It’s the game I started right after I put Nut Harvest 360 on hold. I’ve put a lot of effort and design into the thing, and, personally, I think it shows. It’s a card/puzzler game slated to be released sometime in August for the Xbox 360. It was coded using C# and Microsoft’s excellent XNA framework.&amp;nbsp;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;I think this is going to be the last puzzle game I make in a while… I used to think that puzzle games would be the easiest things to make... You know, how hard could they be? You don’t necessarily need parallaxing layers, or physics, or tile maps, or editors or any of that fun. I now humbly completely disagree with my former self. Puzzlers have their own nightmarish little nuances. They are tied so heavily to logic and rules that programming it can become a nightmare if you aren’t careful. And bugs…ohhh, the bugs… That’s the worst part. I’ve had bugs in platforming games I’ve made and such, but they are relatively easy to spot, and generally not too hard to fix. The same thing can’t necessarily be said about puzzle games. The logic is tied so closely together that pulling one string to fix a bug may inadvertently cause the whole system to trip over itself in ways you couldn’t possibly comprehend.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;I know why Bejeweled Twist took four years to make now…and that was made by PopCap, the king of all things puzzle.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Oh well, it’s almost over now. I’m on the downward slope of adding in bits and pieces and hunting down bugs.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;a href="http://www.didgerycardgame.com/"&gt;Here &lt;/a&gt;is Didgery’s website. Have fun!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-2849899763824217821?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/2849899763824217821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/07/didgery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2849899763824217821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2849899763824217821'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/07/didgery.html' title='Didgery'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-2509039288115835732</id><published>2010-06-20T12:35:00.000-07:00</published><updated>2010-06-20T12:35:41.286-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Game Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='Custom'/><category scheme='http://www.blogger.com/atom/ns#' term='Components'/><category scheme='http://www.blogger.com/atom/ns#' term='World'/><category scheme='http://www.blogger.com/atom/ns#' term='Ragnarok'/><title type='text'>Ragnarok Tutorial 3 - Creating Custom Components</title><content type='html'>Ragnarok is an engine that attempts to be as flexible as possible. It tries to allow creation of any type of 2D game, weather it be top-down, tile-based, or any other type of 2D format.&lt;br /&gt;&lt;br /&gt;In this tutorial we will examine how to create custom components and add them to the world. Custom components can be used to interface more directly with the engine and are used as the basic building blocks in the creation of our game.&lt;br /&gt;&lt;br /&gt;This tutorial is more in-depth and involved than previous tutorials, thus I will not be duplicating the source here. To read the tutorial, please download the &lt;a href="http://www.mediafire.com/?jqrjndlzdtm"&gt;.zip&lt;/a&gt; or &lt;a href="http://www.mediafire.com/?zwnzzndz2mx"&gt;.tar&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Feel free to post any questions in the comments section.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-2509039288115835732?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/2509039288115835732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/ragnarok-tutorial-3-creating-custom.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2509039288115835732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2509039288115835732'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/ragnarok-tutorial-3-creating-custom.html' title='Ragnarok Tutorial 3 - Creating Custom Components'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-6676050854475164894</id><published>2010-06-09T23:56:00.000-07:00</published><updated>2010-06-10T00:39:46.313-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Video Game'/><category scheme='http://www.blogger.com/atom/ns#' term='Game Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='Platforming Block'/><category scheme='http://www.blogger.com/atom/ns#' term='Platformer'/><category scheme='http://www.blogger.com/atom/ns#' term='Ragnarok'/><title type='text'>What!? A new video game?!?</title><content type='html'>Ok, I've been hiding secrets :)&lt;br /&gt;&lt;br /&gt;A friend and I have been working away on an intense (-ly difficult?) 2D platformer that centers around the Ragnarok Engine. It all started when my buddy played an assignment I made for class. He enjoyed the simple level so much that he was willing to learn the tilemap structure that generated the levels. He started messing around with the text files, and before we knew it we were pumping out new levels. He also did some sweet redesigns to the sprites!&lt;br /&gt;&lt;br /&gt;Anyway, I am proud to announce the Demo Version of Platforming Block, powered by the Ragnarok Engine. Why just a demo? Well, let's just say that Platforming Block may have a place with XNA and the Xbox 360 in the near future *wink.&lt;br /&gt;&lt;br /&gt;Go ahead, download the game &lt;a href="http://www.mediafire.com/?uhcniey5qzn"&gt;HERE&lt;/a&gt;. It also acts as a mighty nice tutorial into the realms of Ragnarok.&lt;br /&gt;&lt;br /&gt;Oh yeah, we also have a FaceBook &lt;a href="http://www.facebook.com/pages/Platforming-Block/123334587706222"&gt;page&lt;/a&gt; specifically made to keep you updated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-6676050854475164894?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/6676050854475164894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/what-new-video-game.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/6676050854475164894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/6676050854475164894'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/what-new-video-game.html' title='What!? A new video game?!?'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-7166261436612074314</id><published>2010-06-09T23:25:00.000-07:00</published><updated>2010-06-20T12:28:01.147-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Game Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='Pygame'/><category scheme='http://www.blogger.com/atom/ns#' term='Sprite'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='World'/><category scheme='http://www.blogger.com/atom/ns#' term='Objects'/><category scheme='http://www.blogger.com/atom/ns#' term='Ragnarok'/><title type='text'>Ragnarok Engine: Tutorial 2 - Adding objects to the Engine</title><content type='html'>It is extremely simple to add objects to the world in Ragnarok. All you have to do is create the object and call add_obj from the Ragnarok engine instance. Below follows a more in-depth example:&lt;br /&gt;&lt;br /&gt;A Sprite is essentially a container object for an image that allows us to manipulate properties of it extremely easily. Let's start by creating the object.&lt;br /&gt;&lt;span style="background-color: #ffd966; color: black;"&gt;sprite = R.Sprite()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since we are adding only one object to the world, the update and draw orders don't carry much significance as of yet. But if we were to add more than one object, these values would be responsible for controlling the order in which the object updates and draws in relation to other objects.&lt;br /&gt;&lt;span style="background-color: #ffd966;"&gt;sprite.update_order = 0&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #ffd966;"&gt;sprite.draw_order = 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now we assign an image to the sprite by going to the Ragnarok Engine folder and pulling out its logo image.&lt;br /&gt;&lt;span style="background-color: #ffd966;"&gt;sprite.load_texture("Ragnarok//Ragnarok.jpg")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, remember in the previous tutorial how we said that the World is the entity responsible for&lt;br /&gt;managing our objects for us? Well, the last step to get this object onscreen is to&lt;br /&gt;add it to the world so it can be drawn and updated.&lt;br /&gt;&lt;span style="background-color: #ffd966;"&gt;world.add_obj(sprite)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Boom! That's all it takes to get an sprite on the screen. You can play around with the sprite's coords, scale, and rotation properties to change the orientation of the sprite accordingly.&lt;br /&gt;&lt;span style="background-color: #ffd966;"&gt;engine.run()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Download the source for this tutorial &lt;a href="http://www.mediafire.com/?dm1mx2hefem"&gt;here&lt;/a&gt;.&lt;br /&gt;Linux user? Download the gzipped tar &lt;a href="http://www.mediafire.com/?anyendgzymj"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-7166261436612074314?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/7166261436612074314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/ragnarok-engine-tutorial-2-adding.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7166261436612074314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7166261436612074314'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/ragnarok-engine-tutorial-2-adding.html' title='Ragnarok Engine: Tutorial 2 - Adding objects to the Engine'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-7704050311513672057</id><published>2010-06-09T14:15:00.000-07:00</published><updated>2010-06-20T12:26:40.526-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Initing'/><category scheme='http://www.blogger.com/atom/ns#' term='Game Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='Pygame'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='Ragnarok'/><title type='text'>Ragnarok Engine: Tutorial 1 - Initing the Engine</title><content type='html'>What is an engine without a few tutorials to get user's jumpstarted?&lt;br /&gt;&lt;br /&gt;This tutorial will cover the basics necessary to get the Ragnarok Engine up and running.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first step is to import our Ragnarok engine for use.&lt;br /&gt;The 'as R' clause here acts as a alias for Ragnarok, meaning we can access its&lt;br /&gt;members by typing R instead of Ragnarok.&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #ffd966;"&gt;import Ragnarok as R&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This single line of code is all it takes to actually initalize the engine.&lt;br /&gt;We are telling Ragnarok that we want to create a window of size 640 by 480,&lt;br /&gt;and that it should bear the title "RAGNAROK TUTORIAL 1".&lt;br /&gt;Notice how we are making use of the Vector2 class to pass in the window size.&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #ffd966;"&gt;engine = R.Ragnarok(R.Vector2(640, 480), "RAGNAROK TUTORIAL 1")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One of Ragnarok's goals is to reduce micro management in your code. It does this by automatically&lt;br /&gt;updating and drawing your objects for you. You can control the draw and update order by changing an&lt;br /&gt;object's update_order and draw_order properties. A low number will draw/update first, while a higher number will&amp;nbsp;draw/update overtop the lower numbers. The world is the entity within the engine that does all this work for us.&amp;nbsp;We grab an instance of it here for easier access.&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #ffd966;"&gt;world = engine.get_world()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The world's clear_color property defines what color the backbuffer should be&lt;br /&gt;erased to after each draw operation.&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #ffd966;"&gt;world.clear_color = (0, 0, 0)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That's it! All we have to do now is tell Ragnarok to begin spinning its game loop.&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #ffd966;"&gt;engine.run()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;At this point you should be presented with a blank screen. Don't worry though, Ragnarok can do much more than this!&lt;br /&gt;&lt;br /&gt;Check back in for Tutorial 2 to see how to add sprites and other entities to the world.&lt;br /&gt;&lt;br /&gt;You can download the source for this tutorial &lt;a href="http://www.mediafire.com/?ycdlfmxwln1"&gt;here&lt;/a&gt;.&lt;br /&gt;Linux user? Download the gzipped tar &lt;a href="http://www.mediafire.com/?notoynzzgwd"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-7704050311513672057?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/7704050311513672057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/ragnarok-engine-tutorial-1-initing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7704050311513672057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7704050311513672057'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/ragnarok-engine-tutorial-1-initing.html' title='Ragnarok Engine: Tutorial 1 - Initing the Engine'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-3591966660108644481</id><published>2010-06-09T11:50:00.000-07:00</published><updated>2010-06-11T10:39:56.634-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Game Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='Pygame'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='Ragnarok'/><title type='text'>Ragnarok Engine</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;Today I would like to announce the first release of the Ragnarok Engine for Python/Pygame.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;Ragnarok is a 2D engine built on top of Pygame to make game creation easier. While Pygame is a library, Ragnarok attempts to assume the role of an engine, featuring many&amp;nbsp;capabilities&amp;nbsp;that would take a lot of work to create from the ground up in Pygame.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;The engine is built in such a way that it attempts to be used under any&amp;nbsp;scenario&amp;nbsp;and game environment (i.e. it is generic). It is easy to set up, maintain, and extend for your particular needs.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;A few of the features Ragnarok has to offer:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+2D and 3D Math Library&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+Sprites for easy rotation, scaling, texture loading, etc.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+SpriteSheet and Animation classes&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+Text objects that can be rotated, scaled, and translated&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+A customizable 2D Camera&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+A managed World system that updates, draws, and automatically offsets objects by the camera's&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;translation.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+Collision System&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+Input Handling Systems&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+Particle Systems&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+Pool class for efficiently reusing objects&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;+TileMaps&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;Ragnarok is still a work in progress, thus there &lt;i&gt;will &lt;/i&gt;be bugs present. Feel free to respond to this post with any bugs you find.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;Ragnarok is licensed under the GNU LESSER GENERAL PUBLIC LICENSE v3.0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;Download the engine &lt;a href="http://www.mediafire.com/?mygavjy3jgm"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;Running on Linux? Download the tar &lt;a href="http://www.mediafire.com/?zmwttnykoym"&gt;here&lt;/a&gt;. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-3591966660108644481?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/3591966660108644481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/ragnarok-engine.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3591966660108644481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3591966660108644481'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/ragnarok-engine.html' title='Ragnarok Engine'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-7184190143158563338</id><published>2010-06-05T12:47:00.000-07:00</published><updated>2010-06-08T23:15:30.215-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Billboard'/><category scheme='http://www.blogger.com/atom/ns#' term='Effect'/><category scheme='http://www.blogger.com/atom/ns#' term='#include'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='HLSL'/><category scheme='http://www.blogger.com/atom/ns#' term='preprocessor'/><category scheme='http://www.blogger.com/atom/ns#' term='Metod Sharing'/><title type='text'>Sharing methods across HLSL files</title><content type='html'>I have been working on a lot of HLSL shaders recently, and the more I work on them the more I come to the realization of how often I am copying and pasting methods from one shader to another.&amp;nbsp; This is really an inefficient way to be doing things, so I decided today to begin using the #include directive.&lt;br /&gt;&lt;br /&gt;Here is how I do.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create a plain text file to hold all our shared methods. (Don't use a .fx file because it will expect you to declare a technique for it, which will cause issues if you have a technique with the same name in the shader you are including the file into.)&lt;/li&gt;&lt;li&gt;At the top of the shader that needs to use the method, use the&amp;nbsp;&lt;span style="color: #ea9999;"&gt;#include “filename.txt”&lt;/span&gt; preprocessor directive to load in our methods.&lt;/li&gt;&lt;li&gt;Call the method just like you normally would.&lt;/li&gt;&lt;li&gt;Yay, you are done!&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Here is an example of the extensions file:&lt;br /&gt;&lt;div style="background-color: #f3f3f3; color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;/&lt;/span&gt;&lt;span style="color: #666666;"&gt;*&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;Filename: Extensions.txt&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;*/&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;//Billboard vertices so that they always face the camera.&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;float3 Billboard(float3 pos, float3 billboardCenter, float3 CameraPos, float3 CamUp)&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;{&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Find the vector from the camera to the center of the billboard.&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;float3 eyeVector = billboardCenter - CameraPos;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Calculate the side vector of the billboard.&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;float3 sideVector = cross(eyeVector, CamUp);&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sideVector = normalize(sideVector);&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Calculate the up vector of the billboard.&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;float3 upVector = cross(sideVector, eyeVector);&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;upVector = normalize(upVector);&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Apply the side and up vectors to the location of the vertex&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//to make it always face the camera.&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;float3 finalPos = billboardCenter;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;finalPos += (billboardCenter.x - pos.x) * sideVector;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;finalPos += (pos.y - billboardCenter.y) * upVector;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return finalPos;&lt;/div&gt;&lt;div style="background-color: #f3f3f3; color: #666666;"&gt;}&lt;/div&gt;&lt;br /&gt;Here is the example of our calling code:&lt;br /&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;/*&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;Lotus Games&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;6/5/2010&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;br style="color: #444444;" /&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;Causes quads to always face the camera.&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;*&lt;/span&gt;/ &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #ea9999;"&gt;#include "&lt;/span&gt;&lt;span style="color: #ea9999;"&gt;Extensions.txt&lt;/span&gt;&lt;span style="color: #ea9999;"&gt;"&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;sampler Tex;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;float4x4 WorldViewProj : WorldViewProjectionMatrix;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;float3 CameraPos;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;float3 CamUp;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;br style="color: #444444;" /&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;struct VertexData&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;float3 coords : POSITION0; &lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;float3 centerCoords: POSITION1;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;float4 uvCoords : TEXCOORD0;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;};&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;br style="color: #444444;" /&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;struct PixelData&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;float4 coords: POSITION0;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;float4 uvCoords : TEXCOORD0;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;};&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;br style="color: #444444;" /&gt;&lt;/div&gt;&lt;div style="background-color: #eeeeee;"&gt;&lt;span style="color: #444444;"&gt;PixelData VS(VertexData vIn)&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #eeeeee;"&gt;&lt;span style="color: #444444;"&gt;{&lt;/span&gt;&lt;span style="background-color: #eeeeee;"&gt;&lt;span style="color: #444444;"&gt;&lt;span style="color: #ea9999;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #eeeeee;"&gt;&lt;span style="color: #444444;"&gt;&lt;span style="color: #ea9999;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vIn.coords = Billboard(vIn.coords, vIn.centerCoords, CameraPos, CamUp);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #eeeeee;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #eeeeee;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;PixelData psOut = (PixelData)0;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;psOut.coords = float4(vIn.coords, 1);&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;psOut.uvCoords = vIn.uvCoords;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return psOut;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;br style="color: #444444;" /&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;float4 PS(PixelData pIn) : COLOR0&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return tex2D(Tex, pIn.uvCoords);&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;br style="color: #444444;" /&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;technique Billboard&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;pass p0&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;VertexShader = compile vs_3_0 VS();&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;PixelShader = compile ps_3_0 PS();&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: #f3f3f3;"&gt;&lt;span style="color: #444444;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Everything works wonderfully, and allows you to write duplicate code no more :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-7184190143158563338?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/7184190143158563338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/sharing-methods-across-hlsl-files.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7184190143158563338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7184190143158563338'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/06/sharing-methods-across-hlsl-files.html' title='Sharing methods across HLSL files'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-7234287573484887939</id><published>2010-03-27T10:17:00.000-07:00</published><updated>2010-03-27T10:20:55.724-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XNA 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='premultiplied alpha'/><category scheme='http://www.blogger.com/atom/ns#' term='RenderTarget'/><category scheme='http://www.blogger.com/atom/ns#' term='color'/><category scheme='http://www.blogger.com/atom/ns#' term='Effect.Apply'/><category scheme='http://www.blogger.com/atom/ns#' term='converting'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA 3.1'/><category scheme='http://www.blogger.com/atom/ns#' term='Portability'/><title type='text'>XNA4.0, The changes that will get ya...</title><content type='html'>I’ve been messing around with XNA4.0 a little bit as of late, and man, there are a lot of changes! Just to insinuate how many changes there actually are, I tried porting a game over to 4.0 the other day and had well over 1000 errors! Below is a list of some of the changes I have readily noticed, and some code you can use in its place when porting a 3.1 game to 4:&lt;br /&gt;&lt;br /&gt;XACT will not work with the Win7 phones. You’ll have to use the SoundEffect instance class instead.&lt;br /&gt;&lt;br /&gt;No more Color.TransparentWhite or Color.TransparentBlack. Only Color.Transparent, which is the same as transparent black. &lt;br /&gt;&lt;br /&gt;You can no longer create a Color by specifying a color and alpha value: i.e. new Color(Color.Red, 155) will fail. You must use, new Color(255, 0, 0, 155) instead, or Color.Red * 155. The syntax for Color most likely changed because of the move to premultiplied alpha as the standard alpha blending equation. This essentially means that if you want to set the alpha component of a color, you must multiply the desired alpha by the components rather than setting its color.A component, else your colors will end up looking much washed out.&lt;br /&gt;&lt;br /&gt;Parameter reordering in SpriteBatch.Begin().&lt;br /&gt;&lt;br /&gt;SpriteBlendMode enumeration replaced with BlendState.&lt;br /&gt;&lt;br /&gt;Changes in the VertexElement parameter list. It appears to be much simpler now. Stream specification was removed, as was the VertexElementMethod enumeration.&lt;br /&gt;&lt;br /&gt;Removed the texture index value from GraphicsDevice.SetRenderTarget. So instead of GraphicsDevice.SetRenderTarget(0, target), it is now GraphicsDevice.SetRenderTarget(target)&lt;br /&gt;&lt;br /&gt;DynamicVertexBuffer’s parameters changed. It now accepts a VertexDeclaration and number of vertices to create (instead of bytes).&lt;br /&gt;&lt;br /&gt;Reordering of IndexBuffer parameters. IndexElementSize was moved from the end of the parameter list to right after the graphics device.&lt;br /&gt;&lt;br /&gt;Begin() and End() on Effect passes have been replaced with Apply()&lt;br /&gt;Game.GraphicsDevice.Vertices[0].SetSource(vertexBuffer, offset, vertexSize); has been replaced with Game.GraphicsDevice.SetVertexBuffer(vertexBuffer);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Simplified basic constructor in RenderTarget2D. A target can now be created with (GraphicsDevice, Width, Height) instead of (GraphicsDevice, Width, Height, MipLevels, SurfaceFormat), though the latter option is still there for use.&lt;br /&gt;&lt;br /&gt;The parameters of the VertexDeclaration class simplified from (GraphicsDevice, VertexElements) to  (VertexElements)&lt;br /&gt;&lt;br /&gt;GraphicsDevice.RenderState is removed. The states are now occupied in various locations under GraphicsDevice. Stencil settings, for example, can be found under GraphicsDevice.DepthStencilState.&lt;br /&gt;&lt;br /&gt;RenderTargets now act just like a Texture. You can call spriteBatch.Draw(renderTarget…) rather than spriteBatch.Draw(renderTarget.GetTexture()…)&lt;br /&gt;&lt;br /&gt;Those are most of the changes that really got me in terms of error count, but I think the changes are all well considered. The API, you will notice, has been compressed and feels more intuitive and streamlined. It would be however, much easier to develop a game from the ground-up on 4.0 than try to transfer it over from 3.1. So if you are currently working on a 3.1 game, I suggest you attempt to get it completed before XNA4 becomes the standard, else you may have to traverse rough waters to port it over.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-7234287573484887939?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/7234287573484887939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/03/xna40-changes-that-will-get-ya.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7234287573484887939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7234287573484887939'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/03/xna40-changes-that-will-get-ya.html' title='XNA4.0, The changes that will get ya...'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-3202964906418251605</id><published>2010-03-08T22:28:00.000-08:00</published><updated>2010-03-08T22:30:08.703-08:00</updated><title type='text'>I'm a twitface!</title><content type='html'>The title says it all folks. Follow me at:&lt;br /&gt;&lt;a href="http://twitter.com/LotusGames"&gt;http://twitter.com/LotusGames&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-3202964906418251605?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/3202964906418251605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/03/im-twitface.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3202964906418251605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3202964906418251605'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/03/im-twitface.html' title='I&apos;m a twitface!'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-5317969455099011701</id><published>2010-02-11T14:15:00.000-08:00</published><updated>2010-02-11T14:25:03.220-08:00</updated><title type='text'>Nut Harvest 360</title><content type='html'>I thought I might as well show some of the stuff I've been working on. Below is a very short video of my work-in progress game, Nut Harvest 360. Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/0bDZ4fTi2E8&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/0bDZ4fTi2E8&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-5317969455099011701?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/5317969455099011701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/02/nut-harvest-360.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5317969455099011701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5317969455099011701'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/02/nut-harvest-360.html' title='Nut Harvest 360'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-331928670865476165</id><published>2010-02-06T11:23:00.000-08:00</published><updated>2010-02-06T11:35:50.167-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Compiler'/><category scheme='http://www.blogger.com/atom/ns#' term='Errors'/><category scheme='http://www.blogger.com/atom/ns#' term='stencil buffer'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='Clear'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Xbox 360'/><category scheme='http://www.blogger.com/atom/ns#' term='An unexpected error has occured'/><category scheme='http://www.blogger.com/atom/ns#' term='fix'/><title type='text'>Cryptic Error Messages on Stencil Buffer Clear</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CUsers%5CClinton%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CUsers%5CClinton%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CUsers%5CClinton%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 415 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-520092929 1073786111 9 0 415 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-size:12pt;" &gt;It has been a looong time since I lasted posted… Working on my game, school, and a newly acquired job have been eating away at my time. Anyway, I thought I would post something short and simple, but hopefully helpful.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-size:12pt;" &gt;The C# compiler is usually good about giving you detailed information on compiler/runtime errors, but there are those occasional times in which it gives you some really cryptic response that doesn’t help you in the least. I ran into one of those today when attempting to clear my stencil buffer. It crashed on this line:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10pt;"  &gt;Game.GraphicsDevice.Clear(&lt;span style="color: rgb(43, 145, 175);"&gt;ClearOptions&lt;/span&gt;.Stencil, &lt;span style="color: rgb(43, 145, 175);"&gt;Color&lt;/span&gt;.Black, 0, 0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-size:12pt;" &gt;With the ever-so helpful error message: “An unexpected error has occurred.”&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-size:12pt;" &gt;Well great, that tells me everything I need to know to fix the problem! (Extreme sarcasm intended)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-size:12pt;" &gt;After messing around for a bit I found that my problem lay in the fact that I hadn’t created my stencil buffer at startup! So if you are running into this problem, add this code to your Game1 constructor:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10pt;"  &gt;graphics.PreferredDepthStencilFormat = &lt;span style="color: rgb(43, 145, 175);"&gt;DepthFormat&lt;/span&gt;.Depth24Stencil8Single;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-size:12pt;" &gt;That will make sure you have a stencil buffer ready to use, and thus the cryptic error message should go away.&lt;/span&gt;&lt;span style="line-height: 115%;font-size:12pt;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-331928670865476165?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/331928670865476165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2010/02/normal-0-false-false-false-en-us-x-none.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/331928670865476165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/331928670865476165'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2010/02/normal-0-false-false-false-en-us-x-none.html' title='Cryptic Error Messages on Stencil Buffer Clear'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-5804486167026841880</id><published>2009-10-19T01:59:00.000-07:00</published><updated>2009-10-19T02:16:18.768-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MaxVertexIndex'/><category scheme='http://www.blogger.com/atom/ns#' term='doesSupport32Bit'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='PC'/><category scheme='http://www.blogger.com/atom/ns#' term='IndexElementSize'/><category scheme='http://www.blogger.com/atom/ns#' term='Xbox 360'/><category scheme='http://www.blogger.com/atom/ns#' term='Graphics Card'/><category scheme='http://www.blogger.com/atom/ns#' term='indices'/><title type='text'>Detecting if a Graphics Card supports IndexElementSize.ThirtyTwoBits</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof: yes"&gt;I ran into a little problem with my Particle system when trying to make it function elequently on different PC’s, I didn’t know how to get some necessary Graphics Device information! What I needed was critical to making sure the engine didn’t crash on lower-spec PCs (pretty much anything with an Intel integrated graphics chip.) The IndexElementSize determines the maximum number of indices you can send to the graphics card in one batch. If the graphics card supports 32 bits (ints) (like the Xbox 360 or most modern graphics chips), than you can use 2^32 indices (a very huge number), which means you can draw your gigantic landscape or thousands of particles with no worry. If the system only supports 16bits (shorts), however, you only get about 32,000 indices, a sad fact that will throw a critical error if you don’t handle it right.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof: yes"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof: yes"&gt;The soultion?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-font-family: &amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;bool&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt; doesSupport32Bit = &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-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-font-family: &amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;if&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt; (Game.GraphicsDevice.GraphicsDeviceCapabilities.MaxVertexIndex &gt; &lt;span style="color:blue"&gt;ushort&lt;/span&gt;.MaxValue)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof: yes"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;doesSupport32Bit = &lt;span style="color:blue"&gt;true&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof: yes"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof: yes"&gt;If the return value of MaxVertexIndex is greater than the maximum value describable by a unsigned short (an unsigned number is a value that can have no negative representation), than it must support 32 bit indices. If it doesn’t, than you should accomidate the user by using an index buffer that takes the IndexElementSize.SixteenBits flag instead of the ThirtyTwoBits flag. This will ensure (or at least help) your game run on a larger variety of hardware, thus increasing your potential audience. &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-5804486167026841880?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/5804486167026841880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/10/detecting-if-graphics-card-supports.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5804486167026841880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5804486167026841880'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/10/detecting-if-graphics-card-supports.html' title='Detecting if a Graphics Card supports IndexElementSize.ThirtyTwoBits'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-6742530772498950411</id><published>2009-10-08T23:00:00.000-07:00</published><updated>2009-10-10T10:51:08.005-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IsPlaying'/><category scheme='http://www.blogger.com/atom/ns#' term='Ford'/><category scheme='http://www.blogger.com/atom/ns#' term='XACT'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Glitch'/><category scheme='http://www.blogger.com/atom/ns#' term='XACT not setting IsPlaying Property'/><category scheme='http://www.blogger.com/atom/ns#' term='Bug'/><category scheme='http://www.blogger.com/atom/ns#' term='freeze'/><category scheme='http://www.blogger.com/atom/ns#' term='Xbox 360'/><category scheme='http://www.blogger.com/atom/ns#' term='360'/><category scheme='http://www.blogger.com/atom/ns#' term='undocumented'/><title type='text'>Yet Another XACT Bug</title><content type='html'>I strongly dislike it when I encounter a bug, assume its mine own, and then go on a wild goose chase after it, only to eventually realize the bug is in the software I'm using sometime later.&lt;br /&gt;&lt;br /&gt;Here's the bug:&lt;br /&gt;When playing extremely short duration sounds through XACT on the Xbox 360, XACT will fail to set the IsPlaying property to false when the sound has completed, meaning the system continues to execute the sound even after it has completed. If many small sounds are played in succession (such as my newest still-in-progress-game does) the game will begin to hitch, exhibit audio glitches, and eventually freeze. This problem affects only the 360; the PC can handle small sounds without a problem. The duration in question are sounds that are .007 seconds or less long. I can confirm that sounds with a duration of at least .01 are handled properly by XACT.&lt;br /&gt;&lt;br /&gt;On a side note, I got my 360 back today! MS gave me a replacement console, a letter of apology, and a free month of live! Plus the repair was free, despite their web site saying my warranty had expired! I am extremely satisfied with their support. In fact, I probably haven't ever been this satisfied with any kind of service center support in my life. Most of the time it is a pain. This was actually very smooth and well executed, exactly the way things should be. I wish Ford would be like this and replace my faulty transmission in my '03 Taurus (they have a track record for breaking, much like the 360 has a record for the Red Rings.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-6742530772498950411?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/6742530772498950411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/10/yet-another-xact-bug.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/6742530772498950411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/6742530772498950411'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/10/yet-another-xact-bug.html' title='Yet Another XACT Bug'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-8173899151457453804</id><published>2009-09-17T20:26:00.000-07:00</published><updated>2009-09-17T20:30:54.683-07:00</updated><title type='text'>Red Rings of Death</title><content type='html'>I just fired up my 360 to test my game, got some artifacts while playing, freaked out, and turned the 360 off. Turned it back on moments later to see the dreaded red rings blinking dumbly in my face. This is a huge stumbling block...I was counting on this game to bring me in some much needed revenue...and now it looks like that is impossible.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Oh boy, another mountain to climb. Let's hope I can rake up enough cash to get the 360 repaired.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-8173899151457453804?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/8173899151457453804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/09/red-rings-of-death.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/8173899151457453804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/8173899151457453804'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/09/red-rings-of-death.html' title='Red Rings of Death'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-3582902241351472384</id><published>2009-09-17T19:34:00.000-07:00</published><updated>2009-09-17T20:05:57.913-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Stuido'/><category scheme='http://www.blogger.com/atom/ns#' term='ADPCM'/><category scheme='http://www.blogger.com/atom/ns#' term='XACT'/><category scheme='http://www.blogger.com/atom/ns#' term='build'/><category scheme='http://www.blogger.com/atom/ns#' term='sound'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='freeze'/><category scheme='http://www.blogger.com/atom/ns#' term='xWMA'/><category scheme='http://www.blogger.com/atom/ns#' term='music'/><category scheme='http://www.blogger.com/atom/ns#' term='XMA'/><title type='text'>Bizarre XACT Freezing Problem – And how to work around it.</title><content type='html'>&lt;p class="MsoNormal"&gt;I’ve been having a problem recently when trying to build my newest game for the 360 (details on the game in a week or so.) The build would get to the XACT 3.0 portion, at which point the build would promptly freeze – for those who don’t know, XACT is the utility used to author sounds for a game. Visual Studio became unresponsive, and the only way to exit the hopeless build was to either kill the XactBld3.exe process, which would cause the build to finish with the side effect of having no sounds, or to kill Visual Studio, which, obviously, kills everything. I found it strange that the problem was only occurring when the 360 build was enabled, so I opened up the XACT Authoring tool and attempted to find out what was wrong. I did. Answer: xWMA. When this format is enabled for BOTH the PC and Xbox, the build will NOT finish, at least in a reasonable time. I left it running for about 30mins with no luck. I don’t know about any other developers out there, but a 30min waiting time is not reasonable (note that I only had about five short sounds and one 30 second music clip building, so it wasn’t a huge amass of sounds that was halting the build.) I found, however, that if I changed xWMA on either the PC or Xbox to some other format (XMA or ADPCM respectively) that the build would work fine. Note that I only had to change the format for one of the systems, not both, to get everything working.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This definitely seems like a bug to me...&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In short, if your XNA Game build is freezing, and you are using XACT, change the format settings from xWMA to XMA and everything should work fine.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-3582902241351472384?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/3582902241351472384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/09/bizarre-xact-freezing-problem-and-how.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3582902241351472384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3582902241351472384'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/09/bizarre-xact-freezing-problem-and-how.html' title='Bizarre XACT Freezing Problem – And how to work around it.'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-2662655949173227436</id><published>2009-09-07T13:50:00.000-07:00</published><updated>2009-09-07T14:08:47.544-07:00</updated><title type='text'>Game Development &amp; Writing: The Similarities</title><content type='html'>&lt;div style="text-align: left;"&gt;I realized today that Video game development holds some similarities with the writing process. When you start to make a game you are presented with this screen:&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;img src="http://3.bp.blogspot.com/_qCFbwyV6yHY/SqVztAkPicI/AAAAAAAAAB0/m7B8u-GIS4c/s400/BlankGame.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 314px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5378832547047246274" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When you start to write a story you are presented with something like this:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_qCFbwyV6yHY/SqVzto3fq0I/AAAAAAAAAB8/azGJc_K9BqU/s400/BlankWrite.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378832557865413442" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 350px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The common similarity between both of these is that they are, well, blank. There is something frightening and somewhat overbearing about this utterly clean slate. The knowledge that it is &lt;i style="mso-bidi-font-style: normal"&gt;your&lt;/i&gt; duty to turn this utter nothingness into something engaging and worthwhile can easily be overwhelming. Even when we have finally made something it is easy to digress about how absolutely terrible it still is. Whenever you do that, keep this in mind: The first draft of anything sucks, period. The game (or story) is not necessarily going to read or play well your first time though it. So take a break, get yourself a soda, and take a moment to calm yourself down. Once you have the basics in place (i.e. the ‘rough draft’ version of the game) you can comfort yourself with the knowledge that it is going to be an easier process to make it actually look good (but it’s still going to take effort!) Spend some time replacing all those placeholder graphics with something that looks decent (this would be like cleaning up the sentences and making them sound more elegant in terms of writing.) Add in some good sound effects and music (similar to perfecting the atmosphere of a story by word choice and sentence structure) (&lt;a href="http://www.soundsnap.com/"&gt;SoundSnap &lt;/a&gt;and &lt;a href="http://incompetech.com/m/c/royalty-free/"&gt;Kevin MacLeod&lt;/a&gt; are excellent resources for sounds and music respectively.) Remember that this is your first ‘pass’ through the game, so it still isn’t going to be perfect by any means, but it should look much better than the first draft. I find that the sooner the game actually &lt;i style="mso-bidi-font-style:normal"&gt;looks &lt;/i&gt;good, the sooner I gain confidence in myself, so I tend to try and up the graphics as soon as I have some basic gameplay in place.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I suppose I could go ahead and give an example by using my Nut Harvest 360 game.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Here is what the game looked like while I was putting together the basic gameplay:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://4.bp.blogspot.com/_qCFbwyV6yHY/SqVzt1GpfXI/AAAAAAAAACE/GwfP6EYfePk/s400/Nut+Harvest+360+Crap.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5378832561150197106" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 225px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Inspiring, huh?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;After spending some time on the graphics department it now looks like this:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_qCFbwyV6yHY/SqVzueKC1gI/AAAAAAAAACM/IjNfsgjtNik/s400/Nut+Harvest+360+Better.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378832572170294786" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 225px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Which one makes you feel more confident?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Now there’s still much more revising I need to do, but it’s easier now that I know I have at least something decent already in place. Note that it didn’t look like this in one ‘pass’ by any means. There were a lot of revisions and trial and error before it got to this point, but they were well worth it.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The same goes with writing. The first time I write something it is just about as beautiful as a monkey smearing poop on a tree. After the first revision I gain a stronger understanding of what the story is and how it should feel (I also tend to add a lot more material during this time.) The second revision cleans up all the new stuff I added in the first revision. The third draft results in some pretty cool sounding sentences and a stronger atmosphere. From there I can continue to go on and try to perfect all the little nuances of the story. Notice that each draft results in less and less work, meaning you can focus harder on more specific areas. This, again, applies directly to game development. You start out with NOTHING. So you make some crappy graphics and get the core programming of the game relatively completed. After the game functions you can replace those graphics with something good and tweak the code a bit more. Next you may start adding the HLSL effects and improving the graphics and sound, etc. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So, in conclusion, try to realize that, even though the game sucks now, it may not necessarily later. Spend some time in the iterative cycle. Scrutinize your game like a sentence. Improve the big things (graphics and gameplay) first, and then work your way down into the little details. You’ll quickly gain confidence in yourself and have a kick-butt game to boot.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-2662655949173227436?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/2662655949173227436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/09/game-development-writing-similarities.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2662655949173227436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2662655949173227436'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/09/game-development-writing-similarities.html' title='Game Development &amp; Writing: The Similarities'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qCFbwyV6yHY/SqVztAkPicI/AAAAAAAAAB0/m7B8u-GIS4c/s72-c/BlankGame.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-7204914597757217666</id><published>2009-09-02T16:58:00.001-07:00</published><updated>2009-09-02T17:14:26.579-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='BeginShowMessageBox'/><category scheme='http://www.blogger.com/atom/ns#' term='256'/><category scheme='http://www.blogger.com/atom/ns#' term='guide'/><category scheme='http://www.blogger.com/atom/ns#' term='Xbox 360'/><category scheme='http://www.blogger.com/atom/ns#' term='limitation'/><category scheme='http://www.blogger.com/atom/ns#' term='undocumented'/><title type='text'>Undocumented Guide.BeginShowMessageBox Limitations</title><content type='html'>&lt;p class="MsoNormal"&gt;I came across a problem today while trying to display a message to the end user. For some reason the Guide wasn’t displaying my message! After a bit of messing around I decided to shorten the text I was passing to the Guide. It appears the Guide only supports 256 characters, no more. Normally this should throw you an exception so you could fix it, but I had my code wrapped in a try catch{} block, so I didn’t get the error. This limitation currently isn’t documented (outside of the Exception) so if you’re having trouble getting the Guide to display a message, try trimming the string down to 256 characters or less. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-7204914597757217666?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/7204914597757217666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/09/undocumented-guidebeginshowmessagebox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7204914597757217666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/7204914597757217666'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/09/undocumented-guidebeginshowmessagebox.html' title='Undocumented Guide.BeginShowMessageBox Limitations'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-2078530474039553122</id><published>2009-08-28T23:47:00.000-07:00</published><updated>2009-08-28T23:48:08.582-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='broke'/><category scheme='http://www.blogger.com/atom/ns#' term='Nut Harvest'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='DeVry'/><category scheme='http://www.blogger.com/atom/ns#' term='QuadTrix'/><title type='text'>The Mountains of Difficulty</title><content type='html'>&lt;p class="MsoNormal"&gt;I’ve realized a development cycle that I tend to go through when working on a game for a period of time. I’ll realize half-way through, “Oh crap, my engine is wholly inadequate for this game!” or “I don’t have the necessary tools to do what I need to do!” or, more commonly, “I don’t have enough experience, it’s taking me way too long!” I think the last statement applies the most heavily. HLSL (High Level Shader Language), for example, was a huge barrier for a long period of time. In fact, I haven’t got somewhat acquainted with it until a few months ago (soon after QuadTrix was released), and I haven’t got decently knowledgeable about it until recently. Once I realize how much time is being reworked in the engine, rather than the game, and learning new material, rather than design, I begin to wonder if I should simply stop work on the current game and deviate totally, bent on creating a simple game in a short span of time. That’s how QuadTrix came about. Before that I was working on an epic puzzler that was beginning to take extraordinarily long. I was working on my engine, trying to piece together an editor (which went very badly), and running low on my bank account (which is now officially empty thanks to DeVry and insufficient Financial Aid,) when one day an overwhelming self-challenge came about me. Why not just start anew on a simple game? Scrap all the time-hoarding stuff and get work on something that can be completed quickly. Well, I did. The results weren’t anything amazing, but for a week and a half of work I was satisfied.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I’ve had much time since then to develop my engine and learn HLSL, but I find the same problems arising. I’m realizing that several parts of my engine either aren’t developed yet or need massive rework. Futhermore, I don’t have the necessary tools to do everything that I need to do (and I don’t have time right now to create them as I am completely broke and in bad need of money.) Sometimes there are situations which just get you in a rut and you can’t get out. &lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;The whole story of how I got in such a bad predicament is a post in itself. I may right about it in the nigh-future.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Anyway, I believe it is happening again. I’m beginning to feel that after I implement a couple more systems into my engine that I will break from Nut Harvest 360 to make a much simpler (and hopefully fun) game. Perhaps this will get me some necessary dough to continue living and making more games.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-2078530474039553122?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/2078530474039553122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/08/mountains-of-difficulty.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2078530474039553122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2078530474039553122'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/08/mountains-of-difficulty.html' title='The Mountains of Difficulty'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-4563220324805180392</id><published>2009-08-26T12:09:00.000-07:00</published><updated>2010-05-21T01:03:36.360-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='uint'/><category scheme='http://www.blogger.com/atom/ns#' term='color'/><category scheme='http://www.blogger.com/atom/ns#' term='pack'/><category scheme='http://www.blogger.com/atom/ns#' term='unpack'/><category scheme='http://www.blogger.com/atom/ns#' term='bitwise'/><category scheme='http://www.blogger.com/atom/ns#' term='shift'/><category scheme='http://www.blogger.com/atom/ns#' term='PackedValue'/><title type='text'>Unpacking a Color from the Color.Packed Property</title><content type='html'>&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;The Color.PackedValue property can be a great shorthand way to represent a color. Unfortunately, there is no Color.Unpack() method, so how do we go about getting our original Color? &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Bitwise operators of course! I had to mess around for a while before I could finally get the structure down correctly (it appears the color is packed different than the well-know RGBA format, in fact, it seems to be packed as BGRA).&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Here is how to go about it:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="color: #cccccc;"&gt;//First lets pack the color &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 10pt;"&gt;                &lt;span style="color: black;"&gt;Color &lt;/span&gt;&lt;span style="color: black;"&gt;color = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Color&lt;/span&gt;&lt;span style="color: black;"&gt;(155, 72, 98, 255);&lt;/span&gt;&lt;o:p style="color: black;"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: black; line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 10pt;"&gt;                uint packedColor = color.PackedValue;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: black; line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: black; line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 10pt;"&gt;                &lt;span style="color: #cccccc;"&gt;//Now unpack it to get the original value.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: black; line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 10pt;"&gt;                &lt;span style="color: #e69138;"&gt;Color &lt;/span&gt;unpackedColor = new Color();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: black; line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 10pt;"&gt;                unpackedColor.B = (&lt;span style="color: #f9cb9c;"&gt;byte&lt;/span&gt;)(packedColor);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: black; line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 10pt;"&gt;                unpackedColor.G = (&lt;span style="color: #f9cb9c;"&gt;byte&lt;/span&gt;)(packedColor &amp;gt;&amp;gt; 8);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: black; line-height: normal; margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 10pt;"&gt;                unpackedColor.R = (&lt;span style="color: #f9cb9c;"&gt;byte&lt;/span&gt;)(packedColor &amp;gt;&amp;gt; 16);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%;"&gt;&lt;span style="color: black;"&gt;                &lt;/span&gt;&lt;span style="color: black;"&gt;unpackedColor.A = (&lt;span style="color: #f9cb9c;"&gt;byte&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;)(packedColor &amp;gt;&amp;gt; 24);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;We use the bit shift operator (&amp;gt;&amp;gt;) to shift the bit representation over by the specified number of bits. Converting it to a byte removes all but the last 8 bits. This allows us to filter out a specific R,G,B, or A component. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-4563220324805180392?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/4563220324805180392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/08/unpacking-color-from-colorpacked.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/4563220324805180392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/4563220324805180392'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/08/unpacking-color-from-colorpacked.html' title='Unpacking a Color from the Color.Packed Property'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-5260242577579559556</id><published>2009-08-17T09:54:00.000-07:00</published><updated>2009-11-22T20:15:02.686-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='foreach'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='List'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='new'/><category scheme='http://www.blogger.com/atom/ns#' term='Current Technique Pass'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Linq'/><category scheme='http://www.blogger.com/atom/ns#' term='Xbox 360'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><category scheme='http://www.blogger.com/atom/ns#' term='Garbage'/><title type='text'>Those Sly Little Garbage Collection Issues</title><content type='html'>&lt;span class="Apple-style-span"   style="  ;font-family:Verdana;font-size:11px;"&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Do you hate garbage? I do, I hate it a lot. There’s nothing more dissatisfying than playing your game and then &lt;b style="mso-bidi-font-weight: normal"&gt;HITCH&lt;/b&gt;, the garbage collector kicks in and takes a big-juicy bite from your framerate. I recently got through doing a major refactoring to my game engine (now it’s actually suited for some platformer action) and became interested in how much garbage was being generated. To find some of the basic stuff causing garbage I created a test scenario that told my game engine to render a lot of stuff at once. After some scrutiny with the XNA Framework Remote Performance Monitor I was able to find (and document) a majority of the garbage-generating sections of my engine. The results were terrifying. 7 Garbage Collections lasting roughly 80 milliseconds were occurring every frame. In other words, a majority of my CPU time was spent simply cleaning up after my engine! Not good. So I got on my classic programmer mind set and began commenting things out until I could hone down into the source of garbage. After I got most of the core code cleaned up I ran my work-in-progress game (Nut Harvest 360) to what else I could find out. A lot of things I discovered surprised me.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Iterating though a Current Technique Passes using foreach generates garbage&lt;/b&gt;:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;This was a tough one. I had nearly all my code commented out that I thought would cause garbage, but yet the Perf. Monitor told me that boxing was happening somewhere.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So I continued searching (ludicrously commenting out additional statements), until I was left with my Primitive Rendering Class. All it was doing was iterating over an EffectPass collection like so:&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;&lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:#2B91AF;"&gt;EffectPass&lt;/span&gt; pass &lt;span style="color:blue;"&gt;in&lt;/span&gt; PBBasicShader.CurrentTechnique.Passes)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;Pass.Begin();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;Game.GraphicsDevice.VertexDeclaration = &lt;span style="color:blue;"&gt;this&lt;/span&gt;.vertices;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;Game.GraphicsDevice.DrawUserPrimitives(type, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.elements, 0, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NumOfPrimitivesToRender);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;Pass.End()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Pretty normal eh? So after scratching my head for a second I disabled the body of the code. But there was still boxing! I was getting discouraged at this point. Surely it couldn’t be the foreach could it? A moment of doubt passed. I commented out the foreach and… the boxing problem went away! I never thought that iterating over an EffectPass collection would generate garbage, (I mean, several XNA books I have use this technique) but tests confirmed that it does. After rewriting the above as:&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;int&lt;/span&gt; i = 0; i &lt;span class="Apple-style-span"  style=" ;font-size:-webkit-xxx-large;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&amp;lt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;technique.Passes.Count; ++i)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;PBBasicShader.CurrentTechnique.Passes[i].Begin();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Game.GraphicsDevice.VertexDeclaration = &lt;span style="color:blue;"&gt;this&lt;/span&gt;.vertices;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Game.GraphicsDevice.DrawUserPrimitives(type, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.elements, 0,&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span style="color:blue;"&gt;this&lt;/span&gt;.NumOfPrimitivesToRender);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;PBBasicShader.CurrentTechnique.Passes[i].End();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;The boxing/garbage problem when away! I found the same problem in my ParticleSystem. After I swithced to a regular &lt;i style="mso-bidi-font-style: normal"&gt;for&lt;/i&gt; instead of a &lt;i style="mso-bidi-font-style:normal"&gt;foreach&lt;/i&gt; I no longer received boxed value types.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;Be very careful when it comes to boxing. (If you don’t know what boxing is take a look &lt;/span&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/yz2be5wk.aspx"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;.) Some of the most simple methods that you think don’t box actually do. I dug into my Camera class and found that the statements Vector2.Equals(val, val2) was generating garbage. How could a comparision between two Vector2’s result in garbage?, I thought. Well, I looked at the Equals definition and found that it actually takes a reference of two Objects. The Vector2’s were being boxed into an Object, and then compared, when resulted in garbage, and thus garbage collections. I changed this to the val.Equals(val2) method and removed the boxing problems.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;Anytime you use the &lt;i style="mso-bidi-font-style:normal"&gt;new&lt;/i&gt; keyword you are generating garbage (unless it’s a value type such as an int, struct, etc.)&lt;/span&gt;&lt;/b&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt; This was my largest problem next to boxing. I had too many methods that were dynmanically creating arrays every time they were called (often every frame.) This was remidied by removing the array from the method and instead have the method accept an array by &lt;b style="mso-bidi-font-weight:normal"&gt;ref.&lt;/b&gt; This puts a bit more work into the calling code (as you specifically have to set up an array in every class that uses the method) but it’s worth it in terms of how much garbage you are saving yourself.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;In my InputManager I found that &lt;b style="mso-bidi-font-weight:normal"&gt;having a list of enumeration types causes boxing each time a value is added&lt;/b&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;The problem code was these two lines:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;List&lt;playerindex&gt; connectedControllers = new List&lt;playerindex&gt;(MAX_CONTROLLERS);&lt;o:p&gt;&lt;/o:p&gt;&lt;/playerindex&gt;&lt;/playerindex&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;connectedControllers.Add(PlayerIndex.One);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;I don’t really understand why…perhaps the list does some internal operations? I read on Shawn’s blog that using an enum as a key in a Dictionary causes boxing due to internal operations, so perhaps this is something similar. This was remidied by making the List accept ints and casting the PlayerIndex value to an int before storing it into the array.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;Solution:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;List&lt;int&gt; connectedControllers = new List&lt;int&gt;(MAX_CONTROLLERS);&lt;o:p&gt;&lt;/o:p&gt;&lt;/int&gt;&lt;/int&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;connectedControllers.Add((int)PlayerIndex.One);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;Be very wary of using Linq extensions, as a majority of them box values in a heartbeat.&lt;/span&gt;&lt;/b&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt; If its possible to make your own method, than it may be best to do so. I was making some heavy use of the Linq function &lt;b style="mso-bidi-font-weight:normal"&gt;Except&lt;/b&gt; (returns an array of all the data in the first set not present in the second set.) I was able to reduce garbage and boxing by creating my own function.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;"&gt;Problem:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;Courier New&amp;quot;;color:black;mso-thememso-no-proof:yesfont-family:&amp;quot;;color:text1;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;IEnumerable&lt;/span&gt;&lt;point&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; set3 = set1.Except&lt;/span&gt;&lt;point&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;(set2);&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/point&gt;&lt;/point&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;Courier New&amp;quot;;color:black;mso-thememso-no-proof:yesfont-family:&amp;quot;;color:text1;"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;Courier New&amp;quot;;color:black;mso-thememso-no-proof:yesfont-family:&amp;quot;;color:text1;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Solution:&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; SetDifference&lt;/span&gt;&lt;t&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;(&lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;List &lt;span class="Apple-style-span"  style="color: rgb(0, 0, 0);  font-size:16px;"&gt;&amp;lt; T &lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;&amp;gt; &lt;span class="Apple-style-span"  style=" ;font-size:16px;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;set1  , &lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;List&lt;/span&gt;&lt;/span&gt;&lt;t&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &amp;lt; T &amp;gt; set2, &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ref&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;List&lt;/span&gt;&lt;/span&gt;&lt;t&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; setDifference)&lt;/span&gt;&lt;/t&gt;&lt;/t&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/t&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; (setDifference == &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;)&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;setDifference.Clear();&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;foreach&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; (T obj &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;in&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; set1)&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; (!set2.Contains(obj))&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-family:&amp;quot;;"&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;setDifference.Add(obj);&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;SetDifference&lt;/span&gt;&lt;point&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;(set1, set2, ref set3);&lt;/span&gt;&lt;/point&gt;&lt;/span&gt;&lt;span style="color:black;mso-themecolor:text1;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Here is one that broke my heart: &lt;b&gt;Using the List&lt;/b&gt;&lt;/span&gt;&lt;t&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;b&gt; sort functionality produces garbage!&lt;/b&gt; This was (and still is) a baddie for me, as I sort all of my objects each frame multiple times before drawing them (once for their Update Order and once for their Draw Order.) The only way to get around this is to either use an array or to create your own sort method. (Please note that casting your List to an Array to Sort is a very very bad idea, as calling ToArray() or ToList() &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;creates a new array&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; and then returns it, resulting in garbage.&lt;/span&gt;&lt;/t&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Well there ya go, a few general performance tidbits to keep in mind. I hope they prove useful.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-5260242577579559556?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/5260242577579559556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/08/those-sly-little-garbage-collection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5260242577579559556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5260242577579559556'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/08/those-sly-little-garbage-collection.html' title='Those Sly Little Garbage Collection Issues'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-5819477334205059511</id><published>2009-07-29T13:27:00.000-07:00</published><updated>2009-07-29T13:33:12.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Nut Harvest'/><category scheme='http://www.blogger.com/atom/ns#' term='Game'/><category scheme='http://www.blogger.com/atom/ns#' term='360'/><title type='text'>Nut Harvest 360</title><content type='html'>A total remake of Nut Harvest  is in the works for the Xbox 360! Let me just say that it's going to be awesome (much more awesome than the shoddily controlled PC alternative)! Keep an eye out for screen shots and general performance tid-bits.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-5819477334205059511?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/5819477334205059511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/07/nut-harvest-360.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5819477334205059511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/5819477334205059511'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/07/nut-harvest-360.html' title='Nut Harvest 360'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-3442359439073792342</id><published>2009-07-14T11:33:00.000-07:00</published><updated>2009-07-14T12:58:10.031-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><category scheme='http://www.blogger.com/atom/ns#' term='Clone'/><category scheme='http://www.blogger.com/atom/ns#' term='XNA'/><category scheme='http://www.blogger.com/atom/ns#' term='Generics'/><category scheme='http://www.blogger.com/atom/ns#' term='Xbox 360'/><category scheme='http://www.blogger.com/atom/ns#' term='Copy'/><category scheme='http://www.blogger.com/atom/ns#' term='ToArray'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Array Copy Performance</title><content type='html'>&lt;div style="text-align: left;"&gt;I was recently working on a program ( a cloud Component in XNA to be exact) that was doing a fair amount of copying from one array to another. I became interested half-way through the project as to which was faster, the Array.Copy method, or a simple for loop that iterates through the array and copies each element from one array over to another array. I wanted to squeeze out as much performance as possible, so I created a simple test application that examines the speed of three copying methods. I used Array.Copy(), the for loop method, and the CopyTo() member of an array object. I compiled the results into the table below. All time is in milliseconds, with the lower number being the best. Stopwatch was used to measure time intervals.&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://2.bp.blogspot.com/_qCFbwyV6yHY/SlziSV2ShfI/AAAAAAAAABk/5tyCj-ZL1Cg/s400/Array+Copy+Performance.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5358406461394421234" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 261px; " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;For some reason I anticipated that the simpler for loop would have an advantage, but I was very wrong. As you can see, Array.Copy or arrayObj.CopyTo() is the clear choice when you are wanting to copy an array over to another array. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This introduces some further interesting performance considerations. Let’s say you have two arrays (ary1 and ary2) and you want to synchronize ary1 to equal ary2. You have several options. You could use the Clone() method of ary2 (which creates a new Object that then must be unboxed to the type of array you are using), you could use ary2.ToArray&lt;int&gt;()* (which generates a new array and returns it), or you could use ary2.CopyTo(ary1, 0) (which generates no new array and thus should generate no garbage.) Now, keep in mind that the Xbox 360 is &lt;b style="mso-bidi-font-weight:normal"&gt;extremely&lt;/b&gt; fragile when it comes to garbage. Anything that generates a new object will eventually generate garbage. Anything that is boxed and unboxed generates garbage. With this knowledge, it is likely that the Clone method will be slower than the ToArray() method, and the ToArray() method will be much slower than the Array.Copy method. And if you use the Clone() or ToArray() methods in a tight loop, well, let’s just say your performance will die - completely. We need something that doesn’t generate garbage, and that something is the Array.Copy method. The graph below compares performance. (Each operation executed 25 times and times averaged. All times in milliseconds.)&lt;/int&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_qCFbwyV6yHY/SlziqhiS2gI/AAAAAAAAABs/eeo_EsOdc28/s400/Array+Cloning+Performance.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5358406876848642562" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 241px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Note that this was all done on the PC, though it’s highly probable these figures carry over to the 360. It’s interesting to note the linear speed improvement as we head toward the Array.Copy() side of things. Array.Copy is twice as fast as ToArray&lt;int&gt;(), and three times faster than the Clone method.&lt;/int&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So that pretty much settles it. If you are programming an application that requires the utmost performance (such as a video game) than Array.Copy() is the immediate choice. It’s wise to take a few moments and look though your code for any tight loops where copying operations are occurring. I switched from using ToArray&lt;int&gt;() in my Radix Sort implementation to Array.Copy() and got a grand performance boost.&lt;/int&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Thanks for reading.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;*Note that System.Linq will have to be included in order for this function to be used.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-3442359439073792342?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/3442359439073792342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/07/array-copy-performance.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3442359439073792342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3442359439073792342'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/07/array-copy-performance.html' title='Array Copy Performance'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qCFbwyV6yHY/SlziSV2ShfI/AAAAAAAAABk/5tyCj-ZL1Cg/s72-c/Array+Copy+Performance.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-2293763102024807866</id><published>2009-06-08T16:41:00.000-07:00</published><updated>2009-06-08T16:45:26.051-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Game Component'/><category scheme='http://www.blogger.com/atom/ns#' term='Design Decisions'/><category scheme='http://www.blogger.com/atom/ns#' term='WinForms'/><title type='text'>Design Decisions: The wiles of the Game Component.</title><content type='html'>&lt;p class="MsoNormal"&gt;If you’ve used XNA at all you’ve probably already heard of the Game Component. In case you haven’t I’ll provide a brief description: A Game Component is an object that is automatically updated and drawn by the &lt;b style="mso-bidi-font-weight:normal"&gt;Game&lt;/b&gt; class for you. All you have to do is derive an object from the GameComponent or DrawableGameComponet class such as:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sprite : DrawableGameComponent&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{&lt;/p&gt;  &lt;p class="MsoNormal"&gt;…code here&lt;/p&gt;  &lt;p class="MsoNormal"&gt;}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;And make a call to Game.Components.Add (derivedObjectHere) and your good! None of those nasty draw or update calls littering your code. It seems like a good idea at first, but there are a lot of hidden implications to creating a game, or game engine, that is based around the Component paradigm (as I have personally discovered.)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This post is going to examine three major hidden implications of using GameComponents and hopefully give you a better idea of what you’re getting into if you decide to go this route.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The first implication is a shift in control. Let’s say you create a few non game component Sprite objects inside your Game class. In order to draw or update them, you must manually call their draw and update methods. Ok, so what does that have to do with anything? The point is that you have &lt;b style="mso-bidi-font-weight:normal"&gt;control&lt;/b&gt; over the order in which the sprites should Draw or Update. Things are a bit different with Components, as the Draw and Update methods are called automatically by &lt;b style="mso-bidi-font-weight: normal"&gt;Game&lt;/b&gt;. You can achieve a similar effect by adding them to the component list in the same order that you called draw or update on the non component objects. This is OK if you are going to create all your objects in Game, but frequently Level objects are created (which may be a component in and of itself) that store other components. When a structure like this is in place, it becomes much more difficult to get everything to draw in the correct order. To circumvent this problem, Components have a property called DrawOrder and UpdateOrder. A value of 0 means it draws first (which means it draws behind everything else) while a greater value makes it draw later. If I assign 0, 1, and 2 to three different components, the one with a DrawOrder of 0 will draw, followed by 1 and then finally 2. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;The second implication is the tendency of GameComponents to affect the design of all objects in your engine or game. What do I mean by that? Imagine this scenario. You have a non-component object that you want to spawn game component sprites at a given interval. You quickly realize, however, that your Sprites require a reference to Game, as do all GameComponents. You do not have direct access to game from a non-component object, leaving you with two options: go against OOP standards and make a static property from which you can access game to create your sprites, or refactor the non-component object into a component object so you have direct access to everything you need. This redesign will be required for every non-component object that you want to create a component object with, and can amount to a very large amount of time refactoring your code.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The third implication is that you are tied to the &lt;b style="mso-bidi-font-weight:normal"&gt;Game&lt;/b&gt; class. This is a biggie, a real biggie. What makes this so huge is that your components will not function if &lt;b style="mso-bidi-font-weight:normal"&gt;Game&lt;/b&gt; isn’t present. When it really bites (and I’m finding out now) is when you try to integrate your components into a WinForms project (such as for a level editor.) This imposes a major hurdle: using the WinForms method (as detailed on the XNA site &lt;a href="http://creators.xna.com/en-us/sample/winforms_series1"&gt;here&lt;/a&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;) &lt;/b&gt;strips out the functionality of the Game class, replacing it with a custom implementation. Ok, so what’s so bad about this? The problem, my friend, lies in the fact that GameComponents &lt;b style="mso-bidi-font-weight:normal"&gt;must&lt;/b&gt; be passed a reference to Game in order to function. So guess what? All that work you just did refactoring all your code into a component amounts to a big pile of nothing. Now you have to do even &lt;b style="mso-bidi-font-weight:normal"&gt;more&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;refactoring&lt;/b&gt; in order to get your engine or game up and running. I’m still working out an elegant solution to this problem, but it was suggested to me via the intellectuals over at the XNA forums to create a custom implementation of a Component by means of inheriting from IGameComponent and IUpdateable. This wouldn’t require a reference to Game (as I would be creating my own object) but it would require me to pass in a ServicesContainer of some sort for every object I create in order to access the data commonly accessed from a regular GameComponent (such as GraphicsDevice, Content Manager, etc.)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now for my personal thoughts on the matter:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Game Components aren’t all bad. They can really automize and streamline the game development process, but using them requires the framework of your engine to be set up to expect them. Strangely enough, I’ve found that as my engine evolved, the benefits of Game Components became less prevalent, and I’m finding it that I could actually do without them. I now no longer add the components to the Game Class. Instead I have separate layers that each has their own collection of components. Each layer then manually iterates though the collection and calls Draw and Update on each component. The layer also automatically sorts its collection every time a new component is added in order to get the Draw and Update functions to do everything in the correct order. With this said, it is very much a possibility to get a game or engine up and running that doesn’t use components. Doing so frees you up from the Game Class and allows you to easily migrate to WinForms or other custom rendering solutions. It also doesn’t require refactoring existing code into components. If you’re in the middle of developing a large game or comprehensive game engine and are thinking about switching to GameComponents, I implore you to take a moment and think of an alternative method. You’ll save a lot of time and headache this way. If you’re just starting, however, and you really want to take the GameComponent approach, please, please, follow my above request and take a moment to ensure that what you are trying to do can’t be easily accomplished without using GameComponents. If you have a good enough of excuse of why you need it (or you simply wish to ignore me) than take some time in the planning stage to make everything a component from the get go, and most of all, good luck!&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Until next time…&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-2293763102024807866?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/2293763102024807866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/06/design-decisions-wiles-of-game.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2293763102024807866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/2293763102024807866'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/06/design-decisions-wiles-of-game.html' title='Design Decisions: The wiles of the Game Component.'/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-8350443462264303716</id><published>2009-05-28T01:20:00.000-07:00</published><updated>2009-05-28T01:43:54.224-07:00</updated><title type='text'></title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;b&gt;How to make Platformer Grass in GIMP&lt;/b&gt;&lt;/div&gt;  &lt;p class="MsoNormal"&gt;In this tutorial I’m going to guide you through the steps necessary to create some basic, yet good-looking grass that could fit very well in a platformer game.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The end result of this tutorial should look something like this:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://2.bp.blogspot.com/_qCFbwyV6yHY/Sh5JhVp0qII/AAAAAAAAAAU/LKuC3xoUTSw/s400/Grass7.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340787045205059714" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 267px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The first thing you need to do is load up GIMP (duh!) GIMP can be found &lt;a href="http://www.gimp.org/"&gt;here&lt;/a&gt;, though if you don’t want to download it you can follow along in any advanced image editing software of your choice. Note, however, that these steps will not match up perfectly with whatever software you are using. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;I’m using GIMP 2.6.6 for this tutorial.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;First we need a new layer to work with. Click File-&gt;New and then extend the + button beside Advanced Options. Find the &lt;i&gt;Fill With&lt;/i&gt; dialog box, and choose &lt;i&gt;Transparency&lt;/i&gt;. Leave the image size as the default for now.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This layer will act as our background layer. It will act as the base color for the rest of the image. Let’s go ahead and fill this will a dark green color.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We should now have something that looks like this:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_qCFbwyV6yHY/Sh5Lf6AVnAI/AAAAAAAAAAc/SNhgWsqDwLc/s400/Grass1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340789219626687490" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 301px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Boring huh? But stay with me, things will get interesting in a minute.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Let’s now begin to add a bit of variance to our base image.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Create a new layer and call it Light Green.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We are now going to make use of the airbrush. This guy is extremely useful for adding subtle details that makes things look a lot better. Remember this if your image looks too flat or uninteresting. A little use of the airbrush with modest opacity settings can do wonders.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Select the airbrush tool and select a brighter green (not too bright.)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Select a fuzzy brush and set the scale of the airbrush to 10. Lower the opacity to around 60 and draw some randomized strokes on the Light Green layer. Hopefully we have something that somewhat resembles this:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_qCFbwyV6yHY/Sh5L1ZzDILI/AAAAAAAAAAk/4O1aPkk7L4M/s400/Grass2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340789588938137778" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 301px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;It’s starting to get there, but it’s definitely not there yet. What we need now is some extra variance added in.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A little bit of variance is what makes things appear realistic and less deterministic and computer-derived looking. A great way to get this variance is to use a pseudo-random algorithm to generate a texture, and then merge this texture with our base image. This can be used to really liven up an image. It sounds complicated, but trust me, it’s really not.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Let’s go ahead and create a new layer. Call it Cloud. Now to create the computer-generated image we will merge with the one we made. Click Filters-&gt;Render-&gt;Clouds-&gt;Plasma. Change the Turbulence to what you desire and click OK. I used the default settings.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Our image will now look like this:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://2.bp.blogspot.com/_qCFbwyV6yHY/Sh5MMzJi3BI/AAAAAAAAAAs/AQodUjmabi0/s400/Grass3.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340789990880369682" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 301px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;image3&gt;&lt;/image3&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now we need to remove all the color from the Cloud image so that it doesn’t affect the color values of our base images when we merge it. Click Colors-&gt;Desaturate-&gt;Average. Our cloud image should now be in grayscale. It is ready to merge. Change the Cloud Mode to overlay, and set the layers opacity to about 60.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_qCFbwyV6yHY/Sh5Mj4iZJGI/AAAAAAAAAA0/E65iCkrRJhQ/s400/Overlay.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340790387463758946" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 79px; height: 400px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://4.bp.blogspot.com/_qCFbwyV6yHY/Sh5NecImI6I/AAAAAAAAAA8/YTNN42TfMf4/s400/CloudApplied.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340791393451647906" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 311px; " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Looking a bit better now. At least we have some variance going on. Let’s add one more element, a linear gradient. Create a new Layer and Name it Linear Gradient. Choose the gradient tool and set the foreground color to black and the background color to white. Place the cursor at the bottom center of the image and hold Control as you move the mouse near the top of the image (This makes it stay in a perfectly straight line.) Release the mouse button. &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qCFbwyV6yHY/Sh5NySJQuUI/AAAAAAAAABE/iL6jlYdWm-I/s1600-h/Grass4.jpg"&gt;&lt;img src="http://2.bp.blogspot.com/_qCFbwyV6yHY/Sh5NySJQuUI/AAAAAAAAABE/iL6jlYdWm-I/s400/Grass4.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340791734367467842" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 311px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;forth image=""&gt;&lt;/forth&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Change the mode to multiply.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The grass should now look like this:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_qCFbwyV6yHY/Sh5N4oZAF-I/AAAAAAAAABM/Kbto3cDfmYI/s400/Grass5.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340791843418281954" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 311px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;fifth image=""&gt;&lt;/fifth&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In my case it’s still a bit too dark, so let’s go lighten it up a bit.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Let’s go to the Background layer and use the airbrush to paint on some brighter greens. Experiment with the brushes to see what looks the best. Here’s what it looks like after lighting things up:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://4.bp.blogspot.com/_qCFbwyV6yHY/Sh5OFj2FvHI/AAAAAAAAABU/lkxx9-zjB6o/s400/Grass6.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340792065536408690" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 311px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;sixth image=""&gt;&lt;/sixth&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Almost there. Let’s merge the layers into one. Go to Image-&gt;Merge Visible Layers and click OK when the dialog appears. We know have a single image. Let’s erase some of the top portion to see if we can get something that looks like grass going on. I used a combination of the Pencil Sketch#2 and Galaxy brushes to achieve this effect:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_qCFbwyV6yHY/Sh5OJ_C9z1I/AAAAAAAAABc/TYe9pcp5JO4/s400/Grass7.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5340792141557649234" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 267px; " /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;seventh image=""&gt;&lt;/seventh&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Not too bad. I can see this being used in a platformer game. Can you?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-8350443462264303716?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/8350443462264303716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/05/how-to-make-platformer-grass-in-gimp-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/8350443462264303716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/8350443462264303716'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/05/how-to-make-platformer-grass-in-gimp-in.html' title=''/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qCFbwyV6yHY/Sh5JhVp0qII/AAAAAAAAAAU/LKuC3xoUTSw/s72-c/Grass7.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9026666720801508897.post-3687892578584279236</id><published>2009-05-27T23:21:00.000-07:00</published><updated>2009-05-27T23:25:31.207-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TicTacToe'/><category scheme='http://www.blogger.com/atom/ns#' term='Nut Harvest'/><category scheme='http://www.blogger.com/atom/ns#' term='QuadTrix'/><category scheme='http://www.blogger.com/atom/ns#' term='Introduction'/><title type='text'></title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;FIRSTIES!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;Ok, sorry, please forgive me for uttering that overused and deeply irritating phrase. I’m kinda new to this blog business and I’m having a difficult time starting out this introduction (ever had that trouble?) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;So yeah, let’s get this thing a rolling. My name is Clinton. I’m a fledging independent game developer with an aim toward the Xbox 360 Community Games Marketplace, though I’ve been throwing the idea around of developing for the iPhone. We’ll see how that goes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;I have released one game so far for the 360 Community Marketplace. It’s a simple puzzler titled &lt;a href="http://marketplace.xbox.com/en-US/games/media/66acd000-77fe-1000-9115-d80258550202/?did=00000001-0000-4000-8000-000058550202&amp;amp;gu=66acd000-77fe-1000-9115-d80258550202&amp;amp;sb=1&amp;amp;mt=32&amp;amp;partner=RSS&amp;amp;p=1&amp;amp;of=6"&gt;QuadTrix&lt;/a&gt;. Give it a try if you get the chance. There are probably more than one gameplay flaw mixed into its chemistry, and it lacks that certain element that makes it enjoyable to anyone who plays it, but I’m proud of it nevertheless. I’m just beginning on the long journey of the indie game developer, the one with the forlorn path that twists sinuously through hours of lost sleep and mounds of anxious books stacked in a never ending queue, waiting for their knowledge to be devoured with weary eyes and an unkempt heart, so I’m not too hard on myself – yet. &lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;I’m taking it slow, learning what I need to and messing around a bit. The better games are coming baby, they’re coming.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;Some additional info:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;I made my first game in ninth grade high school (at the age of fourteen) using the RPG Toolkit game engine and its associated scripting language. In 2006 I decided to take my love of programming to a new level when I began my venture with DeVry University, starting out on the path of a Computer Information Systems developer. Midway through that program I decided it best to follow my true aspirations, and thus switched paths to the Game Programming Degree. Since my time at DeVry I have made three games as of the time of this writing. &lt;a href="http://www.yoyogames.com/games/show/33797"&gt;Nut Harvest&lt;/a&gt; (created on the Game Maker engine), which can be found here, and &lt;a href="http://www.youtube.com/watch?v=7ysRqB5vAQ8&amp;amp;feature=channel_page"&gt;Tic-Tac-Toe&lt;/a&gt; and &lt;a href="http://www.youtube.com/watch?v=rQiTAStyJ-0&amp;amp;feature=channel_page"&gt;QuadTrix&lt;/a&gt;, which were both developed on XNA.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;I plan to use this blog as a means of posting hopefully helpful tutorials on various subjects relating to programming, video game development, and graphical subjects. I may also occasionally post game reviews.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; line-height:115%;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;color:black"&gt;Thanks for the read.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9026666720801508897-3687892578584279236?l=enigmaticfish.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enigmaticfish.blogspot.com/feeds/3687892578584279236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enigmaticfish.blogspot.com/2009/05/firsties-ok-sorry-please-forgive-me-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3687892578584279236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9026666720801508897/posts/default/3687892578584279236'/><link rel='alternate' type='text/html' href='http://enigmaticfish.blogspot.com/2009/05/firsties-ok-sorry-please-forgive-me-for.html' title=''/><author><name>Lotus</name><uri>http://www.blogger.com/profile/06623776909845360460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_qCFbwyV6yHY/S644GDqfm3I/AAAAAAAAACY/EA7J2C0M_Vk/S220/Various+005_Smal.jpg'/></author><thr:total>0</thr:total></entry></feed>
