• 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:
Prefabs replace existing blocks, be them air or dirt, so what I would do is generate a world, make my prefab there, export it, the restart the world fresh (no prefab) and import it until it looks right, noting the coordinates, then put the prefab in the worlds prefab.xml.

 
So, I have been trying to take a crack at 7d2d map making and stumbled upon the guppy tutorial. Everything went very smoothly until I attempted to smooth the world. I've looked all over google for an solution and just finished trying to export the .tga file in grayscale using gimp ( This exported the tga file in 16 bit ) However none of any attempt resulted in a smooth world.

Here's what I attempted:

8192x8192 attempt, followed the guppy tutorial and tried "swa 5 noregion", "swa 50 noregion", "swa 100 noregion" and "swa" Displayed message in console was:

swa1.jpg

Then I quitted the game, deleted region files if any, verified the existance of heightinfo.dtm, started game and loaded in the world using the world editor. No change, no result.

I have tried the above with a map of 4096x4096 as well, then tried exporting the .tga in grayscale ( 16 bit ) which resulted in the message:

swa2.jpg

Exception: TGA texture has non 32/24 bit texture

Also tried using the .dll simply for the sake of trying as i was running out of options.

It would mean a lot if someone could assist me with this issue by perhaps pinpointing what i've missed or done wrong or ask me to upload the files to have a closer look/experiment with them for a bit.

May it be of help, here's a picture of the world contents in folder \7 Days To Die\Data\Worlds:

8192x8192 Dev Map:

swa3.jpg

4096x4096 Test Map:

swa4.png

 
Last edited by a moderator:
So, I have been trying to take a crack at 7d2d map making and stumbled upon the guppy tutorial. Everything went very smoothly until I attempted to smooth the world. I've looked all over google for an solution and just finished trying to export the .tga file in grayscale using gimp ( This exported the tga file in 16 bit ) However none of any attempt resulted in a smooth world.
Here's what I attempted:

8192x8192 attempt, followed the guppy tutorial and tried "swa 5 noregion", "swa 50 noregion", "swa 100 noregion" and "swa" Displayed message in console was:

View attachment 28245

Then I quitted the game, deleted region files if any, verified the existance of heightinfo.dtm, started game and loaded in the world using the world editor. No change, no result.

I have tried the above with a map of 4096x4096 as well, then tried exporting the .tga in grayscale ( 16 bit ) which resulted in the message:

View attachment 28246

Exception: TGA texture has non 32/24 bit texture

Also tried using the .dll simply for the sake of trying as i was running out of options.

It would mean a lot if someone could assist me with this issue by perhaps pinpointing what i've missed or done wrong or ask me to upload the files to have a closer look/experiment with them for a bit.

May it be of help, here's a picture of the world contents in folder \7 Days To Die\Data\Worlds:

8192x8192 Dev Map:

View attachment 28247

4096x4096 Test Map:

View attachment 28248
UPDATE FIXED ISSUE

After referencing my own work with the tutorial map result download I found a couple more things i could try out and finally came to an solution to the issue.

Step 1. Make sure you follow the tutorial to the point where you have the dtm.tga

Step 2. Open your world in the world editor and navigate to \7 Days To Die\Data\Worlds\YourWorld

Step 3. open the console using f1 and execute "swa 5 noregion"

Step 4. If something goes wrong here make sure you have enough ram ( 12GB and more should be enough )

Step 5. If everything proceeds successfully you should end up with heightinfo.dtm in the folder mentioned in step 2.

Step 6. Exit to menu and delete the dtm_processed file in the folder mentioned in step 2.

Step 7. Reload your world and celebrate! Now you have a smooth world ;)

swa5.jpg

 
Is there an option to the "swa" command if you get an error like this:

Execution of swa failed - out of memory

I have 32 GB of Ram, with 16 i could run swa with a 13k world, now its 16k and it fails. I did even adjust the swap file size on windows, did not help.

Is there a hardcoded limit ?

 
Is the tutorial still working for A18 ?

I get my old world running, the smoothworldall does work too, but the ground texture is complete brown in every biome?

2019-10-07_21h56_31.jpg

And i see some more file in the worlds folder:

splat3_processed.tga

splat4_processed.tga

Can you do an update to the tutorial, Red Eagle LXIX ? Or is world generation from an external image not possible anymore with A18?

Edit: Maybe thats my problem:

2019-10-07T21:52:17 21.925 INF StartAsServerWARNING: Shader Unsupported: 'Hidden/Nature/Terrain/Utilities' - All passes removed

ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/Nature/Terrain/Utilities' - Setting to default shader.
In a generated map it works. And yes, its a radeon card :upset:

 
Last edited by a moderator:
I guess i found the solution, the splatX_processed.tgas are based of the splat3.png, and this new procedure does not like the black background anymore, just made all black translucent. That should get the terrain shaders to appear again.

Testing that now.

It works :high5:

Picture of the same place seems ok.

Edit: only problem is the streets are not sharp textures. Lets see when there is another helpful advice how to format the splat3_processed.tga and whats the splat4_processed.tga needed for.

