Sign in to follow this  
blayze

WGenerator - Blayze

Recommended Posts

WGenerator - Blayze


 


Download v1.1


 


This is a version of WGenerator created by Buddah. I have added a lot of different tools/features and changed the layout a bit. After I comment and clean up the code I'll release it.


 


 


Whats New:


Overlay map - A separate layer that can be blended into the main map layer.


Domain Distortion - A feature that pushes the stretches the terrain in different directions.


Ridged Noise - A feature that replicates rivers and valleys.


Angle of Repose Style Dirt Drop - Changed the way that dirt is dropped so it drops more naturally.


Layout Change - Moved around the settings to fit everything


Fixed the way dirt is dropped so it does not create rock tiles that players can mine


 


 


How It Works:


Overlaying:


Each of the different noise function can be done on the main height map and the overlay height map.


The overlap map can be pressed/overlaid into the main map.


The press feature combines the two maps together, usually decreasing the brightness


The overlay feature combines the two maps together, usually increasing the brightness


 


Domain Distortion:


This will create the domain count number and create that amount of random points squared.


Each one of those random points pushes the image in a random direction.


After each use it is best to change the seed number or else it will be pushed into a corner


 


Ridged Noise:


This will create a map with deep valleys


The higher the frequency the bigger the valleys get, the smaller they become


The octaves is the level of detail. With numbers above 10 this can take a lot of time.


 


Dirt Dropping:


The the slope dirt angle determines the max steepness of a dirt slope.


The lower the dirt slope angle the more time it will take to run.


Anything lower than a max slope angle of 12 will be forced back to 12.


The more dirt that is dropped the more time it will take.


 


Other:


I'm working on multi-threading as much as I can to make it faster. I have already done the domain distort and ridged noise but I still need to work on the base noise (perlin noise) and the dirt dropping.


 


Examples of what can be done:



72308312fa.jpg


 

80a041d1e6.jpg


1e1e45dd12.jpg



 


Update 1.1


Fixed bugs with values not updating such as resolution and border weight


Optimized the dirt dropping so its a bit faster


Edited by blayze
  • Like 2

Share this post


Link to post
Share on other sites

When i click on the downloaded jar it does not do anything. 


Share this post


Link to post
Share on other sites

When i click on the downloaded jar it does not do anything. 

Edited by blayze

Share this post


Link to post
Share on other sites

Very nice, it'll take me some time to actually get to grips with the new functions.


 


It seems to take a considerable time to process domain distortion and ridged noise, but the results are certainly impressive, if not always 'natural'.


 


I do have a small request however, if possible can you extend the size parameter to include a 512 option? I'm not sure about anyone else, but solo play on a small map appeals, while I can emulate this by playing with water levels, those tend to produce islands in a huge, (relatively) ocean. It should be possible, since the original Affliction server was 512x512.


 


Liking the new layout, since I lost my 1440x900 monitor I've been afflicted with a 1366x768 which limits the vertical depth possible, and left some options a little squashed for me, so while I was hoping for a tabbed layout, this works fine as it is.


Share this post


Link to post
Share on other sites

Dropping dirt seems to take a long time compared to previous WGenerator iterations. Taking even longer than say, the ridged noise portion. Using a 4096 map size w/ 5 octive / 175 frequency noise. Pretty crazy looking valleys, so I guess I'll just let it run. Hopefully it hasn't stalled.


 


EDIT: Started it up at the command line to get feedback while it was working and it did finish, it just took forever to do each layer of dirt dropping :D


Edited by Scrubbs

Share this post


Link to post
Share on other sites

512 is not a supported WurmAPI map, you have to do a 1024 and make a smaller island


Share this post


Link to post
Share on other sites

Is this able to load the height maps from the original WGenerator? When I try to load one it seems to hang on the Dirt Dropping.


 


If not, how are you able to generate those maps with a large landmass? All I'm getting is lots of little islands, lakes etc. Changing the res value seems to have no effect.


Share this post


Link to post
Share on other sites

I'm confused... I don't see a generate height map button - once I select a Map Size (2048, etc), nothing happens. 


Share this post


Link to post
Share on other sites

