Making a Custom World Map (terrain characters walk on and POIs)

This article is a work in progress and is subjected to change.
== What making a custom world map entails ==
by BoronGorax on Steam forums: https://steamcommunity.com/app/233860/discussions/3/4203492762831234144/
The devs used World Machine to make the map. It's a node-based program for making procedural terrain based on a 2D heightmap. Personally, I find World Machine pretty outdated and it has a far better alternative (QuadSpinner Gaea), however I use WM for Kenshi because it outputs the correct heightmap dimensions and format with no problem. 
The wrong dimensions can cause terrain banding - where a lack of data or bad image compression causes slopes to become step-like (think Minecraft) rather than smooth.
I'll break down the various elements of the map. You've got:
* fullmap.tif
* overlays
* areasmap.tga
* biomemap.png
* navtiles
* blendmaps
=== Fullmap.tif ===
Fullmap.tif is the heightmap output by Worldmachine (WM). 
The format is a 16K +1 heightmap set to 32km x 32km - the highest possible resolution output by WM. Editing in photoshop is technically possible but it's very difficult to know what you'll get like that. Never bothered to check, but I'm fairly sure the +1 pixel thing is so that you have one pixel that's precisely at the centre of the heightmap.
For the LitA map I started by painting a basic layout by hand (blobs in different shades of grey) and then smudging it for a basic layout. From there I ran it through several rounds of thermal weathering, erosion, and other effects in WM. Now I'm in the refining stage, so mostly making smaller areas in WM before overlaying them onto the main map. It's easier to do it that way and create smaller patches with proper detail individually, as working in WM or Gaea at the macro (32km x 32km) scale means you can't see much of the finer detail.
There are two types of overlay maps Kenshi uses - color overlays and "splat" maps. In the Kenshi files, the color overlays are numbered (color.0.1, color.0.2 etc) and the splatmaps are just called "newoverlay.0.1", "newoverlay.0.2" etc.
Both are also generated in WM.
=== Color maps ===
Color maps are simple colors overlaid on top of the world terrain. They're used to tint the terrain subtly. It's why the Cannibal Plains have a red tint while the Deadlands are dark. However, that tint is mixed with the underlying textures. (That texturing is done with the splatmaps.)
These use the R, G, B, and A channels of images to tell Kenshi where to use biome textures (e.g. grass, dirt, slope). IIRC
R = dirt
G = grass
B = slope
=== Base textures ===
"Base" textures are used where those channels are 0. "Cliff" textures aren't on the splatmaps, they're done using triplanar mapping (because you can't represent vertical data on a flat image anyway).
=== Splatmaps ===
Splatmaps (also called texture weightmaps) are generated in WM through a mix of noise and parameters (like the steepness of slopes). You can set up some nodes so that e.g. it'll paint a bunch of blue where slopes are greater than x degrees and randomly paint red or green where the land is flat. That kinda thing.
The A channel of the splatmaps is the exception - that determines where the roads go and is projected in-game after the roads have been designed through the in-game editor.
=== Areasmap ===
Areasmap is a simple TGA that uses color indexes to determine where the named biomes ("spawn areas") go. Where are the boundaries of The Great Desert or The Deadlands, etc.
=== Biomemap ===
Biomemap is a weird one. Ostensibly, it splits up the biomes. While spawn areas determine weather (iirc), random/nest spawns, and the title of each biome shown to the player, biomes contain foliage and texture data.
However, changing biomemap.png ONLY affects the textures used by terrain features that use terrain mapping (ie using surrounding terrain textures that are triplanar-mapped onto features). It doesn't seem to affect where the textures used on the actual terrain go.
ATM I still have no idea where the "true" biomemap is hard-coded (editor's note: it may be biomemap is something we cannot edit).
Eventually I'll reach out to Chris and ask about it, though for now I have a decent enough solution as a fallback; I simply combined a bunch of existing biomes (and shared the textures) to create a "new" biome map within the borders of the original. Not perfect, but completely workable as I use higher quality terrain textures at the expense of less diversity, anyway.
=== Navtiles ===
Navtiles are how the navmesh is split up. 
They're generated by Havok in-engine, and they're supposed to be adapted at run-time (e.g. player builds a house). In practice, this goes to ♥♥♥♥ when you've got a whole new world map, so when the map is 100% finished I'll have to manually regenerate each one in-game (there's a button) and then link to the new navtiles folder through rekenshi (editor's note: Re-Kenshi is a third party application that is worked on by the community. It allows modders to load files previously unobtained to be loaded in the game by a mod, such like the map files).
=== Blendmaps ===
Blendmaps determine how the biome textures blend together at the borders. No idea how those work exactly yet, something to figure out later on. I'm not worried about it atm.
Category:WIP
Category:Modding
Category:Modding Guide
Category:World map