Jump to content

KingGen - A Random World Generator for 7 Days to Die


KingSlayerGM

Recommended Posts

KingGen v0.11.1
Random World Generation for 7 Days to Die

This is the official webpage of KingGen, a tool to generate beautiful maps for 7 Days to Die.

 

Give feedback here: google form

Follow development here: trello board

 

Downloads:

Windows - 64 bit

Linux - 64 bit

 

Usage:

  • Download KingGen.
  • Run it.
  • Choose your preferences and click “Generate world”.
  • KingGen will create a folder containing the world. You have to copy it into 7 Days to Die’s worlds folder, usually: “%appdata%\Roaming\7 Days to Die\GeneratedWorlds”

 

Why KingGen?

  • The generated worlds are beautiful, with natural landscapes and large cities.
  • The generation is faster than vanilla, even on old machines.
  • Biomes are randomly placed, no repetitiveness.
  • Deserts and snow never touch.
  • KingGen is purely noise based, no stamps are used. This means that no two lakes look the same, nor two mountains.
  • Advanced customization supported.

 

Tutorials

Thanks to @Tallman Brad for the fantastic tutorials!

 

 

Screenshots:

Editor

z3KED8d.png

 

4K

CN0MJ1e.jpg

 

8K

aoRq6e4.jpg

 

16K

I5333jL.jpg

 

An 8K heightmap

fTpmRZ1.jpg

 

Performance:
KingGen is incredibly performant. It is several times faster than vanilla generation thanks to its parallelized algorithm that takes advantage of all your cpu cores.

This table summarizes KingGen’s performance on a laptop. You can expect even better results on a gaming pc.

 

Size of world Execution time Ram usage
4K 30 sec 400 MB
8K 2 mins 1.5 GB
12K 4 mins 3 GB
16K 8 mins 6 GB
Edited by KingSlayerGM (see edit history)
Link to comment
Share on other sites

Posted (edited)

Version 0.11.0 released!

Here is what's new:

  • Fixed error with CLI on Windows
  • Fixed bug with preview generator and water level
  • Fixed bug with roads
  • Added coordinates to preview
  • Added poi names to preview
  • Updated vanilla poi list to A19.5
  • Added crash log to tools
  • Added rgb heightmap support
  • Added community heightmaps download button
  • Preview now appears in editor after beign generated from tool
  • Improved road generation (still work in progress, however large worlds, like 16K, should be faster to generate now)
  • Added option to load pre generated world into editor

Version 0.10.0 released!

Here is what's new:

  • Fixed bug with water map
  • Added custom radiation map import
  • Added custom splat file import
  • Added option for water level
  • Added option for cities elevation
  • Added option for snow elevation

Version 0.9.0 released!

Here is what's new:

  • Fixed spawns in water
  • Fixed crevasse near villages
  • Fixed import of images in palette mode
  • Added spawn points to preview
  • Added dialog for output folder
  • Added button to open generated worlds folder
  • Added option for border biome
  • Added option for traders in the wilderness
  • Added option for heightmap smoothing
  • Added option to control grid size of cities, towns and villages individually
  • Added option to control number of cities, towns and villages individually
  • Improved water edges
  • Added custom water map import
  • Added forced generation of cities if imported cities map is empty. This is usefull if you want to use the cities map only to restrict some areas from the generation, but you still want KingGen to generate the cities.

Version 0.8.0 released!

Here is what's new:

  • Added very wide biomes option
  • Added label to identify game version (for compatibility)
  • Added key bindings: "enter" to start generation, "escape" to stop generation, "escape" when not generating to close the editor, "tab" to switch to advanged settings and back
  • Added option to customize world border
  • Added option to choose output folder
  • Optimizations for smoothing world around pois
  • Added support for raw heightmap import
  • Added tools for map makers:
    • png to raw
    • raw to 16 bit png
    • raw to 8 bit png
    • biomes file fix
    • splat file fix
    • preview generator for any world
  • Optimized caching of native functions
  • Improved mountains. Sharper edges, rougher terrain.
  • Added dynamic elevation for cities. Now cities spawn at whatever height the terrain underneath is
  • Added cities map import: you can now draw cities on a file and KG will generate cities accordingly
  • Added zoning map import: you can mask zones on a png file and KG will use that to generate pois

