<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>#AltDevBlogADay &#187; Martin Pichlmair</title>
	<atom:link href="http://www.altdevblogaday.com/author/martin-pichlmair/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.altdevblogaday.com</link>
	<description>Each day a little more #gamedev love</description>
	<lastBuildDate>Wed, 08 May 2013 03:07:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Game Prototyping 101</title>
		<link>http://www.altdevblogaday.com/2011/12/07/game-prototyping-101/</link>
		<comments>http://www.altdevblogaday.com/2011/12/07/game-prototyping-101/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 09:08:32 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[interaction design]]></category>
		<category><![CDATA[prototyping]]></category>
		<category><![CDATA[sketching]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=21220</guid>
		<description><![CDATA[<p>This article tells you how to get started with game prototyping.<span id="more-21220"></span></p>
<h1>Key Properties of a (Game) Prototype</h1>
<p>Prototypes can be analog or digital, made out of paper, assembler, clay or python. They can take any shape or form, but still share some key properties. The reason for a prototype is always that you want to test a specific feature, technique or design decision as cheap as possible. In order to make the prototype cheap, it needs to be easy to create and fast to get started. Use whatever is at hand or, even better, create a prototyping environment. The environment can mean a box of crayons and some sheets of paper or setting up <a title="Processing.org" href="http://Processing.org/">Processing</a>. The ultimate fate of every prototype should be the trash can. Once you&#8217;ve created it, tested it, and noted the results of the test, you best throw away the prototype. Of course you might keep it around in case you want to iterate it, but that should be the exception rather than the rule. It is especially dangerous to create a prototype that could potentially be used in the final product. Most production environments are too complex to allow for agile prototyping. As soon as you run into a technical problem, you are most likely working in the wrong environment (or really clumsy with scissors). Also, a prototype should never be optimized. Since prototypes might be used for all kinds of experimenting, different tools are appropriate for different prototypes. Always remember that a prototype should test one specific aspect of your design. Don&#8217;t make it holistic. Don&#8217;t let any feature creep hamper your agility.</p>
<p><a href="http://www.altdevblogaday.com/2011/12/07/game-prototyping-101/" class="more-link">Read more on Game Prototyping 101&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>This article tells you how to get started with game prototyping.<span id="more-21220"></span></p>
<h1>Key Properties of a (Game) Prototype</h1>
<p>Prototypes can be analog or digital, made out of paper, assembler, clay or python. They can take any shape or form, but still share some key properties. The reason for a prototype is always that you want to test a specific feature, technique or design decision as cheap as possible. In order to make the prototype cheap, it needs to be easy to create and fast to get started. Use whatever is at hand or, even better, create a prototyping environment. The environment can mean a box of crayons and some sheets of paper or setting up <a title="Processing.org" href="http://Processing.org/">Processing</a>. The ultimate fate of every prototype should be the trash can. Once you&#8217;ve created it, tested it, and noted the results of the test, you best throw away the prototype. Of course you might keep it around in case you want to iterate it, but that should be the exception rather than the rule. It is especially dangerous to create a prototype that could potentially be used in the final product. Most production environments are too complex to allow for agile prototyping. As soon as you run into a technical problem, you are most likely working in the wrong environment (or really clumsy with scissors). Also, a prototype should never be optimized. Since prototypes might be used for all kinds of experimenting, different tools are appropriate for different prototypes. Always remember that a prototype should test one specific aspect of your design. Don&#8217;t make it holistic. Don&#8217;t let any feature creep hamper your agility.</p>
<p>In summary, a prototype has the following key properties:</p>
<ul>
<li>Easy to create, fast to get started</li>
<li>Cheap to work with, so that you can throw away the results</li>
<li>Should not produce something you can use in finished product</li>
<li>Should not allow optimization</li>
<li>Be made with the right tool for this specific design challenge</li>
<li>Allows to judge one specific aspect of design</li>
</ul>
<h1>Why Should I Build a Prototype?</h1>
<p>The problem with prototypes is that they sound like extra work. Most people have trouble throwing away anything that required an investment from their side. To overcome this, a prototype needs to be as cheap as possible. Throwing away something cheap is easier than trashing something expensive. If the prototype requires too much work to be worth the effort or to be thrown away, you are most likely building it with the wrong tools.</p>
<p>The key benefit of building a prototype is that it enforces design decisions. Once you put a design to paper in the form of a testable prototype you have to settle for the behavior of the system. Also, if the team plays the prototype together they are confronted with those design decisions. The prototype fosters team communication. If the prototype is played by people other than the designers, those inevitably find loops in the rule set. The prototype then acts as a coverage check for your rule set.</p>
<h1>Different Prototypes for Different Experiments</h1>
<p>Different prototypes for different aspects of a game sounds great in theory. But what exactly can you test with a prototype? The easiest part is game design. Most game rules can be formalized and written down on paper. It&#8217;s a bit difficult for action-intensive games, but still doable. I&#8217;ve even read about first person shooters that were <a title="Game Design Workshop" href="http://www.amazon.com/Game-Design-Workshop-Prototyping-ebook/dp/B001UN2WCK">prototyped on paper</a>. Basic game systems like resource systems, character progression and enemy balancing can be easily abstracted. More obscure game systems like loot frequency and item properties can be tested by building specific prototypes, e.g. card games, that focus on those sub-systems alone. If you build a paper prototype for a highly interactive part of the game, don&#8217;t shy away from <a title="Wizard of Oz experiments" href="http://en.wikipedia.org/wiki/Wizard_of_Oz_experiment">Wizard-of-Oz’ing</a>. Remember, AD&amp;D is all smoke and mirrors.</p>
<p>Things might get more complicated if you want to prototype more technical elements of a game. Game controls are a classic example of where a prototype is helpful, especially if you&#8217;re trying something new. Novel interfaces, the Wii Remote or the iPhone&#8217;s touch screen, can be tested for specific interaction forms before integrating those controls into the game proper. A.I. is another area where it makes sense to prototype a new algorithm before rewriting the engine. If you have e.g. a plant growing algorithm in your game you can develop a <a title="Lindenmayer Systems" href="http://en.wikipedia.org/wiki/Lindenmayer_systems">Lindenmayer-System</a> in a dedicated piece of software before carrying over the rules that work for your game. Arranging audio before putting it into the game is so common I wouldn&#8217;t even call it prototyping, but what if you build an interactive dedicated audio-prototype?</p>
<h1>Making Game Design Prototypes</h1>
<div style="clear: both"><img class="alignleft size-large wp-image-21221" style="border-style: initial;border-color: initial;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/12/27032009538-1024x768.jpg" alt="" width="100%" /></div>
<p>Stone Librande gave a <a title="Stone Librande Slides" href="http://www.stonetronix.com/">wonderful talk about paper prototyping at GDC09</a>. Apart from numerous examples of paper prototypes he has built, one of his slides listed the do&#8217;s and don&#8217;ts of game prototyping. Here&#8217;s the gist of it:</p>
<p><strong>What To Do</strong></p>
<ul>
<li>Focus on one key idea at a time</li>
<li>Abstract as much as possible</li>
</ul>
<p><strong>What Not To Do</strong></p>
<ul>
<li>Don&#8217;t worry if the paper version is not &#8220;fun&#8221;</li>
<li>Don&#8217;t try to duplicate the whole game</li>
<li>Don&#8217;t simulate computer functions (physics, math, …)</li>
</ul>
<h1>Make Rules, Not Boards</h1>
<p>Apart from prototyping my own games, I&#8217;ve taught this technique in game design and interaction design courses over the last six years. My students usually fall into expected traps when building their first gameplay prototypes. What goes wrong? They start with a board.</p>
<p>If you&#8217;re not experienced with prototyping, a game board is a bad starting point. A card game game is easier to create because it requires less assets and is faster to balance and iterate. Also, boards restrict character movement and thus have the tendency to make games slower and rounds longer. Think of popular card games and board games and compare the average match duration. It is far easier to build card games where the system escalates from a stable into an extreme state (I am resisting the urge to make a pun about the board leveling the playing field). That means it makes the game shorter, allowing for more iteration in the same time frame. It also makes for a better test setup for your rules because they are tested more intensively for their dynamics.</p>
<p>Another thing I learned through having students fail at assignments: Avoid using dices in your first prototypes. Balanced random makes it too easy to create a good game dynamic. Try to make a game without random first, and introduce dices when you need them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/12/07/game-prototyping-101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Game Thinking</title>
		<link>http://www.altdevblogaday.com/2011/11/28/game-thinking/</link>
		<comments>http://www.altdevblogaday.com/2011/11/28/game-thinking/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 08:58:12 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[#gamedev]]></category>
		<category><![CDATA[Bizdev]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[General Interest]]></category>
		<category><![CDATA[design theory]]></category>
		<category><![CDATA[design thinking]]></category>
		<category><![CDATA[game thinking]]></category>
		<category><![CDATA[gamification]]></category>
		<category><![CDATA[iteration]]></category>
		<category><![CDATA[wicked problems]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=20743</guid>
		<description><![CDATA[<p>I recently attended a talk by a gamification proponent who presented a fragmented and ill structured theory on what gamification can bring to a product. He arrived at the right conclusions, but due to the long and winded road he took there. the audience was generally unwilling to accept the fine finale of his talk. In the end, he dismissed gamification as the surface-scratching marketing tool that it currently is, proposing a focus on &#8220;game thinking&#8221; instead. Because he failed to come up with a convincing definition of that phrase, I thought I should step in and deliver one. Mine is based on &#8220;design thinking&#8221;[1], a term popular in design theory. I&#8217;m quite familiar with design theory because it was the foundation of all our research at the university department I researched, taught and worked at before entering the exciting world of the games industry.</p>
<p><a href="http://www.altdevblogaday.com/2011/11/28/game-thinking/" class="more-link">Read more on Game Thinking&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>I recently attended a talk by a gamification proponent who presented a fragmented and ill structured theory on what gamification can bring to a product. He arrived at the right conclusions, but due to the long and winded road he took there. the audience was generally unwilling to accept the fine finale of his talk. In the end, he dismissed gamification as the surface-scratching marketing tool that it currently is, proposing a focus on &#8220;game thinking&#8221; instead. Because he failed to come up with a convincing definition of that phrase, I thought I should step in and deliver one. Mine is based on &#8220;design thinking&#8221;[1], a term popular in design theory. I&#8217;m quite familiar with design theory because it was the foundation of all our research at the university department I researched, taught and worked at before entering the exciting world of the games industry.</p>
<h1>Design as a Process</h1>
<p>It is an engineer&#8217;s dream to structure the design process of a product into discreet steps leading from idea to finished product. Many disciplines of engineering, be it software engineering, bridge building, or product engineering, shared this dream. Take a problem and solve it by dividing it into sub-problems that can be tackled in succession. The steps are: generate an idea, make a plan, follow the plan, ship. At worst, the product is mistaken as the process, with &#8220;the plan being organized so as to make the structure of the design process reflect the structure of the sub-components of the resulting design product.&#8221;<a href="http://www.archive.org/details/HowDesignersWork-MakingSenseOfAuthenticCognitiveActivity">[2]</a>, which is then called the product-process symmetry.</p>
<p>Yes, the waterfall model is a famous result of this thinking. But there&#8217;s a reason why most game studios utilize agile methods instead of the waterfall model. Games do not lend themselves to this style of strict planning. This is especially true if they are innovative, but even games with a marginal degree of innovation might have development challenges that are difficult to take into account in advance. The same is true for product engineering. I&#8217;m not very familiar with bridge building, so I won&#8217;t talk about that. In design, iteration became the new paradigm, and with it came a plethora of new design and development methods – from rapid prototyping and pair programming to interaction sketching.</p>
<h1>Wicked Problems</h1>
<p>The core of games is interactivity. Games are rules systems that only flourish upon interaction. The dynamics and aesthetics of play is what we design them for. In design thinking, the notion of &#8220;wicked problems&#8221; was introduced to describe those mostly user-centric problems that are so hard to solve in a step-wise problem-solving manner. Rittel and Webber described wicked problems in 1973 as problems where the following list of conditions is met:</p>
<ol>
<li>There is no definitive formulation of a wicked problem.</li>
<li>Wicked problems have no stopping rule.</li>
<li>Solutions to wicked problems are not true-or-false but good-or-bad.</li>
<li>There is no immediate and no ultimate test of a solution to a wicked problem.</li>
<li>Every implemented solution to a wicked problem has consequences.</li>
<li>Wicked problems do not have a well-described set of potential solutions.</li>
<li>Every wicked problem is essentially unique.</li>
<li>Every wicked problem can be considered a symptom of another problem.</li>
<li>The causes of a wicked problem can be explained in numerous ways.</li>
<li>The planner (designer) has no right to be wrong.<a href="http://www.thestudiony.com/ed/bfa/Rittel+Webber+Dilemmas.pdf">[3]</a></li>
</ol>
<p>Think of a game mechanic and you can see how nicely it fits this description. I&#8217;ll give an example. We&#8217;re currently testing out different single-player mechanics in <a href="http://chasing-aurora.com">Chasing Aurora</a>. One of the design challenges we&#8217;re facing is developing physics-based 2D flight for a bird-man. Since flight is your main means of traversing a level and the challenges are platformer-ish, the player has to have a lot of control over movement. On the other hand a lot of the challenges are built on wind-streams that affect your movement. We&#8217;re iterating the flight movement component again and again and again and again to strike the perfect balance between control and being at the mercy of the elements. Now let&#8217;s look at the above list. (1) The description of the problem is informal and incomplete. (2) We will not know it when we built the perfect control scheme just bounce against the fluffy invisible wall of diminishing returns because there is no absolutely (3) right solution to this problems. (4) There isn&#8217;t even a formal test we could apply to test if our solution is perfect. All we got is unreliably human game testers. (5) If we implement a different solution it affects the whole gameplay. (6) There is no point in describing all possible control schemes for character movement, we just need to make it (7) deep, feeling fresh and perfectly fitting to the game as a whole. (8) Reminder: The whole game can be regarded as a wicked problem. Point (9) is impossible to tackle without venturing into philosophy. I leave that as an exercise for the reader. And finally, (10) the game will simply not fulfill the player if we fail.[4]</p>
<p>The reasons why wicked problems are so prevalent in the game development process are many, but the most obvious are:</p>
<ul>
<li>Game development is bound by countless constraints: Genre, technology, player expectation and physiological limits, to name a few. Constraints call for creative solutions.</li>
<li>Interactivity is at the core of games: Nearly every aspect of a game manifests as a dynamic system bound to user interaction. Interactive components always need to be tested with players.</li>
<li>All systems and parts of systems are connected: Health and health packs, health packs and lifting strength, lifting strength and inventory display, inventory display and button mapping, button mapping and device drivers, device drivers and graphics cards, graphics cards and shader versions, shader versions and post-processing FX, post-processing FX and particle systems, particle systems and healing magic, healing magic and health. Solutions to one problem affect a host of other problems and their solutions.</li>
<li>Innovation needs experimental setups: Every innovation is a risk. Despite the ongoing cloning and the prevalence of straight genre works, there&#8217;s a huge amount of innovation in the field.</li>
</ul>
<p>The standard game design and development problem solving toolkit consists of tools to overcome wicked problems: Scrum, prototyping, MDA, game testing from pre-alpha/internal to beta, interaction sketching, even patching and the rampant board game obsession. Tackling wicked problems is key in game design. And we&#8217;re doing it every day.</p>
<h1>We&#8217;ve Already Solved These Problems, Let&#8217;s Tell The Others</h1>
<p>Game development never fell into the product-process symmetry trap in the first place. We&#8217;ve solved a lot of design problems in this industry that other similarly structured areas are still having problems with. And if you look at the current trend of gamification and how horribly designed most of the applications of gamification are, it is clear that the challenge is not only bringing game mechanics to other areas but revising company structures in other industries so that they are able to tackle problems as game design tasks. Hand over the keys instead of opening the doors. To truly gamify a service, processes in the company that run the service have to be adapted. New processes, tools and methods have to be introduced. Just adding a points-based rank system does not do the trick. While restructuring the company, the whole process of user interaction has to be restructured, too. I am no friend of gamification, but if you do it, you better do it whole-heartedly. If you add achievements to a web service, make them as supporting to your design goals as possible (after all, achievements play an important support role in modern gaming), as a prize for risking something, as a tool to foster changing the style of play, rewarding exploration and experimentation, as a means of comparing your progress to other player&#8217;s progress. Awarding points for arbitrary interaction is not gamification and reduces the whole concept to a marketing trend. Structuring interaction dynamics via game mechanics can make products better.</p>
<p>If gamification was about introducing game/design thinking to new areas, it would not feel so much like a marketing stunt. I firmly believe that a lot of products – and their design processes – could profit from the agile design methods we use in game development*. And a lot of interactivity can be rendered more satisfying when it is game-designed.</p>
<p>[1] Lawson, B. (1980): How Designers Think. Third and revised Edition, Architectural Press, Oxford, 1997.<br />
[2] Gedenryd, H. (1998): <a href="http://www.archive.org/details/HowDesignersWork-MakingSenseOfAuthenticCognitiveActivity">How designers work</a>. Ph.D. dissertation, Cognitive Studies Department, Lund University, Sweden.<br />
[3] Rittel, H. &amp; Webber, M. (1973): <a href="http://www.thestudiony.com/ed/bfa/Rittel+Webber+Dilemmas.pdf">Dilemmas in a General Theory of Planning</a>. Policy Sciences, Vol. 4, Elsevier Scientific Publishing Company, Amsterdam.</p>
<p>* If you look at the most successful recent product launches, like the iPhone, and think about how many iterations they went through before being released you can see design thinking in action. Also, I think what sets Apple apart from other companies mostly the fact that they do not release every iteration of a product to the market. It&#8217;s not like they make better hardware than Samsung. Samsung just releases crap mobiles additionally to their great and well thought-out products.</p>
<p>** … and it will not sell, and not have a decent metascore, either.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/11/28/game-thinking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Layers of Depth, Layers of Fun</title>
		<link>http://www.altdevblogaday.com/2011/11/05/layers-of-depth-layers-of-fun/</link>
		<comments>http://www.altdevblogaday.com/2011/11/05/layers-of-depth-layers-of-fun/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 19:40:03 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[General Interest]]></category>
		<category><![CDATA[aesthetics]]></category>
		<category><![CDATA[depth]]></category>
		<category><![CDATA[dynamics]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[layers]]></category>
		<category><![CDATA[mda]]></category>
		<category><![CDATA[mechanics]]></category>
		<category><![CDATA[prototyping]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=19801</guid>
		<description><![CDATA[<p>Next week I&#8217;m going to teach a course on Game Prototyping at a university in Salzburg. It will be a practical introduction of all things you can prototype when making a game – from user interaction to social features, from rulesets to art. I am a huge fan of prototyping out of two reasons. Firstly, I&#8217;m responsible for the production timeline and to a certain degree also for the production budget here at Broken Rules. Prototyping takes the edge off a lot of tasks and generally makes production cheaper simply by making mistakes cheaper. Secondly, I&#8217;ve been teaching various kinds of design<a href="#star">*</a> – from interactive art to interaction design because students need to be taught in ways that enable them to get to action instead of building dream castles. Prototyping is a lot about removing unnecessary complexities and getting to the heart of the matter at hand. The question is what features to distill to a prototype.</p>
<p><a href="http://www.altdevblogaday.com/2011/11/05/layers-of-depth-layers-of-fun/" class="more-link">Read more on Layers of Depth, Layers of Fun&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>Next week I&#8217;m going to teach a course on Game Prototyping at a university in Salzburg. It will be a practical introduction of all things you can prototype when making a game – from user interaction to social features, from rulesets to art. I am a huge fan of prototyping out of two reasons. Firstly, I&#8217;m responsible for the production timeline and to a certain degree also for the production budget here at Broken Rules. Prototyping takes the edge off a lot of tasks and generally makes production cheaper simply by making mistakes cheaper. Secondly, I&#8217;ve been teaching various kinds of design<a href="#star">*</a> – from interactive art to interaction design because students need to be taught in ways that enable them to get to action instead of building dream castles. Prototyping is a lot about removing unnecessary complexities and getting to the heart of the matter at hand. The question is what features to distill to a prototype.</p>
<p>In our current game, <a href="http://chasing-aurora.com">Chasing Aurora</a>, project we&#8217;ve prototyped different gameplay elements, game modes, ways of control your character, graphic styles, level designs, game rules, enemies and timing rules. We will soon also prototype different social interaction methods, asynchronous multiplayer, settings and more enemies. Both of these lists are far from complete. When setting up the design principles for the single player mode we isolated four layers of challenge that we are basing our game design upon:</p>
<ul>
<li>The story layer: Levels can be generated by thinking about the (background) story of the game.</li>
<li>The metaphoric layer: The story conveys a meaning via metaphors. This is the meta-story.</li>
<li>The skill layer: The player will learn how to play the game. His skill might be contested in order to help him develop the physical abilities it takes to complete the game.</li>
<li>The setting layer: Our game plays in the Alps. The game world is always an interesting starting point for challenges.</li>
</ul>
<p>Of course all of these layers are intertwined and connected and each level has to challenge the skill, progress the story, work in the setting, and have a metaphorically interesting proposition, even if it is a simple one. The settings and skill layers lend themselves the most to prototyping. You can model an challenging level in an hour and have it tested out by players. You can model a feature of the setting, e.g. waterfalls or rock slides, in a few hours. Developing a block of story is also fairly simple once the background story is in place. Yet testing it out proves to be a bit more complicated because parts of stories live from the associations and connections to the whole. The metaphoric level is even harder to test because it is closest to the player. Different cultural contexts might make a situation getting read completely different by the player. Ethics is not universal, and neither is body language.</p>
<p>Story, metaphor, skill and setting might form the starting points for our level design, yet the overall game design needs to incorporate even more layers. Every layer has his own depth and the ability to pull the player deeper into the game world. It is this depth &#8211; along all four axes &#8211; that makes the player continue playing. Succeeding to deliver on all of them makes a great game. I could drop hundreds of examples here, but Zelda might be the easiest to prove my point. Most dungeons in Zelda are modeled to teach you the use of a newly acquired ability that manifests as a new weapon or tool in most cases. There are different settings and how to beat one of them is a question of using the right tool in combination with the settings affordances. The story layer in Zelda is quite linear and yet another interpretation of the famous Hero&#8217;s Journey which is in itself packed with witty metaphors.</p>
<p>A slightly different view on these layers of depth is presented in Hunicke et al.&#8217;s seminal <a href="http://www.cs.northwestern.edu/~hunicke/MDA.pdf">MDA Framework</a>. The authors of the paper list eight kinds of aesthetics that create the player experience of a game:</p>
<ol>
<li>Sensation: Game as sense-pleasure</li>
<li>Fantasy: Game as make-believe</li>
<li>Narrative: Game as drama</li>
<li>Challenge: Game as obstacle course</li>
<li>Fellowship: Game as social framework</li>
<li>Discovery: Game as uncharted territory</li>
<li>Expression: Game as self-discovery</li>
<li>Submission: Game as pastime</li>
</ol>
<p>While prototyping can not be used to directly test for one of these, and neither they are suited as generators for good game design, a game designer might still be able to probe for a specific aesthetic by creating a prototype. Our game is strong at challenge and discovery. Most of our prototypes so far have focussed on the challenge aspect of the game because we did not have the assets to support discovery. The single player campaign will lean heavily towards exploration and thus we need to build prototypes focus on the narrow space of risk/reward systems in spatial movement. We need to build environments that feature spatial challenges and rewards. If you read discovery less literal, exploring the main character&#8217;s capabilities is an act of discovery and can be prototyped by focussing on skill-based prototypes.</p>
<p>I think Hunicke&#8217;s list needs an update. The paper even states that the list is incomplete. Limiting social elements of games to fellowship and challenge is complicated in the age of FarmVille and Demon&#8217;s Souls. At the same time, social factors are a strong reason for submitting to a game. Nowadays – or maybe it was always the case – compulsion is the most important kind of &#8220;fun&#8221; in games, and the one most talked about. At the same time, the demise of music games can be read as a games-as-expression bubble. If players want to express themselves they fire up Twitter or Facebook. Most games are ill-suited to help you discovering anything about yourself but some physical abilities. Shadow of the Colossus stands as the exception to this rule. Narrative as story (the game&#8217;s story) builds on make-believe. Narrative as experience (telling other players about your personal journey) is in the discovery/expression corner. Thus I propose a new list of layers of depth in game design:</p>
<ol>
<li>Sensation: Game as sense-pleasure</li>
<li>Challenge: Game as test</li>
<li>Competition: Game as rivalry</li>
<li>Fellowship: Game as event of social connection and alignment to a cultural circle</li>
<li>Exploration: Game as uncharted territory</li>
<li>Drama: Game as make-believe and drama</li>
<li>History: Game as an experience worth telling stories about<a href="#starstar">**</a></li>
<li>Compulsion: Game as force that pulls you in</li>
<li>Metaphor: Game as learning something about you and the world around you</li>
</ol>
<p>Our own starting points for level design – story, metaphor, skill and setting – can be integrated into this broader set of aesthetics. Skill becomes challenge, story becomes drama, and the setting is what allows for exploration. Only metaphor stays as it is. Now it is up to us to effectively start implementing mechanics that foster dynamics that trigger aesthetics. And if we design for enough depth on all these axes, we will be able to pull off the game we set out to make. Do the same. Make a good game.</p>
<p><a name="star">*</a> The late Steve Jobs served this marvelous quote about his definition of design: &#8220;Design is the fundamental soul of a man-made creation that ends up expressing itself in successive outer layers of the product or service&#8221;</p>
<p><a name="starstar">**</a> I&#8217;m not happy with that choice of word</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/11/05/layers-of-depth-layers-of-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Risk and Reward Deluxe</title>
		<link>http://www.altdevblogaday.com/2011/10/10/risk-and-reward-deluxe/</link>
		<comments>http://www.altdevblogaday.com/2011/10/10/risk-and-reward-deluxe/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 07:57:46 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[Game design]]></category>
		<category><![CDATA[General Interest]]></category>
		<category><![CDATA[active reload]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[motions controls]]></category>
		<category><![CDATA[reward]]></category>
		<category><![CDATA[risk]]></category>
		<category><![CDATA[timing]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=18305</guid>
		<description><![CDATA[<p>I recently came across a quote from Cliff Bleszinski (source forgotten) where he contemplated that he&#8217;d rather have other game designers ripping off Gears of War&#8217;s &#8220;active reload&#8221; mechanic than its cover-based shooting. Reading that, I was reminded of an observation that my friend and colleague Peter once had while we were playing Wii Tennis together. We were pretty good players, having played that game daily during our lunch break for months. And we finally understood the finesse, the genius, of the service in Wii Tennis.</p>
<p><a href="http://www.altdevblogaday.com/2011/10/10/risk-and-reward-deluxe/" class="more-link">Read more on Risk and Reward Deluxe&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>I recently came across a quote from Cliff Bleszinski (source forgotten) where he contemplated that he&#8217;d rather have other game designers ripping off Gears of War&#8217;s &#8220;active reload&#8221; mechanic than its cover-based shooting. Reading that, I was reminded of an observation that my friend and colleague Peter once had while we were playing Wii Tennis together. We were pretty good players, having played that game daily during our lunch break for months. And we finally understood the finesse, the genius, of the service in Wii Tennis.</p>
<p>The service in Wii Tennis works like this: First, you waggle the Wii Remote to throw the ball into the air. Then you make a racket swing-like gesture with the remote in order to hit the ball. The higher up the ball, the mightier the service. When you strike the ball in the moment it reached the apex of its flight curve, you serve with maximal speed. Hit it perfect and you play a &#8220;power serve&#8221; that smashes the ball across the court leaving a trail of smoke. Countering a power serve requires perfect timing. After failing to perfect his abilities to reliably play the power serve Peter invented the so-called &#8220;Lulu-service&#8221;. It&#8217;s the on the opposite end of the coolness scale. </p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/10/flightpaths.png"><img src="http://altdevblogaday.com/wp-content/uploads/2011/10/flightpaths.png" alt="" width="351" height="219" class="alignleft size-full wp-image-18306" /></a></p>
<p>While the power serve is played by throwing the ball into the air and hitting it with the bat when it has reached its peak, the lulu-service needs the player to hit the ball moments before the Mii catches the ball again with his hand. Why is the service so important in Wii Tennis? Because the game has an intricately balanced risk-reward scheme. After training for months, we reached a point where our games were brutal hit-and-miss duels. Just like in real tennis, we played serve and volley, yet without much volleying. The thing with the power serve is that it is a high-risk operation. If you succeed, you most likely win the point, because returning it is so hard. Yet if you miss that small window of opportunity and fail, the opponent can strike back by returning a 100% uncatchable ball. It&#8217;s hard to play that return, but we were good enough, back then. The game punishes you severely for failing while rewarding you for taking the risk if you succeed. It would be a classic risk-reward scheme if there weren&#8217;t the lulu-service. Played that way, the ball barely makes it over the net. It touches ground right behind it, making the opponent&#8217;s Mii hurl himself across the field. Since the ball ends up so close to the net and has so little velocity, it bounces just a few inches. The opponent can not play and aggressive return from that angle. If he does so, the ball inevitably ends up in the net. He can either play a lob, handing over the initiative to you again, or try to play a similarly limp cross. It is a good service because in most cases it allows you to remain in the role of the attacker. Also, it is easier to play than the power serve. In the end, it is the second-best service in the game. </p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/10/difficultysuccess.png"><img src="http://altdevblogaday.com/wp-content/uploads/2011/10/difficultysuccess.png" alt="" width="351" height="219" class="alignleft size-full wp-image-18307" /></a></p>
<p>Nintendo&#8217;s genius can be seen in this intricately modeled risk-reward scheme. Above, you find a risk-reward curve of the service in Wii Tennis. You can see how it diverts from a conservative, linear, &#8220;more risk equals more reward&#8221; balance. Additionally to its merits as a means to win a game, the power serve also serves a second purpose: it rewards spectacular play. Gears of War&#8217;s active reload serves the same purpose and is similarly cleverly modeled. The player gets rewarded if he risks to actively reload his gun and gets punished if he fails. Participation is optional, as active reload just shortens – or prolongs, if you fail – the normal reload sequence. Active reload adds depth and playfulness to a dull and repetitive task. I&#8217;m sure similarly structured game mechanics can be found in a lot of games, though they rarely come with the attention to detail that Nintendo put into the simple act of thrashing a ball across the court. Nintendo served risk and reward deluxe.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/10/10/risk-and-reward-deluxe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How We Scrum</title>
		<link>http://www.altdevblogaday.com/2011/09/21/how-we-scrum/</link>
		<comments>http://www.altdevblogaday.com/2011/09/21/how-we-scrum/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 08:21:20 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[Bizdev]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[General Interest]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[design methods]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[scrum]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=16841</guid>
		<description><![CDATA[<p><a href="http://brokenrul.es">We</a>&#8216;re a small indie company of six. Four programmer/designer hybrids, though each of them proficient in other areas too, one artist/designer and one community manager/marketing/designer. Only half of us have ever worked in other game companies and only one of us has ever contributed to a AAA game (though <a href="http://kotaku.com/318044/manhunt-2-credits-forget-to-thank-people-who-made-manhunt-2">uncredited</a>). We have no strong ego running the business, but a very collaborative atmosphere. That&#8217;s why we need a clear methodology for working efficiently. We have a rigid structure for our creative process in order to live the freedom that it gives. The system we&#8217;re using is loosely based on scrum but finely tuned to our situation. I don&#8217;t believe in off-the-shelf design methods. So we tailored our own. Here&#8217;s how we scrum.</p>
<p><a href="http://www.altdevblogaday.com/2011/09/21/how-we-scrum/" class="more-link">Read more on How We Scrum&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p><a href="http://brokenrul.es">We</a>&#8216;re a small indie company of six. Four programmer/designer hybrids, though each of them proficient in other areas too, one artist/designer and one community manager/marketing/designer. Only half of us have ever worked in other game companies and only one of us has ever contributed to a AAA game (though <a href="http://kotaku.com/318044/manhunt-2-credits-forget-to-thank-people-who-made-manhunt-2">uncredited</a>). We have no strong ego running the business, but a very collaborative atmosphere. That&#8217;s why we need a clear methodology for working efficiently. We have a rigid structure for our creative process in order to live the freedom that it gives. The system we&#8217;re using is loosely based on scrum but finely tuned to our situation. I don&#8217;t believe in off-the-shelf design methods. So we tailored our own. Here&#8217;s how we scrum.</p>
<p>We usually work in one or two week sprints. It has been seen that we&#8217;e been doing three week sprints, too, but those were rare. We use <a href="http://basecamphq.com/">Basecamp</a> for the detail-work, i.e. todo lists and discussions. We use Skype for immediate communication. The scrum is a tool for on-site face-to-face collaboration and that&#8217;s why we do it on paper. We scrum on Monday, Tuesday and Thursday. Our core period is from 11am to 3pm. You&#8217;re supposed to be on-site during that hours. If you can&#8217;t make it to the office, you must be available on Skype during that time. The scrum is shortly after 11am, usually around 11:30am, once everyone is in the office or online. We try to timebox it to 15 minutes, but sometimes we fail.</p>
<p>We have no roles in our scrum because otherwise half of the team would have a role which somehow contradicts agility. We know that this will change once we&#8217;re a larger team, but for our current situation, the most important factor is honesty. And if you&#8217;re playing the &#8220;Product Owner&#8221; when you&#8217;re in fact the engine programmer, your honesty is severely compromised right from the start. We don&#8217;t play games, we make them.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/09/scrum-board.png"><img class="alignleft size-large wp-image-16842" src="http://altdevblogaday.com/wp-content/uploads/2011/09/scrum-board-1024x768.png" alt="" width="100%" /></a></p>
<p>Our scrum board has the following layout. There&#8217;s the &#8220;Future&#8221; box on the left. Unassigned and miscellaneous future tasks can be put into that box all the time. They are to be considered in the next sprint. Then there are three bars titled &#8220;Todo&#8221;, &#8220;In Progress&#8221; and &#8220;Check&#8221;. On the right, there are two boxes, &#8220;Done&#8221; and &#8220;Backlog&#8221;. An item is introduced in the &#8220;Future&#8221; box. During the planning of the next sprint, the tasks&#8217; post-its are moved from &#8220;Future&#8221; to &#8220;Todo&#8221;. Also, one ore more people are assigned to the task, one of them officially responsible for the completion. Those are written on the post-it, too. If a task loops over the whole scrum board several times we talk about why that happens and either drop it or reframe it so that it can be completed. During the scrum meeting, each team member picks the task he&#8217;s going to work on for the next one or two days and moves the post-it from &#8220;Todo&#8221; to &#8220;In Progress&#8221;. He also moves all accomplished tasks from &#8220;In Progress&#8221; to either &#8220;Done&#8221; or &#8220;Check&#8221;. Tasks that are to be checked should be tested by a different team member before they are considered &#8220;Done&#8221;. If the task could not be completed and gets postponed to the next sprint, the team member puts it in the &#8220;Backlog&#8221; box. Additionally, there are &#8220;Mail Pending&#8221; post-its that signify an external dependency. Sometimes you can&#8217;t proceed because you&#8217;re waiting for a phone-call or email. Other dependencies are modeled using different post-it colors for the tasks. Red means either that the task is very important or that a yellow task depends on its completion. Green is one hierarchy level lower than yellow.</p>
<p>We&#8217;re currently quite happy with our custom-tailored scrum (or is it even scrum-ban; I&#8217;d say so). But there have been times when things didn&#8217;t work so smooth. We had one person responsible for the scrum meeting for some time who was not interested in that particular position at all. He did the job but the scrum really started to show its strength as a productivity tool once we&#8217;ve made our whole development dependent on it instead of having one guy reminding us that it is time for the scrum. Put bluntly, it&#8217;s necessary that the scrum feels necessary for everybody. We&#8217;ve also experimented with estimating the hours we have to put into a task and writing them down on the post-its in order to get a better feeling on the amount of tasks we can put into a sprint. That worked but always felt awkward to me personally. Currently we&#8217;re not pursuing this route anymore. In my opinion it is much more valuable to have flexibility than predictability. In other words: Postponed tasks and tasks that explode into hour-eating martyrdoms are problematic cases. Keeping an eye out for those is really important. We might experiment with a more abstract system of estimating the workload of a task in the future.</p>
<p>This is how we scrum. As usual, we&#8217;ve broken a lot of rules. I&#8217;m not writing this because I want you to copy our methods. I&#8217;m fairly certain you can ruin a project by doing that. All I want to tell you is that it is a good thing to tailor your production methods to your own needs. How do you scrum?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/09/21/how-we-scrum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning From Indie Studio Successes</title>
		<link>http://www.altdevblogaday.com/2011/08/23/learning-from-indie-studio-successes/</link>
		<comments>http://www.altdevblogaday.com/2011/08/23/learning-from-indie-studio-successes/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 07:37:06 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[#gamedev]]></category>
		<category><![CDATA[Bizdev]]></category>
		<category><![CDATA[General Interest]]></category>
		<category><![CDATA[Angry Birds]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[indie]]></category>
		<category><![CDATA[Minecraft]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=14940</guid>
		<description><![CDATA[<p>I put on the indie entrepreneur hat for the second installment of my series of articles on the future of everything. This time around, &#8220;everything&#8221; is the indie studio. In the <a href="http://altdevblogaday.com/2011/08/08/looking-into-the-future/">first part</a>, &#8220;everything&#8221; were &#8220;games&#8221; as a whole. Take a grain of salt and carefully apply it to my very personal opinions.</p>
<p><a href="http://www.altdevblogaday.com/2011/08/23/learning-from-indie-studio-successes/" class="more-link">Read more on Learning From Indie Studio Successes&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>I put on the indie entrepreneur hat for the second installment of my series of articles on the future of everything. This time around, &#8220;everything&#8221; is the indie studio. In the <a href="http://altdevblogaday.com/2011/08/08/looking-into-the-future/">first part</a>, &#8220;everything&#8221; were &#8220;games&#8221; as a whole. Take a grain of salt and carefully apply it to my very personal opinions.</p>
<h1>Part 2: The New Game Studio</h1>
<p>There has been a disturbing number of success stories in independent gaming in the last years. First there was 2D Boy with World of Goo, then Jonathan Blow&#8217;s Braid came along, then Rovio introduced the whole world to Angry Birds and at last, Mojang made Minecraft &#8211; or the other way around. What do all these success stories have in common? They all (except of Minecraft, where it&#8217;s a bit more complicated) had <a href="http://www.brokenrul.es/blog/?p=793">about the same budgets</a>. Each of them uses a custom engine. All of these games came to many platforms, or are in the process of doing so, extending their shelve life infinitely as they hop from marketplace to marketplace. Plus there&#8217;s one more thing they have in common: The studios that made those games still own the IP&#8217;s of the games.</p>
<p><img alt="" src="http://blogs.ft.com/fttechhub/files/2011/08/minecraft-head-167x222.jpg" class="alignleft" width="167" height="222" /></p>
<h3>Be A Fighter</h3>
<p>If you want to go down the Rovio route, there are a couple of things you can learn from them. One of the most important ones is: <a href="http://startupwebguide.com/2011/07/19/how-angry-birds-saved-rovio/">Make tons of games</a>. They were in the business for 6 years when they released Angry Birds, having released more than 50 &#8211; mostly mobile &#8211; titles. They dared to launch their own IP when the time was right for new IP&#8217;s, i.e. when the App Store was still young. Also, they kept their IP and just sold the distribution rights for the first Angry Birds game to Chillingo. Rovio had their tool chain and in-house tech in place. Once they struck gold, they immediately started building a community around their game, creating a loyal customer base. They were quick in switching the product to a service &#8211; and a brand, drip-feeding their newly created community with fresh content and monetizing their brand by launching spin-offs and selling merchandise. They wisely used their money to bring Angry Birds to each and any platform that pops up, lest an impostor grabs a marketplace with <a href="http://kotaku.com/5829804/fortresscraft-breaks-the-1-million-barrier-on-xbox-live-indie-games">a clone</a>. I&#8217;m also quite sure that they were quick in setting up a legal department, but I don&#8217;t know that for sure. </p>
<p>In short, these are the lessons you can learn from Rovio, or 2D Boy, or Mojang, for that matter:<br />
- Keep control over your IP*<br />
- Build your own tech (<a href="http://blog.wolfire.com/2010/01/Why-you-should-use-OpenGL-and-not-DirectX">based on open platforms</a>)<br />
- Create your own community<br />
- Get agile &amp; hop from platform to platform**<br />
- Have a lawyer</p>
<p>Don&#8217;t take this list as a recipe for success, though. There&#8217;ve been tons of studios that ticked all the boxes and failed. It&#8217;s more a list that tells what most successful indie studios have in common.</p>
<h3>Be A Publisher</h3>
<p>Mojang is another interesting case. They built their fortune on something that started off as <a href="http://www.youtube.com/watch?v=F9t3FREAZ-k">a clone</a> but quickly got into its own and grew far beyond any inspiration. Mojang shares a lot of properties with Rovio. They own their IP, use their own tech, and are experts in creating a community. Mojang <a href="http://www.rockpapershotgun.com/2011/08/18/minecraft-mojang-publish-cobalt/">recently announced</a> the first third-party game they&#8217;re going to publish, <a href="http://www.oxeyegames.com/cobalt/">Cobalt</a>, which is an interesting road to go down once you&#8217;ve outgrown the single-IP stage of a new company. Turning into a publisher might not be the right direction for every independent game producer out there, but if you&#8217;ve got the community, the marketing power, and the understanding of the production process for a game, you might as well publish other indies. </p>
<h3>Build A World</h3>
<p>What Mojang and Rovio have in common is that they have a deep understanding of what constitutes their brands. I&#8217;d love to see them as not regarding their brands as &#8220;brands&#8221; but as &#8220;worlds&#8221; they are building for their players. They know what constitutes the unique style of their game worlds, from the graphical language to the gameplay. And they quickly and convincingly translate that knowledge into new products, be they marketing give-aways or spin-offs. While Rovio walks the Disney road without too much controversy, Mojang has certainly built <a href="http://www.geekosystem.com/notch-bethesda-scrolls-lawsuit/">a strong studio identity</a>. Mojang proves every day that growth does not mean that you&#8217;ve got to compromise your values. And that&#8217;s also part of the world they&#8217;re building.</p>
<p>In my next, and last, article of this short series on the future of game development, I&#8217;m going to look at the future game. See you in two weeks.</p>
<p>* Kellee Santiago of thatgamescompany keeps reminding me that it is not about who owns an IP, but about who has control over an IP.<br />
** Or strike an excellent deal with a big platform holder and grow from there. Depends on your IP, your studio, and your connections.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/08/23/learning-from-indie-studio-successes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking into the Future</title>
		<link>http://www.altdevblogaday.com/2011/08/08/looking-into-the-future/</link>
		<comments>http://www.altdevblogaday.com/2011/08/08/looking-into-the-future/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 10:38:16 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[#gamedev]]></category>
		<category><![CDATA[Bizdev]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[General Interest]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[social]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=13892</guid>
		<description><![CDATA[<p>I&#8217;m not the most experienced and neither the most visionary game developer around. I&#8217;ve started out in the game dev business just 3 years ago. But in those years I&#8217;ve founded a company, merged that company with another company, released four iPhone games and one downloadable console game and brought an existing game to several new distribution platforms. I generally had an exhausting but extremely rewarding time. In my next couple of articles for this beautiful tome of knowledge called #AltDevBlogADay I&#8217;m going to dare to predict the future. New technologies – if you want to call them techs – like Steam, the iPhone and Facebook disruptively introduced new aspects of game development, design, and business. Now we all have to live with social games, flexible pricing structures, gamification, a shorter technology lifecycle, and zero-cost marketing. And with yet another revival of AR. What does that all mean for game design and the games business as a whole? I dare to look ahead. [Grabs crystal ball and stares into it]</p>
<p><a href="http://www.altdevblogaday.com/2011/08/08/looking-into-the-future/" class="more-link">Read more on Looking into the Future&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m not the most experienced and neither the most visionary game developer around. I&#8217;ve started out in the game dev business just 3 years ago. But in those years I&#8217;ve founded a company, merged that company with another company, released four iPhone games and one downloadable console game and brought an existing game to several new distribution platforms. I generally had an exhausting but extremely rewarding time. In my next couple of articles for this beautiful tome of knowledge called #AltDevBlogADay I&#8217;m going to dare to predict the future. New technologies – if you want to call them techs – like Steam, the iPhone and Facebook disruptively introduced new aspects of game development, design, and business. Now we all have to live with social games, flexible pricing structures, gamification, a shorter technology lifecycle, and zero-cost marketing. And with yet another revival of AR. What does that all mean for game design and the games business as a whole? I dare to look ahead. [Grabs crystal ball and stares into it]</p>
<p><a href="http://www.flickr.com/photos/picturepurrfect685/5229656076/" title="Crystal Ball Christmas by Jennuine Captures, on Flickr"><img src="http://farm6.static.flickr.com/5003/5229656076_8a5b4dd341.jpg" width="500" height="349" alt="Crystal Ball Christmas"></a></p>
<h1>Part 1: The future is already here</h1>
<p>William Gibson famously <a href="http://en.wikiquote.org/wiki/William_Gibson">said</a>, &#8220;The future is already here — it&#8217;s just not very evenly distributed&#8221;. Looking at the spectacular successes of some new-born gaming giants should tell us where the future lies. Apple, Zynga, and Mojang are suited best for my case. Lets look at them one by one.</p>
<h3>A New Breed Of Hardware And Software</h3>
<p>Apple has released the iPhone in 2007 and is now the dominant force in mobile and portable gaming. The PSP and the Nintendo DS are still selling well, but they already feel the sting of the iPhone. Looking at the specs of the PlayStation Vita tells how closely Sony is paying attention<a href="#x">*</a>. As I see it, three factors contributed most to the huge success of iPhone gaming: The fast platform iterations, the low level of entry for developers and the great software. Reducing the life cycle of the platform from 4-6 years to 9 months made incremental hardware improvements possible. At the same time, it made hardware sales a viable business for the manufacturer, whereas the PS3 was sold <a href="http://ps3.ign.com/articles/746/746482p1.html">below production costs</a> at launch. Apple established a walled garden for iPhone development, but the wall is significantly lower than in console development. Sony tried to replicate the lower wall with the PlayStation Minis and Microsoft has XNA. While the diminished costs of entry meant that the iPhone marketplace is crowded and full of cheap knock-offs and shovelware, it also enabled a number of startups to print money. The garden&#8217;s wall was lowered even further with of two clever moves by Apple: Having no dedicated dev kits by making each device its own dev kit and releasing easy-to-use free SDK&#8217;s. If you compare XCode to Visual C++ it is not on par in most regards, but it is free and developing for the iPhone is (nearly) as straight-forward as developing for the host machine. ObjectiveC made the wall a bit higher, but most games for the iPhone are programmed in C/C++ anyway. Or at least their game logic is. At the same time, the iTunes store is so seamlessly integrated into the product usage that it feels almost natural to buy software, as opposed to pirating it. Combined with the low prices and the automatic upgrade system, a lot of would-be pirates don&#8217;t bother pirating software on the iPhone. Just like Steam turned pirates into loyal customers by adding additional value, lowering the prices, and offering more convenience than torrents, Apple offers a service that is more comfortable than the gray market, and nearly as cheap.</p>
<h3>Social Is Not A Fad. It&#8217;s A Change Of Lifestyle</h3>
<p>I know a lot of game designers look down at Zynga because their games are hardly revolutionary in terms of gameplay. With most game mechanics indistinguishable from grinding, Zynga&#8217;s games are prime examples of what Nick Yee from Stanford University describes in the following sentences: &#8220;The timing and layering of reward mechanisms in video games train players to derive pleasure from the work that is being done. Video games condition us to work harder, faster, and more efficiently&#8221; (Yee 2006, p. 70). According to Yee, this careful crafting of challenges and rewards can be traced back to behavioral conditioning (see Skinner 1938). The player pays for being turned into a worker, producing, buying and consuming immaterial goods. Yet Zynga&#8217;s games sell like hotcakes. And people <a href="http://terranova.blogs.com/terra_nova/2006/08/in_praise_of_th.html">love that kind of mechanics</a>. Why is that so? I&#8217;m sure part of the reason is that FarmVille perfectly blends into our socially networked surroundings. From its monetization strategy to the marketing, it fits perfectly into the world of today. At the same time, the bite-sized playing sessions fit into contemporary working environments: FarmVille is the Twitter of games<a href="#xx">**</a>.</p>
<h3>The Minimal Viable Product</h3>
<p>Mojang is the developer behind Minecraft. By the time of writing, the game has sold <a href="http://www.minecraft.net/stats.jsp">2,999,785 units</a>, making it the fastest and best selling indie game ever. When Minecraft was first released, it barely deserved to be called an alpha version. It had barely any gameplay but the most important hooks were already in place. Then the beta came along and everything fell into place. Mojang is the most successful proponent of the minimal viable product-approach in video game development. A number of factors contributed to this success. First, Minecraft is a great game. Its sandbox-style open world with physics and endlessly fulfilling grinding fits perfectly into today&#8217;s gaming landscape. And it has pixels the size of voxels. Minecraft takes no learning and is hardly twitch-skill based. Learning Minecraft is playing Minecraft. Playing Minecraft is learning Minecraft. Clay, sand, rock, wood, everything in Minecraft is an abstraction of the real world. The game is social to the bones. <a href="http://www.youtube.com/results?search_query=minecraft&amp;aq=f">Youtube fan-videos</a> and the outspokenness of <a href="http://en.wikipedia.org/wiki/Markus_Persson">Markus &#8220;Notch&#8221; Persson</a>, its creator, are perfect marketing tools. The success of Minecraft was neither an accident, nor planned.</p>
<p>Minecraft is but the best example of recent games that launched as minimal viable products, hardly in shape for prime-time, and turned into successes later. Yet neither the production methods nor the studio structures of most game developers allow for this way of production. It takes a new approach to game design and development, which is natural to some younger and more agile studios. It requires versatile technology and business models. And there&#8217;s hardly any knowledge about how a structured design approach for a minimal viable product looks and how those games can stand out in the sea of shovelware within the low walls of the new gardens.</p>
<h3>Looking Ahead</h3>
<p>I will continue this series of articles next time, where I&#8217;ll write about the new game studio and what the changes to game development outlined here mean to us as game developers. I&#8217;m no expert in any of this, just making up a plan as I go along. So feel free to bash me and tell me I&#8217;m wrong. I appreciate any and all critique.</p>
<p><a name="x">*</a> Also, I am personally delighted that we&#8217;re going to have RISC instruction sets on all interesting platforms in the near future. By the way, Apple was the first company to put a RISC processor into a <a href="http://en.wikipedia.org/wiki/Bandai_Pippin">gaming machine</a> (if you don&#8217;t count the Archimedes/BBC Master).</p>
<p><a name="xx">**</a> An important implication of social networks is the redefinition of privacy. It was Google who realized that this is where Facebook is occasionally too ruthless. I&#8217;d bet that features a la Google+&#8217;s circles will become a familiar feature of many social platforms.</p>
<h3>References</h3>
<p>- Skinner, B. F. 1938, The behavior of organisms. Appleton-Century-Crofts, New York.<br />
- Yee, N. 2006, &#8220;The Labor of Fun &#8211; How Video Games Blur the Boundaries of Work and Play&#8221;, Games and Culture, vol. 1, issue 1, pp. 68-71.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/08/08/looking-into-the-future/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building your GUI with Gwen</title>
		<link>http://www.altdevblogaday.com/2011/07/26/building-your-gui-with-gwen/</link>
		<comments>http://www.altdevblogaday.com/2011/07/26/building-your-gui-with-gwen/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 05:48:20 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[#gamedev]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[UI and UX]]></category>
		<category><![CDATA[bindings]]></category>
		<category><![CDATA[ginkgo]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[gwen]]></category>
		<category><![CDATA[properties]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=12470</guid>
		<description><![CDATA[<p>I&#8217;ve talked about <a href="http://altdevblogaday.com/2011/06/28/the-quest-for-the-ginkgo-gui/">different GUI solutions</a> and <a href="http://altdevblogaday.com/2011/07/08/the-quest-for-the-ginkgo-gui-2-going-for-gwen/">how I started to integrate</a> the <a href="http://code.google.com/p/gwen/">Gwen GUI library by Garry Newman</a> into our engine, Ginkgo, in order to power the live editor. The live editor is a tool to build and tweak levels of our upcoming game. It has access to all runtime data of the engine. In order to manage the connections between the data and the GUI, I chose the good old <a href="http://en.wikipedia.org/wiki/Model–view–controller">Model-View-Controller</a> pattern. Here&#8217;s how I&#8217;m using Gwen in our project.</p>
<p><a href="http://www.altdevblogaday.com/2011/07/26/building-your-gui-with-gwen/" class="more-link">Read more on Building your GUI with Gwen&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve talked about <a href="http://altdevblogaday.com/2011/06/28/the-quest-for-the-ginkgo-gui/">different GUI solutions</a> and <a href="http://altdevblogaday.com/2011/07/08/the-quest-for-the-ginkgo-gui-2-going-for-gwen/">how I started to integrate</a> the <a href="http://code.google.com/p/gwen/">Gwen GUI library by Garry Newman</a> into our engine, Ginkgo, in order to power the live editor. The live editor is a tool to build and tweak levels of our upcoming game. It has access to all runtime data of the engine. In order to manage the connections between the data and the GUI, I chose the good old <a href="http://en.wikipedia.org/wiki/Model–view–controller">Model-View-Controller</a> pattern. Here&#8217;s how I&#8217;m using Gwen in our project.</p>
<h2>The Data To Tweak</h2>
<p><a href="http://altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/">Ginkgo</a> is a component-based engine. Game objects, which we call nodes, have basic geometric data. But their functionality is located in their components. Components are classes that wrap one specific aspect of a game object. They are coded in C++ and we use a Python-based Preprocessor-like script to generate their data definitions, which also include default values for all properties. Properties are (soft-)typed &#8220;data fields&#8221; of components. Some properties can be set via writing a specific piece of data into a specific memory location, made slightly safer than it sounds by our Property class. Some properties require accessor functions to be called. Since we do not have an inheritance system, but an aggregation system, we needed a solution to replace the comfort of the former while maintaining the flexibility of the latter. Thus we implemented a template solution; Template as &#8220;pattern&#8221;, not as &#8220;STL&#8221;. A template defines a game object, a required set of components and the default values of all the data of these components. There can be game objects without templates, but we currently don&#8217;t support runtime generation of game objects without templates. Each game object can override its template&#8217;s properties. Thus we end up with the following hierarchy of initialization of all properties. Higher levels override lower levels in the hierarchy shown in this graphics:</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/07/Templates.png"><img src="http://altdevblogaday.com/wp-content/uploads/2011/07/Templates.png" alt="" width="425" height="162" class="aligncenter size-full wp-image-12473" /></a></p>
<h2>Data Bindings</h2>
<p>We use the above-mentioned properties to establish rtti-like access to game objects. Reading and writing properties is implemented via a delegation mechanism. Well, actually there are a couple of different ways to read/write data values to/from objects and only the most slow &amp; uncomfortable one is based on delegates. Though you won&#8217;t notice that from the &#8220;user&#8221; side anyway. The same mechanism is used to implement editor access. Soft-typed access, as I&#8217;m used to call it, lends itself to data bindings for GUI&#8217;s. The functionality &mdash; apart from a number of convenience functions to allow for faster browsing of scene objects &mdash; is that there is a property tree that reflects a game object. The nodes of the tree are the game object hierarchy (game objects can be inside other game objects to group them) and the components. The properties are at the leaves of the tree. The Controller of the MVC structure I implemented manages the tree. The leaves got their own controllers that manage the binding between a property and the text field that allows editing it. The clue is that you set the runtime value as well as the definition value of the property. And you can edit a game objects&#8217;s template with a similar tree widget. As a level designer, you have full access to the value hierarchy. This is especially important in a live editor, where runtime evens might override the runtime data of a property. We use the per-class property definitions when creating the game object. When the engine is compiled for edit mode, the same definition is used to store the values that get written back into the property&#8217;s XML definition. These definitions are stored on save, together with the edited templates. Bear in mind that the original definitions are per class. We store an extra definition structure per instance for editing. Runtime values are not preserved, so as not to overwrite startup values. I.e. you want your objects to spawn in the right place, even if they moved during gameplay.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/07/TemplateSaving.png"><img src="http://altdevblogaday.com/wp-content/uploads/2011/07/TemplateSaving.png" alt="" width="318" height="120" class="aligncenter size-full wp-image-12472" /></a></p>
<h2>Extending the Library</h2>
<p>At first, I thought Gwen is a well rounded library. While most nuts and bolts are in place, it still lacks some features I needed. Gwen comes with a property editor, but there are just text fields, number fields and a color picker that does not support alpha. All our data descriptions are string-based, so we&#8217;re currently using the text field for all the editing. Later, I will have to implement at least a pop up list, an alpha-supporting color picker, and a clamping-supporting number box. In order to make the editor more comfortable to use, I wanted the property fields to display the definition value when you mouse over them. Usually they show the current runtime value. And there were other little changes I had to make to the text field-based property editor fields, e.g. exiting them without entering the data by pressing escape, or rewire them so that they only fire change events when the user presses enter. Per default, the event is fired once the user presses any key.</p>
<p>Here&#8217;s how I&#8217;ve extended Gwen to suit my needs:<br />
- I&#8217;ve added an <code>Event::Caller</code> called onEntered to the class <code>Gwen::Controls::Property::Base</code>. It is called when <code>OnTextEntered()</code> is called by the underlying text box. Since continuous update triggered some cases where the value was incorrect (and immediately set back to the last valid value) I had to add this event to the library itself.<br />
- I&#8217;ve added an <code>OnKeyEscape()</code> function to the <code>Gwen::Controls::TextBox</code> class that blurs (de-focusses) the text box.<br />
- My Property Field Controllers are hooked up to the <code>Gwen::Controls::Property::Base</code> subclasses via OnPropertyValueChanged. This event is fired by Gwen, if the user edits the property. It is responsible for writing the new value into the property data field as well as the property&#8217;s definition. If a template is edited, the same event writes into the template definition. Property definitions and template definitions are saved. No API changes necessary.<br />
- The above-mentioned behavior of showing the default value on hover is added via the <code>Gwen::Controls::Property::Base</code>&#8216;s onHover <code>Event::Caller</code>. No API changes necessary.<br />
- I&#8217;m adding checkboxes to mark if a template default was overridden via the GUI by attaching them to the <code>Gwen::Controls::Property::Base</code>. Since scroll bars were overlapping with checkboxes I had to adapt the rendering a little bit. I also had to add rendering for different checkboxes. A simple subclass to the existing checkbox does the job nicely.</p>
<p>I know that there are as many ways to architect a game engine as there are stars in the sky. Ours might not be the most performant one, and neither is it the most comfortable to work with. But with Gwen, we&#8217;ve found a GUI library that allows for a cross-platform live-editor that does not explode our code base and is simple enough to be portable to future platforms. It&#8217;s not the solution to every GUI problem we&#8217;ll ever face, but it proved to be a versatile, easy to integrate, and well behaved library. Now, if I manage to get rid of all the dynamic_casts I could even use it in deployment builds.</p>
<p><em>P.S.: Sorry that I did not include source code. My code is so intertwined with the property system that I&#8217;d have to add the source of that, too, which would explode this post.<br />
P.P.S.: We&#8217;re currently using good old XML as a data format. But its well encapsulated and we&#8217;re planning to enter the 21st century by totally going for JSON in the near future.<br />
P.P.P.S.: This posting concludes my series about Gwen. I feel like I should write about a less technical topic next.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/07/26/building-your-gui-with-gwen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Quest for the Ginkgo GUI (2): Going for Gwen</title>
		<link>http://www.altdevblogaday.com/2011/07/08/the-quest-for-the-ginkgo-gui-2-going-for-gwen/</link>
		<comments>http://www.altdevblogaday.com/2011/07/08/the-quest-for-the-ginkgo-gui-2-going-for-gwen/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 14:49:11 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[#gamedev]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[UI and UX]]></category>
		<category><![CDATA[ginkgo]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[gwen]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=10815</guid>
		<description><![CDATA[<p><a href="http://altdevblogaday.com/2011/06/28/the-quest-for-the-ginkgo-gui/">Last week</a> I&#8217;ve written about OpenGL GUIs and gave you an overview of what&#8217;s out there. Right after finishing my posting I decided to integrate <a href="http://www.garry.tv/2011/01/13/gwen-minimal-gui-toolkit/">Gwen</a> into our engine. Why Gwen? It is sleek, highly configurable, stable, well maintained, and close to production-ready out of the box. It does not throw exceptions and relies on simple data structures (if you consider STL as simple). It is quite well written and the code is easy to understand. And, yes, there is code to read. The library is open source and comes with an MIT license attached. Actually there are only two downsides: Gwen is not an immediate mode GUI and I would have loved to check that new paradigm out and Gwen uses dynamic_cast and thus requires RTTI. I&#8217;ll try to iron that out later on and will post my progress here. This time I&#8217;ll focus on how you hook up Gwen with your tech by telling you about how I hooked her up with *my* tech. There&#8217;s one more downside to Gwen: There&#8217;s hardly any documentation.</p>
<p><a href="http://www.altdevblogaday.com/2011/07/08/the-quest-for-the-ginkgo-gui-2-going-for-gwen/" class="more-link">Read more on The Quest for the Ginkgo GUI (2): Going for Gwen&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p><a href="http://altdevblogaday.com/2011/06/28/the-quest-for-the-ginkgo-gui/">Last week</a> I&#8217;ve written about OpenGL GUIs and gave you an overview of what&#8217;s out there. Right after finishing my posting I decided to integrate <a href="http://www.garry.tv/2011/01/13/gwen-minimal-gui-toolkit/">Gwen</a> into our engine. Why Gwen? It is sleek, highly configurable, stable, well maintained, and close to production-ready out of the box. It does not throw exceptions and relies on simple data structures (if you consider STL as simple). It is quite well written and the code is easy to understand. And, yes, there is code to read. The library is open source and comes with an MIT license attached. Actually there are only two downsides: Gwen is not an immediate mode GUI and I would have loved to check that new paradigm out and Gwen uses dynamic_cast and thus requires RTTI. I&#8217;ll try to iron that out later on and will post my progress here. This time I&#8217;ll focus on how you hook up Gwen with your tech by telling you about how I hooked her up with *my* tech. There&#8217;s one more downside to Gwen: There&#8217;s hardly any documentation.</p>
<h2>Finding Gwen</h2>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/07/GwenLogo.png"><img src="http://altdevblogaday.com/wp-content/uploads/2011/07/GwenLogo.png" alt="" width="128" height="128" class="alignleft size-full wp-image-10816" /></a>The Gwen project is currently hosted on <a href="http://code.google.com/p/gwen/">Google Code</a>. The main community forum seems to be on <a href="http://www.facepunch.com/forums/376-GWEN-Lightweight-GUI-Widget-library">Facepunch</a> where you can also meet Garry Newman (of Garry&#8217;s Mod fame), who wrote the library. On the Google Code site there&#8217;s a <a href="http://code.google.com/p/gwen/wiki/CustomRenderer">handy guide to hooking up your own renderer</a> with Gwen. Out of the box, Gwen comes with OpenGL, DirectX9, GDI and SFML renderers. You can use those by instantiating the renderer and you should be fine. Gwen also includes input handlers for SDL, SFML and Windows. We&#8217;re using OpenGL and SFML for Ginkgo, so there was not too much work to do. Input handling worked out of the box. I just had to adapt the focus handling a little bit. See below for details. The rendering was also pretty much ready to use, but I wanted to hook up our own resource manager and font renderer rather than loading textures and fonts directly. For now, Gwen just renders in every frame after the game. Since we&#8217;re building a 2D engine, draw order equals depth and Gwen thus always stays on top of things.</p>
<h2>Taming Gwen</h2>
<p>In order to write a custom renderer for Gwen it is best to copy or inherit from one of the included renderers and just replace the functions that you need to. In my case, I had to provide the following functions:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> Ginkgo<span style="color: #008080;">::</span><span style="color: #007788;">Begin</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> Ginkgo<span style="color: #008080;">::</span><span style="color: #007788;">End</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> LoadTexture<span style="color: #008000;">&#40;</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Texture</span><span style="color: #000040;">*</span> pTexture <span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> FreeTexture<span style="color: #008000;">&#40;</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Texture</span><span style="color: #000040;">*</span> pTexture <span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> LoadFont<span style="color: #008000;">&#40;</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Font</span><span style="color: #000040;">*</span> pFont <span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> FreeFont<span style="color: #008000;">&#40;</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Font</span><span style="color: #000040;">*</span> pFont <span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> RenderText<span style="color: #008000;">&#40;</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Font</span><span style="color: #000040;">*</span> pFont, Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Point</span> pos, <span style="color: #0000ff;">const</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">UnicodeString</span><span style="color: #000040;">&amp;</span> text <span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">virtual</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Point</span> MeasureText<span style="color: #008000;">&#40;</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Font</span><span style="color: #000040;">*</span> pFont, <span style="color: #0000ff;">const</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">UnicodeString</span><span style="color: #000040;">&amp;</span> text <span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>Begin is called before any rendering takes place. Set up your projection and model view matrices as well as a pixel-exact viewport in this function. You can pop everything back to normal in the corresponding End() function. Load texture should load a texture via your resource manager. Fill out the struct Gwen::Texture and return it. You can save a pointer to your engine&#8217;s texture class in the data field of Gwen::Texture. Here&#8217;s how I implemented it:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> Ginkgo<span style="color: #008080;">::</span><span style="color: #007788;">LoadTexture</span><span style="color: #008000;">&#40;</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Texture</span><span style="color: #000040;">*</span> pTexture <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	GIN<span style="color: #008080;">::</span><span style="color: #007788;">Texture</span> <span style="color: #000040;">*</span>tex <span style="color: #000080;">=</span> GIN<span style="color: #008080;">::</span><span style="color: #007788;">TextureManager</span><span style="color: #008080;">::</span><span style="color: #007788;">instance</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>.<span style="color: #007788;">get</span><span style="color: #008000;">&#40;</span>GIN<span style="color: #008080;">::</span><span style="color: #007788;">FixedSymbolize</span><span style="color: #008000;">&#40;</span>pTexture<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>name.<span style="color: #007788;">Get</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>.<span style="color: #007788;">c_str</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	pTexture<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>width <span style="color: #000080;">=</span> tex<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>width<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	pTexture<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>height <span style="color: #000080;">=</span> tex<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>height<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	pTexture<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>data <span style="color: #000080;">=</span> tex<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>LoadFont does the same for fonts. RenderText and MeasureText both depend on your engine&#8217;s font rendering and should be implemented accordingly. We&#8217;re using a custom bitmap font renderer in Ginkgo, that can either write into pre-allocated interleaved arrays for per-vertex information and indices or return non-interleaved arrays for vertices, indices and texture coordinates. When I connect Gwen to our render manager (possibly the topic of one of my next posts) I&#8217;ll use the interleaved method. For now, I just have the font renderer allocate the data for me. Gwen is quite cleverly implemented. It caches rendering information and flushes the cache when it reaches a certain size and after it finished rendering. In order to properly fit your own rendering between Gwen&#8217;s cached vertex rendering you must Flush() before you render on your own.</p>
<p>One function that needs a little explanation is Translate(Gwen::Rect &amp;rect), which is found all over the place in the renderers. Translate translates and scales the supplied rectangle and is the primary method for placing objects in Gwen. If you add your own rendering functions, be sure to Translate() all coordinates.</p>
<p>Make sure you load the default skin and at least one font before anything else. Set the appropriate values via SetDefaultFont and  Init&#8217;s parameter of the skin. Here&#8217;s my setup function for the GwenManager. The texture &#8220;defaultSkin&#8221; and the font &#8220;editorFont&#8221; are both loaded in advanced.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cpp" style="font-family:monospace;">GwenManager<span style="color: #008080;">::</span><span style="color: #007788;">init</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	_gRenderer <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Renderer</span><span style="color: #008080;">::</span><span style="color: #007788;">Ginkgo</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	_gSkin <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Skin</span><span style="color: #008080;">::</span><span style="color: #007788;">TexturedBase</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	_gSkin<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>SetRender<span style="color: #008000;">&#40;</span> _gRenderer <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	_gSkin<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>Init<span style="color: #008000;">&#40;</span>L<span style="color: #FF0000;">&quot;defaultSkin&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	_gSkin<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>SetDefaultFont<span style="color: #008000;">&#40;</span>L<span style="color: #FF0000;">&quot;editorFont&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	V2f contextSize <span style="color: #000080;">=</span> RenderContext<span style="color: #008080;">::</span><span style="color: #007788;">instance</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>.<span style="color: #007788;">getDimensions</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	_gCanvas <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Controls</span><span style="color: #008080;">::</span><span style="color: #007788;">Canvas</span><span style="color: #008000;">&#40;</span> _gSkin <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	_gCanvas<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>SetSize<span style="color: #008000;">&#40;</span> contextSize.<span style="color: #007788;">x</span>, contextSize.<span style="color: #007788;">y</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	_gCanvas<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>SetDrawBackground<span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">false</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	_gInput <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> Gwen<span style="color: #008080;">::</span><span style="color: #007788;">Input</span><span style="color: #008080;">::</span><span style="color: #007788;">SFML</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	_gInput<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>Initialize<span style="color: #008000;">&#40;</span> _gCanvas <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>With this information, <a href="http://code.google.com/p/gwen/wiki/CustomRenderer">and the tutorial</a>, you should be able to integrate Gwen into your engine. I don&#8217;t regret choosing this GUI so far. Attaching events is a bit awkward, but I&#8217;ll come to that next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/07/08/the-quest-for-the-ginkgo-gui-2-going-for-gwen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Quest for the Ginkgo GUI</title>
		<link>http://www.altdevblogaday.com/2011/06/28/the-quest-for-the-ginkgo-gui/</link>
		<comments>http://www.altdevblogaday.com/2011/06/28/the-quest-for-the-ginkgo-gui/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 18:27:49 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
				<category><![CDATA[#gamedev]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[UI and UX]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[level editor]]></category>
		<category><![CDATA[live editing]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[sockets]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=9894</guid>
		<description><![CDATA[<p>This post is part one of a short series of posts about my progress in searching a viable GUI solution for our in-game/live editor. It is live coverage of my research and implementation. I welcome any and all feedback.</p>
<p><a href="http://www.altdevblogaday.com/2011/06/28/the-quest-for-the-ginkgo-gui/" class="more-link">Read more on The Quest for the Ginkgo GUI&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>This post is part one of a short series of posts about my progress in searching a viable GUI solution for our in-game/live editor. It is live coverage of my research and implementation. I welcome any and all feedback.</p>
<p>We&#8217;ve integrated live-editing into <a href="http://altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/">Ginkgo</a> some time ago by hooking up our component system and <a href="http://www.antisphere.com/Wiki/tools:anttweakbar">AntTweakBar</a>. Now that the system has outgrown what AntTweakBar has on offer, I&#8217;ve started the epic quest of finding a suitable OpenGL-based GUI solution. Our requirements are straight-forward:</p>
<ul>
<li>Platform independence (i.e. Windows, OSX, possibly Linux and maybe even iOS)</li>
<li>Unicode support</li>
<li>Simple skinning</li>
<li>Either scriptable or easy to abstract</li>
<li>Copy&amp;paste and Undo supported, or easy to add</li>
</ul>
<p>I&#8217;ve spent the last two months on and off evaluating GUI libraries and toolkits in order to find the perfect one. Sadly, all of them have proven to have their downsides. Let me summarize what I&#8217;ve found out so far.</p>
<div id="attachment_9896" class="wp-caption alignnone" style="width: 310px"><a href="http://altdevblogaday.com/wp-content/uploads/2011/06/GUIQuest01.png"><img src="http://altdevblogaday.com/wp-content/uploads/2011/06/GUIQuest01-300x181.png" alt="" width="300" height="181" class="size-medium wp-image-9896" /></a><p class="wp-caption-text">A failed experiment but you can see AntTweakBar in the top right corner.</p></div>
<h2>What&#8217;s Out There</h2>
<p>Of course I started my research by looking at projects that already have a working live editor and trying to find out what tools they&#8217;re using. <a href="http://blog.wolfire.com/2009/07/a-webkit-primer-part-1/">Wolfire Games</a> are fans of <a href="http://awesomium.com/">Awesomium</a>, a custom version/wrapping of Apple&#8217;s <a href="http://www.webkit.org/">WebKit</a> (which started out as a branch of KHTML of KDE fame). There&#8217;s also an open source BSD-licensed equivalent to Awesomium called <a href="http://berkelium.org/">Berkelium</a> that uses Google&#8217;s Chromium (itself a modified WebKit, as far as I can tell) instead. Both offer the benefit of being easy to skin and script since they are windowless browsers rendering HTML and executing JavaScript. On the downside, they are pretty big, adding 80MB of foreign code to your project. Since we&#8217;re eager to keep control over our source code and would love to maintain portability, even for the in-game editor, both of those sound like a less than perfect solution for us. Of course, one could substitute Chromium/WebKit with EA&#8217;s open sourced portable WebKit, but that looks like a major engineering task while all I wanted was a window with some sliders and buttons.</p>
<p>A somewhat similar solution two the above is <a href="http://librocket.com/">libRocket</a>, the poor man&#8217;s ScaleForm. It&#8217;s a freshly implemented wrapper for a subset of XML that approximates a subset of HTML. In other words: You can build your GUI in HTML and the library is less than 80MB large. Sadly, I found it unnecessarily difficult to get the library running and it is more suited for in-game GUIs than for procedurally generated editor panes.</p>
<p>On the other side of the spectrum lies Capcom Game Studio Vancouver&#8217;s tool chain for Dead Rising 2 which they explained in great detail over at <a href="http://www.gamasutra.com/view/feature/6329/the_tale_of_the_tools_that_made_.php">Gamasutra</a>. Incidentally their architecture greatly reminds me of <a href="http://puredata.info/">Pure Data</a>, the open source audio programming language / live instrument I used to work on years ago. You&#8217;ve got a server – the game, the audio engine, … – and a client GUI that connects to the server. All communication between the two goes over sockets. The upside of this approach is that you can live-edit your game even on a console, with the editor running on your workstation. The downside is that this approach is less suitable for in-game editing (where the editor lives in a window in your game context). Every coin has two sides.</p>
<p>Apart from these two there are numerous GUI libraries out there of varying quality and simplicity. CEGUI seems behind the curve nowadays, with <a href="http://sol.gfxile.net/imgui/">&#8220;immediate mode&#8221;</a> interfaces getting en vogue. Yet, IMGUI and its cousins are good for in-game displays but less suitable for level editors. <a href="http://code.google.com/p/gwen/">Gwen</a> and <a href="http://guichan.sourceforge.net/wiki/index.php/Main_Page">guichan</a> are two packages of straight and simple C++ libraries I&#8217;ve recently had a look at.</p>
<h2>A Quick Rundown Of What I&#8217;ve Found So Far</h2>
<p>I&#8217;ve looked at a number of GUI libraries and attached a couple of them to our renderer – or at least configured their OpenGL rendering and hooked them up with our resource manager. Here&#8217;s a quick rundown of the pros and cons of those libraries:</p>
<ul>
<li><a href="http://www.antisphere.com/Wiki/tools:anttweakbar">AntTweakBar</a>: Perfectly suited for live-tweaking values. I&#8217;ve rarely seen source code as dense. Reminds me of Pearl more than of C++. Due to that it is very hard to extend and not suited for anything else but tweaking strongly hierarchically displayed data systems.</li>
<li><a href="http://awesomium.com">Awesomium</a>: A comfortable WebKit-based package for OSX and Windows. Closed source, unless you pay $$$. Can&#8217;t say how hard it would be to port it to Linux and/or consoles. 80MB large, which is hefty for a downloadable game. Easy to script the GUI in HTML5 and JavaScript. Simple skinning through CSS.</li>
<li><a href="http://berkelium.org">Berkelium</a>: Same as Awesomium plus Open Source. Linux support available, yet similarly unfathomably hard to port.</li>
<li><a href="http://librocket.com">libRocket</a>: Does it&#8217;s own rendering but there&#8217;s not JavaScript support. I found it impossible to hook the system up with our resource system. But it sounds intriguing. Simple skinning with CSS. Lively community.</li>
<li><a href="http://qt.nokia.com/products/">Qt</a>: Replaces your application framework like so many good tools out there. Visual designer available. Lively community. All bells and whistles, but we&#8217;ve built our game around the easily substitutable and portable SFML instead.</li>
<li><a href="http://developer.apple.com/technologies/mac/cocoa.html">Cocoa</a>: OSX-only but, boy this library is good. Visual editor, beautiful and well working widgets, easy to integrate bindings. Object C-based and closed-source, so importable to other platforms.</li>
<li><a href="http://en.wikipedia.org/wiki/Microsoft_Foundation_Class_Library">MFC</a>: Insert random joke here.</li>
<li><a href="http://guichan.sourceforge.net/wiki/index.php/Main_Page">guichan</a>: A small and portable GUI lib. Makes heavy use of exceptions but features quite good code quality. Widget set is rather small and there&#8217;s no copy&amp;paste or undo management.</li>
<li><a href="http://code.google.com/p/gwen/">Gwen</a>: Like guichan, Gwen is a straight C++ GUI lib. It does support copy&amp;paste and does not require exceptions. Very good code quality from what I can tell. Made by the guys who make Garry&#8217;s Mod.</li>
<li><a href="http://wiki.python.org/moin/TkInter">Tkinter</a>: The standard python GUI. While the ugly standard flow layout might not be the perfect fit for everyone, scripting a GUI is the only viable replacement for a visual GUI editor.</li>
</ul>
<div id="attachment_9900" class="wp-caption alignnone" style="width: 310px"><a href="http://altdevblogaday.com/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-8.25.28-PM.png"><img src="http://altdevblogaday.com/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-8.25.28-PM-300x178.png" alt="" width="300" height="178" class="size-medium wp-image-9900" /></a><p class="wp-caption-text">Browsing my object hierarchy over telnet.</p></div>
<h2>What I&#8217;m Doing Next</h2>
<p>This week and the coming week I&#8217;ll implement a socket-based interface to our game engine. Then I&#8217;ll design a GUI that hooks up with that. What I&#8217;m planning is more of a browser than a full-fledged level editor. That way I hope to maintain the live-editing features of AntTweakBar but make everything far easier to access. I&#8217;ll keep you covered how that goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/06/28/the-quest-for-the-ginkgo-gui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Living With Game Reviews</title>
		<link>http://www.altdevblogaday.com/2011/06/08/living-with-game-reviews/</link>
		<comments>http://www.altdevblogaday.com/2011/06/08/living-with-game-reviews/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 08:46:36 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=7897</guid>
		<description><![CDATA[<p><a href="http://sinned2bsaved.deviantart.com/art/Zero-Punctuation-Blub-Blub-186435910"><img src="http://altdevblogaday.com/wp-content/uploads/2011/06/zero_punctuation_blub_blub_by_sinned2bsaved-d32zyva-300x168.png" alt="" class="aligncenter wp-image-7900" /></a></p>
<blockquote><p>I&#8217;ve been writing path finding algorithms, balanced trees and motion blur shaders for the past 3 years and all I got was a lousy 76% (Anonymous game developer)</p></blockquote>
<p>All of us have a different attitude towards game reviews. Reviews tend to be one-sided and unfair, sometimes even irresponsible. They treat your game like any other game, disregarding the fact that your own game is work of love and hard labour whereas the other games were just quickly mashed together in Unity. They don&#8217;t see the effort that went into the game, just the outcome. How unfair. Additionally, most of the time they culminate in a numerical score that does a lousy job in quantifying what you&#8217;ve been up to for the last 3 years. The world is different for AAA than for indie games (again!). Where there&#8217;s a dedicated marketing team for AAA games, most indie studios have to manage publicity themselves, meaning that reviews are even more personal. In this #AltDevBlogADay posting I&#8217;d like to comment on game criticism, as you cannot deny that it is one of the many forces that shape game design.</p>
<p><a href="http://www.altdevblogaday.com/2011/06/08/living-with-game-reviews/" class="more-link">Read more on Living With Game Reviews&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p><a href="http://sinned2bsaved.deviantart.com/art/Zero-Punctuation-Blub-Blub-186435910"><img src="http://altdevblogaday.com/wp-content/uploads/2011/06/zero_punctuation_blub_blub_by_sinned2bsaved-d32zyva-300x168.png" alt="" class="aligncenter wp-image-7900" /></a></p>
<blockquote><p>I&#8217;ve been writing path finding algorithms, balanced trees and motion blur shaders for the past 3 years and all I got was a lousy 76% (Anonymous game developer)</p></blockquote>
<p>All of us have a different attitude towards game reviews. Reviews tend to be one-sided and unfair, sometimes even irresponsible. They treat your game like any other game, disregarding the fact that your own game is work of love and hard labour whereas the other games were just quickly mashed together in Unity. They don&#8217;t see the effort that went into the game, just the outcome. How unfair. Additionally, most of the time they culminate in a numerical score that does a lousy job in quantifying what you&#8217;ve been up to for the last 3 years. The world is different for AAA than for indie games (again!). Where there&#8217;s a dedicated marketing team for AAA games, most indie studios have to manage publicity themselves, meaning that reviews are even more personal. In this #AltDevBlogADay posting I&#8217;d like to comment on game criticism, as you cannot deny that it is one of the many forces that shape game design.</p>
<h2>Side Quest: Personal Experience</h2>
<p>I&#8217;ve been reading reviews of my own games for the past years and I was startled – even shocked – by some of them. The more abstract my games were, the more interesting the ideas reviewers had about how they work. In the beginning of my game development life I tried desperately to learn from reviews. Then I shot myself in the knee by issuing a sequel to a game that tried to repair everything that needed improvement according to reviewers and players. From that point on I decided that I won&#8217;t listen to complaints in reviews anymore. I tend to avoid them altogether, nowadays, except when I know the journalist.</p>
<h2>Reviewers Are People, Too</h2>
<p>One of the key facts that I&#8217;ve learned from Chillingo&#8217;s Chris Byatte (or was it Joe?) is that reviewers often secretly (and sometimes openly) want to make games themselves. They just ended up on the wrong end, somehow. Of course, it could be the other way around. Journalists told their audience what is wrong about a game for such a long time that they believe they know how to make a game without wrongs. Now, while there might be stories about game journalists that turn into successful game makers, what you should learn from this is that the journalist is not eager to imprint his ego on your game. Most journalists write from the assumed perspective of their audience. All journalists I&#8217;ve ever met were willing to contribute and constructively criticize my games when I communicated directly with them.</p>
<h2>Flocking Behavior</h2>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/06/Screen-shot-2011-06-08-at-9.54.43-AM.png"><img class="aligncenter size-full wp-image-7899" src="http://altdevblogaday.com/wp-content/uploads/2011/06/Screen-shot-2011-06-08-at-9.54.43-AM.png" alt="" width="642" height="93" /></a>Just like money breeds money, favorable reviews breed favorable reviews. A lot of games get carried away by a wave of rave reviews if their first review in an established magazine is overly positive. And it takes courage and strength to defend a game that got meager reviews from other sources or to bash a game that everyone pretends to love. Journalists fly in flocks, creating trajectories. I&#8217;m sure there&#8217;s a marketing term for this. Our last game&#8217;s <a href="http://www.metacritic.com/game/wii/and-yet-it-moves">metacritic score</a> barely moved 3 points after the first 10% of reviews were received. In other words: Once your game is a ~83% game, it stays that way. There are hardly any games that really divide the professional reviewers. Many more of them <a href="http://features.metacritic.com/features/2011/game-critic-scores-vs-user-reviews/?tag=supplementary-nav;article;2">divide the player masses</a>.</p>
<h2>The Good, The Bad, And The Ugly*</h2>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/06/Screen-shot-2011-06-08-at-9.53.55-AM.png"><img class="aligncenter wp-image-7898" src="http://altdevblogaday.com/wp-content/uploads/2011/06/Screen-shot-2011-06-08-at-9.53.55-AM-300x228.png" alt="" /></a>Coming to an end, I&#8217;d like to highlight some of the braver attempts at journalistic integrity and ingenuity and lament about some general faults. Have your read the recent <a href="http://killscreendaily.com/articles/reviews/infinity-blade">Infinity Blade review</a> by the notorious Kill Screen magazine? If not, do it now. The 100 word reviews the guys at <a href="http://noaddedsugar.ie/">No Added Sugar</a> came up with are pretty hilarious, too. And of course, there are the standard bearers like e.g. EDGE magazine. When you look at the landscape of iPhone game reviews, it is striking how much amateurism there is. But the field is very young and it might simply take a few more years until professionalism settles in. Still, there are laudable efforts in this area, e.g. the <a href="http://www.gotoats.org/">O.A.T.S</a> oath of ethical standards for reviewing presented above.</p>
<p>Reviews lost some importance with Twitter and Facebook and thus word of mouth getting the prime way of exchanging opinions about games. Those channels are not so much marketing tools as they are direct communication channels with your audience, the players. Nowadays, a high profile tweet about your game might shift more units than a rave review in an established print magazine. I welcome this new world of game criticism and I think that professional journalism is the perfect counterpart to rampant amateurism. Did I just end up with a critique on the state of the art of game journalism? That was unintended. Oh well, I&#8217;m off making a 91% game now.</p>
<p>* I swear I&#8217;ll stop using that headline.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/06/08/living-with-game-reviews/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Digital Distribution Woes</title>
		<link>http://www.altdevblogaday.com/2011/05/24/digital-distribution-woes/</link>
		<comments>http://www.altdevblogaday.com/2011/05/24/digital-distribution-woes/#comments</comments>
		<pubDate>Tue, 24 May 2011 09:33:34 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=6528</guid>
		<description><![CDATA[<p>Before joining Broken Rules, I&#8217;ve run a small iPhone game studio. We didn&#8217;t have the best hand for the market, so the studio only existed for 2 years and the remainders (me, some code, and my connections) were later merged into Broken Rules. The two companies have produced games for the iPhone, WiiWare, Steam and numerous other PC download platforms. And the Mac App Store. The outlook that shaped both of my companies is: the future of games is the download/digital distribution market, with tightly integrated social networking features for all platforms. The vivid XBLA, Facebook and iPhone markets show the road. Still, I&#8217;d like to point out some of the problems of these markets and how to deal with them. As usual, I&#8217;m writing this post from the perspective of a small indie studio, because that&#8217;s all I know.</p>
<p><a href="http://www.altdevblogaday.com/2011/05/24/digital-distribution-woes/" class="more-link">Read more on Digital Distribution Woes&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>Before joining Broken Rules, I&#8217;ve run a small iPhone game studio. We didn&#8217;t have the best hand for the market, so the studio only existed for 2 years and the remainders (me, some code, and my connections) were later merged into Broken Rules. The two companies have produced games for the iPhone, WiiWare, Steam and numerous other PC download platforms. And the Mac App Store. The outlook that shaped both of my companies is: the future of games is the download/digital distribution market, with tightly integrated social networking features for all platforms. The vivid XBLA, Facebook and iPhone markets show the road. Still, I&#8217;d like to point out some of the problems of these markets and how to deal with them. As usual, I&#8217;m writing this post from the perspective of a small indie studio, because that&#8217;s all I know.</p>
<p><a href="http://www.introversion.co.uk/uplink/"><img class="alignnone" src="http://www.introversion.co.uk/uplink/screenshots/uplink4.gif" alt="" width="640" height="480" /></a></p>
<h2>Outages, Hacking, and Dependency</h2>
<p>The hacking of Sony&#8217;s servers demonstrated what is the most media-effective trouble an online distributor can run into. Losing your client&#8217;s data is <a href="http://blogs.forbes.com/andygreenberg/2011/05/02/sony-apologizes-for-playstation-breach-appeases-users-with-freebies/">embarrassing</a> and <a href="http://it.slashdot.org/story/11/05/23/1327230/PlayStation-Network-Hack-Will-Cost-Sony-170M">expensive</a>. But that is just Sony&#8217;s part of the problem. For game developers with their games on PSN, the missing revenue for the time of the service&#8217;s outage, might yield lower numbers than Sony&#8217;s reported <a href="http://it.slashdot.org/story/11/05/23/1327230/PlayStation-Network-Hack-Will-Cost-Sony-170M">$170 Million</a>. Nevertheless, the loss of a revenue stream is <a href="http://www.industrygamers.com/news/playstation-network-developer-outage-definitely-affects-our-bottom-line-exclusive/">hard to compensate</a>. Of course, other companies could become culprits of hackers the same way, Sony did. I expect other services to get hacked or DDoS-attacked in the near future. Imagine if Apple or Microsoft are hit. On the brights side, just like bank robbing does not bring down the banking system (and neither does Bernard Madoff), criminality has always flocked around money and rarely destroyed working ecosystems. The only thing you can do as a small games company is to diversify as much as possible. Establish as many revenue streams as you can, because if one of them dries up, you still got the others. Make yourself as independent as you can. Diversify! Sounds easier in theory than it is in practice.<br />
<img class="alignnone" src="http://farm2.static.flickr.com/1152/5113585711_1ebc70982d_z.jpg" alt="" width="640" height="426" /></p>
<h2>The Player As Customer</h2>
<p>I should rather title this paragraph &#8220;unidirectional communication&#8221;. I&#8217;ll start with a story: We&#8217;ve released And Yet It Moves for the Mac App Store when that opened. We had a Mac version of the game for a year, so it was pretty straight-forward to make it compliant with the terms of service. After a few submissions we were in the store and thanks to Apple&#8217;s gratuitous featuring and the quality of the game we quickly <a href="http://www.brokenrul.es/blog/?p=690">rose up in the charts</a>, leading to a #2 spot in the charts on our best weekend. Then an unexpected dynamics started to kick in. We&#8217;ve learned that some older MacBooks and iMacs have trouble rendering the shaders in the game. Also, case-sensitive file systems introduced buggy behavior. We simply had not tested on enough different kinds of hardware. We fixed those bugs but some players were still having trouble getting the game to start. It just showed a black screen on startup. We released four patches so far, all of them addressing the same issues and introducing only very few new features. While we fixed the game for most players, sadly, there are still systems out there that seem to have the black screen problem. They are very few and none of the test systems we have access to still has the problem. We&#8217;ve done our best to fix the game for every user. And we&#8217;d love to work with those that still have trouble getting the game to run.</p>
<p>The core of the problem is: One of the users that is still suffering from this problem is &#8220;Like Clockwork&#8221;. And what that user does is that he posts a one-star review minutes after a new update hits. I suppose he will do so until the problem is fixed for his system. His most recent <a href="http://itunes.apple.com/us/app/and-yet-it-moves/id404553869?mt=12">review</a> is:</p>
<p>&#8220;<em>there have been several updates to this program, all promising a fix of the &#8220;black screen&#8221; issue, yet every time i start the game, i get NOTHING but a plain black screen. i want my money back!</em>&#8221; (<a href="http://itunes.apple.com/us/app/and-yet-it-moves/id404553869?mt=12">Mac App Store</a>)</p>
<p>Apple has a refunding policy, and it would be very easy for Like Clockwork to get his money back. We&#8217;ve got a support forum and we&#8217;d love to send Like Clockwork a test version of the next update before we publish it. We&#8217;d also love to hear what hardware he owns in order to test our game on that specific type of Mac. Sadly, the Mac App Store makes it far easier to trash a developer with a one-star review than to offer support. Our game runs on 99% of the machines out there. Bugs happen. The player is a great customer if the platform supports him. What we&#8217;re learning from this experience is that we will release our next game for the Mac with minimal hardware requirements. You have to design for the lowest denominator because one angry customer is enough to break your neck.</p>
<p><img class="alignnone" src="http://ny-image1.etsy.com/il_fullxfull.188377989.jpg" alt="" width="600" height="298" /></p>
<h2>Tangible Ethereal Goods</h2>
<p>I have a theory. If products turn from physical goods to ethereal, something has to compensate the lack of haptic sensation. In other words, back in the days when games were still physical goods – and I&#8217;m talking about those days when the additional <a href="http://images.wikia.com/u5lazarus/images/9/9e/U5jap-map.jpg">content of the package was worth the money</a> alone – you got something tangible and seemingly personal from the manufacturer of the game. With the introduction of standardized packaging and even more with digital downloads, this aspect of the physical good got lost. Still, the hardcore fans of any brand, those key leads you have to target first, if you&#8217;re marketing your games yourself, demand a personal experience. The AAA world introduced limited editions for this demographic. What we&#8217;re trying to do in the indie world is to establish a relationship with our customers. Via twitter, Facebook and all the other dreaded social networking systems. We can&#8217;t have a marketing person, department or company make that for us, because our core players want direct communication with developers and designers. The <a href="http://www.humblebundle.com">Humble Indie Bundle</a> managed to leverage this aspect of digital games marketing very successfully. The most tangible thing we&#8217;re offering nowadays is ourselves, the developers. Of course you can also <a href="http://www.etsy.com/listing/60478786/super-meat-boy-plush">sell plush toys via Etsy</a> instead.</p>
<p>I hope this post did not come out as a rant. I would not say that I believe that digital distribution is the future. I think it is inevitably coming our way. The reasons are manifold and most of them are not in the interest of the customer – e.g. having full control over content distribution, destroying the second-hand market, and diminishing piracy – but the security, comfort and possibilities it offers are by far exceeding the downsides for most people. For each poison, there&#8217;s a remedy, and for every woe of the download market, there is a strategy to work around it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/05/24/digital-distribution-woes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thoughts On University Education</title>
		<link>http://www.altdevblogaday.com/2011/05/09/thoughts-on-university-education/</link>
		<comments>http://www.altdevblogaday.com/2011/05/09/thoughts-on-university-education/#comments</comments>
		<pubDate>Mon, 09 May 2011 15:39:45 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=5443</guid>
		<description><![CDATA[<p>Recently, we&#8217;ve been looking for interns for my company. And we&#8217;re currently expanding our staff for the second time. I took that as an opportunity to think about the state of education. Here are some of my thoughts.</p>
<p><a href="http://www.altdevblogaday.com/2011/05/09/thoughts-on-university-education/" class="more-link">Read more on Thoughts On University Education&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>Recently, we&#8217;ve been looking for interns for my company. And we&#8217;re currently expanding our staff for the second time. I took that as an opportunity to think about the state of education. Here are some of my thoughts.</p>
<p>I&#8217;ve been working at a technical university for the last 5 years before I joined Broken Rules. I&#8217;ve also been part of the committee that shaped a new curriculum for a university of applied sciences some months ago and lectured at a number of universities. I&#8217;m still teaching game design and prototyping courses at the Vienna University of Technology. During the years at the university I&#8217;ve done my best to produce bright and open students. Students with a passion for computer science and new media. This article is written from the perspective of an indie developer that runs a <a href="http://www.inc.com/magazine/20110401/jason-fried-why-i-run-a-flat-company.html">flat</a> company. Small companies have specific recruitment needs. While there are highly specialized startups that require employees with very specific capabilities, the majority of small independent games companies needs generalists. In my company, we&#8217;re all wearing exquisite collections of hats. Most of the local games companies are small to medium sized. The same holds true for web startups and content providers. That is a European tradition. Local universities should produce a workforce for local companies. Nowadays, our European economy builds on innovative small businesses – even if they get sucked up by large corporations. So why not focus education on their needs?</p>
<h2>No More Programmers</h2>
<p>Educating generalists means that we don&#8217;t teach programmers. Most of the brilliant programmers I&#8217;ve met are great despite their education, rather than because of it. They were not spoiled by mediocre programming courses they had to attend at uni. They were self-taught and quickly included the knowledge they acquired in the structured environment of the educational system into their rich private pool of knowledge. Yet they profited particularly from the few high level courses that a university offers. It is ironic that highly specific courses advance the generalists the most. Similarly, focussing on one computer language, no matter which, is wrong. Someone who receives a master degree from a university in a technical curriculum must have a thorough understanding of programming that goes past the ability to work in a specific language. If you show him a PHP script he should be able to edit it within seconds, even if he&#8217;s never seen PHP before. He should immediately recognize that Clojure is a LISP dialect. And he should be taught OOP with all its pitfalls and flaws. Even if he&#8217;s hired as a C++ programmer, I would expect him to write a Python script when it&#8217;s appropriate. As an indie we rarely hire pure programmers. Most of my team is made up of designer-engineers. We could invent a new word for us: Designeers. We need an education for designeers rather than one that isolates engineering from design.</p>
<h2>A New Foundation</h2>
<p>In my personal opinion, a solid footing in the history, theory and practice of information science is the best basis for developing deep interest in computer science. Whether it is the history of computer systems, mathematics, information theory, theoretical informatics, or the social implications of information systems, a strong background in the science part of &#8220;computer science&#8221; is crucial for becoming a generalist. In order to nourish the interest in all things digital, the social ties between students need to be strengthened. A lot of Scandinavian universities excel in this aspect. The german speaking countries with their German tradition of studying are less inclined in supporting the social side of learning. I could ramble on for hours about the architectural differences between the ITU in Copenhagen and the Vienna University of Technology. Suffice it to say; we could learn a lot from Finland and Denmark.</p>
<h2>It&#8217;s The Money That Ruins Everything</h2>
<p>During the last years, more and more of my students took on jobs during their studies. Nowadays, there are hardly any full-time master students anymore. While it is important to learn how to work and to apply your knowledge, I still think that it dilutes their studies. Maybe it was the transition from a single 5-year Master curriculum to the Bachelor/Master curriculum, which yielded half-educated half-prize programmers. Maybe the parents can not support their kids&#8217; education anymore. Maybe the iPhone4 is a tad to expensive for a student but considered mandatory equipment nevertheless. All I know is that I&#8217;m sure students would benefit more from starting non-commercial pet-projects and fumbling around with strange OSs and languages than from making websites for an advertising agency.</p>
<p>I know I&#8217;ve formulated this posting in very general – and slightly whiny – terms. There are great students coming out of all universities I&#8217;ve mentioned. I just fear that the current direction education is taking, turning the self-determined and free student of the once-revolutionary universities into a schoolboy, is not leading in the right direction. You cannot optimize education indefinitely. Sooner or later it breaks.</p>
<p>PS: Now I don&#8217;t know <a href="http://techcrunch.com/2011/04/10/peter-thiel-were-in-a-bubble-and-its-not-the-internet-its-higher-education/">what&#8217;s wrong with education in America</a>, but it looks like it is as bugged as ours. Just differently so.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/05/09/thoughts-on-university-education/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Indie Project Budgets</title>
		<link>http://www.altdevblogaday.com/2011/04/24/indie-project-budgets/</link>
		<comments>http://www.altdevblogaday.com/2011/04/24/indie-project-budgets/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 11:19:12 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=4618</guid>
		<description><![CDATA[<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/04/Screen-shot-2011-04-22-at-11.29.31-AM.png"><img class="alignright size-full wp-image-4619" src="http://altdevblogaday.com/wp-content/uploads/2011/04/Screen-shot-2011-04-22-at-11.29.31-AM.png" alt="" width="242" height="400" /></a>I&#8217;ve recently stumbled across the numbers behind Angry Birds. <a href="http://www.gamesindustry.biz/articles/2011-03-09-angry-birds-revenues-at-USD70m-from-USD140k-costs">Reportedly</a>, producing the game cost $140k whereas the revenue generated approaches $70m making Angry Birds one of the most successful media franchises in history. Another game that was <a href="http://www.destructoid.com/kickstarter-for-no-time-to-explain-does-it-right-198694.phtml">in the news</a> was No Time To Explain. The game clocks in at <a href="http://www.kickstarter.com/projects/1296948465/no-time-to-explain-indie-game">$16,649 on Kickstarter</a> at the time of writing. Indie games are produced with budgets between those two numbers (and less).</p>
<p><a href="http://www.altdevblogaday.com/2011/04/24/indie-project-budgets/" class="more-link">Read more on Indie Project Budgets&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/04/Screen-shot-2011-04-22-at-11.29.31-AM.png"><img class="alignright size-full wp-image-4619" src="http://altdevblogaday.com/wp-content/uploads/2011/04/Screen-shot-2011-04-22-at-11.29.31-AM.png" alt="" width="242" height="400" /></a>I&#8217;ve recently stumbled across the numbers behind Angry Birds. <a href="http://www.gamesindustry.biz/articles/2011-03-09-angry-birds-revenues-at-USD70m-from-USD140k-costs">Reportedly</a>, producing the game cost $140k whereas the revenue generated approaches $70m making Angry Birds one of the most successful media franchises in history. Another game that was <a href="http://www.destructoid.com/kickstarter-for-no-time-to-explain-does-it-right-198694.phtml">in the news</a> was No Time To Explain. The game clocks in at <a href="http://www.kickstarter.com/projects/1296948465/no-time-to-explain-indie-game">$16,649 on Kickstarter</a> at the time of writing. Indie games are produced with budgets between those two numbers (and less).</p>
<p>For a AAA-developer, even a budget of $140k would be a joke. Yet for an iPhone project, this is an immense pile of money. The average budget for iPhone software can be assumed as <a href="http://communities-dominate.blogs.com/brands/2010/06/lets-dig-into-apple-1b-dollars-paid-out-by-iphone-app-store-how-relevant-is-this-number.html">$35k</a>. Even with a budget that low, you can not expect to generate enough revenue to <a href="http://communities-dominate.blogs.com/brands/2010/06/lets-dig-into-apple-1b-dollars-paid-out-by-iphone-app-store-how-relevant-is-this-number.html">recoup your investment</a>. In fact, it is not a sane economic decision to invest $140k in a project for a platform where the average return is as low as on the iPhone. According to this <a href="http://communities-dominate.blogs.com/brands/2010/06/lets-dig-into-apple-1b-dollars-paid-out-by-iphone-app-store-how-relevant-is-this-number.html">analysis</a>, the average sales of a number of surveyed games were 11,625 units, or 44 copies per day. However, 56% of the those games sold less than 10k units. What lessons can be learned from this state of affairs?</p>
<p>We&#8217;re working on a series of three games, in the moment. While I cannot talk about the content of those games yet, I would love to take this opportunity to talk about our budget. We&#8217;ve recently received public funding for this project. Remember, we&#8217;re based in Europe. In order to acquire that funds we had to submit a detailed project and budget plan for the duration of the project, which runs until early 2013 in our case. Each game has a budget of around $100k for the initial release and a further budget of around $75k for ports and sustained support. How did I end up with these numbers? I&#8217;ve had an enlightening conversation with Martin de Ronde from <a href="http://www.mistbound.com/vanguard/">Vanguard Games</a> (and formerly from Guerilla Games) and after that I knew what to do. Martin was kind enough to share his thoughts on development costs and his advice was: Either go for $100k or invest more than half a million. Since the latter was not an option for us, we decided to design the project so that it fits in the first category.</p>
<p>Our budget is spread between all kinds of development tasks, from coding and game design to marketing. Additionally, there are material costs for dev kits and there&#8217;s a traveling budget. The following pie chart shows the distribution between those tasks. The &#8220;Code&#8221; task is a bit misleading because it includes all programming as well as gameplay-scripting and other game design tasks like controls tuning. Also, 80% of the costs summed up as &#8220;Materials&#8221; are marketing costs. Still, our marketing costs are exceptionally low and our coding pretty dominant. If I had had this chart at hand when I planned the project I would have skewed the numbers a bit to give marketing a bigger role. Still, most of our marketing is community building, which is a) cheap and b) not in the project plan.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/04/riders-budgetbyactivity.png"><img class="aligncenter size-medium wp-image-4620" src="http://altdevblogaday.com/wp-content/uploads/2011/04/riders-budgetbyactivity-300x300.png" alt="" width="300" height="300" /></a></p>
<p>I would not advise to take this template and apply it to any project. The reason why the coding piece of the pie is so large is that we&#8217;re currently building our own tech, <a href="http://altdevblogaday.com/2011/02/23/ginkgos-game-loop/">as you know</a>.</p>
<p>Compared to other indie games that have published their development budgets, we are on the cheap side. Braid – a showcase in indie marketing as well as game design – <a href="http://indie-fund.com/apply/">cost $180k to develop</a>. World of Goo, another indie darling, <a href="http://indie-fund.com/apply/">had a budget of $120k</a>. Both are in the &#8220;forbidden zone&#8221; mentioned above, as is Angry Birds. We are aiming at three games of the size and scope of these examples and hope to achieve the same level of game design and polish.</p>
<p>In sum, I think it was a brilliant idea of Rovio to invest $140k on an iPhone game. There are only a handful of games of this scope on that platform and most of them were very successful (e.g. Rage, Infinity Blade, World of Goo). The tide of no-budget games drowns most low- to normal-budget outings. Rovio went with a publisher – Chillingo – and allocated the time and talent needed to bring the game into a shape that reduced the risk of investment significantly. In other words: investing $20k in a downloadable game is gambling. With a fitting budget and the right team, you can reduce your risk. I&#8217;m sure there&#8217;s a business term for this.</p>
<p>Take another grain of salt and apply it to my personal advice, which is:</p>
<ul>
<li>It looks like $100k to $140k is a suitable budget for a downloadable indie game.</li>
<li>It is wise to acquire additional money for sustained support and porting, although you might only need it if you strike gold, anyway.</li>
<li>There are more articles about sales numbers than about development budgets online.</li>
<li>Of course, the most important thing is that your budget fits to your game.</li>
</ul>
<p>PS: This blog was initially published at <a href="http://altdevblogaday.com/">#AltDevBlogADay</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/04/24/indie-project-budgets/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Ginkgo and the Unanswered Questions</title>
		<link>http://www.altdevblogaday.com/2011/04/13/the-ginkgo-and-the-unanswered-questions/</link>
		<comments>http://www.altdevblogaday.com/2011/04/13/the-ginkgo-and-the-unanswered-questions/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 08:05:32 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=3894</guid>
		<description><![CDATA[<p>In <a href="http://altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/">my longest post</a> about our in-progress component-based 2D game engine I talked about our component system. There have been a number of unanswered questions after that article and I&#8217;d like to answer those before I proceed. Be sure to check out the <a href="http://altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/">first</a> <a href="http://altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/">three</a> <a href="http://altdevblogaday.com/2011/02/23/ginkgos-game-loop/">parts</a> of this series of blog posts.</p>
<p><a href="http://www.altdevblogaday.com/2011/04/13/the-ginkgo-and-the-unanswered-questions/" class="more-link">Read more on The Ginkgo and the Unanswered Questions&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>In <a href="http://altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/">my longest post</a> about our in-progress component-based 2D game engine I talked about our component system. There have been a number of unanswered questions after that article and I&#8217;d like to answer those before I proceed. Be sure to check out the <a href="http://altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/">first</a> <a href="http://altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/">three</a> <a href="http://altdevblogaday.com/2011/02/23/ginkgos-game-loop/">parts</a> of this series of blog posts.</p>
<p>Brooksoid asked:</p>
<blockquote><p>I’d love more details on what’s going on in your macros, as information on Terrence’s COMPONENT macro is non-existent.</p></blockquote>
<p>Actually the only macro that I mentioned in the article but did not properly explain is GIN_IMPLEMENT_COMPONENT. This macro expands to the following code:</p>
<pre escaped="true" lang="c++">#define GIN_IMPLEMENT_COMPONENT(className, stages) \
GIN_IMPLEMENT_DERIVED_COMPONENT(className, stages, );</pre>
<pre escaped="true" lang="c++">#define GIN_IMPLEMENT_DERIVED_COMPONENT(className, stages, baseName) \
ComponentPool* className::_pool; \
ComponentInfo className::_info = { ComponentManager::unregisteredType, #className, ComponentManager::unregisteredType, #baseName, SymbolArray(0) }; \
GIN_IMPLEMENT_COMPONENT_HELPERS(className) \
GIN_IMPLEMENT_INITIALIZE(className) \
void className::preMain() { \
	_pool = new ComponentPool; \
	ComponentManager::instance().registerType(&amp;_info, 		\
							static_cast(_pool), 	\
							stages); 			\
	staticInitialise(); \
}
</pre>
<p>As you can see, the macro mostly adds static functions to the component class. The preMain function is actually a misnomer. It is called before the engine enters the runloop, but in main(). Still, preMain allocates a static component pool for the class and registers the class type. The info structure used for registration is similarly static. At last, it calls the staticInitialise (which is obviously British) function that registers all properties (functors) of the class. Maybe I should write about our property system at some point. For now, I&#8217;ll just say: The property system registers component variables for XML import and export, the in-game editor and (soon) scripting.</p>
<p>GIN_IMPLEMENT_INITIALIZE hooks up the preMain function following <a href="http://www.google.com/url?sa=t&amp;source=web&amp;cd=1&amp;ved=0CBUQFjAA&amp;url=http%3A%2F%2Fwww.amazon.com%2FGame-Engine-Architecture-Jason-Gregory%2Fdp%2F1568814135&amp;ei=TEA9TfzSLYOt8QP__6WfCA&amp;usg=AFQjCNHui5zAm4pMCONaOYQMHzreoSJv4Q">Gregory&#8217;s Game Engine Architecture</a>:</p>
<pre escaped="true" lang="c++">#define GIN_IMPLEMENT_INITIALIZE(classname)	\
bool classname::preMainRegistered = false;	\
bool classname::registerPreMain()			\
{ \
	if ( !preMainRegistered )				\
	{ \
		Initializer::AddInitializer(classname::preMain); \
		preMainRegistered = true; \
	} \
	return preMainRegistered; \
} \
static bool classname##RegisteredInitialize = classname::registerPreMain();
</pre>
<p>The class Initializer is a singleton that calls all registered initialize functions before our engine enters the runloop.</p>
<p>coolbeenz asked:</p>
<blockquote><p>I would also be interested to hear if and how you support a GetComponent( ComponentType ) on an object instance.</p></blockquote>
<p>We have several getComponent() functions in the Game Object. Bear in mind that the components are stored in contiguous arrays in the ComponentPools. The Game Object just stores a linked list of its components in what we call a component chain. This list can be queried for a specific component type. The Game Object also offers handy functions to access other object&#8217;s components, but those are rarely used. Each component can have a name that might also be used for retrieving it. The most commonly used method for getting a specific component is a template function that expands to getComponentThatImplements(T::type()), where type() is the static type stored in the _info structure and registered by the GIN_IMPLEMENT_COMPONENT macro above. getComponentThatImplements first tries to return a component of the correct class. If it fails, it returns a component of a derived class.</p>
<p>Brooksoid asked:</p>
<blockquote><p>I figured (naively?!) that the vtable indirection would be absorbed by the d-cache once you’ve updated the first component of a type, and all the repeated calls (for the rest of the components in the pool) wouldn’t really cost…
</p></blockquote>
<p>This is the result of <span style="text-decoration: line-through">a battle</span> design by compromise between Peter, our main C++ coder, and me, our main C coder. I wanted a virtual-function-free component system closer to the <a href="http://t-machine.org/index.php/2010/05/09/entity-system-1-javaandroid/">Entity System architecture proposed by Adam Martin</a>. Peter wanted to stick to the OO features that C++ offers. In the end, we settled for a compromise that is neither optimal, nor satisfying for anyone. Maybe it&#8217;s time to refactor that bit. We&#8217;ll profile that part when we&#8217;re on the brink of moving into production with our current game.</p>
<p>My next post will be about component communication. We&#8217;ve implemented more than enough methods of cross-component interaction and I&#8217;d like to publicly discuss those. I&#8217;d appreciate feedback, so please keep it coming!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/04/13/the-ginkgo-and-the-unanswered-questions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rules We Don&#8217;t Break</title>
		<link>http://www.altdevblogaday.com/2011/03/25/rules-we-dont-break/</link>
		<comments>http://www.altdevblogaday.com/2011/03/25/rules-we-dont-break/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 14:04:23 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=2502</guid>
		<description><![CDATA[<p>Instead of continuing my series about <a href="http://altdevblogaday.com/2011/02/23/ginkgos-game-loop/">Ginkgo</a>, our game engine, I&#8217;d like to write a short posting about our game creation process. We&#8217;re at an interesting point in our current project here at Broken Rules, so I though it&#8217;d be clever to have a little discussion on how we develop ideas and how that funnels into the game development process.<br />
<span id="more-2502"></span><br />
Before I dive into the matter at hand I&#8217;d like to introduce our company. Broken Rules is a small and young indie games company based in Vienna, Austria. We all own a share in the company and our staff, us, is just five people. All of us wear many hats. Each one of us, except our graphics artist, is able to code. Also, we do most of the game design together or in small groups. And it might be notable that my past is in the academia, where I used to research design theory and practice.</p>
<p><a href="http://www.altdevblogaday.com/2011/03/25/rules-we-dont-break/" class="more-link">Read more on Rules We Don&#8217;t Break&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>Instead of continuing my series about <a href="http://altdevblogaday.com/2011/02/23/ginkgos-game-loop/">Ginkgo</a>, our game engine, I&#8217;d like to write a short posting about our game creation process. We&#8217;re at an interesting point in our current project here at Broken Rules, so I though it&#8217;d be clever to have a little discussion on how we develop ideas and how that funnels into the game development process.<br />
<span id="more-2502"></span><br />
Before I dive into the matter at hand I&#8217;d like to introduce our company. Broken Rules is a small and young indie games company based in Vienna, Austria. We all own a share in the company and our staff, us, is just five people. All of us wear many hats. Each one of us, except our graphics artist, is able to code. Also, we do most of the game design together or in small groups. And it might be notable that my past is in the academia, where I used to research design theory and practice.</p>
<p>There aren&#8217;t many rules we&#8217;re following, hence the name of the company. But we&#8217;ve developed three key techniques for game design that I&#8217;d like to share. They work for us, so they might as well work for other comparable teams. I&#8217;m not so sure about larger teams and companies and neither about more traditional projects. We&#8217;re independent because that allows us to make those games that a traditional publisher hardly funds. Also, we&#8217;ve only released three games so far (not counting my 3 iPhone games) and only one of those is of a decent scale and ambition. But we&#8217;re currently working on our next big title. We&#8217;re in the second pre-production phase of this project. We&#8217;ve finished a playable core gameplay prototype, playtested it and made a vertical slice. At the moment we&#8217;re testing out other gameplay elements and working to get the engine on speed. The rules we&#8217;ve followed so far, and that have proven to unleash a lot of productivity and creativity are:</p>
<ul>
<li>Brain Day</li>
<li>Constraints are King</li>
<li>The Single Invention Rule</li>
<li>Kill Your Darlings</li>
</ul>
<p>Let&#8217;s visit them one by one.</p>
<h2>Brain Day</h2>
<p>This one is simple. During the early stage of development everyone involved in the creative process of conceiving the game is allowed – even encouraged – to have a Brain Day once a week. On Brain Day you&#8217;re not supposed to show up at the office. You might go shopping or enjoy a walk. Or just stay in bed all day. You might Skype with the team but you&#8217;re not expected to check your emails. Just do whatever is necessary to get into a creative mindset and let the thoughts flow. If you turn up with a gameplay idea, a setting, or a sketch on the next day that&#8217;s excellent. If not, there&#8217;s another Brain Day in the next week.</p>
<h2>Constraints are King</h2>
<p>This one has a backing in academic <a href="http://books.google.com/books?id=lPvqZJNAdG8C&amp;pg=PA94&amp;lpg=PA94&amp;dq=lawson+constraints&amp;source=bl&amp;ots=Y8YrhMas3l&amp;sig=sa7S9knAvBiOnWWHPZZ5vhsOjhE&amp;hl=en&amp;ei=sZWMTdCZOYXOhAe2qpmZCw&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;resnum=4&amp;ved=0CCUQ6AEwAw#v=onepage&amp;q=lawson%20constraints&amp;f=false">design theory</a> and has been iterated more than enough by a lot of <a href="http://www.gamespot.com/ps3/puzzle/flow/news.html?sid=6213519">clever</a> <a href="https://inspirationtopublication.wordpress.com/2010/09/29/design-tip-constraints-are-good/">people</a>. We&#8217;re making 2D games because with our team of five we could simply not make a full-fledged 3D game. We&#8217;ve settled for a game world before we&#8217;ve developed most of the gameplay, because once you know what world your game is playing in you can just look at it and pick those elements of that world that you currently need for your game. We&#8217;ve tried to make gameplay fun when it was played with the accelerometer alone, before we introduced buttons. We&#8217;re working with prototypes with wireframe graphics to focus on the gameplay alone. Some constraints we&#8217;re experiencing are external &#8211; budget, time, platform technology, and team size are examples for those &#8211; and we have to work within those limits. Other constraints are internal and we set them up explicitly in order to fuel our creativity.</p>
<h2>The Single Invention Rule</h2>
<p>This is maybe something indie-specific. Since we&#8217;ve got no publisher backing and are completely free in our game design decisions, we&#8217;ve come up with one specific constraint that&#8217;s central to our design philosophy. The Single Invention Rule is actually based on a talk by Kellee Santiago (from thatgamecompany) that I can&#8217;t find right now. Our interpretation goes like this: There should be no more and no less than one <em>gameplay</em>, one <em>technological</em> and one <em>conceptual</em> innovation per title. With our upcoming games we&#8217;re trying exactly that. We&#8217;ve got revolutionary gameplay, but only in one aspect. Some of the tech we&#8217;re working on is to be considered innovative for our standards. And the concept of the games we&#8217;re working on is innovative, too. I can&#8217;t go into detail because the game&#8217;s not announced yet. The idea of this rule is that it&#8217;s far too easy for an independent game developer to invent something completely new. Yet players want games that are approachable. And they want to understand what&#8217;s going on when they see a screenshot. The single invention rule keeps us from letting our creativity run loose.</p>
<h2>Kill Your Darlings</h2>
<p>Richard Fine wrote about this <a href="http://altdevblogaday.com/2011/03/24/how-to-polish-a-turd/">the other day</a>: Don&#8217;t get too attached to anything. Be prepared to throw away key parts of your game if it is necessary. Every time we run into a dead end – and we&#8217;re running into dead ends a lot during the initial design of our games – we&#8217;ve found our way out by throwing something away. It might be a key game mechanic or the graphical style. Sometimes it&#8217;s the target platform or the control method. Just because you sunk a lot of time, effort and money into it does not mean that it was a good decision in the first place. The challenge is to isolate the piece to get rid of. A Brain Day helps to get some distance between you and the project. Or a pair of fresh eyes.</p>
<p>These four rules are cornerstones of our design process. They&#8217;ve helped us open up the design space. Currently, we&#8217;d need some new rules that help us to narrow the design space again. But I&#8217;m sure we&#8217;ll come up with those once we really need them. And I&#8217;ll keep you posted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/03/25/rules-we-dont-break/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Ginkgo&#8217;s Game Loop</title>
		<link>http://www.altdevblogaday.com/2011/02/23/ginkgos-game-loop/</link>
		<comments>http://www.altdevblogaday.com/2011/02/23/ginkgos-game-loop/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 14:28:21 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=1092</guid>
		<description><![CDATA[<p>The game loop is the heart of every game engine. In this posting I explain how our loop is structured and how we manage to integrate a fixed time step with variable frame times. This is my third posting about the development of our in-house game engine Ginkgo. Ginkgo is a component based engine written in C++. I covered the inspirations for Ginkgo in my <a href="http://altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/">first</a> posting and the component system in the <a href="http://altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/">second</a> posting.</p>
<p><a href="http://www.altdevblogaday.com/2011/02/23/ginkgos-game-loop/" class="more-link">Read more on Ginkgo&#8217;s Game Loop&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>The game loop is the heart of every game engine. In this posting I explain how our loop is structured and how we manage to integrate a fixed time step with variable frame times. This is my third posting about the development of our in-house game engine Ginkgo. Ginkgo is a component based engine written in C++. I covered the inspirations for Ginkgo in my <a href="http://altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/">first</a> posting and the component system in the <a href="http://altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/">second</a> posting.</p>
<p>The textbook approach to game loops is to model them as simple loops that first process the input, update all game objects and then render all objects:</p>
<pre escaped="true" lang="c++">while (!quit)
{
	ReadJoypad();
	UpdateScene();
	DrawScene();
	FlipBuffers();
}</pre>
<p>In an OOP system, the update function is usually found in the game object. After each object drew itself &#8211; or was drawn &#8211; the graphics buffer is switched. In a more sophisticated engine this buffer switching might be synced to the vertical refresh of the graphics card.</p>
<p>Jason Gregory of Naughty Dog described the pitfalls of this design in his <a href="http://www.gameenginebook.com/gfg2010-final.pdf">excellent talk</a> at Game Forum Germany 2011:</p>
<p>&#8220;It’s also terribly inefficient<br />
- potential for <strong>duplicated computations<br />
</strong>- possible <strong>reallocation of resources<br />
</strong>- poor data and instruction <strong>cache coherence<br />
</strong>- not conducive to <strong>parallel computation</strong>&#8221;</p>
<p>In Ginkgo, every component registers for n update pools. N is usually 1, sometimes 0 and might be &gt;1 in the future. The pools are triggered consecutively. Thus, we can order components, aspects of the same object. There are no game objects, but each assembled component group that forms a runtime game object receives several update calls as each component might be updated with a different pool. Rendering is done by one of the game object&#8217;s component among many. All rendering components are currently executed in the same update stage at the end of the loop, though this is not strictly necessary in the long run. Naughty Dog&#8217;s engine uses a dynamic bucket-based approach, which is something we might consider in the future, e.g. as soon as our number of update stages goes over a certain threshold.</p>
<p>In order to address the above issues we took the following actions:<br />
- Less duplicated computations by building pools of similar objects and manager objects where it&#8217;s appropriate (e.g. the particle system, physics engine, etc.).<br />
- We forbid reallocation during update. Let&#8217;s see how that ends ;-)<br />
- We increased cache coherence by putting our components into pools and updating them pool-wise.<br />
- We have not thought about parallel computation yet, but we have a very clear image where sync points will/might be.</p>
<p>But there&#8217;s an additional issue with game loops. There are a number of algorithms out there that profit significantly from predictable timing. The <a href="http://en.wikipedia.org/wiki/Runge–Kutta_methods">Runge-Kutta methods</a> &#8211; which are widely used in physics calculations &#8211; are an example. Now you can&#8217;t change anything about the timing of the screen refresh. But in Ginkgo, the render timing is based on the vertical sync of the graphics card whereas the physics engine we&#8217;re using, Box2D, uses integration methods that demand fixed timesteps. Gladly, Glenn Fiedler wrote an excellent article describing how to merge these two time sources into a single game loop, &#8220;<a href="http://gafferongames.com/game-physics/fix-your-timestep/">Fix your timestep!</a>&#8220;.</p>
<p>Why not dive straight into the subject matter at hand and look at our game loop:</p>
<pre escaped="true" lang="c++">void Ginkgo::update()
{
	f32 timeScale = _paused ? 0.0f : _timeScale;

	f64 newTime = System::getTime();
	f64 dt = newTime - _systemTime;
	_systemTime = newTime;
	_deltaTime = (f32)dt;

	// For timescaling we need to consider 2 values:
	// 1) _deltaTime: We stretch the time that passed since the last frame with _timeScale
	_deltaTime *= timeScale;

	// 2) _currentTime:  We need to fake this value for all the components and systems that use currentTime() to update their state (TaskManager etc.) in order to reflect that time passes slower/faster than usual.
	// We can do this by moving the _startTime value backward/forward corresponding to the offset of the real vs. the scaled time per frame.
	// Thus currentTime advances slower/faster according to timeScale. This is the most problematic point, as numerical errors will add up here.
	f64 timeOffset = dt * (1.0 - (f64)timeScale);
	_startTime += timeOffset;

	// currenttime is the time since start
	_currentTime = (f32)(_systemTime - _startTime);
	
	// deltatime is the time since the last loop
	_accumulator += _deltaTime;

	u32 numTicks = (u32)glm::floor(_accumulator / TICK_DURATION);

	_accumulator -= numTicks * TICK_DURATION;
	numTicks = glm::min(numTicks, MAX_TICKS);

	for (u32 i = 0; i &lt; numTicks; ++i)
	{
		// We use a fixed-step update function and accumulate between frames
		++_tickCount;
		tickStages();
	}

	// Rest of the accumulator, in percent of dt
	_interpolationFactor = _accumulator / TICK_DURATION;

	updateStages();
}</pre>
<p>This game loop first determines a timeScale for this loop. If the game is pause, the timeScale is set to 0.0. The current time is requested from the class &#8220;System&#8221; that provides a uniform interface to platform-specific functions. &#8220;dt&#8221; &#8211; delta time &#8211; stores the seconds since the last iteration. It is scaled by the time scale. A time scale of 2 thus means that the system behaves as if double the time has passed sine the last iteration, doubling the game speed. In order to correctly scale the execution of e.g. scheduled tasks that demand absolute time, the start time of the engine needs to be adapted. The engine thus behaves as if time would always have been that slow or fast.</p>
<p>In order to maintain a constant tick rate, an accumulator is used. This variable gets the last time slice added. Then the number of ticks in the accumulator is calculated. The update() function of all pools registered for ticks is called via tickStages(). This function first updates all PreTick components, then Tick and at last PostTick. These are the three update stages in the tick section. Glenn Fiedler describes the accumulator as follows: &#8220;Any remainder in the accumulator is effectively a measure of just how much more time is required before another whole physics step can be taken. For example, a remainder of dt/2 means that we are currently halfway between the current physics step and the next. A remainder of dt*0.1 means that the update is 1/10th of the way between the current and the next state&#8221; [1]. This remainder has to be used for interpolating the actual position of e.g. a sprite when the frame needs to be drawn as the drawing occurs between ticks. It is stored in _interpolationFactor. At last, updateStages() is called. This function updates the pools that registered for the PreDraw, Draw and PostDraw update stages as well as all singletons that need frame-wise updates, e.g. the external sound engine.</p>
<p>While our approach to the game loop is not as elegant as Naughty Dog&#8217;s, it still solves a number of issues more naive approaches to game loops have. And it integrates nicely with the physics engine. The usual disclaimer: Ginkgo is a work in progress, and every line of code might change in the future. Also, I&#8217;m happy for all feedback!</p>
<p>I think I&#8217;ll take a leave from Ginkgo for a while and make my next posting about something entirely unrelated. Let&#8217;s see how that works out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/02/23/ginkgos-game-loop/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Growing a Ginkgo (2): Components</title>
		<link>http://www.altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/</link>
		<comments>http://www.altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 10:50:00 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/2011/02/08/growing-a-ginkgo-2-components/</guid>
		<description><![CDATA[<p>This is part two of my series of posts about the game engine we&#8217;re building. Part one was about where we started and how we&#8217;re working. Before that I had already posted a blog post about our motivations and motives.</p>
<p><a href="http://www.altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/" class="more-link">Read more on Growing a Ginkgo (2): Components&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>This is part two of my series of posts about the game engine we&#8217;re building. Part one was about where we started and how we&#8217;re working. Before that I had already posted a blog post about our motivations and motives.</p>
<p>Here&#8217;s the thing to remember: We&#8217;re a team of just two coders working on this engine. Also, bear in mind that we&#8217;re currently at a very early stage. Everything can still be changed &#8211; which is the main reason why I&#8217;m writing publicly about the engine in the first place. Keep the feedback coming, tell me all I&#8217;m doing wrong!</p>
<p><strong>The Component System</strong></p>
<p>The core of the Ginkgo engine is a Component System. Instead of using a fat Game Object class and inheriting other game objects, we assemble Components to aggregate a game object. The main point of a Component System is to replace (especially multiple) inheritance with aggregation. Components are allocated independently of the actual game objects and assembled according to requirements. Components are vertical slices of game objects. Each one encapsulates specific functions and a specific set of data. They are updated (their update() function is invoked) in consecutive order. Our system assembles the game object aggregates from templates defined in XML. Our components are stored in contiguous pools. One component pool is updated at one update stage. Updating a component pool means that all components are updated. Thus, a game object is updated several times during one main loop iteration &#8211; part for part, component for component.</p>
<p>Let&#8217;s look at a typical component. The player Game Object currently consists of 9 components. PlayerController collects and manages a number of other components. PlayerStateMachine is a state machine for the player. It is used to trigger different states (e.g. flying, falling, crashed, …) and thus different player character behavior. PlayerInput is a component that translates the input of the player to specific properties. These are interpreted by the PlayerMovement component. The Box2dBody component wraps a physical body that is actually part of the physics subsystem. The Spatial2d component stores a location and orientation in space. It is written by the Box2dBody and read by the RenderManager. The SpriteRenderer sends rendering information to the RenderManager in every frame. The TickInterpolator component interpolates the draw position and orientation in order to sync the tick-based physics to the frame-based rendering.</p>
<p>Additionally, this player has a particle system attached that consist of two components, the system itself and a particle renderer component. The particles are stored in a different tight contiguous pool. More about that in a later post.</p>
<p><strong>The Components</strong></p>
<p>All components are derived from the base Component class. It stores administrative data and receives a number of events. Components are declared and defined using a number of macros. The most important one is GIN_DECLARE_COMPONENT, which declares ObjectPool and ComponentPool as friends, adds a declaration of an update() function that is not virtual but thus still present in all components. The GIN_DECLARE_COMPONENT_HELPERS are mostly comprised of shortcuts to static management information and typed allocation and free functions.</p>
<pre escaped="true" lang="c++">#define GIN_DECLARE_COMPONENT(className)
GIN_DECLARE_COMPONENT_FRIENDS
private:
GIN_DECLARE_COMPONENT_DECONSTRUCTORS(className)
GIN_DECLARE_COMPONENT_MEMBERS(className)
void update(UpdateStage::Enum stage);
public:
GIN_DECLARE_COMPONENT_HELPERS(className)
GIN_DECLARE_INITIALIZE</pre>
<p>Each component has a class, a name and an internal type. By supplying the class name to the macro, we circumvent error prone RTTI methods and can still query each component for its class and type.</p>
<p>There are three important callbacks in each component:<br />
- update(UpdateStage::Enum stage) gets called with a specific update stage. In this function the main runtime work of the component is done. See the runtime section below for further information on the different update stages. Update is called once per frame/tick, so making it non-virtual is crucial.<br />
- onOwnerModified(bool added, ComponentType type, Component* component) is a callback that gets triggered once the owner (usually a game object) is modified, i.e. a component is added or removed.<br />
- loadConfiguration(TiXmlElement* element) is a callback that is issued by the level loader. We use tinyXML for loading component configurations. We&#8217;ve initially planned to allow different initialization data, but there was no reason to implement that yet.</p>
<p><strong>Component Pools</strong></p>
<p>Components are stored in component pools. Each pool stores exactly one type (class) of components. It has a capacity that is specified at level load time. The full capacity is allocated once and all components are pre-initialized at that point by calling each component&#8217;s init() function.</p>
<p>Component classes set up their pools in static initialization methods pre-main. The pool is first allocated and then registered in the ComponentManager. The ComponentManager class is the main entry point for all component operations, allocating, initializing, updating and terminating components. It manages all pools. Once the pool is valid, the staticInitialise() function of the component class is called. This function initializes e.g. exported component properties for the GUI and component loading. The two-stage init is just necessary because the preMain() call is wrapped in a macro that always makes sure the pool is created:</p>
<pre escaped="true" lang="c++">GIN_IMPLEMENT_INITIALIZE(className)
void className::preMain() {
_pool = new ComponentPool;
ComponentManager::instance().registerType(&amp;_info, static_cast(_pool), stages);
staticInitialise();
}</pre>
<p>As you can see in the registerType() function above, the pool is created with a template of the component class. Every concrete pool object is a subclass of the abstract IComponentPool interface:</p>
<pre escaped="true" lang="c++">class IComponentPool
{
public:
virtual ~IComponentPool() { }

virtual Component* allocateBase(void *prius, GameObject *owner) = 0;
virtual Component* getComponentBase(ComponentHandle handle) = 0;
virtual void freeComponentBase(ComponentHandle handle) = 0;

virtual void recreate(ComponentHandle newSize) = 0;
virtual void updateComponents(UpdateStage::Enum stage) = 0;
virtual Component** getActiveComponents(u32&amp; numActiveComponents) = 0;
virtual ComponentArray getActiveComponents() = 0;
virtual void pauseComponents (bool paused) = 0;
};</pre>
<p>Let&#8217;s go through these functions one by one. recreate() deletes all Components in the pool (physically) and creates #newSize new ones. It is to be used at level or scene changes. updateComponents calls the non-virtual update function of all components, whose state is set to INITIALISED. All components start in state DEAD. getActiveComponents() returns a temporary array of Component* or a vector of Component* containing only initialized components. We have implemented a component-level pause function that can be called via pauseComponents().</p>
<p>The allocateBase() function allocates a component and returns it with the actual type it has. It calls pool-&gt;allocate() and simply casts the component before returning it. The allocate function of the pool first retrieves a new component handle. Then it sets the state of the new component to INITIALISED, sets the game object that called the allocate function as the owner of the component and calls the component&#8217;s init.</p>
<p><strong>The ComponentManager</strong></p>
<p>Usually you do not interact with component pools directly. Instead, ComponentManager acts as a one-stop shop for all accesses to component pools. This singleton class also manages the actual pools. The functionality of the ComponentManager is split into two areas: Its internal functions for managing the pools, its external functions for querying the pool for specific components.</p>
<p>The manager maintains an array of actual pools. It also stores all necessary runtime information for the pools and has preprocessed lookup functions for retrieving the internal type and the name of a component class. Most lookup functions are based on each component pool&#8217;s ComponentInfo struct. The ComponentInfo is stored as a static struct for each component class:</p>
<pre escaped="true" lang="c++">struct ComponentInfo
{
ComponentType type;
FixedSymbol name;
ComponentType baseType;
FixedSymbol baseName;
FixedSymbolArray requiredComponentsAtStartup;
};</pre>
<p>The system can look up type information and name of the component class and the same for the base class of the component. It also stores a list of required components describing all dependencies of this component, should there be any. We have implemented a fail-early approach for dependencies. The other option would have been to use a visitor pattern. In that case, a component would always act as if its dependency is sufficed and broadcast messages in the hope that the required component picks it up. In our solution, the required component needs to be present once the whole list of components for the game object is assembled. Otherwise the system exits with an error.</p>
<p>The component manager has the ability to call all component update functions per pool. Since the data of the components is stored in consecutive order, iterating over them and invoking their respective update functions should be very cache-friendly. The update stage for each component class is set at the definition of the class via the macro GIN_IMPLEMENT_COMPONENT(className, stages). We currently support one update stage per pool but a limited number of stages in total.</p>
<p>Next up: The Game Loop</p>
<p>In the next post about the Ginkgo engine I&#8217;ll write about the runloop and how (and when) the different subsystems and component pools are updated.</p>
<p>It&#8217;s great to have your own tech but it also means that you have to make a lot of decisions. I know we&#8217;re building something quite experimental &#8211; and a lot of things could go wrong. I&#8217;d highly welcome feedback!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/02/08/growing-a-ginkgo-2-components/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Growing Ginkgo Pt. 1: The Reading List</title>
		<link>http://www.altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/</link>
		<comments>http://www.altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 09:11:01 +0000</pubDate>
		<dc:creator>Martin Pichlmair</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/2011/01/24/growing-ginkgo-pt-1-the-reading-list/</guid>
		<description><![CDATA[<p>After giving it a lot of thought I settled on a central theme for my #altdevblogaday articles. My first series of posts will be about <a href="http://www.brokenrul.es/blog/?p=568">Ginkgo</a>, our new in-house engine. I figured that this is is the right place to discuss its main features and get as much feedback as possible.</p>
<p><a href="http://www.altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/" class="more-link">Read more on Growing Ginkgo Pt. 1: The Reading List&#8230;</a></p>
]]></description>
				<content:encoded><![CDATA[<p>After giving it a lot of thought I settled on a central theme for my #altdevblogaday articles. My first series of posts will be about <a href="http://www.brokenrul.es/blog/?p=568">Ginkgo</a>, our new in-house engine. I figured that this is is the right place to discuss its main features and get as much feedback as possible.</p>
<p><a href="http://brokenrul.es/">We</a>&#8216;re a small independent game developer. Three of us have studied computer science (actually two are still in their master studies), one is a studied game designer and one a graphic artist. That&#8217;s our small but skilled team. The company is owned by ourselves and we&#8217;re working on our own IP&#8217;s from design, production and QA to marketing and support. We&#8217;re not only financially independent but strive for establishing our own independent infrastructure. That comes at a price &#8211; our wages are far below industry average &#8211; but every value we grow is a value of our own company. The largest project in a long list of actions furthering our independence is our in-house engine. The engine is written by just two guys, Peter, the main engine architect and CTO and me, the pragmatic coder that knows all the finishing moves. We&#8217;re very different, yet we had to agree on a lot of issues before starting the project. In this blog post I&#8217;m going to describe our starting points for developing the engine. There was a <a href="http://www.brokenrul.es/blog/?p=568">recent blog post on our studio blog</a> that detailed why we started to write our own tech in the first place.</p>
<p><strong>Setting Our Limits</strong></p>
<p>The first thing we had to agree on was a number of very strict limitations for the engine. We can&#8217;t produce a state of the art 3D engine with our limited budget and manpower. We formulated general requirements and decided on limitations of the engine. The main goal for the engine is to provide us with a tech that we can easily port to any platform out there. Our business model highly depends on agility and the ability to cheaply bring our games to emerging new platforms like e.g. the Mac App Store or the iPhone. So the number one requirement for our engine is portability. We&#8217;re making 2D games. While our rendering architecture would be suited for 3D content as well (more about that later) we&#8217;ve decided to focus on 2D for now. The main reason for that decision is that it is near impossible for such a small studio to provide the amount of content a 3D game needs. In other words: We&#8217;d rather deliver a highly polished 2D game than the crude and simplistic 3D game we could deliver with our limited resources. Other things that were off the list right from the start are e.g. networked multiplayer and streaming content.</p>
<p>The cornerstones for Ginkgo that we agreed upon are:</p>
<ul>
<li>An easily extensible 2D engine</li>
<li>XML as the main data format</li>
<li>Optimized for physics-based games</li>
<li>Component-based design</li>
<li>The only STL classes we&#8217;d use would be vector and string (and some maps, but we might replace those later)</li>
<li>No networked multiplayer/replication</li>
</ul>
<p>The engine would have a slightly different architecture if the main design would have been mine and not Peter&#8217;s. I&#8217;m a C programmer and I&#8217;ve mainly developed highly specialized software for art installations (e.g. <a href="http://randomseed.org/sevenmileboots/">talking boots</a> and <a href="http://www.luuux.com/technology/bagatelle-concrete-play-music-not-high-score">music-playing pinball machines</a>), realtime audio and similarly one-sided areas of application. I&#8217;ve singlehandedly coded a number of iPhone games, but none of them were technically very sophisticated. I&#8217;ve had my days in the Open Source development, too. Peter is a C++ programmer, on the other hand. Where I&#8217;m using a void pointer he&#8217;s reinterpret_casting. While I think OOP is only perfectly suited for a small number of tasks (UI&#8217;s come to mind), he thinks it is the basis of good design. We&#8217;re constantly fighting over these issues and I think that&#8217;s important for our engine architecture and our design process. Compromises often lead to mediocre results, but talking things out is a very important thing.</p>
<p><strong>A Component-based Core</strong></p>
<p>What we easily agreed on is the component-based nature of our engine. We&#8217;ve prototyped in the component-based Pushbutton Engine (Flash) and Unity before and we knew it would help us keep the increasing number of classes with overlapping functionality that usually get written during a game project. Also, Peter had stumbled across Terence Cohen&#8217;s GDC 2010 presentation <a href="http://www.insomniacgames.com/research_dev/articles/2010/1530793">&#8220;A Dynamic Component Architecture for High Performance Gameplay&#8221;</a>. At the same the DoD movement &#8211; and especially <a href="http://gamesfromwithin.com/data-oriented-design">Noel Llopis&#8217; take on it</a> &#8211; was at the centre of my attention. I see the C programmer&#8217;s mindset at work and I&#8217;m pleased. Insomniac&#8217;s architecture was the blueprint for our core engine architecture.</p>
<p>Here are some additional coding rules we agreed on early:</p>
<ul>
<li>Templates instead of instancing, where it&#8217;s possible</li>
<li>Never call a virtual function in a component&#8217;s update</li>
<li>As little inheritance as possible</li>
</ul>
<p><strong>… And What We&#8217;ve Built On Top Of It</strong></p>
<p>Most low-level features we implemented are based on publications by established game engineers. I&#8217;ll go through them one by one.</p>
<ul>
<li>Our initialization and termination methods are lifted from Jason Gregory&#8217;s excellent book <a href="http://www.google.com/url?sa=t&amp;source=web&amp;cd=1&amp;ved=0CBUQFjAA&amp;url=http%3A%2F%2Fwww.amazon.com%2FGame-Engine-Architecture-Jason-Gregory%2Fdp%2F1568814135&amp;ei=TEA9TfzSLYOt8QP__6WfCA&amp;usg=AFQjCNHui5zAm4pMCONaOYQMHzreoSJv4Q">&#8220;Game Engine Architecture&#8221;</a></li>
<li>Our main game loop is designed as suggested in Glenn Fiedler&#8217;s <a href="http://gafferongames.com/game-physics/fix-your-timestep/">&#8220;Fix Your Timestep!&#8221;</a>. The paper describes a fixed timestep game loop ideally suited for integrating physics independent of frame time. It is ideally suited for libraries that request a constant tick rate, like physics libraries. We&#8217;re using Box2D for our physics part.</li>
<li>Many subsystems of the engine depend on iterating over contiguous arrays of components or structs as outlined in Tony Albrecht&#8217;s <a href="http://research.scee.net/files/presentations/gcapaustralia09/Pitfalls_of_Object_Oriented_Programming_GCAP_09.pdf">&#8220;Pitfalls of Object-Oriented Programming&#8221;</a>. Our components feature an update function. But they contain the minimally necessary data to perform their functionality and are iterated over by component pool. Our component pool architecture will be featured in a future post.</li>
<li>We did not implement <a href="http://cmpmedia.vo.llnwd.net/o1/vault/gdccanada09/slides/marcinchadyGDCCanada.ppt">Marcin Chady&#8217;s messaging architecture</a> though nowadays I think we should&#8217;ve gone for it. Instead, we access components directly if a call is time-critical or via delegates if we want a leaker link between them. Component-to-component communication will be a different post.</li>
<li>Our rendering subsystem is following the guidelines outlined in Christer Ericson&#8217;s <a href="http://realtimecollisiondetection.net/blog/?p=86">&#8220;Order Your Drawcalls&#8221;</a>. We have buckets of arrays of faces that are sorted according to a render mask. More about that in a later post.</li>
<li>Our particle system was designed according to Lutz Latta&#8217;s <a href="http://www.2ld.de/gdc2004/">&#8220;Building a Million Particle System&#8221;</a> slides from GDC 2004. I don&#8217;t know if I should write too much about our particle system. Maybe once it&#8217;s fully integrated into the engine. Currently, the main downside is that every game object can only have one single particle effect attached because the emitters are components just like the any other blob of data.</li>
</ul>
<p><strong>The Future Is Bright And Full Of Pragmatism</strong></p>
<p>Now that you know where we started I can describe how we kicked off the project in the next post. I would also like to think aloud if the development of your own tech is even viable for a micro-studio like ours and how we manage to focus on games and develop our own tech at the same time with only one team consisting of five people. We&#8217;ve had our first user test with a prototype of our next game last friday, and it was awesome to see our engine (and the game) in action for the first time I will write about our upcoming game in the future, too, but it&#8217;s currently top secret.</p>
<p>If you have any questions or want me to focus on specific engine features, just tell me and I&#8217;ll gladly write about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/01/24/growing-ginkgo-pt-1-the-reading-list/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.046 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-17 00:48:16 -->
<!-- Compression = gzip -->