It's the "noise" or  "noise overlay" button to generate the heightmap.


 


EDIT: I'm also getting the same thing as cmiddlebrook where it's just a ton of small islands and no large land masses at all. Changed resolution, changed iterations, changed min edge and changed border weight. Also changed resolution; tried low and high. Doesn't seem to change much in the way or what's presented. Using 4096 map size.


 


EDIT2: for cmiddlebrook: try running the jar from the command line with: "java -Xm2048x (or Xm4096x depending on how much memory you want to give it) -jar whateveryounamedthe.jar


 


This will allow you to watch the command prompt window to see if it's hanging or just taking a long time to execute steps. I know that for dirt dropping, each layer it drops (the "dirt per tile" variable you specify) take a significant period of time. So if you specify 60 dirts per tile, it drops dirt 60 times and each drop takes like 30-45 seconds for me. But you can see it executing each layer so you know it hasn't frozen if you watch the command prompt.


Edited by Scrubbs
  • Like 1

Share this post


Link to post
Share on other sites

This is not really a practical solution. I'm generating a 4096 map and I pressed the drop dirt button 45 minutes ago. It has yet to complete. The drop dirt box was left at default levels. The concepts are good, the execution is not.


 


The map name at the top should reflect the seed number in the noise box.


 


In the drop dirt box the default max dirt height should not exceed the default max height in the noise box.


Share this post


Link to post
Share on other sites

This is not really a practical solution. I'm generating a 4096 map and I pressed the drop dirt button 45 minutes ago. It has yet to complete. The drop dirt box was left at default levels. The concepts are good, the execution is not.

 

The map name at the top should reflect the seed number in the noise box.

 

In the drop dirt box the default max dirt height should not exceed the default max height in the noise box.

I think Blayze said he's working on multi-threading the dirt drop and 1 other thing, so if he gets that working, the dirt dropping should process faster.

Share this post


Link to post
Share on other sites

This is not really a practical solution. I'm generating a 4096 map and I pressed the drop dirt button 45 minutes ago. It has yet to complete. The drop dirt box was left at default levels. The concepts are good, the execution is not.

 

The map name at the top should reflect the seed number in the noise box.

 

In the drop dirt box the default max dirt height should not exceed the default max height in the noise box.

 

Are you just going around posting this in any map-related thread?

Share this post


Link to post
Share on other sites

Are you just going around posting this in any map-related thread?

 

What are you referring to? Explain yourself. 

Share this post


Link to post
Share on other sites

WGnerator has problem with memory on many many maps. On maps 4096x4096 this problem is persistent for me. Win 10 64bit, 4 GB, java uses only 86MB (heights), 112 MB (erode), 280MB (drop dirt) of memory (with other processes, system, browsers, editors, hexviewer - 67%) for 2048x2048 map. So.... it looks like problem with inner memory of  java/swing controlls.


Probably I must start using old good buffering, to create my demonic 4096x4096 project of Dark Zone. :rolleyes:


Share this post


Link to post
Share on other sites

The settings for the initial noise and noise overlay aren't working. I've put the res, iterations and max height to all sorts of numbers in the mundane and the extreme, and nothing  changes. Max height of 10 for example still creates a normal looking height map.


I also can't for the life of me figure out what erosion does, it doesn't seem to change my map no matter what the settings, though i'm not sure that's anything you can work on as it's probably an issue of budda's base app.


just found another bug, biome size is off screen, as well as the "reset biomes" button. I've tried fullscreen and resizing the window and it won't come back on screen. You can still tab to them and use them though...


 


On a side note, feature request :


max height for ridged noise so we can avoid it reaching full white


I'm not sure on how the formula works, but some way for us to shift the centre would also be cool, so we can avoid it being bright in the middle all the time. The problem is when you mash a ridged noise layer onto your height map it will always add the most height to the middle of the map, constantly pushing up any mountains already there. Ultimately it just means all maps that use ridged noise will be much higher in the center.


Edited by Manifestation

Share this post


Link to post
Share on other sites

This is not really a practical solution. I'm generating a 4096 map and I pressed the drop dirt button 45 minutes ago. It has yet to complete. The drop dirt box was left at default levels. The concepts are good, the execution is not.

 

