7 Days to Die

7 Days to Die

View Stats:
A17b240 Quick Guide to Creating a ‘7DTD’ world from an image.
Alpha 17b240 Quick Guide to Creating a ‘7 Days To Die’ world from an external image.

The following is a basic guide on how I put together the world BackgroundLife[www.dropbox.com].
A 7 Days To Die game world.
Available for download here:
BackgroundLife - a 7 Days To Die world[www.dropbox.com]

The purpose of this project was to prove the viability of taking an arbitrary starting image and create a game world.

First we need to know where the Worlds folder is located. So let’s get there by using the Steam Client:
Steam Client > Games Library > Right-Click 7 Days To Die > Click Properties > Click Local Files Tab > Click Browse Local Files > Navigate into the Data Folder > Navigate into the Worlds Folder.
This is the location to which one would extract the BackgroundLife.zip to have the world available for edit or play.

Before we begin let me list the image editing tools in use for my build here:
Paint Shop Pro 9 – modified for Windows 7 to not disable Aero, and Large Address Awareness (thus allowing more memory usage on 64bit machines)
Photoshop CS6 v13 – used for final edits and save of files, including adding the tags to each file and copyright to the dtm.tga, and Red Eagle LXIX to each PNG. Every TGA and PNG file was last saved in this program.

Next we need that 1 starting file. To get that we’re going to start the game and generate a Random World (any size, doesn’t matter 4096 will be fastest).

Next let’s take the file we need and copy it. Navigate into the folder for the newly created world. Find main.ttw and copy it (should be 194 bytes and basically empty).

Go back to the Worlds folder. Create a new folder to hold your custom world. In this case I am going to create a folder called BackgroundLife.

Paste the main.ttw you copied from the Random World into your new world folder.

Obviously if we try starting a game on this new world right now it is going to yell at us as there is almost nothing here.

Next we need to create a map_info.xml that tells the game the basics about our world:
<?xml version="1.0" encoding="UTF-8"?> <MapInfo> <property name="Name" value="Background Life"/> <!-- Left over property may not be used anymore --> <property name="Scale" value="1" /> <!-- not tested, believe how it maps the images to the world for all but radiation --> <property name="HeightMapSize" value="8192,8192" /> <!-- Size of the world. MUST be Square to use smoothworldall due to math --> <property name="Modes" value="Survival,SurvivalSP,SurvivalMP,Creative" /> <!-- Game modes allowed to use the world --> <property name="FixedWaterLevel" value="false" /> <!-- should there be a fixed height to generate water - UNTESTED --> <property name="RandomGeneratedWorld" value="false" /> <!-- Used by RWG to check if RWG has already made a map that came out to same name --> <property name="Description" value="Living life in or on the background is never fun." /> <!-- This may have to be a key to localization text, a left over as even for Navezgane, not used anymore --> </MapInfo>

As we can see here I’ve decided to create an 8192x8192 world.
Next to start we’re going to create some basic files we will fill in more completely later:
prefabs.xml:
<?xml version="1.0" encoding="UTF-8"?> <prefabs> </prefabs>
spawnpoints.xml – I assigned an arbitrary value, the game will spawn player on the surface regardless):
<?xml version="1.0" encoding="UTF-8"?> <spawnpoints> <spawnpoint position="0,251,0" rotation="0,0,0"/> </spawnpoints>

water_info.xml:
<WaterSources> </WaterSources>

At this point we should have 5 files:
main.ttw
map_info.xml
prefabs.xml
spawnpoints.xml
water_info.xml


Now for the fun. We need to pick an image that will be the heightmap for our world. This image will define the hills, the valleys, the mountains, the fields.
In this case I chose one people might recognize:
https://steamcdn-a.akamaihd.net/steam/apps/251570/page_bg_generated_v6b.jpg
https://steamcommunity.com/sharedfiles/filedetails/?id=1612137065

After some cleanup, cropping, resizing, convert to greyscale, negative image, enhancement, and smoothing via Average and Median smoothing the image ends up like this JPG (50% scaled) -- EDIT: the important bit here is the greyscale (image must be 0-255, black-white only everything else is a matter of preference in world design):
https://steamcommunity.com/sharedfiles/filedetails/?id=1612137298

I saved that as dtm.tga

We’re almost ready to load this world but we’re still missing a few bits.
Now for the first of the 2 files that tends to be annoying.
biomes.png
I had originally tried working with ones like those from Navezgane and RWG worlds but kept having issues. Especially when saving from Photoshop.
This worked for me; creating a new biomes.png file the size of my world with no transparency.

