<?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>VectorStorm Blog &#187; Engine</title>
	<atom:link href="http://www.vectorstorm.org/category/vectorstorm/engine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vectorstorm.org</link>
	<description>Creating games, one brightly glowing line at a time.</description>
	<lastBuildDate>Tue, 27 Jul 2010 13:12:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Everywhere I look, Matrices!</title>
		<link>http://www.vectorstorm.org/2010/07/06/matrices/</link>
		<comments>http://www.vectorstorm.org/2010/07/06/matrices/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 12:28:05 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=1413</guid>
		<description><![CDATA[Warning:  technical brain-dump post.  I&#8217;ll try to have something more interesting to non-techies tomorrow.  :) So there&#8217;s a major VectorStorm engine update that&#8217;ll be happening sometime in the near future;  it&#8217;s really needed for MMORPG Tycoon 2 (and any other 3D games I might feel like doing in the future). Here&#8217;s the thing.  VectorStorm was [...]]]></description>
			<content:encoded><![CDATA[<p>Warning:  technical brain-dump post.  I&#8217;ll try to have something more interesting to non-techies tomorrow.  :)</p>
<p>So there&#8217;s a major VectorStorm engine update that&#8217;ll be happening sometime in the near future;  it&#8217;s really needed for MMORPG Tycoon 2 (and any other 3D games I might feel like doing in the future).</p>
<p>Here&#8217;s the thing.  VectorStorm was written to be a 2D game engine, and so some of the things in it aren&#8217;t exactly what you&#8217;d want for a full 3D engine.  One example is its render management.  VectorStorm organises a game into a series of &#8220;layers&#8221;.  Each layer is drawn in front of the previous layer.  Now, in a game like MMORPG Tycoon 1 where your game was entirely 2D, and you wanted to make sure that your UI was being drawn in front of your game map, and tooltips were being drawn in front of the UI, and the cursor was being drawn in front of the tooltips, &#8220;layers&#8221; is a really sensible way to arrange things.  Within a layer, you couldn&#8217;t really predict how things would overlap.  So if it was important that object &#8220;A&#8221; draw in front of object &#8220;B&#8221;, you need to put object A in a higher layer than B.</p>
<p>However, in the world of 3D, we have depth buffers which handle this whole &#8220;what goes in front of what&#8221; thing for us more or less automatically.  Since MMORPG Tycoon 2 is a 3D game with a depth buffer, I mostly don&#8217;t need to draw things according to how they will overlap on screen;  the video card handles that for me.  Instead, I really want to draw according to whatever will allow the 3D card to render the game the most quickly.</p>
<p>(...)<br/>Read the rest of <a href="http://www.vectorstorm.org/2010/07/06/matrices/">Everywhere I look, Matrices!</a> (783 words)</p>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2010. |
<a href="http://www.vectorstorm.org/2010/07/06/matrices/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2010/07/06/matrices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VectorStorm trunk updated</title>
		<link>http://www.vectorstorm.org/2010/07/02/vectorstorm-trunk-updated/</link>
		<comments>http://www.vectorstorm.org/2010/07/02/vectorstorm-trunk-updated/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 12:50:53 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=1409</guid>
		<description><![CDATA[Latest engine stuff from MMORPG Tycoon 2 development has now been brought into the VectorStorm library development trunk, and the testbed games have been adjusted to work with those changes. I&#8217;ve also uploaded the first new binary builds of those testbeds for the first time in ages.  The last build was of version 164 &#8212; [...]]]></description>
			<content:encoded><![CDATA[<p>Latest engine stuff from MMORPG Tycoon 2 development has now been brought into the VectorStorm library development trunk, and the testbed games have been adjusted to work with those changes.</p>
<p>I&#8217;ve also uploaded the first new binary builds of those testbeds for the first time in ages.  The last build was of version 164 &#8212; this new one is version 1175.  The games themselves aren&#8217;t any different, but this now has the &#8220;ATI shader&#8221; fix which should have modern ATI cards able to use bloom and other shaders.  If you want to have a look, the link is in the sidebar, under &#8220;VectorStorm testbed games.&#8221;</p>
<p>If you&#8217;re interested in seeing the source code for the game library that I&#8217;ve written and use for all my games on this site, the source is publicly available under the terms of the GPL.  Details are on the page for the testbed games.</p>
<p>Now, back to MMORPG Tycoon 2 development!</p>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2010. |
<a href="http://www.vectorstorm.org/2010/07/02/vectorstorm-trunk-updated/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2010/07/02/vectorstorm-trunk-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Today</title>
		<link>http://www.vectorstorm.org/2010/07/01/today-4/</link>
		<comments>http://www.vectorstorm.org/2010/07/01/today-4/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 13:18:03 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=1404</guid>
		<description><![CDATA[So it&#8217;s been a day of maintenance.  I&#8217;ve been merging all the VectorStorm library changes back into the public library trunk.  I&#8217;m about halfway through;  I&#8217;ve got the Mac build working, I&#8217;ll get the Win32 build going tomorrow.  The screenshot here is the original 3D sample that you may remember from ages back. Notable changes: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vectorstorm.org/wp-content/uploads/2010/07/VectorStormTestbed.jpg"><img class="alignnone size-medium wp-image-1405" title="VectorStormTestbed" src="http://www.vectorstorm.org/wp-content/uploads/2010/07/VectorStormTestbed-300x193.jpg" alt="" width="300" height="193" /></a>So it&#8217;s been a day of maintenance.  I&#8217;ve been merging all the VectorStorm library changes back into the public library trunk.  I&#8217;m about halfway through;  I&#8217;ve got the Mac build working, I&#8217;ll get the Win32 build going tomorrow.  The screenshot here is the original 3D sample that you may remember from ages back.</p>
<p>Notable changes:</p>
<ul>
<li>vsMaterials are now very important.  Previously, they were a novelty, now they&#8217;re a core concept in the VectorStorm library, completely replacing the old &#8220;DrawMode&#8221;, and mostly supplanting direct setting of colors in display lists.  Materials are now loaded from data, instead of being specified in code.</li>
<li>The bloom effect is much more subdued than previously.  This is largely because of work I&#8217;ve done in MMORPG2 to make there be a smaller visual difference between bloom-enabled and bloom-disabled builds.</li>
<li>Added full lighting/fog/etc shaders &#8212; the same ones (currently) being used in MMORPG Tycoon 2.</li>
<li>vsOverlays are no longer supported.  They were cool and quirky, but they really don&#8217;t fit in with the new focus on performance.</li>
</ul>
<div>All this isn&#8217;t checked in yet.  I&#8217;ll put it in tomorrow, along with updated binaries for Win32 and OS X.</div>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2010. |
<a href="http://www.vectorstorm.org/2010/07/01/today-4/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2010/07/01/today-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VectorStorm engine improvements</title>
		<link>http://www.vectorstorm.org/2010/05/01/vectorstorm-engine-improvements/</link>
		<comments>http://www.vectorstorm.org/2010/05/01/vectorstorm-engine-improvements/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 14:21:51 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=1247</guid>
		<description><![CDATA[I&#8217;ve spent a day working on VectorStorm engine improvements, today.  Those who aren&#8217;t interested in technical details should probably skip the rest of this post;  sorry, guys! Here&#8217;s the list of improvements: 2D Display lists now correctly calculate their bounding boxes, even if there are transforms applied within the display list.  (previously, transforms within a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent a day working on VectorStorm engine improvements, today.  Those who aren&#8217;t interested in technical details should probably skip the rest of this post;  sorry, guys!</p>
<p>Here&#8217;s the list of improvements:</p>
<p>2D Display lists now correctly calculate their bounding boxes, even if there are transforms applied within the display list.  (previously, transforms within a display list were ignored for the purposes of calculating their visible size.  This probably wouldn&#8217;t have affected anyone;  it&#8217;s pretty unusual for a transform to be explicitly placed inside a display list that cares about its bounding box.</p>
<p>Bitmap font rendering now uses a vsBuffer to store each font glyph, so their data is stored on the GPU persistently, instead of needing to push explicit vertex positions and texture coordinates into the display list to draw text to the screen.  As a result, font rendering commands now only take up about a third as much system memory as they used to.  (My MMORPG Tycoon example was the string &#8220;Monster Type&#8221;, which dropped from requiring 1232 bytes of display list data to draw under the old system, to requiring only 352 bytes of display list data now that it&#8217;s using vsBuffers to store its vertex data.)</p>
<p>As a quick reminder, vsBuffer is my wrapper around OpenGL&#8217;s concept of VBOs (&#8220;Vertex Buffer Objects&#8221;), which are designed to store blobs of frequently-used data on the GPU.  The vsBuffer will also transparently fall-back to OpenGL&#8217;s older &#8220;array&#8221; functionality, for folks whose 3D cards or drivers don&#8217;t support VBOs.   Today, I have implemented interleaved VBOs within vsBuffer.</p>
<p>The old way of using vsBuffer was to give it an array of positions or colors or some other data type, and then put a command onto a display list telling the renderer what to do with the buffer.  (For example, you might tell it to use one buffer as a vertex position buffer, and another one as a normal buffer, and yet another as a texture coordinate buffer, each storing one type of data about each vertex to be drawn.)  That old code will all still work.  However, you can now use the explicit vertex formats exposed by the vsBuffer, such as &#8220;PNT&#8221;, for vertices which specify a position, a normal, and a texture coordinate.  The vsBuffer places all these bits of data together into a single OpenGL VBO, interleaved for fast access.  You bind these interleaved buffers by giving a &#8220;BindBuffer&#8221; command to the display list.  When finished, you can either give an &#8220;UnbindBuffer&#8221;, or &#8220;ClearAllArrays&#8221; command.</p>
<p>I&#8217;ve also converted the vsMesh utility class to automatically use its internal vsBuffers in interleaved mode, when it can.  So if you were already using the vsMesh or the vsMeshMaker (as I do in MMORPG Tycoon 2), you&#8217;ll automatically get this improvement.</p>
<p>With that said, I only see a moderate performance improvement on my laptop, but every little bit helps.  And I&#8217;m reliably informed that on embedded systems (such as mobile phones) that having interleaved VBOs gives substantially improved performance.  And someday I might want to look into things like that, I suppose.</p>
<p>Anyhow, as is often the case with these sorts of improvements, I&#8217;ve done this in my MMORPG Tycoon 2 development branch;  these changes haven&#8217;t yet been migrated back into the main publicly accessible VectorStorm trunk.  But I&#8217;ll get to that eventually.  :)</p>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2010. |
<a href="http://www.vectorstorm.org/2010/05/01/vectorstorm-engine-improvements/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2010/05/01/vectorstorm-engine-improvements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bugs which aren&#8217;t bugs</title>
		<link>http://www.vectorstorm.org/2009/12/28/bugs-which-arent-bugs/</link>
		<comments>http://www.vectorstorm.org/2009/12/28/bugs-which-arent-bugs/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 05:28:16 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=1010</guid>
		<description><![CDATA[Inside VectorStorm, there&#8217;s a function vsClamp;  it looks like this: #define vsClamp(a,min,max) ( vsMin( max, vsMax( min, a ) ) ) (modified for legibility;  C/C++ coders, no need to warn me about how painfully dangerous that code snippit is. ) You&#8217;d use it like this: vsClamp(1, 0, 10) -&#62; 1 vsClamp(0, 10, 20) -&#62; 10 [...]]]></description>
			<content:encoded><![CDATA[<p>Inside VectorStorm, there&#8217;s a function vsClamp;  it looks like this:</p>
<pre>#define vsClamp(a,min,max) ( vsMin( max, vsMax( min, a ) ) )</pre>
<p>(modified for legibility;  C/C++ coders, no need to warn me about how painfully dangerous that code snippit is. <img src='http://www.vectorstorm.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>You&#8217;d use it like this:</p>
<pre>vsClamp(1, 0, 10)  -&gt; 1
vsClamp(0, 10, 20) -&gt; 10
vsClamp(6, 2, 3)   -&gt; 3</pre>
<p>Effectively, you give it a number, and then a minimum and maximum legal value;  the value that pops out of the other end is the original number, clamped to within the requested range.</p>
<p>But what I&#8217;ve just discovered is that about half of my code is actually calling this function like this:</p>
<p>vsClamp( min, a, max );</p>
<p>That is, it sandwiches the value to be clamped between the minimum and maximum values.  Which actually makes a weird kind of sense, but isn&#8217;t how I actually implemented that function.  &#8221;Oh no,&#8221; I thought, &#8220;all that code is going to be doing totally the wrong thing&#8221;</p>
<p>But as it turns out, calling vsClamp(  a, min, max ) is identical to calling vsClamp( min, a, max ), which is itself identical to calling vsClamp( min, max, a ).  As long as whichever value you intend to act as the &#8216;min&#8217; is less than whichever value you intend to act as the &#8216;max&#8217;, all three are guaranteed to return the same result.</p>
<p>How bizarre is that?  :)</p>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2009. |
<a href="http://www.vectorstorm.org/2009/12/28/bugs-which-arent-bugs/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2009/12/28/bugs-which-arent-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The fun of input devices</title>
		<link>http://www.vectorstorm.org/2009/10/30/the-fun-of-input-devices/</link>
		<comments>http://www.vectorstorm.org/2009/10/30/the-fun-of-input-devices/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 11:28:01 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=944</guid>
		<description><![CDATA[So I&#8217;ve been looking around at various input devices again, and pondering about how VectorStorm might support them.  Tablets and styluses and light guns are, of course, easy, as from software&#8217;s point of view, they&#8217;re basically just mice which have cursors which ought to vanish when their buttons aren&#8217;t being held down..  the VectorStorm engine [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been looking around at various input devices again, and pondering about how VectorStorm might support them.  Tablets and styluses and light guns are, of course, easy, as from software&#8217;s point of view, they&#8217;re basically just mice which have cursors which ought to vanish when their buttons aren&#8217;t being held down..  the VectorStorm engine can handle these quite easily right now.</p>
<p>Multitouch surfaces (such as many modern laptop trackpads, iPhones, and other devices) are a little more tricky;  one could argue that they&#8217;re just multiples of the tablet &#8220;vanishing mouse&#8221;;  instead of one cursor that behaves that way, you have three or four of them.  Unfortunately, none of them are actually implemented that way in the OS, and the current version of SDL which I use doesn&#8217;t support these types of devices.  Well.. my MacBook Pro&#8217;s trackpad has a &#8220;two-finger-scrollwheel&#8221; feature which works in VectorStorm games, but only because it&#8217;s being treated as a scrollwheel.</p>
<p>Speaking of scroll wheels, it&#8217;s worth mentioning that under Windows and Linux, scroll wheels act like buttons.  They have integer &#8220;clicks&#8221;, and send a &#8220;button down&#8221; event every time they&#8217;re spun a distance of one &#8220;click&#8221;, however that&#8217;s defined for the particular mouse.  You can&#8217;t scroll by a half-click;  if you had a mouse which didn&#8217;t have &#8216;stops&#8217; on it, and you spun the wheel by half of a &#8216;click&#8217; (however far that is on that mouse), you&#8217;d get no scrolling at all.  By contrast, under Mac OS X, scroll wheels typically have no &#8216;stops&#8217;, and report a floating point distance.  The VectorStorm engine treats a scroll wheel as a digital button &#8212; that is, the extra precision available under OS X is lost.  Or to be more specific, SDL swallows that extra precision, and never shows it to VectorStorm in the first place.  Similarly, the current version of SDL does not support horizontal scroll wheels at all, either on the rare Windows mice equipped with them, or Apple&#8217;s &#8220;scroll ball&#8221; on the Mighty Mouse or two-finger scrolling on trackpads or touch-scrolling on the Magic Mouse.  SDL <em>does</em> support tilt wheels, which while still somewhat unusual, are no longer considered exotic under Windows.  On tilt wheels, the left and right tilting of the wheel shows up as two extra mouse buttons, and so can easily be mapped to functions inside VectorStorm.  I imagine that proper support for horizontal scrolling is probably going to require a new version of SDL, and even then, it probably won&#8217;t support full-resolution scrolling  under OS X.  And even if full-resolution scrolling was supported for OS X, I couldn&#8217;t actually use it for anything important, as Windows and Linux users wouldn&#8217;t have access to it, as it&#8217;s not provided at an OS level for them.</p>
<p>Most popular custom controllers like Guitar Hero guitars and Dance Dance Revolution mats are easy to support;  they&#8217;re just joysticks without the sticks.  If you can get your OS to detect them as gamepads, VectorStorm should be able to make use of them.</p>
<p>Gesture controls are, of course, big business these days, and every platform does them slightly differently.  But when you come right down to it, gesture controls are the first big thing that really doesn&#8217;t fit well into the VectorStorm input model.  Oh, sure, I briefly ported VectorPhysics (from the testbed apps) over to the iPhone, and used the accelerometer to set the gravity for the simulation.  But I couldn&#8217;t use SDL to get at the data, and passing the data through the sysInput interface was a real kludge;  sysInput is designed to handle one-dimensional data.  Passing matrices and 3D vectors through it was just awkward and unpleasant.  I don&#8217;t expect to see SDL providing support for these any time soon.</p>
<p>And things like Microsoft&#8217;s <a href="http://en.wikipedia.org/wiki/Project_Natal" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Project_Natal?referer=');">Project Natal</a> would be even more difficult to shoehorn into my current input model, which was relying on all input forms being, at a certain level, exactly the same, as they have been pretty much from the Atari 2600 up until the Wii, with only very minor evolutionary adjustments a few times per decade.</p>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2009. |
<a href="http://www.vectorstorm.org/2009/10/30/the-fun-of-input-devices/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2009/10/30/the-fun-of-input-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The return of brightly glowing</title>
		<link>http://www.vectorstorm.org/2009/06/24/the-return-of-brightly-glowing/</link>
		<comments>http://www.vectorstorm.org/2009/06/24/the-return-of-brightly-glowing/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 13:40:38 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[Full Games]]></category>
		<category><![CDATA[MMORPG Tycoon]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=586</guid>
		<description><![CDATA[So it&#8217;s been an extremely busy day today.  Today I revamped a lot of VectorStorm&#8217;s underside, in order to support this magical feature that I&#8217;ve been wanting for a while;  the ability to do the old style &#8220;bright vector glow&#8221; at the same time as rendering other geometry normally.  Long-time readers will have noticed that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vectorstorm.org/wp-content/uploads/2009/06/ReturnOfGlow.png"><img class="alignnone size-medium wp-image-587" title="ReturnOfGlow" src="http://www.vectorstorm.org/wp-content/uploads/2009/06/ReturnOfGlow-300x249.png" alt="ReturnOfGlow" width="300" height="249" /></a>So it&#8217;s been an extremely busy day today.  Today I revamped a lot of VectorStorm&#8217;s underside, in order to support this magical feature that I&#8217;ve been wanting for a while;  the ability to do the old style &#8220;bright vector glow&#8221; at the same time as rendering other geometry normally.  Long-time readers will have noticed that all glow vanished from the MMORPG Tycoon shots a month or two back, as I simply wasn&#8217;t happy with the &#8220;brightness threshhold&#8221; mechanism I was using to determine which bits of the screen glowed and which didn&#8217;t.  Now I have a system where I can mark any individual object as glowing or not, and it works (basically) as one would expect.</p>
<p>Notice, for example, in this screenshot that the red hook object is made up of stripes;  half the stripes are brightly glowing white, and the other half are non-glowing red.  Notice that the cursor outline glows, but the sky and clouds (which are both brighter than the cursor outline) are not glowing.  This sort of trick is surprisingly tricky to do!  But I&#8217;ve finally got it working, and at virtually no performance penalty.  (In fact, in MMORPG Tycoon the glow will be cheaper than in previous games, as the lack of a flat black background means that I can get away with using a slightly cheaper Gaussian blur to generate the glow effect;  the background noise helps hide the extra artifacting)</p>
<p>I&#8217;ve also fixed a more low-level performance bug which was causing VBOs to take about twice as long to render as they should have.  Nice speed boost, and it means that I can use VBOs again, instead of using display lists for everything!  Yay!</p>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2009. |
<a href="http://www.vectorstorm.org/2009/06/24/the-return-of-brightly-glowing/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2009/06/24/the-return-of-brightly-glowing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>On Optimisations</title>
		<link>http://www.vectorstorm.org/2009/06/21/on-optimisations/</link>
		<comments>http://www.vectorstorm.org/2009/06/21/on-optimisations/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 13:41:45 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[MMORPG Tycoon]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=580</guid>
		<description><![CDATA[There&#8217;s an old maxim amongst programmers, that premature optimisation is the root of all evil.  Or to put that in a less glib way, it&#8217;s generally a bad idea to perform optimisations before your program is completed, and it&#8217;s always a bad idea to perform optimisations if you have no way to check your performance [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s an old maxim amongst programmers, that premature optimisation is the root of all evil.  Or to put that in a less glib way, it&#8217;s generally a bad idea to perform optimisations before your program is completed, and it&#8217;s always a bad idea to perform optimisations if you have no way to check your performance before and after.  In practice, this means that you need to use a profiler before you start thinking about performing optimisations.</p>
<p>So apologies, but it&#8217;s another technical post.  For those who aren&#8217;t interested in programmer topics but are looking for pretty screenshots or discussions about game design, please feel free to skip this one.  Coders, hit the &#8216;Continue Reading&#8217;, below.  :)</p>
<p>(...)<br/>Read the rest of <a href="http://www.vectorstorm.org/2009/06/21/on-optimisations/">On Optimisations</a> (623 words)</p>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2009. |
<a href="http://www.vectorstorm.org/2009/06/21/on-optimisations/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2009/06/21/on-optimisations/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Sigh</title>
		<link>http://www.vectorstorm.org/2009/06/07/sigh/</link>
		<comments>http://www.vectorstorm.org/2009/06/07/sigh/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 04:44:16 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=547</guid>
		<description><![CDATA[After all that time fixing and re-fixing VectorStorm&#8217;s 3D engine stuff during the development of Lord, I just found yet another whopper of a bug in VectorStorm&#8217;s 3D projection matrix (the projection matrix is basically used to &#8216;flatten&#8217; 3D objects into a 2D plane so that they can be drawn to the screen) .  This [...]]]></description>
			<content:encoded><![CDATA[<p>After all that time fixing and re-fixing VectorStorm&#8217;s 3D engine stuff during the development of Lord, I just found yet another whopper of a bug in VectorStorm&#8217;s 3D projection matrix (the projection matrix is basically used to &#8216;flatten&#8217; 3D objects into a 2D plane so that they can be drawn to the screen) .  This one was causing everything to render stretched horizontally.. more stretched, the more widescreen the window was.</p>
<p>Mental note:  <em>tan(halfFOV)*aspectRatio</em> does not equal <em>tan(halfFOV*aspectRatio)</em>.  (It&#8217;s so obvious when you write it out like that, <em>innit</em>?)</p>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2009. |
<a href="http://www.vectorstorm.org/2009/06/07/sigh/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2009/06/07/sigh/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tinkering Under the Hood</title>
		<link>http://www.vectorstorm.org/2009/05/24/tinkering-under-the-hood/</link>
		<comments>http://www.vectorstorm.org/2009/05/24/tinkering-under-the-hood/#comments</comments>
		<pubDate>Sun, 24 May 2009 03:51:55 +0000</pubDate>
		<dc:creator>trevor</dc:creator>
				<category><![CDATA[Engine]]></category>
		<category><![CDATA[VectorStorm]]></category>

		<guid isPermaLink="false">http://www.vectorstorm.org/?p=519</guid>
		<description><![CDATA[Apologies; the following post is kind of technical.  Those who are uninterested in this sort of fiddly technical stuff can safely ignore this post;  it contains nothing at all relevant to game design.  A bunch of work under the hood of the VectorStorm engine, the past few days.  It&#8217;s mostly invisible from game code, but [...]]]></description>
			<content:encoded><![CDATA[<p>Apologies; the following post is kind of technical.  Those who are uninterested in this sort of fiddly technical stuff can safely ignore this post;  it contains nothing at all relevant to game design.  <img src='http://www.vectorstorm.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>A bunch of work under the hood of the VectorStorm engine, the past few days.  It&#8217;s mostly invisible from game code, but produces better performance in general.</p>
<p>The first big change is that I&#8217;ve created a &#8220;vsCache&#8221; class, which can handle any sort of named, reference-counted game resource (textures, files, etc).  It&#8217;s trivial to create these for anything you might want to keep cached or otherwise reference-counted.  I&#8217;ve reworked both the &#8220;vsTexture&#8221; and &#8220;vsMaterial&#8221; systems to use the vsCache system.  The system is, generally, invisible from the game code;  you still create &#8220;vsTexture&#8221; and &#8220;vsMaterial&#8221; objects from code exactly as before, but now these objects look in the cache for existing data that they can piggy-back on top of, instead of always using up extra memory for something that might be a duplicate.  This basically means that if you create sixteen identical vsMaterials, you&#8217;re not actually storing sixteen copies of the data any more, but only one.</p>
<p>Building on with that change, materials can now be loaded from text data files.  To do that, you just create a vsMaterial, passing in the filename from which to load the material definition.  Again, if that file has already been loaded into the cache, the engine won&#8217;t actually load the file, but will use the one which had previously been loaded.</p>
<p>Finally, materials now compile themselves into OpenGL display lists, which really speeds up the process of changing from one material to another while rendering the scene.  (Still <em>TODO</em> is to consider trying to make the engine automatically batch materials together, so we don&#8217;t have to keep switching back and forth between materials.  With the number of polygons I&#8217;m pushing through with each material right now, this would probably be a lot more work than it&#8217;s worth, so I&#8217;m not going to do it unless something easy occurs to me)</p>
<p>I&#8217;ve also fixed a couple of engine bugs.  One annoying bug in particular involved how the file reading classes parsed unquoted strings, which caused some strings to vanish entirely before the game code had a chance to see them.  I&#8217;ve fixed this bug in each &#8220;Game in a Week&#8221; game since <em>Robot Finds Ice Cream</em>, and keep forgetting to migrate the fix back into the core VectorStorm engine code.  I&#8217;ll remember this time, I promise!</p>
<p>I&#8217;ve also added some facilities to make sure that singletons created by engine code are accessible by game code.  All I&#8217;ll say here is that the C++ standards are basically non-existant about how static templated data should work when statically linking libraries together (and this has caused problems for me in optimised OS X builds, in particular)..  so by pairing a hash table with RTTI information, I&#8217;ve created a mechanism to make the code do what I want it to, without relying on a particular behaviour from the compiler.  (This was a critical fix, in order to get the vsCaches working)</p>
<p>I&#8217;ve also fixed an infinite loop bug in the vsHashTable, if there was a hash table collision.  Silly bug, I&#8217;d overlooked it before just because I&#8217;ve never plugged enough data into one of these to make a collision happen, until now.  And to my knowledge, nobody&#8217;s actually played with that before;  it was just something I&#8217;d put together months ago while working on localisation support, which kind of fell by the wayside once the basics were implemented.</p>
<p>These engine upgrades and bug fixes are all in the MMORPG 2.0 codebase now;  they have not yet been ported back into the public VectorStorm engine repository.  But I&#8217;ll get to that within the next few weeks (once I&#8217;m really confident with them).</p>
<p>Also, I currently have about five essays about game design half-written.  I should really finish one or more of those, so I can stop boring people with these painfully technical code updates.</p>
<hr />
<p><small>© Trevor for <a href="http://www.vectorstorm.org">VectorStorm Blog</a>, 2009. |
<a href="http://www.vectorstorm.org/2009/05/24/tinkering-under-the-hood/">Permalink</a> 
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vectorstorm.org/2009/05/24/tinkering-under-the-hood/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