Version 0.7.0 released!

Here is what's new:

  • Added biomes/mountains spacing option
  • Biomes are now slightly larger with larger maps
  • Added option to save png heightmaps
  • Added support for 8-bit heightmaps import
  • Biomes creation optimizations
  • Preview rendering optimizations
  • Fixed bug with roads
  • Added compatibility with Darkness Falls (to be verified)

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

Version 0.5.0 released!

Here is what's new:

  • Improved village generation (now smoother)
  • Added option for all custom sizes 5K,6K,7K....
  • Added city grid size option
  • Added spawn points option
  • Added button to increase and decrease number of generations
  • Added header image
  • Added check for newer versions available
  • Added Rtree data structure for cities towns and villages locations

Version 0.4.0 released!

Here is what's new:

  • Improved village generation. Now villages spawn on mountains and are connected one another by roads.
  • Added option to generate multiple worlds at once.
  • Added terrain roughness option.
  • Added single-city option.
  • Added no-preview option to make generation faster.
  • Added check when creating cities. The game now tells you which pois are missing from the custom list.
  • Added check to skip commented/empy/wrongly-formatted lines in custom list.
  • Added button to open worlds folder.
  • Expanded tips at the top.
  • Added link to KingGen page.
  • Added settings files.
  • Seed is now optional
  • Player spawns are now closer to traders.
  • Added "reset to default settings" button.

Version 0.3.0 released!

Some new feature are:

  • Improved city generation
  • Improved poi placement
  • Improved GUI
  • Fixed bugs

Version 0.2.0 released!

Some new features are:

  • City districts
  • Smooth roads
  • Improved world generation
  • Improved UI

Version 0.1.0. released!

Some new feature are:

  • Added custom heightmap support
  • Added custom POIs support
  • Improved world generation
  • Improved interface