The map name at the top should reflect the seed number in the noise box.

 

In the drop dirt box the default max dirt height should not exceed the default max height in the noise box.

 

Yeah I'm working on the dirt dropping to increase the speed but as it stands there is a limit on how fast I can make it.

 

The algorithm takes each point on the map (4096x4096=16,777,216 points) and then looks at each surrounding point with a range of 1-3 tiles (7x7=36 * (16,777,216) = 822,083,584). For each point it then needs to calculate the slope in 3D space which takes some x amount of time. If the slope is greater than what is selected then it needs to then repeat this process over and over again till it finds a place that is flat enough. This can happen on average about 30 times per tile, if not more (822,083,584 * 30 = 24,662,507,520). Then this needs to happen for each layer of dirt that is put on, lets say 30 (30*24,662,507,520 = 739,875,225,600). Which is a lot.

 

The other problem is that this cant really be multi threaded easily. Each tile that is dropped has an affect on the next tile that is dropped, So each point can't be calculated independently which causes a huge problem.

 

I am still looking into it but there is a limit on how fast this type of thing can be done due to the complexity of the problem but I will see what I can do.

 

Edit: After optimizing it a bit I was able to get each dirt layer to process in about 18 seconds (7.5 minutes in total) for a 4096x4096 map. Before it was taking a minute or two per layer. The change is in v1.1. 

 

 

As for the max dirt drop height, I don't see any point in limiting it because it doesn't make any difference between limiting it and not limiting it. If anything it would force the user to have to update a separate field if the map height changed.

 

 

I'm also looking into progress bars but college and work takes out most of my day so I haven't had much time.

Edited by blayze

Share this post


Link to post
Share on other sites

It's the "noise" or  "noise overlay" button to generate the heightmap.

 

EDIT: I'm also getting the same thing as cmiddlebrook where it's just a ton of small islands and no large land masses at all. Changed resolution, changed iterations, changed min edge and changed border weight. Also changed resolution; tried low and high. Doesn't seem to change much in the way or what's presented. Using 4096 map size.

 

EDIT2: for cmiddlebrook: try running the jar from the command line with: "java -Xm2048x (or Xm4096x depending on how much memory you want to give it) -jar whateveryounamedthe.jar

 

This will allow you to watch the command prompt window to see if it's hanging or just taking a long time to execute steps. I know that for dirt dropping, each layer it drops (the "dirt per tile" variable you specify) take a significant period of time. So if you specify 60 dirts per tile, it drops dirt 60 times and each drop takes like 30-45 seconds for me. But you can see it executing each layer so you know it hasn't frozen if you watch the command prompt.

 

Is this able to load the height maps from the original WGenerator? When I try to load one it seems to hang on the Dirt Dropping.

 

If not, how are you able to generate those maps with a large landmass? All I'm getting is lots of little islands, lakes etc. Changing the res value seems to have no effect.

 

Fixed in v1.1, the values should update now.

Share this post


Link to post
Share on other sites

Ad. dropping dirt: Why not drop all dirt at once, ie. "If rock_layer[i,j] = N Then  top_layer[i,j] = N + dirt_per_tile for every Tile[i,j].height below Max_dirt_height-dirt_per_tileor something like that and then do postprocessing? Set fifty-fifty line L at rock_layer slope 55 for example and probability distribution on set [0..Max_slope] may looks like half of Gauss. The higher slope (edge/edges and/or diagonal) is the bigger is probability of removing some dirt. Below L, (for rock slopes below 55) the higher is distance from L the smaller is probability of adding some dirt. Next you may distort or sculpture dirt layer a bit using filters. Do smoothing etc. Last step may be dropping down all dirt that not fullfill 40/56 rule starting  from upper tiles to down. Coin flipping, where probability od heads (tails) depends on rock slope.


 


Ad. "EDIT 2: ...":


 


C:\...\WGenerator>java -Xm4096x -jar WGenerator.jar

Unrecognized option: -Xm4096x

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

 

C:\...\WGenerator>java

Usage: java [-options] class [args...]

           (to execute a class)

   or  java [-options] -jar jarfile [args...]

           (to execute a jar file)

