• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

KingGen - A Random World Generator for 7 Days to Die

I still dont know what is going wrong with the generation but is there a way to edit the images say if I wanted to go back and edit my CITIES

because for some reason Im not seeing the BG as Transparent anymore

 
On 8/8/2021 at 9:02 AM, Tallman Brad said:

Well that went up a bit quicker than I thought. Might not have finished processing the HD version yet. But here it is anyway. I hope someone finds it useful 



Thank you very much Tallman Brad for the new tutorial, although the truth is that I prefer to avoid headaches by making lots of maps and not liking so much what it turns out in the end, I keep what KingGen offers me, I do not ask for anything else I am happy with that.
Regards

 
With the caveat that I'm only just getting started trying to model an IRL location, could be completely wrong, and your life may be in danger if you follow anything I say...

I don't think the custom water map works quite like that. In my testing (attempting to put water into heightmapped IRL riverbeds and lakebeds, including mountain streams), the custom water map appears to override the global map water level. That is, if you add a custom water map into the mix, the 43 level that you entered is simply ignored. The only places water will show up on your map are places which have non RGB(0,0,0) grey colors.

And but so, if you want your riverbeds to be dry, but also to have water elsewhere on the map, you have a couple of options I think (please read the caveat above again, and put on a helmet before proceeding):

1) Make sure your dry riverbeds are higher in elevation than places where you want water, then just use the global water level (43 perhaps) to fill in the lower-lying water areas and the higher-elevation dry beds will remain dry.

2) Create a custom water map which paints out all of the water you want. Every non-dry lake and river must be painted in non-(0,0,0) colors appropriate for the local elevation. For example in my own world I might have a mountain lakebed at elevation 180, and the rim of the lake is elevation 190. If I paint that area (does not need to be precise - just cover the surface area of the lake) with (188,188,188), then water level in that area will be 188, filling the lake to within 2m of the rim.

My map has a few large rivers and a couple of lakes. I'm having to hand-paint all of them since they are all at different elevations. Hope that helps. Assuming I'm not 100% wrong!

Edit to add: below is my work-in-progress water map (on a white background; the white would not be exported to png). It all looks black here, but actually it is copied out of the original heightmap of the IRL location. If I were to try to use this, the water levels would be precisely at surface-level in the areas shown. The work-in-progress is me "sinking" the heightmap in just these areas by a couple/few meters, then sinking the watermap by 1m to put the water just below the rim of the river/lake.

The overall point is that water will only show up in these areas. No matter what I put into the KG global water level. At least that's been my experience in testing so far.

View attachment 20748
I spent a while experimenting with different settings for water maps today and I have discovered/confirmed a few things:

You are correct, kinggen's water height option is ignored if you use your own water map. 

When drawing your own water map treat it like a land height map and draw a base level for water, which will be the basic height of water round your island of the height you would have set in kinggen. So bucket fill the layer with 43,43,43 (for example). This ensures the base level for water through the whole map. 

Assuming the majority of your map is roughly 50 or 60 high (not including mountains) you will only need to paint 0,0,0 in the areas where you don't want any water. So your dry riverbed or lake. 

When carving a river or lake draw round the outside of your river/lake with the lasso and simply decrease its brightness a couple of points on the terrain heightmap to sink it evenly below the terrain. When creating the water layer, copy/paste the actual heightmap of the river or lake from the terrain heightmap into the water layer and, while still selected, increase its brightness by 1 or two points to create a river or lake that sits just above the height of the river or lake bed you just carved. 

I very quickly managed to create an overall base water height, parted the sea area bordering the map like moses, flooded 3 identical craters with different levels of water and made a stream  in a channel, that followed the terrain, down from a raised volcano shaped crater. The stream was hideous thanks to the water engine in 7dtd but I couldn't find anything else left to do with water after that. 

1 water map, no water settings in kinggen, it was all very possible just with a water map. 

Hard to explain in text form. But I'm not in a position to do a video until I get back from holiday unfortunately. 

 
Last edited by a moderator:
The stream was hideous thanks to the water engine in 7dtd but I couldn't find anything else left to do with water after that. 


