Project Frontier #17: Feature Dump

By Shamus Posted Friday Jul 15, 2011

Filed under: Programming 137 comments

Okay, this series has fallen way behind. I basically spent an entire week writing about one day of work, so to get caught up I need to cover a week of work in one day. Let’s get started.

But before we begin: IGNORE THE SILHOUETTE GUY HE IS PLACEHOLDER ART. ANYONE CAUGHT CRITIQUING PLACEHOLDER ART WILL BE BEATEN WITH A 1987 VINTAGE MONOCHROME MONITOR. THANK YOU.

Day / Night Cycle

frontier17_1.jpg

The sky has become significantly more complicated since I wrote about it back in part six.

We still have the original cone, which is used to create the fade. Then we have a canopy that I use for the star texture. Imagine you and a friend have a bedsheet by the corners, and you quickly lower it to the floor. The corners are flat, but there is still a bit of air trapped in the middle. That’s the shape of my sky, which has a star texture painted onto it. This shape is sub-optimal, because you can see the foreshortening on the stars. In the distance, they are tiny dots. Overhead, they are big blurry messy dots. In between, you’re looking at them at an angle and they end up looking disk-shaped. On the horizon they are numerous and tiny. Overhead they are large and sparse. It still looks nice, but it could look better.

I seriously considered using a scattering of square panels floating in the sky, as Michael Goodfellow discussed way back in part 4 of his project. His is a superior method, since none of the stars end up being stretched out.

frontier17_2.jpg

As it gets dark, this star canopy gradually fades in. There is a huge billboard on the western and eastern side of the sky. At sunrise / sunset, the appropriate billboard fades in. The texture on the billboard is just a big fuzzy blob of light – bright in the center, dark at the edges. I render it so that half of the billboard falls below the horizon. In the morning it’s tinted yellow, in the evening it ends up being more red. It’s laughably simple from a simulation point of view, but it sells the sunset / sunrise idea nicely.

There are two aspects to the sun itself: Where the sun appears in the sky, and where the light is actually coming from. See, when the sun is overhead the world looks very boring. There’s no shading to the world in the middle of the day and so everything looks kind of flat. That’s fine for a short period of time, but in a twenty-minute day/night cycle I don’t want five whole minutes of dull lighting. (Yes, shadows would help, you relentlessly demanding taskmasters. One thing at a time.) So I have the sun move overhead at a steady pace, while the light origin stops at the 45 degree position and lingers there all morning. (Since the sun is now overhead, it’s very, very hard to get both the sun and the landscape into view at the same time, so nobody is going to notice this discrepancy.) After midday the light origin hurries across the sky to catch up with the sun.

frontier17_3.jpg

At sun rise / set, I have to pull this trick again. Once the sun touches the horizon, the lighting would normally come in perfectly horizontal. As it lowers, the light would actually come up from below. This looks really, really bad, and would actually wreck most shadowing systems. So what I do is have the light source stop about ten degrees above the horizon and let the sun move away on its own. The light goes from yellow / red to pale blue. Once the sun itself is gone, the light sneaks back to the eastern side of the sky, to be ready for when the sun appears the next morning.

No, I don’t have a moon yet.

Vertex Shaders

I finally break down and add some shaders to my program, taking me from 1998-level technology to 2004-level technology. Now I can do all of these crazy per-frame calculations to the world. First up, I curve the points away as they near the horizon, making it appear as if we were on a spherical planet.

frontier17_4.jpg

(This is a bit of an optical illusion. I’m not 200 meters tall, I’m just flying way up in the air.)

Now I don’t need some fancy-pants system of fading in blocks of terrain. (It’s pretty hard to sneak something that huge into view, no matter how you handle it.) The new terrains will just appear over the horizon. We will still have pop-in problems with things like mountains, but screw that. You can’t make everything perfect and if you try you’ll go broke before you’re ready for alpha testing. The pop-in isn’t that bad, and it’s rare. It’s trivial compared to the pop-in you see in Minecraft (Donk! Suddenly there is a mountain!) and nobody complains that the Minecraft pop-in is this immersion-shattering annoyance. Artistic myopia can kill a budget faster than anything else. (Not that I have a budget.) My pop-in should be less intrusive because the pieces it drops in are smaller, and the draw distance is further. So the things that are popping in are very small, from the player’s perspective.

Speaking of pop-in, way back in week 3 you could see obvious pop-in when blocks of grass would appear. These were very close, filled a lot of the player’s view, and so looked bad. (The fact that they were great big squares didn’t help.) So I add a vertex shader to make grass fade in gradually.

Undergrowth

I take the grass system and make another similar system for undergrowth.

frontier17_5.jpg

As others have predicted, this makes an immense difference. The world feels much richer and more varied. The undergrowth actually shares the same texture as the grass, so I can draw all of them in a single pass. Like this:

frontier17_6.jpg

The first row is flowers. The second is grass. The last row is undergrowth. Again, I’m not much of a pixel artist, but I did what I could. I experimented with the bushes a bit, seeing what looked good and what didn’t. Amazingly, bush #3 – which to my eye looks the best – doesn’t look significantly better than the others in-game. Bush #4, which looks stupid and horrible on the texture, doesn’t look half bad within the game. Bush #1 is actually the best of the bunch.

It takes a great deal of effort to pry myself away from this. I could blow two days fussing with pixel art and texture maps and figuring out why some things look better than others, but I’m on a push to hammer out the technology. For now, this is good enough and I can see that it works.

Wind

What else can we do with vertex shaders? Hm. You know, let’s try making the trees blow in the wind. If you remember, tree textures look like this:

