Hello world!
This is a new blogroll, obviously, but what we’re going for here is a community site geared towards programmers, gamers, and technophiles. Or just those curious about that sort of thing. We’ll generally cover a lot of different topics, from a lot of different people… but it’s all opinion, and open for discussion. We’d love to hear from you, so don’t hesitate to comment or shoot any of us an email.
So, let’s start things off with a bang, shall we?
First off, for those of you who don’t know me, my name is Luke Pederson and I’m a student at Full Sail University. Avid gamer and programmer. Lately I’ve gotten an itch for all things procedural (things which are generated with math rather than stored). So I wrote a terrain generator*. This uses a technique called Perlin Noise to generate a height map, which then is used to form dynamic geometry. In the current build, it’s all done on the CPU, which is expensive to generate, and near impossible to stream terrain generated from there.
From this generated terrain I took the height, and a pseudo-random variance to place textures on the different heights. So I have a smooth fade from grass to dirt to snow depending on how high the terrain is at a given location. I spent most of my time optimizing my code, making sure normal averaging wasn’t slow as mud, taking my generation code from about 6 separate double for loops to just two, and drawing the terrain as a single triangle strip rather than 80,000 triangles one at a time (it’s still 80,000 triangles, but the GPU just does it all now in one go).
So my goal from here is to make the terrain more varied and believable, give it virtually no limits, allow on-the-fly modification, and file output. The first bit means improving the texture mapping (taking into account slope, using more textures, etc), adding sprites so it’s more than just ground, and allowing for peaks, cliffs, and ravines. Virtually no limit is possible through streaming terrain, but as I said before, it’s currently generated on the CPU, which is slow for this. So this means exporting the generation to the graphics processor, having it generate the height maps, and then reducing the triangle count for far away geometry. On-the-fly modification means I’ll need to build an interface for my algorithm so I can create terrain more pertinent to a given situation. File output goes hand in hand with an interface, but show cases the power of procedurally generated content. A file telling my algorithm how to re-create a limitless terrain could be as small as a single kilobyte, probably much less. All I have to keep track of is my seed numbers (random numbers generated once to create new terrain from), my hard limits (height, change in height, cell size, etc), and any little tweaks I might make from the base algorithm.
So, as I start down this laundry list of features, I’ll chronicle my journey here, and hopefully I’ll be able to help those who try to follow in my footsteps, or use it as reference in the future.
* This may require the C++ Runtime (x86) to work and has not been tested on many machines.