Project Frontier: Source

By Shamus
on May 3, 2012
Filed under:


The source for Project Frontier is now available on BitBucket. I’m really hoping you find it to be useful. I’m very sorry to see I left the codebase in such shabby shape.

The program defaults to re-loading the last save you played. If you’re running it for the first time, then it doesn’t do anything. Bring down the console with ~ and type:

game new 1

You can replace the 1 with any number you like. That’s the seed number used to create the world. Different numbers will lead to different worlds. (The screenshot above is from right near the spawn point in world #1.)

Looks like it also defaults to wireframe on, textures off, shaders off. That’s dumb. Sorry. In the console:


That should put you in a good place. Also use:


If you’re a mouse-inverter. Use




To turn flying on and off. The WASD keys move you around. Right-click enters and exits mouselook.

Missing textures are represented with a checkerboard pattern.

Please let me know if you have any other problems.

Enjoyed this post? Please share!

A Hundred!203There are 123 comments here. I really hope you like reading.

From the Archives:

  1. rmt says:

    So why try to put the thing on GitHub if you used a Mercurial repository all along?
    Also, thanks! I’ve been looking forward to this =)

  2. atma says:


    I think it is a very good thing; i won’t have time to delve in the code but i think it will definitely benefit the community (i’m thinking in particular about your river code, which i find very interesting)

    Don’t hesitate to keep us posted about what spawns from your code.

  3. Otakun says:

    Thank you, Shamus!

    I’ve usually done most of my (scientific) program on a unix account, but am now starting to re-teach myself C/C++ at home on my Windows box. Anyone have any suggestions on a free IDE to use? If I can get Frontier to compile that will be a major achieve for me :P

    • rmt says:

      There is a free version of Visual Studio available here. Alternatives are CodeBlocks or the QtCreator, which are both also cross-platform.

      • psivamp says:

        I would love to recommend QtCreator (cross-platform development without splitting your codebase), but it just stopped compiling my project by trying to link to things that don’t exist that I didn’t intentionally ask it to. My OpenGL demo code doesn’t depend on an installation of some SQL library that I’ve never heard of or had installed. Grr…

        Edit: Managed to get rid of it by manually removing it from my Makefiles. It would be nice to have found some documentation on how to change that inside QtCreator, but I can compile again…

    • Simperin' Fool says:

      I’ve used Dev C++ and found it to be quite nice.

      • Don’t use Dev-C++. The compiler it ships with is a beyond ancient version of MinGW that can’t handle modern C++ or libraries. You can install a newer version of MinGW for it, but it’s not worth the trouble.
        Using Dev-C++, you’ll run into lots of code that doesn’t compile, but when you ask for help everyone will say there is no problem on their end…it’s simply Dev-C++ being unable to handle C++.

        Instead, use the freely available VC++ Express or Qt Creator or anything else that integrates properly with the debugger and autocomplete (which so far only VC++ and Qt Creator do on Windows).

  4. Dev Null says:

    We need a post – this one would do fine, really – for people to post their favorite world seeds.

    Haven’t played with it yet myself (yeah well; I really should do _some_ work today) so I don’t have any favorites… yet.

  5. nmichaels says:

    If nobody does it before this weekend, I might hack up some makefiles to get this thing building on Linux. Of course, I’d probably have to remember all the C++ I’ve forgotten and then learn the rest. Maybe not though!

    • Deadfast says:

      I’m afraid porting this will require much more effort than just a makefile. Assuming all the libraries used have a matching Linux alternative there are still the WinAPI calls I spotted during my quick look.

      • nmichaels says:

        I haven’t scanned the source yet, so maybe you’re right, but it’ll get done one way or another.

        • Deadfast says:

          It would hardly surprise me. I looked at the libraries used and all of them are indeed available for Linux. So in the end it really is just about stripping out windows.h.

      • ferryman says:

        I don’t think there are that many ties to windows. SDL takes care of opengl and input, and along with cg, it’s cross platform. The biggest worry, though, is the .ini settings parsing system. Maybe we could get Shamus to switch to xml and use, say, tinyXML.

        In the mean time, I’m sure WINE will run a visual studio or mingw binary.

    • Bryan says:

      IIRC it took me about a week and some change (hacking on it nights and weekends, when not working) to port over pixel city. This should be mostly similar in terms of the windows api calls, except probably many many fewer of them. (And no four days’ worth of trying to figure out freetype or fontconfig or whatever it was, to get the bitmaps for the fonts used on buildings. Probably.)

      Not sure if I’ll get time in the next day or two to install mercurial and fork the repo, and get started, but maybe.

      The INI parsing code really wasn’t hard to port over; there was an entire separate Ini.{h,cpp} file pair that made it really self-contained.

  6. thegrinner says:

    Seeing as this is a public repository, I feel the need to ask whether you prefer we fork before doing any playing with the code or if direct changes are acceptable?

  7. MichaelG says:

    So what do we need to install in order to get this code and run it?

    • Dave B says:

      So far, I went to the Bitbucket page, used “Download Source”, downloaded the .zip. Then I got extracted the .zip onto my hard drive and then downloaded Visual Studio C++ 2010 Express. I opened “Frontier.sln” and pressed “build”. Then the compiler choked because I seem to be missing something called “glConsole.”

    • Neery says:

      I’d be really grateful if someone would be willing to post some sort of tutorial for non-coders on how to turn the github file into an executable game. I just want to walk around in the world, not play around with the source files, but to be honest I’m a little stumped. (I should probably try this again when I’m not half-delirious from exhaustion.)

      • anaphysik says:

        Indeed. As a follower of Shamus’ work, I’d love to be able to traipse about the procedural worlds his code can generate and check out the scenery. As a non-coder, I have no idea how to go about this. :/

  8. Ed Lu says:

    Maaan, when I saw this title for a second I thought you meant you’d ported Project Frontier to Valve’s Source engine.
    Which, in theory, may be conceivable since it also uses C++ – however, probably still a ridiculous amount of work.

    EDIT: Shamus, what exactly was in your “H:/sdk/cg/” folder? From the compile errors, I assumed it was just SDL, but apparently I was wrong – I’m still missing a couple files, “cg.h” and “cggl.h”. I’m assuming they’re the libraries that you yourself wrote? Nevermind, looking into it more, it’s probably a third party library. However, just doing google searches, I can’t find it. Any way I could get some help with this?

  9. DrMcCoy says:

    One question: What license is this code under?

  10. Luke Maciak says:

    Awesome! Thanks for doing this.

    I hate to give you more work, but if you find a free minute could you perhaps put a small README with the code that outlines:

    – What are the basic system requirements: (ie which Visual Studio version you used, what additional tools might be needed).

    – Few sentences on how to compile (if there are any steps other than hitting compile button)

    – All the stuff you just explained above (or link to this post)

    This way if someone stumbles upon your source code six months from now, they can build and play with the game without actually having to dig out this post to learn how.

    Once again, thanks for open sourcing it. :)

    • DrMcCoy says:

      I wish he would also free (as in freedom) the code, by giving it a free license (copyleft or not).

      Right now, though the code is open, we’re not actually allowed to do anything with it beyond reading, when you’re pedantic about copyright law.

      • nmichaels says:

        Actually, that’s not true. We’re allowed to do all sorts of things to it, just not distribute the result. In fact, we’re not allowed to distribute it at all. Not even to put up on bitbucket.

        Fortunately, that only applies if Shamus is a litigious jerk, which he is not.

        Incidentally, the libraries may be under different licenses that need to be included.

      • Luke Maciak says:

        Very good point.

        Shamus, if you don’t care I would recommend the WTFPL license: :P

        If you don’t want people making for-profit copies then just go with GPL.

        • DrMcCoy says:

          Copyleft licenses like the GPL still allow people to monetize your work, they just require them to also free any changes they made.

        • nmichaels says:

          BSD is good and short, if you don’t care what people do with it. If you want PF to only form the core of money-making games when you approve, the GPL (with an option to commercially license) will get you there. Of course, if you go that route you’ll have to get approval from anyone who contributes to it. The GNU approach of requiring anyone who contributes to assign copyright to you can work, but it’s not very practical if you want to encourage people to work on it.

          Short version:
          Do you care if other people internalize this into commercial products?
          Yes -> GPL
          No -> BSD

          The other thing to consider is the license for the various libraries you’re using. SDL is LGPL’d, so as long as you don’t make changes to SDL itself you’re clear. I don’t know about all the other things you’re using, but if you link with something that’s GPL’d, and distribute the resulting binary, you have to GPL it.

          That can help.

          And you thought open sourcing stuff would be easy!

          • Shamus says:

            I’ve placed the BSD license on the Wiki.

            • Shamus says:

              And now I’ve changed it to the WTFPL.

              • harborpirate says:

                I’ve seen some developers multi-license stuff.

                Thus far, Apache and MIT were the two most “free” license types that I’d seen – this is the first I’ve heard of WTFPL, so I’ll be interested to check that out.

                I’m just thrilled that you decided to open up the code, I think this is of great benefit to the development community at large.

                Thank you!

                • My personal favourite license to use (if I feel like I’ve been remotely creative in some way) is
                  In a binary release, at minimum a copyright line crediting the original author is only needed (but apparently optional).
                  So no TEXT BLOCK OF DOOM to annoy people with.

                  And in the cases where I don’t feel like I did anything remotely creative I just “license” it public domain. (Just a line of textg stating I place it in the public domain).

                  Though Creative Commons is kinda neat as they have a more standardized way of creating your licensed. (both zlib’ish and PD’ing your work) so I might use that in the future, we’ll see.

                  EDIT: Actually after looking quickly at the longform CC, and the BSD and MIT licenses. I find that the zlib license is probably the most straight forward and and simple license I’ve seen.

  11. Luke Maciak says:

    Guys, can we start a list of dependencies for this? Maybe Shamus can add it to a REAMDE later.

    So far from the comments I gather you need:

    GL Console:
    CG Tookit:

    Anything else?

    Shamus, can you enable the Wiki on the Bitbucket page? Maybe we can pull resources and write some documentation for you. Crowdsourcing man! :)

  12. Exetera says:

    Uh… is File.cpp supposed to have Activeworlds Inc. copyright info at the top? (Related: is Cg.cpp supposed to have a header claiming to be CTerrain.cpp?)

    That and I kinda disapprove of File.cpp in general. Yuck, Microsoft-specific stuff… curse you, File.cpp, you’ve probably just wasted fifteen minutes of porting time. It also stores timestamps in 32-bit integers.

    Ini.cpp also makes me sad.

    • MichaelG says:

      Shhh…. this is why programmers don’t like to release their code to the net.

      • Ed Lu says:

        Also, why I’m trying to learn as much as I can about this kind of stuff (portability, open source software, third-party libraries, etc) as I can before I get out of college. This is all stuff they don’t teach you about, folks.

    • Shamus says:

      Wow. That means I’d originally copied something from Activeworlds source.


      Looking at it… it’s clear it’s not this file. It’s obvious I copy that block header around. Still, that’s sort of alarming.

      And like Goodfellow said, this is exactly the sort of thing I worry about when releasing code.

      EDIT: Okay, I’ve looked over the source. I no longer have Activeworlds code to compare to, but I think we’re in the clear.

    • DrMcCoy says:

      Somewhat related, I could try to start flamewars about how I hate his use of spaces instead of tabs for indenting and his {-placement… :P

      But yes, File.cpp and Ini.cpp are not really tutorials on portability.

      When Shamus settles on a license, I’d probably be willing to relicense my INI reading class as a replacement, if that’s helpful to people.
      It might be too complex for this use-case, though, and has certain other dependencies that need to be replaced, that I can’t relicense (for example, the Stream classes come from ScummVM and are GPLv2+).

      • Shamus says:

        I’ll go ahead and say File.cpp and Ini.cpp are pretty horrible. Yes, I knew all along they would need to be replaced at some point. You know how it is when you’re prototyping.

        • Exetera says:

          I’ve got a File.cpp working on POSIX, but I suspect it wouldn’t run on Windows. (Also, I didn’t actually check that some of the directory code actually worked… it looked kinda gnarly.) Now to fix my pesky texture bugs… It loads the sun, the stars, dust puffs, and absolutely nothing else. (Not even the console font!) Any suggestions would be appreciated…

          • MichaelG says:

            You know, looking at the dependencies and portability issues, I have to say there are some advantages to being anal and writing all your own code like I’ve been doing. Too bad it’s only taken me a year to do what Shamus does with his libraries.

            • Exetera says:

              Meh, aside from the INI stuff (which I ended up hackily patching out) I haven’t had too much trouble porting to POSIX, aside from this texture thing… and as best as I can tell, that’s not a library issue. (Shamus’ chosen image library seems to be loading images fine, it’s just OpenGL doesn’t render ’em for whatever reason. Still trying to figure out why that is…)

              Of course, I’m of the “write your own code” sort myself, though that’s mostly as regards algorithms… I’m gonna have to implement Fortune’s Algorithm soon, which will naturally be a blast.

              • Ben says:

                Good luck. A friend and I spent the better part of two weeks trying to get Fortune’s Algorithm for some robotics work. That is one of the most complex algorithms I’ve ever tried to get my head around and implement.

              • Bryan says:

                Instead of patching out the INI stuff, you could try pulling these from pixelcity:


                Not sure if they’ll continue to work with frontier (going to find out once I get all the $*(@#)”%&)(#$ nonsense introduced by case-insensitive filesystems cleaned up), but maybe.

                • Exetera says:

                  There wasn’t really that much that depended on the INI code, though. If I were going to replace it with anything, I would probably just rewrite the code using it to depend on CVars instead.

                  • Bryan says:

                    Well, it’s one of the age-old tradeoffs — between reusing something that has worked previously, even if written for a different source, and just changing around the rest of the program to not require it.

                    Depends on how much you want to do. I have the pixelcity sources sitting on this machine, so I’ll most likely just copy those two files in and — assuming they work — call it an hg commit. :-)

                    • Bryan says:

                      Hmm, nope. Looks like a few things changed in Shamus’s Ini files. Wheee.

                      They got overloads for specifying a section explicitly, and adding that support will be … interesting. I can probably make it work with a multi-way map: “map<string, map >” where the first is the section and the second is the entry. Hopefully this is reasonably easy to save and parse back. Whee.

          • Shamus says:

            You know, I’ve got a huge 2k post tomorrow about how much Qt bothers me, but seeing these porting headaches is making it all look reeeeally attractive.

          • Exetera says:

            Here’s an in-progress screenshot showing [a] that it’s mostly running natively under Mac OS X (POSIX) and [b] that only the stars have any texture.

            • Exetera says:

              OK, I’m fairly sure that the issue is in the shader system. Shamus, do you remember any issues that you had with the shaders which might be helpful here? Alternately, do you have any suggestions on how to eliminate them entirely? The way it’s set up right now, when I tried to sloppily eliminate shaders, I ended up with a permanently overcast sky and non-colored grass and flowers.

      • Shamus says:

        The thing is, I HATE a lot of the coding styles I use.

        For years I worked on Activeworlds. That began in ANSI C in 1994. It used the old-school styles favored by its originator. All lowercase. Underscores. Spaces, not tabs. Indents are 2 spaces. Braces open on same line.

        Everyone else followed these standards. Even after the original guy left, it was generally agreed that consistency was king, and nobody wanted to convert all those 100k lines of code from

        void do_a_thing ()


        void DoAThing ()

        When I moved on, I was free to use styles that I favored, but after all those years it was hard to get out of those old habits – even the ones I disliked. I’m looking at frontier, and at my current project, and I’m seeing a lot of worrisome inconsistencies of style. I really do need to pick a set of conventions and stick with them.

        However, I really am a fan of

        //I'm not paid for my code based on the square yard.
        for () {
        do {
        } while (thing);

        I dislike throwing away a lot of vertical space on curly braces. I can understand why people like the symmetry of matching braces, but I’d rather have the screen space.

        • MichaelG says:

          Tell me about it! I learned all that Microsoft cruft — m_lpzString and then gradually let most of it fade away.

          I was reading someone else’s coding standards the other day, and it was “yes, yes, that too! I do all of that! Finally, someone with the same style as me!” But after the first five points, it went insane and I had to stop reading…. sigh.

          • Bryan says:

            Ugh, m_lpz prefixes. :-(

            There is, of course, a much better way to do them:


            Apps Hungarian had very useful, meaningful prefixes like “ix” to mean an index into an array, “c” to mean a count, “d” to mean the difference between two numbers (for example “dx” meant “width”), and so forth.

            Systems Hungarian had far less useful prefixes like “l” for long and “ul” for “unsigned long” and “dw” for double word, which is, actually, uh, an unsigned long. In Systems Hungarian, the only thing that the prefix told you was the actual data type of the variable.

            This was a subtle but complete misunderstanding of Simonyi’s intention and practice, and it just goes to show you that if you write convoluted, dense academic prose nobody will understand it and your ideas will be misinterpreted and then the misinterpreted ideas will be ridiculed even when they weren’t your ideas. So in Systems Hungarian you got a lot of dwFoo meaning “double word foo,” and doggone it, the fact that a variable is a double word tells you darn near nothing useful at all. So it’s no wonder people rebelled against Systems Hungarian.

        • DrMcCoy says:

          Went right the other way round for me.
          I used to put the { on their own line. Instead I was more stingy with the horizontal space “for(i=0;i<10;i++)".

          Then I joined the ScummVM team in 2006, and adjusted to their coding style. And I kept with it. Hugging braces, "for (i = 0; i < 10; i++)" and all.

          The only thing I always did was tabs for indent, spaces for alignment. Spaces for indenting just never made sense to me.

        • Chiller says:

          I prefer to open curly braces on a new line. Not as much for symmetry, but for with being able to easily tell where the blocks start and end.

        • Neko says:

          For my work, we settled on an unconventional braces style – a mix of K&R style vertically aligned braces for class and method blocks, but with BSD KNF style opening braces on the same line for ifs and loops and anything else. It was weird at first, but I’ve since adopted it as my own – it kind of makes sense that you don’t need to waste whitespace on a 3-line if statement, but you want to keep your functions and methods nicely spaced out.

          Let’s see if I can’t screw up a ‘code’ tag to illustrate my own odd style:-

          TES3::Record *
          QDataStream &data_stream)
          static const QByteArray tes3 = QByteArray("TES3");

          // Check TES3.
          QByteArray magic = data_stream.device()->peek(4);
          if (magic != tes3) {
          qDebug() << "This does not look like a TES3 format file - header magic is wrong.";
          TES3::NotTES3FormatException ex = { magic };
          throw ex;
          return read_record(data_stream);

          • Neko says:

            Okay, how can I edit comments? I just keep managing to screw up the formatting. I don’t see an obvious ‘edit’ link.

          • WJS says:

            Given the nature of the blog and audience, I really don’t get why Shamus doesn’t have proper support for code samples in comments. Surely it can’t be that hard? Of course, I’m coming from the direction of having written my own website code from scratch to do exactly what I want it to, so I have no idea how to do things in WordPress-land. Still, it seems like it should come up enough that someone should have worked out a solution by now.

  13. Neery says:

    Thank you for posting this, I appreciate it a lot!

  14. Zukhramm says:

    I guess now’s as good a time as any to learn C++.

  15. Rohit says:

    Thanks for releasing the source, Shamus. My final project in my graphics class last semester was a terrain generator that was inspired by Project Frontier. Your series also helped me implemented a mostly working quadtree simplification algorithm. The code is here, though it’s not nearly as impressive as yours.

    Can’t wait to see what you come up with in Project Octant.

  16. Bryan says:

    Your trees look like cubes. Is that a reference to minecraft, or a result of more traditional tree designs being difficult to program?

    • Shamus says:

      When textured properly, they should look more like a World of Warcraft-ish kind of thing. I don’t know about “difficult to program”. One tree is about as easy as another until you start getting close to photorealism.

  17. Lachlan the Mad says:

    Speaking as a programming noob; How me make this go?

    • Ed Lu says:

      Easiest and cheapest way is to get Visual Studio Express. Then, download all the libraries noted here. Download Shamus’ source. Open up the .sln file with Visual Studio. There should be two “frontier”s on the left pane; right click the second one (the one tabbed over on the hierarchy) and hit properties. Look through all the categories; every time you see something like “H:\SDK\…” replace it with the location you downloaded and unzipped the libraries to. Now, you should be good to compile.
      It’s a bit more nuanced than that. Maybe someday I’ll do a long writeup on how to compile other people’s source, but for now, it’s late.

  18. Rohit says:

    If anyone wants to run the program in first person view, my .exe is available here.

    Download Ed Lu’s archive and replace the exe with mine, and change the CameraDistance in Frontier.ini to 0.

    If you don’t trust my .exe, I simply reduced CAM_MIN to 0 and commented out the code that renders the player model and the code that handles the mouse-wheel. It works well enough, I think.

  19. Simplex says:

    Could someone please post the executable version of Project Frontier for the n00bs that have no idea how to compile code (i.e: me)?

  20. Doctor Broccoli says:

    Okay, here’s what happened today:

    – I started reading your code
    – Two hours pass
    – I forgot to eat dinner and now have 20+ tabs open in notepad++

    Congratulations Shamus! You created your very own TV Tropes!

    Seriously though, I am learning a LOT from this stuff. I study computer science and although it’s all fine and dandy to hear how this stuff works in theory it can be so much more educational to see how it’s actually applied in practice.
    Thank you for this.

  21. Bryan says:

    Well, I think there’s a bug. :-)

    In World.cpp, both in WorldWaterLevel and WorldBiasLevel, the code calculates an origin.x and origin.y value from the passed-in world_x and world_y values. Then it clamps them to the range [0, WORLD_SIZE-1] (inclusive).

    Then, it tries to get the region at four different points: (origin.x, origin.y), (origin.x, origin.y+1), (origin.x+1, origin.y), and (origin.x+1, origin.y+1).

    However, that last one (just to focus on one of them), up in WorldRegionGet, tries to dereference[WORLD_SIZE][WORLD_SIZE] when the code calls WorldWaterLevel(max_x, max_y) (whatever the maximum world coordinates are). Since the valid indices into C and C++ arrays start at 0 and go to [array size]-1, and since map was declared as “Region map[WORLD_SIZE][WORLD_SIZE]”, you can’t dereference that entry.

    The program segfaults for me partway through building a world (the first time it tries to walk off the end of the — pretty large — block of memory reserved for map). It works fine (or, well, gets past this crash anyway :-) ) if I replace the “clamp” calls in both those functions with clamp calls that limit the range to [0, WORLD_SIZE-2] instead.

    See — though I don’t know if there’s any easy way in mercurial to pull this individual patch.

    • Bryan says:

      …Except that last commit doesn’t fix all the cases where the code tries to overrun the size of[][] — there’s one more (known so far) in WorldColorGet().

      See for that fix.

      I don’t see any more in World.cpp at least…

      • Bryan says:

        Another bug. None of the GridData-derived classes are actually calling the GridData constructor. They’re all simply creating a temporary (of type GridData), then throwing it away. :-)

        For instance, in CTerrain.cpp:

        CTerrain::CTerrain ()
          //Call parent constructor
          GridData ();

        Well, er … no, actually, that’s not what that does. :-) That’s what this does:

        CTerrain::CTerrain ()
          : GridData()

        (Note that you can use the initializer list after the colon to set the initial values of class fields, as well, though I think there are some restrictions on the usable values, and I know you have to initialize fields in the order they were declared in the header file. Elements in this list are separated by commas. But that’s a bigger change.)

        • Bryan says:

          Last bug. I think. :-) This change actually makes it *show* the ground when shaders are enabled:

          (It’s possible that one of my other changes made this particular enum value stop working, but I think it’s unlikely.)

          Now I can finally see stuff. And reverting all the local changes to the .cg programs (that I added to try to figure out why I couldn’t see anything before), makes all the other effects show back up again, as well. :-)

          No purple trees — the surrounding night makes it a little hard to tell, but I do see green. No green noise all over for the fog, either (although again, it’s night, so maybe the fog isn’t present or something; have to wait about ten minutes to see).

          Crap, never mind, the fog isn’t working. (Large checkerboard patterns along the ground instead of actual fog.) Most likely because of the missing fog.png texture I mentioned earlier. Well, everything but that is pretty good, I think. :-)

    • WJS says:

      Wait, what? Bounds errors and segfaults? How did this ever run?

  22. Troy says:

    I got problems with the binaries Ed Lu offered. Problem: Window keeps black (even after 5mins of waiting), both with on board Intel and normal Nvidia graphics card. Any solutions?

    • Shamus says:

      Hit the tilde key ~ to bring up the console. Type “game new 1”. That will begin a new game. Replace the #1 with some other number to use as a seed, if you like.

      • Troy says:

        Thanks :)
        I should read the posts more carefully in the future.. Now its working :)
        Interesting fact: with on board intel gpu: no purple trees, but weird grass effect, like MichaelG mentioned. With nvidia gpu: purple trees, but everything else works fine :)

        • Troy says:

          Interesting fact #2: with on board intel gpu: clouds, stars (at night) and trees are beeing displayed correctly, with nvidia gpu i don’t see any clouds or stars. Maybe that helps fixing the problem :)

  23. Tharwen says:


    It compiles! It runs!

    I mean, sure, my desktop is covered in assorted source files and binaries which I’ll never be able to reassemble if something goes wrong, and GLConsole doesn’t recognise any commands I put into it, and the trees are all purple, and I have absolutely no knowledge of C++ which I could put to use debugging this stuff, but IT COMPILES! AHAHAHAHAHAHAHAHA BOW BEFORE ME MORTALS.

    EDIT: Oh. It keeps crashing randomly.

  24. […] week Shamus Young has decided to open source his excellent proof of concept, procedural world generation project codenamed […]

  25. Neil Roy says:

    Thanks for releasing the source. I have actually created a similar program, or at least started to, but it’s not nearly as good as what you have done. I have some terrain rendered from a heightmap, some simple trees, a huge water texture like yours (only animated so it is moving and transparent). I added in ambient sound (wind, birds, water when swimming). I done mine like Battlefield 1942 mostly, I copied the terrain so that it basically goes on forever. You keep walking/flying and when you reach the edge it wraps around, but because I copied the terrain and it is designed to the edges all match up (wraps around) it just seems to go on forever. I wanted to try something like you have done, with different terrain in sections and eventually have the world wrap around, opposite sides would match up and you could walk around the world literally.

    I love the idea of procedurally generated worlds, I got the idea from the old game Elite which generated the entire universe at runtime, which led me to your page here when searching. We have the same interests, you just have far more skill! ;)

    As for your coding STYLE, we’re alike I think. K&R seems to suit me, and it looks like your style as well. I also use underscores for my variables, I don’t like the look of MyVariable, I prefer my_variable, it’s more readable in my opinion and I hate Microsoft’s style. Like you I see no need in wasting vertical space on brackets. Some people say it helps them know where the block is, well, you can tell easily by the indented lines…

    if(a == b) {
    c = d + 5;

    As anyone can see, the indented lines make it obvious, but no wasted space. I also can’t stand things like:

    if(a == b)
    d = 1;

    when it could be written:

    if(a == b) d = 1;

    But everyone’s different. If you want to get truly portable, a good compiler to pick is Code::Blocks, it has many of the same look and feel of Dev-C++ for those that liked it, but it is maintained still. It can now (with the latest nightly build) import VC2010 solutions as well as Dev-C++ projects, but most importantly, it is also available on other platforms like Linux, so you can completely port your projects, code and all to Linux, using the same compiler and compile away. Code::Blocks uses the MinGW (Windows version of the GNU GCC) compiler.

    A library I use that is similar in portability as SDL is Allegro (specifically, Allegro 5, which is more up to date). It supports JPG, PNG, OGG, OpenGL etc and is very flexible with nice sound, TTF etc… support as well.

  26. […] worked a bit on Shamus Young‘s project Frontier, fixed a few things, and someone in the comments asked what I did exactly. After writing it up, I […]

2 Trackbacks

  1. By The Plight of a Git Newb | Terminally Incoherent on Mon May 7, 2012 at 9:08 am

    […] week Shamus Young has decided to open source his excellent proof of concept, procedural world generation project codenamed […]

  2. By Project Frontier fixes | Csirke blog on Tue Sep 17, 2013 at 8:17 am

    […] worked a bit on Shamus Young‘s project Frontier, fixed a few things, and someone in the comments asked what I did exactly. After writing it up, I […]

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="">Darth Vader</a> on Wikipedia!

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