Project Octant Part 14: Moving Goalposts

By Shamus
on May 31, 2012
Filed under:
Programming

octant14_4.jpg

We’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’ve satisfied my initial goals, which I talked about at the very beginning:

  1. The Qt Development Environment. 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’s not right for a project like this one.
  2. Octrees. I learned about octrees. It didn’t really pay for itself, performance-wise, but it was a fun little system.
  3. Perlin Noise. So what I had in mind was actually called “value noise”, not “Perlin noise”. 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.

So now what?

A reader asks in email:

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.

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?

That’s a lot of questions. Let’s break it down:

You are also not making a Minecraft clone, so there will be no mining.

Eh. I dunno about that.

See, I’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 “will this game have mining?” is like asking “will this car be used to commute or get groceries?” to someone working on the assembly line at the automobile factory.

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’d love to see. This results in a lot of scattered Google docs, which are fast becoming my drawer full of scrawled notes.

The thing is, I don’t want to grab a specific design and say, “This! THIS is what I’m doing!” Making a game takes a long, long time. Rather than set some far-off goalpost of making a commercial game, I’d rather just focus on technology. To put it another way: If I was focused on a specific design document, then I wouldn’t have messed with marching cubes because marching cubes isn’t in the design doc. And I would have missed out on all of this cool stuff.

If the technology stuff pans out, then I can re-assess. If I’m still having fun, maybe I’ll add some gameplay. If not, maybe I’ll do something else. This project isn’t a game. It’s a skunkworks.

The point is: If this were a game, it might have “mining”. Mining is not precluded by anything I’m doing here.

(For one thing, a world made with value noise is unpredictable. Without the ability for the player to remove blocks, it’s possible that the game could generate stuff the player couldn’t reach. Even if we wanted to make a Skyrim kinda game, you’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.)

What can Project Octree do that Project Frontier could not do better?

It’s certainly yielding more interesting scenery. Frontier was always going to be limited by its heightmap-based world. That’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.

Moving further with this question: are you planning to use erosion generator for Octree? If not, what are you planning to use?

No real need. Value noise seems to be giving me all of the cool scenery I could ask for.

Which brings me to my next set of goals.

1. An Interface

I really need a way that I can get detailed, real-time feedback from my program. So far I’ve been using the program title bar for this purpose.

octant14_1.jpg

That’s… less than ideal. What I really want is something like this:

octant14_2.jpg

Having live feedback like this is really important for smooth development. If I’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.

You can’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’t read it. If you dump it to a log file you’ll have to sift through megabytes of text to find the trouble spot. (That’s how we did things for a long time at Activeworlds. Man, I hated that. When you see something questionable happen you have to make a split-second decision: 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’ll have a chance at finding it?)

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’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’ll have no way to know about it. That’s too small of a change for me to feel.

If I’m running around and I find a bit of scenery that doesn’t make sense, it’s nice to be able to see what it’s supposed to be. “Ah! This region is marked as mountains. So this mess must be the result of a problem with the mountain-making code.”

Case in point: Minecraft is a rare game where the developer left his debug screen available to end users:

minecraft_debug.jpg

This sort of thing is immensely useful. Now, I don’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.

I’ve been working with Michael Goodfellow on this. Do read his post on his framework if you’re interested in this part.

With regards to his “framework” problem, I’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’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’s on a keyring with 350 pounds of unrelated gear.

I’ve talked about this problem before. I don’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, “Oh? You need to do some 4×4 matrix math? No sweat. I’ve got some code to do that right here. Er. It’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’ll need that code to get it to compile, even though you don’t need the 2D stuff. Oops. Looks like it’s also connected to my code for using Euler Angles. That’s kind of big. Sorry. Also Quaternions. 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.”

So in this example I have one module (source file) that solves your problem, and five others that you don’t need, don’t care about, and don’t help you, but are simply required because of a tiny bit of inter-dependence.

So Goodfellow has a GUI system and I’m going to try to integrate it into my project.

2. Cool scenery

I want to combine these marching cubes with the value noise and see what kinds of cool places I can make. I’ve already made quite a bit, which I’ll be showing off in future entries. I have a lot more ideas along these lines. Basically, this stuff consists of:

“What if I took some 2D noise, combined it with 3D noise like so, and used it to make formations of this material?”

This is my favorite part of this whole thing so far.

3. Lighting, texturing, and different block types

I have cube-based blocks in addition to the blobs I’ve been using.

octant14_3.jpg

