Hey everyone, I don't normally show my experimental work, but Zervox inspired me after seeing and talking with him about his cool
terrain generator he posted the other day using the
noise++ library.
I haven't been using Esenthel much for the past year or so, but over the Christmas break I decided to download the latest version and brush up my skills again as I'm thinking of getting back into Esenthel development one day. I had a full week up my sleeves and needed a small project I could work on for a bit of fun. Coincidentally, I chose to work on a terrain generator using the noise++ library (which Zervox introduced me to a while ago).
I got a bit carried away having fun and ended up building something bigger than I originally planned. I didn't get it all finished within the week, so I spent an extra day finishing some things off, fixing bugs and polishing it further so I could post these screen shots. I'm not planning on spending any more time on the project, and since I have no real need for a terrain generator at the moment, I'll be shelving it for now.
The tool uses a flow graph approach, which you drop modules (from a right click menu) on to and drag lines to connect them up. The flow graph (and its modules) can be resized and dragged, so you can create pretty big flow graphs. I ended up making the system pluggable, so each module is actually a DLL plugin. This makes it possible for anyone to write their own module plugins for the tool by including a single header file in Visual Studio (or the Esenthel Code Editor if you use that) and compiling a DLL. You then drop the DLL file into the tool's plugins folder and it will detect and load your plugin. The plugin system made it easy to convert all the noise++ modules to DLL plugins. I even ended up adding some new plugins as well that are not part of noise++, such as erosion, perturbation, averaging, and some other experimental ones just for fun.
I've multi-threaded pretty much everything than can be. The terrain changes as you adjust the flow graph and the individual properties on the modules, so experimenting to come up with interesting terrains is kind of fun. I've got code in there to manually adjust the terrain too, i.e. raise/lower/smooth/etc, however I don't have any gui controls for that stuff at the moment. You can export your finished heightmap out and you can also save/load your flow graph too. I have designed the whole thing so the core flow graph engine could be exposed as a stand-alone library (or DLL) that can be included in other projects. Then you could load a flow graph into it (that you previously designed) and actually generate procedural terrain in real-time within your project.
The terrain materials are just hardcoded at the moment. Please excuse my quick choice of poor terrain materials. I had plans of allowing them to be changed and to set the slope and altitude of each one to apply to the terrain. However this feature was low priority since the primary purpose of the tool is to generate interesting heightmaps using stateless math. I'm also missing some gui controls to allow the size, scale and resolution of the heightmap and terrain to be adjusted. So that stuff is hardcoded too at the moment, but that would be pretty easy to fix.
There are a few known issues. Such as problems with the gui that I can't fix relating to dragging the flow graph due to the way Esenthel windows handle the right mouse button and window resizing. Also, the terrain area mesh rebuilding is a bottle-neck that I can't do anything about unfortunately. Esenthel also doesn't use tri-planer terrain mapping, so you can end up with some crazy texture stretching on cliffs (the last screen shot demonstrates that pretty well).
Anyway, I had a lot of fun working on this little project. Thanks again to Zervox for introducing me to the noise++ library and thanks to Greg for Esenthel, one of the best game engines I've worked with.
I hope you guys enjoy the screen shots.
Some typical ridged multi noise, with a terrace applied to it.
The same ridged multi noise, but this time I've eroded it for a couple of thousand years.
The terrain's mesh LOD makes it look a bit funny from a distance, but compare the heightmaps in the top right corner between this shot and the previous one to see how erosion affects the terrain.
And here is the same ridged multi noise again, but with a bit of scaling to give it a canyon look.
Here is a more complex flow graph. Just drop some better textures on it, with some grass, rocks and trees and you've got a nice terrain for an RPG.
Here's some voronoi noise mixed with some ridged multi noise to create a sand like terrain with some strange rock formations. Again, better material choices would bring this scene to life more. However I just wanted to demonstrate how different terrain features can be blended together.
Finally, here is a custom module plugin I threw together to create a weird effect. I'll leave you with that one.