Mods / Landform Patcher

Tags:
Worldgen Compatibility Harmony Patching
Author:
vostSive
Side:
Server
Created:
Jun 9th at 12:31 AM
Last modified:
Jun 10th at 9:39 PM
Downloads:
171
Recommended download (for Vintage Story 1.22.0 - 1.22.3):
landformpatcher-1.0.3.zip  1-click install

Landform Patcher is a mod that applies configurable patches to landforms (vanilla or modded) at runtime, meaning you don't have to manually edit the landforms file. In its current stage, it is primarily meant to adjust landforms to work with the Wilderlands Custom Sea Level mod.

In v1.0.1, the mod uses the game's world config system to handle its settings. They are now documented in the world config tab when customizing the world as well as here.

The most important settings are the two height patching modes, which control the strategy used to patch the height of landforms.

The default mode is "Scale". It starts by anchoring landforms to the world sea level. It then scales surface parts (above sea level) by the amount of vertical space from the sea level to the max build height and submerged parts (below sea level) by the amount of vertical space from the sea level to the mantle, as compared to the default amount of vertical space (calculated from the default sea level setting). This means that mountains will still reach a similar height even with a much lower sea level, and that oceans and lakes will be made shallower with a lower sea level or deeper with a higher sea level. Essentially, if a landform reaches halfway to the build limit from the vanilla sea level before being patched, it will reach halfway to the build limit from the custom sea level after being patched.

"Offset" is a simpler mode that raises or lowers landforms to align them with the world sea level. It subtracts the difference between the default sea level (defined by the default sea level setting) and the custom sea level. Landforms are not scaled at all, which means that they will cover the same amount of space vertically as they would without being patched. This does mean that, in particularly extreme cases, landforms may extend beyond the world limits, which may cause issues with worldgen.

"Stretch" is a new mode in v1.0.1 that should only be used as one of the two modes, with the other one set to "Scale" or "Offset". It maintains the highest or lowest points of landforms, stretching down everything else to sea level. This means that mountains will reach the same height as they would before patching, or that lakes will reach the same depth. However, it also means that flatter landforms will be stretched from their original height down to sea level, which will make them not very flat anymore. This mode should only be used as the surface height patching mode when the sea level is below the default sea level, or as the submerged height patching mode when the sea level is above the default sea level.

Height patching can be entirely disabled by setting both modes to "None".

If you want to adjust the height of landforms without setting a custom sea level for some reason, you can edit the default sea level setting, which is a fraction of the world height (0 to 1). This will make the patcher adjust landforms as if they were meant for that sea level to make them work with the actual sea level, meaning that a value lower than the actual sea level will raise landforms and a value higher than the actual sea level will lower them.

New in v1.0.1 is ocean depth patching, controlled by the patch ocean depth setting. This causes ocean depth to be scaled according to the sea level rather than the world height, which fixes issues with overly deep or needlessly shallow oceans. Without this option, a low sea level on a 512 height world is likely to cause oceans to hit the mantle.

Once a world has been generated, the landform patching settings should not be changed for that world. If you remove this mod and load a world that was generated with it, your world will revert to unpatched landforms, which will cause sudden seams between old chunks (generated with the mod) and new chunks (generated without the mod). If you want to change the landform patching settings, you can use the /worldconfig command, but you will have to regenerate all existing chunks or deal with the seams.

Credit to the excellent Terra Prety landform mod for the screenshots (including those in the mod icon).

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.0.3 landformpatcher
1.22.0 - 1.22.3
112 Jun 10th at 9:39 PM landformpatcher-1.0.3.zip 1-click install

Added compatibility with Rivers

Clarified the description of the default sea level world config attribute

1.0.2 landformpatcher
1.22.0 - 1.22.3
20 Jun 9th at 8:43 PM landformpatcher-1.0.2.zip 1-click install

Adds compatibility with Watersheds and Algernon's Terrain Sampler Lib. If you were using this mod with Watersheds in a previous version, make sure to disable ocean depth patching on worlds you generated in v1.0.1.

Changes world attribute translations to have only the first letter of the first word capitalized, which is how (most of) vanilla's are.

Logs landform patching under VerboseDebug instead of Debug.

1.0.1 landformpatcher
1.22.0 - 1.22.3
15 Jun 9th at 5:39 PM landformpatcher-1.0.1.zip 1-click install

