Confirm with your password

TerrainMistile

Spawns configurable TerrainMistiles from changed terrain. They seek the edit, detonate, and reset player-made height/paint changes while preserving world/location terrain. Tune biome chance, interval, radius, health, color, and base protection.

Client & Server
Changelog & versions

· Website

Stars
0
Downloads
10
Version
1.0.8
Updated
Author
sighsorry
Virus scan
✓ Scan successful
Runs on
Client & Server
Required by
2 mods

Compatibility

Required 1

Install these too — Gale pulls them in for you.
  • Jotunn ValheimModding ·2.29.0

Description

TerrainMistile

Spawns configurable TerrainMistiles from changed terrain. They seek the edit, detonate, and reset player-made height/paint changes while preserving world/location terrain. Tune biome chance, interval, radius, health, color, and base protection.


TerrainMistiles try to reset changed terrain, but players can stop them by destroying them before impact.


Terrain changes near player bases can be protected from TerrainMistile spawn checks. The base-check radius and required number of unique base prefabs are configurable per biome.




TerrainMistile spawn chance, interval, visual color, health, and reset radius can be configured per biome.

How It Works

  • Changed terrain is grouped into 32m terrain units.
  • Each changed unit rolls on its biome rule interval while at least one player is within playerSearchRadius.
  • TerrainMistiles target changed terrain points, not players.
  • A TerrainMistile reset happens when it reaches terrain impact or uses its self-destruct attack.
  • Killing a TerrainMistile before self-destruct does not reset terrain.
  • Successful resets prompt nearby players to check the localized TerrainMistile Compendium entry, at most once every 60 seconds.
  • Reset clears player-style TerrainComp height and paint deltas in resetRadius.
  • Location and world baseline terrain are preserved, so location terrain changes can remain after reset.
  • TerrainMistiles use nonblocking colliders so terrain and pieces do not trap them before impact.

TerrainMistileEnforcer

TerrainMistileEnforcer is a same-size companion prefab intended for external spawn systems such as DropNSpawn events. TerrainMistile does not spawn it through its own periodic spawn rolls.

  • It selects the horizontally nearest living player to its spawn point, then targets the horizontally closest eligible changed terrain around that player.
  • Its localized display name uses the separate terrainmistile_enforcer_name token.
  • Its horizontal target search radius is the larger of 128m and the highest enabled biome playerSearchRadius.
  • It ignores only the TerrainMistile playerBaseValue target suppression.
  • The target biome must still have an enabled TerrainMistile rule.
  • Expand World Data/location protected terrain, temporary external terrain exclusions, and existing target reservations remain protected.
  • Its reset radius and visual color come from the current target biome rule; initial health comes from the first acquired target. Biomes without a dedicated rule use defaults.
  • It retries target acquisition for 10 seconds and then despawns without resetting if no eligible changed terrain is found.
  • A targetless Enforcer does not consume the normal TerrainMistile maxSpawn allowance.

DropNSpawn event entries must specify a biome, and insidePlayerBase: true is needed when the native SpawnSystem spawn point itself may be inside a vanilla PlayerBase effect area:

spawns:
  - prefab: TerrainMistileEnforcer
    spawnSystem:
      biomes: [All]
      insidePlayerBase: true
      huntPlayer: false

huntPlayer does not affect Enforcer terrain selection or movement; leave it false or omit it.

DropNSpawn event spawns replace that event's entire spawn list, so keep any existing event spawn entries that should remain.

BepInEx Config

  • Enable TerrainMistile: globally enables new TerrainMistile spawns. Existing TerrainMistiles remain active when disabled.
  • Lock Configuration: server admin config lock.

Localization

English and Korean localization are embedded in TerrainMistile.dll, so the mod keeps its built-in translations when only the DLL is installed. TerrainMistile also loads optional flat YAML files named TerrainMistile.<Language>.yml from anywhere under BepInEx when the plugin starts. External files add languages or override embedded values. The language must use its exact Valheim/Jötunn name and begin with a capital letter.

For example, a modpack can add French localization without changing the TerrainMistile plugin folder:

BepInEx/config/TerrainMistile.French.yml

The release archive includes TerrainMistile.English.yml as an editable template. Copy it, translate only the values, and keep token keys and placeholders such as $1 and $2. Restart the game after adding or changing a localization file.

Files are loaded in a deterministic path order, with files under BepInEx/config loaded last. If more than one file supplies the same language, later files override only their duplicate tokens; invalid files are skipped without blocking valid translations.

TerrainMistile.yml

  • Main spawn rule file.
  • Synced from the server.
  • Generated automatically if missing.
  • defaults supplies fallback values.
  • playerBasePrefabs is the editable base-protection prefab list.
  • Every other top-level key is treated as a biome rule.
  • Expand World Data custom biomes can use their custom biome name or numeric biome value.

