Jump to content

KingGen - A Random World Generator for 7 Days to Die


KingSlayerGM

Recommended Posts

9 hours ago, KingSlayerGM said:

I improved the poi selection in cities. Now it is impossible for the same poi to be placed more than once in the same city. However, this comes at a cost. If KG cannot find a poi that satisfies the required zone, it will start looking for pois of other zones.... if KG still cannot find a suitable one, it will start looking for pois in other townships (towns, villages...). This needs to be done otherwise large lots would remain empty. I think this is an improvement, but I'll listen to the community feedback .

Well done! Very nice

Link to comment
Share on other sites

First, the tool is awesome. Excellent work!

 

Second:

20 hours ago, KingSlayerGM said:

I improved the poi selection in cities. Now it is impossible for the same poi to be placed more than once in the same city.

 

Could this be made into an option? I don't so much mind dupes in a large city, but I do dislike them being two blocks away from each other. I'm thinking of three choices, but maybe it really only needs to be yes/no toggle:

 

Allow Duplicate POIs in Cities

1) Yes

2) Yes, but only if spacing allows (i.e. the algorithm requires dupes to be X city blocks apart or something)

3) No

 

Third, I am playing with heightmaps and water maps to try to recreate a real-world location which mixes plains and mountains. I have the following layers in GIMP:

 

1) A grayscale terrain map of the area (from Tangram Heightmapper) with auto-exposure

2) A grayscale map with manual exposure, so the plains areas are not pitch black

3) A grayscale overlay of waterways and lakes

 

Here is what I've tried:

A) Darken the waterways and layer them on top of the manual-exposure heightmap, set water level in KG appropriately. Result: plains waterways look decent, mountain rivers are each in their own individual Grand Canyons. I understand why this happened - every waterway has the same near-black gray value so every river/lake is exactly the same depth, requiring deep chasms to be cut into the mountains.

 

B) Select the contours of the waterways from the manual exposure heightmap, and save this (with original heightmap gray levels) as a new water map. Result: water resting on or near the surface of the terrain, but not in river channels. This I think is just because the heightmap is not detailed enough to really capture each river channel.

 

Here is my idea:

1) Select the contours of the waterways from the manual exposure heightmap, darken them a bit, then layer them back onto the heightmap. This should create channels and lakebeds a few meters below the surrounding terrain.

2) Also save the un-darkened waterway contours as a water map. This should put the water surface where the original terrain was, but water will fill down into the channels and lakebeds. I might also darken the water map just a tad, so the water surface is 1M below the lip of the channels.

 

Is that the right approach?

Link to comment
Share on other sites

Are you trying to get the water to appear as if it's running down the hills?

 

A tip for softening the edges of your 'canyons' is to use the gaussian blur tool on the whole water layer which will slightly soften all of the edges for you. You'll need to start at a low setting as it's quite severe when you turn it up. Alternatively try a blur option and see if you get a smoother gradient. 

 

Link to comment
Share on other sites

5 hours ago, Tallman Brad said:

Are you trying to get the water to appear as if it's running down the hills?

 

More or less, yes. I have the outlines of the real rivers in the area, and of course many of them originate in the mountains and run down the valleys. I expect there will be a stair-step effect in the water, but I'll evaluate how bad that is after I get the basic idea working.

 

The problem with the canyons isn't so much the sharp edge at the top, it's that water is at, say, level 40 and the terrain in the mountains is at level 100. So this "mountain stream" sits in a canyon that is 60m deep. A single map-wide water level just won't work. The stair-stepping mentioned above might mean that water map-based mountain rivers flowing down into the valley might also not work, but I'm hoping I can at least get the concept working.

 

If not I'll just stick to the rivers flowing through the valley/plains and limit myself to mountain lakes with no outflow.

 

Edit to add: an example from the heightmap with my original idea (very dark waterways; all the same color). This "worked" in that when I set an appropriate water level in KG (not using a separate water map, just the heightmap below), I'd get water in all the waterways. And the ones in the plain (NW part of the image) were pretty decent since it's mostly flat there. Up in the mountains SE, the rivers were 20-50m deep chasms.

 

image.png.252a8145777d6fb75eae11e1194029b0.png

 

And this is a separate water map created using the exact RGB of the underlying heightmap. This was attempt 2 which resulted in water on the surface (but in all the right places). My current idea is to darken this somewhat and use it in the height map (like the above picture) to create channels and lakebeds several meters deeper than the original terrain. Then use it also as a water map (possibly very slightly darker, to nudge the water surface down 1 or 2m).

 

image.png.48492e355ec6435f384a02b1f24cf153.png

 

Edit to add 2: well the idea seems to have worked, though I can't go in game at the moment to see it up close. Just looking at the preview, though, it looks like the river winding into the mountains SE is remaining in its channel and a little bit below the lip. As long as the water isn't too stair-steppy this might work out really well.

 

image.png.cd53083a2f12d490af70f107a72f24f3.png

Edited by Boidster (see edit history)
Link to comment
Share on other sites

1 hour ago, custom_hero said:

Generated 10 worlds with different settings. The generator is poor. much worse than nitrogen. sorry for the bad feedback

 

