<?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>Hidden Games &#187; development diary</title>
	<atom:link href="http://blog.hiddengames.co.uk/tag/development-diary/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hiddengames.co.uk</link>
	<description>Indie video game developer</description>
	<lastBuildDate>Sat, 04 Feb 2012 11:31:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Multisample Anti-Aliasing (MSAA) on iOS</title>
		<link>http://blog.hiddengames.co.uk/2012/01/26/msaa-on-ios/</link>
		<comments>http://blog.hiddengames.co.uk/2012/01/26/msaa-on-ios/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 10:28:01 +0000</pubDate>
		<dc:creator>HiddenJ</dc:creator>
				<category><![CDATA[Development Diary]]></category>
		<category><![CDATA[development diary]]></category>
		<category><![CDATA[project iota]]></category>

		<guid isPermaLink="false">http://blog.hiddengames.co.uk/?p=447</guid>
		<description><![CDATA[Currently a lot of the technology is complete for Project Iota &#8211; we&#8217;ve got the main physics system working, which manages bomb placement and how the buildings collapse with the rest of the scenery reacting accordingly. In the coming weeks we will be throwing a few tweaks around to make sure the physics are both [...]]]></description>
			<content:encoded><![CDATA[<p>Currently a lot of the technology is complete for Project Iota &#8211; we&#8217;ve got the main physics system working, which manages bomb placement and how the buildings collapse with the rest of the scenery reacting accordingly.</p>
<p>In the coming weeks we will be throwing a few tweaks around to make sure the physics are both challenging and fun. I will talk more about how the physics have been put together in the future once more media of the game has been released.</p>
<p>Recently I took a break from game code and decided to try and get <strong>Multisample anti-aliasing (MSAA)</strong> working on iOS. It was a lot easier than I thought it would be. Due to the default renderer on iOS rendering to a Framebuffer Object (FBO) all that was required was to create another FBO and a multi-sample render buffer and just get the draw loop to render to the new FBO and resolve and display into the normal FBO.</p>
<p>Here&#8217;s are the results&#8230;</p>
<p><img src="/assets/news/msaa-comparison.jpg" alt="Multisample anti-aliasing comparison" /></p>
<p>Whether this effect makes it into the final game is unknown. We will need to do a profiling step to make sure we still have time to render the MSAA and process the rest of the models. At the moment it seems a little expensive especially with the amount of objects we have to render and process.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hiddengames.co.uk/2012/01/26/msaa-on-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Texture Atlas Tool for Maya</title>
		<link>http://blog.hiddengames.co.uk/2011/06/03/texture-atlas-tool-for-maya/</link>
		<comments>http://blog.hiddengames.co.uk/2011/06/03/texture-atlas-tool-for-maya/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 11:17:46 +0000</pubDate>
		<dc:creator>Pixelnaut</dc:creator>
				<category><![CDATA[Source Code]]></category>
		<category><![CDATA[development diary]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[texture atlas]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.hiddengames.co.uk/?p=429</guid>
		<description><![CDATA[Today sees the (belated) release of our TextureAtlas Tool, which we used during the development of Prisoner 84. Although it&#8217;s far from perfect, we have decided to make the tool (along with its source code) available to the public in the hope that, if you find it useful, you might also want to contribute to [...]]]></description>
			<content:encoded><![CDATA[<p>Today sees the (belated) release of our <a href="/source/maya-textureatlas/">TextureAtlas Tool</a>, which we used during the development of <a href="/games/prisoner84/">Prisoner 84</a>.</p>
<p>Although it&#8217;s far from perfect, we have decided to make the tool (along with its source code) available to the public in the hope that, if you find it useful, you might also want to contribute to help improve it.</p>
<p><a href="/source/maya-textureatlas/">Click here</a> for download links and more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hiddengames.co.uk/2011/06/03/texture-atlas-tool-for-maya/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dev Diary #2: Texture Atlasing</title>
		<link>http://blog.hiddengames.co.uk/2010/03/13/dev-diary-2/</link>
		<comments>http://blog.hiddengames.co.uk/2010/03/13/dev-diary-2/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 20:07:05 +0000</pubDate>
		<dc:creator>HiddenJ</dc:creator>
				<category><![CDATA[Development Diary]]></category>
		<category><![CDATA[development diary]]></category>
		<category><![CDATA[texture atlas]]></category>

		<guid isPermaLink="false">http://blog.hiddengames.co.uk/?p=109</guid>
		<description><![CDATA[One of the recent additions to our tool chain is the ability to create texture atlases. Texture Atlasing is a concept whereby you place multiple textures into a single bigger texture or textures so that you drastically reduce your texture binding and swaps during the rendering of a complex scene. Atlasing has existed for a [...]]]></description>
			<content:encoded><![CDATA[<p>One of the recent additions to our tool chain is the ability to create <strong>texture atlases</strong>.</p>
<p><strong>Texture Atlasing</strong> is a concept whereby you place multiple textures into a single bigger texture or textures so that you drastically reduce your texture binding and swaps during the rendering of a complex scene.</p>
<p>Atlasing has existed for a while and has been used on many older games as a primary technique &mdash; the Quake games for example started using atlasing for a level&#8217;s lightmap information. We have recently been looking into this technique because we have increased our texture usage, plus atlasing has a lot of benefits on devices such as the iPhone where texture bandwidth is limited.</p>
<p><span id="more-109"></span></p>
<h3>Usage</h3>
<p>Previously we had been using a limited form of a texture atlas for our UI elements in our games. Here is an example of the atlas for the <a href="/air-cadets/">Air Cadets</a> UI artwork.</p>
<p class="thumbs"><a rel="lightbox[atlas]" href="/assets/news/2010-03-13_atlas.png"><img src="/assets/news/2010-03-13_atlas.png" alt="Air Cadets UI Texture Atlas" width="256px"/></a></p>
<p>As you can see we used a 1024&#215;1024 texture which contains every button, character and element seen throughout the games&#8217; menus and HUD. This atlas was created manually and we had to store image positions and dimensions in a spreadsheet which then was used to create the correct UV coordinates for the in game buttons/images. Although it worked, it was terribly slow for both of us and meant changes to the menu artwork caused many headaches!</p>
<p>For the current project we need to take advantage of atlasing for the main level scenes because our texture usage has drastically increased. After some research, I found that nVidia had released a command line driven tool back in 2004 that had various features to create an atlas automatically and output a useful text-based file (.TAI Texture Atlas Information file) that listed the original texture, its new atlas file and the UV offsets of the position in the atlas (see <a href="#links">links</a> at the bottom of this page).</p>
<p>After a few tests and most importantly having the source code to the tool, it looked like the perfect option to get this working within our pipeline with a few changes to help us make sure everything would work on the final iPod/iPhone hardware.</p>
<p>The route I chose was to create a new maya &#8216;command&#8217; plug-in that would externally call the command line tool with the scene textures, read the created TAI file, then use the new offsets to update all the UV coordinates for the scene. After some testing and custom changes to the nVidia tool, we can now generate atlases efficiently and have all our geometry updated in maya referencing the atlas with the correct texture coordinates.</p>
<p>This now has multiple uses across everything we do as we can decide to place multiple similar objects into an atlas or keep them separate. For example, if we have a scene that contains various prefab objects like tables, chairs, cups or other general incidental items (and we know that these items are going to have a high probability of always being drawn together even if they are separate models) we can simply put all their textures into the same atlas thus cutting down multiple texture swaps when the renderer is drawing these objects.</p>
<p>Once we iron out the few remaining bugs &ndash; and once we have got all of its features documented &ndash; <strong>we hope to release the maya tool at some point in the not-too-distant future</strong>.</p>
<h3>The Pros and Cons of Atlasing</h3>
<p>I&#8217;ve been quite positive about atlasing so far, however I should probably make a rundown of all the pros and cons so you can judge for yourself if this would be useful to projects you might be working on or if you are just researching the technique.</p>
<h3><strong>Pros</strong></h3>
<p><strong>Texture batching / Speed</strong><br/>Mentioned throughout this post, this is pretty much your main benefit. It is not guaranteed to give you a speed up, but with good render ordering it most likely will. For iPhone if you make your atlas a PVR texture as well, you will see much better bandwidth usage.</p>
<p><strong>No power of two limitation within the atlas</strong><br/>With an atlas you get the benefit of placing non-power of two textures into a large power of two atlas – thus allowing much greater freedom creating odd texture shapes and UV setups.</p>
<p><strong>Multiple use – UI elements, UV Animations</strong><br/>You can use the atlas in various forms as mentioned earlier: Air Cadets placed all UI elements into an atlas; you could also (for example) have a waterfall texture animation in your game that uses separate textures for each frame &mdash; if you place all the animation frames into an atlas all you have to do is perform UV coordinate shifts on a single atlas.</p>
<p><strong>Image assets easier to manage</strong><br/>Having all your texture information in a single big texture can make life a little simpler for art changes as everything is there in a single image resource for tweaks throughout development.</p>
<h3>Cons</h3>
<p><strong>Mipmapping and Filtering</strong><br/>Since all your textures are tightly packed, if your UVs are right on the edge of an image within the atlas and you want some sort of mipmap filtering on the atlas to smooth out pixelation, then when the image is mipmapped and using as an example, bilinear filtering &mdash; since it uses nearest neighbour you&#8217;ll potentially get pixels bleeding from unrelated textures which will look jarring in the final render. A solution to this can be to shift your UVs away from the exact edge of the image or make the image bigger itself inside the atlas with extra pixels so there is a safety border between two images.</p>
<p><strong>Limited texture wrapping / Texture tricks (rotate/scale) will not work</strong><br/>Since your UVs are all referencing the same texture, you are pretty much limited to the (GL_)REPEAT texture wrapping mode. It also means if you were using various texture matrix tricks to increase the repetition or to rotate/scale a texture image you become incredibly limited to small changes, otherwise you will see the surrounding images in the atlas.</p>
<p><strong>Moving/changing images within the atlas can be restrictive</strong><br/>The main point of creating an atlas is to pack as many images into a single texture as possible. Problems may arise when you decide that you want to remove an image from the atlas, which leaves a large wasteful hole that you don&#8217;t want. Simply moving the other images about in an image editor is no good as this breaks your UV values for the images that you move. I&#8217;d always recommend doing atlasing at a late stage in level creation so you can make more of a correct judgement on what images should be atlased on what objects.</p>
<h3>Round up</h3>
<p>I know this post is a bit text heavy, but I hope it provides some information to those looking into this technique. We&#8217;ve found this system to very beneficial in our current game as it allows us to push the uniqueness of an environment by using more textures than we could have previously. As mentioned, we hope to release our <strong<Maya atlas plugin</strong> which you might find useful, so watch this space. As ever comments, corrections or any other information is always welcome.</p>
<h3>Links</h3>
<p><a name="links">&nbsp;</a><a href="http://developer.nvidia.com/object/texture_atlas_tools.html" rel="external">nVidia Texture Atlas Tools</a> &#8211; Tools and source.<br />
<a href="http://clb.demon.fi/rectangle-bin-packing" rel="external">Algorithm plus another usage example</a> &#8211; Good example.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hiddengames.co.uk/2010/03/13/dev-diary-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dev Diary #1: Core Tech</title>
		<link>http://blog.hiddengames.co.uk/2010/03/01/dev-diary-1/</link>
		<comments>http://blog.hiddengames.co.uk/2010/03/01/dev-diary-1/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 16:21:41 +0000</pubDate>
		<dc:creator>HiddenJ</dc:creator>
				<category><![CDATA[Development Diary]]></category>
		<category><![CDATA[development diary]]></category>

		<guid isPermaLink="false">http://blog.hiddengames.co.uk/?p=90</guid>
		<description><![CDATA[Over the coming weeks as we continue development on our next game – and in an attempt to get into the habit of updating our web site more regularly! &#8211; we will be posting a series of development diaries. These diaries will not only allow us to document our progress for our own benefit, but [...]]]></description>
			<content:encoded><![CDATA[<p>Over the coming weeks as we continue development on our next game – and in an attempt to get into the habit of updating our web site more regularly! &#8211; we will be posting a series of development diaries.  These diaries will not only allow us to document our progress for our own benefit, but we hope will provide other indie developers with an insight into how we work  – which may prove beneficial when applying our development concepts to their own projects.</p>
<p>In our first dev diary we will cover some of our core tech that we have been developing on and off since our first release in 2008.  To illustrate our tech we will be showing off a prototype that we were working on called “H3”.</p>
<p><span id="more-90"></span></p>
<h3>About H3</h3>
<p>H3 was a prototype for a puzzle-based platformer.</p>
<p>Most platformers are purely level-based where the player starts a level, travels from A to B (sometimes having completed a set of objectives) and then moves on to the next level.  In H3 we wanted to make a continuous, seamless game where the emphasis was on the journey, but so that it still played like a traditional platformer.</p>
<p>The following videos show some game-specific features that our core tech enables us to do.</p>
<h3>Video 1</h3>
<p>In this video you can see some of the basic mechanics that were implemented in the H3 prototype.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/pz87uU6JQ7w&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/pz87uU6JQ7w&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><i>Auto climb/jump</i></p>
<p>For this technique a simple collision tagging method is used.  When the collision data is created each collision polygon can have up to 5 numerical &#8216;tags&#8217; attached to it.  These tags can be used for anything from auto jumps; which footstep sound effect to play; which footsteps particle effect to draw; as well as changes to the default physics settings for that surface (e.g. friction/restitution).</p>
<p>In the case of the auto climb/jump system we use a single numeric tag with a value of 1 or 2 to pick which animation should be played based on the height of the object.  When the jump animation starts, the system grabs the current root bone position so that when the animation finishes, the player&#8217;s new position is correctly matched with the final animation frame within the level.</p>
<p>Near the end of the video you can also see another use of the tags which causes the player to slide down a slope.</p>
<p><i>Switches</i></p>
<p>Switches are managed via an invisible area that checks firstly to see if the player inside it, and secondly whether the use/action button was pressed.  When a switch is used it calls an &#8216;OnUse&#8217; scripted function which triggers any valid scripted event to occur (such as move a block, move the camera, enable/disable another switch etc.)</p>
<p><i>Ladders</p>
<p></i></p>
<p>Ladders are handled in much the same way as switches where there is an invisible “use” area in front of the ladder.  If the player chooses to “use the ladder”, a scripted event occurs that moves the player towards the ladder and into position so that the player can control their ascent or descent.  To ensure the hand positions of the climb animation match with the rung positions, and to ensure  mount/dismount positions are handled correctly, we also encode into the invisible area the number of &#8216;climb&#8217; animations that should be played for that ladder instance. This makes the system very robust as it enables us to have ladders of any height, and means we have direct control when matching our animations to movement.</p>
<h3>Video 2</h3>
<p>This video shows a test level which includes a block-based puzzle.  The movement of each block is handled via a scripted event where a climbable staircase is formed if the player uses a switch.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/l3vshN_1KCo&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/l3vshN_1KCo&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>The blocks are simple box2d objects which are attached to the world on a prismatic joint.  The prismatic joint allows a block to be moved horizontally or vertically, and can be limited within min/max values depending on how you set them up.</p>
<p>The blocks are tagged in exactly the same as a normal world collision obstacle, which means the player&#8217;s auto climb/jump code works as it would on a static obstacle.</p>
<h3>Video 3</h3>
<p>For a final look at the H3 prototype, this video shows a render test to see how we wanted things to look.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/nBtrRH9tWTc&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/nBtrRH9tWTc&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>The world itself is made up of multiple layers that are ordered to make sure all the alpha and  blending is correctly passed through the render system.  Most of the level consists of 2D quads that are textured with silhouettes of grass, branches, rocks and other objects, which gives it a very organic look.</p>
<p>Since the game was to contain a limited colour range, we experimented with some overlay effects to try and give the world more of a unique style.  As illustrated in the video, we implement a noise and sketch effect.  These effects were achieved using some basic greyscaled textures which were mapped to a full-screen quad.</p>
<h3>Our Tech and Tools in Brief</h3>
<p>We currently use Maya as our main &#8216;editor&#8217;. In Maya we have written a selection of custom exporters and plug-ins that are all derived from a generic base type which we can adapt to the specific needs of whichever game we are working on.</p>
<p>From a code point of view we mainly use open source technology which helps us enormously when it comes to getting things done quickly.  The following is a list of some of the libraries that are currently in our pipeline:-</p>
<ul class="featureslist">
<li><a href="http://www.box2d.org/" rel="external">Box2D</a> – We use this for our collision and physics in games where we only need 2D feedback.  All the Cabby levels had box2d physics for the vehicles and levels.</li>
<li><a href="http://www.freetype.org/" rel="external">Freetype</a> – When a game requires some nicely rendered fonts Freetype is used to create quad glyphs from TTF files to pass to OpenGL.</li>
<li><a href="http://www.xiph.org/downloads/" rel="external">Ogg Vorbis</a> – <a href="/air-cadets/">Air Cadets</a> used ogg for sound effect playback.  We have since switched to the AV Foundation from the iPhone SDK as it uses hardware for decompression which is much faster overall.</li>
<li><a href="http://www.lua.org/" rel="external">Lua</a> – Lua is our choice for anything script driven. Cabby for example used lua scripts for level setups so we could customise various parts without the need to ever recompile the game.</li>
<li><a href="http://www.ode.org/" rel="external">Ode</a> – This is a recent addition which will be used for any full 3D collision/physics that we will do in the future.</li>
<li><a href="http://www.libpng.org/pub/png/libpng.html" rel="external">Libpng/zlib</a> – Used to load/save our png files in both game code and exporters.</li>
</ul>
<p>Our current philosophy is to keep things very light and simple so that we don&#8217;t need to waste time creating tech, so that instead we can concentrate purely on creating games!</p>
<h3>Round Up</h3>
<p>We hope you enjoyed this first look at some of our core tech in action. In the next few weeks we will hopefully be able to show off how we&#8217;re applying it to our next game&#8230;so watch this space! If you have any questions, comments or requests for things you&#8217;d like to see in future installments of our development diaries, then please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hiddengames.co.uk/2010/03/01/dev-diary-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