YAML Example

# Expand World Data custom biomes can use their custom biome name or numeric biome value.
# defaults and playerBasePrefabs are reserved. Every other top-level key is treated as a biome rule.

defaults:
  interval: 60
  playerSearchRadius: 32
  spawnChance: 0.25
  maxDeformationSpawnChanceBonus: 0.25
  maxSpawn: 3
  perPlayerSpawn: true
  playerBaseValue: 1
  baseCheckRadius: 24
  spawnRadius: 16~32
  spawnAltitude: 8
  resetRadius: 8
  health: 1
  visualColor: "#45FF5A"

Meadows:
  interval: 120
  spawnChance: 0.1
  resetRadius: 4
  visualColor: "#7CFF6B"
BlackForest:
  interval: 120
  resetRadius: 6
  visualColor: "#2ED36F"
Swamp:
  playerBaseValue: 2
  visualColor: "#8FBF3F"
Mountain:
  interval: 120
  playerBaseValue: 2
  resetRadius: 6
  visualColor: "#8FE8FF"
Plains:
  interval: 120
  playerBaseValue: 3
  resetRadius: 6
  visualColor: "#FFD15C"
Mistlands:
  interval: 120
  playerBaseValue: 3
  resetRadius: 6
  visualColor: "#B58CFF"
AshLands:
  playerBaseValue: 4
  visualColor: "#FF5A2E"
DeepNorth:
  playerBaseValue: 4
  visualColor: "#BFEFFF"
Ocean:
  visualColor: "#3EA7FF"

playerBasePrefabs:
  - workbench
  - forge
  - portal

The generated YAML includes the full vanilla playerBasePrefabs list. Add custom player-placed piece prefab names there if they should protect terrain from TerrainMistile spawn checks.

Spawn Rule Fields

  • interval: seconds between spawn rolls for one changed 32m terrain unit. 0 disables that biome.
  • playerSearchRadius: players within this horizontal radius activate rolls for a changed unit.
  • spawnChance: base chance used when a unit interval is ready and at least one player is nearby.
  • maxDeformationSpawnChanceBonus: bonus added to spawnChance when the largest height deformation in the 32m terrain unit reaches Valheim's 8m deformation cap. The bonus scales linearly from 0m to 8m and the final chance is clamped to 1.
  • maxSpawn: maximum active TerrainMistiles with targets within 32m of the target. 0 disables that biome.
  • perPlayerSpawn: if true, one successful roll can spawn up to one TerrainMistile per nearby player, capped by maxSpawn and available targets.
  • playerBaseValue: unique listed player-placed base prefab type count required to skip spawn checks. 0 disables the player base check.
  • baseCheckRadius: horizontal radius used by playerBaseValue.
  • spawnRadius: horizontal spawn distance from the selected nearby player. Use 24 for fixed distance or 16~32 for a random range.
  • spawnAltitude: height above solid ground where TerrainMistile spawns.
  • resetRadius: terrain height and paint reset radius saved onto each spawned TerrainMistile.
  • health: maximum and current health applied when TerrainMistile spawns.
  • visualColor: HTML hex color used for flames, sparks, and light.

Player Base Protection

playerBaseValue counts unique prefab names from playerBasePrefabs within baseCheckRadius meters of the changed terrain point. Repeated copies of the same prefab count once.

Only player-placed instances are counted. Internally, TerrainMistile checks the ZDO longs.creator field and ignores matching prefabs when creator == 0, which filters out noCreator world and location pieces.

Examples:

  • playerBaseValue: 0: no base protection check.
  • playerBaseValue: 1: one listed player-placed prefab nearby is enough to skip spawn checks.
  • playerBaseValue: 3: three different listed player-placed prefab types must be nearby to skip spawn checks.

Tuning Tips

  • Increase interval to reduce spawn roll frequency.
  • Lower spawnChance to make TerrainMistiles rarer without disabling a biome.
  • Lower maxDeformationSpawnChanceBonus if near-cap terrain edits should not strongly increase spawn chance.
  • Set both spawnChance and maxDeformationSpawnChanceBonus to 0 for chance-based suppression, or use interval: 0 / maxSpawn: 0 to disable a biome.
  • Increase playerSearchRadius if changed terrain should stay active from farther away.
  • Increase resetRadius for tall or wide terrain edits that need a larger reset area.
  • Raise playerBaseValue in dangerous biomes if simple one-piece bases should not fully suppress spawns.

Development

Copy environment.props.example to environment.props to select a specific Valheim installation or when automatic detection fails, then set ValheimGamePath.

TerrainMistilePlugin.ModVersion is the release version source. On Windows, a Release build updates the source Thunderstore manifest when needed, then creates both Thunderstore and Nexus archives:

dotnet test .\TerrainMistile.sln -c Debug
dotnet build .\TerrainMistile.csproj -c Release
dotnet build .\TerrainMistile.csproj -c Release -p:DeployToGame=true
dotnet build .\TerrainMistile.csproj -c Release -p:PackageMod=false
dotnet test .\TerrainMistile.sln -c Release -p:PackageMod=false

DeployToGame copies the merged DLL to the configured BepInEx plugins directory. Windows Release packaging is enabled by default; set PackageMod=false when only the DLL is needed. Deployment and packaging remain properties on the normal Build entry point, and internal build-action targets reject direct invocation.

Changelog

1.0.8 Latest
  • Added the TerrainMistileEnforcer prefab for external spawn systems such as DropNSpawn events.
    - Made Enforcers select the nearest living player to their spawn point and pursue the nearest eligible changed terrain around that player, retrying briefly before despawning when no target exists.
    - Made Enforcers bypass only TerrainMistile PlayerBase target protection while retaining enabled-biome rules, Expand World Data/location protection, temporary terrain exclusions, and target reservations.
    - Applied the target biome's reset radius and visual color with default-rule fallback, and added a separately localized Enforcer display name.
    - Documented event-spawn configuration and kept targetless Enforcers outside the normal TerrainMistile maxSpawn count.
1.0.7
  • Added embedded English and Korean localization for the Earth Warden name, Compendium topic, and generated Compendium text, with optional TerrainMistile.<Language>.yml files for additional languages and overrides.
    - Added a localized center-screen prompt after a successful terrain reset so nearby players can discover the relevant Compendium entry, limited to once every 60 seconds.
    - Added a synchronized global spawn toggle that prevents new TerrainMistiles without removing existing ones.
    - Replaced the old display-name config with localization tokens; existing custom names can be moved to an external localization YML file.
    - Included TerrainMistile.English.yml as an editable translation template in release archives and game deployment while keeping built-in translations available from the DLL.
1.0.6
  • Fixed terrain scanning and resetting on current Valheim runtimes by removing direct private game-member access and the publicized-assembly dependency, preventing repeated TerrainComp.s_instances access errors.
    - Added cached runtime terrain bindings and build/test guards so game compatibility failures are detected once at startup or build time instead of repeatedly during world updates.
    - Changed TerrainMistiles to the Boss faction so players and player-aligned systems can respond to them while their player-hunting and player-object attack AI remains disabled.
    - Improved Expand World Data compatibility for late initialization and biome-data reloads, and fixed fallback custom-biome ordering and normalized-name collisions.
    - Hardened protected-terrain synchronization and terrain resets against reconnects, invalid data, oversized protected areas, and recently changed external terrain.
    - Improved spawn-rule reload and validation so invalid values fall back safely, long custom intervals retain their cooldowns, and stale runtime state is cleared between worlds.
1.0.5
  • Fixed a dedicated-server regression where broad zone readiness checks could prevent TerrainMistile spawns.
    - Limited load-readiness checks to relevant player-created PlayerBase prefabs in the exact affected zones.
1.0.4
  • Prevented PlayerBase protection from being missed while nearby zones and pieces are still loading.
    - Added a Compendium page showing the server-synced PlayerBase prefab list with localized in-game names and effective protection requirements by biome.
1.0.3
  • Improved terrain target reservation and reset reliability, and replaced the redundant version handshake with ServerSync validation.
    - Made Expand World Data protected-area refreshes atomic and avoided unchanged full-list syncs.
    - Added modified terrain cell-index caching and explicit visual Material cleanup for lower long-session overhead.
1.0.2
  • Added synced protected terrain areas for Expand World Data blueprint locations so clients preserve EWD terrain on dedicated servers.
    - Added protected area bucket caching and shared terrain cell scan helpers to reduce repeated lookup work.
    - Removed debug logging and the debug config option for leaner runtime behavior.
1.0.1
  • Added maxDeformationSpawnChanceBonus so heavily raised or dug terrain can increase TerrainMistile spawn chance.
    - Documented the new deformation-based spawn chance setting.
1.0.0
  • Initial release.

Full version history & older downloads →

Manual download
Just this mod One .zip — TerrainMistile 1.0.8
Files you'll get 2
  • TerrainMistile 1.0.8 sighsorry this mod Get
  • Jotunn 2.29.2 ValheimModding asked for 2.29.0 Get

Your browser may ask permission to download several files at once. How to install these manually

Manual installation instructions
1

Install BepInExPack Valheim

BepInExPack Valheim is required to run mods in Valheim.

Download BepInExPack Valheim 5.4.2333 · View mod page

Check out the mod page for detailed installation instructions.

2

Install TerrainMistile

This mod must be installed on both the client and the server.

Download TerrainMistile 1.0.8

Extract the ZIP and place the file(s) into the BepInEx/plugins/ folder inside your Valheim game folder.