itworks.jpg

 
Last edited by a moderator:
Addition to the very nice tutorial by Red Eagle LXIX:

Since A18 the world generation differs a bit from now, pretty much all is the same, the one thing that differs is the splat3.png.

Working as before (in A17) gives you a map with an ugly brown ground texture and the cliffs show no stone texture at all.

Looking at the new files in the delivered maps shows the splat3.png has now a transparent layer. If you are doing map creation at low cost and have no photoshop i can give you some advice how to convert the splat3.png:

First: Backup your file(s)! ( It is always a good idea to have backups in case something bad happens)

Download Gimp (GNU Image Manipulation Program) from here:https://www.gimp.org/ It is free and well known :)

Open the splat3.png in Gimp, immediatly export it to the same file format, but choosing an 8bit RGB type (I did painting in paint.net, and that program does not save in RGB)

gimpsplat1.jpg

After thet, close the file (or Gimp) and reopen it. Now you should see RGB values in the channel, but we also need a transparency layer. Add a layer like in the next 2 screenshots.

gimpsplat2.jpg

gimpsplat3.jpg

 
Last edited by a moderator:
Now your splat image should look like this, it has an RGB value and a transparency layer.

gimpsplat4.jpg

Time to export again, this time you will choose 8b RGBA file type, cause we have a transparency now.

gimpsplat5.jpg

Close Gimp, it will say it has unsaved changes but we exported the file already, so no worries. With this splat3.png you can proceed as you know it.

A18 will generate 2 more files then you are used to in A17:

splat3_processed.tga and

splat4_processed.tga.

These files are created as you start the game and are based at the prefabs positions and the splatmap. If you are doing changes you can delete this 2, they will be generated again (much like the dtm_processed.raw).

Additional: If you are making changes and working on your map again and again dont forget to

delete following files after making changes and before starting 7D2D again, to get no old world showing in the new generated map:

- always your savegame in %appdata !

- if you are doing changes to the basic TGA then delete the dtm.raw and dtm_processed.raw and the both splatx_processed.tga

- if you only doing changes to your road layout then you only need to delete both splatx_processed.tga

In my case (my mapping procedure) it means the following: I do changes to the road layout (splat3.png) and to the terrain (dtm.tga).

So i delete these files before i start to see the changes:

- The savegame in %appdata

- both the dtm.raw and the dtm_processed.raw (both will be generated again with the dtm.tga)

- both of the splatx_processed.tga

After first starting of the map i do a smoothworldall (swa) command, after thats finished i close the game, delete

all of the above files again except the dtm.raw ! ( All other stuff will be regenerated )

Starting again will give me now the correct files and no visual bugs like terrain/buldings that are not anymore there.

I will usually start the World Editor ingame, to place prefabs or jump around to take a look at the changes.

 
Last edited by a moderator:
Be faster to delete only the region files in the save game...

...that way you're not spawning new every time, and can keep crap on your toolbelt, etc.

 
Another additional info:

I kept seeing weird shader bugs like i posted in bug reports sometime ago, if you are doing a custom map i would advise to make the maximum altitude 150 or lower, otherwise you will see things like this:

https://7daystodie.com/forums/showthread.php?131113-A18-b155-EXP-bug-reporting-thread&p=1047948&viewfull=1#post1047948

shadertest.png


With lower levels you will not see this (much less).

- - - Updated - - -

Be faster to delete only the region files in the save game...
...that way you're not spawning new every time, and can keep crap on your toolbelt, etc.
Spawning in the ingame world editor (which i would prefer doing stuff like placing prefabs and so on) you will see no real difference. For real playtesting you might want to go your preferred way.

The ingame world editor has another advantage: You will see the prefabs with green outlines in the map even if you did not visit that area yet.

Makes hopping around on some places in the map much easier.

 
Last edited by a moderator:
Another additional info:I kept seeing weird shader bugs like i posted in bug reports sometime ago, if you are doing a custom map i would advise to make the maximum altitude 150 or lower, otherwise you will see things like this:

https://7daystodie.com/forums/showthread.php?131113-A18-b155-EXP-bug-reporting-thread&p=1047948&viewfull=1#post1047948

shadertest.png


With lower levels you will not see this (much less).

- - - Updated - - -

Spawning in the ingame world editor (which i would prefer doing stuff like placing prefabs and so on) you will see no real difference. For real playtesting you might want to go your preferred way.

The ingame world editor has another advantage: You will see the prefabs with green outlines in the map even if you did not visit that area yet.

Makes hopping around on some places in the map much easier.
I actually think this is a bug in the games distant terrain. At higher elevations it "sticks out" more compared to the local terrain. Thus you can see those nasty edges. Some imprecision when calculating the y position of vertecies of the distant terrain.

 
Yeh Sphereii has been messing with that stuff and may have some sort of fix; definitely seems to be a tfp thing.

 
Thanks for the info. I come from the other thread. but I did not succeed ... I gave up, I do not know why the island which I edit is not generated

for those who know how to edit and make it work. here you have a nice island 😭
 







 
Back
Top