Sign in to follow this  
Eitr

Map Generator 2.9 [supports Wurm 1.4]

Recommended Posts

Hi, this tool is great, I've already wasted two days with it :D


 


I have a quick question if I may: is there a way to find the min and max altitude of a map?


 


I exported a generated heightmap and imported it into L3DT to see how it would look there but on import, it asks for the horizontal scale as well as the min and max altitudes of the map. I know the horizontal scale is 4 meters but since I don't know the altitude values it turns into a lot of trial and error to scale the map correctly.

Share this post


Link to post
Share on other sites

If a tile is the max height for the rock layer, then biomes can not be placed on it.


The max height in the rock generator should not limit max height anywhere else, except for the max possible map height.


The original generator did not have this problem, max biome height could be higher than max rock height.


 


I set max height to 1000 when generating the rock, dirt was droped covering rock at 1000 hight, but the dirt can not be changed from grass to anything else. not sure how thick the dirt is, probably just 1.

Share this post


Link to post
Share on other sites

Hi, this tool is great, I've already wasted two days with it :D

 

I have a quick question if I may: is there a way to find the min and max altitude of a map?

 

I exported a generated heightmap and imported it into L3DT to see how it would look there but on import, it asks for the horizontal scale as well as the min and max altitudes of the map. I know the horizontal scale is 4 meters but since I don't know the altitude values it turns into a lot of trial and error to scale the map correctly.

If you want the scale in meters, then 1 dirt is .10 meters high, so 10 dirt is 1 meter, 100 dirt is 10 meters, and so on, which means a height of 4096 would become 409.6 meters. As far as the min and max altitudes of the map, I suppose it would depend on if you were going from the very bottom for your scale, or from the water level.

 

If you go from the lowest point, then the minimum altitude would probably be 0 and the max would be whatever your max height on the heightmap is set to (divided by 10 to get the meters). If it's going from the water level, then subtract whatever value you have as water height from those numbers (and again divide by 10 for the measurement in meters).

 

I hope you find this information helpful.

Edited by Marienara
  • Like 1

Share this post


Link to post
Share on other sites

If you want the scale in meters, then 1 dirt is .10 meters high, so 10 dirt is 1 meter, 100 dirt is 10 meters, and so on, which means a height of 4096 would become 409.6 meters. As far as the min and max altitudes of the map, I suppose it would depend on if you were going from the very bottom for your scale, or from the water level.

 

If you go from the lowest point, then the minimum altitude would probably be 0 and the max would be whatever your max height on the heightmap is set to (divided by 10 to get the meters). If it's going from the water level, then subtract whatever value you have as water height from those numbers (and again divide by 10 for the measurement in meters).

 

I hope you find this information helpful.

 

Thanks, that helped me realise a few errors in my approach. I assumed 4096 in the generator would translate to meters so my resulting map was a bit jaggy and even after scaling down I couldn't get it quite right, glad I asked :)

 

And, if I understood you correctly, Wurm assumes the lowest point in the map to be 0 where as L3DT allows for negative heights so I'll have to take that into account too. Nevermind that one, think I misread you.

 

I did a quick test and dividing the height by 10 like you said, does the trick. I'm going to try the other way around now that I know how it scales. Thanks again!

Edited by BadLuckBurt

Share this post


Link to post
Share on other sites

Could you add a height in dirts to the coordinate display when right clicking a tile? That would make it a lot easier to place biomes in altitude-appropriate locations, and also guess about how hilly an area would look in-game. Also, how many dirts apart are the contour lines on the topo map? Giving each 5th or so contour line a different color would also make it a lot easier. For example, if they were 20 dirts apart, make every 100 dirt line white instead of black or something like that.


Share this post


Link to post
Share on other sites

im still getting this is in certain spots where grass meets rock, i am able to dig on these tiles and i definitely shouldn't be

[12:19:14] Tile 1041, 1083 now at 17, rock at 16.

 

possibly this thing that blayze found?

 

 

I found a bug with the way that dirt/rock tiles are set. Basically it allows players to dig on some rock tiles that are next to dirt tiles.

 

The problem is with the updateAPIMap function in WGenerator.java. It does not set the 4 tiles around the vertice to dirt/grass when processing the type of tile.

 

The fix for this requires doing three passes when setting the surface tiles:
The first sets everything rock.
The second places 4 dirt tiles around each dirt vertex (set all 9 vertices to dirt to tell wurm to not allow digging on any tile on the dirt border)

The third places bushes and trees so they don't get painted over by the dirt

 

 

