GeoGen - procedural heightmap generator - call for testing

GeoGen - procedural heightmap generator - call for testing

Postby mzabsky » 27 Oct 2014, 13:40

GeoGen is an open-source procedural height map generator. You feed it map script and it renders a height map. It is designed as a library that can be used in games and other visualisation software, but it's not quite ready to be included in other applications yet - I first need to throughly test that the compiler, virtual machine and renderer work properly (plus some required features like controlled memory management are missing for now), so for now the generator is called using an interactive console application.

This project is my master's thesis - I have submission deadline on 5th of December. All features that are in scope of the thesis are already implemented, so for now I'm looking to thoroughly test the whole thing.

Features:
  • Fully featured dynamic procedural scripting language - Supports most of the programming constructs you would expect from a programming language. Variables, functions, conditions, loops etc. are all in.
  • Powerful standard library - Includes ~60 graphical functions, including noise generators, various graphical primitives, combination functions, filters etc.
  • Cutouts and infinite maps - The generator can render arbitrary rectangular part of any map independently. This also brings the ability to render "infinite" maps, which can be rendered tile by tile (most maps that don't declare any "hardcoded" terrain features such as "this map has a lake in the center" end up being infinite). This of course allows for trivial multithreading.
  • Scaled renders - Any map can be rendered at various scales ranging from 10x zoomed in to 10x zoomed out. This can be used to render accurate and efficient previews or for level-of-detail (eg. in a 3D game, distant terrain can be generated with reduced detail level and as you approach it, that region can be re-generated with gradually greater detail level).

One of the main goals was to make the scripts as readable and as terse as possible. Example of a simple script, which renders a random terrain with 10 peaks randomly scattered throughout:

{l Code}: {l Select All Code}
metadata
{
   // This map is finite (infinite maps are not allowed to refer to width and height of the map at all). Maps are infinite by default.
   // If we wanted, we could restrict the map to a cerain range of allowed sizes, but that is not necessary for such simple script.
   Width: Finite,
   Height: Finite
}

// Create an empty height map with height 0. All the heights in GeoGen are in range <-1, 1>. 0 is a "base" level, often thought of as water level.
var map = HeightMap.Flat();

for (var i = 0; i < 10; i++)
{   
   // Random point within the map
   var position = [Random(0, Parameters.MapWidth), Random(0, Parameters.MapHeight)];

   // Creates a cone centered at the random position, with radius equal to one tenth of width of the map. Its height will be 0.5 at the peak and 0 at the rim.   
   var cone = HeightMap.RadialGradient(position, Parameters.MapWidth / 10, 0.6, 0);

   // Each peak is blurred a bit, to prevent any unnatural hard edges from getting into the resulting height map.
   cone.Blur(10);

   map.Add(cone);
}

// Add some random noise to the map. Don't bother to customize the noise here, that's more advanced topic :)
var noise = HeightMap.Noise();

// The range of heights in the noise is full <-1, 1> by default, we need to reduce that a bit to make the peaks stand out.
noise.Multiply(0.5);

map.Add(noise);

// Pass the map to the API.
yield map;


And sample map generated by this script:

Image

Not too impressive, but that's just several lines of code! See the gallery for more interesting images.

The download package includes interactive console application, scripting language reference and example scripts. For now, only Windows is supported (GCC support is one of the highest priority features that are outside of scope of the thesis).

Download (alternate mirror)
Scripting reference (also part of the download package)
Render gallery
Known issues
Source code (GPLv3, not looking for contributions right now)

I welcome any feedback - bug reports, typos in documentation, hard to understand documentation etc.
User avatar
mzabsky
 
Posts: 2
Joined: 27 Oct 2014, 11:29

Re: GeoGen - procedural heightmap generator - call for testi

Postby Julius » 29 Oct 2014, 18:58

Looks pretty cool. Simulated erosion would be a awesome feature.
“You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete” - Buckminster Fuller
User avatar
Julius
Community Moderator
 
Posts: 1862
Joined: 06 Dec 2009, 14:02

Re: GeoGen - procedural heightmap generator - call for testi

Postby mzabsky » 29 Oct 2014, 19:23

Julius {l Wrote}:Looks pretty cool. Simulated erosion would be a awesome feature.


I do have a sort-of working hydraulic/thermal erosion simulator implemented in previous generation of the project (it used canned Squirrel scripting language and lacked all the "smart renderer" features like scaling and rendering regions). It has two main problems though: it is very computationally intensive (slower by an order of magnitude or two than anything else) and it is extremely hard to determine size of the input rendering region.

It is definitely something I would love to have and I know it is possible to implement within the constraints of the concept (commercial World Machine has it), but it is not a priority feature and most definitely is out of scope of what I want to be doing in this stage.
User avatar
mzabsky
 
Posts: 2
Joined: 27 Oct 2014, 11:29

Re: GeoGen - procedural heightmap generator - call for testi

Postby Marta121 » 16 May 2017, 14:18

mzabsky {l Wrote}:
Julius {l Wrote}:Looks pretty cool. Simulated erosion would be a awesome feature.


I do have a sort-of working hydraulic/thermal erosion simulator implemented in previous generation of the project (it used canned Squirrel scripting language and lacked all the "smart renderer" features like scaling and rendering regions). It has two main problems though: it is very computationally intensive (slower by an order of magnitude or two than anything else) and it is extremely hard to determine size of the input rendering region.

It is definitely something I would love to have and I know it is possible to implement within the constraints of the concept (commercial World Machine has it), but it is not a priority feature and most definitely is out of scope of what I want to be doing in this stage.


Try this one http://visengine.com
Marta121
 
Posts: 1
Joined: 16 May 2017, 14:16

Re: GeoGen - procedural heightmap generator - call for testi

Postby Duion » 24 May 2017, 19:20

Without erosion a heightmap generator is pointless as it is the main feature a terrain generator needs.
Duion
 
Posts: 218
Joined: 16 Mar 2013, 20:33
Location: Germany

Re: GeoGen - procedural heightmap generator - call for testi

Postby DrAltaica » 25 May 2017, 06:35

How you looked into how No Man's Sky fakes erosion using analytical derivatives?
https://www.youtube.com/watch?v=SePDzis8HqY
User avatar
DrAltaica
 
Posts: 10
Joined: 26 Dec 2009, 14:49

Who is online

Users browsing this forum: No registered users and 1 guest