{"id":498,"date":"2010-01-05T22:48:47","date_gmt":"2010-01-06T04:48:47","guid":{"rendered":"http:\/\/handyvandal.com\/?p=498"},"modified":"2010-02-23T22:25:36","modified_gmt":"2010-02-24T04:25:36","slug":"oop-game-design-theory","status":"publish","type":"post","link":"https:\/\/handyvandal.com\/wphv\/2010\/01\/oop-game-design-theory\/","title":{"rendered":"OOP Game Design Theory"},"content":{"rendered":"<p>Question posted over at <em>Stack Overflow<\/em>:<\/p>\n<blockquote><p>I&#8217;ve tried to develop a 2D game with C++ in the past using mere objects, however, in the design process I don&#8217;t know how and what parts of the engine I should split into smaller objects, what exactly they should do and how to make them interact with each other properly. I&#8217;m looking for books, tutorials, papers, anything that explains the game engine design in detail. Thanks.<\/p><\/blockquote>\n<p>From the comments:<\/p>\n<blockquote><p>\n&#8220;You might want to take a look at XNA if only to see how the main game loop works.&#8221;<\/p>\n<p>&#8220;Don&#8217;t use &#8220;mere objects&#8221;. Use whatever makes sense. Your game doesn&#8217;t have to be strict OOP. It has to work, and it should preferably be nice, well-structured code. Neither requires OOP. Write your game using every tool available. Classes, functions, functors, templates, procedural programming, object-oriented programming, functional programming, generic programming, whatever fits the task at hand. Don&#8217;t limit yourself to OOP just because some people 20 years ago thought it was the holy grail.&#8221;<\/p>\n<p>&#8220;Mandatory reading: <a href=\"http:\/\/scientificninja.com\/advice\/write-games-not-engines\">http:\/\/scientificninja.com\/advice\/write-games-not-engines<\/a>&#8221;<\/p>\n<p>&#8220;Why do you think you need a game engine? Write the code you need in order to implement your game. Modify it along the way as requirements change. And when you have a complete game, take a step back and look at what the result looks like.&#8221;<\/p>\n<p>&#8220;I like the try &#038; refactor approach. Crafting OO design takes experience.&#8221;<\/p>\n<p>&#8220;Even with experience, it&#8217;s still 1) impossible, and 2) a bad idea to try to come up with a complete detailed design before implementing it. There&#8217;s a reason the whole &#8220;agile&#8221; thing has caught on so much. You will encounter issues you hadn&#8217;t thought of, so make the design decisions when you&#8217;ve got the information you need &#8212; that is, when you&#8217;ve tried to implement it, and found out what all the pitfalls are.&#8221;<\/p>\n<p>&#8220;Give this a try: <a href=\"http:\/\/www.devmaster.net\/articles\/oo-game-design\/\">http:\/\/www.devmaster.net\/articles\/oo-game-design\/<\/a>&#8221;<\/p>\n<p>&#8220;If you haven&#8217;t made a game before, how can you make an engine? There&#8217;s tons of free engines out there or you will be spending 20 years trying to get something done because you will be rewriting over and over again.&#8221;<\/p>\n<p>&#8220;What makes a game good is the content not the engine, all good programmers &#8216;borrow&#8217; other peoples code whenever they can.&#8221;<\/p>\n<p>&#8220;Eberly&#8217;s <em>3D Game Engine Architecture<\/em> and <em>3D Game Engine Design<\/em> are rather heavy on the theory, but cover all of the bases quite well.&#8221;<\/p>\n<p>&#8211; <a href=\"http:\/\/stackoverflow.com\/questions\/1977264\/oop-game-design-theory\">OOP Game Design Theory<\/a> @ Stack Overflow\n<\/p><\/blockquote>\n<p>My own opinion: Don&#8217;t write a game engine.  Start with an existing framework. Work within the framework, or modify the framework to meet your needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question posted over at Stack Overflow: I&#8217;ve tried to develop a 2D game with C++ in the past using mere objects, however, in the design process I don&#8217;t know how and what parts of the engine I should split into smaller objects, what exactly they should do and how to make them interact with each [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,94],"tags":[],"class_list":["post-498","post","type-post","status-publish","format-standard","hentry","category-game-design","category-programming"],"_links":{"self":[{"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/posts\/498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/comments?post=498"}],"version-history":[{"count":2,"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/posts\/498\/revisions"}],"predecessor-version":[{"id":744,"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/posts\/498\/revisions\/744"}],"wp:attachment":[{"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/media?parent=498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/categories?post=498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/handyvandal.com\/wphv\/wp-json\/wp\/v2\/tags?post=498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}