Moved mod config and world data to world config. Mod parameters can now be set in the world customization screen or in serverconfig.json. Saves from v1.0.0 are compatible and will be migrated to the world config upon loading.

Split height patching modes between surface and submerged, which can now be set independently.

Added a patch for ocean depth, which is scaled by world height rather than sea level in vanilla.

1.0.0 landformpatcher
1.22.0 - 1.22.3
24 Jun 9th at 12:32 AM landformpatcher-1.0.0.zip 1-click install

Initial release


17 Comments (oldest first | newest first) (threaded | flat)

UsulMuadib, Jun 15th at 1:47 PM

would continetal world work with this?

vostSive , Jun 15th at 5:35 PM
@UsulMuadib: would continetal world work with this?

I haven't tested it, but I think it should, because this mod works with Terra Prety, which also changes how oceans and continents are placed. If you run into any issues, let me know and I'll be happy to take a look.

MadSeraph, Jun 10th at 10:03 PM

This probably interacts badly with my mod Landforms Need Curves. It hard codes the vanilla default sea level and has a harmony prefix on the exact same method yours does. Hardly anyone uses mine though because nobody actually knows what it does. :D Still, perhaps we should coordinate. I think the easiest would be that mine optionally accounts for the different sea level from the Wilderlands mod and applies the landform curves _after_ your mod applies its changes.

vostSive , Jun 10th at 10:44 PM (modified Jun 10th at 10:54 PM)
@MadSeraph: This probably interacts badly with my mod Landforms Need Curves. It hard codes the vanilla default sea level and has a harmony prefix on the exact same method yours does. Hardly anyone uses mine though because nobody actually knows what it does. :D Still,

As long as your mod applies its changes before this one does, I think it should work fine as is. The point of this mod is to adjust landforms to work with non-default sea levels, and it should be able to handle landforms patched by your mod just as well as any others. The only case I see an issue is if this mod patches the landforms before your mod does, in which case your mod will be working with, from its perspective, very strangely positioned landforms.

