The difficultyPresets registry
The four named world-setting presets: Default, Relaxed, Hard and Survival. Each holds the 38 settings used when a dedicated server starts or a hosting client establishes its world session. A change takes effect after a restart, including for an existing world using that named preset, not immediately in a running world. Custom uses its own saved or configured settings and the separate difficulty bounds registry. Only the server or hosting client needs the preset mod: the game sends the chosen settings block to joining players, which do not select their own local preset. The menu has independent preset copies; editing this registry does not change its descriptions or slider choices. Numeric ranges are the storage types' full ranges, not the game's stock difficulty bounds; time values are seconds. Since 0.2.0-dev.32.2.
Schema version 0.1.0, experimental (KILNX031: may change in any release until it is marked stable). C# entry type Kiln.Registry.DifficultyPresetEntry. What registries are, the stages, the conflict rules and how ids are made: README.
Edits per call: 4,096. One OnRegistry callback (one phase of one entry point) or one Registries.Change takes at most this many edits of this registry; a call with more is refused whole, with the reason in kiln.log and registry.json, and nothing of it applies (the other calls do). The default for a registry whose schema declares none (4,096).
Ids
- Game entries:
game:<default|relaxed|hard|survival>. Mod entries:(none: the four named presets are the game's). All ids are lower case. The mod idsgameandkilnare reserved: no mod's entries use them. - The lower-case preset identity names each entry: game:default, game:relaxed, game:hard and game:survival. The identity is read-only; array order is never identity. Custom is not an entry.
- Names:
DisplayName(never empty; display names) is default, Relaxed, Hard and Survival, respectively; the stable preset id made into words.
Fields
Applies: now = takes effect at the next use; worldLoad = takes effect when a world loads; restart = takes effect after a game restart. Ops: number = a value or the relative operations (mul, add, min, max, raiseOnly, lowerOnly); set = a value; list = clear, append, remove, replace; indexed = a list of fixed length, edited one element at a time (xpPerLevel[2]) with a value or a number operation. A field of a list's elements is named with [] in this table and with the element's index in an edit (entries[3].chance, or [*] for every element). Mapping: whether this Kiln maps the field onto the game; an unproven or unmapped field is refused per entry, with the reason, until a Kiln update maps it. Joined client: when a joined Kiln client consumes a server edit; see README.
| Field | Type | Applies | Ops | Since | Mapping | Joined client | About |
|---|---|---|---|---|---|---|---|
presetId |
enum (default, relaxed, hard, survival, custom) | restart | read-only | 0.1.0 | mapped | serverOnly | The preset identity: default, relaxed, hard or survival on this build; custom is a settings mode, not a fifth preset entry. Read-only; reordering the game data does not change which entry an edit names. Since 0.2.0-dev.32.2. |
playerHealthFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for players' health (playerHealthFactor). Since 0.2.0-dev.32.2. |
playerManaFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for players' mana (playerManaFactor). Since 0.2.0-dev.32.2. |
playerStaminaFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for players' stamina (playerStaminaFactor). Since 0.2.0-dev.32.2. |
playerBodyHeatFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for players' body heat (playerBodyHeatFactor). Since 0.2.0-dev.32.2. |
playerDivingTimeFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for players' diving time (playerDivingTimeFactor). Since 0.2.0-dev.32.2. |
enableDurability |
bool | restart | set | 0.1.0 | mapped | serverOnly | Whether equipment loses durability. Since 0.2.0-dev.32.2. |
enableStarvingDebuff |
bool | restart | set | 0.1.0 | mapped | serverOnly | Whether hungry players can acquire the starving debuff. Since 0.2.0-dev.32.2. |
foodBuffDurationFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for how long food buffs last (foodBuffDurationFactor). Since 0.2.0-dev.32.2. |
fromHungerToStarving |
time s -9223372036.854776..9223372036.854776 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for the time from hungry to starving (fromHungerToStarving). Since 0.2.0-dev.32.2. |
shroudTimeFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for players' time in the Shroud (shroudTimeFactor). Since 0.2.0-dev.32.2. |
tombstoneMode |
enum (addBackpackMaterials, everything, noTombstone) | restart | set | 0.1.0 | mapped | serverOnly | What a player leaves in a tombstone on death. Since 0.2.0-dev.32.2. |
enableGliderTurbulences |
bool | restart | set | 0.1.0 | mapped | serverOnly | Whether gliders experience turbulence. Since 0.2.0-dev.32.2. |
weatherFrequency |
enum (disabled, rare, normal, often) | restart | set | 0.1.0 | mapped | serverOnly | How frequently weather occurs. Since 0.2.0-dev.32.2. |
fishingDifficulty |
enum (veryEasy, easy, normal, hard, veryHard) | restart | set | 0.1.0 | mapped | serverOnly | The fishing difficulty. Since 0.2.0-dev.32.2. |
miningDamageFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for mining damage (miningDamageFactor). Since 0.2.0-dev.32.2. |
plantGrowthSpeedFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for how fast plants grow (plantGrowthSpeedFactor). Since 0.2.0-dev.32.2. |
resourceDropStackAmountFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for how much resources drop (resourceDropStackAmountFactor). Since 0.2.0-dev.32.2. |
factoryProductionSpeedFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for how fast workshops make things (factoryProductionSpeedFactor). Since 0.2.0-dev.32.2. |
perkUpgradeRecyclingFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for what salvaging an upgraded perk gives back (perkUpgradeRecyclingFactor). Since 0.2.0-dev.32.2. |
perkCostFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for what upgrading a weapon costs (perkCostFactor). Since 0.2.0-dev.32.2. |
experienceCombatFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for experience from combat (experienceCombatFactor). Since 0.2.0-dev.32.2. |
experienceMiningFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for experience from mining (experienceMiningFactor). Since 0.2.0-dev.32.2. |
experienceExplorationQuestsFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for experience from exploring and quests (experienceExplorationQuestsFactor). Since 0.2.0-dev.32.2. |
randomSpawnerAmount |
enum (few, normal, many, extreme, automatic) | restart | set | 0.1.0 | mapped | serverOnly | The amount of randomly spawned enemies. Since 0.2.0-dev.32.2. |
aggroPoolAmount |
enum (few, normal, many, extreme) | restart | set | 0.1.0 | mapped | serverOnly | The amount of enemies that may aggro together. Since 0.2.0-dev.32.2. |
enemyDamageFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for enemies' damage (enemyDamageFactor). Since 0.2.0-dev.32.2. |
enemyHealthFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for enemies' health (enemyHealthFactor). Since 0.2.0-dev.32.2. |
enemyStaminaFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for enemies' stamina (enemyStaminaFactor). Since 0.2.0-dev.32.2. |
enemyPerceptionRangeFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for how far enemies see and hear (enemyPerceptionRangeFactor). Since 0.2.0-dev.32.2. |
bossDamageFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for bosses' damage (bossDamageFactor). Since 0.2.0-dev.32.2. |
bossHealthFactor |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for bosses' health (bossHealthFactor). Since 0.2.0-dev.32.2. |
threatBonus |
float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for how often enemies attack (threatBonus). Since 0.2.0-dev.32.2. |
pacifyAllEnemies |
bool | restart | set | 0.1.0 | mapped | serverOnly | Whether enemies are pacified. Since 0.2.0-dev.32.2. |
tamingStartleRepercussion |
enum (keepProgress, loseSomeProgress, loseAllProgress) | restart | set | 0.1.0 | mapped | serverOnly | What startling an animal does to taming progress. Since 0.2.0-dev.32.2. |
dayTimeDuration |
time s -9223372036.854776..9223372036.854776 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for how long a day lasts (dayTimeDuration). Since 0.2.0-dev.32.2. |
nightTimeDuration |
time s -9223372036.854776..9223372036.854776 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for how long a night lasts (nightTimeDuration). Since 0.2.0-dev.32.2. |
curseModifier |
enum (easy, normal, hard) | restart | set | 0.1.0 | mapped | serverOnly | The curse difficulty. Since 0.2.0-dev.32.2. |
flameLevelFogRemoval |
int 0..255 | restart | number | 0.1.0 | mapped | serverOnly | The preset value for the Flame level from which the Shroud lifts where players build (flameLevelFogRemoval). Since 0.2.0-dev.32.2. |
Entries
- Add (stage add, id
<your mod id>:<name>): no. Only the four named preset identities are supported by the game; Custom is a separate settings mode, not an added preset. - Remove: no. The game must be able to find each named preset when a server starts or a world session is established.
- Raw game paths in edits (the Advanced tier): allowed.
Edit it from a data pack
A preset is a complete block of world settings that the host chooses when it starts a named-preset world. This registry has
four entries: game:default, game:relaxed, game:hard and game:survival. Each holds the same 38 settings; its display name
is Default, Relaxed, Hard or Survival. Entries are named by their read-only presetId, not their position in an array.
A preset cannot be added, removed or renamed.
Select the named preset whose settings you want to change. For example, "registry": "difficultyPresets",
"select": "game:hard", "field": "playerHealthFactor", "op": 2.5 gives Hard a player-health factor of 2.5. The full JSON
example is below. A relative operation such as "op": {"mul": 2} multiplies the value below this mod, as
in any registry.
Every setting applies after a restart, and may be authored only at GameStart: it does not change a running world's
active settings. Choose that named preset in the server or world configuration for its settings to be used; existing worlds
using that preset also take its values at the next start. Custom is not a fifth preset entry: it uses the world's saved or
configured settings, with bounds from the separate difficulty registry.
Duration fields (fromHungerToStarving, dayTimeDuration, nightTimeDuration) use seconds in JSON. They are not the
minute-valued slider steps in the menu. Enum values use the camelCase names in the field table, such as noTombstone.
The schema uses the storage types' full numeric ranges, not the game's stock difficulty caps.
Edit it from C#
[RegistryEntryPoints(RegistryEntryPoint.GameStart)]
public sealed class HardPresetEditor : Mod
{
public override void OnRegistry(RegistryContext context)
{
if (!Kiln.Registry.Registries.Available) return;
Kiln.Registry.Registries.For(context).Alter(stage =>
{
var hard = stage.DifficultyPresets["game:hard"];
hard.PlayerHealthFactor = 2.5;
hard.TombstoneMode = DifficultyPresetTombstoneMode.NoTombstone;
hard.DayTimeDuration = TimeSpan.FromSeconds(1234.5);
});
}
}
RegistryStage.DifficultyPresets holds DifficultyPresetEntry values, keyed by the four preset ids. The settings are typed:
float factors use double, durations use TimeSpan, and enum fields use the generated DifficultyPreset... enums.
PresetId is read-only (DifficultyPresetIdentity). A later entry point (WorldLoad, ModLoad, HotReload or
Registries.Change) cannot apply these restart fields: it is refused RestartRequired.
Views
RegistryViews.Find("difficultyPresets") is the stable view of the four preset definitions and their composed values. It is
not the running world's active settings and not the settings menu's copies. An edit here changes the preset definition the
host will choose after a restart, not whichever settings a currently running world holds.
Worked example
Give Hard a player-health factor of 2.5, no tombstone, and a day lasting 1,234.5 seconds (20 minutes 34.5 seconds). This is the same combination as the C# example and the native boot-writer test:
{
"format": 1,
"registry": {
"alter": [
{ "registry": "difficultyPresets", "select": "game:hard", "field": "playerHealthFactor", "op": 2.5 },
{ "registry": "difficultyPresets", "select": "game:hard", "field": "tombstoneMode", "op": "noTombstone" },
{ "registry": "difficultyPresets", "select": "game:hard", "field": "dayTimeDuration", "op": 1234.5 }
]
}
}
For a pack containing only these registry edits, use "side": "both" and "clients": "none" in its kiln.mod.json.
Install it on the dedicated server or on the client that hosts the world. side: both lets the same pack work on either
kind of host; it does not require joining players to install it. Select Hard and restart the host to use these values.
In multiplayer
The dedicated server or hosting client chooses the preset and sends the actual settings block to joining clients. A
joining player does not select a preset from their own local table, so joining players need neither this mod nor Kiln
merely to receive these settings. These fields are joinedClient: serverOnly: there is no client-held preset copy that must
match at join. Other features in a mixed mod can still require Kiln or the mod on clients; the advice above is for these
registry edits alone.
This also works for single-player worlds: the local client is the host and needs the mod itself. A mod installed only on a joining, non-hosting client cannot change the host's settings.
Known limits
- The settings menu holds its own copies of the presets, separate from these authoritative definitions, so it can show
the old preset numbers and comparisons even when the host uses the edited settings. Editing this registry does not update
those menu copies or its slider choices. The sliders' steps are the separate
difficultyUiregistry (since 0.2.0-dev.32.2, edited on each player's own game); the menu's preset descriptions and comparisons are in neither. - All writes need a host restart. Reloading a pack, changing worlds without restarting the process, or rejoining alone is not a live update of these definitions.
- Editing a named preset does not edit Custom settings, the separate difficulty bounds, or an already-running world's
active settings. It cannot create a fifth preset or change
presetId. - Full storage-type ranges are not a guarantee that every value makes sense in gameplay; no extra gameplay caps are imposed by this registry.
- Native byte-backed tests cover reordered preset identities, float/enum/time writes and read-only refusal. A real host using the edited preset after a restart, and a joined player receiving its settings, have not yet been checked in game.