<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF
	xmlns="http://purl.org/rss/1.0/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel rdf:about="http://feeds.garagegames.com/rss/blogs/developer/38694/">
		<title>Blog for Brian Wilson at GarageGames.com</title>
		<description>Blog feeds for Gamers and Developers in the GarageGames community.</description>
		<link>http://www.garagegames.com/</link>
		<image rdf:resource="http://www.garagegames.com/images/GarageGames_logo_small_w.gif" />
		<dc:date>2008-11-21T13:59:39+00:00</dc:date>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/38694/14752"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/38694/14718"/>
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="http://www.garagegames.com/blogs/38694/14752">
		<dc:format>text/html</dc:format>
		<dc:date>2008-05-19T21:51:17+00:00</dc:date>
		<dc:creator>Brian Wilson</dc:creator>
		<title>TGB Crowd Test pt. 2</title>
		<link>http://www.garagegames.com/blogs/38694/14752</link>
		<description>Ok, time for an update on the TGB Crowd Test Generator. Last time I unveiled my first run at my crowd generator. At the time I created several art assets to handle color variation along with 2 variants of the shirt and pants graphic to mix things up a bit.&lt;br&gt;&lt;br&gt;I've updated the system to use t2dSceneObject::setBlendColor() on a simple white template for each object. So now there is just 1 graphic for each art asset. This results in 7 different assets instead of 29 and and an exponential increase in runner variants from the previous 2178 unique possibilities:&lt;br&gt;&lt;br&gt;&lt;img src='http://www.soulsofthebanished.com/images/torque/CrowdTest002/runner_assets.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;And here a new movie with the updated code and an added background manager (again, 1 art asset using some tricks with setBlendColor(); )&lt;br&gt;&lt;br&gt;&lt;a href='http://www.youtube.com/watch?v=bFa0ROaEAhs' target=_blank&gt;www.youtube.com/watch?v=bFa0ROaEAhs&lt;/a&gt;&lt;br&gt;UPDATE: Vimeo version (much better) - &lt;a href='http://www.vimeo.com/1214676' target=_blank&gt;www.vimeo.com/1214676&lt;/a&gt;&lt;br&gt;&lt;object width=&quot;400&quot; height=&quot;300&quot;&gt;
	&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot;&gt;
	&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;
	&lt;param name=&quot;movie&quot; value=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=1214676&amp;amp;server=www.vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot;&gt;
	&lt;embed src=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=1214676&amp;amp;server=www.vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; width=&quot;400&quot; height=&quot;300&quot;&gt;