This is the fixed code

    private void updateAPIMap() {
        MapData map = getAPI().getMapData();
        Random treeRand = new Random(System.currentTimeMillis());
        
        for (int i = 0; i < heightMap.getMapSize(); i++) {
            for (int j = 0; j < heightMap.getMapSize(); j++) {
                map.setSurfaceHeight(i, j, tileMap.getSurfaceHeight(i, j));
                map.setRockHeight(i, j, tileMap.getRockHeight(i, j));
                
                if (tileMap.hasOres())
                    map.setCaveTile(i, j, tileMap.getOreType(i, j), tileMap.getOreCount(i, j));
                
                map.setSurfaceTile(i, j, Tile.TILE_ROCK);
            }
        }
        for (int i = 0; i < heightMap.getMapSize(); i++) {
            for (int j = 0; j < heightMap.getMapSize(); j++) {
                if(tileMap.getType(i, j) != Tile.TILE_ROCK && !tileMap.getType(i, j).isTree() && !tileMap.getType(i, j).isBush()){
                    for(int x = i - 1; x < i + 1; x++)
                        for(int y = j - 1; y < j + 1; y++)
                            if(x > 0 && y > 0 && x < heightMap.getMapSize() && y <heightMap.getMapSize())
                                map.setSurfaceTile(x, y, tileMap.getType(i, j));
                }    
            }
        }
        for (int i = 0; i < heightMap.getMapSize(); i++) {
            for (int j = 0; j < heightMap.getMapSize(); j++) {
                if (tileMap.getType(i, j).isTree())
                    map.setTree(i, j, tileMap.getType(i, j).getTreeType((byte) 0),
                            FoliageAge.values()[treeRand.nextInt(FoliageAge.values().length)], GrowthTreeStage.MEDIUM);
                else if (tileMap.getType(i, j).isBush())
                    map.setBush(i, j, tileMap.getType(i, j).getBushType((byte) 0),
                            FoliageAge.values()[treeRand.nextInt(FoliageAge.values().length)], GrowthTreeStage.MEDIUM);
            }
        }
    }

 

 

Share this post


Link to post
Share on other sites

tried it and i get a line up and down dividing the whole map into 4 quarters?  also have  ridges along those 2 lines.


 


it really shows up dropping 100, 200 or more dirt.


Edited by Uberknot
  • Like 1

Share this post


Link to post
Share on other sites

I can't add biomes, can't paint them on the map and I can't add them in. What am I doing wrong?


Share this post


Link to post
Share on other sites

I can't add biomes, can't paint them on the map and I can't add them in. What am I doing wrong?

 

what size of map are you editing?

uncheck around water?

set min height and max height properly

increase slope to 40

biome density 1

biome size 60

switch to Topo view and paint on non rock tiles

 

you should get some results

Share this post


Link to post
Share on other sites

im still getting this is in certain spots where grass meets rock, i am able to dig on these tiles and i definitely shouldn't be

[12:19:14] Tile 1041, 1083 now at 17, rock at 16.

 

possibly this thing that blayze found?

 

Thanks, I'll look into fixing that.

 

Could you add a height in dirts to the coordinate display when right clicking a tile? That would make it a lot easier to place biomes in altitude-appropriate locations, and also guess about how hilly an area would look in-game. Also, how many dirts apart are the contour lines on the topo map? Giving each 5th or so contour line a different color would also make it a lot easier. For example, if they were 20 dirts apart, make every 100 dirt line white instead of black or something like that.

 

Looks like every 250 dirt, but the topo map is being generated from the API. I can add a height label for mouse location though.

Share this post


Link to post
Share on other sites

Why don't you use any normal image file format to let people making their own HeightMaps in normal graphics programs? The map is not 16-bit gray scale but only 8-bit: R=80,G=80,B=80. Probably program to convert any image file to the 16-bit gray scale PNG exists only in closed Oracle's java cosmos.


 


Yes, it is easy to read the file into java program, but is not easy programming all useful graphics filters and effects as GIMP gives us for free.


Share this post


Link to post
Share on other sites

Why don't you use any normal image file format to let people making their own HeightMaps in normal graphics programs? The map is not 16-bit gray scale but only 8-bit: R=80,G=80,B=80. Probably program to convert any image file to the 16-bit gray scale PNG exists only in closed Oracle's java cosmos.

 

Yes, it is easy to read the file into java program, but is not easy programming all useful graphics filters and effects as GIMP gives us for free.

 

It's not as simple as converting 8-bit images to 16-bit.

 

-edit

 

Well, the wikipedia link was worthless :)

 

Anyway, 16-bit heightmaps allow for more gradual slopes which is why they are used, terrains get very blocky otherwise because 8 bits hold less height information than 16 bits.

Edited by BadLuckBurt

Share this post


Link to post
Share on other sites

Yes I know, but 16-bit grayscale PNG doesn't allow to make a single mountain. I mean there are no convenient tolls to edit height map inside WGenerator, on the other side 99% of graphics editors doesn't write files in such format, so heightmap.png file is for fun only.


Share this post


Link to post
Share on other sites

