Jump to content

KingGen - A Random World Generator for 7 Days to Die


KingSlayerGM

Recommended Posts

10 hours ago, KingSlayerGM said:

2. KingGen tries not to use the same poi multiple times, however sometimes it is forced to choose one it has used before. I can try to improve this, but given the fact that the list of pois is not infinite, at some point pois must be repeated.

The issue I have it generates multiple copies within close proximity (<100m same town). I suggest once per city or town.

 

10 hours ago, KingSlayerGM said:

3. I can't allow for empty lists. If you don't have a list, just use the vanilla list provided by KingGen

Example: I removed all road signs, and street lights. Throws list index errors.

 

Suggestion:

If (poi_list.count() < 1):

continue

else

...

 

Hope above is clearer.

Link to comment
Share on other sites

An update for you regarding linux gui

Ran the same test as I did previously only this time using the linux gui version.
 

The setup - Linux Ubuntu 20.04.2  LTS  desktop environment
Downloaded KingGen, then copied it from my users download folder to my users home folder and after making it executable ran it detached from the terminal using the command
./KingGen &

Then in the GUI on the desktop ran a straight up RNG generation with the seed 1234567890
Changed no other settings

Worked fine - generated the world in 34 seconds

Then went and changed the world name by adding a 2 to the end of it  and went into advanced settings, selected the 4ktest.png file as per the previous test on WNDOWS and told it to generate the world - no other settings were changed and I did notice the seed had been erased and left this blank.

It got to the same point as per the windows gui version - just sitting there on Generating random pois

 

Link to comment
Share on other sites

Version 0.6.0 released!

Here is what's new:

  • Smoother villages
  • Smoother roads
  • Optimized preview rendering
  • Custom biomes map support
  • Added single biome option
  • Added no city/town/village option
  • Added configfile support for CLI
  • Faster water generation
  • Reduced executable size
  • Added check for no streetlights/signs
  • Fixed seed not working
  • Fixed spawning random pois forever
Link to comment
Share on other sites

Really nice. Thanks again for going above and beyond on helping us Win7 users.

With that I just created 2 maps to have a look at the new program and I noticed it showed the first of the 2 and then as soon as the other one finished (quickly I might add) it showed that preview. I never really got a chance to see the first one and there was no way to go back to it.

I was wondering is there a way to tab the map previews so you could go back and forth between them to compare? Not sure how much mem it would use so even if it could show 3 or 4 that might help someone decide which of the maps they would like to use.

Thanks again for keeping this program alive and updated.

Link to comment
Share on other sites

3 hours ago, Gamida said:

Really nice. Thanks again for going above and beyond on helping us Win7 users.

With that I just created 2 maps to have a look at the new program and I noticed it showed the first of the 2 and then as soon as the other one finished (quickly I might add) it showed that preview. I never really got a chance to see the first one and there was no way to go back to it.

I was wondering is there a way to tab the map previews so you could go back and forth between them to compare? Not sure how much mem it would use so even if it could show 3 or 4 that might help someone decide which of the maps they would like to use.

Thanks again for keeping this program alive and updated.

Previews are saved inside the world folder. So you can always go there to have a look.

Link to comment
Share on other sites

Ok @KingSlayerGM I did a very quick test on windows 10 tonight with the new version



Running KingGen in a directory in my home directory

RWG - no seed entered - worked just fine

RWG - seed entered - worked just fine

 

Custom Height MAP - did not clear the seed...

Map file is on D Drive and users folder is on E Drive

Owner of file is my user account

 

Generating heightmap.
Generating biomes.
Generating cities.
Generating water.
Generating roads.
Generating villages.
Generating random pois.
Saving heightmap.
Generating spawn points.
Generating radiation.
Generating map info.
Generating ttw.
Generating preview.
Traceback (most recent call last):
  File "gui.py", line 925, in generate
  File "ntime.py", line 11, in ntime
  File "world.py", line 818, in run
  File "world.py", line 186, in generate
  File "world.py", line 213, in gen_preview
  File "drawing.py", line 15, in bump
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

 

It appears to have generated the dtm.raw file but I won't know till later if it actually paid attention to the height map it was given or not when I can check it out in game

Tried the same with the file moved to the users home directory tree - same sub dir that king gen is running  in.  Same result as above.

Will test it on linux desktop and get back to you as well as CLI tests

 

Link to comment
Share on other sites

@scallipus Thank you for testing. I really appreciate it :)
 

