Skip to content

Ambient wildlife spawns

A creature pack can add wildlife encounters to existing worlds. Put a spawnrule_*.json file in your pack, usually under Spawning/. You do not need a custom world profile or Lua spawn timer. Registering a creature by itself does not make it appear in ambient encounters.

A surface rule

Example Mod ships this rule for its Jacked Kangit:

{
  "AmbientSpawnRule": {
    "UniqueIdentifier": "jackedkangit_surface",
    "Targets": { "WorldTypes": ["NEW_EARTH"] },
    "SpawnGroup": {
      "Weight": 2,
      "EnsureSurface": true,
      "ValidTileIDs": [2, 3, 22, 13, 20],
      "WeightedLivingEntityTypes": [
        { "CreatureTypeId": "ExampleMod.jackedkangit", "Weight": 1 }
      ]
    }
  }
}

The full rule id is UniqueModName.UniqueIdentifier, here ExampleMod.jackedkangit_surface. Keep it distinct from other rules in the pack. The creature id refers to a registered creature_*.json definition. Rules load after the pack's creatures, so filename order does not matter.

Choose worlds explicitly

Target field Meaning
WorldTypes Currently accepts NEW_EARTH, the built-in Osiris/New Earth world type.
WorldProfileIds Full ids of individual custom world profiles, such as ExampleMod.flatlands.

Include at least one target. A world qualifies when either its built-in type or its profile id is listed. NEW_EARTH does not also select every New-Earth-like custom world. There is no wildcard or target-all option.

For a pack world, use its full profile id:

"Targets": { "WorldProfileIds": ["ExampleMod.flatlands"] }

A profile that is not installed contributes no encounters. This lets a pack optionally support another world's habitat. Creature references still have to resolve when the rule loads; Mod Prep warns about external creature dependencies.

Example Mod's new rule targets the built-in world only. Flatlands already includes the Jacked Kangit in its own SPWN_Flatlands.json table.

Spawn groups and habitat

All supplied habitat filters must match the candidate location. Tile and covering lists match any one id in their respective list. A candidate must also pass the engine's normal placement checks, including creature size, open space, view bounds, overlap, and recent spawn locations.

SpawnGroup field Meaning and default
Weight Positive integer relative to other eligible groups; default 1.
ValidTileIDs Required nonempty list of ground/attachment tile ids.
ValidTileCoveringIDs Optional covering ids on that tile; an empty list accepts any covering.
EnsureSurface Require the exposed surface at that column; default false.
EnsureUnderground Require a tile Y below the world's configured surface height; default false. Do not combine with EnsureSurface.
MinLightLevel, MaxLightLevel Light fraction from 0 to 1; default -1 leaves that bound unset.
MinTileHeight, MaxTileHeight Absolute tile Y, increasing downward; default -1 leaves that bound unset. These are not pixel positions or depth below the local surface.
MinTileX, MaxTileX Absolute tile X bounds; default -1 leaves that bound unset.
FlatnessRegion Named region from the world's terrain definition; defaults to unset. Its horizontal bounds restrict the group. If the region is absent, that group is skipped with a diagnostic.
RequireEventTag Require an active world event tag, such as HALLOWEEN; defaults to unset.
SpawnDensity Chance from 0 to 1 of continuing after the group is chosen; default 1.
WeightedLivingEntityTypes Required nonempty list of weighted species, described below.

Each species entry has a positive integer Weight and exactly one identity:

Species field Meaning
CreatureTypeId Full registered pack-creature id.
LivingEntityType Built-in creature enum name, such as KANGIT or CHICKEN.
CanHang Permit ceiling attachment as well as standing; default false.
MustHang Require ceiling attachment; default false.

Use documented spelling for every field. Unknown fields, missing targets, unresolved creatures, invalid ids, conflicting bounds, empty lists, and invalid or overflowing weights fail the pack load with a file and rule diagnostic. Duplicate rule ids fail rather than replacing an earlier rule.

How packs combine

The world keeps its selected base spawn groups in their original order, then appends matching contributions sorted by full rule id using ordinal ordering. Pack discovery order therefore does not change the combined group list. Contributions cannot remove or replace the base groups.

The engine chooses among eligible groups by weight, then chooses a species within that group by its species weight. If the only eligible base group has weight 20 and your group has weight 2, your group receives about 9% of group choices. Density and placement checks can still prevent an encounter. Adding more packs changes these proportions. Ordering is deterministic; individual encounters continue to use the game's random generator.

Contributions share the existing ambient spawn attempts and nearby population limit. They do not run a separate timer or bypass the cap. Disabling ambient spawning on a map also disables these contributions. The same groups are used for initial world-generation seeding and later ambient encounters.

Existing saves, Load Now, and multiplayer

  • Enabling the pack changes future encounters in existing saves. Terrain does not need to be regenerated, and existing creatures are not replaced.
  • Load Now can add a Pending pack during single-player play. After a successful load, the active world's rules refresh while keeping its spawn cooldowns and recent-location history. A failed load rolls back its rules with the rest of the pack.
  • Editing an already Loaded pack requires the existing content reload/restart workflow. Install / Refresh Test Copy only changes files on disk.
  • Disable follows the Mods browser's content reload/next-launch behavior. Once content reloads without the pack, its contributions stop affecting future encounters; this does not delete creatures already in the world.
  • The host chooses ambient encounters in multiplayer. Every peer needs matching enabled creature packs; Load Now is unavailable during multiplayer.

Validate with Mod Prep before publishing. Test a populated existing world as well as a newly generated world, and check that your habitats permit placement without overwhelming the base wildlife.