Yep, I did pretty much what you described and with similar results. I have abandoned the really steep mountain rivers, opting instead for a couple of lakes. But the long river that flows through the valley I have decided to try to chop into 3 chunks and then cut their channels into the heightmap (and adjust the water level accordingly) using local minimum terrain height as a guide.

So for example broadly speaking the northeast section of river might have a minimum riverbed height (from the IRL heightmap) of 45. The central section might have a minimum of 38, and the southern section might have a minimum of 30. IRL the river flows smoothly down a gently sloping valley. Due to the crappy 7D2D water engine, though, I can't do "smoothly flowing" down the valley so the portions of the river will be set up like this:


River Zone


Riverbed

(heightmap)



Water Level

(water map)



North


42


44


Central


35


37


South


27


29



What I expect is that each section will have steeper sides where the local heightmap was higher, but at least a 1m high river bank near the minimum original terrain height. At the transitions between the zones, there will be a (likely ugly) waterfall effect, but it ought to not be as bad as the ugliness I had when I tried to do an end-to-end sloping river. This will be more like having three 2000m long flat rivers, joined at ugly but relatively small transition points. Maybe I can get cute with pixel-level heightmap editing and actually make it look like a waterfall. 🙂

 
Yep, I did pretty much what you described and with similar results. I have abandoned the really steep mountain rivers, opting instead for a couple of lakes. But the long river that flows through the valley I have decided to try to chop into 3 chunks and then cut their channels into the heightmap (and adjust the water level accordingly) using local minimum terrain height as a guide.

So for example broadly speaking the northeast section of river might have a minimum riverbed height (from the IRL heightmap) of 45. The central section might have a minimum of 38, and the southern section might have a minimum of 30. IRL the river flows smoothly down a gently sloping valley. Due to the crappy 7D2D water engine, though, I can't do "smoothly flowing" down the valley so the portions of the river will be set up like this:


River Zone


Riverbed

(heightmap)



Water Level

(water map)



North


42


44


Central


35


37


South


27


29



What I expect is that each section will have steeper sides where the local heightmap was higher, but at least a 1m high river bank near the minimum original terrain height. At the transitions between the zones, there will be a (likely ugly) waterfall effect, but it ought to not be as bad as the ugliness I had when I tried to do an end-to-end sloping river. This will be more like having three 2000m long flat rivers, joined at ugly but relatively small transition points. Maybe I can get cute with pixel-level heightmap editing and actually make it look like a waterfall. 🙂
The vanilla waterfall prefab is still included in the install, you could also make your own water block to cover the transition blemishes.



 

 
Last edited by a moderator:
I know i could do it but i have lots to learn about map designing and making mods but since some of yall made a UK shaped map as well as Europe but it would be cool if yall could try and make maps shaped like Texas or the U.S mainland.

 
So this would be post-generation, using the world editor to put the prefabs where I need them?
Correct, takes literally minutes

While we are on the subject of water. I wanted to mention something you posted on a few days ago. If you are looking to add dry river beds/craters below your maps set water level, here is a trick i use.

Generate a map with all the water you know you want. Save that map as #1

Add in the features where you Do Not want water to populate, save it, and make a new map with that, map#2

Delete the 'water_info.xml' from map #2, and replace it with the 'water_info.xml' from map#1, open that up and you will find you have those new features with no water.

Just remember to save this step until the end and make a backup of that water file, if you regen it again, its going to fill in like normal.

 

I know i could do it but i have lots to learn about map designing and making mods but since some of yall made a UK shaped map as well as Europe but it would be cool if yall could try and make maps shaped like Texas or the U.S mainland.
Dont you worry old son, Uncle Krunch got you. Long live the Republic :)

Still needs some work, but Ive been planning to make an all desert/forrest map out of this one with some highways.

 

2020-11-22_02h59_52.jpg

 
Correct, takes literally minutes

While we are on the subject of water. I wanted to mention something you posted on a few days ago. If you are looking to add dry river beds/craters below your maps set water level, here is a trick i use.

Generate a map with all the water you know you want. Save that map as #1