The error seems to occur when KingGen is rendering the preview. So the dtm.raw has already been created (I am not sure if correclty).

Can you please share the config file and the heightmap file that you used, so that I can reproduce the error and pin point the bug?

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

@KingSlayerGM sure I just ran the world in game - and basically it generated the terrain - Of course this was a quick and dirty adjusted height map as a test and nothing like my final maps end up but the overall land mass shape and the various islands are about right as far as their placement went etc.. So yeah it seems to be the preview that is bugging out

 

 

the test image is at the following url

4k_KG_test2.png

 

 

and config file...

  _  ___              _____
 | |/ (_)            / ____|
 | ' / _ _ __   __ _| |  __  ___ _ __
 |  < | | '_ \ / _` | | |_ |/ _ \ '_ \
 | . \| | | | | (_| | |__| |  __/ | | |
 |_|\_\_|_| |_|\__, |\_____|\___|_| |_|
                __/ |
               |___/
v0.6.0
7 Days to Die Random World Generator
Find out more at https://community.7daystodie.com/topic/23988-kinggen-a-random-world-generator-for-7-days-to-die/

SETTINGS:
burnt_size=medium
cities_size=medium
desert_size=medium
grid_size=medium
heightmap=E:/Users/myuser/KingGen/4k_KG_test2.png
mountains_size=medium
multiple_generations=1
name=KingGenWorld6
pois_list=vanilla
pois_number=medium
seed=1234567890
single_city=false
size=4
skip_preview=false
snow_size=medium
spawn_points=medium
terrain_roughness=medium
towns_size=medium
traders_number=medium
villages_size=medium
waste_size=medium
water_size=medium

Link to comment
Share on other sites

@scallipus thank you, I found the bug and fixed it. However I will not upload the fix until KingGen7, so it might be a week.

In the meantime I can suggest you to:

1) try a few times with random seeds and eventually your heightmap will work

2) use larger worlds (8K or above) and the error will not happen

 

Also I noticed that your heightmap goes from very low (2) to very high(255). This is permitted, but it might be undesirable. I would suggest to keep your heightmap between 30 and 230.

 

Btw this is what a world generated with your image looks like. Pretty cool if you ask me :)

GUr3N0C.jpg

One more thing: biomes.png files are now supported. Maybe that would go along well with your Australia project.

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

as mentioned it was a very quick and dirty test map level adjustment from my 10K map artwork.  Yes a bit of tweaking would need to occcur for a playable map, the original artwork was 20K x 20k and done it 8 bit grayscale and the land mass was level balanced for 32 or 34 to 180 or something (what works well for nitrogen as far as most maps go where you end up with your land mass low level set to 1 block above the water level).

As your maps have a higher low point I just raised the levels overall and then scaled it to 4K purely for a test, the actual live map on scallisgaming.com plays very nicely by the way...

I tend to work on real world terrain maps for games as it makes it a lot more interesting IMHO



And yes the map looks bloody awesome in the preview above thanks for looking into it and fixing the bug, I will continue to test a few things during this week - including the cli config file option, how it goes on linux gui and cli, and will also test out the custom biomes option :)

Keep up the great work you are doing its absolutely a breath of fresh air so far and for your efforts I honestly thank you :)



The current live 10K map looks like this on the server

ausmap.png

 

 

the screen shot cuts off tasmania but you get the idea based on the sheer volume of POI's

One thing I am wondering - from a programming design standpoint - why did you choose 16 bit grayscale as the basis for the height map image ??
It is because that is what the raw file uses or was it for some other reason?  As the colour space the game plays in is essentially 8 bit I would have thought an 8 bit map basis would be easier to work with - as a minor thing I noted when I viewed the map in game, a result for changing the colour space from 8 bit to 16 bit for me was it essentially required me to double the levels of the artwork (no easy feat when using sliders lol) compared to clamping it between 0 and 255...  the initial map test was mostly under water until I just boosted the levels - I was not really tweaking levels as simply setting a white point at one of the brightest areas and relevelling  the colour space at that.

If for program allowed for 8 bit grayscale levels it would make it a lot easier working in gimp doing level adjustments (at least from my point of view)

 

 

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

10 hours ago, KingSlayerGM said:

Previews are saved inside the world folder. So you can always go there to have a look.