There are exactly 5 colors that can be used (any other colors can result in either Void or Biome Generation errors):

COLOR - Biome
#004000 - Forest
#BA00FF - Burnt Forest
#FFA800 - Wasteland
#FFE477 - Desert
#FFFFFF - Snow
https://steamcommunity.com/sharedfiles/filedetails/?id=1612137121

The other annoying file is splat3.png. This is where our roads and gravel paths live.
For this file I had originally tried dealing with copies of RWG worlds or even creating my own file with transparency. Everything worked fine when adding roads or paths. It was when deleting the road or path from the file, the road would be gone and transparent, but still show in the world.
So again, I tried without transparency, black background. This allows working adding and deleting gravel and asphalt.

This file uses only 3 colors
COLOR - Effect
#000000 - None
#FF0000 - Asphalt
#00FF00 - Gravel
https://steamcommunity.com/sharedfiles/filedetails/?id=1612137182

Next we need our radiated border so we need a new file called ‘radiation.png’.
This file should be 1/16 of our map size. So for BackgroundLife I’ll be creating a 512x512 radiation.png
Each pixel will either be RED (#FF0000 radiated) or Black (#000000 normal).
Each pixel will represent approximately a 16x16 area of your full size map.
https://steamcommunity.com/sharedfiles/filedetails/?id=1612137244

At this point we should have 9 files:
main.ttw
map_info.xml
prefabs.xml
spawnpoints.xml
water_info.xml
dtm.tga
radiation.png
biomes.png
splat3.png

Do I know if creating new biomes, splat3, and radiation PNG files without transparency was 100% correct way? No. I do know this. Everything worked as I expected when I did this. I got the world I expected and the result expected every time doing it this way.

Right now we have no prefabs in our prefabs.xml and no water in the water_info.xml but we are finally at a point we can load our custom world and see how things look in the World Editor.

There is currently an issue/bug with the code that SmoothWorldAll assumes a world size of 4096x4096 when using the noregion flag. However we need this to get smooth terrain.
As such I have put together a pack of modified Assembly-CSharp.dll files for different sizes.
The following shows a code compare between Stock 4096 and the Modified 8192:
https://steamcommunity.com/sharedfiles/filedetails/?id=1612187728

Last edited by Red Eagle LXIX; Jan 9, 2019 @ 6:12am
< >
Showing 1-10 of 10 comments
Red Eagle LXIX Jan 2, 2019 @ 1:00pm 
Exit out of the game and replace the stock Assembly-CSharp.dll with one from the pack here chosen for the size of the world we want to smooth (8192 in this case): https://www.dropbox.com/s/ofenxy18fm8t9cm/swa_smoothworldall_patched_DLL_files.zip

Start 7 Days to Die > Select Editing Tools > World Editor > Our New World (“BackgroundLife”) > Start

Doing this will create the first version of dtm.raw file for us.

At this point we can fly around and determine if we’ve smoothed our image enough to make it ready for smoothworldall command. If it looks like a porcupine then it is not ready. If it looks like the whole world is the surface of golf balls, iffy (might want to smooth more, might not). If it looks like Minecraft with diamond shaped blocks but nice rolling hills, valleys, plains, mountains; then it is ready.
This all boils down to preference on how you want your terrain.
NOTE: at this point your world will be upside down from your starting dtm.tga – Do not worry.
Example:
https://steamcommunity.com/sharedfiles/filedetails/?id=1612146711
https://steamcommunity.com/sharedfiles/filedetails/?id=1612146628
https://steamcommunity.com/sharedfiles/filedetails/?id=1612145045

If we’re happy with the flow of the world we can issue the SmoothWorldAll command which will generate smooth terrain data for the world to make it less Minecraft-y.

The command is formatted as
swa <NUMPASSES> noregion
smoothworldall <NUMPASSES> noregion

This tells the command to run <NUMPASSES> of smoothing, and write the smoothworldadjustment data to the dtm.raw file because we specified no region (instead of writing all the region files like accompany a save game).
The reason we had to replace the DLL was because the default DLL assumes all worlds are 4096x4096 when writing to dtm.raw at this point.

In the case of BackgroundLife I issued ‘swa 5 noregion’.
https://steamcommunity.com/sharedfiles/filedetails/?id=1612148693

Now we exit out of the game, delete any saves.

At this point we will have 11 files:
main.ttw
map_info.xml
prefabs.xml
spawnpoints.xml
water_info.xml
dtm.tga
radiation.png
biomes.png
splat3.png
dtm.raw
heightinfo.dtm

You might also notice a new file heightinfo.dtm. This is some of the heightmap and smoothing data that was used during the re-write of dtm.raw. The heightinfo.dtm file is no longer necessary and can be deleted (as you’ll see I did before packaging the world). Technically we no longer need the TGA, but for the purposes of editing, changes, etc, best to keep it and supply it with the world.

The world should now have smooth flowing terrain based on the heightmap and the orientation should match the source dtm.TGA file.
https://steamcommunity.com/sharedfiles/filedetails/?id=1612158686
https://steamcommunity.com/sharedfiles/filedetails/?id=1612158725
Red Eagle LXIX Jan 2, 2019 @ 1:00pm 
https://steamcommunity.com/sharedfiles/filedetails/?id=1612158760
https://steamcommunity.com/sharedfiles/filedetails/?id=1612160165
https://steamcommunity.com/sharedfiles/filedetails/?id=1612067828
https://steamcommunity.com/sharedfiles/filedetails/?id=1612067759

Now we can paint our roads and biomes as we see fit to match our smoothed world, modify our prefabs.xml and our water_info.xml.

Since this was a demo, I cheated and just moved both Perishton and Diersville onto this map, and put a trader between.
For the water I flew around and found a few dips and then updated my water_info.xml accordingly.
Lastly I moved the single spawnpoint I have given this world to a location that allows a more testable start.

That’s it, a quick and dirty guide on converting an image to a world.

This is how it turned out:
https://steamcommunity.com/sharedfiles/filedetails/?id=1612137347
Last edited by Red Eagle LXIX; Jan 3, 2019 @ 4:15pm
Manos cálidas Jan 2, 2019 @ 1:20pm 
Nice job. Now if I only had the skills to do this.
Red Eagle LXIX Jan 2, 2019 @ 3:34pm 
Originally posted by Manos cálidas:
Nice job. Now if I only had the skills to do this.
I barely know how to use graphics apps and managed it. Finding the issue with smoothworldall is more where I'm comfortable. I do figure showing that it can be done and giving such a guide may inspire the ones with abilities beyond mine by seeing it work.
NoMan Jan 3, 2019 @ 4:52am 
I doubt I will ever do this but after reading your tutorial I am sure I could. So well written. It's a service to the community. Thank you. :buzzed:
Last edited by NoMan; Jan 3, 2019 @ 4:55am
Red Eagle LXIX Jan 7, 2019 @ 6:24am 
This is how you can see how many colors are in use in Photoshop (example when checking to make sure you only use the 5 colors for biomes) (the below example has an incorrect 34 colors plus 1 for the transparency = 35 {as can be seen when switching to custom, last one is transparency}:
https://i.imgur.com/7PnJBcJ.jpg
Last edited by Red Eagle LXIX; Jan 7, 2019 @ 6:26am
NLBlackEagle Apr 25, 2019 @ 6:23pm 
Formost, thanks a lot for this tutorial! It helped me a lot settings things up for prefab placement in the world im creating for use in the Anarchy server. However I've ran into an issue where sma 1/50/100 noregion or "sma" does not give any results. It does not give any error messages as well but instead it simply says how much time it took to do basicly nothing. I have tried Both with and without the dll file but the latest patches says its not needed anymore.

Looking through Google i havent found any solution so i want to kindly ask if you could take a look at it. It Will be much apriciated if you do.

Thanks a ton in advance if you decide to accept this request!
[FoG] NL-Chaos Jul 9, 2019 @ 2:11am 
Is there a way to make a hight map from a specific area in Zwitserland? and if so does anyone know how to use that one? ow and i use the tool nitrogen to generate maps for 7 days to die and they say its possible but there are no tutorials on YouTube how to make a hight map and how to use it in nitrogen so :S if anyone can help me out that would be great because then i can play a map what me and my brother recognize a bit from our youth.
NLBlackEagle Jul 9, 2019 @ 8:13am 
Originally posted by NL-Chaos:
Is there a way to make a hight map from a specific area in Zwitserland? and if so does anyone know how to use that one? ow and i use the tool nitrogen to generate maps for 7 days to die and they say its possible but there are no tutorials on YouTube how to make a hight map and how to use it in nitrogen so :S if anyone can help me out that would be great because then i can play a map what me and my brother recognize a bit from our youth.

You can use https://terrain.party/ to extract a 60x60km heightmap from any place in the world. As for nitrogen I have no clue, I myself use gimp 2.0 to put everything together.

Good luck with your map!
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Jan 2, 2019 @ 12:59pm
Posts: 10