Add in the features where you Do Not want water to populate, save it, and make a new map with that, map#2

Delete the 'water_info.xml' from map #2, and replace it with the 'water_info.xml' from map#1, open that up and you will find you have those new features with no water.

Just remember to save this step until the end and make a backup of that water file, if you regen it again, its going to fill in like normal.

 

Dont you worry old son, Uncle Krunch got you. Long live the Republic :)

Still needs some work, but Ive been planning to make an all desert/forrest map out of this one with some highways.

 

View attachment 20753
Oh hell yeah now thats what im talking about keep up the awesome work. Also all of north and east texas is woods and plains in real life so that section can be forest while all of south and west texas is a desert so that can be the biome layout in this map and the waistlands can be major cities like san antonio and huston

 
Last edited by a moderator:
I thought I was doing something a bit clever to make my cities and towns a bit more diverse, but KingGen keeps throwing errors on generation.

Would this be causing it?  I wanted the bookstore to be in the downtown of both towns and cities, but only the commercial areas of cities. (just to be different).

 

xcostum_Book_Stop(by_Hydroponic),35,8,25,-1,1,pine_forest/desert,town/city,downtown,,
xcostum_Book_Stop(by_Hydroponic),35,8,25,-1,1,pine_forest/desert,city,commercial,,




The error logs i'm getting look like below

 

Traceback (most recent call last):
File "crash_log.py", line 19, in handle_crash_log
File "gui_generation.py", line 27, in generate
File "ntime.py", line 11, in ntime
File "world.py", line 1258, in run
File "world.py", line 276, in generate
File "world.py", line 665, in gen_random_pois
File "rrlist.py", line 25, in get_random
IndexError: list index out of range




This isn't the only place in my pois file I've made this kind of edit, it's just an example.

 
Correct, takes literally minutes

While we are on the subject of water. I wanted to mention something you posted on a few days ago. If you are looking to add dry river beds/craters below your maps set water level, here is a trick i use.

Generate a map with all the water you know you want. Save that map as #1

Add in the features where you Do Not want water to populate, save it, and make a new map with that, map#2

Delete the 'water_info.xml' from map #2, and replace it with the 'water_info.xml' from map#1, open that up and you will find you have those new features with no water.

Just remember to save this step until the end and make a backup of that water file, if you regen it again, its going to fill in like normal.

 

Dont you worry old son, Uncle Krunch got you. Long live the Republic :)

Still needs some work, but Ive been planning to make an all desert/forrest map out of this one with some highways.

 

View attachment 20753
oh I got another good idea instead of all the states in the lower 48 how about just the states in the south, cause when u think about it more gun owners live in the south than all other american regions combined also theres alot more smart people in the south so out of all the American regions the south would obviously have the highest survival chance. Not to mention it would be interesting to see a large island or landmass shaped like the south.

 
oh I got another good idea instead of all the states in the lower 48 how about just the states in the south, cause when u think about it more gun owners live in the south than all other american regions combined also theres alot more smart people in the south so out of all the American regions the south would obviously have the highest survival chance. Not to mention it would be interesting to see a large island or landmass shaped like the south.
Doing just the south would scale a little better than trying the whole lower 48. Scaling everything is really the hardest part. The maps are all squared, so it can be hard to get enough good space without ending up with either too much empty water space or too much unusable high elevation terrain in places like the Appalachian Mountain states. I can take another look at breaking up the 48 into regions. Its also a bummer not to have custom biomes, Florida would also be pretty cool.
 

 
I thought I was doing something a bit clever to make my cities and towns a bit more diverse, but KingGen keeps throwing errors on generation.

Would this be causing it?  I wanted the bookstore to be in the downtown of both towns and cities, but only the commercial areas of cities. (just to be different).

 

xcostum_Book_Stop(by_Hydroponic),35,8,25,-1,1,pine_forest/desert,town/city,downtown,,
xcostum_Book_Stop(by_Hydroponic),35,8,25,-1,1,pine_forest/desert,city,commercial,,




The error logs i'm getting look like below

 