where options include:

    -d32          use a 32-bit data model if available

    -d64          use a 64-bit data model if available

    -client       to select the "client" VM

    -server       to select the "server" VM

                  The default VM is client.

 

    -cp <class search path of directories and zip/jar files>

    -classpath <class search path of directories and zip/jar files>

                  A ; separated list of directories, JAR archives,

                  and ZIP archives to search for class files.

    -D<name>=<value>

                  set a system property

    -verbose:[class|gc|jni]

                  enable verbose output

    -version      print product version and exit

    -version:<value>

                  Warning: this feature is deprecated and will be removed

                  in a future release.

                  require the specified version to run

    -showversion  print product version and continue

    -jre-restrict-search | -no-jre-restrict-search

                  Warning: this feature is deprecated and will be removed

                  in a future release.

                  include/exclude user private JREs in the version search

    -? -help      print this help message

    -X            print help on non-standard options

    -ea[:<packagename>...|:<classname>]

    -enableassertions[:<packagename>...|:<classname>]

                  enable assertions with specified granularity

    -da[:<packagename>...|:<classname>]

    -disableassertions[:<packagename>...|:<classname>]

                  disable assertions with specified granularity

    -esa | -enablesystemassertions

                  enable system assertions

    -dsa | -disablesystemassertions

                  disable system assertions

    -agentlib:<libname>[=<options>]

                  load native agent library <libname>, e.g. -agentlib:hprof

                  see also, -agentlib:jdwp=help and -agentlib:hprof=help

    -agentpath:<pathname>[=<options>]

                  load native agent library by full pathname

    -javaagent:<jarpath>[=<options>]

                  load Java programming language agent, see java.lang.instrument

    -splash:<imagepath>

                  show splash screen with specified image

Edited by Darkregis

Share this post


Link to post
Share on other sites

C:\...\WGenerator>java -Xm4096x -jar WGenerator.jar


 


should be


 


C:\...\WGenerator>java -Xm4096m -jar WGenerator.jar


 


or even better


 


C:\...\WGenerator>java -Xm4g -jar WGenerator.jar

Share this post


Link to post
Share on other sites

 

Ad. dropping dirt: Why not drop all dirt at once, ie. "If rock_layer[i,j] = N Then  top_layer[i,j] = N + dirt_per_tile for every Tile[i,j].height below Max_dirt_height-dirt_per_tileor something like that and then do postprocessing? Set fifty-fifty line L at rock_layer slope 55 for example and probability distribution on set [0..Max_slope] may looks like half of Gauss. The higher slope (edge/edges and/or diagonal) is the bigger is probability of removing some dirt. Below L, (for rock slopes below 55) the higher is distance from L the smaller is probability of adding some dirt. Next you may distort or sculpture dirt layer a bit using filters. Do smoothing etc. Last step may be dropping down all dirt that not fullfill 40/56 rule starting  from upper tiles to down. Coin flipping, where probability od heads (tails) depends on rock slope.

 

 

Yeah this kinda sounds like the greedy algorithm that someone made for WGenerator but a bit different.

 

While it works great for dropping the dirt and shaving it off where the dirt is too steep, it doesn't represent the flow of dirt down hill sides that occurs in nature. 

 

510760243e.jpg

Share this post


Link to post
Share on other sites

Yeah this kinda sounds like the greedy algorithm that someone made for WGenerator but a bit different.

 

While it works great for dropping the dirt and shaving it off where the dirt is too steep, it doesn't represent the flow of dirt down hill sides that occurs in nature. 

 

510760243e.jpg

 

Yeah, that was me, just a note to others:

Blayzes dirt algorithm looks 100x better, so, at least until i fix mine, it's probably better to spend more time dropping dirt using his algorithm.

 

I might take a look at it later, but as things stand now I hardly have any time.

Share this post


Link to post
Share on other sites

I am just testing very simple command line program to create rock layer, drop dirt and planting biomes. I plan to use such code snippets as a filters, effects or brushes in my generator. Similar to Photoshop or Gimp structure. All is based on rewriting of disk files, so I have no problem with low memory, heap exceptions and Swing interface.


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this