The generator is as good as the settings you give it to generate from. Perhaps instead of saying it's poor, offer some actual constructive feedback as to what you were hoping it would do.

On 7/28/2021 at 3:28 PM, Tallman Brad said:

I've put together a tutorial on drawing roads which involves editing splat files. I hope this helps somebody. 

 

Another good video. Will these canyon maps be realistic as far as not being filled with water? I was hoping there could be a color drawn on the map to indicate that water not be generated there. I don't know if that's even possible with random map generation in general.

Link to comment
Share on other sites

Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1892, in __call__
  File "gui.py", line 1250, in generate_world
  File "settings.py", line 26, in dump_settings
PermissionError: [Errno 13] Permission denied: '.\\KingGenConfig.txt'
Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1892, in __call

 

This error?

Link to comment
Share on other sites

4 minutes ago, Bailan1111 said:

Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1892, in __call__
  File "gui.py", line 1250, in generate_world
  File "settings.py", line 26, in dump_settings
PermissionError: [Errno 13] Permission denied: '.\\KingGenConfig.txt'
Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1892, in __call

 

This error?

PermissionError: [Errno 13] Permission denied: '.\\KingGenConfig.txt'

KingGen does not have permission to write in the folder where it is located. Run it as administrator, or move it to a different folder

On 7/28/2021 at 6:19 PM, Boidster said:

 

More or less, yes. I have the outlines of the real rivers in the area, and of course many of them originate in the mountains and run down the valleys. I expect there will be a stair-step effect in the water, but I'll evaluate how bad that is after I get the basic idea working.

 

The problem with the canyons isn't so much the sharp edge at the top, it's that water is at, say, level 40 and the terrain in the mountains is at level 100. So this "mountain stream" sits in a canyon that is 60m deep. A single map-wide water level just won't work. The stair-stepping mentioned above might mean that water map-based mountain rivers flowing down into the valley might also not work, but I'm hoping I can at least get the concept working.

 

If not I'll just stick to the rivers flowing through the valley/plains and limit myself to mountain lakes with no outflow.

 

Edit to add: an example from the heightmap with my original idea (very dark waterways; all the same color). This "worked" in that when I set an appropriate water level in KG (not using a separate water map, just the heightmap below), I'd get water in all the waterways. And the ones in the plain (NW part of the image) were pretty decent since it's mostly flat there. Up in the mountains SE, the rivers were 20-50m deep chasms.

 

image.png.252a8145777d6fb75eae11e1194029b0.png

 

And this is a separate water map created using the exact RGB of the underlying heightmap. This was attempt 2 which resulted in water on the surface (but in all the right places). My current idea is to darken this somewhat and use it in the height map (like the above picture) to create channels and lakebeds several meters deeper than the original terrain. Then use it also as a water map (possibly very slightly darker, to nudge the water surface down 1 or 2m).

 

image.png.48492e355ec6435f384a02b1f24cf153.png

 

Edit to add 2: well the idea seems to have worked, though I can't go in game at the moment to see it up close. Just looking at the preview, though, it looks like the river winding into the mountains SE is remaining in its channel and a little bit below the lip. As long as the water isn't too stair-steppy this might work out really well.

 

image.png.cd53083a2f12d490af70f107a72f24f3.png

Im not sure about this, I think it will end up looking like a staircase

Link to comment
Share on other sites

5 hours ago, DJQuad said:

 

Another good video. Will these canyon maps be realistic as far as not being filled with water? I was hoping there could be a color drawn on the map to indicate that water not be generated there. I don't know if that's even possible with random map generation in general.

You can set the water height in kinggen. In the canyon map I'm playing with I lowered the height so that there is only a thin layer at the deepest part of the canyon. It really depends on your heightmap depths too. 

Link to comment
Share on other sites

8 hours ago, custom_hero said:

Generated 10 worlds with different settings. The generator is poor. much worse than nitrogen. sorry for the bad feedback

it is still under development.

kingslayer is actively working on this, Nitrogen tho is not actively being worked on. 
Maybe post what you find wrong and i am sure king will happily listen to anything you may seek. 

 

Link to comment
Share on other sites

1 minute ago, Tallman Brad said:

You can set the water height in kinggen. In the canyon map I'm playing with I lowered the height so that there is only a thin layer at the deepest part of the canyon. It really depends on your heightmap depths too. 

 

Yeah the water height was what I was referring to. It's typically fine as the default as far as generating rivers, lakes, etc. But for canyons, being able to draw areas where water should not be generated would be ideal.

 

From your video, the current colors that can be draw are:

city = 0,0,255
town = 0,255,0
village = 255,0,255
no pois = 255,0,0

 

An additional color for "no water generated here" I suppose would be a feature request if it's even possible to do that with map generation.

Link to comment
Share on other sites

0.11.1 is broken on linux. I have downloaded 0.9.1 earlier, which works fine. Is it possible to download a 0.10 binary for linux?

 

