
MAKE linked to my terrain project and since then a few people have expressed interest in the code. I’m not sure why this is catching on now. I tried putting the story on digg a few days ago and it was more or less ignored. Go figure.
Anyway, I’ll go over the project and will probably be releasing the code this weekend. If anyone else is interested, just drop a note in the comments. Thanks.
UPDATE 2/25/2006: I have now released the source code.
The Best of 2019

I called 2019 "The Year of corporate Dystopia". Here is a list of the games I thought were interesting or worth talking about that year.
Batman: Arkham City

A look back at one of my favorite games. The gameplay was stellar, but the underlying story was clumsy and oddly constructed.
Hardware Review

So what happens when a SOFTWARE engineer tries to review hardware? This. This happens.
PC Hardware is Toast

This is why shopping for graphics cards is so stupid and miserable.
What is Piracy?

It seems like a simple question, but it turns out everyone has a different idea of right and wrong in the digital world.
Awesome read from start to finish! Thanks for sharing. Even as a non-coder, I found it very stimulating.
I’ll forward the URL to my coding friends. I’m sure they’ll get more out of it than I did.
Yep, another Make viewer here.
Your thought process thru each step is tight and logical.
That’s a very high-quality tut, and makes captivating reading..
..a big “Bring It On!” for a Google paid authoring system!!
(yeah, and a GooPay system would be neat too ;O)
Sure, any code would be great. Particularly the early poly stuff.
Thankyou for the presentation and ideas Shamus.
Are you ever going to release the source code for this under an open source license?
This was really interesting to read. I have always been interested in programming in 3D, and your documentation of building a 3D engine was a very good general introduction to this. I hope you elaborate on (and document) your current engine at some point in the future.
That’s an *awesome* tutorial, the most engaging one I’ve ever read. Thanks!
Hy.
It’s really nice that you showed us the step by step process of building a 3d engine. Now i’m starting to understand just how hard it is to make a game engine, specially one that works well on older systems too.
I’d like to see the source code, and as somebody else said before, a GNU or other type of open source system would be the nicest way to go.
BTW, if you do post the source, and you still have the older versions, it would be nice to see also the code in it’s different stages, to see just how each modification you’ve documented is reflected in the code (i believe a lot of people would learn quite a few things from it).
Thanx for the documentation, it was really fun to read it.
Very nice walkthrough. As a programmer, I saw alot of the issues you had comming, but then I’m sure you did too :). I’d be interested to know more about the excess polygons on the corners of your ramp example and what the bug was leading up to this. Was it that you were classifying the edge of the map as a elevation change perhaps?
I do very little graphics programming and would be interested in doing something like this and documenting it … Reminds me of a “geek night” a friend of mine and I used to have in which we’d explore differient ways to solve problems, usually graphics in nature. We wrote a neat-o flame generator in an evening. Nothing nearly this complex, but fun none the less.
Anyway, thanks again.
Oh, BTW, you’ve been metafiltered … Probably explains the increase in traffic.
http://metafilter.com
I'd be interested to know more about the excess polygons on the corners of your ramp example and what the bug was leading up to this. Was it that you were classifying the edge of the map as a elevation change perhaps?
Wow. I never expected so much interested in the code at all, much less the interest in the old, buggier versions of it. Let me think:
The ramp stuff was a few weeks ago, but if I remember right there were several problems that led to excess polygons on the edges:
1. My input data was a bit “jaggy”. I was smoothing it so I didn’t have thousands of little pitcher’s mounds everywhere. This smoothing was not being done along the edges, which made them more jagged than the rest of the terrain.
2. When comparing elevations (like: hey, are these two points very far apart vertically?) I was incorrectly wrapping the values, so that the points near one edge were being compared to the elevations of points on the opposite side of the map. My first map tiled (the edges matched) so I didn’t notice this until later in the project when I started using a different input image for the terrain.
3. The “east” and “south” edges of the terrain were not being cleared between updates. So, once one of those edge points was marked “this point is important and should be included in the final mesh”, it would forever stay in use. If you moved far away from that edge, it would retain its high level of detail.
4. At one point I messed up the image used to generate the terrain. I had a little black line on the edge of the image, which made this cliff. You can see this in action in Part 6, in the second section where I lower the polygon count. Notice how the distant corner of the map seems to retain a lot of detail compared to the other parts? On the back side of that hill is a deep gouge / cliff that pushed the local level of detail higher than it should be.
If you have the interim code steps I think it would be a great companion piece to your already great writeup. I’m an engineer, some programming experience but I’m not a programmer, and looking over completed source code doesn’t do much for me. Being able to see WHY a change was made would be incredibly useful.
Sadly, I did not make incremental code backups. The final source should be available later today.
And so it is. You can now get the source.
And now that this thread has expanded above twelve entries…
I am wondering how high my dice-rolling script goes. I forget. When I wrote it, I didn’t expect to get a dozen comments on just one post. Hmmmm…. I better check into that.
Hee-hee! “Didn’t expect to get a dozen comments on one post”? That’s hilarious in hindsight, considering that once the site took off, some posts got hundreds.
Great walkthrough!
Just a thanks for making the material available to us and a general “hey – I read this too” shout.
Now that was a very nice go-thru of many of the problems in terrain rendering and potential solutions; very informative and educational indeed. I doubt if I have ever read anything better on this subject and from the programmer’s prespective I give you my credits for making such a task look easy to the readers! Keep up the good work!
Hei ! Good work ! Compliments !!!
I started a similar project 2 years ago in Delphi …. now I use Torque for a new project !
I have download your source code for study and learn new features for my old project ….
Thanks for this work !
if you want visit my website ! ;-)
Bye
Andrea
Greetings,
Very interesting. I particularly liked your progressive analysis of the problem. When trying to access the download link to your terrain project, the link appears to be broken.
I would be most interested in having a look at the code details. Please advise.
Nice Work!
Mario
Whoops. Sorry about the broken download. Should be fixed now.
Thank you so much for giving something the community can actually grasp regarding such a complex subject. Your article makes one feel just about anybody can make a terrain editor. I’m curious, what was the total time spent in its creation?
Keep up the great work and I look forward to reading more of your insights and experiments.
thanks a lot for your tutorial. its very usefull for me.
Umm, Shamus its simply awesome!
Hi Shamus, as a person who regularly employs programmers for web based stuff it is interesting to see a view from someone the other side of the keyboard.
I suppose if I thought about it, I would realise that there were all kinds of tradeoffs, but this graduated view really shows what kinds of things you look at.
I guess the logical progression is for you to create a full computer game based on your terrain engine.
Seems reasonable…
Just wanted to say, as a programming student: this is awesome.
Wonderfull stuff dude. Anyone who is learning 3D game programming should go through your tutorial. You should publish a book. There’s a big lack of intermediate game programming tutorials.
Very nice!
You wouldn’t by chance be doing more of these types of things in the future?
It is a great learning tool!
Great stuff there, dude. I was looking for a terrain optimization algorithm for my engine and stumbled upon your blog accidentally, and found your project, with screenshots speaking more about its efficiency than mathematical formulas. I hope you don’t mind if I use your code as a reference implementation.