Edited by KingSlayerGM (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...
Posted (edited)

Community heightmaps!

Hello everyone! I am pleased to announce that the next version of KingGen will support community heightmaps. Users will be able to share their creations with the community so that others can enjoy them too!

 

How it works

Community members can submit their heightmaps to this google form. Heightmaps will be stored on a server from which they can be downloaded by KingGen with just a click. Users will see them from within KingGen and they will be able to select and download what they like. Everybody is welcome to submit heightmaps.

 

Heightmaps

Heightmap files must be grayscale png images, either 8bit or 16 bit. They must match the size of the world they are meant for. For example 4K, 6K, 8K, 10K, 12K, 14K and 16K use 4096x4096, 6144x6144, 8192x8192, 10240x10240, 12288x12288, 14336x14336 and 16384x16384 images respectively.

 

 

Topics

Heightmaps can be about anything! They can be countries, animal silhouettes, mystic lands, geometric shapes... Anything! Let you imagination wonder freely.

 

Videos

 

Edited by KingSlayerGM (see edit history)
  • Like 18
  • Thanks 4
Link to comment
Share on other sites

Posted (edited)

User Guide

This guide will help you getting started with KingGen. It is advisable to read thoroughly. If you want a nice video tutorial I sugget you check out @Tallman Brad's video here.
KingGen is a tool to generate worlds that are playable in 7 Days to Die. The generation is procedural, which means that an algorithm will create the world for you. Also every time you run such algorithm, you get a different world. This is great, because you can play the game over and over again in different worlds, without getting bored.

 

Getting Started

First off, download KingGen. You can find the download links at the top of this page. KingGen is provided as an executable file for Windows 64 bit and Linux 64 bit. It is packaged inside a single file so that it is easier to distribute. Once you have downloaded KingGen, make sure it is located somewhere on your disk where it has writing permission (like in your home folder), or in alternative run it as administrator. Also make sure that there is enough space available on your disk. This is necessary because KingGen needs to save the generated worlds. Once that is taken care of, it is time to run it.

 

Windows

Double-click to start it. Windows might warn you that the publisher is unknown, but you can go ahead and click "run anyway" (buying certificates to be a publisher is expensive).

 

Linux

Depending on your distribution, you might just double-click it, or you might have to run it from the terminal. To run it from the terminal open a terminal window at the location of KingGen. Give the file execution permission with:

chmod +x ./KingGen

Fnally run it with: 

./KingGen

 

Once you have started it, give it a few seconds to load and then the editor will appear.

 

Generating First World

To generate your first world using the default settings, simply click on the big button on the left side of the panel that says "Generate World". Now the tool will start and you will be able to see its output log on the left side. The default world is 8K in size and it is called KingGenWorld. Once the generation is completed a folder will appear with the same name of the world and a big preview image will appear on the right side of the panel. The preview image is a map of the newly generated world, in which you can see biomes, mountains, lakes, cities and the traders, which are small rectangles of blue color on the map. A preview image is also saved inside the world folder.

 

In order to play this world, you have to copy its folder to the 7 Days to Die world folder, which is usually located under  “%appdata%\Roaming\7 Days to Die\GeneratedWorlds”. If you don't have this folder  you have to create it manually or you can generate a world from within 7 Days to Die and the game will create the folder for you. Once you have copied the world into this folder, you are ready to fire 7 Days to Die and start a new game. You will find the newly generate world in the worlds list.

 

Settings

You you are not satisfied with the default generation, or you just like to mess around and experiment, KingGen offers a lot of options to customize the world as you like. Firt off, on the left side of the panel you can find the basic settings: world name, world size and world seed.

 

Name

The world name is the name of the folder and the name that you will see inside 7 Days to Die. Keep in mind that two worlds cannot have the same name. Also keep in mind that the world is not the saved game and these two can have different names.

 

Size

The world size is either 4K, 8K or 16K. Each of them is a square and their sizes, in blocks, are respectively 4096x4096, 8192x8192 and 16384x16384. Their area is respectively 16Km2, 64Km2 and 256Km2.

 

Seed

The world seed is a sequence of characters that determines the randomness of the generation. Two generations with different seeds, will generate different worlds. Two generation with the same seed will generate the same world. You can put anything you want as seed or you can leave it empty for a random seed.

 

Advanced settings

The advanced settings tab allows you to control the generation more in depth. There are options to control:

  • POIs used and placement. Custom pois are supported
  • Cities, towns and villages generation
  • Landscape generation (biomes, mountains, terrain roughness...)
  • World border
  • Advanced tools
  • Advanced imports (heightmaps, biomes map, cities map...)

 

Custom heightmaps

KingGen allows you to import custom heighmaps. You might like to create them yourself or you might have found a cool looking one online, well you are in luck because now you have a way to use them inside the game. If you do not know about heightmaps, skip this option, it is not fundamental.

 

If you want a nice video tutorial for custom maps I suggest you check out @Tallman Brad's video here.

 

In order to be acceptable, heightmaps must sutisfy some requirements. Heightmaps must be 8-bit or 16-bit, grayscale, png images. Alternatively they can be raw files of the same kind used in the game. The size of heightmaps must be exactly the same as the world you are trying to generate (4096x4096 or 8192x8192 or 16384x16384). If your images do not satisfy these requirements, you might want to use a third party software to convert/adjust it, such as Photoshop or Gimp.

Furthermore there are a few things to keep in mind when designing your own custom heightmap. The world goes from 0 to 255 blocks in height. 0 is the bedrock level and 255 is the build limit. The water level in KingGen is fixed at 43, so any land below that will be submerged. Anything above 100 will be covered in snow. Cities generate only between levels 43 and 70. It is preferable to have flat land around level 60.

 

Custom biomes maps

KingGen allows you to import custom biomes maps. If you do not know about biomes maps, skip this option, it is not fundamental.

 

In order to be acceptable, biomes maps must sutisfy some requirements. Biomes maps must be 24-bit (or 32-bit), rbg (or rgba), png images and their size must be exactly the same as the world you are trying to generate.

 

The colors allowed in biomes maps are:

██ pine forest = 0,64,0

██ snow = 255,255,255

██ desert = 255,228,119

██ burnt forest = 186,0,255

██ wasteland = 255,168,0

These are the default colors used by the game.

 

Custom cities maps

KingGen allows you to import custom cities maps. If you do not know about cities maps, skip this option, it is not fundamental.

 

Cities maps are masks that tell KG where and how to generate cities, towns and villages. You can basically draw any shape you want and KG will create a city with that shape. Here is an example:

aLY4MoA.jpg

 

In order to be acceptable, cities maps must sutisfy some requirements. Cities maps must be 24-bit (or 32-bit), rbg (or rgba), png images and their size must be exactly the same as the world you are trying to generate.

 

The colors allowed in cities maps are:

██ city = 0,0,255

██ town = 0,255,0

██ village = 255,0,255

██ no pois = 255,0,0

The "no pois" color prevents KingGen from placing any random pois in that area.

 

Custom zoning maps

KingGen allows you to import custom zoning maps. If you do not know about zoning maps, skip this option, it is not fundamental.

 

Zoning maps are masks that tell KG the type of POIs to use in certain areas. For example industrial buildings vs commercial buildings.

 

In order to be acceptable, zoning maps must sutisfy some requirements. Zoning maps must be 24-bit (or 32-bit), rbg (or rgba), png images and their size must be exactly the same as the world you are trying to generate.

 

The colors allowed in zoning maps are:

██ old residential = 255,100,0
██ new residential = 255,255,0

██ downtown = 0,255,0

██ industrial = 0,0,255

██ commercial = 255,0,255

 

 

Custom water maps

KingGen allows you to import custom water maps. If you do not know about water maps, skip this option, it is not fundamental.

 

In order to be acceptable, water maps must sutisfy some requirements. Water maps must be 8-bit, grayscale, png images. The size must be exactly the same as the world you are trying to generate (4096x4096 or 8192x8192 or 16384x16384). If your images do not satisfy these requirements, you might want to use a third party software to convert/adjust it, such as Photoshop or Gimp.

 

Water maps tell KingGen where the water is. The value of each pixel determines the elevation of water in that point. A value of 0 means no water. Water maps merely tell KingGen how to generate the waterinfo.xml file. Water maps DO NOT change the heightmap itself. So it is your duty to provide a suitable heightmap along with the water map.

 

Custom POIs

KingGen allows you to generate a world with your own custom POIs, including the Compo-Pack. If you are not familiar with modding and custom POIs you can skip this option, it is not fundamental.

 

If you want a nice video tutorial about custom pois and the Compo Pack I suggest you check out @Tallman Brad's video here.


KingGen has an internal list of vanilla POIs, taken from the latest version of the game. For the generation you can use this list and KingGen will generate a world only using vanilla POIs. If you want to use Compo-Pack POIs instead, you can check out the Compo-Pack page or you can check out the Compo-Pack discord for a detailed guide.


For any other custom POIs that you might want yo use, you must provide KingGen with a list of comma separated values formatted as follows: each POI must be listed on a new line and be written as <name>,<x size>,<y size>,<z size>,<y offset>,<rotation to face north>,<allowed biomes>,<allowed townships>,<zones>. Any POI that does not follow this format will be ignored. Here is an example taken from the vanilla list:

abandoned_house_01,24,18,26,-1,2,burnt_forest/snow/pine_forest/desert/wasteland,rural/city/town/wilderness,residentialold
abandoned_house_02,24,17,25,-1,2,burnt_forest/snow/pine_forest/desert/wasteland,rural/city/town/wilderness,residentialold
abandoned_house_03,21,16,28,-1,2,burnt_forest/snow/pine_forest/desert/wasteland,rural/city/town/wilderness,residentialold

 

The allowed values for biomes are: pine_forest, burnt_forest, desert, snow and wasteland.

The allowed values for townships are: city, town, rural and wilderness.

The allowed values for zones are: residentialold, residentialnew, downtown, commercial, industrial and any.
Any other values will be ignored. Please note that any POI with "waste" in their name will be automatically considered a wasteland-only POI. This is to accomodate vanilla's POIs that do not come with a AllowedBiomes property.
 

If you do not want to write one such list by hand, KingGen will generate one for you given a folder containing all the custom POIs. See the advanced setting of the tool for this option.

 

World preview

After the generation has completed, the editor will display a preview map of the generated world. A copy of the map is also saved inside the world folder with the name "preview.png". The preview will show you the location of each biome and each POI. POIs are drawn with different colors according to the following table:

██ wilderness

██ old residential
██ new residential

██ downtown

██ traders

██ industrial

██ commercial

 

Command line interface (for nerds)

KingGen comes with a command line Interface. This is helpful if you want to automate the generation trough a script to generate lots of worlds.

 

On Windows you can run the tool in a terminal like so:

./KingGen gen <world name> <size> | more

When running the CLI on Windows, always end the command with "| more".

On Linux you can run the tool in a terminal like so:

./KingGen gen <world name> <size>

 

More options are available, use "-h" to get an help message that lists all of them.

 

All the map makers tools are available through the GUI and the CLI as well. The tools are accessed with the following subcommands:

  • gen
  • poislist
  • pngraw
  • rawpng16
  • rawpng8
  • biomesfix
  • splatfix
  • preview

 

To get a specific help message for a subcommand, use "-h" option after the subcommand.

Edited by KingSlayerGM (see edit history)
  • Like 2
  • Thanks 2
  • Have a Cookie 1
Link to comment
Share on other sites

2 hours ago, KingSlayerGM said:

KingGen Beta
Random World Generation for 7 Days to Die
This is the official webpage for KingGen, a tool to generate beautiful maps for 7 days to die.

KingGen is in Beta, you should expect crashes and misplaced pois. Feedback is welcome.
Downloads:

Windows 64 bit

Linux 64 bit

Usage:

  • Download KingGen.
  • Run it.
  • Choose your preferences and click on “Generate”.
  • KingGen will create a folder containing the world. You have to copy it into 7 Days to Die’s worlds folder, usually: “%appdata%\Roaming\7 Days to Die\GeneratedWorlds”

Why KingGen?

  • KingGen is incredibly fast, even on old machines.
  • The generated worlds are beautiful, with huge mountains and large cities.
  • Biomes are randomly placed, no repetitiveness.
  • Deserts and snow never touch.
  • KingGen is purely noise based, no stamps are used. This means that no two lakes look the same, nor two mountains.
  • KingGen is also customizable to suit one's needs.

Screenshots:

UtrMM0Y.png

 

4K

XQAnSfE.png

 

8K

zBlIk3q.jpg

 

16K

5tZcnMD.jpg

Performance:
KingGen is incredibly performant. It is several times faster than vanilla’s generation thanks to its parallelized algorithm that takes advantage of all your cpus cores.

This table summarizes KingGen’s performance on a laptop. You can expect even better results on a gaming pc.

Size of world Execution time Ram usage
4K 25 sec 300 MB
8K 1 min 30 sec 1.2 GB
16K 7 min 30 sec 5 GB

 

 

Hi KingSlayerGM


Thank you very much for this new tool, although Nitrogen continues to work well, it needs to be updated, it generates somewhat strange worlds.
I will try it and start a new game.
By the way, will your tool have any compatibility with the CompoPack prefablist?
Regards

Link to comment
Share on other sites

1 minute ago, Gouki said:

 

Hi KingSlayerGM


Thank you very much for this new tool, although Nitrogen continues to work well, it needs to be updated, it generates somewhat strange worlds.
I will try it and start a new game.
By the way, will your tool have any compatibility with the CompoPack prefablist?
Regards

I haven't looked into combo pack compatibility yet, but I think I will be able to include it.

Link to comment
Share on other sites

6 minutes ago, KingSlayerGM said:

I haven't looked into combo pack compatibility yet, but I think I will be able to include it.

 

Ok, for now I'll play it like this.
But I could also add them to the RWG and with your tool it should work without problems, I will try it later and see how it works.
Regards

Link to comment
Share on other sites

1 minute ago, Gouki said:

 

Ok, for now I'll play it like this.
But I could also add them to the RWG and with your tool it should work without problems, I will try it later and see how it works.
Regards

KingGen has an internal list of pois from which it generates the world. So adding the combo pack to the game, won't work. I think I can probably just include the combo pack pois into the internal list, but that will happen in a future release.

 

Link to comment
Share on other sites

1 minute ago, KingSlayerGM said:

KingGen has an internal list of pois from which it generates the world. So adding the combo pack to the game, won't work. I think I can probably just include the combo pack pois into the internal list, but that will happen in a future release.

 

 

OK, thanks a lot.

Link to comment
Share on other sites

23 minutes ago, KingSlayerGM said:

KingGen has an internal list of pois from which it generates the world. So adding the combo pack to the game, won't work. I think I can probably just include the combo pack pois into the internal list, but that will happen in a future release.

 

So great work :-). So a user wont have control over the pois the map generator does like nitrogen does or that is planned

  • Like 1