To make your prefix run first, we can add the HarmonyBefore or HarmonyAfter attribute to our prefixes. I've set this mod's prefix to run after "lncurves" and you can set yours to run before "landformpatcher" if you want (only one of us needs to specify it though, I believe, but it shouldn't hurt anything for both mods to do so). This seems to work according to my testing:

Landform Patcher debug logging
10.6.2026 18:31:00.241 [VerboseDebug] [landformpatcher] Patching landform game:eternalsublimeconcavehighlands
10.6.2026 18:31:00.241 [VerboseDebug] [landformpatcher] Original TerrainYKeyPositions: [0.4291935, 0.5486642, 0.6683362]
10.6.2026 18:31:00.241 [VerboseDebug] [landformpatcher] Patched TerrainYKeyPositions: [0.24873714, 0.40470368, 0.5625469]

The actual original TerrainYKeyPositions of this landform are [0.425, 0.523, 0.667], so they've definitely been modified by your mod before they got to mine, and then adjusted to fit the custom sea level by this mod.

 

Somewhat unrelated, but you may also want to avoid patching "game:riverlandform", as that landform is from the Rivers mod and won't take all that well to your mod's adjustments. I'm seeing a similar issue to the one I just fixed in v1.0.3 of this mod (see the report by cornchev) when I use your mod with Rivers. I suppose this could also be done manually via the landform overrides config though.

cornchev, Jun 10th at 7:06 PM

This mod seems to have weird results with the Rivers mod no matter what I do in the settings, adding significant amounts of water around the rivers. I'd previously used your python patch for Terra Prety and this didn't happen, so I assume there's a genuine interaction here. This screenshot is what I get with the world seed 418309215 and the terra prety recommended worldgen settings, a sea level of 96 with wilderlands, and scale for surface and submerged, with no other mods installed: https://imgur.com/a/Ii2OOrl

vostSive , Jun 10th at 8:51 PM
@cornchev: This mod seems to have weird results with the Rivers mod no matter what I do in the settings, adding significant amounts of water around the rivers. I'd previously used your python patch for Terra Prety and this didn't happen, so I assume there's a genuin

Thank you for the report. I confirmed that this is an issue and will be uploading an update to fix it. The issue is caused because both this mod and Custom Sea Level patch Rivers landforms to align them with the sea level, so the rivers get lowered much further than they should.

UsulMuadib, Jun 10th at 1:15 AM

what setting should i use if i want gradulally heightening landforms?

vostSive , Jun 10th at 1:25 AM
@UsulMuadib: what setting should i use if i want gradulally heightening landforms?

I would recommend using "Scale" for both surface and submerged to start with, and if the landforms are too steep, try "Offset" or a combination of "Scale" and "Offset". "Scale" is the most balanced mode, it makes good use of the vertical space available to it but isn't too aggressive. "Offset" is good if you want the landforms to work just like they do when using the default sea level. "Stretch" is the most aggressive mode and probably not what you're looking for, as it forces landforms to keep the same y level at the top but stretches the lower portions down to the sea level.

All modes try to keep the identity of the original landforms, as the point of the mod is to adapt landforms meant for standard world configurations to less typical world configurations (which means custom sea levels, currently).

Thalius, Jun 9th at 9:45 PM

I've been testing Landform Patcher, and it seems to work great with Custom Sea Level.  However, it's messing with my cave mod generating fracture layers. 

The way W.Caves generates fracture layers deals with water protection by "squashing" cave generation below oceans and deeper lakes below sea level. The result is that if you have deep oceans or deep lakes, you don't get fracture caves. 

This works just fine when running CSL and W.Caves. They play together just fine.

Adding Landform Patcher however squashes cave generation even where there is no oceans or deep lakes.

On default settings, caves only show up under mountains or high hills. Plains and any water body flattens cave generation.

If I set Surface Height or Submerged Height (either one, but not necessarily both), to "none", then caves will generate in most of the areas they should. Though oddly, which one I set to none seems to have a bit of an effect on how they are shaped. Nothing drastic, and so it is hard to explain, but there are differences if I set one or the other to none and leave the other on.

It is acting like Landform Patcher, when left to default settings, is making my cave mod think that most plains areas and lower are below sea level, even though they are not, and it is triggering W.Caves water protection feature.

vostSive , Jun 9th at 10:52 PM
@Thalius: I've been testing Landform Patcher, and it seems to work great with Custom Sea Level. However, it's messing with my cave mod generating fracture layers. The way W.Caves generates fracture layers deals with water protection by "squashing" cave generation b

I did some debugging, and it looks like "api.World.SeaLevel" still has the default value (220 in my case, since I'm using a fixed level of 128 with a world height of 512) when "StartServerSide" is called even when a custom sea level is defined using CSL. This seems to be causing your cave mod some confusion, since you cache the sea level for each layer in StartServerSide. You should probably change your code to either initialize the layers later (after CSL has had the chance to set the sea level) or just get the sea level from the world accessor (which can be accessed from the block accessor) during generation.

I confirmed that this is the issue by forcibly setting all cave layers to use 128 as the sea level, which caused them to generate even under low, flat areas with Landform Patcher enabled, a fixed sea level of 128, and a world height of 512.

Burksty, Jun 9th at 6:51 PM

Hey this isnt generating a config file, or if it is I can't find it in modconfig

vostSive , Jun 9th at 7:23 PM
@Burksty: Hey this isnt generating a config file, or if it is I can't find it in modconfig

v1.0.1 no longer uses a config file, it instead uses world config parameters. You should see a new tab on your world customization screen called "Landform patcher", where you can adjust the mod's parameters.

vostSive , Jun 9th at 7:32 PM
@Burksty: Ahh I see, how would I go about generating this for a server then? Generate the world in singleplayer first?

Yes, or edit the "WorldConfig.WorldConfiguration" section of your "serverconfig.json", i.e.:

serverconfig.json
"WorldConfig": {
    "WorldConfiguration": {
        "landformpatcherDefaultSeaLevel": 0.43137254901960786,
        "landformpatcherHeightPatchingModeSurface": "scale",
        "landformpatcherHeightPatchingModeSubmerged": "scale",
        "landformpatcherPatchOceanDepth": true,
        ...
ArsenikMilk, Jun 9th at 2:33 PM (modified Jun 9th at 2:33 PM)

Dang, I wish I'd had this when I originally made my world. Perhaps this would've fixed some of the issues with my world for having a sea level at 128 on a 512 height world. Good work, thank you for this!