If you have no objection to being limited to 2048x2048, try the free version of L3DT. It takes a bit of experimenting to get hang of it's settings but you can make very nice terrains with it. If you get the full version you can generate bigger maps.


Share this post


Link to post
Share on other sites

Also, part of being able to import heightmaps is that you can export them from WGenerator. So if you generate a good height map, you can just export it for later instead of having to re-seed it.


Share this post


Link to post
Share on other sites

Yes I know, but 16-bit grayscale PNG doesn't allow to make a single mountain. I mean there are no convenient tolls to edit height map inside WGenerator, on the other side 99% of graphics editors doesn't write files in such format, so heightmap.png file is for fun only.

 

You fail to understand what it is for, it is so that you an use any terrain editor that writes 16b grayscale because they already understand 8b is insufficient resolution.  8b means you can only have +/-128 dirt high worlds (barely 3 tiles high) or you suffer 256 dirt high blocky contour cliffs everywhere.  

 

Photoshop and the latest GIMP and several other free paint programs support reading/writing 16b grayscale if you prefer to use paint brushes to draw a heightmap, that is not 1% of the paint program market so no need for hyperbole here  as that has nothing to do with Oracle Java at all.  But if someone did want to use Oracle Java there is ImageJ which is an image editor/processor written in it that supports all the formats. If using Java offends you then do not waste your time with Wurm, as it and many of it's support tools are using Java.

 

Someone certainly could add 8b import, but they will need to have processing dedicated to adding details that remove the 256 dirt high cliffs.  Since those details are more than 10x taller than your avatar, you might not like the result.  Reading the format is easy with an graphics API, and likely transparent to the reader that the file is 8b or 16b, the fact that it is not supported is because the dev left it out because the results are bad.

Edited by yarnevk

Share this post


Link to post
Share on other sites

Yes I know, but 16-bit grayscale PNG doesn't allow to make a single mountain. I mean there are no convenient tolls to edit height map inside WGenerator, on the other side 99% of graphics editors doesn't write files in such format, so heightmap.png file is for fun only.

 

I've found an example of what an 8-bit heightmap would look like: http://www.ofgabriel.com/scrupbucket/dn/u6s8myljsckc8.png

  • Like 1

Share this post


Link to post
Share on other sites

For further perspective that is unplayable minecraft that has steep 25.6x taller blocks.


 


Certainly an algorithm could exist to add dither noise and slopes, but it is not a straightforward import.


Edited by yarnevk

Share this post


Link to post
Share on other sites

Update 2.5 - River Painting


 


Added river/lake painting

 - Click "River Painting" mode (under Drop Dirt) and draw on the map where the river should be.

 - Clicking "Generate Rivers" will alter the heightmap with the current river settings (depth/width/slope).

 - It will automatically queue a drop dirt action after that unless you uncheck "Auto Drop Dirt".

 - "Reset Rivers" will throw away the currently drawn rivers.

 - Eroding afterward will make the river look more natural.

 - Drawing in topo view will be more accurate.

 - Rivers are not compatible with the Actions import/export (save the heightmap before/after editing, then import later).

 - Width input determines how big the base of the river is, Slope determines how steep the dirt is dug for the river (higher = steeper).

 - It's advisable to drag your mouse slowly or zoom in to get a smooth river.

 

Saves current view as default view (instead of map view).

Fixed drop dirt creating ridges down the center.

Fixed digging on rock tiles (credit to Blayze).

Added height (in dirt) to coordinate marker.


 


River painting (before)



YyZe9aO.png



 


(After)



aloOCw4.png



 


Don't want to spend all week digging a canal? Generate one!



OHfySeZ.png



 


If anyone wants to load a generated river in game, I'd be happy to see what it looks like. It will definitely take some tweaking to get the rivers looking just right.


  • Like 3

Share this post


Link to post
Share on other sites

They look great!


 



dbv6vZs.jpg



 


The only issue I noticed was that the Cliff Ratio doesn't seem to work anymore, tried 1 and 5 which should be drastically different, but I didn't noticed anything change.


Share this post


Link to post
Share on other sites

They look great!

 

dbv6vZs.jpg

 

The only issue I noticed was that the Cliff Ratio doesn't seem to work anymore, tried 1 and 5 which should be drastically different, but I didn't noticed anything change.

 

Oh cool! Better than I expected. And oops, I accidentally left that part out when I fixed the drop dirt earlier.  :P

Share this post


Link to post
Share on other sites

"Update map name" seems to just hang now. making you have to force quit.


 


and yeah the cliff ratio :P


 


painting in topo is excellent!


 


rivers are also awesome but i i lost both my maps from the rename bug x)


Edited by Aum

Share this post


Link to post
Share on other sites

"Update map name" seems to just hang now. making you have to force quit.

 

and yeah the cliff ratio :P

 

painting in topo is excellent!

 

rivers are also awesome but i i lost both my maps from the rename bug x)

All the above

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