Two more generated worlds
FractalGlobe-4.jpg
FractalGlobe-5.jpg
For my own enjoyment, I've been writing a piece of software to procedurally generate worlds.
The features so far:
Very loosely simulates tectonic faults
Generates fractal terrain (diamond square algorithm) that combines with the faults
Generates random island/continents (fractal radius)
Loosely Simulates river erosion (still needs improvement)
Simulates climate (based on latitude, earth-type prevailing winds, altitude, humidity, and proximity to ocean)
The project is written entirely from scratch in VB6 (no plugins, libraries, etc). It hasn't been optimized at all yet, so it takes a couple of minutes to run through the whole generation process. I have been very inspired by the Shamus Young's Terrain and Project Frontier blog entries (http://www.shamusyoung.com/twentysidedtale/?cat=66)
My wishlist
3D viewing (I have no experience with 3D programming or textures)
Zooming (generating a deterministic closeup of a particular region of a world map on the fly)
Near instantaneous world generation (probably impossible)
I'd like to hear your input on how the results looks so far, on what would be the most beneficial things to add to the simulation, etc.
Thanks,
Tim
Two more generated worlds
FractalGlobe-4.jpg
FractalGlobe-5.jpg
Visually they're fairly nice, if standard.
The maps won't work on a sphere, which is a problem for world maps. Since you're coding from scratch, if you can figure out how to generate your terrain on a sphere that would be an advantage. An alternative approach may to generate a continent at a time then place it on the world map reprojecting as appropriate.
I can see some arc-like artefacts in the topography.
A known issue of most random terrain generators is mountains being too central. If you can reproduce situations like the Andes where appropriate that would be great.
Regarding zooming in - I reckon if you basically use the world-scale elevation data to "seed" the fractal algorithm for generating more detailed stuff, that lets you add the detail deterministically without having to generate everything straight away.
I am a geology nerd.
I don't know how to make it wrap onto a sphere without transitioning the whole project to 3D. Which is something I'd like to do, but will require a steep learning curve first.
The arc-like artifacts are intentional (which doesn't mean they're correct). I designed the fault lines to follow a sine curve with amplitude that varies from straight to about a half of an "S" shape. If this is wrong, what would be a more plausible shape to use?
I can definitely do offset mountains as I am calculating the slope on each side of the fault separately. Any idea on how often this feature should appear?
I'm working on improving the fractal seeding with a scaling factor and depth.
Thank you for your great comments!
I could imagine using this! Maybe you should make it be able to export a wilbur MDR file? Just thought.
The first thing for making the map make sense on a sphere is to remember that for a rectangular map, the top and bottom lines are actually points (the North and South poles). Therefore, the entire top and bottom edges of the map need to be either all continent or all ocean.
Faults are usually great circles on a globe. They do indeed become sine waves on the map. I think it's rather that they're not normally so "crisp" on continents.
Major transform boundaries - where one side moves sideways with respect to the other - are not too common on continents. The San Andreas is the best known; others include some around Turkey and one through New Zealand.
I am a geology nerd.
eVile_eAgLe, I might consider it if there was really good documentation on the MDR file format. For now the project can save BMPs (and import them too, if you wanted to use it for the climate calcs and erosion simulation).
Taking a break from features in order to refactor the code and data to make it object oriented. I read a bunch about map projection equations, so hopefully I'll be able to address the wrapping issue soon.
I eagerly await the return of this!
The MDR file format is a simple format that consists of a 1024-byte header followed by a raster block of 32-bit floating-point samples. Byte order of all fields and data is Intel order (LSB first). The VC++ structure definition for the file header is shown below:
There is a problem with 32-bit MDR vs. 64-bit MDR files embodied in the pointers in the structure. There will likely be an offset from 32-bit vs 64-bit files.Code:// make sure we're aligned on 2-byte boundaries for this declaration #pragma pack(push) #pragma pack(2) // map structure definitions struct MDRHeader { union { struct { char Chunk[4]; // name of chunk - should be "WLBR" int Next; // offset in file to next data (unused) char Name[256]; // name associated with the data (unused) double Left; // min longitude double Right; // max longitude double Top; // max latitude double Bottom; // min latitude double Min; // lowest point on surface double Max; // highest point on surface double XRes; // distance between X points (right - left) / XSize double YRes; // distance between Y points (top - bottom) / YSize int Version; // version number (unused, should be 0) int TypeInfo; // type information (should always be 0) char SurfName[8]; // name of data block (unused) void** SurfData; // pointer to surface data (unused) char PicName[8]; // name of picture block (unused) void** PicData; // pointer to image data (unused) int XSize; // width of blocks int YSize; // height of blocks }; // struct struct { char Padding[1024]; // make the structure 1024 bytes long }; }; // union }; // MDRHeader #pragma pack(pop)