RimWorld

RimWorld

40 ratings
[Core] MDK Terrain Patch
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.0, 1.1, 1.2, 1.3, 1.4
File Size
Posted
Updated
402.299 KB
12 Sep, 2018 @ 10:22pm
25 Oct, 2022 @ 4:31am
8 Change Notes ( view )

Subscribe to download
[Core] MDK Terrain Patch

Description
Every terrain is special, at least for modders.

THIS MOD DOES NOTHING MUCH ON ITS OWN!

1.4 IS BETA!
Carpets are no longer supported due to source code change.

1.3
Added Alpha Biomes compatibility, unique to 1.3 and onwards.

This MUST be under 'Core' or any other core-mod like 'HugsLib' for example:
Core HugsLib [Core] MDK Terrain Patch

Other Mod Compatibilities
This mod only affects vanilla terrains via an additive patch. Any mod that replaces them entirely will break it. I've been given a list of mods to test with it. It's best for any mod author that wants to use this and another author's custom terrain to patch for said terrain.

The following mods have been auto-patched to work with MDK Terrain Patch:
  • Advanced Biomes: MDKTP_BiomePoison, MDKTP_BiomeWaste, MDKTP_BiomeVolcano
  • Terra Project: Base terrains are cross-shared with MDKTP vanilla names
  • Biomes! 2: Uses Terra Project
  • Alpha Biomes: MDKTP_GU_AlienSand, MDKTP_AB_Slime, MDKTP_AB_CrackedMud, MDKTP_AB_WebbedMarshyTerrain, MDKTP_AB_Propane, MDKTP_AB_ForsakenSand
The authors of the previous mods need to do nothing, as they hold the upper hierarchy.
The authors of mods using MDKTP DO NOT need to patch for those specific mods in regards to terrain. For example, MDKTP_BiomeWet will include Advanced Biomes' defined PoisonMarshyTerrain whether the mod exists or not for the player.

Why This Mod Might Be Needed
I was originally going to patch ZARS Core, but I thought this might be more useful to others. I wanted to specifically build structures semi-exclusive to biomes. Now I can, and other modders easily can too.

What this Mod Includes
- Every terrain has a unique affordance other than the 'Light', 'Diggable', 'Bridgable', etc. with some extra added.
- Proof of concept Walls that can only be built on Soils (but not gravel), Ice, and Sand

Ideas for Usage
- Want an oil rig mod in the ocean? You got it.
- Want marshy mud buildings? You got it.
- Want ice walls in arctic biomes only? Yup.

What Cannot Be Added
All 'Rough Rock', 'Hewn Rock', and 'Smooth Rock' are hardcoded in the TerrainDefGenerator_Stone class inside the game itself by Tynan. So restricting 'Cave-Only' or 'Mountain-Only' buildings are a pipe dream from a primitive standpoint. The current workaround is:
<terrainAffordanceNeeded>SmoothableStone</terrainAffordanceNeeded>

How to Use
The basic idea when wanting something like a building to be placed on a very specific terrain would be...
<terrainAffordanceNeeded> MDKTP_{terrain defName} </terrainAffordanceNeeded>

If wanting to only construct a specific building on Ice...
<terrainAffordanceNeeded>MDKTP_Ice</terrainAffordanceNeeded>

If wanting to only construct a specific building on Bidge only...
<terrainAffordanceNeeded>MDKTP_Bridge</terrainAffordanceNeeded>

You can use some of the following extras that encompasses multiple terrains:
<terrainAffordanceNeeded> MDKTP_{name} </terrainAffordanceNeeded>
  • AnySoil - Soil, MossyTerrain, MarshyTerrain, SoilRich
  • AnySand- Sand, SoftSand
  • AnyWater - Self explanatory. Includes Marsh, Excludes Mud
  • AnyDeepWater - WaterDeep, WaterOceanDeep,
  • AnyOcean - WaterOceanDeep, WaterOceanShallow
  • AnyShallowWater - Self explanatory. Includes Marsh, Excludes Mud
  • AnyMovingWater - Self explanatory.