I already knew about the previews in the folder but as you already were showing them in the program I was thinking you could tab through new ones you had just made and maybe even have a delete button there. If you saw one you had just made that you knew you would not be interested in using you could get rid of it right there and then without having to go directly to the folder to delete it. That way you only have usable maps in your folder.

Link to comment
Share on other sites

 

2 hours ago, Gamida said:

I already knew about the previews in the folder but as you already were showing them in the program I was thinking you could tab through new ones you had just made and maybe even have a delete button there. If you saw one you had just made that you knew you would not be interested in using you could get rid of it right there and then without having to go directly to the folder to delete it. That way you only have usable maps in your folder.

That would be cool. But it is low priority. Thank you for the suggestion anyway. I've added it to the list.

Link to comment
Share on other sites

4 hours ago, scallipus said:

One thing I am wondering - from a programming design standpoint - why did you choose 16 bit grayscale as the basis for the height map image ??
It is because that is what the raw file uses or was it for some other reason?  As the colour space the game plays in is essentially 8 bit I would have thought an 8 bit map basis would be easier to work with - as a minor thing I noted when I viewed the map in game, a result for changing the colour space from 8 bit to 16 bit for me was it essentially required me to double the levels of the artwork (no easy feat when using sliders lol) compared to clamping it between 0 and 255...  the initial map test was mostly under water until I just boosted the levels - I was not really tweaking levels as simply setting a white point at one of the brightest areas and relevelling  the colour space at that.

If for program allowed for 8 bit grayscale levels it would make it a lot easier working in gimp doing level adjustments (at least from my point of view)

 

 

Was your current server generated with Nitrogen?

 

Regarding 16-bit vs 8-bit. The game needs 16-bit. Otherwise the terrain would look blocky. This is proven by the fact that the file dtm.raw is a 16-bit file. I know that many editing software only work with 8 bits but  I can't change the game.

Link to comment
Share on other sites

12 hours ago, scallipus said:

as mentioned it was a very quick and dirty test map level adjustment from my 10K map artwork.  Yes a bit of tweaking would need to occcur for a playable map, the original artwork was 20K x 20k and done it 8 bit grayscale and the land mass was level balanced for 32 or 34 to 180 or something (what works well for nitrogen as far as most maps go where you end up with your land mass low level set to 1 block above the water level).

As your maps have a higher low point I just raised the levels overall and then scaled it to 4K purely for a test, the actual live map on scallisgaming.com plays very nicely by the way...

I tend to work on real world terrain maps for games as it makes it a lot more interesting IMHO



And yes the map looks bloody awesome in the preview above thanks for looking into it and fixing the bug, I will continue to test a few things during this week - including the cli config file option, how it goes on linux gui and cli, and will also test out the custom biomes option :)

Keep up the great work you are doing its absolutely a breath of fresh air so far and for your efforts I honestly thank you :)



The current live 10K map looks like this on the server

ausmap.png

 

 

the screen shot cuts off tasmania but you get the idea based on the sheer volume of POI's

One thing I am wondering - from a programming design standpoint - why did you choose 16 bit grayscale as the basis for the height map image ??
It is because that is what the raw file uses or was it for some other reason?  As the colour space the game plays in is essentially 8 bit I would have thought an 8 bit map basis would be easier to work with - as a minor thing I noted when I viewed the map in game, a result for changing the colour space from 8 bit to 16 bit for me was it essentially required me to double the levels of the artwork (no easy feat when using sliders lol) compared to clamping it between 0 and 255...  the initial map test was mostly under water until I just boosted the levels - I was not really tweaking levels as simply setting a white point at one of the brightest areas and relevelling  the colour space at that.

If for program allowed for 8 bit grayscale levels it would make it a lot easier working in gimp doing level adjustments (at least from my point of view)

 

 

You put snow in qld lol. That place don't get snow. But apart from that looks sweet as. Terrific job 

Link to comment
Share on other sites

@scallipus and @Cpt Krunch, after your suggestion I have added 8-bit heightmap support. With the next version of KingGen you will be able to select your 8-bit heightmap and KingGen will smooth it out for you to fill the whole 16 bits. This smoothing does change the image a little, but it shouln't be a problem. You can always use a 16-bit heightmap if you want perfection.

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

32 minutes ago, KingSlayerGM said:

@scallipus and @Cpt Krunch, after your suggestion I have added 8-bit heightmap support. With the next version of KingGen you will be able to select your 8-bit heightmap and KingGen will smooth it out for you to fill the whole 16 bits. This smoothing does change the image a little, but it shouln't be a problem. You can always use a 16-bit heightmap if you want perfection.

