{"id":147,"date":"2006-02-20T10:54:48","date_gmt":"2006-02-20T15:54:48","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=147"},"modified":"2011-04-10T05:44:41","modified_gmt":"2011-04-10T10:44:41","slug":"terrain-part-10","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=147","title":{"rendered":"Terrain, Part 10"},"content":{"rendered":"<div class=date>End of The Project<\/div>\n<table align=right>\n<tr>\n<td><img src='http:\/\/www.shamusyoung.com\/twentysidedtale\/images\/terrain_final.jpg'\/><\/td>\n<\/tr>\n<\/table>\n<p>I think I&#8217;ve accomplished everything I set out to do when I started this project.  I have an attractive terrain engine that runs well even on a two-year-old computer, and which leaves plenty of memory and CPU power for whatever game I might want to add.  <\/p>\n<p>From here, I may modify the engine and try to put it to use, but if I do it will be a seperate series. <\/p>\n<p>There were several items I had left for this final post, but most of them were not part of the engine itself and would make for even duller reading, if such a thing is possible.  <\/p>\n<p>Stuff I learned:<\/p>\n<ol>\n<li>An overhead engine is far, far easier to make than a first-person engine.  This was easier than I&#8217;d anticipated.  I imagine the real challenges of such an engine appear when you start putting foliage on it.<\/li>\n<li>A lot of camera movement limits I&#8217;ve encountered in games probably exist due to engine limitations, and not because the designers wanted to annoy the users.  I&#8217;m thinking back to the original <a href=\"http:\/\/www.lionhead.com\/bw2\/\">Black &#038; White<\/a> (the link goes to B&#038;W 2, the original website just redirects to the sequel. Jerks)  and the way the overhead camera was always tethered to the ground in such an annoying way.  At the time I thought it was just a poor interface, but now I see it was probably a way to keep poly count under control.  I found limiting the camera movement speed covered a multitude of shortcomings.<\/li>\n<li>Making a lot of textures on the fly is much faster than I expected. I cranked the number of distinct terrain textures to 1,024 and I was still able to turn them out fast enough to keep up.<\/li>\n<li>In the future, I need to set more specific goals for projects like this.  Without any guiding design, I felt a lot of my choices were arbitrary when confronted with various tradeoffs.  For example, I never decided ahead of time how fast the user should be able to move around the landscape, how high or low their viewing angle was allowed to be,  how far they should be allowed to see, or even what scale I was dealing with.  Many games put limits on stuff like this, and deciding those limits ahead of time (or at least having an idea of how I wanted the interface to work) would have given me more to go on.<\/li>\n<li>Agonizing over polygon counts with modern graphics hardware is often time poorly spent.  It&#8217;s better to give the CPU a break, even if it means being sloppy and letting the GPU (your graphics card) pick up the slack. <\/li>\n<li>The method I came up with in <a href=\"?p=146\">Part 6<\/a> for casting shadows is really fast, and a nice trick.  I&#8217;ll have to remember that one.<\/li>\n<li>Making an engine that can churn out good-looking rolling hills that are visible to the horizon is still a major challenge.   It&#8217;s easy to come up with a couple of &#8220;square miles&#8221; of terrain, but reaching the horizon is very hard.  Most games have fake mountains in the distance.  Far Cry fixed this by setting the game on small islands, making the horizon all water.  Flight simulators make the ground very simple up close.  I think we&#8217;re still a little ways off from true expansive terrain that can be explored on foot. <\/li>\n<li>Recording a project like this was useful.  It was time-consuming, and probably wouldn&#8217;t make sense if I was actually making a game, but for an educational project like this it gave me a good look at what worked and what didn&#8217;t.  Even better, it gave me a chance to learn from others who took the time to leave some very interesting comments.\n<\/li>\n<\/p>\n<\/ol>\n<p>UPDATE 2\/25\/2006: In response to inexplicable public demand, I have since <a href=\"?p=202\">released the source code<\/a>. So, if you have some skill in C++ you can experiment with the code yourself.<\/p>\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>End of The Project I think I&#8217;ve accomplished everything I set out to do when I started this project. I have an attractive terrain engine that runs well even on a two-year-old computer, and which leaves plenty of memory and CPU power for whatever game I might want to add. From here, I may modify [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=147"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/147\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}