&lt;/object&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;And a couple of screenshots, this of the new game running:&lt;br&gt;&lt;img src='http://www.soulsofthebanished.com/images/torque/CrowdTest002/runner_ss2a.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;and a close-up of the action:&lt;br&gt;&lt;img src='http://www.soulsofthebanished.com/images/torque/CrowdTest002/runner_ss2.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;And now for the code. First a run-through of the variables used:&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;$UNITLAYERMIN = 5; // the closest layer of the runner anchor&lt;br&gt;$UNITLAYERMAX = 25; // the furthest layer of the runner anchor&lt;br&gt;&lt;br&gt;$CLOSELIMIT = 32.5; // the X coord for the closest runner range&lt;br&gt;$FARLIMIT = -12.5; // the Y coord for the furthest runner range&lt;br&gt;&lt;br&gt;$UNITWIDTHBASE = 10; // set the width base for runners&lt;br&gt;$UNITWIDTHVARIANT = 20; // set the +/-  width variation percentage&lt;br&gt;$UNITHEIGHTBASE = 10; // set the height base for the runners&lt;br&gt;$UNITHEIGHTVARIANT = 20; // set the +/- width variation percentage&lt;br&gt;&lt;br&gt;$UNITSPEEDBASE = 10; // set the velocity base for the runners&lt;br&gt;$UNITSPEEDVARIANT = 20; // set the +/- velocity variantion percentage&lt;br&gt;&lt;br&gt;$UNITSCALE = 25; // the degree of scale between distance variations&lt;br&gt;&lt;br&gt;$thescenegraph = sceneWindow2D.getSceneGraph(); // global for the scenegraph&lt;br&gt;&lt;br&gt;$STREAKERBOTTOM = 5; // percentage probability of runner having no pants&lt;br&gt;$STREAKERSHOES = 25; // percentage probability of runner having no shoes&lt;br&gt;$STREAKERTOP = 15; // percentage probablity of runner having no shirt&lt;br&gt;&lt;br&gt;// vars for random clothing style&lt;br&gt;// using a naming convention of:&lt;br&gt;// &amp;lt;clothingtype&amp;gt;&amp;lt;variant#&amp;gt;&lt;br&gt;// i.e. &amp;quot;shirt1&amp;quot;&lt;br&gt;&lt;br&gt;$CLOTHINGPANTVAR = 2; // there are 2 pant graphic variants&lt;br&gt;$CLOTHINGSHIRTVAR = 2; // there are 2 shirt graphic variants&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;And the generator:&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;function newRunner()&lt;br&gt;{&lt;br&gt;   %thislayer = getRandom($UNITLAYERMIN,$UNITLAYERMAX);&lt;br&gt;   %rangeY = $CLOSELIMIT-$FARLIMIT;&lt;br&gt;&lt;br&gt;   // algo to determine runners location in the depth field&lt;br&gt;   // 5% - Closest Quarter&lt;br&gt;   // 13% - 2nd Closest Quarter&lt;br&gt;   // 15% - 3rd Closest Quarter&lt;br&gt;   // 66% - Furthest Quarter&lt;br&gt;   %rangeFinder = getRandom(1,100);&lt;br&gt;   if(%rangeFinder&amp;gt;95){&lt;br&gt;     %rangeYhigh = $CLOSELIMIT;&lt;br&gt;     %rangeYlow = (%rangeY/4)*3;&lt;br&gt;     %speedmod = 1.50;&lt;br&gt;   } else if(%rangeFinder&amp;gt;82) {&lt;br&gt;     %rangeYhigh = (%rangeY/4)*3;&lt;br&gt;     %rangeYlow = (%rangeY/4)*2;&lt;br&gt;     %speedmod = 1.25;&lt;br&gt;   } else if(%rangeFinder&amp;gt;67){&lt;br&gt;     %rangeYhigh = (%rangeY/4)*2;&lt;br&gt;     %rangeYlow = (%rangeY/4);&lt;br&gt;     %speedmod = 1;&lt;br&gt;   } else {&lt;br&gt;     %rangeYhigh = (%rangeY/4);&lt;br&gt;     %rangeYlow = $FARLIMIT;&lt;br&gt;     %speedmod = 0.75;&lt;br&gt;   }&lt;br&gt;   %coordY = getRandom(%rangeYlow, %rangeYhigh);   &lt;br&gt;   &lt;br&gt;   // set the runners height and width /w variant factored&lt;br&gt;   // and then scale it based on location in depth field&lt;br&gt;   %sizebaseX = getRandom($UNITWIDTHBASE-($UNITWIDTHVARIANT/$UNITWIDTHBASE),&lt;br&gt;                        $UNITWIDTHBASE+($UNITWIDTHVARIANT/$UNITWIDTHBASE));&lt;br&gt;   %sizebaseY = getRandom($UNITHEIGHTBASE-($UNITHEIGHTVARIANT/$UNITHEIGHTBASE),&lt;br&gt;                        $UNITHEIGHTBASE+($UNITHEIGHTVARIANT/$UNITHEIGHTBASE));&lt;br&gt;   %sizescale = (%coordY+50)/($UNITSCALE+100);&lt;br&gt;   %size = %sizebaseX*%sizescale@&amp;quot; &amp;quot;@%sizebaseY*%sizescale;&lt;br&gt;   &lt;br&gt;   // spawn the root layer of the runner&lt;br&gt;   %runner = new t2dAnimatedSprite() {&lt;br&gt;      scenegraph = $thescenegraph;&lt;br&gt;      imageMap = &amp;quot;runnerBaseImageMap&amp;quot;; // &lt;br&gt;      canSaveDynamicFields = &amp;quot;0&amp;quot;;&lt;br&gt;      Position = &amp;quot;-76 &amp;quot; @ %coordY; //spawn on left side offscreen&lt;br&gt;      class = &amp;quot;runnerClass&amp;quot;;&lt;br&gt;      size=%size;&lt;br&gt;      WorldLimitCallback = &amp;quot;1&amp;quot;;&lt;br&gt;      WorldLimitMax = &amp;quot;75 100&amp;quot;;&lt;br&gt;      WorldLimitMin = &amp;quot;-85 -100&amp;quot;;&lt;br&gt;      WorldLimitMode = &amp;quot;KILL&amp;quot;;&lt;br&gt;   };&lt;br&gt;   %runner.playAnimation(runnerBaseAnimation);&lt;br&gt;   %runner.setLayer(%thislayer);&lt;br&gt;   // set the speed based on base modded by variant range and depth field loc&lt;br&gt;   %runner.setLinearVelocityX(getRandom(($UNITSPEEDBASE-&lt;br&gt;                        ($UNITSPEEDVARIANT/$UNITSPEEDBASE))*%speedmod, &lt;br&gt;                        ($UNITSPEEDBASE+($UNITSPEEDVARIANT/$UNITSPEEDBASE))&lt;br&gt;                        *%speedmod));&lt;br&gt;&lt;br&gt;   // spawn the skin layer and mount it behind the root   &lt;br&gt;   %runnerSkin = new t2dAnimatedSprite() {&lt;br&gt;      scenegraph = $thescenegraph;&lt;br&gt;      imageMap = &amp;quot;skinImageMap&amp;quot;;&lt;br&gt;      canSaveDynamicFields = &amp;quot;0&amp;quot;;&lt;br&gt;      class = &amp;quot;runnerClass&amp;quot;;&lt;br&gt;      size=%size;&lt;br&gt;      WorldLimitCallback = &amp;quot;1&amp;quot;;&lt;br&gt;      WorldLimitMax = &amp;quot;75 100&amp;quot;;&lt;br&gt;      WorldLimitMin = &amp;quot;-85 -100&amp;quot;;&lt;br&gt;      WorldLimitMode = &amp;quot;KILL&amp;quot;;&lt;br&gt;   };&lt;br&gt;   // generate the skin shade darkness&lt;br&gt;   %shade=getRandom(441, 1000)/1000;&lt;br&gt;   // generate the skin pigment and modify it by the shade&lt;br&gt;   // my starting color for skin was R252G228B186. Based on a shift of&lt;br&gt;   // +/- 20 degrees hue and +/- 50 lightness (what looked good in my tool)&lt;br&gt;   // I shifted the skin to +20deg hue and +50 lightness to figure out what&lt;br&gt;   // 100%/100%/100% would be for my top color, which ended up being&lt;br&gt;   // R254G253B221. I then shifted from my base&lt;br&gt;   // color to -20%deg Hue and +50 lightness to figure out my low hue shift of&lt;br&gt;   // R254G231B221. Now, knowing that R and B do not shift in my hue range,&lt;br&gt;   // I only needed to shift G from 91.3% to 100%. I took my base skin color&lt;br&gt;   // again and shifted it to -20% hue, -50% lightness to get my darkest pigment&lt;br&gt;   // which was R126G103B093 or R49.6%G40.7%B42.1%. I averaged these percentages&lt;br&gt;   // to 44.1%. So once I  apply my green shift, then apply the shading of&lt;br&gt;   // 44.1% to 100%.&lt;br&gt;   %runnerSkin.setBlendColor(%shade@&amp;quot; &amp;quot;@&lt;br&gt;                        (getRandom(913, 1000)/1000)*%shade@&amp;quot; &amp;quot;@%shade@&amp;quot; 1&amp;quot;);&lt;br&gt;   %runnerSkin.playAnimation(&amp;quot;skinAnimation&amp;quot;);&lt;br&gt;   %runnerSkin.setLayer(%thislayer+1); // place behind root&lt;br&gt;   %runnerSkin.mount(%runner, &amp;quot;0.000 0.000&amp;quot;); // mount to center of root&lt;br&gt;&lt;br&gt;&lt;br&gt;   // spawn the shoe layer and mount it (if runner isn't streaking)&lt;br&gt;   if(getRandom(1,100)&amp;gt;$STREAKERSHOES){&lt;br&gt;      %shoes = &amp;quot;shoes1&amp;quot;;&lt;br&gt;      %runnerShoes = new t2dAnimatedSprite() {&lt;br&gt;         scenegraph = $thescenegraph;&lt;br&gt;         imageMap = %shoes@&amp;quot;ImageMap&amp;quot;;&lt;br&gt;         canSaveDynamicFields = &amp;quot;0&amp;quot;;&lt;br&gt;         class = &amp;quot;runnerClass&amp;quot;;&lt;br&gt;         size=%size;&lt;br&gt;         WorldLimitCallback = &amp;quot;1&amp;quot;;&lt;br&gt;         WorldLimitMax = &amp;quot;75 100&amp;quot;;&lt;br&gt;         WorldLimitMin = &amp;quot;-85 -100&amp;quot;;&lt;br&gt;         WorldLimitMode = &amp;quot;KILL&amp;quot;;&lt;br&gt;      };&lt;br&gt;      %runnerShoes.setBlendColor((getRandom(25, 100)/100)@&amp;quot; &amp;quot;@&lt;br&gt;                           (getRandom(25, 100)/100)@&amp;quot; &amp;quot;@(getRandom(25, 100)&lt;br&gt;                           /100)@&amp;quot; 1&amp;quot;);&lt;br&gt;      %runnerShoes.playAnimation(%shoes@&amp;quot;Animation&amp;quot;);&lt;br&gt;      %runnerShoes.setLayer(%thislayer-1);&lt;br&gt;      %runnerShoes.mount(%runner, &amp;quot;0.000 0.000&amp;quot;);&lt;br&gt;   }&lt;br&gt;&lt;br&gt;   // spawn the pants layer and mount it (if runner isn't streaking)&lt;br&gt;   if(getRandom(1,100)&amp;gt;$STREAKERBOTTOM){&lt;br&gt;      // there are 2 pant variants to chose from&lt;br&gt;      %pants = &amp;quot;pants&amp;quot;@getRandom(1,$CLOTHINGPANTSVAR);&lt;br&gt;      %runnerPants = new t2dAnimatedSprite() {&lt;br&gt;         scenegraph = $thescenegraph;&lt;br&gt;         imageMap = %pants@&amp;quot;ImageMap&amp;quot;;&lt;br&gt;         canSaveDynamicFields = &amp;quot;0&amp;quot;;&lt;br&gt;         class = &amp;quot;runnerClass&amp;quot;;&lt;br&gt;         size=%size;&lt;br&gt;      };&lt;br&gt;      %runnerPants.setBlendColor((getRandom(25, 100)/100)@&amp;quot; &amp;quot;@&lt;br&gt;                           (getRandom(25, 100)/100)@&amp;quot; &amp;quot;@(getRandom(25, 100)&lt;br&gt;                           /100)@&amp;quot; 1&amp;quot;);&lt;br&gt;      %runnerPants.playAnimation(%pants@&amp;quot;Animation&amp;quot;);&lt;br&gt;      %runnerPants.setLayer(%thislayer-2);&lt;br&gt;      %runnerPants.mount(%runner, &amp;quot;0.000 0.000&amp;quot;);&lt;br&gt;   }&lt;br&gt;&lt;br&gt;&lt;br&gt;   if(getRandom(1,100)&amp;gt;$STREAKERTOP){&lt;br&gt;      // there are 2 shirt variants to chose from&lt;br&gt;      %shirt = &amp;quot;shirt&amp;quot;@getRandom(1,$CLOTHINGSHIRTVAR);&lt;br&gt;      %runnerShirt = new t2dAnimatedSprite() {&lt;br&gt;         scenegraph = $thescenegraph;&lt;br&gt;         imageMap = %shirt@&amp;quot;ImageMap&amp;quot;;&lt;br&gt;         canSaveDynamicFields = &amp;quot;0&amp;quot;;&lt;br&gt;         class = &amp;quot;runnerClass&amp;quot;;&lt;br&gt;         size=%size;&lt;br&gt;         WorldLimitCallback = &amp;quot;1&amp;quot;;&lt;br&gt;         WorldLimitMax = &amp;quot;75 100&amp;quot;;&lt;br&gt;         WorldLimitMin = &amp;quot;-85 -100&amp;quot;;&lt;br&gt;         WorldLimitMode = &amp;quot;KILL&amp;quot;;&lt;br&gt;      };&lt;br&gt;      %runnerShirt.setBlendColor((getRandom(25, 100)/100)@&amp;quot; &amp;quot;@&lt;br&gt;                           (getRandom(25, 100)/100)@&amp;quot; &amp;quot;@(getRandom(25, 100)&lt;br&gt;                           /100)@&amp;quot; 1&amp;quot;);&lt;br&gt;      %runnerShirt.playAnimation(%shirt@&amp;quot;Animation&amp;quot;);&lt;br&gt;      %runnerShirt.setLayer(%thislayer-3);&lt;br&gt;      %runnerShirt.mount(%runner, &amp;quot;0.000 0.000&amp;quot;);&lt;br&gt;   }&lt;br&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;My next steps are to do one more version of the generator demo, and also to strip the thing down completely to bare bones for a simple benchmarking tool for release (~2.5MB download).</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/38694/14718">
		<dc:format>text/html</dc:format>
		<dc:date>2008-05-10T17:58:38+00:00</dc:date>
		<dc:creator>Brian Wilson</dc:creator>
		<title>TGB Crowd Test pt. 1</title>
		<link>http://www.garagegames.com/blogs/38694/14718</link>
		<description>On the advice of Kevin James from &lt;a href='http://www.garagegames.com/blogs/118249/14704'&gt;this&lt;/a&gt; blog discussion, I've decided to start posting the various toys/tools/PoCs that I create when toying with the Torque engines.&lt;br&gt;&lt;br&gt;I was an early adoptor of TGB(then T2D) and find myself coming back to it regulary with intent of pulling a game together, but I just have too much fun using it as a toy to make silly concepts come true.&lt;br&gt;&lt;br&gt;So here it is in all of its Youtube FLV artifact-riddled glory:&lt;br&gt;&lt;a href='http://www.youtube.com/watch?v=MD3_S1CWlgM' target=_blank&gt;www.youtube.com/watch?v=MD3_S1CWlgM&lt;/a&gt;&lt;br&gt;&lt;br&gt;What started out as a quite nice 720p capture of a 1400x768 TGB window got utterly pixelated by its business no matter how many knobs I twisted on my various FLV converts. So I gave up and here's what you have. Enough of the video survived to show the concept at work.&lt;br&gt;&lt;br&gt;&lt;img src='http://www.soulsofthebanished.com/images/TGB_CrowdTest01.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;Basically, what I've made is a crowd generator. Each runner is a 5-layer chain of mounted objects that are spawned randomly on the Y-axis off-screen in the -100&amp;lt; land then run toward the Happy Kill Box in the &amp;gt;100 Y-axis land. The following matrices are used in each generation:&lt;br&gt;&lt;br&gt;- 3 different skin tones&lt;br&gt;- 2 different shirts with 5 colors each&lt;br&gt;- 2 different pants with 5 colors each&lt;br&gt;- 1 set of shoes with 5 colors each&lt;br&gt;- Height baseline with a +/- 20% modifier&lt;br&gt;- Width baseline with a +/- 20% modifier&lt;br&gt;- VelocityX with a +/- 20% modifier&lt;br&gt;- Y-axis picker&lt;br&gt;- %this.setLayer(getRandom(5,25)&lt;br&gt;- sexy streaker probability algorithm&lt;br&gt;&lt;br&gt;The runners are put together with the stick-figure outline as the parent and the rest of the components are mounted to that with a layer offset, inheritting position, velocity, height offset, width offset.&lt;br&gt;&lt;br&gt;On my system I can run aproximately 6000 objects (~1250 runners) onscreen and hover at around ~45-55 FPS both in fullscreen at 1600x1050 or windowed at 1400x768. Certainly performance would be better with less background stuff running and a built project without all the editing tools enabled.&lt;br&gt;&lt;br&gt;Current Issues:&lt;br&gt;The only real issue I have so far is an obvious clash between 5-layer runners and TGB's 30-layer limit. I may look into a solution later&lt;br&gt;&lt;br&gt;Moving Forward:&lt;br&gt;I want to work in the RGBtoHSV and rotateHue resource to give my runners unlimited clothing colors as well as a broad spectrum of skin tones. But fear not, the streaker code remains in tact at all costs!&lt;br&gt;&lt;br&gt;I also still need to put in widgets for benchmarking, currently I have just setDebugOn(0) bound to a key, but I will put gui controls in for adjusting variables real-time as well as to provide performance and statistical feedback.&lt;br&gt;&lt;br&gt;Once I've beat this horse to death, I'll post the code either in a blog or as a TDN article.&lt;br&gt;&lt;br&gt;EDIT: Just to add a couple of Images:&lt;br&gt;&lt;br&gt;Close-up cross-cut of the scene:&lt;br&gt;&lt;img src='http://www.soulsofthebanished.com/images/TGB_CrowdTest03.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;And an exploded view of the 2-5 runner objects, depending on how &amp;quot;free&amp;quot; he wants to be ;p&lt;br&gt;&lt;img src='http://www.soulsofthebanished.com/images/TGB_CrowdTest02.jpg'  alt=&quot;&quot;&gt;</description>
	</item>
</rdf:RDF>
