Sign in to follow this  
Tenniel

Map Generator (flavor alternative)

Recommended Posts

Hello Everybody,

 

I'm publishing my version of Budda's WGenerator, it's a flavor alternative, you may like it or you may not.

 

It's provided as is, you may do with it as you wish, freely.

 

https://www.dropbox.com/s/odgm5468v4bjnyr/wgenerator.zip?dl=0

 

I've replaced the UI panel, and instead use only a properties file. You can have many properties files, and you can share properties files among peers instead of sharing the entire map, they just need the same version of the program.

 

Download the program and run with this command (the command should not include the ".properties" file extension):

java -jar wgenerator.jar [properties file]

  1. The maps this program generates does not have the random patches of biomes. Instead, a climate model is generated and biomes are distributed according to temperature. You will find deserts and steppes to the south, and tundra to the north.
  2. Snow is automatically placed on mountain peaks at certain altitudes.
  3. The height map is more compressed and at the same time more jagged and rough, there are cliffs and ravines, and large open fields. Mountains have more pointed peaks.
  4. Dirt also erodes, and at some places piles up to mounds, other places becomes flat, and some hilly.
  5. Trees and bushes are distributed more mixed, and according to climate type. Pine and fir where it's colder, olive and cedar where it's warmer, etc.

 

 

Edit: I'm also publishing a new version of the map generator, which is using a height image and a biome image when rendering the map. The program can be found here:

 

https://www.dropbox.com/s/wycloipvwi26d9y/mapgen.zip?dl=0

 

Run it just like the previous version, though I've renamed it to "mapgen.jar".

 