frontier10_8.jpg

I can isolate any vertex that uses texture values from inside of that second panel. I’ll check it’s distance from the center of that panel. The further away it is, the more it moves. I apply a rolling sine wave over the whole world and use it to push the points around. The result?

frontier17_7.jpg

Uh. Yeah. I guess you can’t see those moving in the screenshot. Well too bad. I don’t have time to make a video of it, but take my unbiased word for it: This looks awesome. You are totally missing out by not being able to see it in action. Really. You poor thing.

I try the same trick on grass, and it is also awesome.

End of Week 7

We’re getting near the end now. I’m planning on finishing up as much of the technology as I can in the next week, and I’ll do another video for the wrap-up. At that point I’ll have the core technology done, and I’ll be in a position to decide what I want to do with my time.

While using this to make a game would be nice, the important thing has been to prove that procedural development is a woefully under-developed area of study. Yes, there’s a procedural game now and again every few years, but that’s less than 1% of all games. We haven’t even mapped out all of the things that are possible, much less harvested all of the low-hanging fruit.

The point I want to make is that procedural techniques can allow one guy to accomplish in two months what a large team can accomplish in half a year. Hopefully I’ve made my case. We’ll see once the video is out.

 


From The Archives:
 

137 thoughts on “Project Frontier #17: Feature Dump

  1. benjamin says:

    this is so awesome that I don’t have word for it ! I hope you’ll go the game way, because that would be too bad to stop now that you have half year of a big team’s work at your disposition :-)

  2. I believe in you. This showcase coupled with the other projects you have on display here. I would back you with monies and time(edit: ie. actual testing if and when you need it) if you decide to take this project onward, to infinity ““ and beyond.

    1. henebry says:

      Lots of projects are being funded via Kickstarter these days. I’d like to see a similar funding system, but where contributors buy equity, rather than products. Because, as Tormod Haugen says, this project seems worth investing in.

      1. Mistwraithe says:

        I believe several people have posted in the past that they might be interested in contributing non negligable funding to a Shamus project. I was one of them and the idea still has merit.

  3. Steve C says:

    Umm you say not to criticize the placeholder silhouette guy but I really like him. His art style really works in those screenshots. It works so well I think it would look worse if there was a “proper” fully drawn character used instead.

    1. Peter H. Coffin says:

      I like silhouette guy too. It reminds me of the manga convention of “these are people you’re not supposed to pay too much attention to.”

    2. Hitch says:

      I was gonna say basically the same thing. Silhouette Guy looks kinda neat. Just let him wander around this landscape with the right background music and little musical stings at random times to make it seem like you must be accomplishing something and I’m sure it would be embraced on Steam as an artistic indie masterpiece.

    3. Josh R says:

      Maybe it could be encorporated in a game – you are a lost shadow, searching for your body, then encorporate an art-game ending where you can never find the body.

    4. Daemian Lucifer says:

      Bah,hes just a charlatan!I want the stickman instead.

    5. Aldowyn says:

      The biggest problem I see is perspective. You can’t really tell where he is because there’s no depth to him :/

      He does look pretty good, though.

    6. thegrinner says:

      Other than being a three dimensional shape of a solid black he’s AWESOME. There’s something weird I’m seeing that I think comes from a 3D shape looking kind of 2D, but for all I know it’s the light in my room… Carry on!

    7. M the cheddar Monk says:

      If you put little twinking lights all over his body, like stars, that would look awesome. He would look like the night sky in human-shaped form.

    8. Cybron says:

      I too like it, though I do think it could use a little shading so as to be a person instead of a black hole. It would be neat rather whimsical stand in.

    9. Deoxy says:

      I was considering criticizing him, but only because I want to see if Shamus really has a vintage 1987 monochrome monitor. It might be worth being beaten with one just to see it in real life.

      (Yes, this would be a “Shamus is old” joke. I can tell those because I am also old – I used monochrome monitors, too. Heck, I could laugh a Gore’s claim of “helping to create the internet in the 90s” because I USED the internet in the 80s. To MUD. On a monochrome monitor.)

  4. hewhosaysfish says:

    Nitpick:
    Under the “Wind” section, paragraph 2: “The further away it is, the move it moves.”

  5. therandombear says:

    hey shamus that placeholder guy looks really weird…oh god, stop hitting me…please, I didn’t mean anything about it!

    Your unbiased word that it is awesome is accepted, progress is being made ;)

  6. Elec0 says:

    This is looking pretty awesome, I love reading about your programming projects.

  7. Adam P says:

    The bushed from #3 look kind of like sandbags. I’m sure it’ll look better with shadows, though.

    In the last screenshot, there’s something near the right edge of the image. Are those trees without leaves or some sort of stone obelisks?

    1. Shamus says:

      It’s a tree trunk. I imagine that it’s foliage is floating somewhere above it. For some damn reason.

      1. Aldowyn says:

        still a lot of bugs to sort out then, Shamus? :P

      2. Adam P says:

        Bug or not, it looks cool. There’s one or two trunks near it that makes it look like ruins or something.

        1. asterismW says:

          Ooh, ruins! Those would look awesome in this world. Though I don’t know how difficult it would be to proceedurally generate convincing ruins.

          1. Zak McKracken says:

            Actually … the shrubbery close to the viewpoint in the first image looked to me a lot like old old walls, and the lone tree trunk without foliage is an obelisk. So if it happens by accident, it’s probably possible to implement, too. The question is just if it’s worth the effort right now.

            1. Leonardo Herrera says:

              We want….a shrubbery!

  8. UbarElite says:

    I personally think this has a lot of potential. I look forward to the video.

  9. Dev Null says:

    Just curious about the light-angle-from-the-actual-sun-boring-at-midday problem. (Well, what would you call it for short?) Does your sun arc directly overhead? As I’m sure you’re well aware, the real sun only does that twice a year, and only at certain latitudes. I wondered about exaggerating the angle a bit – make your effective latitude/season northern Sweden in winter, say, and the sun never gets much above 45 degrees above the horizon; it just rolls around to the south. Then your light source could follow the sun. Not sure how much angle you need to make the lighting interesting, but its a thought…

    (I should note that I’m not proposing you invent seasons – oversimulate much? – just that you pick a single interesting one and keep it all the time.)

    1. Joe Cool says:

      Ninja’d, I was about to suggest this.

      If the sun is never higher than 45°, then there shouldn’t be a problem.

    2. Abnaxis says:

      I was going to mention this. Unless you live in the Tropics, the sun should never be directly overhead.

      In college I made a system for automatically following the sun with a mirror. The angle of the sun is a lot simpler than it might seem to be at first, and is actually quite easy to simulate. Just rotate the sun texture/lighting vector a set angle around the East-West axis and BAM, done (FYI, this angle is equal to the latitude you are at during the equinox). So at 9 in the morning, rotate 45 degrees (9/24*360-90) away from the earth around the N-S axis. After the first rotation, rotate some arbitrary number of degrees (say, 20 degrees–this angle doesn’t need to change, unless you want to simulate how the angle of the sun changes with seasons/geography) around the E-W axis to account for latitude and keep lighting interesting.

      One line, problem solved, and it sounds a bit simpler than the solution you have in place.

      1. Moridin says:

        Actually since Earth’s axis is tilted 22 degrees, sun will be directly overhead on other altitudes, too. It’ll only happen twice a year, though, and never more that 22 degrees from equator.

        1. Abnaxis says:

          When I say “the Tropics” I am referring to the area between Tropic of Cancer and the Tropic of Capricorn, which are the exact furthest latitudes North and South of the equator where you can ever see the sun directly overhead…

      2. WJS says:

        Whether this would work would depend on whether Shamus is still using the terrain shadowing method from the first terrain project. That must have the sun arc directly overhead.

    3. Factoid says:

      Actually I don’t think seasons would have to be a major oversimulation. If this ever turned into a real game that tracked time in any meaningful way, you might very well NEED seasons for it to feel authentic. Just a little bit of subtle color changing and fluctuating periods of rain/snow/fog.

      It could be very simple. A year is 100 days, each season is 25 and there are 5-6 days during which every day at dawn the color palette shifts just slightly toward the new season, trees lose a certain % of foliage and whatnot.

      1. GiantRaven says:

        More games need seasons, especially sandbox games.

        Imagine how awesome it would be to have seasons in games like Fallout, Stalker, Oblivion etc.

        1. Michael says:

          Fallout, eh?

          I do love me some Nuclear Winter.

          1. Reet says:

            AAAARRRRGGGHHHHHH!!!!

            Also I would like to take this time to point out that this project is awesome and that Shamus has done an excellent job. Congradulations!

          2. evileeyore says:

            What? No love for Nuclear Summer? Or Autumn or Spring?

            1. decius says:

              Well, the Nuclear Fall happened some 200 years earlier. That caused all the Fallout. The Potomac river apparently had its mouth in the Nuclear Spring. Therefore the weather in the Mohave must be a Nuclear Summer.

      2. Adam P says:

        At 20 minutes per day, that would be 2000 minutes for a year, or about 33 hours.

  10. Piflik says:

    Are you considering to release an executable of the World Generator so people can create worlds themselves and walk around in it? Maybe even with some possibilities to change variables to odd values and create really surreal worlds…with yellow skies, purple grass and trees growing from clouds…

    1. Aldowyn says:

      I’m pretty sure he’d have to make a new interface to allow people to change stuff without making it opensource

      Unless the console, in its awesomeness can do that. Which, now that I think about it, it might.

  11. David Armstrong says:

    If I knew how to program, then I’d love to take what you made and make my own world with it.

    That’s basically what I do in minecraft – I level out mountains and dig tremendous pits, so that I can start at the bottom of the world and remake it in how I want it.

    World-building is such a positive aspect of gameplay – it’s what games like SimCity and Civilization and even the character creation screens of other games hint at – but never quite deliver.

    You want a mountain? How do you want it to look? Tell ya what, pop in a DVD for white-noise and just make it yourself! YES!

  12. Fat Tony says:

    This is excellent Shamus.
    Would love to see more environmentaly aimed procedural content, small settlements etc. To add more “Character” to the continent.

    Oh and shadows, a moon and some kind of system to randomise the appearance of the character maybe.

    (Also your wifes’ art is pretty good wouldn’t it be possible for her to draw stuff that you could use as art assests, akin to minecrafts painting and so on)

  13. Fat Tony says:

    Wow, 9 more comments in the time I wrote my one.

  14. Josh R says:

    If it does become a game I want to see it get spoiler warning’d

    1. JPH says:

      YES! And this way Shamus can make sure not to include an incinerator.

      1. Alexander The 1st says:

        Eh, it wouldn’t stop Josh – he’d just get a mod for it.

  15. Martin says:


    (This is a bit of an optical illusion. I'm not 200 meters tall, I'm just flying way up in the air.)

    An exploring game where you can eat cake to grow or drink a potion to shrink… That would have been fun (and the source for that is now in the public domain…)

    1. Daemian Lucifer says:

      In madness returns,you can basically shrink at will once you encounter the potion.And in one level,you get to eat the cake and become gargantuan.

      1. Aldowyn says:

        well, that IS based on alice in wonderland, so that’s almost kind of to be expected

    2. Adam F says:

      I figured he was just trolling all the “your character looks too small relative to his environment” folks.

  16. DaMunky89 says:

    Whoa, whoa, whoa.
    That is A LOT of features just out of nowhere. Things I would have thought are complicated to do, even being an amateur programmer myself. Vertex shaders do some really incredible things.

    And as a huge fan of procedural world generation, this project really strikes a chord with me.

    You are unstoppable, good sir! I tip my hat to you.

  17. Daemian Lucifer says:

    A bit unrelated,but its been floating in my mind for a while now:Did you try terraria by any chance?And on that note,did you consider dabbling in 2d?It would be easier to actually complete the game that way.

  18. Eltanin says:

    Eeeek! “We're getting near the end now.” That is the worst thing you could possibly have said. Don’t stop! Yeah yeah, demo, improve the world, etc. etc. Ok, cool. But don’t you think that your point about procedural content would be even MORE powerful if you…continued to dazzle and entertain us while pushing forward with the project? For years. Yes, yes, that’s what we need.

    More Project Frontier.

    To be completely serious, I say all of this because I have truly been enjoying the series. It has been an absolute delight. Even with the art trolls. As ever, thank you Shamus.

    1. Fat Tony says:

      I second this motion

      1. benjamin says:

        me too, please don’t let us down!

        1. Aldowyn says:

          I think I can safely say that pretttty much everyone here doesn’t want you to stop now that the “tech demo” is almost done :)

      2. Isy says:

        I wanted to say I also have been enraptured by this project, and this is coming from someone who can’t understand a word of the tech talk. Obviously there are other things you might put priority on (like something you’d get paid for), but I can’t stress how much I’ve enjoyed this.

  19. Phoenix says:

    I always thought the same about procedural techniques. Nice work.

  20. Scrub Ninja says:

    When the sun has set and you have no moon, wouldn’t it be more useful to have the light become ambient/directionless? I think as soon as you implement shadows, your trick of having the light source on the eastern horizon during the night is going to make things look weird.

    I love the sun-angle trick you’re doing around noon, though again, I wonder if shadows will make the speed change after midday too noticeable.

  21. Potado says:

    I could bug you some more to do shadows next, but I won’t.

  22. I just thought of an interesting way to turn this into a game using just what you have currently–exploit the bugs you created. Every so often the system will intentionally insert a bug. Your job, as the player, is to go out, find the bug, then report the location to the world manager, who fixes the bug.

    It’d be goofy and meta and probably a lot of fun. You could do a lot of oddball things with it, too.

    1. Aldowyn says:

      The problem with that is what happens when the player finds a REAL bug?

      1. Michael says:

        That appears to be what she’s suggesting.

        “…exploit the bugs you have created… system will intentionally insert a bug.”

        1. Aldowyn says:

          Yeah, but if it’s a real bug, the game can’t fix it, because it’s broken.

          *edit* Maybe the game can say “Oops! That may be a real bug! If you are convinced that this is a bug, please report this bug (link) here!”

          1. Michael says:

            Yeah, sorry, if I had understood you meant an undocumented bug, I would have responded with something similar.

            I don’t think an entire game about that would hold water, but as a diversion, I’d enjoy it.

            “Hmm.. I’ve done a good job saving the world and all, but what I really want to do now is to see some groovy graphical glitches!”

            1. Alexander The 1st says:

              Sidequests!

              Minecraft would be so much better if it had started out with this.

              “Right, so since this is an alpha/beta, if you find any bugs that I haven’t intentionally got the game to insert in, and as such it won’t fix it, then report it to me, and if it hasn’t already been reported, then I’ll give you 9999 of an item of your choice.”

              I mean, right now, it IS a Beta…if all Alphas/Betas did this, you’d bet there would be a LOT of unique bugs being found.

              Plus, the developer gets to intentionally force in bugs that, when reported, the game automatically just does a re-build of the software and says “That was a Red Herring. Try harder.”

    2. Syal says:

      Sounds like a silly sidequest more than a whole game.

      Actually, that’s an idea; somebody’s hacked the game, and it’s up to you to stop them! You have to guide Administrators across a world growing steadily buggier, and protect them as they seal the holes the hacker’s gotten through.

      Puzzles would be “How do you get across the river when the bridge glitches out”, that sort of thing; make people go exploring to find alternate routes. Then kill them with insanely overpowered mosquitos.

      1. Chargone says:

        sooo… the plot is like a demented .hack// game with the gameplay actually making sense given the objective rather than being random monster bashing? :D

        1. decius says:

          +1 awesome idea.

  23. Elilupe says:

    I was thinking about procedural stuff a little while ago, and I started to wonder whether a skilled programmer could possibly make a system to create procedurally generated in-game people, all with different procedurally generated personalities and looks. This could be used in a game maybe somewhat similar to the Fable series, with the populations of towns being filled with these procedural people. This may be a stupid question, since i’m not exactly a programmer myself, and don’t know the limitations of procedural content, but I just thought this was a cool idea.

    1. Aldowyn says:

      Personalities – Dwarf Fortress

      Looks – not that hard.

      Could definitely be done. Now I want a completely procedurally-generated town, full of people going about their daily lives Oblivion-style.

      Dang. If I could program worth anything (probably going to take computer science classes in college, possibly even as a minor), I would do that.

      1. Eric says:

        Now I want a completely procedurally-generated town, full of people going about their daily lives Oblivion-style.

        Why would anyone want to watch people rake their carpets and talk about mudcrabs?

        1. Aldowyn says:

          I didn’t say JUST like Oblivion. I mean the way Oblivion CLAIMS to be.

          1. Michael says:

            I think you could have just left off the “Oblivion-style” bit, then

            Because “Now I want a completely procedurally-generated town, full of people going about their daily lives.” says exactly what you meant.

            1. Aldowyn says:

              … Yeah, I guess it does, doesn’t it? I like to tack on examples, I suppose.

            2. Alexander The 1st says:

              Procedurally-generated Legend of Zelda: Majora’s Mask?

              Do want.

    2. Christopher M says:

      Workin’ on it!

      The prime puzzle to be solved with such a system is simulation time – you don’t want to have something that will impact the real-time performance of the game. Obviously, a multithreaded system will help here. But something modular/flyweight will be necessary in almost any solution.

      Basically, give each person three things: A set of jobs (EG locational patterns; tell him where to go to work/eat/buy stuff/sleep), a set of personality traits (EG trustworthy, greedy, violent, etc.) to tell him how to respond to situations, and a set of relations (These relating to people (likes, dislikes, is son of, is friend/enemy of, etc.), things (likes certain food), and topics (knows about X/Y/Z)).

      He goes about his daily life in a node-based traversal, moving from point to point within his job cycle each day, addressing needs and wants as they come up (for instance, buying a new chair), and interacting with other entities that happen to be in the same node. He could with minimal simulation say hello to a good friend, tell the player about a topic he knows by heart, or know to move into a combat stance upon catching a glimpse of his worst enemy.

      If you further abstract the simulation such that his actions are calculated only once every few minutes (less if he’s nowhere near the player) on a non-primary core, it is quite possible to simulate thousands of actors/people in real-time.

    3. Daemian Lucifer says:

      That would fall more in the realm of ai.Making people have various personalities is not that hard.Making them react to their surroundings in believable ways is.Which is why I hate monolith for not focusing on that aspect of fear,instead of the cheap horror “story” they tried to pull off.And which is why I hate everyone else for not emulating and improving that ai.

  24. Fat Tony says:

    Oh yeah Shamus I keep getting horrible spammy ads on your site like I just got:

    HI! YOUR MY 10,000th VISITOR, YOU WIN A PRIZE

    you have xx Seconds left to claim it.

    http://imageshack.us/photo/my-images/64/adsa.png/

    (Oh yeah it’s also funny ’cause it’s trying to dart around the screen but since it’s not a pop up it’s confined to your ad space so it’s just twitching weirdly)

    ANYWAY.
    Is there a way you can clear this up or is it (the problem) on my end?

    1. Retsam says:

      Not an expert on this, but I’m almost positive that that’s something on your end. Shamus has mentioned before that he doesn’t do this sort of stuff. Have you run a check for viruses or spyware recently?

  25. Kian says:

    Is there any reason you don’t use a sky map for the stars? It seems like that’s the generally accepted way of handling it.

    1. MichaelG says:

      You really need a high resolution texture if you are going to do the entire sky in one image. Even 2K by 2K leaves some pretty blurry stars when you are fullscreen.

      That’s why I did lots of little patches. They are all the same image, so I don’t use up a lot of display memory, but with random rotation and reflection, your eye can’t spot that they are all the same.

      1. Adam F says:

        I’ve never done anything even remotely like this, but it seems odd to me that you need to make the night sky an image. Is there really no way just to tell the computer to display points of light at defined coordinates on a sphere centered around the player? I guess “vector based” rather than “pixel based” is what I am trying to get at. But maybe that’s computationally difficult or somesuch.

        1. WJS says:

          That’s probably the way I’d go myself; a few thousand particles with no movement, physics or overlapping? That should be a trivial load on pretty much any system in existence, surely?

  26. Octal says:

    This shape is sub-optimal, because you can see the foreshortening on the stars.

    Is that easier to do than a hemisphere? If you had a hemisphere where the player was at the center of the sphere it was half of, then all the stars would be an equal distance away.

    Amazingly, bush #3 ““ which to my eye looks the best ““ doesn't look significantly better than the others in-game. Bush #4, which looks stupid and horrible on the texture, doesn't look half bad within the game. Bush #1 is actually the best of the bunch.

    Oh oh oh! I think it’s because bush #3 has broad leaves that are clearly in a different plane than the planes that the bush is actually in. I mean, the texture is on two planes that go straight up and down at right angles to each other, but if you were looking at an actual bush like that the leaves would be in planes that are more angled towards the ground, and at all kinds of different angles around the trunk. And they would be loosely layered over each other, too–they would move past each other in wind, and when you went around it you’d see different leaves being uncovered or hidden by other leaves. That kind of bush has a lot of obvious volume, I think, and a lot of moving parts, which makes it especially artificial-looking in this kind of setup.

    On the other hand, I’m not surprised that bush #1 would look the best. It has narrow, spiky leaves… true, those kind of leaves wouldn’t actually be in a straight up-and-down plane, but they kind of look like they could be. They wouldn’t look as strange when seen at an angle, either.

    1. Octal says:

      Oh… I wonder how it would look if you made a bush like #3, but making use of the “flowers” triangles for some of the leaves and making the leaves on the vertical planes much sparser? I honestly think that would make it look more “layered” (and like the grass, it would probably look best in groups).

      It would probably work even better if you had it grow two bushes from the same point, one smaller and inside the other (or maybe shorter, but wider) and at a different angle, but I’m guessing that would require changing the program a bit, and of course it would double the bushes’ polygons.

      That’s just an idea, though; I’m not sure that it would look good… but it would be neat if you could make that type of bush without it looking like piles of rocks.

    2. Piflik says:

      Is that easier to do than a hemisphere?

      It is above all easier to map than a hemisphere. It is impossible to put a texture on a sphere without heavy distortion or many many seams. With Shamus’ star-mesh tt problem is a bit lessened.

      1. Abnaxis says:

        Huh, I wonder…Put a hemisphere with the central ring taken out, and put a moon in the hole with some lighting. I wonder how that would work…

      2. Octal says:

        Oh, I see what you mean, I guess. When I pictured mapping it to a sphere, what I was actually picturing was mapping a whole bunch of textures to polygons making up an approximate sphere. I just didn’t think about that being something different.

        It seems like the seams would be invisible in this case, though, since most of the star texture is transparent (if I understand what Shamus is saying up there correctly). If you could have all the stars inside a shape like this and avoid having any on the edges… or can you do that?

      3. WJS says:

        While that’s true, distorting a texture to fit a sphere is basically a Solved Problem, as is distorting it to fit a cube. Fitting a non-planar yet non-spherical shape like Shamus is using? Yeah, good luck with that.

    3. decius says:

      I figured that the way to solve that problem is to distort the texture. That might require a more complicated/larger/higher resolution texture.

      Or render a mostly-transparent box between the terrain and the skycone. Done perfectly, the brightness of the cone will wash out the stars, making them rendered but not visible… until the skycone fades to black.

    4. Kdansky says:

      I was about to point that out. A sphere or box around the player’s viewpoint, with a disabled z-buffer works nicely. I’m sure you have heard of Skyboxes? You don’t want it to be of any relevant size, or else you end up with the stars moving when you walk around, like any other landscape. But as they are billions of kilometers away, that’s wrong.

      As for the sun: There is no need to put the sun at a realistic position. Just render it three inches away from the players face, without z-buffering and first (so everything obstructs it), and make it smaller. That way, you can use small textures for giant things.

  27. Irridium says:

    Well, hopefully those Infinity/I-Novae dudes can finish their engine. Maybe then we’ll get more procedural games. Or at least get more people interested in procedural stuff.

    I say continue with this. Who knows where it might end up!

  28. Aldowyn says:

    Hey hey hey! You keep saying this is a tech demo…

    Go show it to James Portnow and the Extra Credits crew. He’s starting that fund for indie games, and since this game has undeniable potential and is certainly the kind of thing he’s looking for… GO FOR IT.

    And he probably wouldn’t mind at all you continuing the series, so that’s a plus, for us certainly! :)

    1. Fat Tony says:

      This, THIS, do this. It’s a much better idea than “Just keep applying more Shamus till awesome occurs(which is what I basically meant a few comments above)

  29. JPH says:

    “Artistic myopia can kill a budget faster than anything else.”

    Nah, I’d say Obsidian Entertainment can kill a budget much faster.

  30. bassdrum says:

    You say that the silhouette is just placeholder art… but honestly, it looks to me like just about exactly what I’d want from a character model in this project. If you just textured that stand-in, I feel like it would look pretty solid (of course, this means that I’ll be interested to see what ends up replacing and (hopefully) improving upon it).

  31. Stephanie says:

    20 minute day night cycle?

    1. Gndwyn says:

      Minecraft’s is 10 minutes (and I wish it were 20, especially now that you have beds). Of course it really depends on what’s going on in the game whether that’s too long, too short, or just right.

      1. Aldowyn says:

        according to the wiki, it is also 20 minutes.

  32. Adam F says:

    I think it’s interesting that your description of the method for displaying stars sounds so much like the ancient view of the heavens being a tent or canopy stretched out over the sky. My guess is that back then the universe was running on less advanced equipment, and they didn’t have the processing power to do a full 3D setup for the stars.

  33. Blake says:

    I second, (or is it third now?) the motion for you to apply to Mr. Portnow’s indie game fund. Shamus Young could be the next Notch! That’d kill any nightmares of Cubicles for a good long while.

    Just a decent narrative (likely not a problem for you) and a cool business name.

    Twenty Sided Games is probably taken. Frontier Media? Nitpick Games? ScrewyouRustkarnyouhorribletroll media?

    EDIT – Dude, That world you just built could totally be Mar Tesaro (pardon if I misspelled that). Just slap down a mountain you can see from anywhere and call it Foire! Tell me that doesn’t have a nice synergy to it!

  34. Jordi says:

    This is looking better and better. I have to say though, I really prefer the old style of explaining everything you did in much more detail. This post felt a little rushed, and I think it’s a shame, because normally you explain things so well. You describe how you did these nifty things with vertex shaders (what are they, and why do they apparently not make shadows?), but don’t really go in depth as I think you normally would.

    I get that you have only limited time, and that you should just do what you want and like best. Hopefully you don’t mind getting this feedback from one selfish guy in your audience who wants “the internet” to provide exactly the free entertainment (and education) he wants.

    Anyway, I’m looking forward to seeing where this will go next, and thanks for doing this!

    1. Shamus says:

      Yeah, it was rushed. I’m in a bit of a bind here. I’d prefer to write in more detail. But the longer I wait between doing the thing and writing about it, the less I’ll have to say. (And the harder it will be to get meaningful screenshots.) So I nned to follow the work with a post. But it wouldn’t make sense to delay the work to write a post, and… you can see how this goes.

      1. Actually it depends on your goals. If you want both to showcase your own talents and to make the case for procedural content, it is not enough to produce a thing—it is at least as important that you show how the thing was produced. Stopping work to produce a post means disseminating your work at a deeper level than just wow, that looks cool. Which makes all kinds of sense.

        Oh, and wow, that looks cool!

  35. Gndwyn says:

    Regarding how great the wind works, Titan Quest has this thing where the grass waves and parts as you walk through it. It’s just a little animation effect on some sprites, but it is amazingly effective and beautiful. (Titan Quest also has some of the most beautiful sunrise/sunset lighting in any game ever.)

    Regarding this being just a tech demo, Shamus if that happens you are just leaving a pile of money on the table and walking away. I’d give you at least $10 right now just to wander around exploring in what you’ve created so far (partly because I feel like I owe you that much for the all the free entertainment to date).

    1. Michael says:

      Yeah, and I’m pretty sure Silhouette Man already has more personality than most Bethesda characters.

      If this does get developed into a game, I would buy it. I would buy it so hard.

      1. Topaz Wolf says:

        I too would consider putting money down on this project if it came in an interactive form (if not a game than at least a proof of concept simulator).

    2. Zagzag says:

      I have to agree that I would pay for just what you have put together so far… Please don’t stop making this, as the finiancial implications are not to be underestimated.

    3. decius says:

      I think Titan Quest has polygonal grass, not sprites. The lighting and terrain, however, is pretty.

  36. Traagen says:

    I’ve been thinking about the pop-in problem of things like mountains for a while now. I haven’t really sat down and designed something so it’s still just an idea floating around in my head:

    The world is a giant height map and you know where you are in that world. Would it be possible to dynamically generate an outline of the highest points along the horizon? Having done it, I know that you can render to texture pretty easily. How expensive would it be to find the upcoming high points on the height map in the direction you are facing and then paint an outline onto a billboard? All you’d really need is for it to be reasonably coloured, probably similar to how you’re already doing it, but without all the detail. Now you can display that billboard when the mountain is too far away and fade it out when the actual terrain pops in.

    I think this is workable in concept. I can picture generally what the code would look like building it serially on the CPU. But I don’t think that would be anywhere near fast enough to keep up with you moving, even if it didn’t need to necessarily update every frame. Could it be done in shaders? What would you input? What would the shader look like? How could you do this in parallel? You’d essentially need to set every pixel of the texture without depending on anything else.

    If you could figure out how to do this, I think it would be fun to explore cell shading or Gooch shading (look up Bruce and Amy Gooch for more details. I don’t have a link handy, although they are professors at the University of Victoria).

  37. Jonathan says:

    Sun-wise, you could always pretend that your island is midway between the equator & artic (or antarctic) circle, and have the light source travel slightly south (or north) instead of being directly overhead.

    There are shadows even at noon in Texas on a 108* day. Recent experience verifies that this is still the case.

    1. decius says:

      For added coolness, allow for the elevation of the sun/lightsource to vary with seasons and with location.

  38. Odoylerules360 says:

    I was really hoping you’d get around to ‘animating’ the trees and grass! The Witcher 2 did that with everything, and it looks amazing!

  39. X2-Eliah says:

    Hm, sounds and looks pretty good, massive step-up from before ;)

    I wonder, do you animate creaking/swaying branches too or just the foliage? (also, can’t wait for the vid want to see it in action).

    Random thought – do you have any other indicator of ‘wind presence’? like samll untextured/monochrome ‘dust’ bits flying across screen a bit when it is windy, in the direction of wind.

  40. sab says:

    That silhouette guy could use some texture. By the way, monochrome as in VGA monochrome, bringing all kinds of (about 256) beautiful grey shades, or your garden variety black & green?

  41. Vekni says:

    Here’s a vaguely related procedural question:procedurally created dungeons. Obviously they exist, but they’re generally pretty basic crude flat and angular. Perhaps a massive set of prebuilt pieces each with rules to how/what they can and cannot connect to, sliding scale for frequency of certain things, etc….maybe a way to put in basic puzzles procedurally.

    1. Aldowyn says:

      Dungeons are kind of hard to do anyway :/

      I would love to see a well-done system, though I think expecting a way to make procedural puzzles is a little too ambitious.

      *edit* Correction: A way to make procedural puzzles worth making is a little too ambitious.

      1. Adam P says:

        Someone in another one of Shamus’ posts linked this, which is a procedural dungeon project: http://www.squidi.net/mapmaker/index.php

        It’s a 2D project, which I can only assume means much more work to make a 3D dungeon space. I would also assume that such a feat would just be all sorts of awesome.

        1. Vekni says:

          Yeah, I was thinking 3d. It’s only been oh 15 years now I’ve had an imaginary tinkering in my head with the concept of a science fantasy multiplayer FPS procedurally dungeon crawler. Diablo with Quake, basically.

    2. Slothful says:

      SPELUNKY.

      That is all.

      1. asterismW says:

        Now that would be interesting: caves. Caves with glittering jewels, bioluminescent plants, interesting rock formations, subterranean pools, etc.

    3. Andrew says:

      … Roguelikes?

  42. Sucal says:

    Can you even lift such a monitor… heck why do you still even have it around?

  43. Zak McKracken says:

    Hmm… the sun cycle seems a bit weird to me … wouldn’t it be more realistic to have the light direction always follow the sun, but fade it out (and change colour) as it comes near the horizon? During the night you probably have some other light setup, so that would be a nice opportunity to fade that in. And about direct sunlight from straight above: That would only happen if you’re exactly at the equator, so the sun doesn’t have to go through the zenith in the first place, and when it does, the light might as well follow. Because in real life, it also does :) Or you just decide that your island isn’t at the equator, end of story.

    Regarding the star texture: What prevents you from using a spherical shape to project the star texure on? While looking at the stars, though I had another idea: The “blanket with air” shape you used might actually be a very very good canvas for clouds, because with clouds, you actually do have this perspective effect …

    The shrubbery (I just love that word!) looks very good, though, except at very close distance. With the grass, it was kind of OK, but since the bushes are larger, they also come closer to the viewpoint, so … maybe the detail level for the intermediate trees could be applied there? Actually, wouldn’t that be cool*? You have three ways of displaying stuff. Grass only uses the first, schrubbery the first two, depending on distance, and trees go through all three of them.

    * yeah, so I like my own idea, big news!

    1. Shamus says:

      1) “some other lighting setup” would still be a directional light. No directional light might be realistic, but it looks flat and horrible.

      2) Mapping a square texture on a round surface is even worse than what I’m doing now.

      3) I COULD do LOD for bushes, but that would mean re-writing them.

      1. decius says:

        Is there any good way to portray how dark it gets at night? Maybe play with saturation values so that colors are no longer visible?

        Bright lights (fires, fireballs) at night might be the only correct place to use garish bloom effects that blind the player.

        1. X2-Eliah says:

          This reminds me of GTA4 and how *everything* besides sunny weather made all colours drain and the picture to go greyscale.

          Please don’t. Dark != colourless, especially in non-realistic anti-‘omg teh grphixzorz r all’ game.

    2. Brejlounek says:

      “Mapping a square texture on a round surface is even worse than what I'm doing now.”

      Why do you think so? I mean, sure, if you would map it on a half-sphere using flat/plane projection, it would look bad. But if you would map uv values through angluar values… I think it would end up much better than the recent approach. Which I find quite similar to sphere solution, i think.

  44. Blake says:

    “The point I want to make is that procedural techniques can allow one guy to accomplish in two months what a large team can accomplish in half a year. Hopefully I've made my case. We'll see once the video is out.”

    I’m sure you will’ve made the case, hopefully everyone will listen.

    The way I see it procedural generation is the only kind that makes sense going forward. It scales far far better than having people create anything and as new hardware comes out you just turn a few integers up and BAM suddenly it’s updated to be ‘next gen’ graphics.

    I really look forward to exploring your world, it’s looking amazing.

  45. Jarenth says:

    So who would win in a fight? Silhouette Guy or Fonzie the Stickman?

    Fonzie has those sharp edges going for him, but I assume Silhoutte’s pitch-black colour gives him some serious stealth benefits at night.

    1. Sumanai says:

      So it all comes down to the Stealth Critical Modifier.

  46. Mr. Placeholder Art, eh? Interesting character concept.

  47. Martin says:

    Between this (really good looking, especially from a certain distance) and PixelCity, made to be seen from the air (at night, I know), there could be a nice blimp or hot air balloon simulator…

  48. JasonD says:

    The sun is rarely “directly overhead” at noon, except near the equator. It is highest in the sky at noon, but the angle is still a few degrees below 90, depending on your distance from the equator, and the season.

    Like the north-pole… There is months of night-time, as the sun simply runs around the horizon, then months of day-light as it runs around the horizon, but higher in the sky.

    Pick a side-angle, and keep that as your suns “noon”. You just move the sun to the south-side of the island. Never making it directly above. Whatever angle you like best, for noon, that becomes the world’s maximum noon angle. Also note… The sun should appear to move faster as it approaches the horizon. In a flat-world, unless you set the globe-center at -9999999999999999.1 feet below 0,0,0… the day/night will never look right.

    Also… The sky gets light, about 2 hours before it rises, and has set… Actual visual-sighting of the sun, is about 33% of a day-cycle, while light is about 70% of the day-cycle. (Shorten that light on non-cloudy days, and extend that on overcast days.)

    Also… Overcast days do not have sun-shadows, only ambient occulsion. Clear-skies make sharp shadows.

    For better effects… play with color-balance. Use light to provide the bright colors, not paint-shop. The world is dull…

    For more realistic shades… without actual shaders… Force NORMALS coloring, so the color is significant to the shade on the ground, from where the plant rises. Further, plants under trees would have normals darkened by the ambient tree shade.

    Even more realism… Grass and under-growth is less under trees. They WAX the ground, making it waterproof, and ambient-shade limits growth below. Use a negative-scale or a suppress/remove code to pull those items out from under trees. Might also want to bump-up the land, since roots swell under the ground.

    Hmmm… Thinking of more…

    I think coloring normals, and only using a specular-map, as opposed to a normal-map, is less intensive on the rendering. Distant objects would only be colored and shaded, while specular highlights brighten things like leaf-detail and trunk-detail, without forcing unnatural hand-drawn shades in normal-maps. (Not good for the ground though.)

  49. Jsor says:

    Did you ever consider writing an instructional book on the sort of game engine development you do? I understand that you’re holding out for an industry position, but I think anything you write could become a standard.

    Most tutorials out there, as you’ve noted before, are terrible, atrocious messes. Either the code is obtuse and unintentionally obfuscated, or they explain everything terribly (they make 16 gl calls and explain what one of them does, or explain what the code block does but don’t introduce the functions). Most internet tutorials are either atrocious tutorials or else an excellent, brilliant tutorial from 1996.

    I think your knowledge and “indie-game bent” (since I think that’s what most consumers of these books are looking for — to make their own projects) could be paired with one of your mini-projects and make an excellent tutorial book. I can’t imagine it would look too bad to an employer either.

Thanks for joining the discussion. Be nice, don't post angry, and enjoy yourself. This is supposed to be fun. Your email address will not be published. Required fields are marked*

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>

Leave a Reply to hewhosaysfish Cancel reply

Your email address will not be published.