tag:blogger.com,1999:blog-16873631127879351882023-11-16T02:42:25.791-05:00Code FortressRandom musings of a Game Programmer...Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-1687363112787935188.post-4091291949725629572011-05-17T11:41:00.003-04:002011-05-17T12:08:47.024-04:00Broken Marble<div><div>The past few months I've been working on a little rendering tech demo in my free time and it's my pleasure to finally be able to release it. You can check it out by downloading the demo here: <a href="http://goo.gl/m2kkv">Broken Marble</a>. In this post I'll dig a little into what went into the demo.<br>
<div></div><div><br>
</div></div></div><a href="http://codefortress.blogspot.com/2011/05/broken-marble.html#more">Read more »</a>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com5tag:blogger.com,1999:blog-1687363112787935188.post-34769020600010416262009-07-22T21:49:00.002-04:002009-07-22T21:49:00.747-04:00Spherical Terrain ToolsPicking up where I left off last time here are some more shots of the spherized terrain with a properly calculated per-vertex tangent basis.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWAfFYRaBUnDKpU__2ENLta8fBUeF6dAEpqZy2WTsHOcqxk-F5RQeLz-2T3VqaZCAcEKP1DdA4hpkaJVm5rSEroJYQ_JobnFE0d_tFcV0DhBTo2lEJu_OK8PbEVvNfeYkq88gM1Af2omFK/s1600-h/SpherizeTest+2009-04-08+16-29-26-74.png"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWAfFYRaBUnDKpU__2ENLta8fBUeF6dAEpqZy2WTsHOcqxk-F5RQeLz-2T3VqaZCAcEKP1DdA4hpkaJVm5rSEroJYQ_JobnFE0d_tFcV0DhBTo2lEJu_OK8PbEVvNfeYkq88gM1Af2omFK/s320/SpherizeTest+2009-04-08+16-29-26-74.png" alt="" id="BLOGGER_PHOTO_ID_5361026808298541842" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0SgpHmLPbdQz5qyCMBY3rlTFfUxQeZpbvhfo9URJHqX9Y9QbLHHUhP2rPwtTUji8BI_rXSqcUYIdnofUTyofDjfmqV0ULbn9PEzshry7mTjA24vmsoVdHiTB9aWd2Q1ie8lqA-8_fqRXT/s1600-h/SpherizeTest+2009-04-08+16-04-07-70.png"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0SgpHmLPbdQz5qyCMBY3rlTFfUxQeZpbvhfo9URJHqX9Y9QbLHHUhP2rPwtTUji8BI_rXSqcUYIdnofUTyofDjfmqV0ULbn9PEzshry7mTjA24vmsoVdHiTB9aWd2Q1ie8lqA-8_fqRXT/s320/SpherizeTest+2009-04-08+16-04-07-70.png" alt="" id="BLOGGER_PHOTO_ID_5361026152870587138" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0bf9j3gywU_I-W0yIF5XhgquiavCAOdLJi2g1GkAzb2RlIIjDXRQiyKPE_-r05UmZQykqhixQyzUi3f0rsu6G9PXIIPXPT2_HIOjOYGI69BOaP_BmjNIQo-2JiUQ8Uyv589fflGxL04it/s1600-h/SpherizeTest+2009-04-08+16-04-10-36.png"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0bf9j3gywU_I-W0yIF5XhgquiavCAOdLJi2g1GkAzb2RlIIjDXRQiyKPE_-r05UmZQykqhixQyzUi3f0rsu6G9PXIIPXPT2_HIOjOYGI69BOaP_BmjNIQo-2JiUQ8Uyv589fflGxL04it/s320/SpherizeTest+2009-04-08+16-04-10-36.png" alt="" id="BLOGGER_PHOTO_ID_5361027741809276498" border="0" /></a><br /><br />Obviously the terrain cubic heightmap I used was good 'ole Earth (and the heights are a bit exaggerated, ha). It looks pretty bland but what's important (at least right now) is what's going on under the hood.<br /><br />The heightmap I used is a high-resolution (downsampled to 4096x4096) 16-bit tiff DEM based off of satellite scanned terrain data. Because DEM's are rectangular grid based by nature, I needed to find a way to transform a two dimensional topographical map into a cube map. To do this I created a nifty little program that takes a 2D rectangular image with a 2 to 1 proportion, maps it to a sphere using either a spherical or cylindrical projection, then renders the sphere from the inside out to a cube map. The result is taking something like this:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9HRFDanoMGC7Qs-9EzJL-7w91ZK2kXEUMlIOWlBPYdocN8AKJLK5jS18rG-WNeuXYa8xlMwYw32JbjvZJ9knU8qerVZ4VNwZUw69ufWsPsV-JVKX_RbYUkm59EAFrCMUPouCoial48oxY/s1600-h/earth.jpg"><img style="cursor: pointer; width: 320px; height: 160px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9HRFDanoMGC7Qs-9EzJL-7w91ZK2kXEUMlIOWlBPYdocN8AKJLK5jS18rG-WNeuXYa8xlMwYw32JbjvZJ9knU8qerVZ4VNwZUw69ufWsPsV-JVKX_RbYUkm59EAFrCMUPouCoial48oxY/s320/earth.jpg" alt="" id="BLOGGER_PHOTO_ID_5361362367639343906" border="0" /></a><br />and converting it into this:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeB7m6dOcpWOAC0wa4rjs7rd-LnTsiepvtmUo9VZUa_7kTTBoJRx7AYoWEIplFP5UY1ZuySozXLIRIT-6IskZBrIiYtF7gM5ep1giXbYzpmLIiFNoCbokezaPB58cMPO3nHOIY6MaX79TN/s1600-h/earthcube_cross.jpg"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeB7m6dOcpWOAC0wa4rjs7rd-LnTsiepvtmUo9VZUa_7kTTBoJRx7AYoWEIplFP5UY1ZuySozXLIRIT-6IskZBrIiYtF7gM5ep1giXbYzpmLIiFNoCbokezaPB58cMPO3nHOIY6MaX79TN/s320/earthcube_cross.jpg" alt="" id="BLOGGER_PHOTO_ID_5361362444646306466" border="0" /></a><br /><br />Notice how the cube is reversed? That's a byproduct of rendering from INSIDE the sphere and while it is correct, it can be easily corrected (if needed, i.e. if the object used a different uv mapping). The same process can be done to a heightmap, assuming we make sure to support 16/32-bit floating point colors to preserve that nice precision which can then be used to create the spherical terrain.<br /><br />This is also super handy in cases where I want to use a cube map as opposed to a rectangular (sphere mapped) texture. Why would I want to do this you may ask? Well it turns out spherical textures exhibit some aliasing near the poles due to how the pixels are distributed to those areas. By using a cube map it is possible to use a lower resolution cube map to represent a much higher resolution 2D map with the same level of detail. The catch is that in benchmarks I've done the cube map performs slightly slower. I was a little surprised because although a rendering cube map can certainly be slightly costly if your ray samples are mostly random, texturing a sphere should be pretty cache friendly as the rays are all adjacent and basically wrap around the surface of the sphere (the texture coordinates are just a vector from origin to vertex, interpolated per-pixel). Perhaps there is an intrinsic cost to sample from face to face. Or maybe it's some kind of driver issue (when in doubt, blame the drivers :-). The other gotcha is that it's more difficult to stream in cube maps for very large worlds (if you were going in that direction).<br /><br />It's also possible to do the reverse, albeit with some 2D processing as opposed to 3D. In other words, to convert a cube map to a 2D texture. I chose to implement this feature for the cases in which I wanted to procedurally generate a planetary texture that can be easily touched up and texture mapped in the traditional way. The transform is pretty simple and involves first calculating a polar coordinate for each pixel then transforming that into a cartesian vector that can sample the cube map. The sampled color then becomes the new color for that pixel. As an example, here is a random cube map I found on the internet:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirsVeGxXxTVZHstZ-_7_oB1Ub1mGEr_dXSv8-8AKW9dxv5qZonhMZOUhRGCLXQhiWfyGertSWpUiiznojtdtD4bQY3_5xKD2wUBtMpwWuIEjL0ee4cke3yTI3HxE2M9Hl_qr09Yx9V6l-4/s1600-h/landcube_cross.jpg"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirsVeGxXxTVZHstZ-_7_oB1Ub1mGEr_dXSv8-8AKW9dxv5qZonhMZOUhRGCLXQhiWfyGertSWpUiiznojtdtD4bQY3_5xKD2wUBtMpwWuIEjL0ee4cke3yTI3HxE2M9Hl_qr09Yx9V6l-4/s320/landcube_cross.jpg" alt="" id="BLOGGER_PHOTO_ID_5361383013361957794" border="0" /></a><br />And here is how it looks converted to a sphere mapped texture.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhszCnfFb6KT0TanCwIcsvGXh84P6p2ugQjbrOWSfnmBGFvHjEpxFvvpYPDqxY_mBuuIufzlA-bSNLxl06Ro02LfXyJieAPLvn5wtQDwbRH4dWkWz9O7-2w_cITK4OAN6yHDkG0QRECrXup/s1600-h/CubeToSphereOutput.jpg"><img style="cursor: pointer; width: 320px; height: 160px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhszCnfFb6KT0TanCwIcsvGXh84P6p2ugQjbrOWSfnmBGFvHjEpxFvvpYPDqxY_mBuuIufzlA-bSNLxl06Ro02LfXyJieAPLvn5wtQDwbRH4dWkWz9O7-2w_cITK4OAN6yHDkG0QRECrXup/s320/CubeToSphereOutput.jpg" alt="" id="BLOGGER_PHOTO_ID_5361383085681345426" border="0" /></a><br /><br />What a nice panorama! The nice thing with doing it this way is that supersampling (for nicely anti-aliased images) is easier to do by rendering at a higher resolution then downsampling to the desired size. It's not as simple with the cube render as you need some massive resolutions (which are still not so well supported on cube maps), plus, it's easy to run out of video card memory, ex: if you wanted to do a final render of a 32-bit 1024^2x6 texture at 4x supersampling you'd need 4096x4096x6x4 bytes per pixel = 384MB. For a 128-bit float heightmap it's 4 bytes per-CHANNEL, so 4096x4096x6x16 bytes = 1536MB!! This doesn't include the memory needed for your source assets or geometry buffers. :-)<br /><br />A solution to this is to break up the texture into multiple blocks which are then saved out individually and later stitched together and resampled as a post-process. In the case of the cube map render you would just render each face to a texture. All of this is pretty unnecessary of course unless you're really trying to squeeze out some quality that may or may not come from such high resolutions.<br /><br />Another nice thing that came out of this line of research was an elegant way to render a skybox using a cubemap on a single quad, that is to say two triangles that forms a square over the screen as opposed to say the 12 triangles required to actually draw a box. It's a nice little trick that takes advantage of the way in which the view transform relates to the 2D clip space screen plane. Even though it's 2D there is perspective as you rotate the view around. In addition I found a nice way to set the FOV. While nothing revolutionary, it's simple and elegant and probably prevents a stall or 2 in the pipeline somewhere. It also means I don't have to code up yet another box any time I want a skybox so I'm pretty happy about that.<br /><br />Alright one more teaser to bow me out.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOThk-FrAjLT6kPc2JpJ2gMPTvsaOa7SL8mx4_BUjR-SnRjUUQx2j1fpN6TxDvPxxIvAqJkPgb5tuROUr1PHxe8XmuRddD3xh_07U1aqPI3lTrmonTF2ywFuylo0bsdvHZQoOrgVzKSQ26/s1600-h/AtmosExp.png"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOThk-FrAjLT6kPc2JpJ2gMPTvsaOa7SL8mx4_BUjR-SnRjUUQx2j1fpN6TxDvPxxIvAqJkPgb5tuROUr1PHxe8XmuRddD3xh_07U1aqPI3lTrmonTF2ywFuylo0bsdvHZQoOrgVzKSQ26/s320/AtmosExp.png" alt="" id="BLOGGER_PHOTO_ID_5361376302236909874" border="0" /></a>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-31144039472300203192009-07-16T19:49:00.001-04:002009-07-17T14:50:17.059-04:00PlanetoidsThis update is actually going to be referencing some older stuff I had been working on as I'm knee deep in finishing up a little iPhone app and don't really have anything interesting to show for it (it's a Blackjack game, woohoo...).<br /><br />About 4 years ago I was playing quite a bit with procedural planet creation specifically using the techniques outlined in the book <a href="https://www.amazon.com/dp/1558608486?tag=3dgraphiccc&camp=213381&creative=390973&linkCode=as4&creativeASIN=1558608486&adid=146ZF2JH52KMMZ7Y8TCF&">Texturing and Modeling: A Procedural Approach</a> (a fantastic and highly recommended read for graphics programmers). What I was hoping to get from this was the ability to procedurally generate planets for the Star Trader universe, more as an offline tool to save time than as a real-time galaxy generator as some people have implemented. The results were very good and I ended up with a great tool to generate pretty decent looking planets completely on the fly for rapid iteration (utilizing perlin noise on the GPU in real-time). These could then be saved off to a cubemap and potentially converted to a spherical map (to be applied to the planetary spheres).<br /><br />This tool has sadly been lost to the sands of time (I've adopted a much better project archiving system to avoid this) but my interest in creating procedurally generating planets hasn't vanished. Recently I revisted this from another viewpoint -- since the cube map can be used to represent a spherical environment, how could I take the planetary cube map I generated and turn that into an actual geometric representation instead of just using it as a texture. This isn't a very trivial thing to do considering terrains are normally fixed to a single ground plane.<br /><br />My first attempt involved directly translating the faces of a cube map (painted with a hastily made noise based terrain and another with just the axis triad) to a cube, with each cube face as a seperate terrain. After this I applied a spherization formula that basically generates a unit (normalized) sphere, then, for each vertex, takes the sampled height value and outwardly projects it's position relative to that. Viola, a sphere made of six terrains (here's another option that also works but for some reason the results don't look as good to me: <a href="http://mathproofs.blogspot.com/2005/07/mapping-cube-to-sphere.html">link</a>). Here are some screenshots to demonstrate;<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAxtE9ESabjknmngHfXZG7bituhf1SdY8PB4Pfs3l5lWW9FaNEB0E5T05KmqMdIaQlZd-J4MWaikzMjYUwBVMP96AnILIHX62OR6R2vlUylWSVBNf6VQmzwmBs7cK0q7MPG5sBTITF8zMO/s1600-h/StarField+2009-04-06+17-06-19-92.png"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAxtE9ESabjknmngHfXZG7bituhf1SdY8PB4Pfs3l5lWW9FaNEB0E5T05KmqMdIaQlZd-J4MWaikzMjYUwBVMP96AnILIHX62OR6R2vlUylWSVBNf6VQmzwmBs7cK0q7MPG5sBTITF8zMO/s320/StarField+2009-04-06+17-06-19-92.png" alt="" id="BLOGGER_PHOTO_ID_5321704810066756194" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfqGIXipxcSeoOeS9E61gI-FzG-pmwDVtZk7NDUc_JWLUMYdKzcqnCosYfBukEz2OYSORwsNZ6hnHp6xlxXPfBckpAWCNivEElGMhHXTb50oVxBwVhi5y0EZdFXvC3YUG0jRQwt1R_EoTF/s1600-h/StarField+2009-04-06+17-05-14-53.png"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfqGIXipxcSeoOeS9E61gI-FzG-pmwDVtZk7NDUc_JWLUMYdKzcqnCosYfBukEz2OYSORwsNZ6hnHp6xlxXPfBckpAWCNivEElGMhHXTb50oVxBwVhi5y0EZdFXvC3YUG0jRQwt1R_EoTF/s320/StarField+2009-04-06+17-05-14-53.png" alt="" id="BLOGGER_PHOTO_ID_5321704751299362146" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYFy7NkPzc-EXwtutWMC8W9jPdx8Y8goS6KD0PRsUlaBq3phHdY9zb8AnlUPfB_LWyy2dBa0asOO1HBsNJVseENlMbPNwzbM0T8xx_5RMS1NXQhvQxSp9kFJoUFid_HAVoHkW10b5evCx2/s1600-h/StarField+2009-04-06+17-04-49-99.png"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYFy7NkPzc-EXwtutWMC8W9jPdx8Y8goS6KD0PRsUlaBq3phHdY9zb8AnlUPfB_LWyy2dBa0asOO1HBsNJVseENlMbPNwzbM0T8xx_5RMS1NXQhvQxSp9kFJoUFid_HAVoHkW10b5evCx2/s320/StarField+2009-04-06+17-04-49-99.png" alt="" id="BLOGGER_PHOTO_ID_5321704681704248306" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Nty3f_VLPdlc4SEaTy-uoGp2-ZBXmF4aVVXCfojbGTvz9nzWfjII2_dZZhSHjLGurBRz3akRt3NFmXNkgaiXCsLUU48KEHlRYqA0u7E11CNb1ShDiGMEzCScGB41HjaOrnHOlN5rEexT/s1600-h/cube.png"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Nty3f_VLPdlc4SEaTy-uoGp2-ZBXmF4aVVXCfojbGTvz9nzWfjII2_dZZhSHjLGurBRz3akRt3NFmXNkgaiXCsLUU48KEHlRYqA0u7E11CNb1ShDiGMEzCScGB41HjaOrnHOlN5rEexT/s320/cube.png" alt="" id="BLOGGER_PHOTO_ID_5310190258218392322" border="0" /></a><br /><div><br /></div><div><br />Getting the geometry in spherical form isn't the only thing that needs to be done. The normals must also be transformed from their original representation to the spherized version. This is the tricky part. After trying quite a number of techniques, <a href="http://alexcpeterson.com/alexcpeterson.com/">Alex Peterson</a> (thanks again Alex!!) pointed me to a great little article on building a rotation matrix from one vector to another. Since the original position and the new position are vectors, getting their rotation matrix and transforming the normal by that became a pretty trivial matter! You can find the article <a href="http://www.cs.brown.edu/%7Ejfh/papers/Moller-EBA-1999/main.htm">here</a>. I'll post some screenshots of the final result next time.<br /></div>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-70487895119643049662009-05-14T20:21:00.006-04:002009-05-15T12:01:56.768-04:00Shaders!<span class="Apple-style-span" style="font-family:arial;">The past few months I've felt a new resolve to get Star Trader back on track and the main hurdle to this has been two technological uncertainties - the streaming system and the material system. The streaming system is not as big a priority as the game doesn't NEED it necessarily to proceed, but my material system is another matter all together.<br /><br />My original intention was to build an advanced prototype of the new material system in-place with the old one so I can compare and contrast which is better and whether the old system has a place as a low-level fallback. If it worked better use it, if not, scrap it and fallback to the old with minimal effort. Theoretically this is a sound principal since it can be risky to fully commit to a system that has not yet been completed. In practice though things did not go as planned and in the future I will probably just create a separate branch which I can then integrate/merge to or throw away depending on the outcome.<br /><br />In the end all my predictions were valid and having planned the system so thoroughly (over 10 pages of design notes with many more pages of format specs), it was unlikely that I missed something. The new system is better, plain and simple, and while I'm still really proud of the old system (comparably it's easier to use and more powerful than the material systems in some games I've worked on), gutting the old system code is going to be a necessary hassle. It's a shame because it was especially difficult implementing the new system around the old one. The best comparison I can muster is like navigating a maze overrun with sharp and pointy vines.<br /><br />The new material system is essentially a node graph (DAG) that exists at three levels; Template, Definition, and Shader Tree. The Template represents the base logic from which shaders are generated as well as base states and parameter definitions. It's here that the user specifies node statements by utilizing a library of pre-existing "operators". The material Definition just overrides the properties of the existing parameters, allowing the same template to be reused with different arguments/states. The Shader Tree is where the real magic happens.<br /><br />The tree is pretty straightforward except for the way in which it handles permutations. Essentially each level of the tree references a state, and each sibling node a state condition. A state might be 'Fog', and it's conditions 'On' or 'Off'. The tree for this would be relatively simple. In run-time the tree is traversed using the current state of 'Fog' to determine whether to use the 'On' or 'Off' shader. Things get interesting when we introduce more than one permutation. For instance, let's add a 'Point Light' state with 3 conditions; '0 lights', '1 lights', '2 lights'. For each state and all possible conditions, the tree is generated with a leaf node containing the actual procedurally generated shader (with all the accumulated state attributes/code). In this example we'd end up with a total of six shaders for all possible combinations of those state conditions.<br /><br />Now sure, with current shader models it's possible to build all that logic into an 'uber-shader' of sorts, but from my experience, this is incredibly slow and inefficient. While a Set..Shader() call is not cheap (maybe half as bad as SetTexture()), conditional branching on a per-pixel level is, well, SLOW! A 720p screen resolution could potentially require 921,600 per-pixel conditional checks per render frame! By reducing the work load to the bare essentials via condition specific permutations, it's possible to save a tremendous amount of fill-rate, leaving us to do other interesting things.<br /><br />Personally, I think graph based shader editors get a little too much attention. The big push for them seems to be from people who believe that exposing shader code visually will allow technical artists to create more interesting materials than little 'ole graphics programmer could. However, in my humble opinion (and taking into account some experience I've had with the subject), giving a technical artist that level of control usually leads to unexpected performance issues down the line and really doesn't elleviate the complexity required to make a graphically stunning effect in short time (thats what a good artist frontend like the "Definition" layer is for). The biggest reason I went in this architectural direction was for the ability to generate permutations which is much easier when you can break up your code into logical chunks, as graph based shader systems do. Having said all that, I don't mean to downplay the importance of a node editor since I really would prefer laying down nodes in a visual graph editor as opposed to adding them manually in a text file. That's actually my first priority after the GUI system is done, hehe.<br /><br />Why are permutations so important? Anyone who's worked on a large enough project has experienced shader bloat to some degree or another. As an example, think of the shaders that light objects in a scene. Let's say you can light an object with up to 4 lights at once (optimally, with a 1-1 mapping). Well you're probably going to need at least the basic light types; point, spot, and directional/planar. That already puts you at 12 shaders (+1 for non-lit). What if you wanted to add fog? Environment mapping? An ambient occlusion term? Parallax bumpmapping? It can get pretty wacky to account for all of these things! For some people it's not a big deal, but, in my case where I like custom tailered shaders for unique effects it can get pretty out of hand.<br /><br />So now with a good solution nearly complete I need to rebuild my shader library. The plan so far is to concetrate on a simple and elegant lighting solution that matches the stylized look of the game (remember those Invader Zim images)? Right now this means going back to Deferred Rendering. It's a fantastic algorithm despite being a little overhyped. It's much more efficient than your standard forward renderer, although saying that all your lighting is free (as I've heard from so many people) is ridiculus - you definitely pay the price for your light volumes and the per-pixel cost of evaluating all those lights (and if you want shadows you better be willing to pay the price). Despite this it really does allow you to display a very high level of quality at a reasonable price.<br /><br />For my purposes I intend to use it to lay down a base layer as part of a two tiered rendering pipeline. If an object doesn't meet the criteria for being lit by the Deferred Renderer, it continues down the pipe to the Forward Renderer. The main benefit to using the Deferred Renderer has to do with the way I do my non-photorealistic lighting. Specifically I use something very similar to the G-Buffer in order to generate some nice outlines so it makes sense to leverage this into a full lighting solution. I'll also be able to more easily implement things like Depth-of-Field and Glare/HDR, although MSAA becomes a challenge. The Forward Renderer is required so I can draw objects that don't fall into the additively lit category (which actually happens to be quite a few things). I won't get the free inking/shading with it as I would with the Deferred Renderer but I'm hoping to find a solution that will work well for things like translucent lit objects.<br /><br />I wish I had some interesting shots to show all this off but really it's just been a lot of engine work. The idea is to streamline the development process so unfortunetly this kind of feature doesn't lend itself well to screenshots. :-)<br /><br />On the upside I do have some interesting things to show next time related to the terrain tools I've been working. More to follow in the coming weeks but until then, here's a teaser;<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggb7O127Z0p-a0e4Dw2DmT63fZ69zAr6VNqdlt2pryzlk-37tn6aQJaiYwP9jTo61sPFU16zpUa4DDJNXPnN_HUTnCGaDX4QoGJlEYEHzxaNJo2H13GL2-2RKgQWvc-zvzdz95fsdK8Zf6/s1600-h/SpherizeTest0.png"><span class="Apple-style-span" style="font-family:arial;"><img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggb7O127Z0p-a0e4Dw2DmT63fZ69zAr6VNqdlt2pryzlk-37tn6aQJaiYwP9jTo61sPFU16zpUa4DDJNXPnN_HUTnCGaDX4QoGJlEYEHzxaNJo2H13GL2-2RKgQWvc-zvzdz95fsdK8Zf6/s320/SpherizeTest0.png" alt="" id="BLOGGER_PHOTO_ID_5335808781330737394" border="0" /></span></a>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-43787798862776160862009-04-28T09:03:00.002-04:002009-04-28T12:15:01.446-04:00The Name Game Trap (TNGT?)<div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style=" ;font-family:'Times New Roman';"><div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "><div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;">Marketing your game is usually a pretty drab affiar but when the developers get involved in marketing their technology, things get really interesting. Take Epic for instance and their proprietary Unreal Technology. They're up to version 3 now with 4 coming out relatively soon and their engine boasts a number of confusedly named components. Gemini, Cascade, Kismet, PhAT, Swarm, Matinee, and now Lightmass and MCP. If you've worked with Unreal Tech some of these may sound familiar, but if not, you're probably pretty confused right about now. Who would guess that Kismet is their visual scripting tool? Or that MCP (named after the antagonistic A.I. in Tron) would be their gameplay statistics tool.</span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;">It's an interesting brand marketing strategy especially since most companies just use acronyms. For Mark Rein it probably makes things easier for him to be able to spew out cool sounding names like PhAT or Swarm during a press event and I'm sure the public eats it up. For the developer interested in licensing their technology, does it really matter though? Sure, Matinee makes sense as their camera scripting tool but does cascade bring to mind at all particle systems and effects? Does it describe in any coherent way what it as feature does or how it can be utilized? The value it brings to a project?</span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;">We did something similar at Raven with names like Icarus (our scripting system), behavEd (the scripting system editor), Ghoul (the dynamic dismemberment system), confuseEd (dynamic object destruction), vertigons (surface sprites), etc... In the end it becomes something cumbersome and annoying to have to deal with the ambiguity but it does add a bit of extra flavor to an otherwise drab sounding feature.</span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;">At id, naming engine iterations with the idTech prefix makes a whole helluva lot of sense but outside of a few interestingly named systems (like AAS - area awareness system), the idTech 5 renderer is just, the renderer, not Lightning or Talon or some other pointy sounding name.</span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;">At home I tend toward the simplistic. Right now the engine I've been developing on and off the past 9 years is called the AREngine (which I do plan to backronym as some point). I'm just finishing up a shader graph based permutation system which I blandly call MaterialV2 (Material version 2, despite this being the 4th iteration of my material system - it's the first one I've developed in-place with the previous still functional). Here is a feature that could be a key selling point of the engine and it ends not in an exclamation mark but a period.</span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span class="Apple-style-span" style=" ;font-family:arial;"><span class="Apple-style-span" style="font-size: medium;">If you want to get excited about what you're working on (and get other people excited as well) you usually have to add a bit of edge, which is I think what Epic has done. Having said that, attaching a catchy name that represents what a feature is about is the hard part. The easy part is falling into the name game trap.</span></span></div></div></div></span></span></div></div>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com3tag:blogger.com,1999:blog-1687363112787935188.post-1170535199293852062009-03-31T09:32:00.003-04:002009-03-31T12:15:30.774-04:00Polymorphic Excision<span class="Apple-style-span" style=" ;font-family:'Times New Roman';"><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">Usually when I'm getting back into a codebase, I'll pick a small project and latch onto that until it's completed. This is a great way to re-orient yourself with a once familiar codebase that you've become rusty with. Lately I've jumped back into my millenias old Star Trader project and decided to do just this.</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">A while back there was a great presentation at one of the Microsoft Gamefest events titled <span class="Apple-style-span" style="font-style: italic;">"Cross-Platform Graphics Engine Development"</span>. The premise of this talk was that excessive use of OOP features (like Polymorphism) is harmful when building a system that relies on maximum performance and thus such a system should be tailored to use a more direct approach utilizing type definitions (as opposed to polymorphic type abstraction). What this means in the end is instead of keeping a hierarchy of inherited interfaces to something like your renderer, just create a new type dependent on your platform (and API of choice) and link it in. This is precisely what I decided to do.</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">Now I'm not the type that buys into the argument that C++ is incredibly slower than C, but in general, using a feature needlessly while paying the cost is just, well, dumb. The way my code was I had a 3 teir inheritance hierarchy with the interface at the bottom, the shared functionality (ex. state tracking) at the middle, and the API implementation (D3D9, OpenGL, ...) at the top. This allows me to derive the common interface to generate any number of API implementations and link them in as a DLL. This works pretty well but I'm nearly certain I will never be swapping out my renderer on the same platform (Win32, MacOSX, PS3...). I was paying for a feature I will never use.</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">To resolve this, I first compiled the renderer as a static library. After this, I came up with a public interface to the renderer, that, based on platform and project settings will access only the primary accessor to the renderer. In addition I broke off the common behavior into it's own object that the API specific code calls as neccessary. This was all pretty straightforward and the main executable now directly links to the API specific Renderer. When I create additional platform/API implementations, the interface can still be enforced with a conditional inheritance of the base level interface to ensure that everything was implemented properly (a nice trick). Just to be thorough, I did go ahead and implement an additional option that allows a DLL to be loaded with an inherited renderer (as before), so I could do something like release a Direct3D 11 renderer for those that supported it down the line. Personally I don't like doing stuff like that (you're basically bandaging on functionality and resources at that point instead of building it in to the initial overarching plan), but I figured what the heck.</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">I was quite surprised at the ease of this switch. That is of course until I started the game and my resource manager puked on me. :-)</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">I really enjoy using pluggable software factories. I enjoy them so much I use them exclusively for declaring resource type allocators to my resource manager. In a one line macro, I can completely register a resource class and know that I did it right. It's fantastic and despite the use of Macro's and Globals, I think it's a very elegant solution. Coupling is reduced to nearly nothing since the definition, implementation and registration can all happen in the same .cpp file. I'll spare you the details but </span></span><a href="http://www.codeproject.com/KB/architecture/dp3.aspx"><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">here</span></span></a><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"> is a link to a good explanation of pluggable factories.</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">Since it's a solution that exists in global scope, it does come with it's caveats. Initialization in global scope is seemingly random, so how do you control the order of initialization so that the list of resource allocators is not re-initialized to empty AFTER having already added elements to it? The solution to this is actually quite simple though you won't find it in too many programming books. Using lazy evaluation (also known as Construct On First Use), I ensure the list is initialized only on it's first call. This is really easy to implement and merely consists of using a static variable (of the list) within the scope of a function. The first time the function is called to get the list is when the list is initialized. It would look something like this:</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">CResourceAllocatorList *GetResourceAllocatorList()</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">{</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"> static CResourceAllocatorList s_ResourceAllocatorList;</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"> return &s_ResourceAllocatorList;</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">}</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">To use it:</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">GetResourceAllocatorList()->Append( pNewAllocator );</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">This works great in practice and like I said, is super convenient. When these are defined in a DLL, they sit there waiting until the DLL is created and as soon as that happens are initialized and registered. Eventually they do have to be collected (since the DLL has it's own heap) but this is easy enough and if you use a linked list it's as easy as linking the allocator as another node. But what happens when you link these in via a static library? Nothing... nothing at all. If a factory is placed in a file that has no external references, the linker will omit a reference to the compiled object file when linking it in to the executable. This effectively means that your factories will NEVER be registered. That's, well, really bad! While Visual Studio does have an option to never remove unreferenced data (which should probably never be used), it doesn't actually work for data removed due to an .obj being unreferenced (this is supposedly intended behavior).</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">Resolving this issue is naturally a pain in the ass. One way is to look at your list of generated symbols, find the decorated name for your factory and include a pragma line that forces inclusion of that symbol in the linker, i.e.</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">#pragma comment( linker, "/include:?blah@@" )</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">This is incredibly annoying and completely destroys the convenience of using a factory in the first place. Another way is to include some kind of reference to that file or your factory in code that is definitely executed (like main() or your primary initialization routine). This is what I ended up doing but in a semi-automatic way. I made a Macro in which you pass in the resource type name (RESTYPE_TEXTURE, RESTYPE_MODEL, etc...) and a reference is automatically generated for you (calling a dummy function in an automatically generated pointer to the base factory type, initialized when the factory is created). This effectively adds an additional step to the process but at least it's somewhat straightforward, as opposed to the other option.</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">After that everything was working perfectly! I still have to do some performance tests to double check that talks premise (of sacrificing flexibility for performance) but at first observation the program does appear to have a smaller memory footprint (likely due to the additional optimization the compiler/linker does thanks to the file being directly linked in and the exclusion of some v-tables).</span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:medium;">All in all it was a nice little exercise that definitely got me re-acquainted with my old codebase. Next up on my radar is finishing up my new shader system. I'll talk more about it some other time.</span></span></div></span>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com1tag:blogger.com,1999:blog-1687363112787935188.post-61458906402876506032009-03-06T08:34:00.003-05:002009-03-08T01:36:26.563-05:00The Big Move!<p class="MsoNormal"></p><p class="MsoNormal"></p><p class="MsoNormal"><span class="Apple-style-span" style="font-family:'Times New Roman';"><div style="MARGIN: 8px; FONT: small arial"><span style="font-family:'Times New Roman';"><div style="BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 3px; MARGIN: 0px; WIDTH: auto; PADDING-TOP: 3px; TEXT-ALIGN: left; BORDER-RIGHT-WIDTH: 0px"><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">The response to the interviewing article went really well! I got a lot of great comments about it and am really glad I was able to give back a little by contributing a piece like that. Hopefully I'll find some time to write more articles like it in the future.</span></span><br /><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">So the past few months have been pretty interesting for me. A few months ago I made the decision to leave Destineer to work for id Software. They're a great company and everyone there is absolutely awesome but I just could not pass up the chance of a life time to work at the company that got me excited about computers and games in the first place! They were all incredibly understanding and I truly wish them the very best. Trust me when I say they're working on something really amazing and I'm very excited to see the final result!</span></span><br /><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">So outside of that I've been keeping pretty busy. While looking for some code to generate cubic noise maps (as part of a series of new experiments I've been working on to generate spherical terrains) I ran into my old starfield generator which generates random points and "blurs" them as they whiz by you. A very cool effect, especially when you consider how the points were generated.</span></span><br /><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">When you generate random noise around a unit sphere you have to be incredibly careful to ensure that they are uniform, otherwise you'll see them gathering towards one of the poles as demonstrated here:</span></span><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxPavpxBzqM1aVKh1UGMqv_TzeHaZpjI5OX4g3AMS_qxLYSyEHeVguTdc9Sqqehw4WpZ2xMM4kzlsBZtPpswjvtVld4q6oLBd_v2wbX8UBgGJl5x0mHCiY_aa7LweAjMisYq6MGy6IofPC/s1600-h/StarField+2009-01-19+15-09-55-94.png" target="_blank"><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"><img style="WIDTH: 320px; HEIGHT: 240px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxPavpxBzqM1aVKh1UGMqv_TzeHaZpjI5OX4g3AMS_qxLYSyEHeVguTdc9Sqqehw4WpZ2xMM4kzlsBZtPpswjvtVld4q6oLBd_v2wbX8UBgGJl5x0mHCiY_aa7LweAjMisYq6MGy6IofPC/s320/StarField+2009-01-19+15-09-55-94.png" border="0" /></span></span></a><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"><br /></span></span><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">The problem lies in how spherical coordinates tend to congregate points towards the poles. To fix this problem you can use sphere picking to ensure any given area around the sphere contains the same number of points:</span></span><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvrSlv2mm1Ocz6If2Ci-gHHqq6TrJ0VIZreVznGoXjZapwvVeAuJG11qD_FHfLSoXD0Msjr-F31FplYP_fBeixD9TP92K_Gax9pgzLm59voyq1IlK6aE0pSnldXHMa6C1DvYjNRA4rYvGK/s1600-h/StarField+2009-01-19+15-09-47-64.png" target="_blank"><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"><img style="WIDTH: 320px; HEIGHT: 240px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvrSlv2mm1Ocz6If2Ci-gHHqq6TrJ0VIZreVznGoXjZapwvVeAuJG11qD_FHfLSoXD0Msjr-F31FplYP_fBeixD9TP92K_Gax9pgzLm59voyq1IlK6aE0pSnldXHMa6C1DvYjNRA4rYvGK/s320/StarField+2009-01-19+15-09-47-64.png" border="0" /></span></span></a> </div><div style="BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 3px; MARGIN: 0px; WIDTH: auto; PADDING-TOP: 3px; TEXT-ALIGN: left; BORDER-RIGHT-WIDTH: 0px"><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">This may seem relatively trivial and unimportant for something like a starfield (which it is), but where it starts to really matter is when you need to generate random vectors for something like raytracing. I recently created an ambient occlusion generator for heightfields and ran into an issue where the sampled values where resulting in way to many false positives than they should have been. As I'm sure you can imagine, the issue is pretty obvious; most of the generated rays were going straight up, and heightfields by definition do not have overhangs for those rays to hit!!! The simplest solution is to scale the generated rays up value so they go more towards the sides (which helps quite a bit), but really the best way to do it is to properly generate the sampling rays around the unit hemisphere uniformly. By doing this I was able to get away with using a lot less rays for fantastic looking results!</span></span><br /><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">I won't bother to provide the full algorithm here but if you're interested, check out this page: </span></span><a href="http://mathworld.wolfram.com/SpherePointPicking.html"><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">Sphere Point Picking</span></span></a><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">.</span></span><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"><br /></span></span><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">So as I mentioned I've been doing quite a bit with terrains. Unfortunately I don't have much to show as far as screenshots as it's been mostly experimental type stuff to learn and get acquainted with new algorithms. After I finished the ambient occlusion generator I went ahead and wrote a lightmapper for fun (it wasn't that much of a departure) and started a survery of terrain shadowing techniques.</span></span> <span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"><br /></span></span><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">Shadow Mapping is a tried and true classic which can give some great results if you're willing to put a little blood and sweat into your implementation (ala CSM's, VSM's, TSM's, etc...). Lightmapping is nice but only works for static terrains and doesn't work so well for dynamic objects (though I know of some neat tricks to fix this). Ambient Occlusion works nice but only works for global indirect light (so is more complementary than comprehensive). Spherical Harmonics is an option but from my research doesn't always result in the best looking shadows.</span></span> <span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"><br /></span></span><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">One experimental shadowing technique I tried which resulted in some really nice soft-shadows is Ambient Aperture Mapping. The idea behind it is pretty novel and is similar to relief mapping but simpler. First, you generate your aperture values which consist of a bent normal; a vector pointing towards an un-occluded light source (i.e. the sky/sun/moon), and the aperture; essentially a circle at the end of the bent normal which defines how much light reaches that point (this value is similar to an ambient occlusion result and make the bent normal into a sort of cone). After you have these you can test any given terrain surface point's aperture against your global light source which has it's own aperture values. The intersection of these two apertures defines how much light reaches that surface point.</span></span> <span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"><br /></span></span><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">The results are surprisingly good! I may utilize this in full force the next time I need an efficient low to medium frequency shadowing solution with modest storage costs for terrain rendering. Here's a paper on it for your reading pleasure: </span></span><a href="http://ati.amd.com/developer/siggraph06/Oat-AmbientApetureLighting.pdf"><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">Ambient Aperture Lighting,</span></span></a><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"> and a screenshot of their results:</span></span><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5GECfFibjbQBDf0917oFYLSOugZ6RXpQbviiXPpzCQ2ZCHOg6vpwvoMAGkzeuJThyphenhyphenD_MGRiJyqQtJnVyICO7hZZB-uyqpFonZVX3nYAyKSIeWu8OrJ-jOqCt3UpkiR6r0NRcBWVW7n18v/s1600-h/aa.jpg"><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"><img id="BLOGGER_PHOTO_ID_5310165104088986370" style="WIDTH: 400px; CURSOR: pointer; HEIGHT: 167px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5GECfFibjbQBDf0917oFYLSOugZ6RXpQbviiXPpzCQ2ZCHOg6vpwvoMAGkzeuJThyphenhyphenD_MGRiJyqQtJnVyICO7hZZB-uyqpFonZVX3nYAyKSIeWu8OrJ-jOqCt3UpkiR6r0NRcBWVW7n18v/s400/aa.jpg" border="0" /></span></span></a><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;"><br /></div></span></span><div style="BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 3px; MARGIN: 0px; WIDTH: auto; PADDING-TOP: 3px; TEXT-ALIGN: left; BORDER-RIGHT-WIDTH: 0px"><br /><span class="Apple-style-span"><span class="Apple-style-span" style="font-family:arial;">That's enough for now. Until next time!</span></span> </span></span></div></div>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-43055307632698694002008-12-05T07:19:00.006-05:002009-07-14T15:39:08.738-04:00Game Industry Interviewing 101<span class="Apple-style-span" style="font-family:'Times New Roman';"><div style="border-width: 0px; margin: 0px; padding: 3px; width: auto; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-stretch: normal; text-align: left;font-family:Georgia,serif;font-size:100%;"><span class="Apple-style-span" style="font-family:Arial;"><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">So now without further ado, game industry interviewing.</span></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">As I mentioned before, a few months back I was doing a heavy amount of interviewing for basically two months non-stop. I spoke to over ten game companies and flew out to on-site interviews a total of 7 times (there and back). It was a grueling and nerve wracking experience but I ended up learning a lot and finding a great job. Here are some things I learned that I hope can teach both interviewer's and interviewee's about the right and wrong way to interview.</span></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">DISCLAIMER: I don't pretend to be an expert on the subject. I don't even pretend to follow my own advice. These are merely my opinions on the experience's I've had on both sides of the table. Please take all this with a grain of salt.</span></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">First, let's start with what both parties are looking for. From the interviewers perspective, what they want is:</span></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">To determine skill of the applicant, who is at least c</span></span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">apable if not exceptional<br /></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">To make sure interviewee fits well with the team</span></span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">To pay as little as possible<br /></span></span></span></li></ul><div style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">The interviewee's interests are a bit different. They want (ideally):</span></span></span></div><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Good pay</span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Enjoyable and challenging work<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Job security<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Opportunity for growth and advancement</span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li></ul><div style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Although both parties obviously want different things, they both have many places where they meet. For starter's, both parties want a long-term relationship. It's beneficial for a company to keep it's employee's for a significant amount of time. The first year that an employee is on the job amounts to a decent amount of training. This is both costly in time and money for the employer. It takes an incredible amount of effort to find, interview, and sign an employee and then pay for relocation and benefits on top of salary. Every engineer or artist you take off the job to interview a prospective employee is time lost. Because of these factors it's critical to hire employee's that will stay with you for the long haul.</span></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Both parties also want to put out top quality titles. If you as an employee of that company can't get an interviewee excited about what you're working on, it's unlikely he'll be excited working on it there as well. It's even less likely he'll accept an offer if he has better prospects elsewhere.</span></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">As an interviewee, the entire process is extremely stressful but the most important thing to do is not alienate your interviewer. An easy way to do this would be to:</span></span></span></div><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Bad mouth previous employers or co-workers<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Point out mistakes you've made without addressing ways in which you've resolved or learned from them.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Show lack of knowledge of their company, games.</span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Not be prepared, technically or personally</span></span></li></ul><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">In the end it's about finding a candidate that impresses the interviewer in some way or another. </span></span><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">So how can a candidate impress their interviewer. Well there are a few easy ways:</span></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;"><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"> Show knowledge about the company<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"> Sell yourself, your ability to work with others well and your skills<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"> Be early to the interview<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"> Show manors, be polite<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"> Maintain a positive attitude no matter what<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"> Embrace game industry culture (NO SUITS!) but take the interview seriously<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"> Thoroughly thank the interviewer for their time - they're taking a chance on you!</span></span></span></li></ul><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div></div></div></div><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">The same goes for the interviewer. Interviewers need to realize that they are being interviewed as well. The candidate has a choice to work somewhere else so it's important to show respect for the candidate and treat them as an important individual. A great way to put a bad taste in their mouth is to:</span></span></div></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;"><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Show lack of knowledge of their skills by not giving their resume full attention</span></span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Not giving them time to answer questions, answering questions for them (in large groups) or asking questions not relevant to their day to day job (brain teasers are SATAN).</span></span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li></ul><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Having said that, an interviewer is still expected to do all they can to find qualified candidates. </span></span><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Some candidates are knowingly not qualified for the job but apply anyways. This does a disservice to all and these interviewees should never have gotten to the on-site interview if the interviewer was doing their job right. Interviewing for a job is not shooting in the dark and most employer's know better (and if they don't watch out)!</span></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Despite this, realize that some candidates can have a bad day. There are no such things as re-do's for an interview but it doesn't hurt to be understanding. The worst thing a company can do in my opinion is end an on-site interview early. It's not like you just hung up on the employee on the phone, no harm no foul. This person just made an effort to get out to your company, taking time away from their job, family and life. This is humiliating to the candidate and shows a complete lack of professionalism on the part of the company. I've personally seen this happen before and couldn't have been more disgusted.</span></span></span></div></div></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">So what are the different types of interviews?</span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;"><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">The Gauntlet: In this type of interview, the company throws Interviewer after interviewer at the prospective employee, sometimes in pairs for 30 minutes to an hour at a time. The idea is to expose the candidate to as many people on the team as possible and later discuss as a group the merits of that individual. This is probably my personal favorite (as the interviewer and interviewee) as it gives you the most insight into the candidate, although it can be quite fatiguing.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span style=""><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">The Interrogation:</span></span></span></span><span style=""><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"> Throw everyone and the kitchen sink at the guy all at once. See how you do under immense pressure. "</span></span></span></span><span style=""><a href="http://www.youtube.com/watch?v=NjQ0zu7YK3A" id="zhk7" title=""Oh no, he's going to burst"" style=""><span><span class="Apple-style-span" style=""><span class="Apple-style-span" style="color: rgb(0, 0, 0);"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Oh no, he's going to burst!"</span></span></span></span></span></a></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">. In my opinion this kind of interview is a circus. From my experience it always leads to interviewers talking over each other and the candidate, leaving him in the cross-fire. Very uncomfortable. Also, most game developers tend to be more introverted personality types so exposing them to a full room of people is just cruel.<br /></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><span></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">The Pow-wow: This is the laid back, conversational style interview. I like this style a lot but you have room to miss a lot about the candidate. I would only use this if I knew they were perfectly qualified and just wanted to get a feel for their personality. An experienced interviewer is great at sneaking in very in-depth questions in the guise of just shooting the breeze. Great way to get to know a candidate while having them lower their guard a bit.</span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li></ul></div></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">The main purpose of these different types of interviews is the same, but how they get there is obviously very different. No matter what kind of interviewing style is used, there should be a few questions that are always asked both for the interviewer and interviewee. For the interviewer:</span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;"><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">"Why should we hire you?" - This may seem condescending but in actuality it's a valid question that any competent candidate should be able to answer easily.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">"What in addition to your qualifications do you bring to the table?" - For instance, It's important that a Programmer show some form of creativity and an Artist a thirst for technical knowledge (or at least not an aversion).<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Never EVER ask yes or no questions. This leaves conversations open ended and keeps the interviewee talking.</span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li></ul></div></div></div><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">And the interviewee:</span></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">"Why should I want to work here?" - This is the most important question you could ask yourself.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">"What EXACTLY would my responsibilities be?" - Make sure you know what you'll be doing (and watch out for the switcheroo).<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">"How do you encourage employee personal and career growth" - Not only does this question impress employer's, it's vital to the success of your career.</span></span></span></li></ul></div><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Both interviewer and candidate need to watch out for what I call "impostors" which can be both the company and the person interviewing. You'll know a company that's an impostor when they paint such a rosey picture that there's no way they could live up to that expectation. These companies are often desperate for employee's (due to high turn over or other factors) and are often not honest about work conditions, which are often very poor (see </span></span><a id="natl" href="http://en.wikipedia.org/wiki/Death_march_%28software_development%29" title=""Death March"" style=""><span class="Apple-style-span" style=""><span class="Apple-style-span" style="color: rgb(0, 0, 0);"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">"Death March"</span></span></span></span></a><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"> ). Candidates who aren't capable but pretend to be (or are still aspiring to be) fit in the same category.</span></span></div></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;"><ul style="margin-top: 0px; margin-bottom: 0px;"></ul></div></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span style=""><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></span></div><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Remember what I said a</span></span><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">bout the interviewer being interviewed by the candidate? If you treat an interviewee poorly in an interview, it's easy for them to believe that's how they'll be treated there. Here are some ways to impress the interviewee:</span></span></span></div><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Give them a studio tour</span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Show them your GAME!!!! Can't emphasize this enough. Too many companies seem afraid to show their game. Better to have a poor impression than NO impression. Your fancy idea won't be stolen, and if it is, why should you worry. You are the only one that knows how to pull it off, right?<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Take them out to a nice lunch with people who have shown an obvious enthusiasm for the company (beware the "lurker"). STOP THE INTERVIEW FOR LUNCH!!! This is a chance to see the interviewee's personality, not his knowledge of calculus.</span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li></ul><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">The last thing to mention is actually one of the first things to happen, the phone interview. As the interviewer there are a few guidelines that should be followed:</span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">NEVER have more than two people in the same room.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Don't use interviewer with strong accents (brits and scots especially - no offense guys!).<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Read resume BEFORE the interview.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Keep it under 30 minutes unless it's going extremely well. Still, be aware how much time you're taking and offer to extend the interview for a later time.</span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li></ul><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">As an interviewee, it's likely you'll be very nervous during your first conversation with the company so keep these things in mind:</span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><ul style="margin-top: 0px; margin-bottom: 0px;"><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Find a nice, quiet place.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Don't pace.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Use a land line if at all possible! This avoids drop outs, phone delay and bad reception.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Have a notepad in front of you where you jot down notes and questions to ask.<br /></span></span></span></li><li style="margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">Never EVER interrupt the interviewer (can be hard to avoid with phone delay). This kind of goes with the previous suggestion (write down your questions as they come to you). This should be used in all aspects of life really...</span></span></span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></li></ul></div></div><div style="margin-top: 0px; margin-bottom: 0px;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><div style="border-width: 0px; padding: 3px; margin-left: 0px; width: auto; text-align: left; margin-top: 0px; margin-bottom: 0px;"><span><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:medium;">The process shouldn't be grueling, it should be fun and rewarding for both parties. I hope you take these tips to heart and keep them in mind during your next interview. Though these tips are geared towards the game industry, proper interviewing etiquette works well in any field.</span></span></span></div></div></span></div></span>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com2tag:blogger.com,1999:blog-1687363112787935188.post-72457106193659345822008-10-02T09:35:00.001-04:002008-10-02T10:15:27.554-04:00D.R.M. S.U.C.K.'s<span class="Apple-style-span" style="font-family:'Times New Roman';"><div style="border-width: 0px; margin: 0px; padding: 3px; width: auto; font-family: Georgia,serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 100%; line-height: normal; font-size-adjust: none; font-stretch: normal; text-align: left;">For the second time in just a few shorts months, I am NOT able to play a game I legally purchased... thanks to DRM. DRM (Digital Rights Management) is a system used to enforce that a game is not illegally obtained (i.e. stolen). Instead, again and again I'm finding that all it's doing is stopping people who have a right to the product they purchased to be able to use and enjoy it. If anything is killing PC Gaming, it's not Piracy, it's DRM!<div><br /></div><div>I bought Spore the other day and for three days I was unable to play it, even though I could go right now and find a cracked executable to be able to run it. Heck, I can just go start downloading the torrent and within two days have the game as a whole. Come on EA (and other publishers like you), who are you really hurting here??? Myself and other paying PC Gamers, or the people who can get the game for free anyway, and more easily!? In addition to not even being able to run it now, once I DO get it working, I'll only be able to install it three times? No, not on just three machines, three installs, then I no longer own the game. WOW. And in addition to all that (yes, there's more), even though the manual says you are allowed multiple accounts per-install (so my Fiancee could have an account on my machine for instance), you're in fact only allowed ONE. What hubris! I still have my copy of The Sims that I bought, what, 8 years ago? And guess what, I've re-installed my copy at least 5 times since I purchased it, and both of us have been able to play it at different times. Can they really argue the top selling game of all time suffered from piracy so bad that it's spiritual sequel has to be so guarded!? I'm not the only one: <a href="http://www.gamasutra.com/php-bin/news_index.php?story=20218">1 Star</a>. <a href="http://www.gameplayer.com.au/gp_documents/PC-Gaming-Dead.aspx?catid=Features&Page=1">Food for thought</a>. On the bright side it looks like they're listening to reason and might change a few things for the better (i.e. adding deactivation so you could reclaim your installs), but it's still pretty sad it got this far.</div><div><br /></div><div><rant over=""> Anyhow, life's been hectic in North Carolina. Starting work has been great and I really enjoy it so far. Destineer is a great company with a lot of great people. There's definitely a lot of great things to come from it in the future. Saturday is my birthday then next Friday I'll be up in New Hampshire to get married and man has it been crazy getting the last remaining details worked out.<br /></rant></div><div><br /></div><div>I was finally able to get the Hexen Touch (Hexen for iPhone) source code up; <a href="http://code.google.com/p/hexentouch/">here</a>. If you're interested in iPhone development check it out. Disclaimer: The code is purely for learning purposes, is not at all supported, and doesn't represent the best quality possible. But it basically works so beggars can't be choosy. :-)<br /><br />Time is short. Until next time!<br /></div></div></span>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-13132279426880979752008-08-13T22:34:00.000-04:002008-08-14T01:47:07.772-04:00Good things come in threes...You know, it's amazing how life can move so fast sometimes. A lot of big things have happened to me in the past few weeks. To begin with, I've decided to pursue opportunities outside Firaxis. I really enjoyed working with everyone there (Sid Meier especially) on such an amazing franchise as the Civilization series but after careful consideration I decided it was time to move on. I learned a lot and am incredibly proud of my contributions and wish only the best for everyone there.<br /><br />As for myself, I'll be headed to a young but ambitious company named <a href="http://www.destineerstudios.com/company/company.html">Destineer Studios</a> based in Raleigh, North Carolina to work on their console technology for a currently unannounced title. I'm fond of the area (my parents have lived there for years) and was incredibly impressed by everyone I met there during my interview. After a month of interviewing and multiple offers around the country, I decided to take a chance and go with a company I feel will really make a difference. The people at Destineer (and when I talk about I company, I really do refer to the people - I mean seriously, what else gives a company it's strength), are incredibly talented, enthusiastic, and friendly and I'm very glad to be joining the team. I'm sure to have many more great things to say about the new job and the move in the coming months.<br /><br />So in addition to changing jobs and selling my house (in an amazing 1 week!), I just got engaged! We're trying to fit the wedding in within the next few months but we're not sure yet if that's going to be possible. We figure we can leverage the fact that we're doing all the most stressful things at once to reduce the possible stress later on, haha. Hopefully it'll all work out.<br /><br />As I hinted at last time, I've been working on the iPhone on some pretty neat stuff. One of the things I finished was a port of Hexen for the iPhone. I plan on putting the source code online as soon as I find some time. It's a pretty straight forward port and runs really well. Thanks to my friend Rich Whitehouse for his help (the port is based on the work he had done for his Nintendo DS port of Hexen). In the end it was really fun and I learned a lot. It's quite surprising what the iPhone can do and I'm looking forward to doing some more work on it.<br /><br />In addition to my iPhone projects I'm thinking of writing an article on effective interviewing techniques from the perspective of an interviewee. As I mentioned before, I've been through quite a number of interviews in the past month (something like 8-10), both over-phone and on-site. From this experience I've learned a lot about what an interviewer should and shouldn't do to both represent the company well and impress the applicant. While I've seen a lot of articles on how to interview as an applicant, it's just amazing how many mistakes are made by the companies interviewing and I think there's some good things to be said about improving the process. I have some idea's on what mistakes a company should avoid and some questions that should and shouldn't be asked. Hopefully I'll have more on this soon...<br /><br />Lastly, here's some amazing stuff coming from ATI: <a href="http://www.youtube.com/watch?v=Bz7AukqqaDQ">WOW</a>. The only thing is, 100+ MB a frame!? Hmm, maybe not so practical yet. Still, amazing that we're almost at the age of photorealistic gaming!<br /><br />Take care everyone!Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-26632304279755707562008-06-16T22:10:00.003-04:002008-06-17T18:59:04.278-04:00iPhone: What I've been working on...<a href="http://img406.imageshack.us/img406/8084/screenshot2008061510350re6.png"><img src="http://img406.imageshack.us/img406/8084/screenshot2008061510350re6.th.png" /></a><a href="http://img406.imageshack.us/img406/3536/screenshot2008061510354uw6.png"><img src="http://img406.imageshack.us/img406/3536/screenshot2008061510354uw6.th.png" /></a><br /><br /><a href="http://img406.imageshack.us/img406/7073/screenshot2008061618575ps4.png"><img src="http://img406.imageshack.us/img406/7073/screenshot2008061618575ps4.th.png" /></a><a href="http://img406.imageshack.us/img406/1254/screenshot2008061510331wk5.png"><img src="http://img406.imageshack.us/img406/1254/screenshot2008061510331wk5.th.png" /></a>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-9842866271113651412008-05-12T09:38:00.001-04:002008-05-12T12:53:14.477-04:00More Terrain + iPhone!First off, I apologize for the long hiatus. It's been a crazy last few months, both with work and personal matters. Civilization Revolution is nearly out the door and it's been quite the challenge getting it there but I finally have some time (and motivation) to update the blog.<br /><br />Picking up where I last left off last time, the terrain demo is pretty much complete. By just adding some simple frustum culling to the quadtree node traveral, performance is now exceptional across the board (especially when you take into account how much detail is being represented). I also implemented geo-morphing so the transition between different levels of the heightfield is more pleasant and not so jarring. I implemented it pretty closely to how I said I would - I offset for each sub-node into the parent node's heightfield, store that off as delta's in the vertex structure, then interpolate between that and the real vertex position at specific points based on the error metric. Once again I'm pleased with the results.<br /><br />I don't plan on using the terrain for the Pony Express project anymore - the project scope when taking the game design into account are too divergent, but I do plan on extending the terrain engine a bit more one day. One thing I would love to add is storing off the different levels efficiently into file archives of some kind and streaming them in on demand. Right now when I load in all the different levels for a 8092x8092 terrain at 1024x1024 lowest level detail I very quickly run out of video card memory. The solution I'm thinking of would load the previous, current, and next levels and load and unload on demand as the levels move up and down. Wouldn't be too hard to implement but would take some time, which I just don't have much of lately. Too many other interesting projects to work on!<br /><br />Speaking of that, over Christmas break I finally broke down and picked up an iPhone. Outstanding little gadget, if you can stand that your phone might crash occasionally, hehe. A few months back as some of you may recall apple announced its plans to roll out an official SDK with an official storefront for deploying applications that developers make (well, as long as you pay the $100 fee and follow the rules, ha). Well soon after the Beta for this SDK was released (along with the Beta for the 2.0 iPhoneOS update that enables custom software), guess who was lucky enough to land a spot! Yep, yours truly! So for the past few weeks I've been spending a lot of time learning as much as I can about developing for the iPhone, and I must say, it's been an absolute blast!!<br /><br />The device itself pretty much just runs MacOS X which is not very hard to learn at all. ObjectiveC is also pretty easy to pick up since it's a simple OOP layer over C code. I actually somewhat enjoy the syntax - it's very explicit, which makes for reading old code very easy. Writing new code is a bit more burdensome which makes me wish Xcode (the iPhone development environment) had something like VisualAssist to help with code completion. I'm just being nit-picky though. The entire process is very streamlined and easy to pick up.<br /><br />Outside of a few practice apps, my first real project has been to develop a multiplayer Blackjack game, fully utilizing almost all of the phone's unique features. I won't delve too deep into the features but under the hood one thing I decided to do to simplify the entire process was write the entire application using the MVC (Model-View-Controller) paradigm, with the View currently being represented by a simple Win32 console application. This allowed me to concentrate on the core functionality and eventually migrate to something that conforms to apple's user interface guidelines using the iPhone graphics libraries (Quartz or via the Cocoa programming environment).<br /><br />The core functionality is nearly complete but I've been spending a lot of time refactoring the networking code. The main reason for this is that I plan on representing a large number of games either on a single or distributed type server. The idea right now is that a user logs on to the master server which itself maintains a list of table servers. The bandwidth requirements for a single table (of 5 players max) is very small, so a table server might hold from a few dozen to possibly hundreds of table's, depending on bandwidth requirements. Distributing the load is something I'm trying to work out right now and while the logic is not too difficult, engineering an efficient and easily maintainable (and extendable) system to do this is no cakewalk. Maintaining persistent stats across server boundaries is also a challenge and it also needs to be seamless to the end-user so as they browse for a table to play on they can't tell that they may be joining a different server.<br /><br />All in all it's an incredibly fun experience unlike anything I've ever worked on. My only regret is that I didn't get it finished sooner since I would have loved to submit it to the <a href="http://developer.apple.com/wwdc/ada/faq.html">Apple Design Awards</a> of which the deadline is unfortunately today. Ah well, maybe next year.<br /><br />After finishing up Blackjack Touch, I'm going to look into a health and fitness application I've been wanting to write for a while now, then maybe re-visit the Pony Express idea with mobile gaming in mind. I think it would work really well as a turn-based strategy game, kind of like the board game feel I originally envisioned for it. Because the iPhone is intended for short spurts of usage I think that makes the most practical sense for the kind of games it will have. I just don't see people sitting around for long period of time wearing down their batteries on something they need to receive phone calls on. In my opinion, short spurts of simple yet enjoyable gameplay with clear and concise goals is the way too go!<br /><br />Alright people, take it easy.Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-3181385358286770432007-10-18T09:34:00.001-04:002008-06-03T09:11:22.795-04:00More terrain rendering musings...So, I finally caved in and decided to get a next-gen console. Yes, so I do have a Wii, but I really don't think that counts (<a href="http://wii.ign.com/articles/771/771051p1.html">you go Hecker!</a>). So the question really was Xbox 360, or the Playstation 3. Now both Sony and Microsoft get on my nerves with their ad campaign and hype machine so I tried real hard to ignore things that have been said in the past (which are so absurd I won't even bother to post them here). The question then was, which console offers the most for me, a self-proclaimed casual hardcore gamer. As far as game selection, the 360 wins hands down. I'm not just talking about the much hyped Gears of War or Halo 3, but other worthwhile titles like Just Cause and the soon to arrive Mass Effect. The PS3 is definitely lacking here. On the other hand, things are looking up with games like LittleBigPlanet and <a href="http://www.penny-arcade.com/comic/2007/08/01">Eye of Judgment</a> coming out (<a href="http://www.penny-arcade.com/2007/08/01">which is reason enough to buy a PS3 imo</a>). Oh and <a href="http://www.gamespot.com/xbox360/strategy/sidmeierscivilizationrevolution/news.html?sid=6181133&om_act=convert&om_clk=gumballs&tag=gumballs%3Bimg%3B2&page=1">Civilization</a> <a href="http://xbox360.ign.com/articles/828/828213p1.html">Revolution </a>of course. :-)<br /><br />Now the nice thing about the PS3 is that it doubles as a Blu-ray player, which appears to be winning the Hi-Def disc wars. Right now (<a href="http://www.techspot.com/news/26131-Sony-to-phase-out-60GB-PS3-in-the-US.html">until stock runs out</a>), the PS3 60GB version is selling at $500, which is not too shabby considering it still maintains hardware backwards compatibility with PS1/PS2 via the emotion engine and vector units (and costs Sony $800 to manufacture. Ha, do the math!). To buy an equivalent Xbox (w/ HDMI) you'd have to get the $450 Xbox 360 Elite. For next-gen video, i.e. HD-DVD (instead of Blu-ray, which the 360 does not support), that's an additional $100 (I should mention MS has mandated this drive can never be used for games either, whereas PS3 Blu-ray can). Oh, and you want wi-fi internet access? That's another $100. So for an equivalent Xbox that can compete (feature wise) with the PS3, you're talking about spending $150 more!! To exacerbate the cost, the <a href="http://gamer.blorge.com/2007/05/31/microsofts-xbox-secret-failure-rates/">reported 30-60% failure rate is insane</a>. I think you can already guess which console I went with.<br /><br />Now I think for a while the naive approach most developers have taken towards games for the PS3 will result in a slight win for the 360 (thanks to great development tools, more on-die cache on the (same) PowerPC processor, unified (instead of segmented) video memory, predicated tiling with "free" MSAA, etc...), but once people start using the SPU's as they should be, things are bound to change. I give it two years time. Until then, I'm very happy with my new Blu-ray player. ;-)<br /><br />The only problem I've run into so far is heat due to my keeping the thing in an enclosed cabinet. I'm not willing to sacrifice aesthetics (what can I say, I'm shallow), so I devised a plan to improve air flow and <a href="http://www.amazon.com/Thermaltake-Technology-Mobile-External-Cooling/dp/B00080G0BK/ref=pd_bbs_sr_1/002-5051518-2132869?ie=UTF8&s=electronics&qid=1192567504&sr=8-1">found a cute little usb fan</a> that looks like it will work just nice. So after coming up with all this I decided to run it through my "this has to have been done before" filter and found someone who did the exact same thing (same fan even)! <a href="http://mickwest.com/2007/06/02/cooling-ps3-cabinet/">Props to you Mick</a>, I'm sure this will work now!<br /><br />So to change the subject a bit, I'm nearly done with a major overhaul to my new terrain system. I tried to come up with a good real-time continous LOD algorithm but I ran into a few initial problems. My first approach involved implementing a simple Binary Triangle Tree for polygon simplification (basically split a triangle at it's hypotenuse recursively until a max error level is met), which resulted in improved frame rates in high density terrains in the millions of polygons, but due to the triangle formation not being trivial I had to switch from using triangle strips to triangle lists which resulted in a HUGE performance hit, even with less polygons! I thought about using a 3rd party strippifier (like nvTriStrip) but it will most certainly add a lot of time to the precomputation (which is already somewhat long). I may investigate this in the future, but for now I decided to approach the problem slightly differently.<br /><br />In addition to the terrain simplification I planned to incorporate a quadtree to split the terrain up. As I was doing this , I suddenly remembed a paper I had read a good number of years back by Thatcher Ulrich on something he calls Chunked LOD. The basic premise is so simple it's brilliant. The purpose of the algorithm is to be able to render massive terrains that could not possibly be rendered on modern hardware. To do this, you take your massive terrain heightmap and subdivide using a quadtree (a recursive structure that divides a 2D field into 4 sub-area's until some condition is met). Each sub-level however may still result in too large chunks (quadtree nodes), so some kind of simplification must occur.<br /><br />For the simplification I merely resample the heightmap grid using a bicubic filter I coded up a while back (which looks just as good as photoshop's). I also map the height resolutions to some pre-determined max (for sanity's sake). As an example, a 8092x8092 terrain is WAY too large to display on modern hardware in real-time (it would be in the millions of triangles). If I was to decompose the quadtree to the 4th level, I end up with chunks sized 4096, 2048, and 1024. All of those sizes are still pretty massive, but lets say 1024 was acceptable as a max. Now instead of 8092 for the base chunk, we get 1024. For the next 4 sub-chunks we _could_ half the parent chunk's resolution, but this would result in a uniform distribution of points (not giving us better detail as the tree subdivides). By substituting the max for this number, I still maintain something close to my max from before, but increase the fidelity of the terrain mesh. So each level (including base) becomes 1024, 1024, 1024, and 1024 (the original high resolution version). In this case the lower levels (0, 1, and 2) lose some visual fidelity, but the highest level (3) maintains all of the original detail. This is important since this is the level the viewer will view closest.<br /><br />Thats pretty much how my pre-processing algorithm works. In real-time I recursively render the tree and at each node, check to see if an LOD error metric for that chunk has been met. If not, I continue down the tree until there are no more nodes (leaf node) or we're at a tolerable error level.<br /><br />The results so far are excellent, I'm very happy with it. The only problem so far is the seems at the edge's are still not acceptable even after implementing the terrain skirts like Ulrich mentions in his paper. I think this might have something to do with me not using enough levels so I'll hold off on trying to fix that further for now. The textures (dif/spec and normal map) are split in a similar fashion so I may be doing something wrong there as well to be causing the seems. The last thing I need to do is get terrain morphing working between levels to get rid of the unseemly pop when the LOD level is changed. I plan on doing something very similar to how I did the GPU vertex morphing for the Mona Sax facial animation demo. I'll have more on this later. Until then, here are some screenshots and a short video to demonstrate how it works!<br /><br /><a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab-025527938065526856 visible ontop" href="http://www.youtube.com/v/R8ivSYecXUw"></a><object height="350" width="425"> <param name="movie" value="http://www.youtube.com/v/R8ivSYecXUw"> <embed src="http://www.youtube.com/v/R8ivSYecXUw" type="application/x-shockwave-flash" height="350" width="425"></embed> </object><br /><br /><a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab-025527938065526856 visible ontop" href="http://www.youtube.com/v/jDRbyG1IwrE"></a><object height="350" width="425"> <param name="movie" value="http://www.youtube.com/v/jDRbyG1IwrE"> <embed src="http://www.youtube.com/v/jDRbyG1IwrE" type="application/x-shockwave-flash" height="350" width="425"></embed> </object><br /><br /><a href="http://img147.imageshack.us/img147/2545/terraintest220071017172tc7.jpg"><img src="http://img147.imageshack.us/img147/2545/terraintest220071017172tc7.th.jpg" /></a><br /><br /><a href="http://img147.imageshack.us/img147/4396/terraintest220071017172ax7.jpg"><img src="http://img147.imageshack.us/img147/4396/terraintest220071017172ax7.th.jpg" /></a><br /><br /><a href="http://img147.imageshack.us/img147/1269/terraintest220071017171fh9.jpg"><img src="http://img147.imageshack.us/img147/1269/terraintest220071017171fh9.th.jpg" /></a><br /><br /><a href="http://img147.imageshack.us/img147/3346/terraintest220071017171ag9.jpg"><img src="http://img147.imageshack.us/img147/3346/terraintest220071017171ag9.th.jpg" /></a><br /><br />One last thing! I tried to put into words what I thought of the movie 1408 which I finally got a chance to see last weekend as well as the Unreal Tournament 3 demo which I somehow found time to play. Unfortunately I just wasn't able to, so I leave you with this:<br /><br /><img src="http://www.encyclopediadramatica.com/images/9/92/Tankpwned.jpg" /><br /><br />Phantom Hourglass on the other hand gets an A+.<br /><br />l8r meeples!Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-65498987200109530192007-09-14T09:20:00.000-04:002007-10-10T10:34:10.812-04:00More happenings...Lately I've been doing a lot of creative writing, specifically for two things.<br /><br />The first thing is a new game idea I cooked up a few months ago. It basically started as a game design exercise I started for fun but has bloomed into a pretty fleshed out design with a complete design document in the works and a small proof-of-concept prototype. The high concept is this; Build and manage the Pony Express from the ground up.<br /><br />The setting obviously is the old west, specifically around 1860 in the United States of America western territories. I won't go to much into the history of the Pony Express, but it's story is truly an amazing tale worth reading about (I recommend <a href="http://www.amazon.com/Saga-Pony-Express-Joseph-Certo/dp/0878424520/ref=pd_bbs_5/002-5051518-2132869?ie=UTF8&s=books&qid=1189542579&sr=8-5">this book</a> for anyone interested).<br /><br />The game takes place in "real-time" over the entire span of the Pony Express which was a short 18 months (after which the telegraph reaches the west and the game ends). The goal of the player is to hire experienced riders, buy horses, build routes with relay stations and home stations, and ultimately try to win delivery contracts from different municipalities, and ultimately, the U.S. government (a goal the original Pony Express was never able to fulfill). The west however is not without it's many perils and the player must be careful to protect his routes from many dangers like Native American unrest, outlaws, blizzards, storms, and wild beasts.<br /><br />While certain aspects of the game will be historically accurate, the main emphasis is on simple yet thought provoking gameplay with infinite replayability (I highly regard Introversion's <a href="http://en.wikipedia.org/wiki/DEFCON_%28computer_game%29">DEFCON</a> for their achievements of these qualities). To allow for this the world is relatively accurate to what it was back in the 1860's with many cities and all states and territories left intact as well as the emigration trails existing as a starting point for the players routes. The player is presented with a map of the 1860's United States and from here is able to manage and build his mail delivery empire.<br /><br />It's all still in the planning phase and I may or may never actually implement the design but even so it's fun to work on a new idea (it seems like all I've been working on at home the past few years is <a href="http://www.startraderonline.com/">Star Trader</a>). Here's a few screenshots from a quick little terrain prototype I came up with for the country map:<br /><a href="http://img205.imageshack.us/img205/3315/terraintest220070911153zq2.jpg"><img src="http://img205.imageshack.us/img205/3315/terraintest220070911153zq2.th.jpg"/></a><br /><a href="http://img205.imageshack.us/img205/3428/terraintest220070911153tu8.jpg"><img src="http://img205.imageshack.us/img205/3428/terraintest220070911153tu8.th.jpg"/></a><br /><a href="http://img205.imageshack.us/img205/8156/terraintest220070911153cg8.jpg"><img src="http://img205.imageshack.us/img205/8156/terraintest220070911153cg8.th.jpg"/></a><br /><br />Here's another shot with some vector rendering I've been working on (for showing state borders). And yes, that _is_ Florida overlayed over California. :-)<br /><br /><a href="http://img146.imageshack.us/img146/3484/terraintest220070912170hv3.png"><img src="http://img146.imageshack.us/img146/3484/terraintest220070912170hv3.th.png" /></a><br /><br />The second exercise I've been working on is related to my cop game idea (Justice). The story basically revolves around two men with very similar backgrounds who end up diverging towards very opposite sides of the law. One is young and idealistic and decides to join the police academy after at a young age he witnesses his father being murdered in cold blood. The other cynical and broken after surviving a difficult childhood on the streets finds acceptance and importance in the criminal underworld. Both will eventually meet and come head to head in a tale of revenge, murder and ultimately redemption.<br /><br />That's a brief synopsis, but what I've been trying to do is make the story mirror a bit more some of the work of Joseph Campbell. Specifically the hero myth (or monomyth) story structure. There's basically a number of stages that such a story must use, like the call for heroism, the tests and tribulations, the boon etc... If you're interested I definitely recommend finding A Hero's Journey by Campbell.<br /><br />What I'm tring to do though is take the base skeleton of the story for Justice and see if I can mold it into a hero myth. The "good" guy character for instance joining the force after his father dies would be the call to adventure. The trials would be his time at the academy and first days on the job, continuing on with his success, or perhaps wrapping back around with another call to adventure (like through a promotion from patrolman to detective). Achieving the goal would ultimately involve solving the murder of his father and the admiration of his peer's (the reward).<br /><br />I still have a lot of work to do but I think it can definitely help to craft a more interesting story. An example of a great implementation of this story structure would be the Matrix. A few weekends ago I picked up a new sub-woofer for my entertainment center (a Martin Logan Dynamo fyi) and decided to put in my favorite movie, The Matrix, for a test drive. So as I'm watching it I started realizing that it exactly follows the Monomyth structure. For instance, in the Monomyth, the hero first must have a call to adventure. The Matrix has multiple instances of this. The message from Trinity to Neo's computer. The Cell Phone delivery at his job. The red pill or the blue pill. All of these things draw the hero into his quest despite his initial reluctance.<br /><br />Next the tests or trials. You can take these either literally or figuratively. When Neo fights Morpheus. The roof test. Morpheus' rescue. His first fight with an agent or more importantly with Agent Smith. In each of these Neo either succeeds or fails, but either way his quest continues.<br /><br />Next the hero achieves his goal or "boon". Trinity's profession of love to him. His death and ascendancy beyond the rules of the Matrix. These things bring important self-knowledge to Neo, specifically in that he is indeed "The One".<br /><br />Next the hero returns back to the real world. This stage requires little explanation except for being out of order perhaps (Neo returns from the Matrix to the "real-world" multiple times throughout the film. :-)<br /><br />Finally the hero applies what he has learned. The destruction of Smith. His warning to the powers that be. His Super Man flight. Neo has now learned of his true potential and will go on to use his power's towards freeing the rest of humanity that are still imprisoned in the Matrix (a perfect segue into the disappointing sequels).<br /><br />In some ways I think the Wachowski Brothers were greatly influenced by George Lucas' interpretation of the Monomyth. The Wachowskis so accelerated the process though that they ran out of room to develop the myth, resulting in two horrible sequels (as opposed to Lucas' 3 horrible prequels). ;-)<br /><br />Alright, I'm out. Later everyone.Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-78447253047155855092007-09-03T15:31:00.000-04:002007-09-03T14:42:43.895-04:00What's new?<p style="margin-bottom: 0in;">These past few weeks I've been pretty busy at work (yay <a href="http://en.wikipedia.org/wiki/Games_Convention">Leipzig</a>) and haven't been very diligent at home on my own stuff. The plan for the Zone system is pretty much in shambles. I have a number of idea's but each of them has their own set of limitations, which makes it very frustrating to just go with one. At this point I feel so indecisive about it I don't know how I'll ever get it working. Because of this I started working on my new material system. I said I wouldn't work on this until the project is over but what else was I going to do, ha.<br /><br />For those that may not know, a material is basically a way for an artist to describe the surface properties of a 3D object. While a model describes the shape of the object, the material defines which textures it will use, how light interacts with it, and possibly additional surface flags to describe how it interacts with the environment (i.e. concrete, dirt, grass). Although the term "texture" usually refers to an image applied to a 3D mesh, a material is what actually does define the texture of an object.<br /><br />Now it's not like my previous material system was insufficient; it was certainly incredibly capable. It's just that I have had an idea for a much more robust and extensible material system for a while now but really didn't want to re-write my material system yet again (the current version is probably the 4th or 5th revision in the history of the STO engine). Most of what I'm doing is design work; fleshing out the formats and detailing the creation process. Right now there's about 3 stages throughout the process of making a material but the final result is a fully optimized engine ready "compiled" output file.<br /><br />The way it works, there's a base material template (.mtrtmpl) which defines the specifics of what that material will do. Things like the number of passes, LOD info, sampling textures, multiplying colors and implementing lighting equations happens here. This file is setup to mirror most high level shader intrinics (things like dot(), mul(), etc...) and intended to be edited in a visual graph based environment (which I hope to have time to build one day, hee hee) strictly by a graphics programmer or (very) technical artist. The low level instructions are actually referred to as 'Micro-Operators'. 'Macro-Operators' allow for a collection of multiple Micro-Ops.<br /><br />The second part of the material system is the material definition file (.mtrdef). This file mostly matches the structure of the template and used is to allow the artist to specify which uniform and constant parameters are to be passed to the material. This includes things like colors, scalar values and texture (names). This file is also intended to be edited visually but also more easily than the template file, so only each operator that represents a user specified parameter is displayed. This is basically the artist frontend and thus is intentionally simple and straightforward to use.<br /></p> <p style="margin-bottom: 0in;">The material definition is then taken and compiled into a material object file (.mtro). During this process the template and definition files are evaluated and hlsl (or equivalent high level shader language) code is procedurally synthesized and the material object file created to store any user parameters (like which textures are used and any of the states for the material rendering passes).<br /></p> <p style="margin-bottom: 0in;">One thing I haven't touched on and will try to briefly describe is the way that shader permutations will work with this new system. One of the most irritating things graphics programmers have to do is generate multiple versions of the same shader with slight variations. When I was at RavenSoft for instance, there was a particular game I worked on that required 4 versions of any given shader. A version without skinning, one with one bone skinning, another with two bones, and yet another with four. Now if I wanted to make a version of this shader for when fog was enabled, that would require 4 more shaders!! Now there are ways around this problem if you use the .fx file format (uniform shader parameters for instance), but that's quite a limitation (a non-D3D renderer obviously can't use such a feature). To work around this issue, permutations will be a first class citizen in the material template file (described above). This means when I am defining an operation and it's inputs and outputs, I can also declare it as a permutation operator, define the possible permutations, and based on the game state, the proper one is used. When the material is being compiled all permutations are generated so the run-time costs are negligible; the material system just matches the renderer state to the correct shader permutation for that material. Half-life 2 has a similar system (although not as versatile and very slow) as well as Unreal Engine 3 (also not as versatile, plus they compile these shaders in run-time, which is, well, unwise, imo).<br /></p> <p style="margin-bottom: 0in;">There are still a few rough edges to iron out but most of the major hurdles have been accounted for. One thing I'm doing different than the other material system revisions is building this system in conjunction with the existing material system (MaterialV2). This means I can still choose to use the older system if something went wrong. I highly recommend this approach to anyone else contemplating reworking an existing system, it can lead to a lot less headaches over time.<br /><br />Alright, I have a lot more to talk about but I'll save it for another time. Have a great labor day everyone!</p>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-32003697385623893152007-06-29T00:32:00.000-04:002007-06-29T12:01:04.277-04:00The REVOLUTION begins!Yes, after all this time the game I've been working on at Firaxis has finally been announced!! <span style="font-weight: bold;">Civilization Revolution</span> is a continuation of the civilization series which takes it into a radical new direction (hence the interesting title). It's fast paced, visceral, and incredibly strategically engaging and has been an absolute pleasure to work on. It's been an incredible opportunity to be working with Sid Meier; definitely a a dream come true. I'm constantly learning something new and his level of genius never ceases to amaze me.<br /><br />The game is set to be released next spring so everyone will have to wait a bit longer before they can play it but there's an announcement trailer floating around along with some concept shots (<a href="http://www.shacknews.com/onearticle.x/47666">like here</a>). In-game screenshots will probably be released within the next few weeks, which is very exciting since that will actually show off some of the work I've done related to rendering and general graphics work. The game is looking phenomenal and I think will definitely surprise some people who thought a studio like Firaxis couldn't pull off the next-gen look.<br /><br />All in all it's very exciting to finally be able to talk about what I'm working on. It seems like so often everything I do is cloaked in secrecy. From one project to the next, I get maybe 6 or 7 months where my friends and family can know what I work on, then on to the next 2 year (on avg) secret development cycle. I suppose in modern times it's a necessity in order to avoid over-exposure (ehem, Duke Nukem Forever anyone?), especially on a game like Civilization that's constantly being tweaked and relies so much on iterative design to ensure the most balanced and enjoyable gameplay.<br /><br />So even though the past few weeks have kept me very busy at work, I've still had a lot of time to get a lot done at home. I've taken up collecting Star Wars: CCG cards again, which is unfortunately quite an expensive habit (seeing as they haven't been made in years). It was probably my favorite card game growing up (more so than Magic: TG) and even after all these years impresses me with it's strategic complexity and depth.<br /><br />I'm also really enjoying playing with the adorable little puppy we got about 2 weeks ago. It loves to keep me up at night which is just great... yeah. She's a miniature schnauzer, and incredibly cute, but, ugh, getting a new pup takes a lot of initial effort.<br /><br />As far as Star Trader work, most of what I've been working on in the past few weeks as been conceptual design work. The combat system is almost completely planned out and just needs to be implemented. I have a document that's something like 20 pages long and goes incredibly in-depth into all the space combat specifics. The last remaining detail actually involves interface design and how a bigger ship's weapons will be fired by the player (for instance, the turret hardpoints on a capital ship as well as any energy beam emitters and torpedo launchers). I'm trying to keep things as simple as possible while still keeping the player involved (via tactile interaction). This means I'm shying away from automated firing but I think this may come back to haunt me.<br /><br />I've actually gotten quite a bit of code work done as well. In the past few weeks I completely integrated the new very efficient font and gui element (quad) rendering I had prototyped a few months ago back into the main engine codebase. I can now basically render the entire GUI in a single draw pass if I setup my textures intelligently (by texture atlasing for instance).<br /><br />I also completely revamped my entire GUI system to use xml. It supports a brand new animation system and uses a much better skinning solution which relies upon a few layers of abstraction to reduce complexity. A GUI file defines a layout and a skin. A layout once finished should never change and contains all the windows with the different gui controls that represent any given user interface. The skin file however contains control templates and properties, which define the look and feel of the GUI and can be changed at will. I have a feeling I'll probably be working on all of the layouts and templates and eventually when I get an artist to help out (hopefully sooner than later), he'll be swapping out new art and assets in the property files.<br /><br />The other thing I finished was adding support for the 360 controller to the game. I recently purchased a wireless Xbox 360 controller and PC wireless adapter for this purpose. It's actually a great controller and works great for playing some Tie-Fighter or Freespace 2. So far I've only implemented controls for the new GUI stuff I had been working on but the plan is eventually allow for complete control of the game through the Xbox controller. Now I'm not of the mind that all game genres perfectly translate to a gamepad controller (first person shooters for instance will NEVER play as good as a mouse/keyboard combo), but I think that Star Trader really is perfectly suited to allow for all levels of control strictly from the gamepad. I actually think it may work even better than the mouse/kb and have a lot of great idea's about how to make the player interactions with the controller completely seamless requiring almost no thought. I'll have more details about this at some point but don't worry, I'm definitely planning on keeping things as simple and straight forward as possible. <a href="http://www.penny-arcade.com/comic/2007/06/08">This</a> situation is certainly something I plan to avoid.<br /><br />Another thing I had been playing around with is screen-oriented billboard line drawing, which I plan to use these for lasers and exhaust trails (think Homeworld). Although the basic implementation is complete, there are a few issues I still need to work out. Basic laser projectile code is up and running though but I really need to get the ship combat system back up and running. It's been down for a few weeks as I've been revamping my entity management and zone systems. I basically NEED to finish my zone system by next week or progress with the game is going to be completely stalled. I have some idea's about how it should work but right now I'm trying to figure out the best way to implement it with the least room for programmer error (i.e. where's entities aren't accidentally placed in the wrong zone, or objects render incorrectly because of wrong zone ownership).<br /><br />Alright, that's all I've got for now. Have a good one! Later!Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-85993341555039433402007-05-18T09:26:00.000-04:002007-05-20T22:41:11.305-04:00Star Trader Communication System + Skeletal AnimationIn Star Trader the player will be able to communicate with both player and non-player characters (NPCs) indirectly via "sub-space channels", and directly via the com (communication) screen. When the player initiates a com screen dialogue with another player or a trading station, a little screen will pop up with the other party's avatar and bunch of options underneath the screen for what the player wants to do next. Here's a (very) rough mock-up to illustrate what I mean (source art from Space Quest 6).<br /><br />This screen represents the space station com screen.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR56Nhs83Qi4gDGVdteuCQGdIMqKF2o7-Vtaid0g9GSrSIzw-Pu8afAKU3GK9L2IvVksfrTcm2ZFTzxgEiXVevMmPejChy_Dzf4_JqrQwyo2Xfa323N9YlYzv9cTo_aCPdEEecKiljKyEB/s1600-h/station_mockup.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR56Nhs83Qi4gDGVdteuCQGdIMqKF2o7-Vtaid0g9GSrSIzw-Pu8afAKU3GK9L2IvVksfrTcm2ZFTzxgEiXVevMmPejChy_Dzf4_JqrQwyo2Xfa323N9YlYzv9cTo_aCPdEEecKiljKyEB/s320/station_mockup.jpg" alt="" id="BLOGGER_PHOTO_ID_5065229173260935394" border="0" /></a><br /><br />And this screen is a mock-up for the player-to-player/player-to-npc com screen.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXHmOVXKCbBxhLbmq-EGpBimtET55goyHrLHWFkPk0qWule4Q1WQuGBd9opwKGf1c3Go6Fe96ucvYn9iE_5KxLsARzrJBqL02K4oONyaSUDHNpQthv2DUUWvZegXDZjzG-8gwMNaojf4EF/s1600-h/com_mockup.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXHmOVXKCbBxhLbmq-EGpBimtET55goyHrLHWFkPk0qWule4Q1WQuGBd9opwKGf1c3Go6Fe96ucvYn9iE_5KxLsARzrJBqL02K4oONyaSUDHNpQthv2DUUWvZegXDZjzG-8gwMNaojf4EF/s320/com_mockup.jpg" alt="" id="BLOGGER_PHOTO_ID_5065899145209438450" border="0" /></a><br /><br />Because the player will be looking at an actual person (or uh, alien... thing), I needed to implement some kind of character rendering to accommodate this. Those characters would also need to animate so I would need support for skeletal animation, which my engine did not at the time support. Because of this, over the past few weeks I've been slowly building a prototype of the skeletal animation system which I am almost ready to incorporate into the engine. For this I ended up creating a my own custom Collada importer because I was quite unhappy with the DOM and FCollada libraries, and surprisingly it works quite well! The last major thing I need to do is convert form the Z-Up axis format to Y-Up and optimize the vertex lists.<br /><br />Now the skeletal animation system is not quite done yet but here's a short video of it in action using the Mona Sax model from Max Payne 2 as a test model:<br /><br /><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/iDpWLAGekoE"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/iDpWLAGekoE"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/iDpWLAGekoE"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/iDpWLAGekoE"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/iDpWLAGekoE"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/iDpWLAGekoE"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/iDpWLAGekoE"></a><a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" href="http://www.youtube.com/v/iDpWLAGekoE"></a><a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" href="http://www.youtube.com/v/iDpWLAGekoE"></a><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/iDpWLAGekoE"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/iDpWLAGekoE" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></embed></object><br /><br />I had to manually rig and animate the model myself (since only the source model was available in the MP2 SDK) so although it may not be too impressive it's something at least (until someone makes me a better test model :-). Whats in place so far is standard skinning through software or GPU. I'm storing the transforms as quaternions and keyframe interpolation works perfectly but I still need to implement multiple animation channel blending (e.g. for running and waving at same time) and transition blends (e.g. smooth transition from run to jump). I'm not quite sure how I want to do that just yet so it may take me another week or so to completely finish it up.<br /><br />The Mona Sax model was originally made for a fixed function pipeline with no per-pixel lighting so I had to create some normal and specular maps to go along with the phong lighting I'm using. One thing I did that I am very happy with the results of is storing not only the specular color mask in the rgb channels of the specular map but also the specular power in the alpha channel. What this means is that I can render an entire character in one pass with very diverse levels of shininess. Thus the skin be relatively matte but the eyes nice and shiny. Here's an example:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQNuKP-dNWEMG_8AYAkbi2ODfas7M7g4U4rG7b8VX7na1XLjEJar2NCp583VH8aYpIxCTlhTEiKDVWqXIRiQLL1I4kJ8uJeZk6_UzZM7Zhpz0QDp-73c0C-rK9b-onxw3YT9xxbrPQ95lp/s1600-h/colladatest+2007-05-18+11-05-38-25.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQNuKP-dNWEMG_8AYAkbi2ODfas7M7g4U4rG7b8VX7na1XLjEJar2NCp583VH8aYpIxCTlhTEiKDVWqXIRiQLL1I4kJ8uJeZk6_UzZM7Zhpz0QDp-73c0C-rK9b-onxw3YT9xxbrPQ95lp/s320/colladatest+2007-05-18+11-05-38-25.jpg" alt="" id="BLOGGER_PHOTO_ID_5065918159029657858" border="0" /></a><br /><br />The eyes and lips have a specular power (shininess) of about 200 or so and the skin is varies around 50-150. I plan to eventually add some pseudo subsurface scattering at some point but right now I'm keeping it pretty simple.<br /><br />Now one of the other pre-requisites for my character system was some sort of support for facial animation. The most straight forward way to do this would have been to use skeletal animation with a bunch of face joints to animate important muscle groups. There are definitely a number of advantages to this. For starters the animation pipe-line is unified and easily modifiable by an artist. Second, skeletal animation is relatively efficient and quick to do in hardware. Also it's relatively easy to blend multiple animations together to achieve a nearly infinite number of facial expressions.<br /><br />Skeletal animation however is not necessarily the only and best way to do facial animation. Another option is using morph target animation, which is what I ended up going with. With morph target animation, instead of interpolating between different poses of a skeleton which deforms a mesh, we interpolate, or morph, between multiple geometry shapes. The really nice thing about using morph target animation over skeletal animation is that you can directly model the poses you want to deform to without having to worry about proper joint placement and weighting. For facial animation this is especially nice since you can do things like creases and subtle muscular skin deformations that would take a ton of joints to pull off.<br /><br />An additional point to think about, and bear in mind I don't have any evidence to directly back this up, I suspect that on especially complex (high polygon) models it can be much more efficient to use GPU accelerated blend pose animation over skeletal animation. Now while I concede that software based blend pose animation will never beat out skeletal animation performance wise, doing the calculations on the GPU offers an incredible opportunity for taking advantage of the GPUs parallel nature. Some further points:<br />First, that vast amount of joints is potentially more than can be rendered in a single pass since only a certain number of constant registers are available on older vertex shader profiles (like vs 2.0). This might require additional passes as the model must be segmented to accommodate multiple HW accelerated renders.<br /><br />Second, most GPU skinning implementations do not go beyond 4 joint influences per vertex. With a large number of joints in close proximity, the effect of the surrounding joints for a particular musculature would be incredibly weak, making it very difficult to achieve good results, requiring a lot of tweaking.<br /><br />Third, if you're blending between 4 joint matrices per-vertex (the average influence count), you're talking 4 matrix adds (at 4 instructions each), plus 4 scalar/vector multiplies (for the weights), plus a matrix multiply for each vertex attribute that must be transformed, so for the position, normal, tangent, 3 matrix multiplies (at 4 instructions for each m4x4). Roughly lets say that's 32 instructions total (16 + 4 + 12).<br /><br />For GPU accelerated morph target blending, you load up all the targets into vertex buffer, then set the active ones to the appropriate vertex streams with only a max number of simultaneous blend targets active at once (and mapped to the proper vertex attributes). So lets say there were a max of five blend targets possible at one time. Using delta morph targets (with a base target acting as the delta source), to accumulate the result of each morph target requires a single scalar add and multiply, which is 1 instruction (madd). So for 5 morph targets, we're using 5 instructions for position, plus 5 instructions for the normal. The tangent can be derived from the morphed normal and the base tangent via orthonormalization (this takes about 4 instructions) and the binormal is derived via a cross product (as would be in the skeletal animation case as well so we won't count that).<br /><br />That gives us a total of 14 instructions for morphing over skeletal animation's 32 instructions per-vertex. Although using multiple vertex streams is not as efficient as interleaved vertex arrays, you're also not sending huge lists of joint matrices to the vertex shader (just a small list of morph target weights) which about evens it out. So in the end I think it's pretty obvious that for complex models that require a lot of animation detail, GPU accelerated morph target animation can be just as fast if not much faster than using skeletal animation with a high joint count. There's next to no CPU work involved for blend targets, whereas skeletal animation requires a skeletal hierarchy to be maintained (traversed/accumulated, animated, interpolated, keyframes blended etc...).<br /><br />Now I'm not advocating switching your engine to using pure blend target animation here, I'm just saying that for certain situations (like facial rendering), blend target animation can be a big win. It should be noted however that older games like Quake 3 actually did use blend target animation ("vertex animation") to animate it's characters, but this required a LOT of blend shape keyframes as the linear interpolation results in horrible artifacts if the poses differ too much. For large animations this requires a lot of memory (and is proportional to the vertex count for that model, so it can be REALLY big for larger models). Also you can't reuse an animation between multiple models as you could with skeletal animation so it's a lot of wasted time for artists.<br /><br />In the end here's the result of a keyframed blend target animation using 3 poses (base, open mouth, closed eyes):<br /><br /><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/x9enTsryrA8"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/x9enTsryrA8"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/x9enTsryrA8"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/x9enTsryrA8"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/x9enTsryrA8"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/x9enTsryrA8"></a><a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" href="http://www.youtube.com/v/x9enTsryrA8"></a><a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" href="http://www.youtube.com/v/x9enTsryrA8"></a><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/x9enTsryrA8"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/x9enTsryrA8" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></embed></object><br /><br />Of course this is nothing compared to the new face demo nvidia just released. Here's the vid if you haven't checked it out yet:<br /><br /><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/LIGWAYS5uRw"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/LIGWAYS5uRw"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/LIGWAYS5uRw"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/LIGWAYS5uRw"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/LIGWAYS5uRw"></a><a style="left: 0px ! important; top: 15px ! important;" class="abp-objtab visible ontop" href="http://www.youtube.com/v/LIGWAYS5uRw"></a><a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" href="http://www.youtube.com/v/LIGWAYS5uRw"></a><a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" href="http://www.youtube.com/v/LIGWAYS5uRw"></a><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/LIGWAYS5uRw"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/LIGWAYS5uRw" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></embed></object><br /><br />I don't plan to go quite that extreme with my implementation but it's definitely exciting to see whats possible using current generation hardware. Their lighting implementation appears to be the same one used in the Matrix movies (blurred texture space lighting), but the brunt of what makes that look so nice probably has a lot to do with the high resolution textures they used. Such a shame you need Windows Vista and a DX 10 part to see this on your own computer.<br /><br />Aright I'm out, later.<br /><br />p.s. As I was writing this I suddenly noticed a little pop-up bubble next to the "save now" button which says "Now Blogger saves your drafts automatically!" - exactly what I was complaining about last time! Damn I love Google.Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-81904909942802851152007-05-11T07:23:00.000-04:002007-05-12T23:26:36.382-04:00GDC, Part II (and long overdue)Part 2 of my GDC wrapup will be relatively short since I covered most things last time. Also the rest of my pictures came out quite poorly so no pics this time around.<br /><br />The first class I attended at GDC was entitled "Interactive Cinematography" with speaker Thiery Adams from Ubisoft. First Thiery elaborated on what he meant by Interactive Cinematography. When people normally think of cinematography in games, the first thing that probably comes to mind is cutscenes or other in-game scripted events. Thiery on the other hand is referring to cinematography in regards to what the player sees as he makes his way through the world. As an example he presented the camera work in the Nintendo 64 classic, Mario 64, as a game that gave many people their first impressions of interesting camera work in a 3D environment. Thiery's main insight into the subject was that while games have progressed greatly since then (i.e. look at Resident Evil 4), game developers still don't talk in a common grammar when describing how a scene should be presented to the player. Thiery suggests taking a cue from the movie industry by having developers speak in terms of framing, focus, exposure, pacing, close-ups, long-shots, panning, tracking, etc... The talk was not quite what I expected but interesting none-the-less. Definitely something to consider.<br /><br />Since the last time I attended they added a new kind of session called a poster session. The idea is basically to have a presenter talk about his subject in front of, well, a poster. The idea seems somewhat sound until you actually attend one of these sessions. The one I attended was called "True Imposters" by Eric Risser and I have to say it was absolute madness. Since the poster sessions are on the floor (right next to the hiring fair and one of the cafeteria's), it was so loud you couldn't actually hear the presenter. That hardly mattered however as he was completely surrounded by the people trying to read the poster behind him, which meant you couldn't even see the poster yourself. The idea is ludicrous; I really hope the GDC organizers wise up and drop it for next year.<br /><br />From what I got out of the session though, Eric came up with a solution for having imposters that properly replicate the color and depth of an object, as opposed to just the depth as in depth sprites, and the color as in imposters. His solution is basically just a raytracer within a pixel shader which unfortunately makes it completely impractical for real-time usage. Why would any developer want to use an LOD technique to imitate an object when the LOD technique is more expensive than just rendering the object!? Ah, academics...<br /><br />An interesting session I attended involved something I had never heard of; Dual Quaternions. The basic idea, from what I understand, is that you can extend a basic quaternion (you know, those 4-dimensional imaginary numbers that can be used to represent a 3-dimensional orientation) to provide a translation in addition to the orientation. The talk was titled 'Skinning with Dual Quaternions', by Ladislav Kavan, so the examples centered around the effective use of DQ's for animating joint orientation and translation (as opposed to using a matrix or standard quaternion). The main benefit to using DQ's over a standard quaternion is that when you interpolate your skeletal joints between frames using a spherical interpolation (slerp) you're also transforming your translation around the unit sphere.<br /><br />I liked the talk, but I do have to say Ladislav used incredibly biased examples to skew the effectiveness of his results. DQ's are supposed to fix issues related to odd interpolation artifacts, but a large part of what his algorithm was solving was a very poorly rigged model. I've worked on games for a while so understand the evolution of an animated model from the conceptual sketchup to the finalized product, and I can tell you that with a great artist you can reduce the kinds of problems he was presenting with some clever fine tuning. While I acknowledge that DQ's give some very nice results, I couldn't possibly justify the 30%+ decrease in performance for it when a little work makes existing animation schemes function just fine.<br /><br />In addition to the classes and numerous other events that occur at GDC, there is also a yearly IGDA meeting. <a href="http://igda.org/">IGDA</a> if some of you are not aware is the Independent Game Developers Association, and they basically advocate for game developer rights and setup committees to explore currently relevant issues. The meeting was exceptionally disappointing for me. The last time I attended was many years back, but little has changed. There are certainly more people, and some of the players have changed, but the IGDA is really not doing much to enrich game developer lives. The biggest topic on hand was how to increase awareness of the organization while spreading it's message to more people. The problem though is that the IGDA does not even have a mantra or mission statement that people could latch on to or identify with. Not even something like "To enrich game developer lives through advocacy and education". I was about to bring up this point but was interrupted by someone with a different agenda (something about Tom Buscaglia, who's now the game industry super star lawyer or something) and then had to leave early to attend a Sony meeting. I may try to change this by becoming more active in the local chapter in the future but enacting change is never an easy thing.<br /><br />Finally the last class I attended was titled 'Shared Technology at Rare', by Tom Grove (who is the Tool/Tech Director or some equivalent at Rare). While Tom was without a doubt the most nervous lecturer I have ever seen (I was honestly worried he would have a heart attack right there), he made a lot of great points and was an interesting speaker to listen to. Tom chronicled the process involved in making a solid shared technology team as they did at Rare for such titles as Perfect Dark Zero, Kameo and Viva Pinata. It sounds as if they had a lot of hurtles to overcome. One very interesting insight was that they started out treating the project groups as customers, but quickly learned that this model just doesn't work since projects have very specific needs that require constant maintenance. Overall a good talk if not a little nerve-wracking (for the speaker, heh).<br /><br />And that wraps it up. I apologize for taking so long to post this but I had written up a nice long post and accidentally rebooted my PC before saving (thanks Windows Update). Google should really add an auto-save option to Blogger. Either way my fault. Next time something more interesting. See ya!Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-16609164757233883752007-03-13T15:36:00.000-04:002007-03-27T17:54:20.021-04:00GDC, Part 1Although I promised to get around to the Star Trader combat model, I was lucky enough to be able to attend GDC this year and I thought I would share my impressions.<br /><br />It's actually been 5 years since I last attended so it was nice to finally make it back out. The last time I went was right before I got a job in the game industry so this was actually my first attendance as a game professional (as opposed to a desperate little kid looking to break into the biz). Here's a shot of me back then with a man that needs no introduction:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbMs-VRmibAb7nEw3wv_19BD6LUP76f51tdjSyn9p8aEU6qt6oDMw8EbuwqeHr5DNiavXOAjOk1EZ6YzajdOL4c51mHjPhhT2LM-VfIM1P_p-j2EqVyNzbcLvmYbCzTZtdopSEKXPx8wzY/s1600-h/will_aurelio.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbMs-VRmibAb7nEw3wv_19BD6LUP76f51tdjSyn9p8aEU6qt6oDMw8EbuwqeHr5DNiavXOAjOk1EZ6YzajdOL4c51mHjPhhT2LM-VfIM1P_p-j2EqVyNzbcLvmYbCzTZtdopSEKXPx8wzY/s320/will_aurelio.jpg" alt="" id="BLOGGER_PHOTO_ID_5041496358779004322" border="0" /></a><br /><br />The conference this year was great and I certainly came home with a lot to think about. One of the highlights was definitely Shiguru Miyamoto's kenote address on Thursday, although I definitely could have done without the line.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMprc6I6Qetc_bxzsNGz1dRZmdE8tUDLhOW62fpJJsuxqemmFjc3xIY3rZsUIbJGQtoE2aQuf-YtE6IvfDCVYqopmrkKCLNx_9ad6DnGFtMw6Jp7P4BZ7h7mlWDarS0A6vqDffuHPqcos1/s1600-h/CIMG1959.JPG"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMprc6I6Qetc_bxzsNGz1dRZmdE8tUDLhOW62fpJJsuxqemmFjc3xIY3rZsUIbJGQtoE2aQuf-YtE6IvfDCVYqopmrkKCLNx_9ad6DnGFtMw6Jp7P4BZ7h7mlWDarS0A6vqDffuHPqcos1/s320/CIMG1959.JPG" alt="" id="BLOGGER_PHOTO_ID_5045687529966148626" border="0" /></a><br /><br />His examination of the state of the industry and the negative connotations we must fight were certainly very heartfelt. The "wife-o-meter" was also a very entertaining and humorous way to describe the critical and mass adoption of games by an entirely new generation of "casual" gamers. His contributions are what pushed me to want to make games so seeing him speak was quite an honor. Passing by him on the way to diner that night was quite an exciting moment as well.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDCjXk_D9_L2aKzb1jyjGWONRCr1mxLnjvNYapCmCpALGIYiMIVbd_1GqZT_DZtQFK4hMWH2tayO0fvXOt3i8s7ojYNJENgbeg06cuoQ5exo0-tzWwSsYEwZ0LDg0At2mXrPTqpEoqKReC/s1600-h/CIMG1973.JPG"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDCjXk_D9_L2aKzb1jyjGWONRCr1mxLnjvNYapCmCpALGIYiMIVbd_1GqZT_DZtQFK4hMWH2tayO0fvXOt3i8s7ojYNJENgbeg06cuoQ5exo0-tzWwSsYEwZ0LDg0At2mXrPTqpEoqKReC/s320/CIMG1973.JPG" alt="" id="BLOGGER_PHOTO_ID_5045688058247126050" border="0" /></a><br /><br />Phil Harris also gave a great presentation for Sony's new "Home" environment for the Playstation 3. Although it obviously a PR event, Harris' explanation of what Home is and how it will appeal to both gamers and developers alike was very well presented, entertaining, and infused with enthusiasm. I could definitely see this as a great way to unobtrusively tune the player into a game world outside of the massive cutscenes and backstory that are injected into games these days. It seems like a natural progression to combine something like The Sims with Nintendo's Mii Channel. LittleBigPlanet was also a very interesting example of emergent gameplay in the "next-gen era" and looks to be lots of fun (assuming myself or anyone I know every picks up a PS3 to play it on).<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcvOaKpx5rScEZmiQdqSe89ZNtzpKejMIk277h64ieiPxTeLKLUFYyfWO1g1ly_sDUP108T58GoB_liUrnyGmWcjBT6gjiCMWr07oZH-eteue4q7qPl676kVLfRKcLTSFB-AFYsh-QE8DZ/s1600-h/CIMG1953.JPG"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcvOaKpx5rScEZmiQdqSe89ZNtzpKejMIk277h64ieiPxTeLKLUFYyfWO1g1ly_sDUP108T58GoB_liUrnyGmWcjBT6gjiCMWr07oZH-eteue4q7qPl676kVLfRKcLTSFB-AFYsh-QE8DZ/s320/CIMG1953.JPG" alt="" id="BLOGGER_PHOTO_ID_5045683157689441266" border="0" /></a><br /><br />Although I had to make quite a few meetings (Nvidia, ATI, Microsoft, etc...), the classes I was able to attend were very insightful. I was particularly impressed at Chris Hecker's talk about the Procedural animation engine in Spore. Before I went in there it seemed almost like magic how they were able to take completely user generated creatures and animate them without any fore-knowledge. After his talk though I had a much better understanding of how they were able to use developer created content along with a number of hints to determine how a user created creature should be animated. Also from Maxis was Chain Ginhold who spoke about Spore's "Magic Crayons". Basically he went in depth into how Spore and similar games (i.e. Will Wright 'toys', like Sim City) allow the player to express themselves creatively.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1Kf3WiYBHUS-XjtBbsFsgeCkNXpJPAf3NV9vPTi-hcwEg9TSi3QrjGGWzxZQu2oRBEi4UXVqbLupRr146hwLA0iK1ABDsQPokucFbtaL15VgvbXO5Yfr-94jKkFKMcDxp_zphNP6GTPhW/s1600-h/CIMG1982.JPG"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1Kf3WiYBHUS-XjtBbsFsgeCkNXpJPAf3NV9vPTi-hcwEg9TSi3QrjGGWzxZQu2oRBEi4UXVqbLupRr146hwLA0iK1ABDsQPokucFbtaL15VgvbXO5Yfr-94jKkFKMcDxp_zphNP6GTPhW/s320/CIMG1982.JPG" alt="" id="BLOGGER_PHOTO_ID_5045688444794182706" border="0" /></a><br /><br />Warren Spector gave an excellent presentation on story telling in next-gen games. His talk was actually an update on his thoughts on storytelling that he gave about 3 years ago. In conclusion he still believes story is an integral part of games, going so far as to tell us game developers that we have an "obligation to tell stories in games". I couldn't agree more, although by stories he doesn't just mean the linear kinds of stories we might find in games like Half-Life or Gears of War (Tetris or The Sims can have a story for instance). He also made some great points in the vain that if stories are to be told in a traditional manor, we need better virtual actors, particularly ones that are represented iconically. The new movie 300 appears to do this incredibly well which shows that even the great storytellers in the film biz realize this.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3XPh3lBGSqoFQg_kwK4-nubVrZ5K23F4y3DSNGf8J4jnnuO2J2EP137I3IWOR65rqxdMVqWDI0UKI8Cwm8iZin-lQ5n8XAwDhQA3I2NheIDQMeQZo1x9PigfqOVBfuiJePtGAQbFlnksd/s1600-h/CIMG1954_2.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3XPh3lBGSqoFQg_kwK4-nubVrZ5K23F4y3DSNGf8J4jnnuO2J2EP137I3IWOR65rqxdMVqWDI0UKI8Cwm8iZin-lQ5n8XAwDhQA3I2NheIDQMeQZo1x9PigfqOVBfuiJePtGAQbFlnksd/s320/CIMG1954_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5045686838476413954" border="0" /></a><br /><br />Cliff Blezinski (aka Cliffy B) gave an interesting presentation on iterative design in games. Although he was a very entertaining speaker and made some great points, I felt like he didn't go into their iterative design process as much as I would have liked. There was more talk about the creative decision making of GOW than the iterative design which was disappointing. The best point he made though was that without proper documentation and control in the iterative process, the project is bound to dissolve into 'chaos and anarchy'. He also made a good point that while design is king, visuals, polish, and presentation count. While obvious, it's definitely something important enough to remind people.<br /><br />Tom Leonard from Valve spoke about how they converted the Source Engine to take advantage of modern and future multi-processor computers. I thought he gave a very 'real' account of what a lot of developers have been going through in the past two years, which is basically a complete reworking of how their engines work to take advantage of parallelism. To sum it up, their solution was to split the client and server components of their engine into their own threads, then reuse the remaining processing power for computation hungry systems (through so called 'lazy parallelism'). While clever this solution was nothing novel (I've already made strides towards this end in the Star Trader engine, for instance). Quake 3's SMP is far more interesting, and now being open source I recommend anyone interested on the subject to browse it's multi-threaded renderer. We implemented something similar for Quake 4 when I was at Raven but Q3's SMP really is elegant and simplistic beauty.<br /><br />One of my favorite talks at the conference was by Randy Smith from EA. Randy previously worked on such titles as System Shock 2 and the Thief series which are some of my all time favorite franchises. Randy's talk explored the issue of player save/load compulsion, which has to do with the reasons behind why players feel so compelled to save and load so often (for instance in games like X-COM or Half-life 2). Randy's conclusion about the players motivation has to do with a risk/cost assessment that the player makes before or after an event perceived as major.<br /><br />As an example, lets say you're playing a game of Half-life 2 when suddenly you hear the sounds of gunfire and see explosions in front of you originating from around the corner. As you near the corner you instinctively save the game, sensing the danger you're about to face. Moments after, you're hit by a surprise rocket blast; you failed to see the enemy soldier on the roof of a nearby building. The critical blast takes away 70 points of health, leaving you with just 30 points. At this moment, you the player makes a judgment call; do you continue forward, looking for a health pack that will restore a meager 25 health while another hit might mean doom, or do you re-load from the last save point. In this situation, the player's death means lost time for the player. The risk analysis involves him considering how much time he can recover by simply loading from the last save point. It's of course much more involved than this depending on the situation (i.e. personal attachments to NPC's, unique items, etc...), but the point is that understanding the players psychology is the best way to remedy the problem, and check points or limited saves is just not an answer. Randy suggested enriching the players experience by putting more control into the player hands. He cited the shield control system in the game X-wing as a great example of this. Overall I took a lot away from his talk and plan to keep it in mind on future games I work on.<br /><br />Alright that's enough for today. I'll wrap things up next time. Later.Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-61016019210422446062007-02-03T14:34:00.000-05:002007-02-03T14:34:53.008-05:00Vista! + Board games!So uh, Vista... hmm. Seems like MS' latest OS installment didn't have quite as warm a reception as they had hoped. I'm personally not too shocked - the majority of new features are merely cosmetic and don't thoroughly address modern usability issues. What I am curious about is what this means for long term adoption. Most new computers will be coming out with Vista pre-installed, but there are a lot of existing users out there who sound like they won't bother upgrading. I have to wonder what long-term implications this will have on game developers, since DirectX 10 is a major improvement over 9. In all likely hood developers will probably plow forward with DirectX 10 as a requirement which may increase Vista adoption. It remains to be seen if that was Microsofts plan all along.<br /><br />This is actually kind of funny, while Vista just came out, it's the first time in probably 5 years that I've installed a Linux distribution on one of my machines. Specifically I just installed the <a href="http://en.wikipedia.org/wiki/Ubuntu_%28Linux_distribution%29">Ubuntu</a> Linux distro so I can setup a stable and quick <a href="http://subversion.tigris.org/">Subversion</a> server.<br /><br />The installation was relatively quick and easy. Ubuntu itself is very user friendly although I'm not sure Linux is quite as easy to use as Windows yet (lots of command line tweaking required). I also downloaded the <a href="http://en.wikipedia.org/wiki/Edubuntu">Edubuntu</a> live cd to show to my Fiance (who is a school teacher) and she was actually quite impressed (and didn't even know there was such a thing as <a href="http://en.wikipedia.org/wiki/Open-source_software">OSS</a>). Both versions contain a TON of Open-Source free productivity utilities (like OpenOffice) with Edubuntu even containing an entire educational suite.<br /><br />Now I wasn't able to get a dual-boot setup going although the problem I ran into was not even completely Ubuntu's fault. You see, the machine I was installing it on is a relatively old one and it's bios doesn't have support for greater than 8 GB hard-drives natively. Ubuntu uses something called GRUB as it's boot loader which was installed at a partition past the 8 GB limit. Since it couldn't map that space, the boot loader would fail every time. After a bit of googling and a LOT of experimentation, I finally realized I could just create a tiny new partition at the beggining of the hard-drive (where the boot loader would reside). Unfortunetly I wasn't too careful during the process and so accidentally destroyed my Windows partition. :-) All is well now though and luckily nothing critical was lot. Honestly a dual-boot on that machine doesn't even make sense so I probably won't even bother in the future. Besides, learning how to get SVN working is taking enough time as it is...<br /><br />I've never been very big on Board games but the past year or so me and the woman have been playing a lot of really great ones. Specifically german-style board games like <a href="http://en.wikipedia.org/wiki/Settlers_of_cataan">Settlers of Catan</a>, <a href="http://en.wikipedia.org/wiki/Lost_Cities">Lost Cities</a>, <a href="http://en.wikipedia.org/wiki/Ticket_to_Ride_%28board_game%29">Ticket to Ride</a> and <a href="http://en.wikipedia.org/wiki/Carcassonne_%28board_game%29">Carcassone</a>. Now when most Americans think of board games they usually think of games like Monopoly, Sorry!, or Uno. The reality is that in other parts of the world there are some really incredible games that really haven't penetrated into the American mainstream yet, but I think thats destined to happen. While Settlers and Lost Cities have really been a blast, Carcassone is probably the game we play most. With it's simple rules yet complex strategic depth, it's always a game with tons of suspense and drama. It's also highly replayable offering a completely different experience each time. Settlers is a classic but relies maybe too much on your initial luck with placement and rolling the robber (which can really leave some players in the dust). Next up is <a href="http://en.wikipedia.org/wiki/Puerto_Rico_%28board_game%29">Puerto Rico</a> but I'm afraid the complexity is really going to turn the woman off of it (although I doubt it's as complex as something like Axis & Allies).<br /><br />Alright, I'm out. Next time, <a href="http://www2.blogger.com/www.StarTraderOnline.com">Star Trader</a> space combat!Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-78866491531827029832007-01-27T16:54:00.000-05:002007-01-27T16:55:28.476-05:00Terrain PrototypeI recently read an article on a study that discovered that the more educated you are, the longer it takes to answer simple questions. Forgive me for not having the link handy, but I'll summarize. The research concludes that more educated people have more points of reference to base their answers on, in other words more possibilities.<br /><br />As an example, a (relatively) simple question to ask an American is "What battle represented the last major offensive by the Confederacy in the Civil War". The average person probably doesn't know this, but may have at least heard of Gettysburg, probably the most famous Civil War battle. A college graduate with perhaps a Masters in History will have a lot more perspective on the matter. In mere fractions of a second his mind will go through Antietam, Fort Sumter, Bullrun etc... A simple computer related analogy immediately comes to mind; a fragmented harddrive.<br /><br />Unfortunately there's no Microsoft tool for defragmenting or re-indexing your brain (...yet) but it can definitely help to just step back, take a break and come back with a fresh perspective. I personally use fresh perspective to battle false assumptions and an over-abundance of information on a subject that clouds my ability to make a clear decision. Right now I'm taking a break from my Zone system for instance so I can come back when I'm ready with a clear head ready to tackle the problem again. Unfortunately it's been taking a while for this to happen...<br /><br />So last weekend I did a hardcore coding binge and fleshed out a terrain prototype for Star Trader. I hadn't made a terrain engine in a long time so I got caught up in a lot of the simple details like grid creation, normals/tangents generation, indices ordering (for triangle stips), and grid resampling (I'm currently using bicubic filtering to overcome 8-bit heightmap artifacts). Texturing terrain was also something new I didn't have much experience in, specifically procedural texturing based on terrain properties. What I ended up doing was implementing a very simple real-time per-pixel "terrain splatting" algorithm, that takes a number of texture layers (like grass, rock, snow) and blends between them based upon a pixels altitude and slope. It looks pretty good but the algorithm I'm using right now is pretty rigid and doesn't allow for much alteration so I have plans to improve it. I also added detail normal mapping which looks great when you get real close to the terrain. Here's a teaser to show what I've accomplished thus far:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img264.imageshack.us/img264/479/terrainteaser2dv1.jpg"><img style="cursor: pointer; width: 320px;" src="http://img264.imageshack.us/img264/479/terrainteaser2dv1.jpg" alt="" border="0" /></a><br /><br />Like I said, needs lot of improvement, but I think it was a worthy first attempt. For comparison, here's some offline renders I made a number of years back for the Star Trader planet surfaces before I decided to convert to realtime terrain rendering.<br /><br />The terrestrial/lush planet surface:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img266.imageshack.us/img266/5130/lushos8.png"><img style="cursor: pointer; width: 320px;" src="http://img266.imageshack.us/img266/5130/lushos8.png" alt="" border="0" /></a><br /><br />And the desert planet surface:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img266.imageshack.us/img266/4268/desertng7.png"><img style="cursor: pointer; width: 320px;" src="http://img266.imageshack.us/img266/4268/desertng7.png" alt="" border="0" /></a><br /><br />Comparatively the results aren't that different and I'm pretty sure I'll be able to achieve similar results once I get a sky and some aerial perspective in there.<br /><br />One of my main goals for the terrain renderer was to allow for very high-polygon throughput. That shot for instance is pumping out over 1 million triangles brute force at about 60 frames per second on a Radeon x800 running at 1280x1024 with 6x MSAA. To achieve this kind of performance it really helped that I used triangle strips to keep the number of vertex indices down to a minimum. Another thing I made sure to do was keep the vertex size as small as possible. Right now it's at minuscule 24 bytes used just for the vertex position and normal. Everything else, like the tangent vectors and texture coordinates are synthesized on the GPU computationally.<br /><br />I know this may sound counter to traditional thought but the main reasoning behind this is that while graphics cards have greatly improved their ability to compute complex data, bus speeds for transferring data to the GPU haven't really improved at the same rate. By maintaining a "skinny" vertex size I'm able to improve cache coherency as well as maintain instruction parallelism (since less vertex fetches are required). This is a much bigger deal on the next-gen consoles but is still very relevant in the PC world as well.<br /><br />Now that I'm relatively happy with the performance I plan on moving on to sky rendering and aerial perspective, probably using the technique described by Preetham in "A Practical Analytic Model for Daylight", which is pretty easy to implement with incredible results. After this I want to finish up the per-pixel splatting, then I'll start integrating the prototype code into the main Star Trader codebase.<br /><br />BTW, if you have any experience with <a href="http://www.planetside.co.uk/terragen/">Terragen </a>or <a href="http://www.world-machine.com/">World Machine</a> and would like to help with Star Trader, <a href="mailto:AurelioReis%20_@_%20gmail.com">drop me a line</a>. I'll be needing terrain for the variety of planet types which include Terrestrial (earth like), Ice, Water (underwater), Desolate/Barren, Desert, Mountainous, Volcanic, and Forest/Swamp.<br /><br />Cya!Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com3tag:blogger.com,1999:blog-1687363112787935188.post-13015173185164757232007-01-12T17:40:00.000-05:002007-01-12T20:16:20.131-05:00ShaderX 5 demo code/exe + Shadows!I've decided to put the source code and executable for the demo I made for the ShaderX 5 articles online and you can find it <a href="http://files.filefront.com/6519433">here</a>. A screenshot:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgec8qfX7BcIxhALRyGvlC77BQGElf7D4je5jT1IQKfbUzs7FS_LBu3HyqqI7yvQHZMbmFSI2uFwcezhRNVFmWwQqTU_bCLmQr5jm97B8eftcDajZizLc_gcQN3h37sb3gzKbX6Gyx1SskI/s1600-h/img2.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgec8qfX7BcIxhALRyGvlC77BQGElf7D4je5jT1IQKfbUzs7FS_LBu3HyqqI7yvQHZMbmFSI2uFwcezhRNVFmWwQqTU_bCLmQr5jm97B8eftcDajZizLc_gcQN3h37sb3gzKbX6Gyx1SskI/s320/img2.jpg" alt="" id="BLOGGER_PHOTO_ID_5019246964142071426" border="0" /></a><br /><br />It's probably got a few issues but otherwise should work pretty well. If you found it useful or have any comments let me know.<br /><br />So like I have so many times, I'm once again pondering the ups and downs of using Shadow Volumes (SV) or Shadow Maps (SM) in Star Trader. Cass Everitt has a lot of great insights on the subject and seems to always be going back and forth on why one is better than the other. There are many considerations to take into account (and I won't list them all here), but the majority of time the main reason to use SVs is when your scene will have lots of point lights. The reasoning for this is simple, although SVs are fairly fillrate intensive, it's no where near as bad as rendering the scene six times, as would be required if using SMs.<br /><br />Personally I think the entire debate is context sensitive. If you were going to make a game with huge sprawling outdoor environments, wanted easy soft shadows with ambient color, and wanted to take advantage of perforated (alpha-tested) surfaces, your best bet is to use SMs. If your game is able to take advantage of static light placement, has really expensive lit pixels, requires easy self-shadowing, and has a _lot_ of omnidirectional light sources, SVs are the best choice. One feature both techniques share is that hardware acceleration is a must, either for the depth testing in SMs or for the shadow extrusion in SVs.<br /><br />So the question remains, what technique have I chosen to use on Star Trader, a game that really doesn't have too extensive a shadow need? The place that will benefit the most will be the planetary terrains, which would logically lead me to SMs. Well, although I've had a lot of good experiences using Shadow Maps, even with PSMs, Trapezoidal Shadow Maps and the numerous other Shadow Map enhancements I still think the quality is not quite there (well, relative to the expense). So what I plan to do is something I had experimented with quite a bit in the past, which is a hybrid Stencil Shadow Volume/Ambient lighting technique.<br /><br />The idea behind my technique is to basically take the SV algorithm and extend it with an additional ambient pass. Ambient is one of the things that Doom 3 was lacking and I think that disappointed a lot of people. The game in general was way too dark, even for a military base on Mars. Ambient lighting raises the average brightness of the scene and not only makes it easier to see things but also hints at the indirect light bouncing thats so common to natural lighting. The technique is really simple and works as such. First the stencil buffer is filled up as normal and lit objects rendered with the standard stencil test. The stencil test is then reversed and all lit objects rendered again, but this time just once and with the ambient lighting shader.<br /><br />Now a nice thing about doing ambient this way is that the ambient light contributes only one time. This is in contrast to SMs where ambient is accumulated for each light that hits a surface and so has the potential to massively over-saturate your lighting results. Another nice thing about doing your lighting this way is that you don't need to add your ambient term into the (direct) lighting equation, which has the potential to over-saturate the scene colors. If you min clamp your lighting results to the ambient level you're guaranteed to have your scene never go darker than the base ambient level. Because the ambient level is object sensitive, you can even give different parts of your scene their own levels (in a certain game I can't talk about I actually made it so different portal area's could each have their own ambient level dependant on whether they were straddling an outdoor area or not).<br /><br />Another nice thing is that since you're now rejecting the (probably) expensive lit pixels on the unlit sides and instead using the (hopefully) inexpensive ambient shader, you're saving on precious GPU cycles. This really helps to cut down on the lighting costs in games like Doom 3 and Quake 4. Of course Carmack took this step to an extreme by completely culling unlit polygons (and yet it was still faster than rendering those expensive pixels)!<br /><br />After I finish up getting the skeleton and anims loaded for my Collada convertor I'll probably move on to this. Alright, later!<br /><br />p.s.<br />A third option I should mention is parabolic shadow maps but they have a number of major problems and only a marginal benefit. The benefit is that only two textures are required for an omnidirectional shadow (as opposed to six), and thus only two additional scene passes per shadowing light source. This is pretty nice considering you get all the benefits of shadow maps. The bad news however is that since ParaSMs require a parabolic warping of space to map properly to both hemispherical textures, your scene must be relatively highly tessellated to render correctly into the shadow textures. This is a big deal, since you're transferring your savings on fillrate to a pretty heavy bandwidth requirement. Add to this the well known seam between the two textures issue (which is even visible in a game I've worked on that used ParaSMs, see Marvel Ultimate Alliance), and you can see why it's basically not a great solution (or at least not a solution for every situation, or even a few occasional ones).Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-21393975470986621282007-01-10T18:23:00.000-05:002007-01-10T18:24:01.014-05:00ShaderX 5I received my copy of ShaderX 5 yesterday and I must say they did an incredible job. As usual Wolfgang Engel has done an amazing job of editing the whole thing; quite frankly, I don't know how he does it.<br /><br />My two contributions this year were 'Per-pixel lit, Light Scattering Smoke', and 'Post-processing effects in design'. I'm very happy with the end result and I hope people enjoy reading them as much as I enjoyed writing them. For those who read the article I should mention there was a minor issue where two figures where mixed up; On page 290, figures 5.2.2 and 5.2.3 are reversed. Where I say the light is behind the particle the figure obviously shows it in front, and vice-versa. It's a minor issue that is hopefully easy to figure out after reading the text.<br /><br />So to go along with the planetary combat stuff I talked about last time I've decided to show some screenshots from Master of Orion 2. Their combat is a lot more simplistic than what I described but the visual look and style is very similar.<br /><br />This first screenshot shows a drop ship landing on a planets surface. In MOO2 this represents a founding new colony. For STO this is more what I envision the marine drop ships looking like although I do plan to have a similar animation for planet colonization as well.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLTB3djtWjweynnk8DoTJVRoIQzk3ywQmPfXc8N2AZTP5w5_B4FnQAfRx87XLc4Xr-1qiYwygKcRWpd3bACDQRPKtOo3IC2KpnAGBl1Ts7X5gHEhRHIxQnGqtAvpP8fHaXAief-eB_r3CO/s1600-h/orion2_021.png"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLTB3djtWjweynnk8DoTJVRoIQzk3ywQmPfXc8N2AZTP5w5_B4FnQAfRx87XLc4Xr-1qiYwygKcRWpd3bACDQRPKtOo3IC2KpnAGBl1Ts7X5gHEhRHIxQnGqtAvpP8fHaXAief-eB_r3CO/s400/orion2_021.png" alt="" id="BLOGGER_PHOTO_ID_5018544689744535138" border="0" /></a><br /><br /><br />This shot shows off MOO2 planetary combat. I want to come pretty close to something like this.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirntzFohvPmE353Zsd0qPL_6n_E_Anpc8ZQUjuUpbt5JuDSKRBOXaSGLyZgseE-FgYplz7MhEgwIXSn_PogiFxEVAlOMB7St4djMQn2yHcEsIJfIeVv5RZh-eTNykSuuQCqL0j0Lr6QHzY/s1600-h/orion2_135.png"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirntzFohvPmE353Zsd0qPL_6n_E_Anpc8ZQUjuUpbt5JuDSKRBOXaSGLyZgseE-FgYplz7MhEgwIXSn_PogiFxEVAlOMB7St4djMQn2yHcEsIJfIeVv5RZh-eTNykSuuQCqL0j0Lr6QHzY/s400/orion2_135.png" alt="" id="BLOGGER_PHOTO_ID_5018545170780872306" border="0" /></a><br /><br />Not bad huh? They really took advantage of pre-rendering back then to achieve such a high quality look but I'm completely certain I can make it look better today in real-time.Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-75549689186256556052007-01-09T19:04:00.000-05:002007-01-10T18:12:58.781-05:00Star Trader Planetary Combat<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXuQMVs-Bn1X7NdzpKqbxn03ugXr8F3vrlFcJdruvsr3v_lxlCH-7fb9wFvUGYP8BLxUDgmESwqFty9TnwR-dd6NbeEQmYKdHq_PjrHB0jTpaY_JyRHltc9cTE0dnbjx25EH06qGiP6mCr/s1600-h/snap059181.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXuQMVs-Bn1X7NdzpKqbxn03ugXr8F3vrlFcJdruvsr3v_lxlCH-7fb9wFvUGYP8BLxUDgmESwqFty9TnwR-dd6NbeEQmYKdHq_PjrHB0jTpaY_JyRHltc9cTE0dnbjx25EH06qGiP6mCr/s400/snap059181.jpg" alt="" id="BLOGGER_PHOTO_ID_5018253154702168418" border="0" /></a><br /><span style="font-style: italic;">"A new life awaits you in the off-world colonies, the chance to begin again in a golden land of opportunity and adventure..."</span><br /><br /><p class="MsoNormal">In Star Trader Online, planets are the most valuable resource you can possess. Owning a planet conveys numerous benefits, but an empty planet is next to useless. For a planet to be useful, it must be populated. In order to do this, the player must pick up colonists from the greatly over-populated Earth, where billions of souls await a fresh start amongst the stars. Once a planet the player has claimed is colonized, the player may assign responsibilities to the colonists. These tasks include ore mining, farming, and fuel manufacturing. This is where the real benefit is; it's production capabilities. Colonies may even be taxed. It's because of these benefits that planets are so sought after, and in time the planet can be upgraded for even greater production through buildings. Although travelers may trade with a planet that is claimed by another person (if landing is allowed by the owner), in some situations it's more beneficial for him to take that planet as his own.<br /><br />After breaking through a planets initial defenses (like planetary shields), a planetary invasion may commence. There are two participants in a planetary invasion, fighters and marines. Before the ground combat may begin, the space marines must land on the surface. The marines start out high above the planetary city to the left of the screen in their drop ships, which slowly descend towards the surface. If there is no star fighter resistance, they drop rapidly, otherwise air combat commences. If the attacker has no fighter escort, the drop ships are sitting ducks and easily destroyed after only a few hits. If a fighter screen is present, however, the attacking and defending fighters battle until either side has no more fighters. If the attacker destroys all the defending fighters, the drop ships drop rapidly and ground combat begins. If the defender destroys all the attacking fighters, they can then begin their attack on the drop ships. If all the drop ships are destroyed, the invasion has been thwarted.<br /><br />Once all the drop ship reach the ground, their hatches drop down and marines pour forth firing upon the awaiting defending marines. The conditions that dictate a marine units effectiveness include it's rank (regular, veteran, elite), it's tech level (primitive, average, or advanced) and any of the attackers special skills (like the planetary assault skill, which is earned after a number of successful planetary assaults, or a player having the planetary assault proficiency trait). Once either side has no more marines combat is finished and the winner gains, or maintains control of the planet.<br /><br />A couple of extra details about planets and their design rationale.<br /><br />Planet growth: Planets populations can slowly grow over time but require food to do so. Some planets can produce food, some can't. Planets that can't produce food will never grow in population until there is an excess of food, which tends to set food prices to a premium. This can create quite a lucrative situation for clever traders. In some cases it may be beneficial for a player that owns such a planet to offer subsidies to other players to encourage them to supply their planet with food, ensuring it's growth and increased production.<br /><br />Planet sizes and populations: Planets come in small, medium, or large (ex: pluto, earth, jupiter/neptune). The size is used to determine the maximum population a planet may hold in the millions, which are represented as population units. One population unit equals one million people. As an example, a planet with max size of 4 population units may hold at most 4 million people. The lowest measurement of population on a planet is one thousand people, so 4 million people would actually be represented as 4,000 k (four thousand thousand). However, only whole population units can be used for production, as opposed to fractional population units. This means if the population was 3,900 k, only 3 pop units could be allocated.<br /></p><p class="MsoNormal">For a standard ship, a single cargo hold can occupy 100 k colonists (special ships like the pod/seed-ship can hold more). So for a ship with 10 holds, a size 4 planet would take 4 trips to fill at 1 pop unit per trip (4,000,000 / (100,000 * 10)).<br /><br />And that’s planetary combat (plus a few extra tidbits). Next time, the new star ship combat is explained.</p>Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0tag:blogger.com,1999:blog-1687363112787935188.post-87867208332163447322007-01-08T13:12:00.000-05:002007-01-09T23:36:31.875-05:00Models and skeletons and formats....This past weekend I unfortunately wasn't able to get much work done. Most of my time was spent on working through the Collada converter issue, and the rest working on getting the skeletal animation stuff up and running and some computer issues. The basics are now there, but I still haven't made any major decisions yet like whether I want a separate skeleton format (.arskel) or whether I want to inline them into all models and animation files (.arm and .aranim). The benefit to a separate skeleton file would be skeleton sharing (and decreased memory usage), while a unified model format (with built-in skeleton) would allow for more verbose error checking. I'm leaning towards skeleton sharing at this point since the model exporter should do most of the error checking anyways.<br /><br />I've started implementing matrix palette skinning on the CPU but I plan to eventually use the GPU for the task. Before then I need a good plan in place for the shaders that will require variable bone indices. I'll probably only support 1, 2, and 4 bone indices, but that would require up to 4 versions of each vertex shader (that's including the 0-bone version). Something else I need to consider soon is adding pre-calculated silhouette edges to the model format since I plan on doing stencil shadows at some point. Sure I could calculate them at load time but it would be just as easy to pre-calculate them and directly load them from file (and much quicker as well).<br /><br />As most people know, Microsoft OS's start to crap out and get flaky after about 6 months of heavy use. Well I've had the same install of Windows XP on my current machine for nearly 2 1/2 years now and I was well overdue for a clean sweep. It's not usually a painful process but I decided to do a very thorough wipe of my hard-drive using <a href="http://dban.sourceforge.net/">DBAN</a>. This took quite a while but honestly not as long as it took to back up all of my critical data onto disk media and my backup hard-drives. So since most of the process entails waiting I had a lot of time to think about some design aspects for <a href="http://www.startraderonline.com/">Star Trader</a>. I think I've basically worked out all the details for ship-to-ship combat as well as planetary ground combat. I've got to run but I'll describe it in my next update.<br /><br />Later!Aureliohttp://www.blogger.com/profile/07263441314958682780noreply@blogger.com0