Traceback (most recent call last):
File "crash_log.py", line 19, in handle_crash_log
File "gui_generation.py", line 27, in generate
File "ntime.py", line 11, in ntime
File "world.py", line 1258, in run
File "world.py", line 276, in generate
File "world.py", line 665, in gen_random_pois
File "rrlist.py", line 25, in get_random
IndexError: list index out of range




This isn't the only place in my pois file I've made this kind of edit, it's just an example.
Add commercial to the first poi and delete the 2nd you made . A poi can have multiple zones, biomes and townships. But KG doesn't like double ups of a poi.

Also towns don't have a downtown  only cities do as kingslayer pointed out. 

 
Last edited by a moderator:
Doing just the south would scale a little better than trying the whole lower 48. Scaling everything is really the hardest part. The maps are all squared, so it can be hard to get enough good space without ending up with either too much empty water space or too much unusable high elevation terrain in places like the Appalachian Mountain states. I can take another look at breaking up the 48 into regions. Its also a bummer not to have custom biomes, Florida would also be pretty cool.
 
yeah now that u mentioned it the game needs a swamp biome considering swampland stretches from louisiana to florida and yeah dividing the lower 48 by what regions the states are in would be easier also if we could use the biome of our choice to mark the borders between the states that would be interesting.

 
KG checks the name to determine if it is a trader
oh ... you should change this with a new parameter in the poislist. :)

FWIW, I just opened a 19.3 POI editor session and checked this option:

View attachment 20746

Here's what popped into view (this is 'business_burnt_01'):

View attachment 20747

The "Rotate" button does what you'd exoect - the black arrow rotates around the blue cube.
Hmmm..... Version 19.3.... yesterday i thought that it might be possible that the pimps did some kind of "weird optimization fault" in Version 19.5/19.6 and so the marker is gone. i will try it with an older version ! 

thank you :)

 
Got it.

thanks to Boidster ! your screenshot was the solution.
its "show facing" on the 3rd tab of the editor and not "show prefab facing" from the 2nd tab :)
the facing of my prefab is correct but my wife had a better idea to fix this problem forever :)  she told me to open my trader-prefab to all 4 sides which i did and the problem is solved now.

 

 
Still have a few questions - 

1. Can you easily edit the Cities and Biomes w/o starting complete over ? The reason I ask is when I reopen the files I dont have the transparent BG any longer?

2. Can you simply resize for the other map sizes or is it better to redraw?

3. Im having issues with getting any WOTW POI Selected aside from the TRADERS ( I have them required) any insight for this?

 
Still have a few questions - 

1. Can you easily edit the Cities and Biomes w/o starting complete over ? The reason I ask is when I reopen the files I dont have the transparent BG any longer?

2. Can you simply resize for the other map sizes or is it better to redraw?


I'm no expert, but these two questions maybe I can give some help on.

1. You really ought to be using GIMP (or a similar graphics program) and keep all of your maps in layers. If you're doing a full custom map, maybe you'd have these layers in roughly this order top to bottom:

  • Cities layer
  • Biomes layer
  • Water layer
  • Heightmap layer
  • All black layer
  • All white layer
Then you just ensure that only the layer you want to export is visible when making your PNG. Need to change your cities layout? Make the cities layer and maybe all-black or all-white visible (for easier visibility while editing), do your edits, then turn off all layers except Cities and export it as PNG and re-generate your world. When I'm working on my map I have multiple copies of each layer because when I try a new thing I want to keep the original layer in case I goof up (though GIMP does have an excellent multiple-step undo feature).

2. Resizing should work fine in most cases. I work on an image in GIMP that is 1024x1024 and then resize to 8192x8192 after export. Working on the full 8K image would take quite a bit more memory and processing would slow to a crawl on my mid-potato PC.

 
I do Height, Biomes, Cities  and all I do is export it - How would I safe an inprocess one to be able to edit? Just a normal save like in Paint?

 
I do Height, Biomes, Cities  and all I do is export it - How would I safe an inprocess one to be able to edit? Just a normal save like in Paint?


What program are you using? Are those each layers, or separate image files? I'm not entirely clear on what you're asking, sorry, but I'm willing to try to help once I understand.

 
Back
Top