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

Alpha 17b240 Quick Guide to Creating a ‘7 Days To Die’ world from an external 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.

A 7 Days To Die game world.

Available for download here:

BackgroundLife - a 7 Days To Die world

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:

Code:
<?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:

Code:
<?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):

Code:
<?xml version="1.0" encoding="UTF-8"?>
<spawnpoints>
   <spawnpoint position="0,251,0" rotation="0,0,0"/>
</spawnpoints>
water_info.xml:

Code:
<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

page_bg_generated_v6b.jpg


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):



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

50% scaled biomes image:



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

50% scaled splat3



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.

100% radiation



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:



 
Last edited by a moderator:
Don't need it anymore.
Im unable to get it to smooth anything. i did smoothworldall 5 noregion and it looks exactly the same so i tried smoothworldall 150 nothing changed. Am I missing something? sorry still new to all of this.

 
I didn't have any luck with it either, so I don't do mine the way he does his.

I get the heightmap, import into Photoshop, export as a .raw and go from there. I never go into the world editor. I use gaussian blur to smooth areas directly to the .raw file.

 
Thanks guppy I’ll try to mess around with that
Give this a whirl, but be warned, I fuggup a lot and TFP will likely change things (this is 17.1b9, no clue if it works in 17.2bwhatever)

 
Hi,

My friends and I have been running a ded server since December last year and I recently got interested in creating our own world to play on.

I'm pretty new to the whole editing game files thing, but I'm slowly but surely getting the hang of it.

I managed to create the world from some height maps, which went pretty smooth thanks to Guppycur's videos on YouTube. I did encounter one problem tough, I want all levels below 20 to be filled with water. I changed the water_info.xml file accordingly (set all Y positions to 20), but in some places in game I get this random straight area where the water just cuts off (see screenshots below).

Can anyone help me with what I'm doing wrong or missing?

Thanks

20190228182647_1.jpg

20190228182742_1.jpg

 
Last edited by a moderator:
I could be wrong about this but check and see if there is a minx and maxx value in your xml. If so, remove it. It basically tells the water where to stop. That may be what's happening.

- - - Updated - - -

Here is an excerpt from my pinned messages on my discord:

How to use water_info.xml

...find a spot you want water to be in, choose a low point.

Edit the water_info.xml file and enter in those coordinates, and the water height. So if you find

1500 (east), 19 (height), and -120 (south), you can create a lake that's 11 high by using:

<WaterSources>

<Water pos="1500, 30, -120"/>

</WaterSources>

...this will create water in every direction from that point at a height of 30, thus "filling" your lake.

You can use minx, maxx, minz, maxz to edit its limits, but I honestly wouldn't go poking around with that, since water flows and if you screw up it's going to kill your frames while it adjusts to the terrain

 
I tried the above but still no success... I changed the height to 40 to see if it differs, still the same. I'm deleting the region files after every test, so it cant be that.

Here's whats in my water_info.xml with the resulting screenshot:

<WaterSources>

<Water pos="0, 40, 0" />

</WaterSources>

20190301131321_1.jpg

Note: The funky edges are just my resolution due to the distance (my PC's graphics aren't the greatest), but those long straight lines are all areas where the water just disappears.

 
Last edited by a moderator:
There might be an internal limit. Maybe keep the 0 one and add a 1024, 40, 1024 and a 2048, 40, 2048, and keep going adding 1024 until you reach map size.

 
I tried that now,

First it gave me an Error - (IndexOutOfRangeException) - turns out you can only go up to half the map size in the positive and negative direction, which in hindsight makes sense. So on a 4K map your coordinates can only run from 2048 to -2048.

I tried adding several coordinate ranges in all directions (N/S/E/W) and also included coordinates from specifically the empty areas... No luck... Still looks the same.

I then added the water_info file from Navezgane into my file. Also nothing.

Strange enough, the lines onlu form in an East-West direction...

This breaks my head.

 
Sorry if have already asked, but what is the size limit of the created map?

Will 64kx64k work in practice?

 
Last edited by a moderator:
I tried creating a map with a custom heightmap (like the op) after loading the world in the world editor, tried the command "swa 5 noregion" and doesn't work. It still looking as a "mainkra" map. the dlls breaks the game (if I replace it, the game wont start)

I tried the Guppycur's tutorial but is still "mainkra" style. I'm probably missing something, I don't know. Please, help me. I really want to make a custom map.

info: I don't use the dtm.raw, I use dtm.tga because I don't have a photoshop copy and on Gimp the export to raw files are non-existent.

 
Dunno what mainkra is.

Make sure the file is 16bit not 8, that's the difference between blocky and smooth.

 
Update on the water issue:

I re-wrote the water_info.xml file and added an entry for every 8 blocks on the x axis (-2044 to 2044) and the problem is still there. I think i might have found what is causing it though. It seems like the water "flows" from its point of origin around hills and mountains but the moment it connects with bare rock texture or gravel texture on its highest point, (i.e. top level of the water) it stops generating... 20190311222052_1.jpg

Also, shrubs, grass and other random junk still appears in "air pockets" under water...

 
Is there any way to create tunnels and/or caves? On a related note, I suspect (based on some of the screenshots here) that there is no way to create a road that goes through a tunnel in a mountain. Is this correct?

 
That sounds good. I'll experiment with them this weekend. In preparation, how do underground prefabs interact with the landscape, do they cut into landscape wherever they intersect?

Aside: I'm not clear on the model that 7DtD uses for the underground and digging. My guess is that the act of digging effectively creates an ad-hoc prefab (corollary: mineral deposits do not exist in the world until they are found) and so adding a prefab would remove the blocks at the edge of the landscape and allow you to pass into what would otherwise be dirt/rock.

 
Back
Top