Link to comment
Share on other sites

Looks like it makes great looking maps. For a vanilla game I bet it's much better than RWG. I'm a fan of the snow on big hills/mountains and how it separates biomes sensibly.

 

But definitely need a way to add custom POIs to it. Wink wink, nudge nudge. ;)

 

Great work, though! After using Nitro this last time and not really enjoying it as much as I did before, I'd love more options for world gen. I'll be keeping my eye on this. :)

  • Like 2
Link to comment
Share on other sites

1 minute ago, bdubyah said:

Looks like it makes great looking maps. For a vanilla game I bet it's much better than RWG. I'm a fan of the snow on big hills/mountains and how it separates biomes sensibly.

 

But definitely need a way to add custom POIs to it. Wink wink, nudge nudge. ;)

 

Great work, though! After using Nitro this last time and not really enjoying it as much as I did before, I'd love more options for world gen. I'll be keeping my eye on this. :)

Thank you! Yes, snow spawns only above a certain elevation and mountains with KingGen can go as high as 200 blocks, which is a lot more than vanilla!

It seems like controlling the pois list is a highly requested feature so I will defenitily have a look into it :)

  • Like 2
Link to comment
Share on other sites

Cool. Another map generator. Always nice to see tools like this being made. Wish I had the big brain and patience to learn programming so I could do stuff like this.