~/tmp/kinggen$ ./KingGen-0.11.1
X Error of failed request:  BadIDChoice (invalid resource ID chosen for this connection)
  Major opcode of failed request:  55 (X_CreateGC)
  Resource id in failed request:  0x4a0009b
  Serial number of failed request:  1037
  Current serial number in output stream:  1039

 

~/tmp/kinggen$ rm KingGenConfig.txt

 

~/tmp/kinggen$ ./KingGen-0.11.1
X Error of failed request:  BadIDChoice (invalid resource ID chosen for this connection)
  Major opcode of failed request:  55 (X_CreateGC)
  Resource id in failed request:  0x4a0009b
  Serial number of failed request:  1050
  Current serial number in output stream:  1052

 

~/tmp/kinggen$

Link to comment
Share on other sites

17 hours ago, custom_hero said:

Generated 10 worlds with different settings. The generator is poor. much worse than nitrogen. sorry for the bad feedback

Need to be a little more specific. I know both tools very well, and there are some differences, but not many. What specifically is the problem?

Link to comment
Share on other sites

11 minutes ago, Snackiz said:

0.11.1 is broken on linux. I have downloaded 0.9.1 earlier, which works fine. Is it possible to download a 0.10 binary for linux?

 

~/tmp/kinggen$ ./KingGen-0.11.1
X Error of failed request:  BadIDChoice (invalid resource ID chosen for this connection)
  Major opcode of failed request:  55 (X_CreateGC)
  Resource id in failed request:  0x4a0009b
  Serial number of failed request:  1037
  Current serial number in output stream:  1039

 

~/tmp/kinggen$ rm KingGenConfig.txt

 

~/tmp/kinggen$ ./KingGen-0.11.1
X Error of failed request:  BadIDChoice (invalid resource ID chosen for this connection)
  Major opcode of failed request:  55 (X_CreateGC)
  Resource id in failed request:  0x4a0009b
  Serial number of failed request:  1050
  Current serial number in output stream:  1052

 

~/tmp/kinggen$

There is no v10 official download. Someone in the community might have a copy.

This bug is really frustrating because on my Fedora32 machine it works well and I have no idea what is causing the error for others.

Anybody from the community that has this linux error and wants to help me fix it, please contact me.

Edited by KingSlayerGM (see edit history)
Link to comment
Share on other sites

54 minutes ago, KingSlayerGM said:

There is no v10 official download. Someone in the community might have a copy.

This bug is really frustrating because on my Fedora32 machine it works well and I have no idea what is causing the error for others.

Anybody from the community that has this linux error and wants to help me fix it, please contact me.

I get the problem on a 64bit Debian GNU/Linux 11 (bullseye). Did you change a dependency or the window drawing code between 0.9 and 0.11?

Link to comment
Share on other sites

4 minutes ago, Snackiz said:

I get the problem on a 64bit Debian GNU/Linux 11 (bullseye). Did you change a dependency or the window drawing code between 0.9 and 0.11?

It the same GUI library for 10 and 11. I suspect the issue is caused by the new community heightmap download functionality.

Are you available for testing?

Link to comment
Share on other sites

17 hours ago, KingSlayerGM said:

Im not sure about this, I think it will end up looking like a staircase

 

It did. If I really wanted to get into it, I could try to make it look like waterfalls by increasing the heightmap of the riverbed at specific points. Buuuuut....that's a lot of work for 5000m of rivers. I know water blocks can be partially deformed; I wish they supported the smoothing function like terrain (not KG's issue I know).

Link to comment
Share on other sites

Is there a fix for the situation shown below? Pretty high variation in elevation on the heightmap and some towns near the mountains have this sort of 'platforming' going on, where the terrain appears to be forced upwards to support a POI. I do plan on creating a custom cities/towns map to overlay, but I'm wondering just how careful I'll need to be to avoid elevation changes within city/town/village areas. IOW, will I need to ensure that every designated town area is only in a flat-ish part of the heightmap? It wouldn't be a big deal; just want to be prepared.

 

I'm using "little" heightmap smoothing at the moment and city level is at 60.

 

image.png.b330e063d4129cf81e96a54dd90369c7.png

Link to comment
Share on other sites

3 hours ago, Boidster said:

Is there a fix for the situation shown below? Pretty high variation in elevation on the heightmap and some towns near the mountains have this sort of 'platforming' going on, where the terrain appears to be forced upwards to support a POI. I do plan on creating a custom cities/towns map to overlay, but I'm wondering just how careful I'll need to be to avoid elevation changes within city/town/village areas. IOW, will I need to ensure that every designated town area is only in a flat-ish part of the heightmap? It wouldn't be a big deal; just want to be prepared.

 

I'm using "little" heightmap smoothing at the moment and city level is at 60.

 

image.png.b330e063d4129cf81e96a54dd90369c7.png



Learn to use the masking tools, they are a LOT more advanced and precise than the ones included with Nitrogen. Create maps first without any prefabs, plan and prep them, then use the masking functionality to populate them, that will avoid problems like the one above in all cases except for maybe wilderness, though i find cliff like this still pretty rare.

2021-07-13_05h29_01.thumb.png.7beafdfde46be38b0791d2027a585adc.png

Link to comment
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
×
×
  • Create New...