<?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>South Winds Games :: Blog</title>
	<atom:link href="http://www.southwindsgames.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.southwindsgames.com/blog</link>
	<description>Casual Games Development</description>
	<lastBuildDate>Thu, 20 May 2010 00:53:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Inner Quest, our 4th game</title>
		<link>http://www.southwindsgames.com/blog/2010/05/19/inner-quest-our-4th-game/</link>
		<comments>http://www.southwindsgames.com/blog/2010/05/19/inner-quest-our-4th-game/#comments</comments>
		<pubDate>Thu, 20 May 2010 00:34:16 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[South Winds Games]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=210</guid>
		<description><![CDATA[Hi all!
Yeah! our fourth game is here. It is called &#8220;Inner Quest&#8220;, a match-3 game which was created having in mind the best user experience possible. We focused on make it smoother and soft, relaxing and pleasant

A video says more than a 1000 screen shots:


We are getting older, actually getting older is good for a [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all!</p>
<p>Yeah! our fourth game is here. It is called &#8220;<strong>Inner Quest</strong>&#8220;, a match-3 game which was created having in mind the best user experience possible. We focused on make it smoother and soft, relaxing and pleasant</p>
<p><span id="more-210"></span></p>
<p>A video says more than a 1000 screen shots:</p>
<div style="margin:10px; text-align:center; ">
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/CDg8vBJdRns&#038;hl=es&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/CDg8vBJdRns&#038;hl=es&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></div>
<p>We are getting older, actually getting older is good for a company but anyway when I look back I feel some nostalgy (drop a tear).</p>
<p>The road until here was hard, and it seems that the upcoming road is harder, but as long as we can make games and eat every day we will be more than fine!</p>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2010/05/19/inner-quest-our-4th-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We finally changed our look :)</title>
		<link>http://www.southwindsgames.com/blog/2010/04/23/we-finally-changed-our-look/</link>
		<comments>http://www.southwindsgames.com/blog/2010/04/23/we-finally-changed-our-look/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 02:37:16 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[South Winds Games]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=201</guid>
		<description><![CDATA[As we promissed after 2009 new year we finally changed our look  
The work was:

Redesign the logo
Update the graphics in all our games (Dylo&#8217;s Adventure is the only one with the old logo)
Redesign our site (which was the biggest challenger)
Customize the order pages at Plimus (not as easy as it sounds)
Re-skin this blog
Buy new [...]]]></description>
			<content:encoded><![CDATA[<p>As we <a href="http://www.southwindsgames.com/blog/2009/01/01/hello-world/">promissed</a> after 2009 new year we finally changed our look <img src='http://www.southwindsgames.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span id="more-201"></span><br />
The work was:</p>
<ul>
<li>Redesign the logo</li>
<li>Update the graphics in all our games (Dylo&#8217;s Adventure is the only one with the old logo)</li>
<li>Redesign our <a href="http://www.southwindsgames.com">site</a> (which was the biggest challenger)</li>
<li>Customize the <a href="http://southwindsgames.plimus.com/jsp/buynow.jsp?contractId=1661382">order pages at Plimus</a> (not as easy as it sounds)</li>
<li>Re-skin this blog</li>
<li>Buy new t-shirts with the new logo <img src='http://www.southwindsgames.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>Actually this has low priority over many things so it was a challenger to keep working on it with the time passing by.<br />
I&#8217;m really proud of the result <img src='http://www.southwindsgames.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
- Juan Pablo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2010/04/23/we-finally-changed-our-look/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simplz Zoo on Steam!</title>
		<link>http://www.southwindsgames.com/blog/2010/04/05/simplz-zoo-on-steam/</link>
		<comments>http://www.southwindsgames.com/blog/2010/04/05/simplz-zoo-on-steam/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 23:57:34 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=188</guid>
		<description><![CDATA[If you have an account on Steam you can now get Simplz Zoo with some of the Steam features like Achievements and Cloud file system.
Whatch out the free demo and full description here.

]]></description>
			<content:encoded><![CDATA[<p>If you have an account on Steam you can now get Simplz Zoo with some of the Steam features like Achievements and Cloud file system.<br />
Whatch out the free demo and full description <a href="http://store.steampowered.com/app/7470/">here</a>.<br />
<a href="http://store.steampowered.com/app/7470/"><img class="size-full wp-image-192 alignnone" style="border: 0pt none; margin: 5px;" title="Simplz Zoo on Steam" src="http://www.southwindsgames.com/blog/wp-content/uploads/2010/04/simplz_zoo_steam.png" alt="Simplz Zoo on Steam" width="188" height="145" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2010/04/05/simplz-zoo-on-steam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Airport Mania &#8211; Retail</title>
		<link>http://www.southwindsgames.com/blog/2009/12/13/airport-mania-retail/</link>
		<comments>http://www.southwindsgames.com/blog/2009/12/13/airport-mania-retail/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 15:37:09 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[South Winds Games]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=182</guid>
		<description><![CDATA[Hi!
We were (are and will be) very busy because we are working on a new pretty ambitious project: www.simplzzoo.com. We expect it to be here really soon, will talk about it later.
Airport Mania hit Retail!
Just a little picture:

See you!
- Juan Pablo
]]></description>
			<content:encoded><![CDATA[<p>Hi!<br />
We were (are and will be) very busy because we are working on a new pretty ambitious project: www.simplzzoo.com. We expect it to be here really soon, will talk about it later.<br />
Airport Mania hit Retail!<span id="more-182"></span><br />
Just a little picture:<br />
<img src="http://www.southwindsgames.com/archives/Image63.jpg" alt="Airport Mania Retail Version" /></p>
<p>See you!<br />
- Juan Pablo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2009/12/13/airport-mania-retail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Traversing an array in random order / Non repetitive Random Number Generator</title>
		<link>http://www.southwindsgames.com/blog/2009/07/20/traversing-an-array-in-random-order-non-repetitive-random-number-generator/</link>
		<comments>http://www.southwindsgames.com/blog/2009/07/20/traversing-an-array-in-random-order-non-repetitive-random-number-generator/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 17:30:38 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[LCG]]></category>
		<category><![CDATA[Linear Congruence Generator]]></category>
		<category><![CDATA[Traversing an array in random order]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=143</guid>
		<description><![CDATA[The problem is simple. You have an array and you want to traverse it in random order. 
There is a trivial solution, to sort the array:
for&#40;int i=N; i&#62;1; --i&#41; 
&#160; &#160; &#160; swap&#40; array&#91; rand&#40;&#41;%i &#93;, array&#91; i-1 &#93; &#41;;
&#8230; but what if you can&#8217;t modify the array and having an array of indexes is [...]]]></description>
			<content:encoded><![CDATA[<p>The problem is simple. You have an array and you want to traverse it in random order. <span id="more-143"></span></p>
<p>There is a trivial solution, to sort the array:</p>
<div class="codecolorer-container cpp mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span>N<span style="color: #008080;">;</span> i<span style="color: #000080;">&gt;</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span> <span style="color: #000040;">--</span>i<span style="color: #008000;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; swap<span style="color: #008000;">&#40;</span> array<span style="color: #008000;">&#91;</span> <span style="color: #0000dd;">rand</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #000040;">%</span>i <span style="color: #008000;">&#93;</span>, array<span style="color: #008000;">&#91;</span> i<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span> <span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></div>
<p>&#8230; but what if you can&#8217;t modify the array and having an array of indexes is too expensive, let&#8217;s say for example that you want to traverse all the pixels of the screen. What you actually need is a non repetitive random number generator which works in linear time. </p>
<p>There is a handy one around, it is called <a href="http://en.wikipedia.org/wiki/Linear_congruence_generator">Linear Congruential Generator</a> (LCG). This is the one most programming languages implement as their default random number generator.</p>
<p>The LCG equation is simple:<br />
<strong>X&#8217; = ( a * X + c) % m</strong><br />
Where <strong>X</strong> is the last generated number, <strong>X&#8217;</strong> is the new one, <strong>a</strong> is an arbitrary constant multiplier, <strong>c</strong> an arbitrary constant increment and <strong>m</strong> is the modulus.<br />
So this function jumps from number to number in a non sequential way, but to have a full period of <strong>m</strong> (to always fall in a different number without repeating it until <strong>m</strong> jumps) some conditions should be met:</p>
<dt>0</dt>
<dd><strong>a</strong> and <strong>c</strong> can be any finite number, positive or negative but it will be the same if they are <strong>0 <= c < m, 0 <= a < m </strong>because of the modulus operation. For <strong>c</strong> it is easy to see it, but let see it for <strong>a</strong>:<br />
Suppose we take a constant <strong>a&#8217;</strong> which is any integer number, and represent it as <strong>a&#8217; = a+m*i</strong> being <strong>a&#8217; = a%m</strong> and <strong>i = a/m</strong> (all in integer arithmetic)<br />
Then <strong>( (a&#8217;+m*i)*X + c ) % m = ( a&#8217;*X + m*i*X + c ) % m</strong><br />
since <strong>(m*i*X) % m = 0</strong> we end up with <strong>( a&#8217; * X + c ) % m</strong><br />
The next conditions are described thinking on <strong>a</strong> and <strong>c</strong> in ranges <strong>[0,m)</strong>.</dd>
<dt>1</dt>
<dd><strong>c</strong> and <strong>m</strong> should be relatively prime (coprime).  This means that they don&#8217;t have any common divisor. Example: 22 = 11*2 and 25 = 5*5. </dd>
<dt>2</dt>
<dd><strong>a-1</strong> should be divisible by all prime factors of <strong>m</strong>. Suppose <strong>m</strong> is 1176 = 2*2*2*3*7*7, <strong>a-1</strong> must be divisible by 2*3*7=42.</dd>
<dt>3</dt>
<dd><strong>a-1</strong> should be multiple of 4 if <strong>m</strong> is multiple of 4 (According to Donald E. Knuth).</dd>
</dl>
<p>The first <strong>X</strong> value can be any number, it will be the <em>seed</em>, after <strong>m</strong> iterations you will end in the same number(mod <strong>m</strong>).</p>
<p>When the LCG reach the initial value it will cycle in the same order it did the first time for ever (from a number X and the same constants you will always jump to the same number).</p>
<p>The quality of the randomness of the LCG is questionable for some critical computations, there are better random number generators, but for most requirements it is more than enough. The most important thing actually is to know what you are doing.<br />
With different constants and seeds we will have different permutations of the numbers in the range <strong>[0,m)</strong>.<br />
Now the next problem is how to pick good constants.</p>
<p>If the size of the array is known in compilation time and only one way of traversing is needed you can simply chose the numbers doing some tests.<br />
Now, if you don&#8217;t have the size of the array in compilation time and/or you need different ways of traversing the array it gets a bit more complicated.</p>
<p>Take into account that you can have an <strong>m</strong> bigger than <strong>N</strong> (the array size), when <strong>X >= N</strong> you can just discard this value in a way similar to:</p>
<div class="codecolorer-container cpp mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">do</span> <span style="color: #008000;">&#123;</span> X <span style="color: #000080;">=</span> LCG<span style="color: #008000;">&#40;</span>X,a,c,m<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span> X <span style="color: #000080;">&gt;=</span> N <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></div>
<p>We can have a table of prime numbers, but figuring out which numbers to pick to either satisfy the coprime property with <strong>c</strong> and to get close to <strong>N</strong> will be a challenge as well &#8230; </p>
<p>Other approach would be to pick <strong>m</strong> to be a power of two:<br />
 &#8211; We can be sure to satisfy the coprime condition just making <strong>c</strong> odd.<br />
 &#8211; We can reduce the modulus operation to a bit mask operation gaining constant speed.<br />
 &#8211; <strong>a</strong> can be calculated with <strong>a = ( ( s*4 )+1) &#038; (m-1)</strong> where <strong>s</strong> is just a random number bigger than 0 and <strong>a-1</strong> is multiple of 4 and divisible by all prime factors of <strong>m</strong> (which is only the number two).</p>
<p>There are two disadvantages about using a power of two as <strong>m</strong> .<br />
 &#8211; First, we can end up with up to the double less one iterations to calculate all the <strong>X</strong>; <strong>N</strong> can be far away from <strong>m</strong><br />
 &#8211; The quality of the random numbers generated is less because of the power of two modulus, the low bits of <strong>X</strong> will vary in a smaller cycle than <strong>m</strong> (this can be compensated with the discard behavior).</p>
<p>With this in mind you can create a templated <a href="http://www.sgi.com/tech/stl/ForwardIterator.html">forward iterator</a> to just traverse any container which accepts <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">random access iterators</a>.</p>
<p>See you,<br />
- Juan Pablo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2009/07/20/traversing-an-array-in-random-order-non-repetitive-random-number-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful Open Source Libraries</title>
		<link>http://www.southwindsgames.com/blog/2009/03/29/useful-open-source-libraries/</link>
		<comments>http://www.southwindsgames.com/blog/2009/03/29/useful-open-source-libraries/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 20:32:39 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[Legal]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[irrxml]]></category>
		<category><![CDATA[jpeglib]]></category>
		<category><![CDATA[libjpeg]]></category>
		<category><![CDATA[libpng]]></category>
		<category><![CDATA[license]]></category>
		<category><![CDATA[ogg vorvis]]></category>
		<category><![CDATA[open source libraries]]></category>
		<category><![CDATA[theora]]></category>
		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=104</guid>
		<description><![CDATA[Of course you won&#8217;t program everything from scratch, but there are situations where you can hesitate to create your own libraries or not.
In many cases the work involved and the results you can achieve with your own libraries is enough to satisfy your requirement but in other situations it isn&#8217;t even close.
One of the best [...]]]></description>
			<content:encoded><![CDATA[<p>Of course you won&#8217;t program everything from scratch, but there are situations where you can hesitate to create your own libraries or not.<br />
In many cases the work involved and the results you can achieve with your own libraries is enough to satisfy your requirement but in other situations it isn&#8217;t even close.<br />
One of the best things of programming in C/C++ is that there is plenty of resources of any kind to satisfy a wide variety of needs, usually there is more than one solution for one requirement.<span id="more-104"></span><br />
There are Open Source and Closed Source libraries, and they can be free or paid, maybe free for non commercial projects or under a specific license.<br />
Not all Open Source libraries are free, and even not all the free ones can be used in commercial projects, even more, there are some of them that allows you to dynamically link to your code for commercial use but not to statically link. Some licenses requires you to make the source of your project public. Many licenses as well require you to make public the changes you made to the library so you share any possible improvement.</p>
<p>Here at South Winds Games we use many 3rd party libraries.</p>
<p><a href="http://zlib.net/"><img alt="ZLIB" src="http://zlib.net/images/zlib3d-b1.png" title="ZLIB" width="92" height="51" class="alignleft"  /></a><br />
For compressing and decompressing data we use the <a href="http://zlib.net/ "><strong>ZLIB</strong></a><br />
Zlib is very handy and easy to integrate and it has a <a href="http://zlib.net/zlib_license.html">very permissive license</a>, you can statically link it to your code and you don&#8217;t need to even name them (we prefer to do it). ZLib is fast and well documented, it has been written in C so it has bindings to many languages, it is completely multi-platform. I don&#8217;t thing there is a replacement for it.</p>
<p><a href="http://www.ambiera.com/irrxml/"><img alt="" src="http://www.ambiera.com/irrxml/images/irrxml_titleright.png" title="IrrXML" class="alignright" width="196" height="64" /></a><br />
For reading XML we use <a href="http://www.ambiera.com/irrxml/"><strong>irrXML</strong></a>, we tried many other like <a href="http://www.grinninglizard.com/tinyxml/"><strong>TinyXML</strong></a> and <a href="http://www.xmlsoft.org/"><strong>libxml</strong></a>  bur IrrXML situed best for our requirements.<br />
IrrXML uses the same license of ZLIB. One problem IrrXML has is that it doesn&#8217;t support UTF-8 despite it says it does, but it works perfectly with all the other encodings.<br />
IrrXML doesn&#8217;t provides a tool to write xml files, so we coded our own. If you were looking for a tool to write XML in UTF8 format (the only format it supports) here you can grab ours: <a href='http://www.southwindsgames.com/blog/wp-content/uploads/2009/03/xmlwriter.zip'>xmlwriter</a> (it has a zlib license as well). IrrXML is a C++ library and I guess it is only supported in C++, it works on Mac OS X on Intel and PowerPC computers as well as Windows, it should work on Linux as well.</p>
<p><a href="http://www.libpng.org/pub/png/libpng.html"><img alt="libpng" class="alignleft" src="http://www.libpng.org/pub/png/img_png/libpng.png" title="libpng" width="91" height="41" /></a><br />
To read PNG graphic files we use <a href="http://www.libpng.org/pub/png/libpng.html"><strong>libpng</strong></a>. The libpng library internally uses the zlib so you should take this into account to only have one instance of the zlib in your linking process. The libpng is distributed with the the zlib license and there are plenty of bindings for many languages as it has been written in C. It is updated regularly.</p>
<p><a href="http://www.ijg.org/"><img alt="" src="http://fmorg.sourceforge.net/pics/jpeglib.jpg" title="jpeglib" class="alignright" width="88" height="31" /></a><br />
We also use the <a href="http://www.ijg.org/">jpeglib</a> which allow us to read JPEG graphic files. This library was last updated in 1998 but it seems that it isn&#8217;t a problem.<br />
This library has a different license which require you to add this line in a part of your software documentation (the readme would be the best place).</p>
<blockquote><p>&#8220;this software is based in part on the work of the Independent JPEG Group&#8221;.</p></blockquote>
<p>Also the lib has been written in C and it shouldn&#8217;t take too much work to bind it to other languages.</p>
<p><a href="http://www.xiph.org/"><img alt="" src="http://www.xiph.org/images/logos/fish_xiph_org.png" title="xiph" class="alignleft" width="245" height="61" /></a><br />
From the xiph open source community we use two very important libraries and archive formats, both related to media, one for sound and other for video.</p>
<p><a href="http://www.xiph.org/downloads"><img src="http://www.southwindsgames.com/blog/wp-content/uploads/2009/03/images.jpg" alt="ogg vorbis" title="ogg vorbis" width="131" height="87" class="alignright size-full wp-image-122" /></a><br />
For sound we use the <a href="http://www.vorbis.com/">Ogg-Vorbis</a> royalty free format. The quality obtained with the ogg format is head to head with the mp3&#8217;s one and if you use the famous <strong>mp3</strong> format you <strong>must pay royalties</strong>, both are very similar one is free, the decision is easy.</p>
<p><a href="http://www.xiph.org/downloads"><img src="http://www.southwindsgames.com/blog/wp-content/uploads/2009/03/images2.jpg" alt="Theora" title="Theora" width="129" height="86" class="alignleft size-full wp-image-126" /></a><br />
For video playback we had the non reliable CODEC problem: You can use the operative system services to stream video, you have directshow on windows or the Windows Video Api and QuickTime on MacOs X but unfortunately Windows only had very bad codecs installed by default. Other option is to include the codecs on the download, but as well many of them require royalties, so we opted for the multi-platform royalty free way of doing the things. Theora is not hardware accelerated so it uses the CPU to decode the video which is not a fast process, but it is well optimized to run smoothly on a Pentium III 750 mhz (our low-end testing machine).</p>
<p>Both libraries are written in C and well <a href="http://www.xiph.org/doc/">documented</a>, there are bindings to many languages for them.<br />
Both libraries use the BSD license which is a variation of the MIT license. This allow you to close the code and use it on commercial projects, but you must include somewhere in your software documentation the copyright license included in the library.</p>
<p>We recommend you to <strong>read all the licenses of all the libraries you are using</strong>, some libraries aren&#8217;t as permissive and some others may require you to mention them or show in your software the copyright message attached to the library.</p>
<p>- Juan Pablo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2009/03/29/useful-open-source-libraries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Best of Casual Gameplay 2008 &#8211; Airport Mania</title>
		<link>http://www.southwindsgames.com/blog/2009/01/29/best-of-casual-gameplay-2008-airport-mania/</link>
		<comments>http://www.southwindsgames.com/blog/2009/01/29/best-of-casual-gameplay-2008-airport-mania/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 03:06:14 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[South Winds Games]]></category>
		<category><![CDATA[Airport Mania]]></category>
		<category><![CDATA[Best of casual gameplay 2008 - time managment]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=65</guid>
		<description><![CDATA[
Jayisgames.com (a very important game news and reviews site) has just published the results of its annual Best of the year, and it was a really nice surprise to find Airport Mania as the winner in the Time Management category.

The article describes why it was chosen capturing the essence of the game in a very [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="Airport Mania - Best of 2008" src="http://jayisgames.com/images/bestof2008-award.png" title="Airport Mania - Best of 2008" width="65" height="70" class="alignright" /><br />
<em>Jayisgames.com</em> (a very important game news and reviews site) has just published the results of its annual <em>Best of the year</em>, and it was a really nice surprise to find <strong>Airport Mania</strong> as the <strong>winner</strong> in the Time Management category.<br />
<span id="more-65"></span><br />
The article describes why it was chosen capturing the essence of the game in a very faithful way.</p>
<p>You may want to read the full article:<br />
<a href="http://jayisgames.com/best-of/2008/download/time-management-or-simulation/">Nominations</a><br />
<a href="http://jayisgames.com/best-of/2008/download/time-management-or-simulation-results/">And the winner is &#8230;</a></p>
<p>Have a happy day as me <img src='http://www.southwindsgames.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
- Juan Pablo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2009/01/29/best-of-casual-gameplay-2008-airport-mania/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fast Integer Log2 function in C/C++</title>
		<link>http://www.southwindsgames.com/blog/2009/01/19/fast-integer-log2-function-in-cc/</link>
		<comments>http://www.southwindsgames.com/blog/2009/01/19/fast-integer-log2-function-in-cc/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 03:14:14 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[log2]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[optimized]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=48</guid>
		<description><![CDATA[Some times, it happens that you need to have a high performance function that you usually use in a not optimized way. And since you never needed to optimize it you hesitated before realising it can be severly improved. Probably, this is what you would think of the integer log2 function, in general this function [...]]]></description>
			<content:encoded><![CDATA[<p>Some times, it happens that you need to have a high performance function that you usually use in a not optimized way. And since you never needed to optimize it you hesitated before realising it can be severly improved. Probably, this is what you would think of the integer log2 function, in general this function is used on not critic code so it can be &#8220;slow&#8221; without creating any problem (often used to calculate the size of a power of 2 texture to hold an image)<span id="more-48"></span></p>
<p>The usual way of calculating this log2 function is testing until the base elevated to the log is bigger than the value. This is easy with the << operator.<br />
This function returns the <strong>truncated to the integer unit log2 of value</strong>:</p>
<div class="codecolorer-container cpp mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">inline</span> <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> iLog2<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> value<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> l <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span> <span style="color: #008000;">&#40;</span>value <span style="color: #000080;">&gt;&gt;</span> l<span style="color: #008000;">&#41;</span> <span style="color: #000080;">&gt;</span> <span style="color: #0000dd;">1</span> <span style="color: #008000;">&#41;</span> <span style="color: #000040;">++</span>l<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> l<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>Easy, isn&#8217;t it? And it is quite fast! you will do 8 comparations to return the log2 of 256.<br />
But what if we do a binary search instead of this linear search &#8230;</p>
<div class="codecolorer-container cpp mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">inline</span> <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> Log2<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> value<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> f<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span>, s<span style="color: #000080;">=</span><span style="color: #0000dd;">32</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span>s<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; s<span style="color: #000080;">&gt;&gt;=</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> value <span style="color: #000080;">&gt;</span> <span style="color: #0000dd;">1</span><span style="color: #000080;">&lt;&lt;</span><span style="color: #008000;">&#40;</span>f<span style="color: #000040;">+</span>s<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> f<span style="color: #000040;">+</span><span style="color: #000080;">=</span>s<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> f<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>Even faster since we will be doing a fixed number of comparations.<br />
And so, if they are fixed &#8230;</p>
<div class="codecolorer-container cpp mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">inline</span> <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> ilog2<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">register</span> <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> x<span style="color: #008000;">&#41;</span> <br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">register</span> <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> l<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>x <span style="color: #000080;">&gt;=</span> <span style="color: #0000dd;">1</span><span style="color: #000080;">&lt;&lt;</span><span style="color: #0000dd;">16</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> x<span style="color: #000080;">&gt;&gt;=</span><span style="color: #0000dd;">16</span><span style="color: #008080;">;</span> l<span style="color: #000040;">|</span><span style="color: #000080;">=</span><span style="color: #0000dd;">16</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>x <span style="color: #000080;">&gt;=</span> <span style="color: #0000dd;">1</span><span style="color: #000080;">&lt;&lt;</span><span style="color: #0000dd;">8</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> x<span style="color: #000080;">&gt;&gt;=</span><span style="color: #0000dd;">8</span><span style="color: #008080;">;</span> l<span style="color: #000040;">|</span><span style="color: #000080;">=</span><span style="color: #0000dd;">8</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>x <span style="color: #000080;">&gt;=</span> <span style="color: #0000dd;">1</span><span style="color: #000080;">&lt;&lt;</span><span style="color: #0000dd;">4</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> x<span style="color: #000080;">&gt;&gt;=</span><span style="color: #0000dd;">4</span><span style="color: #008080;">;</span> l<span style="color: #000040;">|</span><span style="color: #000080;">=</span><span style="color: #0000dd;">4</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>x <span style="color: #000080;">&gt;=</span> <span style="color: #0000dd;">1</span><span style="color: #000080;">&lt;&lt;</span><span style="color: #0000dd;">2</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> x<span style="color: #000080;">&gt;&gt;=</span><span style="color: #0000dd;">2</span><span style="color: #008080;">;</span> l<span style="color: #000040;">|</span><span style="color: #000080;">=</span><span style="color: #0000dd;">2</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>x <span style="color: #000080;">&gt;=</span> <span style="color: #0000dd;">1</span><span style="color: #000080;">&lt;&lt;</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> l<span style="color: #000040;">|</span><span style="color: #000080;">=</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> l<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>You can hardcode the answers and the bit settings, and this one compiles really well!<br />
If you want to go further you can expand the <em>if</em>s to 32 branches with 32 results, and so you will collapse the search time to the minimal (I cannot think on something better), but it is up to you if you want to go further. As well this function can be bounded with template arguments, but I don&#8217;t think this will ever pay off.</p>
<p>Probably you won&#8217;t find this function useful (except if you are here because you were looking for it), but in any case I liked this function so much and I wanted to share it because it shows us that even the most every day used things can be improved, refined, and can be prepared for different contexts. <strong>It isn&#8217;t all invented, you can keep discovering and creating</strong> <img src='http://www.southwindsgames.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>- Juan Pablo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2009/01/19/fast-integer-log2-function-in-cc/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Mouse Lag / Keyboard Lag / Direct3D Lag</title>
		<link>http://www.southwindsgames.com/blog/2009/01/15/mouse-lag-keyboard-lag-direct3d-lag/</link>
		<comments>http://www.southwindsgames.com/blog/2009/01/15/mouse-lag-keyboard-lag-direct3d-lag/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 13:06:17 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[Direct3D]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Direct3d command buffer]]></category>
		<category><![CDATA[Direct3d Lag]]></category>
		<category><![CDATA[Floaty Cursor]]></category>
		<category><![CDATA[Mouse Lag]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=41</guid>
		<description><![CDATA[If you develop for DirectX, there is one very common undesirable behavior which is not as spreaded as other problems. If you plan to create a quality product I recommend you to take the measures to prevent it.
Usually players interpret it as a mouse lag because they don&#8217;t feel the mouse responding to their commands [...]]]></description>
			<content:encoded><![CDATA[<p>If you develop for DirectX, there is one very common undesirable behavior which is not as spreaded as other problems. If you plan to create a quality product I recommend you to take the measures to prevent it.</p>
<p><span id="more-41"></span>Usually players interpret it as a mouse lag because they don&#8217;t feel the mouse responding to their commands and it is the only reference they have in the interaction with the application (on mouse based games). Other name this problem receive is &#8220;floaty cursor&#8221; since the mouse gives the sensation of being floating or sliding over a soapy surface. The Lag is not a few milisecond response lag, it can be of up to a second in some cases which makes the game unplayable.</p>
<p>Actually, the issue has nothing to do with the mouse, there are mouse input lags problems as well but this one is not the case. To better understand why a mouse lag problem isn&#8217;t a problem with the mouse handling code, you should think it as a sympthom of a seekness, but not necesarilly the cause of the problem. Most developers attempt to ignore this problem because of many reasons: they have never seen the problem, it is too much sporadic so it is really hard to track it and it doesn&#8217;t seem to be connected to any cause and so it is really hard to fix it. But you are very lucky! Here you might find a lot of valuable information about this problem.</p>
<p>The problem is tied to Direct3D, there isn&#8217;t evidence of this problem happening on OpenGL, most games that allow both render systems usually fix this problem when switching to OpenGL (so if you are a user which experiment this problem you can try doing this if the game allows you to do it)</p>
<p><strong>The real problem actually occurs in the D3D handling code, the lag experienced by the player is no other than a lag in the scene presentation</strong>.</p>
<p>It is a bit tricky to reproduce it voluntarially since it requieres many conditions and often the problem appears and dissapears with minimal changes in the program or hardware configuration. It usually happens on machines with a CPU faster than the GPU, it is not tied to any specific hardware vendor but some graphic cards are more prone to present the problem. The program also must have some characteristics, like having few instructions (low ammount of D3D commands with low geometry) and a lot of work to do (mostly a lot of pixel drawing). With those conditions given what happens is that the d3d driver queue got filled more often than can be handled, but the queue is big enough to handle many frames of instructions before overflowing, hence the lag.</p>
<p>You might think &#8220;&#8230; but I have set the flip to wait for the vertical sync!&#8221;, even worse, this won&#8217;t do other thing than increase the problem because the command will represent more delay in the queue flow. Except if you wait for the vertical sync by yourself with the WaitForVerticalBlank DirectDraw command, which is not very used because it blocks the CPU, or polling the GetVerticalBlankStatus function.</p>
<p>In any case, the vertical sync behavior can be superseded by the graphic driver, and the command queue can be filled faster than the current vertical sync so it is not a guarantee to fix the problem.</p>
<p>If you manage to reproduce the problem in your computer, you can test adding a clock to the game and so you will see that it is displaying too much back-in-time compared to the system clock. As well you can test checking the response to the keyboard, you will note so that every event seems to be delayed, but this is just a perception effect, the logic is working just on time, it is just the displaying of it the one which is delayed. You can tie a sound to the keyboard input as well, you should be hearing the sound before the graphic response.</p>
<p>Do I have to worry about this problem?, if you did an extensive Q&amp;A testing with enough number of representative machines of your target and it never appeared, and your game has not the characteristics described for this problem, I would say that you shouldn&#8217;t worry about. However, if it is the opposite, you haven&#8217;t done the Q&amp;A or your code characteristic are the ones of this problem you&#8217;d better do something about.</p>
<p>What can you do about it?</p>
<p>One of the biggest problem with this issue is the extrange behavior some cards have when handling the DX_WAIT or DX_DONOTWAIT flag in the flip or blit commands. Some cards completelly ignore the DX_DONOTWAIT flag and never return the DXERR_WASSTILLDRAWING error code which would tell you that the last frame haven&#8217;t been finished yet.</p>
<p>So the problem is to find a way to not overload the driver queue. Unfortunatelly, there isn&#8217;t any Flush command in Direct3D to do so.</p>
<p>Rendering on fixed rate wouldn&#8217;t  fix this problem, supousse you send 30 frames per second to the card but it really can only handle 29 &#8230; after 30 seconds you will have a tail of 30 frames in the driver queue.</p>
<p>You need to eighter now that the queue command queue is empty (to do a graceful frameskip in case not) or to wait at some point for the card to finish the work. A third solution would be to fill the driver queue with garbage so commands would be executed inmediatelly or not executed, but I don&#8217;t find it an apropiated solution because you can end with a severe performance penality.</p>
<p>If you work with DX9 you can use <strong>DirectX Event Queries</strong> to check if a frame has been fully processed. To do so just issue the event in the command buffer just after the Present command, then you just need to poll if this event has been processed to know if the frame has been presented. It is up to you to create a good strategy for this to not stall the CPU when polling and give it the enough flexiblity to allow the game flow smoothly.</p>
<p>Now, if you work with DX8 or DX7 it isn&#8217;t as easy, the only way known to flush the commands buffer so far is to lock for reading a surface of the flipping chain with all the consecuent drawbacks, which in our case it is mostly the CPU stall waiting for the AGP data to get into the ram. You can try to reduce them by locking just a tiny region of the surface, and locking the next surface to be used (if you have a tripple buffer). Of course you will try to lock the backbuffer surface and not the primary one (Vista Aereo doesn&#8217;t like the primary buffer to be locked).</p>
<p><strong>Locking the buffer seems to work perfectly on every machine</strong>, but you again need to create a good strategy to reduce the secondary effects, this strategy will depend on your rendering system and the one which work best for you might be different from others systems so it is a matter of testing and experiment.</p>
<p>- Juan Pablo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2009/01/15/mouse-lag-keyboard-lag-direct3d-lag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We will change our look.</title>
		<link>http://www.southwindsgames.com/blog/2009/01/01/hello-world/</link>
		<comments>http://www.southwindsgames.com/blog/2009/01/01/hello-world/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 19:37:12 +0000</pubDate>
		<dc:creator>Juan Pablo</dc:creator>
				<category><![CDATA[South Winds Games]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Logo]]></category>

		<guid isPermaLink="false">http://www.southwindsgames.com/blog/?p=1</guid>
		<description><![CDATA[Our site needs a revamp, probably it will happen when our new game gets out. But that&#8217;s not all, our logo is some years old too and it is getting old fashioned. We want to redesign it to express our vision of our work.

First we keep thinking on the same colors scheme:

The gold/orange complementary to [...]]]></description>
			<content:encoded><![CDATA[<p>Our site needs a revamp, probably it will happen when our new game gets out. But that&#8217;s not all, our logo is some years old too and it is getting old fashioned. We want to redesign it to express our vision of our work.<br />
<span id="more-1"></span><br />
First we keep thinking on the same colors scheme:<br />
<img src="http://www.southwindsgames.com/blog/wp-content/uploads/2009/01/vincent-van-gogh-noon-rest-from-work-1890.jpg" alt="vincent-van-gogh-noon-rest-from-work-1890" title="vincent-van-gogh-noon-rest-from-work-1890" width="456" height="365" class="alignnone size-full wp-image-100" /><br />
The gold/orange complementary to an aqua cyan.</p>
<p>We also thought on adding a third color but we don&#8217;t want to push it too much, maybe it will come with the time.</p>
<p>Here it is a first model we have worked out, I hope you like it.</p>
<p><img class="alignnone size-full wp-image-7" title="southwindsgames_logo_alpha1" src="http://www.southwindsgames.com/blog/wp-content/uploads/2009/01/southwindsgames_logo_alpha1.png" alt="southwindsgames_logo_alpha1" width="330" height="234" /></p>
<p>We are making a lot of changes to our organization, we keep growing and we would like those changes to be reflected in our image &#8230;</p>
<p>- Juan Pablo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southwindsgames.com/blog/2009/01/01/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