NEW For 1.0!
Roads and Floors
Each floor name now has affordances! Either by specific name, or the following listed catchall...
<terrainAffordanceNeeded> MDKTP_{floor} </terrainAffordanceNeeded>
  • AnyRoad - BrokenAsphalt, PackedDirt
  • AnyFloor - Any terrain found in FloorBase
  • FloorMetal - MetalTile, SilverTile, GoldTile, SterileTile
  • FloorWood - (catchall for all wood floors)
  • FloorCarpet - (catchall for all carpet floors) REMOVED IN 1.4

Biomes
Terrains used in various biomes have been added. Each biome contains any terrain it would normally generate in vanilla.
<terrainAffordanceNeeded> MDKTP_{BiomeName} </terrainAffordanceNeeded>
  • BiomeCold
  • BiomeTemperate / BiomeCool
  • BiomeWarm
  • BiomeWarmArid / BiomeHot

Also special biomes:
  • BiomeCity - Concrete. PavedTile, Gravel, BrokenAsphalt, PackedDirt
  • BiomeWet - Marshes & Mud


If wanting to only construct a specific building on the Ocean...
<terrainAffordanceNeeded>MDKTP_AnyOcean</terrainAffordanceNeeded>

If wanting to only construct a specific building on any Sand...
<terrainAffordanceNeeded>MDKTP_AnySand</terrainAffordanceNeeded>


Want to support my ports and mods?
[ko-fi.com]
17 Comments
Renix 27 Mar, 2024 @ 5:46pm 
I'm unaware of what mods utilize this, but i've seen its effects in my game for a lot of things. I'm not sure what all will break without this. I assume terraforming mods that have terrain requirements of previous stages, maybe bridges, and structures that can be placed on certain specific levels of terrian. I'm pretty sure I'll only notice after I start working on my modlist for 1.5 some months after its release and start panicking at that time.
dracoix 🐉  [author] 15 Mar, 2024 @ 8:14am 
MDK Terrain Patch will no longer be updated for 1.5. Unless there are specific modders out there that use it, but seeing as it's only about 800 subs, it's time to retire this.

ZARS will be turned into an independent subset of mods under the Survival Expanded umbrella, each standalone with little to no need for dependencies.
lorsieab2 12 Dec, 2023 @ 10:02pm 
Great mod! Could you add compatibility for Water Freezes and Nature's Pretty Sweet? Both mods add ice terrain (and the latter adds new sand terrain too).
Renix 25 Oct, 2022 @ 4:43am 
Thank you dracoix, you also happen to be the author of like 3 other mods I use that I still want to use, not sure what they are at this specific moment in time as I am struggling with a crash to desktop on map generation specifically when I choose the sanguinophage due to other mods i have and have no idea where to start figuring this one out.
dracoix 🐉  [author] 25 Oct, 2022 @ 4:37am 
Update tested and pushed for 1.4, awaiting approval from Steam.
dracoix 🐉  [author] 25 Oct, 2022 @ 4:30am 
According to the new 1.4 source code Carpets no longer are TerrainDef from Verse, they are now TerrainTemplateDef from core. So they are now no longer supported by this mod. :(

Will update within the hour.
dracoix 🐉  [author] 25 Oct, 2022 @ 4:10am 
@Renix Apparently 1.4 doesn't like carpets, so this requires more investigation and debugging.
Renix 24 Oct, 2022 @ 9:50pm 
this comment is to express interest in a 1.4 update.
PremierVader 1 Jul, 2022 @ 3:20pm 
How does this work with the mods Soil Relocation and Early Times? Idk if they mess around with the soils or not.
UdderlyEvelyn 2 Feb, 2022 @ 9:28am 
I've had at least one user request compatibility between this and my Water Freezes mod, which adds several new ice terrains that lack your affordances. It'd be easier to do on your end than mine (and your mod has low subs so I'm not too inclined to take the time when I'm pretty busy) so I figured I'd let you know. I will also be adding two more types of ice pretty soon for oceans.