Kenshi
City Architecture Total Overhaul V4.04
 This topic has been pinned, so it's probably important
crunk aint dead  [developer] 25 Jul @ 1:12pm
Level Data and Road Editing Tips for CATO V4
CATO V4 is finally here, I remade the entire road network throughout the game to fix a large number of issues and improve game play. I learned quite a few things I would like to share to make adding to the roads much easier.

My hope is with the release of V4 more mod authors will see the benefit of making their mods compatible with CATO <3

-----Why you should use CATO V4 as your baseline-----
There are many benefits to using CATO as a base for any mods you want to make, as it not only comes with improved visuals but a massive number of level data fixes.

In vanilla when you attempt to edit an intersecting point or an incomplete road it will cause random points from across the entire map to connect to each other. This is due to hundreds of incomplete sections which do not give validation errors. I had to spent a month straight rebuilding the entire road network to fix this issue, so I went all in and remade the entire road network.

-----CATO V4 Road Network Features-----
-Fixes all broken sections of road and all validation errors from V3.

-Fixes hundreds of roads which were floating, underwater, went through impassible terrain, were disconnected, and more.

-Sets all roads in the game to be "Hidden" to prevent textures from burning in twice when using "Render All" in your navmesh tools. (An example of roads which were burned into the overlay maps multiple times can be seen in vanilla on the border of Flat's Lagoon and Shem.)
-Makes all roads smoother for better pathfinding.

-Fixes all incomplete sections of road, preventing errors causing roads to connect randomly across the entire map.

-----In Game Editor Tips-----
-You will need to restart your game often when editing level data, I recommend making a cheat save and starting a new game every time you restart to prevent any oddities like empty camps becoming merged into your level data.

-Avoid having any mods you don't want to merge together enabled. Saving your edits in the in-game editor sometimes saves the changes from all active mods in the loaded zone, causing things to sometimes merge unintentionally.

-Many things can cause squads to shuffle in towns, causing issues like shops either not showing up or being in the wrong building. Never press "Fix All", delete buildings, or add new buildings unless you plan to change a town's residents.

-If you need to fix a building shuffling issue, you will have to check the priority of a town's residents in FCS, Then delete the shuffling buildings one at a time to allow the higher priority squads to spawn.

-Keep your game paused at all times when editing level data to prevent crashes.

-----Road Network Editing Tips-----
-When adding new roads, make sure both ends of any roads connect with the road network! All roads must be a closed loop to prevent them from attempting to connect to each other from across the map.

-To help prevent random points form connecting, avoid clicking on the end point of a road. Always click a road from a point in the middle of it rather than the end.

-Your roads will only affect path finding unless your render them to the overlay maps. They will not have textures or remove foliage.

-Do not use "Render All" or "Render Selected" unless you are adding roads to your overlay maps (Advanced users only!).

-----How to add roads to your overlay maps-----
This is will allow you to have roads which are textured, and remove foliage and rocks from your roads.

Not recommended for anyone but the most advanced users and authors of large scale overhauls! This is a map-wide change, and will limit the compatibility of any two mods which do this.

1: Make a backup of your vanilla overlay maps
-Can be found in your Kenshi installation folder, Kenshi/data/newland/land/overlaymaps/

-If you have ever accidentally pressed "Render All" in your navmesh tools, I recommend deleting this folder entirely and verifying the integrity of your game files, allowing you to download a fresh copy of the vanilla overlay maps to use as a base.

-Overlay maps can only be added to currently, I am unaware of any method to remove road textures from them.

-Kenshi's overlay maps are in RGBA format. All roads (including hidden ones) are added to the alpha channel. Road avoidance for foliage draws from these overlay maps so any roads not added to them can be blocked by foliage, causing path finding issues.

2. Add your roads to the overlay map.
-You have two options when doing this, "Render All" will render every single road in the whole game while "Render Selection" will only render the currently selected roads. Avoid rendering roads multiple times to prevent anti-aliasing artifacts in your overlay map.

-Roads can either be "Hidden" or visible. This effects whether or not a road will add it's textures to the overlay map when rendered, or if it will remain hidden and only remove foliage. I recommend setting all roads to "Hidden" after you are done rendering, as you cannot remove road textures once they have been added.

3. Copy your updated overlay maps to your mod folder
-There are 65 .png files you will need, "new_overlay.png", "new_overlay.0.0.png", etc. (NOTE: these files often do not have an accurate "last modified" date for some reason.)

-Add the copied overlay maps to your mod folder, you will have to create a few new folders to do this. ("Your Mod"/data/newland/land/overlaymaps/)

-Your mod will not be compatible with other mods which also edit to these overlay maps! I do not recommend using this functionality for anything but massive mods. It will be overkill for any mod which doesn't aim to massively rework road networks or add entirely new roads to zones.
Last edited by crunk aint dead; 25 Jul @ 1:16pm