And yes requests for the inclusion of CompoPack (aka: prefablist) are gonna be huge for a tool of this nature.

I, personally, hate playing 7 Days without the Compo pack (and all the other POI's that are, as of yet, not included, so I download and include them as they are released from the various sites I visit)

I've, only just, downloaded this and have not had a chance to fire it up and get into a map, but I can't wait to try it out.

  • Like 1
Link to comment
Share on other sites

9 hours ago, KingSlayerGM said:

mountains with KingGen can go as high as 200 blocks, which is a lot more than vanilla

Isn't that gonna cause performance issues raising the size of the world to be rendered in?

Link to comment
Share on other sites

Posted (edited)
14 hours ago, JCrook1028 said:

Isn't that gonna cause performance issues raising the size of the world to be rendered in?

From my experience I haven't noticed any change in performance.

Consider that the game does support a maximum height of 255 (starting from bedrock), so we are not breaking any rules here :). Furthermore distant terrain helps a lot by not rendering all the single blocks that make up a huge mountain at the horizon, but instead rendering the mountain as a whole.

 

Technically it is possible that performance is reduced by large mountains but you always have the option inside KingGen to reduce the mountains size. There is aslo an option to increase it if you dare to :)

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

30 minutes ago, Cpt Krunch said:

Well done Sir! I will have a look at this once im done with current map. Is there a config file where i can alter the water and snow cap heights?

There isn't a config file, but you can tweak the amount of water and the amount of snow  in the advanced settings.

  • Like 1
Link to comment
Share on other sites

Hi KingSlayerGM

 

I have tried to make a map with the vanilla + CompoPack list, but it always shows me this error:

 

Traceback (most recent call last):
  File "gui.py", line 677, in generate
  File "ntime.py", line 11, in ntime
  File "world.py", line 661, in run
  File "world.py", line 58, in __init__
  File "poi.py", line 38, in __init__
  File "poi.py", line 38, in <genexpr>
TypeError: __init__() takes 9 positional arguments but 17 were given

 

when generating a map with the vanilla list the map is made without problem.
Nor does it generate a list of POIs.
What do I have to do to generate a map with CompoPack?
Regards

  • Like 1
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...