<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx</link><description>I've seen a couple of posts on the forums asking what the best way to structure a game is. For what it's worth, here's a structure I've used in a few of my games. The design itself isn't too complicated, but it's pretty flexible, and will keep your code</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#1283561</link><pubDate>Thu, 14 Dec 2006 15:42:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1283561</guid><dc:creator>Machaira</dc:creator><description>&lt;p&gt;You beat me to it. I was thinking about doing something on this (it comes up a lot in game dev forums), but yours is probably better written than what I could have done. :) For what it's worth, I'm linking to this from my blog.&lt;/p&gt;</description></item><item><title>re: Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#1284835</link><pubDate>Thu, 14 Dec 2006 16:43:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1284835</guid><dc:creator>Machaira</dc:creator><description>&lt;P&gt;I did come up with an idea for one improvement - if a window's BlockDraw is set, the ones below it could be drawn greyed out. This would require a little change to the draw, probably overloading it with a flag to specify whether to draw regularly or greyed out.&lt;/P&gt;</description></item><item><title>re: Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#1294290</link><pubDate>Fri, 15 Dec 2006 16:48:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1294290</guid><dc:creator>Ultrahead</dc:creator><description>&lt;p&gt;Very good article.&lt;/p&gt;
&lt;p&gt;Maybe one of the search processes for the Draw call can be erased, at least partially, by taking advantage of the update method.&lt;/p&gt;
&lt;p&gt;I mean when the update method goes through the stack in a top-down manner it also verifies whether the screen must be drawed or not.&lt;/p&gt;
&lt;p&gt;To ways to follow from here: either you let that search to &amp;quot;scan&amp;quot; all screens objects in the stack regardless whether a BlockUpdate was found or you stop when the BlockUpdate was found and continue the search in the draw method in case the BlockDraw was not yet found.&lt;/p&gt;
&lt;p&gt;Another approach would be using &amp;quot;events&amp;quot;.&lt;/p&gt;
&lt;p&gt;Again, very good series of articles.&lt;/p&gt;
</description></item><item><title>re: Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#1349021</link><pubDate>Fri, 22 Dec 2006 20:23:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1349021</guid><dc:creator>CatalinZima</dc:creator><description>&lt;p&gt;The whole thing looks very good, but when I began implementing it, a thought crossed my head.&lt;/p&gt;
&lt;p&gt;Does this design ensure the calling of LoadGraphicsContent for the components in the GameScreen, when the device is reset ?&lt;/p&gt;
</description></item><item><title>re: Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#1480159</link><pubDate>Wed, 17 Jan 2007 01:03:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1480159</guid><dc:creator>Ultrahead</dc:creator><description>&lt;p&gt;@Catalin: maybe you could test it throwing a device exception at some point in the execution that requires resetting?&lt;/p&gt;
</description></item><item><title>re: Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#1719580</link><pubDate>Tue, 20 Feb 2007 02:51:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1719580</guid><dc:creator>nickspacek</dc:creator><description>&lt;p&gt;I'm implementing this pattern as well, and I had some thoughts, possibly related to CatalinaZima's above.&lt;/p&gt;
&lt;p&gt;If you aren't managing a pool of screens, then how do you ensure that the Initialize and LoadGraphicsContent methods get called? &amp;nbsp;I did a test, and if you Components.Add a DrawableGameComponent at the end of Game.Draw (after base.Draw) then the Game class is still smart enough to Initialize the component before it tries to Draw it. &amp;nbsp;Unfortunately, as far as I can tell there is no way to check if the Component has called its Initialize and LoadGraphicsContent. &amp;nbsp;But how is the Game class doing it then?&lt;/p&gt;
</description></item><item><title>re: Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#1719603</link><pubDate>Tue, 20 Feb 2007 02:56:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1719603</guid><dc:creator>nickspacek</dc:creator><description>&lt;p&gt;Just had a thought. &amp;nbsp;What could be done is to have either the GameScreens themselves or the manager add them to the Game.Components list and just manage their Enabled and Visible properties based on the blocksUpdate and blocksDraw properties.&lt;/p&gt;
</description></item><item><title>Game Maker Studio .Net</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#1799774</link><pubDate>Sun, 04 Mar 2007 02:06:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1799774</guid><dc:creator>Mykres Space</dc:creator><description>&lt;p&gt;I came across this a little while ago and have been watching the progress, Game Maker Studio is a 2D&lt;/p&gt;
</description></item><item><title>re: Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#2079479</link><pubDate>Wed, 11 Apr 2007 03:43:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2079479</guid><dc:creator>JoelBennett</dc:creator><description>&lt;p&gt;nickspacek: &amp;nbsp;I am wondering about the same thing. &amp;nbsp;I guess there is only one way to find out - try it!&lt;/p&gt;
</description></item><item><title>re: Basic Game Engine Structure</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#2235356</link><pubDate>Sun, 22 Apr 2007 22:57:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2235356</guid><dc:creator>zygote</dc:creator><description>&lt;p&gt;for (int i = screensToDraw.Count - 1; i &amp;lt;= 0; i--){ &amp;nbsp; &amp;nbsp;screensToDraw[i].Draw( gameTime );}&lt;/p&gt;
&lt;p&gt;this needs to be:&lt;/p&gt;
&lt;p&gt;for (int i = screensToDraw.Count - 1; i &amp;gt;= 0; i--){ &amp;nbsp; &amp;nbsp;screensToDraw[i].Draw( gameTime );}&lt;/p&gt;
&lt;p&gt;note the change of &amp;lt;= to &amp;gt;=&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Ziggy&lt;/p&gt;
</description></item><item><title>Game Maker Studio .Net</title><link>http://blogs.msdn.com/etayrien/archive/2006/12/12/game-engine-structure.aspx#8483570</link><pubDate>Sat, 10 May 2008 08:58:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8483570</guid><dc:creator>Virtual Realm</dc:creator><description>&lt;p&gt;I came across this a little while ago and have been watching the progress, Game Maker Studio is a 2D editor and Engine for Tile based RPG Systems. In the month of January the system was released in CTP for us all to try and see how it goes. Included on&lt;/p&gt;
</description></item></channel></rss>