It seemed simple to re-introduce cubes, but there’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’ll see if that works out.

Also, I should probably re-name the project.

Enjoyed this post? Please share!



A Hundred!3103 comments. Quick! Add another to see if this message changes!

From the Archives:

  1. TSi says:

    MCeperoG sugested another way to use Octrees back in part 12. I don’t know how much work it would require but it seemed a good idea. (His blog is amazing by the way). It might allow you to keep using this name. : )

    Combining blobs and cubes is a good idea. At least it allows to diferentiate natural formations from man made. Neat.

  2. Stephen says:

    Project Marching? Project Noise? Project Clay?

  3. Nawyria says:

    Is it just because I only have a select few images to go by, or does the terrain only have two different states? It seems to be either “more or less flat terrain riddled with gorges and the occasional bump” or “sheer cliff face”. Is this intentional, or an artefact of the noise you’re using?

    That’s kind of big. Sorry. Also Quaternions. Wow. I forgot those were even in there.

    You had me laughing there XD.

  4. ENC says:

    Space: The Final Frontier?

    Project How did this one break?

  5. StranaMente says:

    I think you may already have seen this prototype (StarForge article on RPS), if not, the game seems interesting and to my unexperienced eye it seems to have some things in common with your project.

    • Darkness says:

      That was a fun set of links.

      The game doesn’t fly for me. It is a Windows only Unity game. No Mac, no linux. As game that is Unity based most of what they are doing is built on someone else’s graphics engine. A lot of really sweet game play has been generated on Unity, even on iOS. I don’t know about Android but it wouldn’t surprise me. Shamus is really big on his own graphics solutions and for a great reason, running on older equipment. I am not that good a graphics programmer so I enjoy him and MGs work.

      If you are going to link things like this try stating it is a Unity based Windows only game. That puts the system into the context of what is worth looking at. I know, I am selfish but it is what I try to do when linking in the other direction.

      Thanks for the link though. It wasn’t your fault they hide the information and I finally found it by downloading their file and extracting the zip. Bingo! Unity, dlls and an exe file.

  6. Mr Compassionate says:

    Focusing on a flexible or interesting engine before deciding what game you want is good, Dragon’s Dogma feels to me like such a game where they decided they wanted a fun fantasy game and set about making a flexible engine to support any silly ideas they come up with.

    For example if you allow the player to pick up large objects you then decide it would be cool if they could pick up people, then enemies, then the player can hold enemies in place for their allies to attack, throw them off cliffs or throw enemies at other enemies. You can even pick up allies and throw them about for fun, or pick up a barrel and smash it over a foes head. The reason I find this your most interesting project is because it looks like it could make for a fantastic adventure, like Minecraft nearly almost was but failed to be once you learn exploring is fruitless. More hills and identical caves you say? Woo hoo.

  7. burningdragoon says:

    The problem with the project name isn’t that it’s now wrong, it’s that it’s not wrong enough. I suggest Project oQTant.

    • Pickly says:

      In a similar vein:

      Project soundmix
      Project smellovision
      Project text interface 2.0

      (Assuming the shamus still stays graphics focused, of course, and doesn’t actually drift into any of these things. :) )

  8. Man, I really want to see this running with trees. :) Any plans for trees? Treeeeees!

  9. Knut says:

    So my two favorite coding bloggers are working together? Great :D

    Also, if I may humbly suggest, some sort of cave/underworld exploration thing might be fun. Less mining, more exploration? Somewhat Underdarkish, but maybe a tad less evil? Some trading, some combat, some mining, a lot of exploration? At least I think the underground caves you have made looks great and could be used for something like that.

  10. MadTinkerer says:

    Project Goalpost? Skunkwerk? Nodelands? Surface Abnormal? Blobscape? Quaternium? Mocheted? Feelps? Voxelrizon?

  11. Paul Spooner says:

    Very fun. Enjoying seeing where this is going.
    I think my favorite thing is programming procedural “doodads” that get plopped down in the world. Like the trees you did for PF. It’s an artifact that is recognizable, but not repetitive. That kind of code always feels more powerful (to me) than the framework stuff. Of course, both are needed.

  12. Sagretti says:

    Project Cannibalism?
    Project Coffee? I love Coffee!

  13. Chuck Henebry says:

    I like “Operation Skunkworks” (or, as per MadTinkerer, “Skunkwerks,” since everyone knows the germans make better engineers. Heh.)

  14. Rick C says:

    You mentioned a few parts ago wanting real-time debug information, and I’ll reiterate my suggestion: put up a *separate* window and debug to that. You could even have that window be a separate process and then use IPC of some sort (sockets, named pipes, DDE if you wanted to throw out cross-platform compatibility and alse were crazy) to feed it your debug information.

  15. Will Cash says:

    I think the blob landscape with the cube blocks looks off. I prefer the wonky brick walls from part 12.

    • Volfram says:

      I disagree with you in pretty much every possible way. I like the idea of having the option of building using Marching cubes, but the the sharp edges provide a nice contrast to the smoothed terrain in my opinion.

      Little does Shamus know I was actually planning on doing something almost EXACTLY like this and he’s actually taking care of a large amount of research that I don’t have the technical knowhow to do just yet.

  16. jwwzeke says:

    Please don’t change the name… it’s nice.

    Solution: The player’s avatar is an 8-legged manned robotic ant construct created by a team of scientists/explorers and sent to this remote world… i.e. Project OctAnt

    Oh and for some fun make the ant construct huge so moving across the landscape is very quick… and then VERY EARLY in the “game” the robot suit breaks down and a small “person” has to get out and explore on foot. You’ve got the person looking like an ant once out of the suit… looking up at an ant the looks like it comes straight out of an old school scifi film. And you’ve got a completely META statement about how Project Octant broke down early in development and became something else entirely. :)

    (Also I know ants don’t have 8 legs… work with me people.)

  17. decius says:

    Clearly, the sequel project to Project Octant is Project Nonant, followed by project Decant.

  18. PhoenixUltima says:

    You know, if you’re more interested in making technology than games, what you could do is stop once the engine is working properly and just license that out to other people/studios. I’m willing to bet there’s a few people who’d be willing to buy a procedural content engine like this so they could slap an RPG/FPS/4X game on top.

  19. Even says:

    Project Exodus? Project Discovery?

    The scenery reminds me somewhat of Yogventures. It’s promising to be an adventure/exploring game that the Yogscast apparently hired a team to make. Had it Kickstarter funded and everything. Judging from the videos it would seem to share a lot of similarities with this.

  20. HiEv says:

    I had some time to kill waiting for the bus, so I came up with a concept for the game, if you’re interested.

    You and your opponents are given four drones and four shield generators, and the first player to destroy all of the other player’s drones wins the “pocket world” that you’ve generated. Basically, you use the drones to survey areas, collect resources, build things (forts, weapons, traps, etc.), and attack the opponent’s drones. The four shield generators allow you to cordon off a triangular (if using three) or trapezoidal (if using all four) area until their batteries die, allowing you time to build up “tech levels” without fear of attack.

    You can give the drones various tasks, such as mining resources, transporting resources to a specific location, building things from those resources, scouting out resources or enemies, attacking enemy units, hiding from enemies, etc., and they will perform them autonomously until complete or until some trigger is met and then they will alert you for more tasks, if necessary (tasks can be queued).

    So, for example, you could set one to mine out ores, one to smelt them down into metal, one to transport the metal to some location, and another one to assemble those parts into a catapult. Or you could have one mining stone, one transporting the stone and building a tower with it, another scouting the area for materials, and one spying on the enemy and stealing their materials. There are endless combinations.

    The building stuff would be fairly “minecrafty”, where, for example, you could have roller skates + cat + rocket = rocket powered cat missile if you have made/found those resources. You could work towards armoring and arming your drones to attack, making mobile weapons (tanks, etc.), arming your fortress to protect a drone, and/or building long-distance weapons to bomb across the map. This allows for all sorts of gameplay tactics.

    The shield emitters are basically there just to keep people from zerging at the beginning, allowing people time to build up to the interesting tech, I wouldn’t allow a way for people to recharge them or make new ones unless you add a fairly easy way to breach them once you’ve built certain things.

    Anyways, the idea is public domain. Anyone is free to implement it or some modification of it if they think it’s worth doing.

  21. uberfail says:

    If Octrees are so ineffecient is that one of the reasons Minecraft has/had a reputation for being incredibly poorly optimised.

  22. Alex says:

    How about “Project tcejorP”?

  23. Oleyo says:

    I was name-dropped! Bask in the internet-fame!

  24. Oleyo says:

    Also, your title-bar info made me shudder a little: you know why.

  25. Taellosse says:

    I just saw this, and thought of you: http://kotaku.com/5914760/ive-been-playing-the-bastard-son-of-minecraft-and-halo

    Obviously a long way from being a proper game, just yet, but I read “Minecraft” and “procedurally generated world” and “deformable environment” and thought maybe it would be something you’d like to know about, if you didn’t already.

  26. harborpirate says:

    You can use this to generate a new name:
    http://videogamena.me/

    Geriatric Death in My Pocket
    Alcoholic Kangaroo Oppression
    War of the Donkey in Space
    Brain Damaged Spelunking in 3D
    Dr. Flatulence Warrior

  27. void says:

    I’ve talked about this problem before. I don’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.

    This is a common problem in programming in general, and a difficult one for some people to work past. The solution, inasmuch as there is one, is a particular form of discipline when it comes to how you organize your approach to data structures and more importantly how data flows through your code.

    The key concept is information hiding. It’s a concept already present in most object-oriented languages, and it’s met with varying degrees of success. In part because of how a language is structured and with what features it offers the programmer for managing data flow, and in part due to the common idioms developed as the shared experience of programmers in a given community.

    One of the better takes on this concept I’ve encountered is in a rather old book on a programming language you’re unlikely to want to use. Thinking Forth, to be specific.

    The book is focused on forth as an implementation medium, but the majority of the book isn’t about writing forth code, it’s about problem solving. How to break your problem down, how to address the subsets, and how to organize the way your solutions connect to each other.

    The website has “preprint” of an updated version, but even that is rather short on code that has any relevance to today (outside of a select number of arcane deployment areas). Still, I don’t think that detracts from some of its most important messages, since at least half of the book is in fact focused on the problem solving process and how to engineer a solid response to whatever you’re facing.

    (It’s probable that the particular nature of how you move data about in forth contributes to this particular mode of thought; you HAVE to treat data differently in a mostly-pure stack-based language than you do in languages like the C family, but that doesn’t mean you can’t apply similar techniques elsewhere.)

    • Paul Spooner says:

      And really, this problem crops up not only in programming, but all over the applied sciences. Engineering (of any kind) requires a certain amount of interconnectedness. The general flaw in computer program engineering is one that was encountered (and eventually solved) a hundred years ago in mechanical engineering. It used to be that every machine, every steam engine, every gear was hand-built and custom designed. Oh sure, there were a few standards, but for the most part the standards weren’t helpful enough to ensure uniformity. The materials were inconsistent, and machines required constant maintenance by experts. To fix this required not only design standards, but uniform and consistent metalurgy, tooling, automation, and interchangable parts. It’s not just a design problem, but an issue with the underlying infrastructure.

      The same is true of computer programs. Reusable code will arise, but not before we have some set (not one, but several) of useful hardware interfaces, automated configuration, firmware flexibility, programming languages, and so on. We’re getting there, but software engineering is still young, and there are a lot of guys still cutting gears by hand. Maybe in another twenty years we’ll have some truly robust reusable code, but until then it’s going to be a bit rough.

      Of course, the up-side is that these days you can still write your own GUI and enjoy it as being “useful”. If I were to start filing my own gears, or designing a pipe flange, or any number of other low-level tasks I would be wasting my time. Nearly all the low level issues have been solved in Mechanical Engineering, and all we do now is high level interfaces, structure, and sizing. So savor the un-usable craftsmanship of hand-made code. It won’t last.

      • Sumanai says:

        Unfortunately electronics manufacturers seem to need to relearn that every ten years or so. Every cellphone manufacturer had their own charging connectors until EU decided to make microUSB the standard. I don’t know if anyone other than Apple has their own connector any more.

        Considering that years ago in the audio field companies participated, of their own volition, in a connector standardisation movement in order to improve their sales, that makes cellphone manufacturers sound extremely dumb and obstinate.

        • WJS says:

          The situation isn’t at all analogous. With audio gear, you will frequently be connecting two pieces together, and none of the manufacturers were individually big enough to use incompatibility for lock-in (if you aren’t big enough, lock-in is basically just lock-out). In that environment, it was in their interests that their equipment interop. A phone charger, on the other hand, isn’t supposed to interface with anything except the phone it comes with (And the wall socket, which strangely none of them tried to make their own connector for :D)

      • Mephane says:

        I also see this situation as mostly rooted in the fact that programming in and of itself is still not a mature discipline of engineering, but in its earliest stages of everyone-does-it-their-own-way. It is actually kind of sad that standardization similarly to that in mechanical engineering has not taken place yet, considering that all these problems could have been foreseen (and like indeed were by some people), but usually many companies got in the way by reinventing the wheel in a way that often locked customers and/or developers into their specific platform, environment etc.

        And even that which is standardized is sometimes still tinkered with in very awkward ways; for example, every web browser has its own variant of how to interpret certain CSS styles, even though the standard clearly states how it should look like. Or the way HTML video was started, with basically a war among companies where many supported video codecs they benefited from (or which they themselves had invented) instead of mutual cooperation towards a common standard. Or how some standards do not define the best technological approach for a problem, but a business compromise between contending parties during the standardization process. Or think about String Encoding Hell. Or how C++ still does not have a standardized application binary interface*…

        *For the non-programmers: the application binary interface, ABI, defines how objects and functions look like to the computer itself, e.i. their representation in 1s and 0s, and in the case of C++ this representation can vary greatly between different compilers, so that pieces of software built with one toolset may be unable to link with stuff built with a different one. Note that this does only apply to C++ (and, most importantly, to classes and objects), not to C and extern "C"-functions exported from C++ projects.

  28. Andrew_C says:

    Project Interrobang‽

    I like the word interrobang, and it sounds vaguely important, yet in no way related to the actual goal of the project, like all good project names.

  29. Michael McHenry says:

    Shamus is a very busy man. I don’t wish to bug him, but I am very curious where he went with this project after this.

    I won’t blame him if, after spending several days futzing with fonts and UI elements, he completely gave up and decided to work on something enjoyable.

    I’ve been liking webGl for just focusing on the fun parts of programming, but good luck getting an octree to perform well in javascript.

  30. Zak McKracken says:

    Two things:

    First: Look what other people are doing! Sound cool to me!
    http://boingboing.net/2012/07/04/procedurally-generated-british.html

    Second:
    I saw a video of a few blokes who recreated the whole middle earth, hobbiton and Mirkwood and Moria and all, in minecraft! Mind-blowing! They did this so they could play RPG games in it. That is: mostly pen-and-paper games, but you don’t need paper maps and stuff if you have a digital minitiature on a difital map. Which gave me this idea: Why not have a world generator like yours which “just” creates a base map for people to have RPGs on?
    Do you know how Neverwinter nights had an RPG mode, where the DM could move stuff around, take over the part of NPCs, type their dialougue etc.? I though that was an incredibly cool thing. Why not have something similar out of project octant?
    It’d create a map and let the DM re-shape it to some extent, then lets the DM place stuff on it and there you go?

  31. Orophor says:

    An interesting Gamasutra post on Procedurally Generated Content that may be of use for this project.

  32. TMTVL says:

    Say Shamus, if you’re no longer working on this project…

    Wanna put the source out there? I’d rather like to see how the thing does what it does.

    • Violetta says:

      This. I’ll understand if he wants to keep the code for personal use later, but I’ve been searching the website for a link to it just in case. I want to be like Shamus-sensei…

  33. Felipe says:

    Hey, you are doing an amazing work here; please don’t stop it!!. Thank you for share with the world your insights about programming and how to solve troubles in it. I came here after watching the Pixel City video, very nice!

  34. Corran says:

    I just came across this little gem and thought I should share.

    It’s a procedurally generated world built in WebGL and Javascript. It runs straight in the browser and looks damn impressive.

    Link: http://www.zephyrosanemos.com/

  35. default_ex says:

    I started working with Qt Creator in Linux and found performance to be leaps and bounds better if you create a CMake project and use the GNU C++ Compiler with the version 11 flag. On Windows you’ll need to install cygwin to have a compliant version of the C++11 compiler, MinGW is still missing a few of the new features that come in handy to keep code neat and clean.

    The performance is comparable to MSVC++09 compiler, better for threading with libpthread.

Leave a Reply

Comments are moderated and may not be posted immediately. Required fields are marked *

*
*

Thanks for joining the discussion. Be nice, don't post angry, and enjoy yourself. This is supposed to be fun.

You can enclose spoilers in <strike> tags like so:
<strike>Darth Vader is Luke's father!</strike>

You can make things italics like this:
Can you imagine having Darth Vader as your <i>father</i>?

You can make things bold like this:
I'm <b>very</b> glad Darth Vader isn't my father.

You can make links like this:
I'm reading about <a href="http://en.wikipedia.org/wiki/Darth_Vader">Darth Vader</a> on Wikipedia!

You can quote someone like this:
Darth Vader said <blockquote>Luke, I am your father.</blockquote>