<?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>ZSpline</title>
	<atom:link href="http://www.zspline.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zspline.net/blog</link>
	<description>Developing games and self</description>
	<lastBuildDate>Sun, 06 May 2012 17:57:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Fire material showcase</title>
		<link>http://www.zspline.net/blog/2012/05/06/fire-material-showcase/</link>
		<comments>http://www.zspline.net/blog/2012/05/06/fire-material-showcase/#comments</comments>
		<pubDate>Sun, 06 May 2012 17:57:51 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[Gavit]]></category>
		<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1771</guid>
		<description><![CDATA[This latest video shows a fire material I made: (Watch it in HD on Vimeo) The base mechanic works for both meshes and particles, can be used for fires of different scales (from candle flame to forest fire) and the material&#8217;s complexity can be adjusted. More on this in the upcoming &#8220;behind the scenes&#8221; article.]]></description>
			<content:encoded><![CDATA[<p>This latest video shows a fire material I made:</p>
<div class="myvideotag" style="width: 512px;"><iframe src="http://player.vimeo.com/video/41496883?title=0&amp;byline=0&amp;portrait=0" width="512" height="390" frameborder="0"></iframe></div>
<p style="text-align: center;">(<a href="https://vimeo.com/41496883" target="_blank">Watch it in HD on Vimeo</a>)</p>
<p>The base mechanic works for both meshes and particles, can be used for fires of different scales (from candle flame to forest fire) and the material&#8217;s complexity can be adjusted. More on this in the upcoming &#8220;behind the scenes&#8221; article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/05/06/fire-material-showcase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A house</title>
		<link>http://www.zspline.net/blog/2012/04/29/a-house/</link>
		<comments>http://www.zspline.net/blog/2012/04/29/a-house/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 08:20:08 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[Gavit]]></category>
		<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1767</guid>
		<description><![CDATA[Here is one of the assets I made for the latest Gavit sub-project: It will be used to showcase my fire material.]]></description>
			<content:encoded><![CDATA[<p>Here is one of the assets I made for the latest Gavit sub-project:</p>
<p style="text-align: center;"><a rel="lightbox" title="Fireshowcase_preview.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/Fireshowcase_preview.jpg"> <img id="thumb809" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_Fireshowcase_preview.jpg" alt="" width="160" height="160" /></a></p>
<p>It will be used to showcase my fire material.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/04/29/a-house/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UniPie documentation update</title>
		<link>http://www.zspline.net/blog/2012/04/02/unipie-documentation-update/</link>
		<comments>http://www.zspline.net/blog/2012/04/02/unipie-documentation-update/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 05:06:33 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1761</guid>
		<description><![CDATA[I&#8217;ve updated the documentation for the UniPie fundraiser campaign so now it includes a special pie for numeric input fields: I also added a few example pies for different tasks: UniPie_Examples.pdf]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve updated the <a href="http://www.zspline.net/files/UniPie_Overview.pdf" target="_blank">documentation</a> for the <a href="http://www.indiegogo.com/unipie" target="_blank">UniPie fundraiser campaign</a> so now it includes a special pie for numeric input fields:</p>
<p style="text-align: center;"><a title="UniPie_Overview_page3.png" href="http://www.zspline.net/blog/wp-content/gallery/misc/UniPie_Overview_page3.png" target="_blank"> <img id="thumb808" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/misc/thumbs/thumbs_UniPie_Overview_page3.png" alt="" width="160" height="160" /></a></p>
<p>I also added a few example pies for different tasks: <a href="http://www.zspline.net/files/UniPie_Examples.pdf" target="_blank">UniPie_Examples.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/04/02/unipie-documentation-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts on pie menus</title>
		<link>http://www.zspline.net/blog/2012/03/27/thoughts-on-pie-menus/</link>
		<comments>http://www.zspline.net/blog/2012/03/27/thoughts-on-pie-menus/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 15:51:36 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1751</guid>
		<description><![CDATA[I started an IndieGoGo campaign for funding the development of UniPie, a universal pie menu system and on that occasion I decided to collect my thoughts on pie menus. Convenience is the main reason why I find pie menus useful when it comes to accessing frequently used functions: the pie appears under the cursor so [...]]]></description>
			<content:encoded><![CDATA[<p>I started an <a href="http://www.indiegogo.com" target="_blank">IndieGoGo</a> campaign for funding the development of <a href="http://www.indiegogo.com/unipie" target="_blank">UniPie</a>, a universal pie menu system and on that occasion I decided to collect my thoughts on pie menus.</p>
<p>Convenience is the main reason why I find pie menus useful when it comes to accessing frequently used functions: the pie appears under the cursor so a slight movement of the mouse selects an action. That beats targeting toolbar icons, digging through linear menus or reaching for a key combos.</p>
<p>The use of a pie menu can be greatly enhanced by arranging functions in an intuitive manner, where the movement and the invoked action have some sort of a relation. For example here is a pie menu I hacked together for Adobe Illustrator using <a href="http://www.autohotkey.com/" target="_blank">AutoHotkey</a>:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/misc/illustweaks.png" alt="http://www.zspline.net/blog/wp-content/gallery/misc/illustweaks.png" width="320" height="320" /></p>
<p>The brown slices perform arrangement actions: a small move up or down sends the selected shape forward or backward in the stack while a longer push sends it to either end. The movement of my mouse wielding hand resembles the motion of the selected shape in the stack which makes the learning curve quite shallow.</p>
<p>Or take the blue slice containing file operations: The slice points toward the top left corner where the file menu is located. Executing the &#8220;save&#8221; action requires less effort since I&#8217;ll need that quite often. Export is somewhat related but less often used so it occupies the outside slot. By the way, the blue color comes from the 3.5&#8243; floppy disk which is often used as an icon for saving. The other place where slice color is related to action is Remove Anchor where the red indicates a &#8220;dangerous&#8221;, destructive function.</p>
<p>Another example for the movement-functionality link could be one of the pie menus I use in <a href="http://www.luxology.com/modo/" target="_blank">modo</a>:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/misc/ModoPieMenu.png" alt="http://www.zspline.net/blog/wp-content/gallery/misc/ModoPieMenu.png" width="316" height="190" /></p>
<p>The down motion hides the selection (&#8220;I hide it under my desk&#8221;) while the up movement unhides everything (&#8220;I put things back up onto my desk&#8221;).</p>
<p>So with some thought intuitive arrangements can be produced and when <a href="http://en.wikipedia.org/wiki/Muscle_memory" target="_blank">muscle memory</a> develops the whole workflow becomes transparent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/03/27/thoughts-on-pie-menus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nine-slice material function in UDK</title>
		<link>http://www.zspline.net/blog/2012/03/18/nine-slice-material-function-in-udk/</link>
		<comments>http://www.zspline.net/blog/2012/03/18/nine-slice-material-function-in-udk/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 12:40:44 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[Gavit]]></category>
		<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1745</guid>
		<description><![CDATA[I needed a flexible way to create borders around things so I implemented nine-slice scaling as a material function: It takes decal projection width and height as parameters so the texture doesn&#8217;t stretch at the corners. Another parameter defines border thickness which is the absolute size of the border slices: &#160; And of course the user [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a flexible way to create borders around things so I implemented <a href="http://rwillustrator.blogspot.com/2007/04/understanding-9-slice-scaling.html" target="_blank">nine-slice scaling</a> as a material function:</p>
<table border="0" align="center">
<tbody>
<tr>
<td><a rel="lightbox" title="NineSliceScale01.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/NineSliceScale01.jpg"> <img id="thumb803" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_NineSliceScale01.jpg" alt="" width="160" height="142" /></a></td>
<td><a rel="lightbox" title="NineSliceScale02.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/NineSliceScale02.jpg"> <img id="thumb804" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_NineSliceScale02.jpg" alt="" width="160" height="142" /></a></td>
</tr>
</tbody>
</table>
<p>It takes decal projection width and height as parameters so the texture doesn&#8217;t stretch at the corners. Another parameter defines border thickness which is the absolute size of the border slices:</p>
<table border="0" align="center">
<tbody>
<tr>
<td><a rel="lightbox" title="NineSliceScale03.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/NineSliceScale03.jpg"> <img id="thumb805" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_NineSliceScale03.jpg" alt="" width="160" height="137" /></a></td>
<td><a rel="lightbox" title="NineSliceScale04.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/NineSliceScale04.jpg"> <img id="thumb806" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_NineSliceScale04.jpg" alt="" width="160" height="137" /></a></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>And of course the user can also define the location of the 4 cuts which create the 9 slices.</p>
<p>Generating the proper texture coordinates costs 24 instructions but it could be simplified by sacrificing some of the flexibility (like forcing symmetric cut positions).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/03/18/nine-slice-material-function-in-udk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Effects and UI design side project</title>
		<link>http://www.zspline.net/blog/2012/03/11/effects-and-ui-design-side-project/</link>
		<comments>http://www.zspline.net/blog/2012/03/11/effects-and-ui-design-side-project/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 13:46:39 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[Gavit]]></category>
		<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1737</guid>
		<description><![CDATA[I spent the majority of my time working on and with our effect container, the GVEffect class. GVEffects are abstract entities containing any number of basic building blocks called EffectTypes. We have particle system and decal effect types working, light and sound will be implemented later. A typical setup would look something like this: [GVEffect: [...]]]></description>
			<content:encoded><![CDATA[<p>I spent the majority of my time working on and with our effect container, the GVEffect class.</p>
<p>GVEffects are abstract entities containing any number of basic building blocks called EffectTypes. We have <em>particle system</em> and <em>decal</em> effect types working, <em>light</em> and <em>sound</em> will be implemented later. A typical setup would look something like this:</p>
<p>[<em>GVEffect</em>: FlashyExplosion]</p>
<p style="padding-left: 30px;">[0][<em>Particle system</em>: Base explosion]<br />
[1][<em>Particle system</em>: Black smoke]<br />
[2][<em>Particle system</em>: Burning ground]<br />
[3][<em>Decal</em>: Scorch mark]<br />
[4][<em>Light</em>: Explosion flash]<br />
[5][<em>Sound</em>: Explosion sound]</p>
<p>By combining different bits and pieces a wide range of different visuals can be created without the need for authoring new assets. (Of course having a decent library is recommended.) In the example above the black billowing smoke could be replaced quickly with a gray smoke puff sort to experiment with the visuals.</p>
<p>There are many additional parameters for defining the behavior of effect types like start delay or life time. Position, rotation and scale can also be set and randomized for each item.</p>
<p>GVEffects are always embedded in other entities which will create them at runtime when it&#8217;s appropriate. For example a pawn might have a GVEffect set up for spawning to make it look like the character was teleported onto the map.</p>
<p>Another example is physics material based interactions (which I implemented last week). What this means is that when two objects are in contact, the right effects are created depending on the interacting materials. For instance if a stone ball hits a reinforced glass surface the following effects will be created:</p>
<ul>
<li>Puff of stone dust (particle effect)</li>
<li>Crack on the stone ball (decal)</li>
<li>Splinters of chipped off glass (particle effect)</li>
<li>Cobweb like cracks on the glass (decal)</li>
</ul>
<p>Each material has its own set of effects for the different types of interactions: impacts, sliding, foot steps for light/medium/heavy characters, bullet/pellet/energy weapon hits, etc. The effects can be dynamically adjusted based on properties of the interaction. For example the force of an impact sets a certain parameter (called &#8220;Amount&#8221;) in the related particle systems and decal materials. What those assets actually do with that information is up to the author: a decal could change size or opacity, particle systems could vary particle number, size, speed, even turn off emitters entirely for smaller impacts.</p>
<p>While I had no trouble with impact effects, slide detection turned out to be a huge problem. Apparently I have no direct access to contact points in the physics scene which makes it rather difficult to find out which actors are in contact. I did manage to get the necessary data but the workaround is hacky, slow and not very reliable. I might revisit it in the future but it seems that I can not do better without access to lower level functions.</p>
<p>To distract myself from Gavit, I took on a side project: MCEditor. It will be a proper configuration utility for the Razer Hydra controller which to this day lacks that kind of a software. (Razer has a <em>lot</em> to learn from Logitech in this regard&#8230;) The programming is handled by a fellow Hydra owner while I&#8217;m responsible for the UI. We&#8217;re using C# and WPF and this is how it looks at the moment:</p>
<p style="text-align: center;"><a title="MCEditor10.png" href="http://www.zspline.net/blog/wp-content/gallery/misc/MCEditor10.png" rel="lightbox"> <img id="thumb802" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/misc/thumbs/thumbs_MCEditor10.png" alt="" width="160" height="134" /></a></p>
<p>This is the second major iteration of the layout. I really enjoy that the challenges are so different from the ones I usually deal with, it&#8217;s somehow refreshing. So much so that I intend to start another side project when this one is done.</p>
<p>Next week I&#8217;ll work on motion replay for rigid bodies and try to finish my earlier pinball prototype.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/03/11/effects-and-ui-design-side-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vehicles</title>
		<link>http://www.zspline.net/blog/2012/02/26/vehicles/</link>
		<comments>http://www.zspline.net/blog/2012/02/26/vehicles/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 15:17:20 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[Gavit]]></category>
		<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1706</guid>
		<description><![CDATA[I&#8217;ve been working with vehicles for two weeks now, covering both programming and asset authoring aspects of the task. On the code side I had to implement proper handbrake functionality which to my surprise was missing, added a few usability tweaks and laid the foundation of a modular car system where one will be able [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with vehicles for two weeks now, covering both programming and asset authoring aspects of the task.</p>
<p>On the code side I had to implement proper handbrake functionality which to my surprise was missing, added a few usability tweaks and laid the foundation of a modular car system where one will be able to assemble a car from different parts.<br />
I learned a few lessons while dealing with the less than neat codebase. These are the most screwed up ones:</p>
<p>- <em>SVehicle.MaxSpeed</em> doesn&#8217;t necessarily define the actual max speed of a vehicle. One should also set <em>Pawn.AirSpeed</em> high enough too.</p>
<p>- The stock handbrake system does not prevent the wheels from rolling for some reason. It only changes slip values on the tires so actually locking the wheels needs an extra function where you apply throttle based on the local velocity vector.</p>
<p>When I had my vehicle class working I started modeling the car which will be the hero of the next prototype video.</p>
<p>I&#8217;m a fan of classic muscle car designs so the vehicle was based on a Plymouth Barracuda but got the undercarriage of a Ford Mustang, tail lights from a Dodge Charger and the hood of an Oldsmobile. (Coincidentally all of them were from 1970.)</p>
<p><a title="Cuda01.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/Cuda01.jpg" target="_blank"> <img id="thumb794" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/Cuda01.jpg" alt="" width="512" height="180" /></a></p>
<p>I used the Pixar SDS implementation of modo 501 so the high poly mesh is reasonably clean.</p>
<table border="0" align="center">
<tbody>
<tr>
<td><a rel="lightbox" title="Cuda02.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/Cuda02.jpg"> <img id="thumb795" class="thumb" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_Cuda02.jpg" alt="" /></a></td>
<td><a rel="lightbox" title="Cuda03.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/Cuda03.jpg"> <img id="thumb796" class="thumb" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_Cuda03.jpg" alt="" /></a></td>
</tr>
</tbody>
</table>
<p>The SDS cage was the base for the low poly mesh which sped up the modeling process.</p>
<p>This time around I used modo (instead of Max) for object baking all surface properties: diffuse color, reflection amount and normals. The baking was performed on &#8220;exploded&#8221; versions of the objects (via a morph map) to prevent baking artifacts on surfaces close to each other:</p>
<p style="text-align: center;"><a rel="lightbox" title="Cuda04.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/Cuda04.jpg"> <img id="thumb797" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_Cuda04.jpg" alt="" width="160" height="114" /></a></p>
<p>As you can see not the whole car was baked only one half plus one extra polygon row on the other side of the mirror axis so normals are properly aligned near the cut.</p>
<p>There were extra textures, &#8220;mask maps&#8221; baked too where the red channel defines the area of the painted body while green indicates decals:</p>
<p style="text-align: center;"><a rel="lightbox" title="Cuda05.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/Cuda05.jpg?48630890"> <img id="thumb798" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_Cuda05.jpg" alt="" width="160" height="61" /></a></p>
<p>The decal texture is actually a distance field which is used by the in-game shader to produce a sharp decal mask:</p>
<p style="text-align: center;"><a rel="lightbox" title="Cuda08.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/Cuda08.jpg"> <img id="thumb801" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_Cuda08.jpg" alt="" width="160" height="60" /></a></p>
<p>Both the body paint&#8217;s and the decal&#8217;s color can be defined in a material instance along with the thickness of the decals (plus the usual surface properties).</p>
<p style="text-align: center;"><a rel="lightbox" title="Cuda06.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/Cuda06.jpg"> <img id="thumb799" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_Cuda06.jpg" alt="" width="160" height="48" /></a></p>
<p>The textures have a 2K native resolution but only the diffuse map is presented that way at the end: the specular map is fine on LOD 1 while both the normal and the mask maps are stored as uncompressed normal textures so they are automatically loaded at half resolution.</p>
<p>The uncompressed normal map not just looks smoother but also fixes the seams along the car&#8217;s forward axis where it was mirrored.</p>
<p style="text-align: center;"><a rel="lightbox" title="Cuda07.jpg" href="http://www.zspline.net/blog/wp-content/gallery/gavit/Cuda07.jpg"> <img id="thumb800" class="thumb aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/thumbs/thumbs_Cuda07.jpg" alt="" width="160" height="111" /></a></p>
<p>The following weeks I&#8217;ll tune the cars and add a few special effects like break lights, wheel smoke and damage.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/02/26/vehicles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digital input replay</title>
		<link>http://www.zspline.net/blog/2012/02/12/digital-input-replay/</link>
		<comments>http://www.zspline.net/blog/2012/02/12/digital-input-replay/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 17:11:41 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[Gavit]]></category>
		<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1699</guid>
		<description><![CDATA[During the past two weeks I spent the majority of my time programming. One of the features I got working (at least on a basic level) was matinee based digital input replay, which means that matinee can now mimic user input for both analog axes and digital buttons in order to drive GVMachines. This replay [...]]]></description>
			<content:encoded><![CDATA[<p>During the past two weeks I spent the majority of my time programming. One of the features I got working (at least on a basic level) was matinee based digital input replay, which means that matinee can now mimic user input for both analog axes and digital buttons in order to drive GVMachines. This replay of captured user performance is a fundamental feature of Gavit&#8217;s machinima support.</p>
<p>The GVMachine class is basically a bridge between an input (a joystick for instance) and a property of an actor (like the location of a box). When the input changes (the joy is pushed forward) the GVMachine translates the data and adjusts the target property accordingly (the box rises).</p>
<p>GVMachines can receive input from one of two sources: either from the user directly or from matinee. The two are handled the exact same way in a GVMachine so it can not tell the difference between them. One can even switch input sources on the fly, interrupt a matinee playback with live input or vice versa. If everything works properly then we can recreate the exact same events later using matinee.</p>
<p>Well, almost the exact same events. Handling analog data is pretty easy because by its nature changes are relatively slow (in computing terms) and gradual so interpolation between keyframes will create a pretty close representation of the original. However digital button events are a bit trickier to handle because they don&#8217;t translate well to matinee curves.</p>
<p>Let&#8217;s consider the following graph:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/ButtonMatinee01.jpg" alt="http://www.zspline.net/blog/wp-content/gallery/gavit/ButtonMatinee01.jpg" width="390" height="218" /></p>
<p>This could be an obvious representation of a button being pressed for a while: At the beginning the curve&#8217;s value is 0 then suddenly it becomes 1 when the button is pressed, stays 1 while held, until suddenly falling back to 0 on release.</p>
<p>Trouble is that we can only sample the graph every now and then, depending on how fast the game thread ticks. The time between ticks varies in a pseudo random manner which means that although we have a slim chance of learning about an event at the exact time it happens (getting a tick at 0.2 and 0.5 in this example) most of the time we will be late. A typical bad case would be sampling at 0.199: just short of noticing the state change so the next time we come around we already late by almost a full frame.</p>
<p>At this point one could suggest that if I worry about a button press being too late then why not offset the whole curve by a fixed value so events appear in the system a bit earlier thus more or less cancelling out our inherent sampling lag.<br />
This would be a reasonably good solution but there is something to consider: we can record what a GVMachine does, regardless if it was controlled by live user performance or by matinee.</p>
<p>Imagine that I try to perform a series of car stunts, 2 minutes of length. I could try and repeat the whole sequence over and over until I get every bit right. This approach would not be very efficient as a single mistake in the last second would render the whole performance useless.<br />
A better way of doing it is focusing on one short segment at a time, redoing it over and over while recording each session. When I&#8217;m happy with my performance then I convert the recorded data into a matinee and let it replay from then on automatically and consistently. That segment is &#8220;in the bank&#8221; so I can focus on the next bit: as soon the matinee replay ends (or even before) I take over and carry on the stunts. I&#8217;ve just seamlessly extended the previously recorded data. Replay, add a new segment, rinse, repeat.</p>
<p>And this &#8220;recording the replay of a previous recording&#8221; part which will run into trouble if the matinee button events keep happening consistently too early or too late: with each recording cycle the events will float off further and further in one direction.</p>
<p>To solve this I tried to make those events &#8220;wider&#8221;, easier to hit so I ended up a graph something like this:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.zspline.net/blog/wp-content/gallery/gavit/ButtonMatinee02.jpg" alt="http://www.zspline.net/blog/wp-content/gallery/gavit/ButtonMatinee02.jpg" width="390" height="218" /></p>
<p>Each button event is preceded by a warmup period (0.1 on the picture but 0.02 in the current implementation): if the sampled value is in the 0..1 range then we know that a &#8220;push&#8221; event is coming up, while if the value is between -1 and 0 then a release event is imminent. Not just that but we also know <em>when</em> something supposed to happen in the future: if we got the value of 0.5 then we know that a push event supposed to occur WarmupTime*0.5 seconds from now.<br />
By keeping track of the average time between ticks we could take an educated guess which one is closer to the real thing: this tick or the next one. In the former case we fire the event now, a bit earlier while the latter case will produce a late event in the next tick. The important thing is that regardless of too soon or too late, we picked the one which is closer to the ideal time.</p>
<p>The somewhat random timing of the sampling ticks will cause a certain event to be fired earlier in one recording cycle and later in another. This won&#8217;t stop the floating of the timing but will slow it down, hopefully to an extent where this won&#8217;t ever become a practical problem.</p>
<p>The biggest disadvantage of this approach is that events can not be closer than the warmup time, which is 0.02 seconds currently. I did some measurements and the fastest doubleclick I could reliably perform was 0.022+ long so that value seems fine for now. However this also means that the game thread must run at at least 50 Hz in order to guarantee a hit during any given warmup time, but that is a good idea to maintain for other reasons anyway.</p>
<p>Next time I&#8217;ll cover the recording part of the system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/02/12/digital-input-replay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Winter Volleyball: Behind the scenes</title>
		<link>http://www.zspline.net/blog/2012/01/28/winter-volleyball-behind-the-scenes/</link>
		<comments>http://www.zspline.net/blog/2012/01/28/winter-volleyball-behind-the-scenes/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 16:00:28 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[Gavit]]></category>
		<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1683</guid>
		<description><![CDATA[In this post I&#8217;ll discuss the creation of the Winter Volleyball prototype. As I mentioned earlier the base mechanic was inspired by the old DOS game Arcade Volleyball. Back in the mid 90&#8242;s I played it a lot with my brother and friends so I wanted to make it a two player game. I had [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I&#8217;ll discuss the creation of the <a href="http://vimeo.com/35505372" target="_blank">Winter Volleyball prototype</a>.</p>
<p><img class="alignleft" src="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_01.jpg" alt="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_01.jpg" width="160" height="100" />As I mentioned earlier the base mechanic was inspired by the old DOS game <a href="http://en.wikipedia.org/wiki/Arcade_Volleyball" target="_blank">Arcade Volleyball</a>. Back in the mid 90&#8242;s I played it a lot with my brother and friends so I wanted to make it a two player game. I had also just added a few features to the <a href="http://www.razerzone.com/minisite/hydra" target="_blank">Razer Hydra</a> integration which needed testing therefore I chose to base the controls on that input device.</p>
<p><img class="alignright" src="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_02.jpg" alt="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_02.jpg" width="192" height="120" />The season lent itself as a visual theme and I started using snowmen as main characters. At first they were just sliding back and forth but hitting the ball with the narrow top of the hat was somewhat difficult. Before going with a different avatar I linked up tilting to see if it&#8217;s fun. While it needed some tweaking, at the end this additional degree of freedom turned out to be both intuitive and useful.</p>
<p>Jumping was implemented at some point but I removed it because it wasn&#8217;t adding that much to the fun. My general goal was to make it as simple as possible so even my non-gamer mother could enjoy it. (And she did indeed, became adept quickly.) However if I ever revisit this prototype I&#8217;ll experiment with jumping again because it has the potential to provide some additional complexity, something which more experienced players (like my brother) expect.</p>
<p><img class="alignleft" src="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_03.jpg" alt="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_03.jpg" width="256" height="142" />Jumping or not, the base control rig for a snowman is the same: the physics driven pieces (hat, head, body) are constrained together with the body also being constrained to a hidden interpolation actor (the orange circular one on the image). That actor is directly controlled by the tilting of the Hydra. It&#8217;s attached to another hidden actor (with the arrows on the right), the one which is responsible for movement: swinging the Hydra horizontally makes the in-game actor move back and forth.</p>
<p>At first I used the raw rotation data from the controller but that felt sluggish near the edges of the play field. The solution was to use the <em>tangent</em> of the incoming angle which made the system work almost like aiming with a laser pointer. (Just &#8216;almost&#8217; because the position of the controller is not factored in at all, something which I&#8217;d like experiment with in the future.)</p>
<p>The reason for using separate actors for movement and rotation is simply that it was easier to debug the underlying systems during development, at the current stage I would probably use a single actor.</p>
<p>The constraint between these interpactors and the physics driven snowman is not rigid but behaves more like a rubber band. This makes movement softer, without sudden accelerations or stops. The tightness needed some tweaking so it felt smooth enough but not so much that it affected precision adversely.</p>
<div class="wp-caption alignleft" style="width: 266px"><img src="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_04.jpg" alt="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_04.jpg" width="256" height="176" />
<p class="wp-caption-text">Without contour highlights, the hat blended into the background.</p>
</div>
<p>After adding the ball (constrained to a plane) I had the core gameplay which allowed me to fine tune restitution, friction, speeds and accelerations on the participating actors. With that done came the first round of two player play testing which revealed several shortcomings from hard to see hats to unintuitive control settings. As soon as I sorted them out I finished replacing the stand-in art assets with proper ones.</p>
<p>Here too I aimed at a tasteful but fast to create visual style, just like for the rest of the Gavit prototypes: basic colors with accentuated edges emphasizing the geometry. I used modo 501 for everything from modeling to texture baking. While I didn&#8217;t make high-poly versions of the meshes I did turn their polygons into Pixar-SDS for the duration of the baking so concavity/convexity/accessibility shading produced smoother results:</p>
<div class="wp-caption aligncenter" style="width: 490px"><img src="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_05.jpg" alt="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_05.jpg" width="480" height="550" />
<p class="wp-caption-text">The subtle differences between the polygonal and SDS cliff.</p>
</div>
<p>The next step was adding special effects mainly to provide feedback about game events: the red light inside the ball foreshadows (erhm&#8230;) an imminent bounce for example. The glitter suspended in the air is not just for filling empty space with something interesting to look at but also there to help visualizing forces affecting the map.</p>
<p><img class="alignleft" src="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_06.jpg" alt="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_06.jpg" width="197" height="347" />Since the glitter was actually a PhysX fluid it automatically interacted with nxForceFields and the ball. In the latter case they simply collided with the sphere which didn&#8217;t produce an interesting enough particle movement so I tried to fake vortices in the ball&#8217;s wake: I made an ActorFollower actor which follows a target as if they were linked with a rubber band. The faster the target moves the more the follower lags behind but it does converge on the exact position at low speeds. With this system in place I simply attached a radial forcefield to this follower to get some extra swirling behind the ball.</p>
<p>There was a bug however: although the ActorFollower scaled the attached force field based on speed, it had no effect at all: its radius and strength stayed the same no matter what. This issue made the stationary ball attract nearby glitter as apparent on the video. I had no time to debug this before finishing the prototype but after posting the video I dived in to see why I can&#8217;t change force field properties on the fly. As it turns out it&#8217;s a limitation of PhysX so one must keep creating and destroying force field actors instead of changing existing ones. Unfortunately this would break all references (in Kismet for instance) so I had to introduce a new force field class: one which doesn&#8217;t actually affect the world, only there to be referenced, to store desired property values and to spawn/remove working force fields when necessary.</p>
<p>Finally here is an image showing the result of a collision hull export problem:</p>
<div class="wp-caption aligncenter" style="width: 405px"><img src="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_00.jpg" alt="http://www.zspline.net/blog/wp-content/gallery/gavit/ArcadeVolleyball_BTS_00.jpg" width="395" height="279" />
<p class="wp-caption-text">A bowling ball is not an ideal choice for this sort of game.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/01/28/winter-volleyball-behind-the-scenes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Winter Volleyball</title>
		<link>http://www.zspline.net/blog/2012/01/23/winter-volleyball/</link>
		<comments>http://www.zspline.net/blog/2012/01/23/winter-volleyball/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 14:28:33 +0000</pubDate>
		<dc:creator>Zoltan</dc:creator>
				<category><![CDATA[Gavit]]></category>
		<category><![CDATA[My projects]]></category>

		<guid isPermaLink="false">http://www.zspline.net/blog/?p=1678</guid>
		<description><![CDATA[Here is my latest prototype, a homage to Arcade Volleyball: The players use the Razer Hydra controllers: aiming at the screen moves the snowmen, twisting the wrist makes them headbutt. This project was finished in about 15 days: the core game mechanics and controls took 5 days, asset authoring was done in 6 and I [...]]]></description>
			<content:encoded><![CDATA[<p>Here is my latest prototype, a homage to <a href="http://en.wikipedia.org/wiki/Arcade_Volleyball" target="_blank">Arcade Volleyball</a>:</p>
<div class="myvideotag" style="width: 512px;"><iframe src="http://player.vimeo.com/video/35505372?title=0&amp;byline=0&amp;portrait=0" width="512" height="390" frameborder="0"></iframe></div>
<p>The players use the Razer Hydra controllers: aiming at the screen moves the snowmen, twisting the wrist makes them headbutt.</p>
<p>This project was finished in about 15 days: the core game mechanics and controls took 5 days, asset authoring was done in 6 and I spent the rest on the special effects.</p>
<p>That&#8217;s all for now, I&#8217;ll discuss the technical details in an upcoming &#8216;behind the scenes&#8217; article. <strong>EDIT</strong>: <a href="http://www.zspline.net/blog/2012/01/28/winter-volleyball-behind-the-scenes/">It&#8217;s up</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zspline.net/blog/2012/01/23/winter-volleyball/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