There are now two buttons: "Quick Map" and "Render Map". The quick map button will overwrite the heightmap image each time you run it. This way you can edit the properties file and run the quick map, to see how it will look. Once you are done with the height map generation, you can edit the heightmap.png image in an image editor like Photoshop or GIMP, myself I do all editing in GIMP. The image should be saved as either 16bit greyscale, or 24bit RGB or 32bit ARGB (GIMP doesn't support exporting 16bit greyscale, so had to make a workaround for 24bit/32bit images). Now you can render the complete map with the button "Render Map", and it will generate all map images. Without a biomemap.png image in the map-output-directory, the entire map will generate only grass fields, which has a few trees and bushes here and there, and some sand along the coast line, and a few patches of clay, tar and peat. The biomemap.png-image should be a black image the size in pixels as the amount of tiles of the generated map, e.g. a 2048x2048 tiles map should have a 2048x2048px image. Draw on the image where you want different biomes, each type of biome has a specific colour, so you should use drawing tools without any smoothing or dithering, but you can of course work with many layers. The following colours are used:

 

  • #FFFFFF - Snow
  • #CCCCCC - Tundra
  • #FFFF00 - Sand
  • #66FF66 - Grass
  • #009900 - Tree/Forest
  • #33FF33 - Bushes
  • #00FF00 - Steppe
  • #FFCC99 - Dirt
  • #CC9966 - Packed Dirt
  • #999999 - Clay
  • #663300 - Peat
  • #333333 - Tar
  • #99FF00 - Moss
  • #00FF99 - Marsh
  • #FF00FF - Mycelium
  • #FF9900 - Lava

 

Tiles below water ignores the biomemap.png and generates biomes separately. Trees and bushes are automatically generated in a way that accounts for various types of biomes, some parts have mixed tree types, some have the same tree type, but all trees and bushes are generated. All marsh will generate clay where there is sand or dirt in the direct surroundings, and marsh is only generated if drawn on the image. Snow is automatically generated at certain altitudes, then is packed dirt, and below that tundra. Tundra is only generated on mountains below the snow, unless drawn on the image. A sample generated map is posted in the thread below.

 

 

Edited by Tenniel
  • Like 1

Share this post


Link to post
Share on other sites

Example of a map the generator can create:

 

map.png

  • Like 2

Share this post


Link to post
Share on other sites

Any tips on getting a map such as you have above? Been playing around for a bit now but cant seem to get a smooth shoreline- just massive cliffs right into the water.

  • Like 1

Share this post


Link to post
Share on other sites

Someone might notice a miss with this type of maps, which is that the sun rises in the north west and sets in the south west, and travels across the western side of the sky, which means that the cold climate should be to the east actually. To make the eastern side of the map colder and the western warmer, replace the code in TileMap.java on line 328, with this:

 

for(x=sx; x<ex; ++x) {
	lat = (float)(s-x)/(float)s;
	for(y=sy; y<ey; ++y) {
		b = biomeMap[x-sx][y-sy];
		if(b.surface>=0) {
			h = (float)b.surface/snow;
			h = h*h*h;
			b.temp = (lat*22.0f + b.inland*(y<t? -5.0f : 5.0f) + (b.climate+b.env*0.33f)*6.0f)*(1.0f-h) + h*-5.0f;
			if(b.temp<minTemp) minTemp = b.temp;
			if(b.temp>maxTemp) maxTemp = b.temp;
		}
		if(x>sx && y>sy && x<ex-1 && y<ey-1) {
			b.slope = (short)Math.abs(b.area[6].surface-b.surface);
			n = Math.abs(b.area[1].surface-b.area[2].surface);
			if(n>b.slope) b.slope = (short)n;
		}
	}
}

 

  • Like 1

Share this post


Link to post
Share on other sites

Which settings to use depends a lot on the size of the map, but the generator will first make a quick render to see what the map will look like in general, without biomes and a lot of dirt, which is the process that takes a lot of time but which doesn't affect the layout of the map much. You can therefore make a quick render, change the settings, quick render again until you get a seed and parameters you like, then render all the way to get the complete map.

Share this post


Link to post
Share on other sites

I love how this map looks! I'll have to grab this and play around if I have time.

  • Like 1

Share this post


Link to post
Share on other sites

Pretty cool changes, a lot better than before. Still I think there are too many hills and not enough flat areas and also not enough mountains, the whole map feels like a hilly area.

We found out that a good combination of big mountains and beautiful looking flat areas and valleys works best in Wurm Unlimited.

 

So we worked with a lot tools and our own dirt dropping algorithm to get a map which comes close to the Wurm Online maps and even closer to the old maps notch made back in the days like Chaos and Gold 2 JKH. Would be really cool if there would be a map generator which comes very close to the style of what WO maps have been in the past.

 

 

OkccBhn.jpg

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, Sklo:D said:

We found out that a good combination of big mountains and beautiful looking flat areas and valleys works best in Wurm Unlimited.

 

I think this is definitely one of those personal opinion things. I do like the map you linked, but depending on what you're after - sometimes just a gentle hilly map is nice. What I like about the OP's map is how the biomes are laid out. A nice mod to indicate air temperature and have weather based on biome would mix well with that.

  • Like 2

Share this post


Link to post
Share on other sites

I am on of those old wurm grandpas who tells people how maps have been in the past. From my personal view with the biomes like that the map doesn't feel like a real wurm map. But yeah that is a personal taste.

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, Sklo:D said:

I am on of those old wurm grandpas who tells people how maps have been in the past. From my personal view with the biomes like that the map doesn't feel like a real wurm map. But yeah that is a personal taste.

 

And I'm one of those damned millennial Wurmians who'd love to write the aforementioned biome mod if I ever get the chance. I'd also love to get land-based server transitions working, but that'd take more behind-the-scenes infrastructure than the average WU server host is willing to do. You'd almost have to centralize the database and use a REDIS cache to ensure the data is 1:1 and still fast. Hit the server boarder, cache flush, connection hand-off. Also would probably do better to have a UDP-based connection instead of our current TCP. I mean keep TCP for chat, but server-side terrain, creature, item, etc would have to go encrypted UDP. Yeaaah. I dream big.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Keenan said:

 

And I'm one of those damned millennial Wurmians who'd love to write the aforementioned biome mod if I ever get the chance. I'd also love to get land-based server transitions working, but that'd take more behind-the-scenes infrastructure than the average WU server host is willing to do. You'd almost have to centralize the database and use a REDIS cache to ensure the data is 1:1 and still fast. Hit the server boarder, cache flush, connection hand-off. Also would probably do better to have a UDP-based connection instead of our current TCP. I mean keep TCP for chat, but server-side terrain, creature, item, etc would have to go encrypted UDP. Yeaaah. I dream big.

 

So basicly you are planning to create your own game :P

Share this post


Link to post
Share on other sites

Personally, I think huge mountains on a WU map are just wasted terrain.  Until we get true 3D caves, you only need a few meters of rock to mine in.

 

On the other hand, I don't think it makes sense to have "biomes" on maps as small as our islands are.  Even an 8k map is only 32 square kilometers.  I guess I could see things like beach, forest, ocean.  But not tropical, arctic, temperate, etc. all on the same map.  It makes more sense to me that individual islands in a cluster have their own major biome set.  So, sail to the island to the north, and the biome gets colder, sail south and it gets warmer, or however you want to set it up...

 

All opinion, of course.

 

 

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, Sklo:D said:

 

So basicly you are planning to create your own game :P

 

 

I mean I could do it with WO, but I couldn't extend it to WU, since supporting it would be heavily based on the infrastructure.

Share this post


Link to post
Share on other sites

Yes, I agree, the maps are too small to realistically have biomes that accounts for northern and southern climate. And yes, it is of course entirely a matter of taste how maps should look and feel.

 

When creating the generator, I felt that much of the landscape was a bit too flat, except where the mountains are. Rock areas are also eroded, which makes the tiles very even. Instead I wanted the landscape to be varied, with hills, cliffs, ravines and also flat areas. In real nature, rocks are often fractured and so I added a bit of fracture to rocks. Dirt is dropped and then eroded, caused by wind and rain, which means that dirt flows downwards, which in some cases causes mounds to pile up.

 

The SimplexNoise algorithm, used when creating the height map, has been used more extensively, for both biomes and for causing smaller variations in the landscape. Unfortunately, when using it for biomes, they get the appearance of "bubbles", which is one of the reasons I've abandoned this generator.

 

I've been working on a new generator, which will place more focus on tools for artistically creating the maps. Which means you generate a height map which can be edited, and then you can draw a biome map. So, instead of algorithmic or random distribution of desert, tundra, marsh, forest etc., you draw where you want it on a picture. For forest and bushes I also use noise filters to blur the lines. These are then used when rendering the map.

 

On Xanadu, I did have a very persistent neighbour, who worked very hard on making a pier to the edge of the map. When last I looked, this summer, he was still working on the project.

 

I like your idea with a biome mod, Keenan. I've been looking at the survival mod, which could be extended to handle desert heat as well. There's also this post with some additional ideas.

Share this post


Link to post
Share on other sites
3 hours ago, Keenan said:

 

 

I mean I could do it with WO, but I couldn't extend it to WU, since supporting it would be heavily based on the infrastructure.

 

Well docker could help there, if preconfigured smart with some good auto configuration inbuilt into the server.

 

Yeah yeah, so much to do, we are still working on bringing the grindy part to smartphones, so you can do that while on train/bus or whatever. Wurm GO

Edited by Sklo:D
  • Like 1

Share this post


Link to post
Share on other sites

I like where everyone is going with the climates, sun angles and rotation!!!  Personally, none of the UI controlled map generators work for me, as far as creating the heighmap.  The one with the river tool was a great step up in customization, but ultimately I went and used a separate map generation tool to create the heighmap.  It was tricky making the right settings and importing it back into one of the WU tools map programs, where I finished it off with the dirt, water level and biomes.  Custom drawing your map can make some really stunning landscapes that no random generators can match.  I will say that this one looks like it gives far more customization to the process, which is a great step.  Here is my current server, with a "hand drawn" (mouse & computer) heighmap and all the rest done by a generator program.

 

If we could get a generator to simulate somewhat of a hand drawn map AND have tweaks like this one is doing, I think we would have something pretty amazing. 

 

This map is basically a volcano.  Lots of nice erosion slopes, between the ridges. Various hard rock peaks that resisted erosion.  Some other mini volcanoes built up that haven't blown their tops and no flat tops - I love the big flats on the mountains of Xanadu, but they are so flat!  I recreated that feature, but gave it a more organic look.  This is not a post hijack to shill my own server.  It isn't open to the public.  Just want to suggest the heightmap in generator programs get more love and less RNG.  I really like the results of the one from the OP the best so far.

 

QIIktYm.png

 

lBPAPW7.jpg

 

JwU7LXm.jpg

 

VnzkutJ.jpg

 

zJVhmRf.jpg

Share this post


Link to post
Share on other sites
5 hours ago, Tenniel said:

I've been working on a new generator, which will place more focus on tools for artistically creating the maps. Which means you generate a height map which can be edited, and then you can draw a biome map. So, instead of algorithmic or random distribution of desert, tundra, marsh, forest etc., you draw where you want it on a picture. For forest and bushes I also use noise filters to blur the lines. These are then used when rendering the map.

 

I can't wait to see this!

Share this post


Link to post
Share on other sites

Ok, give me a couple of days and I'll see if I can get it ready for publishing.

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, Sklo:D said:

Yeah yeah, so much to do, we are still working on bringing the grindy part to smartphones, so you can do that while on train/bus or whatever. Wurm GO

 

That's a nice feature indeed! Will it be a complete client for smartphones or will players still have to keep logged in on the home computer and have some kind of remote control apps for the smartphones with a client mod for accepting the calls?

Share this post


Link to post
Share on other sites
2 hours ago, Tenniel said:

 

That's a nice feature indeed! Will it be a complete client for smartphones or will players still have to keep logged in on the home computer and have some kind of remote control apps for the smartphones with a client mod for accepting the calls?

 

It is still earliest WIP but from our current focus, you need of course a character ingame. Also need to do wood cutting and stuff on the PC, but can later access bulks and maybe even other materials use your tools in your inventory and create planks for example from your smartphone without having the PC running. 

Share this post


Link to post
Share on other sites

Ok, I've edited the first post with an URL to the new version of the map generator. The sample properties file generates this map attached below, using the provided biomemap.png image. Just run the program from the extracted directory and press the "Render Map" button, it will generate everything.

 

map.png

  • Like 2

Share this post


Link to post
Share on other sites

Hello, New to WU and trying to Gen a new map for my server. Getting out of Memory Error in Java. I tried to create a .bat for xmx and xms but will only allow me to go to 2g max?

 

Thanks for any help

 

Invalid maximum heap size: -Xmx8g
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Just noticed memory thing in bottom right* is there a reason it lock at .24?

 

Solved, for whatever reason i had x86 installed . . . . ?

 

Edited by Malaras
Error
  • Like 1

Share this post


Link to post
Share on other sites

Hello, good that you solved it. Of course it depends on the size of the map, a 8k map would use a lot of RAM, 4x that of a 4k map and 16x of a 2k map. The rendering of the biomes use a lot of RAM, it actually splits the map into sections and renders each separately to save RAM.

 

This generator doesn't guarantee lovely maps, with an unhappy set of parameters the map could become a catastrophe. Also, a set of parameters on a smaller map will not always scale well on a larger map. By changing parameters though, you can basically get any kind of shape on the map, flat or hilly, lots of mountains or not, lots of islands or just one continent, etc. You'll have to experiment with it. To get a better understanding you can experiment with settings on a 2k map, and just do quick renderings for the shape. On a larger map, adjust the parameters that need scaling to larger maps, those include: mapResolution, landscapeResolution, heightMapBorderWeight, heightMapCompression, waterHeight.

 

To edit the height map, you should use a very very light paint brush or air brush, with opacity 10 or less, and lightly add or remove height. I'd use an image with a layer on top of the height map, and then add a layer of brushed black on top of it, for lowering down parts of the map. If you can't export the image to 16 bit greyscale the map will render with only 256 height steps, which somewhat will disappear in the post rendering when fracture is added to the height map. For best effect you'd still want to use a 16 bit greyscale height map image. The biomes image must not use smooth stroke brushes, all strokes must be one colour only. Any colours that isn't an exact RGB value will be ignored, and grass or dirt will be rendered there instead.

Edited by Tenniel

Share this post


Link to post
Share on other sites

Thanks very much for this! I was having a lot of trouble adding biomes in the other generators because I am not sure what all the numbers mean. I really like how your program distributes them based on a more "planetary" model so you don't end up with tundra in the south and so forth. Being able to generate a complete map with a few mouse clicks is wonderful! :)

 

Thanks again,

Matt

  • Like 1

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