{"id":16058,"date":"2012-05-31T07:45:33","date_gmt":"2012-05-31T12:45:33","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=16058"},"modified":"2012-05-31T08:03:36","modified_gmt":"2012-05-31T13:03:36","slug":"project-octant-part-14-moving-goalposts","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=16058","title":{"rendered":"Project Octant Part 14: Moving Goalposts"},"content":{"rendered":"<p><table   class=\"\" cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/octant14_4.jpg' class='insetimage'   alt='octant14_4.jpg' title='octant14_4.jpg'\/><\/td><\/tr><\/table><\/p>\n<p>We&#8217;re a few weeks into the project now and a lot has been done.  Now is a good time to assess our progress and see how things are going. After all, it does seem like I&#8217;ve satisfied my initial goals, which I talked about at the <a href=\"?p=15742\">very beginning<\/a>:<\/p>\n<p><!--more--><\/p>\n<ol>\n<li><strong>The Qt Development Environment.<\/strong>  Qt was very interesting, very easy to pick up, but not terribly useful in a situation where I really care about performance. The Qt experiment was an educational endeavor, and time-well spent, but it&#8217;s not right for a project like this one.\n<\/li>\n<li><strong>Octrees.<\/strong> I learned about octrees.  It didn&#8217;t really pay for itself, performance-wise, but it was a fun little system.\n<\/li>\n<li><strong>Perlin Noise.<\/strong> So what I had in mind was actually called &#8220;value noise&#8221;, not &#8220;Perlin noise&#8221;.  I may have used the wrong name, and it took quite a bit of fussing to get it working, but it was a really interesting exercise.\n<\/li>\n<\/ol>\n<p>So now what?<\/p>\n<p>A reader asks in email:<\/p>\n<blockquote><p>The idea behind project Octant was to experiment with Octree and Qt, both of which you dropped. The idea right now seems to be to experiment with noise. You are also not making a Minecraft clone, so there will be no mining.<\/p>\n<p>My question is: what can Project Octree do that Project Frontier could not do better? If there will be no mining, what is the idea behind using cubes? And would the world not look better off using Frontier-type system (I can probably answer this one; this would be boring.) Moving further with this question: are you planning to use erosion generator for Octree? If not, what are you planning to use?<\/p><\/blockquote>\n<p>That&#8217;s a lot of questions. Let&#8217;s break it down:<\/p>\n<p><strong>You are also not making a Minecraft clone, so there will be no mining.<\/strong><\/p>\n<p>Eh. I dunno about that. <\/p>\n<p>See, I&#8217;ve always been driven by exploration in games. I like seeing new stuff. This explains both my passion for, and enjoyment of, procedural worlds. So I tend to gravitate towards things that satisfy that desire.  Asking &#8220;will this game have mining?&#8221; is like asking &#8220;will this car be used to commute or get groceries?&#8221; to someone working on the assembly line at the automobile factory. <\/p>\n<p>I have a design document here.  In fact, I have several. I have a friend (hi Mike!) and we love talking about game designs, gameplay mechanics, gameplay elements, feedback, motivation, etc etc etc.  We bounce ideas back and forth and talk about things we&#8217;d love to see. This results in a lot of scattered Google docs, which are fast becoming my drawer full of scrawled notes. <\/p>\n<p>The thing is, I don&#8217;t want to grab a specific design and say, &#8220;This! THIS is what I&#8217;m doing!&#8221;  Making a game takes a long, long time.  Rather than set some far-off goalpost of making a commercial game, I&#8217;d rather just focus on technology. To put it another way: If I was focused on a specific design document, then I wouldn&#8217;t have messed with marching cubes because marching cubes isn&#8217;t in the design doc. And I would have missed out on all of this cool stuff. <\/p>\n<p>If the technology stuff pans out, then I can re-assess.  If I&#8217;m still having fun, maybe I&#8217;ll add some gameplay.  If not, maybe I&#8217;ll do something else. This project isn&#8217;t a game.  It&#8217;s a skunkworks.<\/p>\n<p>The point is: If this were a game, it might have &#8220;mining&#8221;. Mining is not precluded by anything I&#8217;m doing here. <\/p>\n<p>(For one thing, a world made with value noise is unpredictable.  Without the ability for the player to remove blocks, it&#8217;s possible that the game could generate stuff the player couldn&#8217;t reach. Even if we wanted to make a Skyrim kinda game, you&#8217;d probably need to allow digging because otherwise a quest item might become unreachable due to an unlucky land formation. And detecting and correcting these cases would be insanely hard. Much harder than just giving the player a way to dig and letting them solve the problem themselves.)<\/p>\n<p><strong>What can Project Octree do that Project Frontier could not do better? <\/strong><\/p>\n<p>It&#8217;s certainly yielding more interesting scenery. Frontier was always going to be limited by its heightmap-based world. That&#8217;s not a bad thing, mind you.  World of Warcraft is mostly just a bunch of doodads on a really big heightmap, and that place still looks great.  But now I want to build something else.<\/p>\n<p><strong>Moving further with this question: are you planning to use erosion generator for Octree? If not, what are you planning to use?<\/strong><\/p>\n<p>No real need.  Value noise seems to be giving me all of the cool scenery I could ask for.<\/p>\n<p>Which brings me to my next set of goals.  <\/p>\n<h3>1. An Interface<\/h3>\n<p>I really need a way that I can get detailed, real-time feedback from my program.  So far I&#8217;ve been using the program title bar for this purpose.<\/p>\n<p><table   class=\"\" cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/octant14_1.jpg' class='insetimage'   alt='octant14_1.jpg' title='octant14_1.jpg'\/><\/td><\/tr><\/table><\/p>\n<p>That&#8217;s&#8230; less than ideal. What I really want is something like this:<\/p>\n<p><table   class=\"\" cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/octant14_2.jpg' class='insetimage'   alt='octant14_2.jpg' title='octant14_2.jpg'\/><\/td><\/tr><\/table><\/p>\n<p>Having live feedback like this is really important for smooth development.  If I&#8217;m fumbling around on the landscape and suddenly the framerate takes a momentary dive, it would be really nice if I could just look up and see what sub-system just went nuts.  <\/p>\n<p>You can&#8217;t fit all that crap in the title bar. If you print it to the console every frame it will scroll by so fast you can&#8217;t read it.  If you dump it to a log file you&#8217;ll have to sift through megabytes of text to find the trouble spot. (That&#8217;s how we did things for a long time at Activeworlds. Man, I <em>hated<\/em> that. When you see something questionable happen you have to make a split-second decision: <em>Do I stop and visually inspect this problem now while the log file continues to grow, or do I slam Alt-F4 as fast as I can so this moment will be someplace near the end where I&#8217;ll have a chance at finding it?<\/em>) <\/p>\n<p>You want this information on screen for the same reason that players want their health bar and ammo count on-screen: You need to see when those numbers change.  If some system goes nuts and starts eating five times as much CPU, but only when I&#8217;m looking across the world border, then I need to know about it.  But if this system only eats 5ms to begin with, then I&#8217;ll have no way to know about it.  That&#8217;s too small of a change for me to feel.<\/p>\n<p>If I&#8217;m running around and I find a bit of scenery that doesn&#8217;t make sense, it&#8217;s nice to be able to see what it&#8217;s supposed to be. &#8220;Ah! This region is marked as mountains. So this mess must be the result of a problem with the mountain-making code.&#8221; <\/p>\n<p>Case in point: Minecraft is a rare game where the developer left his debug screen available to end users:<\/p>\n<p><table   class=\"\" cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/minecraft_debug.jpg' class='insetimage'   alt='minecraft_debug.jpg' title='minecraft_debug.jpg'\/><\/td><\/tr><\/table><\/p>\n<p>This sort of thing is immensely useful.  Now, I don&#8217;t need bar graphs and pie charts, but I do need some text. And that means using a third-party GUI, or writing my own.<\/p>\n<p>I&#8217;ve been working with Michael Goodfellow on this. <a href=\"http:\/\/www.sea-of-memes.com\/LetsCode55\/LetsCode55.html\">Do read his post on his framework<\/a> if you&#8217;re interested in this part.   <\/p>\n<p>With regards to his &#8220;framework&#8221; problem, I&#8217;m actually going through the same thing.  Over time, you build a lot of tools. These tools are code snippets, classes, structures, modules, or entire working systems.  You add those tools to your tool-belt.  Pretty soon you&#8217;re like the gosh-darned Batman, with a toolbelt that has every single conceivable gadget in the world.  Then someone asks to borrow your screwdriver and you have to explain why it&#8217;s on a keyring with 350 pounds of unrelated gear. <\/p>\n<p>I&#8217;ve talked about this problem before.  I don&#8217;t know enough different languages to be able to say if this is a problem with the language itself, or with programming in general. But the short version is this: Things in a program tend to inter-connect. You want your code to be portable. You want it to be useful to other people. But then you try to offer it to someone else and you end up with, &#8220;Oh? You need to do some 4&#215;4 matrix math? No sweat.  I&#8217;ve got some code to do that right here. Er. It&#8217;s built on top of my system for using XYZ values. Which has a bunch of code for converting to\/from 2D values, so you&#8217;ll need that code to get it to compile, even though you don&#8217;t need the 2D stuff.  Oops.  Looks like it&#8217;s also connected to my code for using <a href=\"http:\/\/en.wikipedia.org\/wiki\/Euler_angles\">Euler Angles<\/a>.  That&#8217;s kind of big. Sorry. Also <a href=\"http:\/\/en.wikipedia.org\/wiki\/Quaternion\">Quaternions<\/a>. Wow. I forgot those were even in there. And all of that stuff depends on this math module I wrote that calculates angles and such.&#8221; <\/p>\n<p>So in this example I have one module (source file) that solves your problem, and five others that you don&#8217;t need, don&#8217;t care about, and don&#8217;t help you, but are simply required because of a tiny bit of inter-dependence. <\/p>\n<p>So Goodfellow has a GUI system and I&#8217;m going to try to integrate it into my project.<\/p>\n<h3>2. Cool scenery<\/h3>\n<p>I want to combine these marching cubes with the value noise and see what kinds of cool places I can make. I&#8217;ve already made quite a bit, which I&#8217;ll be showing off in future entries. I have a lot more ideas along these lines.  Basically, this stuff consists of:<\/p>\n<p>&#8220;What if I took some 2D noise, combined it with 3D noise like so, and used it to make formations of this material?&#8221;<\/p>\n<p>This is my favorite part of this whole thing so far. <\/p>\n<h3>3. Lighting, texturing, and different block types<\/h3>\n<p>I have cube-based blocks in addition to the blobs I&#8217;ve been using.<\/p>\n<p><table   class=\"\" cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/octant14_3.jpg' class='insetimage'   alt='octant14_3.jpg' title='octant14_3.jpg'\/><\/td><\/tr><\/table><\/p>\n<p>It seemed simple to re-introduce cubes, but there&#8217;s actually a lot of questions as to how lighting ought to work when we combine the two systems.  My goal is to have both block types work together in a single rendering pass, sharing a common atlas texture and shader. We&#8217;ll see if that works out.<\/p>\n<p>Also, I should probably re-name the project.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re a few weeks into the project now and a lot has been done. Now is a good time to assess our progress and see how things are going. After all, it does seem like I&#8217;ve satisfied my initial goals, which I talked about at the very beginning:<\/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":[233],"class_list":["post-16058","post","type-post","status-publish","format-standard","hentry","category-programming","tag-octant"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/16058","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=16058"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/16058\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}