Awesome man truely awesome this makes life a lot easier and as you say still allows us to use 16 bit if we want absolute control over the contouring of the map thanks a heap...

I will be testing out the custom biomes stuff in a few minutes and will follow up with some tests on linux as well as both cli for windows and for linux using the basically same config file with paths edited accordingly


@stallionsden  I remember the old QLD tourism adverts on TV - Perfect One Day, Beautiful The Next....  Consider my take on it for my map as Irradiated One Day, Snowing The next :) (look at the tip of the cape to see the radiated zone :D )

 

Link to comment
Share on other sites

17 minutes ago, scallipus said:

Awesome man truely awesome this makes life a lot easier and as you say still allows us to use 16 bit if we want absolute control over the contouring of the map thanks a heap...

I will be testing out the custom biomes stuff in a few minutes and will follow up with some tests on linux as well as both cli for windows and for linux using the basically same config file with paths edited accordingly


@stallionsden  I remember the old QLD tourism adverts on TV - Perfect One Day, Beautiful The Next....  Consider my take on it for my map as Irradiated One Day, Snowing The next :) (look at the tip of the cape to see the radiated zone :D )

 

Haha either way looks great 🙂

Link to comment
Share on other sites

Ok in the windows gui - When using a custom BIOME map there was no preview generation error

Here is the resulting 10K map image - this was based on my existing nitrogen import.hm and all I have done is done a 6 unit level adjustment and exported it as a 16 bit grayscale image - no smoothing so chances are there will be terracing in the in game map.  The preview generated quickly in just 49 seconds and the biomes are exactly where they should be as per the custom biomes file also taken from my live server and updated to 24 bit RGB from the 8 bit indexed png file I was using.


kinggen_world8_preview.png

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

26 minutes ago, scallipus said:

Ok in the windows gui - When using a custom BIOME map there was no preview generation error

Here is the resulting 10K map image - this was based on my existing nitrogen import.hm and all I have done is done a 6 unit level adjustment and exported it as a 16 bit grayscale image - no smoothing so chances are there will be terracing in the in game map.  The preview generated quickly in just 49 seconds and the biomes are exactly where they should be as per the custom biomes file also taken from my live server and updated to 24 bit RGB from the 8 bit indexed png file I was using.

 

It looks nice. If you zoom in very close, you can see the terracing. But that will be gone with KingGen7, (or if you do your own smoothin on the file)

Link to comment
Share on other sites

17 hours ago, KingSlayerGM said:

 

That would be cool. But it is low priority. Thank you for the suggestion anyway. I've added it to the list.

Thanks for considering it. That is all one can hope for when making a suggestion.

Link to comment
Share on other sites

@KingSlayerGM  I generated a fresh 10K map based on the DEM models I work with and the terracing is a small artifact from that data set... overall it disappears pretty well when doing some smoothing in gimp at 20K and resampling down to 10K...   

I have setup a test server running the map King Gen has generated at scallisgaming.com... In the games launcher search scalli and the servers I run will show up, they are free to join and I only mention it here so you can check out how the map shows up on a server...


Things I have noted on this are, some roads ramp up nicely  and I have seen another that ramped up 1 block at basically 45 degrees, in the previous generation server test I did an hour ago, we had one road drop 3 - 4 blocks in height over 0 blocks in length resulting basically a 90 degree road drop on levels...

The large straight lines that appear to be an artifact for your POI placement (cities is where I really notice it)  is that there ends up being large straight sections of raised terrain at 45 or so degree angles. by straight I mean the lines that are perpendicular along the bottom floor and top floor of the terrain where you have gone from a lower level to an upper level (with your city being on the upper level),  I also notices all cities are flat and do not adjust to the terrain at all at least that is how it seems and in one case the city itself lowered a block compared to the terrain at one spot resulting in a 1 block road drop / raise over a 1 block length.

I understand that trying to smooth out terrain to place a poi is in and of itself a not so easy task and over all the way you have done things works pretty well...

One thing that might (asthetically help) is if there was some noise introduced to the slopes I mentioned above to give a more natural look to the slopes compared to how they currently look


Unfortunately tonight I did not get time to check out the linux GUI or CLI options or the windows CLI options as I got side tracked due to being excited when I saw the preview come up after adding the custom biome file and so spent more time testing the windows gui and the maps generated by setting up instances on the server.

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...