<?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>Rivtind</title>
	<atom:link href="http://www.rivtind.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rivtind.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 16 Aug 2011 20:08:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Tools pipeline</title>
		<link>http://www.rivtind.com/uncategorized/tools-pipeline/</link>
		<comments>http://www.rivtind.com/uncategorized/tools-pipeline/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 20:08:24 +0000</pubDate>
		<dc:creator>Mattias Gustavsson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rivtind.com/uncategorized/tools-pipeline/</guid>
		<description><![CDATA[I’ve been making slow but remarkably steady progress on this. There hasn’t been much to write about, as most of the code has been under-the-hood stuff, which isn’t really that interesting. So&#8217; I’ll just do a brief summary of what amounts to months of work (though at a quite leisurely pace). Basically, I’ve been working [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been making slow but remarkably steady progress on this. There hasn’t been much to write about, as most of the code has been under-the-hood stuff, which isn’t really that interesting. So&#8217; I’ll just do a brief summary of what amounts to months of work (though at a quite leisurely pace).</p>
<p>Basically, I’ve been working on the “asset conditioning pipeline” – which is to say, the scripts, tools, utilities and general technology which gets my props, characters and bits of scenery all the way from the 3D program I use and into the game, where they can be rendered to the screen. I really wanted to have an automated process for this, so that I could just set up an object or character the way I want it in Poser (the 3D program I use), and then just save that file, and have my tools pipeline do the rest. And by “the rest”, I mean quite a few things. Here’s a brief summary of the steps that happens after I’ve saved a new Poser file somewhere in the asset directory for my game.</p>
<ol>
<li>When I’m done using my machine for the day, I launch the asset conditioning program. </li>
<li>This scans through the asset directory, and detects any poser file which is new or have been changed.</li>
<li>If there are new/changed files, the conditioning tool generates a poser script file, which, when called, will load and render the files.</li>
<li>The conditioner starts Poser, and automatically starts the script (by sending key presses! – it was the only way I could get it working)</li>
<li>The script loads up each poser file in order, and renders each object from eight different directions – but also, for each direction, it renders a bunch of different images – I’ll explain way later.</li>
<li>When everything’s been rendered (which could take hours, if there’s a lot of new assets) the conditioning pipeline goes through each rendered image, and processes it into a format that can be loaded by the game. This is a bit tricky, as I want the data to both be as small as possible, and as fast as possible to draw.</li>
<li>Each image is divided up into 16 by 16 pixel tiles. This leaves us with quite a few empty tiles, and these are just discarded.</li>
<li>Next, each 16&#215;16 tile is compressed using a custom RLE compression.</li>
<li>All the images for one object is put into the same file – and what’s more, if I have several animations for an object (as with most characters), all images of all animations are put into the same file. This way, I end up with neatly packaged object files that contains everything there is for that object.</li>
<li>Finally, I look through all the tiles of an object, looking for duplicate tiles. I then get rid of the duplicates and points them to the one instance of that tile. It is amazing how much redundancy there is, especially when having lots of animations, or objects with flat colour areas.</li>
</ol>
<p>&#160;</p>
<p>So what are all those different images I render for each image? Well, here they are, for a simple wooden chest:</p>
<p><a href="http://www.rivtind.com/wp-content/uploads/2011/08/manticore_renders.png" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="manticore_renders" border="0" alt="manticore_renders" src="http://www.rivtind.com/wp-content/uploads/2011/08/manticore_renders_thumb.png" width="640" height="640" /></a> </p>
<p>From top to bottom, they are:</p>
<ol>
<li>Albedo – this is basically the diffuse, unlit texture of the model. Its “colour” if you will.</li>
<li>Depth – used to get pixel perfect depth sorting in the game</li>
<li>Normals – the surface normal of each pixel (including displacement map details) for dynamic lighting</li>
<li>Occlusion – masks off the pixels that should receive no ambient lights. Gives objects more definition</li>
<li>Specular colour – colour to apply to the highlights of the object</li>
<li>Specular power – how focused/spread out the highlights should be for each pixel. In this example, it looks similar to specular colour, but for some models it varies significantly</li>
<li>Height – this is a bit of a special one, in that it is not used for rendering. Instead, it defines the height of each pixel of the object, but stored on a flat plane. The idea is to use this data to determine where the player can walk (imagine that you could walk behind the chest, but not through it)</li>
<li>Not shown here, but there’s also a whole bunch of renders for shadows – I’m rendering shadows from 8 different direction, for each of the objects 8 directions, to be able to have some sort of dynamic shadowing. It won’t be super-smooth, but should be good enough).</li>
</ol>
<p>Occlusion and shadows are stored as 4 bits (16 levels) per pixel, to save memory. Albedo and specular colour are stored as 8 bits per pixel – serving as indices into a 16-bit palette (which is shared between both albedo and specular, and also for all images of an object). Normals are stored as two 8 bit values, with the third component being calculated on the fly. Depth, specular power and height are all 8 bits per pixel.</p>
<p>All in all, this data gives me the ability to do full dynamic lighting, and with all the different tricks, the memory overhead is workable, though perhaps not ideal.</p>
<p>I still have a few bits to finish off with the conditioning pipeline, but it feels really good to have the bulk of it done – this should allow me to focus on what I want my assets to look like, without having to waste a lot of time on getting them in the right format for the game.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rivtind.com/uncategorized/tools-pipeline/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>More Tile Generation &#8211; Going Vertical</title>
		<link>http://www.rivtind.com/manticore/more-tile-generation-going-vertical/</link>
		<comments>http://www.rivtind.com/manticore/more-tile-generation-going-vertical/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 16:31:04 +0000</pubDate>
		<dc:creator>Mattias Gustavsson</dc:creator>
				<category><![CDATA[Manticore]]></category>

		<guid isPermaLink="false">http://www.rivtind.com/manticore/more-tile-generation-going-vertical/</guid>
		<description><![CDATA[&#160; I’ve continued experimenting with my tile generation code for my Manticore engine. I’m already quite happy with the way my ground tiles are coming along, and I feel confident that I can make them into something really useful, but I also wanted to see if I could use a similar technique for generating wall [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="walltilegeneration" border="0" alt="walltilegeneration" src="http://www.rivtind.com/wp-content/uploads/2010/07/walltilegeneration_thumb.jpg" width="640" height="430" />&#160;</p>
<p>I’ve continued experimenting with my tile generation code for my Manticore engine. I’m already quite happy with the way my ground tiles are coming along, and I feel confident that I can make them into something really useful, but I also wanted to see if I could use a similar technique for generating wall tiles. I want to make some games that takes the player not only down man-made dungeons, but also natural caves or tunnels carved through rock. I think it will be tricky to get it looking just right, but the initial results look promising (at least when you put in a few props and a character to distract the viewer a bit <img src='http://www.rivtind.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). The technique is pretty much the same as for the ground tiles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rivtind.com/manticore/more-tile-generation-going-vertical/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tile Generation</title>
		<link>http://www.rivtind.com/manticore/tile-generation/</link>
		<comments>http://www.rivtind.com/manticore/tile-generation/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 18:45:51 +0000</pubDate>
		<dc:creator>Mattias Gustavsson</dc:creator>
				<category><![CDATA[Manticore]]></category>

		<guid isPermaLink="false">http://www.rivtind.com/manticore/tile-generation/</guid>
		<description><![CDATA[Being a programmer who only dabbles in art, I like tools that save having to do art work, so I try and generate things whenever I can. For my Manticore isometric engine, I would like to have nice looking terrain tiles, so I’ve started experimenting with code which generates a height-map, takes a couple of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rivtind.com/wp-content/uploads/2010/07/tilegenerator.png" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="tilegenerator" border="0" alt="tilegenerator" src="http://www.rivtind.com/wp-content/uploads/2010/07/tilegenerator_thumb.png" width="512" height="400" /></a> </p>
<p>Being a programmer who only dabbles in art, I like tools that save having to do art work, so I try and generate things whenever I can. For my Manticore isometric engine, I would like to have nice looking terrain tiles, so I’ve started experimenting with code which generates a height-map, takes a couple of plain textures and generates an isometric tile with nice slope-based terrain transitions and lighting. There’s a lot of work left until it is finished, but initial results look promising <img src='http://www.rivtind.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rivtind.com/manticore/tile-generation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Isometric Engine Lighting Test</title>
		<link>http://www.rivtind.com/manticore/isometric-engine-lighting-test/</link>
		<comments>http://www.rivtind.com/manticore/isometric-engine-lighting-test/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 19:18:11 +0000</pubDate>
		<dc:creator>Mattias Gustavsson</dc:creator>
				<category><![CDATA[Manticore]]></category>

		<guid isPermaLink="false">http://www.rivtind.com/manticore/isometric-engine-lighting-test/</guid>
		<description><![CDATA[I&#8217;ve started to do some prototyping work on Manticore, the isometric 2D graphics engine I’ll be using for my Rage and Sorrow game. The prototype is built on top of my Pixie Game Engine, and I&#8217;ve been working on some rendering scripts for Poser (the art tool I use) which renders my objects in several [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started to do some prototyping work on <strong><em>Manticore</em></strong>, the isometric 2D graphics engine I’ll be using for my Rage and Sorrow game. The prototype is built on top of my <a href="http://www.pixieuniversity.com">Pixie Game Engine</a>, and I&#8217;ve been working on some rendering scripts for Poser (the art tool I use) which renders my objects in several different ways, so that I can use them to do some nice real-time lighting.    </p>
<p>Here&#8217;s the result (and below it are the different images I render from Poser):   <br /><a href="http://www.rivtind.com/wp-content/uploads/2010/07/iso_lighting1.png" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="iso_lighting1" border="0" alt="iso_lighting1" src="http://www.rivtind.com/wp-content/uploads/2010/07/iso_lighting1_thumb.png" width="640" height="467" /></a>     <br /><a href="http://www.rivtind.com/wp-content/uploads/2010/07/iso_lighting2.png" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="iso_lighting2" border="0" alt="iso_lighting2" src="http://www.rivtind.com/wp-content/uploads/2010/07/iso_lighting2_thumb.png" width="640" height="133" /></a>     </p>
<p>What I&#8217;m actually doing here, is rendering four images in Poser &#8211; one for the basic textures, or albedo, one for the facing direction (or normal) of each pixel, and two for shadows (one for the ambient shadows and one for the shadow of a fixed directional light source). These images are then stored in a much more compact format &#8211; albedo is palettized to 8 bits per pixel, the normals are stored with 8 bits for x, 7 bits for y and 1 bit for z (for a total of 16 bits) and the shadows are stored as 8 bits per pixel (though I&#8217;m considering dropping it to 4 bits per pixel, which might work ok). Each of these are then RLE-compressed, making for quite efficient storage.</p>
<p>When I&#8217;m rendering, I do a straight forward deferred renderer (but I do it in software &#8211; no GPU acceleration in this prototype, but it will be eventually) where I render the four RLE datasets to four buffers, and then perform (linear space) lighting in a separate pass (for now, I do two full-screen directional lights and hemisphere ambient lighting, but I&#8217;ll add support for point lights next), followed by a final pass of &quot;filmic tonemapping&quot; (yeah, I got that from this years GDC presentation on Uncharted 2 <img src='http://www.rivtind.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
<p>And I&#8217;m quite happy with the result so far – If you want to see what it looks like when it is running, here’s a download link:</p>
<p> <a href="http://www.colossusentertainment.com/forumref/iso_lighting.zip"></a>
<p><a href="http://www.colossusentertainment.com/forumref/iso_lighting.zip"><font size="4">Download lighting demo</font></a></p>
<p><a href="http://www.colossusentertainment.com/forumref/iso_lighting.zip"></a>    <br />(I won&#8217;t be able to have dynamic shadows with this technology, and I guess it does look a bit funny when the light sources move and the shadows don&#8217;t, but I think I can live with that&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rivtind.com/manticore/isometric-engine-lighting-test/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rage and Sorrow &#8211; Starting out</title>
		<link>http://www.rivtind.com/rage-and-sorrow/rage-and-sorrow-starting-out/</link>
		<comments>http://www.rivtind.com/rage-and-sorrow/rage-and-sorrow-starting-out/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 20:12:43 +0000</pubDate>
		<dc:creator>Mattias Gustavsson</dc:creator>
				<category><![CDATA[Rage and Sorrow]]></category>

		<guid isPermaLink="false">http://www.rivtind.com/rage-and-sorrow/rage-and-sorrow-starting-out/</guid>
		<description><![CDATA[Do you have a dream project, one you’ve always wanted to do, but not quite gotten around to start? I have one, and I’ve finally decided to make a run for it now – I’m going to see this one done no matter how much time or effort it takes. Basically, it’s an isometric 2D, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rivtind.com/wp-content/uploads/2010/07/rageandsorrowcharacter.png" target="_blank"><img style="display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;" title="Rage and Sorrow Character" src="http://www.rivtind.com/wp-content/uploads/2010/07/rageandsorrowcharacter_thumb.png" border="0" alt="Rage and Sorrow Character" width="268" height="405" align="right" /></a>Do you have a dream project, one you’ve always wanted to do, but not quite gotten around to start? I have one, and I’ve finally decided to make a run for it now – I’m going to see this one done no matter how much time or effort it takes. Basically, it’s an isometric 2D, story driven role-playing game, with some strong puzzle elements inspired by games like Commandos or Desperados. When I think of the game, I actually think of multiple games telling different stories, but all with the same game mechanics and technology, and all set in my fantasy world Rivtind.</p>
<p>I’m only just starting out now, but I will try and document my progress on here – both regarding the game itself (or rather, the first story), which is called “Rage and Sorrow”, as well as the isometric RPG engine I’ll be building to power it, which is called “Manticore”.</p>
<p>And just to feel like I’ve properly got started, here’s a preview picture of the main character. When the game starts, you won’t know much about him or his past, but you’ll learn more about him as the story unfolds.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rivtind.com/rage-and-sorrow/rage-and-sorrow-starting-out/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

