The difficultyUi registry
The steps of the world settings menu's sliders on this player's game: for each difficulty setting the menu offers as a slider, the ordered list of numbers it lets a player choose from when a world is created or its settings are changed. Twenty-nine lists, each in the menu's own order (some run from high to low); the day, night and starving lists are in minutes as the menu shows them, the others are the factors (or Flame levels) it shows. A list may be longer or shorter than the game's. Client-authored: each player's own game applies it after a restart; it is never sent to a server or compared when a player joins. An edit changes what the menu offers on that player's game only: not the world's settings, their bounds (the difficulty registry) or the named presets (difficultyPresets). Not checked in a real game yet. 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.DifficultyUiEntry. 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:difficulty_ui. Mod entries:(none: one entry). All ids are lower case. The mod idsgameandkilnare reserved: no mod's entries use them. - One entry, game:difficulty_ui: the world settings menu's slider steps on this player's game.
- Names:
DisplayName(never empty; display names) is the name "Difficulty Sliders" (the menu's sliders, whose steps the one entry holds), not the registry's name 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 |
|---|---|---|---|---|---|---|---|
enemyDamage |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for enemy damage offers, in the menu's order (.25 to 2.5 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
enemyHealth |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for enemy health offers, in the menu's order (.25 to 4 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
enemyStamina |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for enemy stamina offers, in the menu's order (.5 to 2 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
enemyPerceptionRange |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for how far enemies notice players offers, in the menu's order (.5 to 2 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
enemyAttackFrequency |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for how often enemies attack offers, in the menu's order (.25 to 4 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
bossHealth |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for boss health offers, in the menu's order (.2 to 4 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
bossDamage |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for boss damage offers, in the menu's order (.2 to 5 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
miningXp |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for experience from mining offers, in the menu's order (2 down to 0 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
questXp |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for experience from exploration and quests offers, in the menu's order (2 down to .25 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
combatXp |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for experience from combat offers, in the menu's order (2 down to .25 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
playerHealth |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for player health offers, in the menu's order (4 down to .25 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
playerStamina |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for player stamina offers, in the menu's order (4 down to .25 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
playerMana |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for player mana offers, in the menu's order (4 down to .25 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
playerDivingTime |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for how long a player can stay under water offers, in the menu's order (2 down to .75 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
shroudTime |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for time a player can spend in the Shroud offers, in the menu's order (2 down to .5 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
durability |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | unproven: no game code is known to read this list on this build, so an edit of it would change nothing | localOnly | The steps the world settings menu's slider for item durability offers, in the menu's order (2 down to .5 on this build). The game is not known to read this list on this build: an edit of it is refused (unproven). Since 0.2.0-dev.32.2. Read by game clients only. |
dayTime |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for the length of a day, in minutes offers, in the menu's order (2 to 60 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
nightTime |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for the length of a night, in minutes offers, in the menu's order (2 to 60 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
foodDuration |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for how long food lasts offers, in the menu's order (2 down to .5 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
productionTime |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for workshop production time offers, in the menu's order (2 down to .25 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
plantGrowTime |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for plant growth time offers, in the menu's order (2 down to .25 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
weaponUpgradeCost |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for the cost of upgrading weapons offers, in the menu's order (.25 to 2 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
perkUpgradeRecyclingFactor |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for what salvaging an upgraded perk gives back offers, in the menu's order (1 down to 0 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
worldRefreshTime |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | unproven: no game code is known to read this list on this build, so an edit of it would change nothing | localOnly | The steps the world settings menu's slider for how soon the world refreshes offers, in the menu's order (.5 to 5 on this build). The game is not known to read this list on this build: an edit of it is refused (unproven). Since 0.2.0-dev.32.2. Read by game clients only. |
miningDamage |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for mining damage offers, in the menu's order (2 down to .5 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
dropAmount |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for how much a resource drops offers, in the menu's order (2 down to .25 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
starvingTime |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for the time from hungry to starving, in minutes offers, in the menu's order (20 down to 5 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
bodyHeat |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for body heat offers, in the menu's order (2 down to .5 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
flameLevelFogRemoval |
list of float -3.4028234663852886e+38..3.4028234663852886e+38 | restart | list | 0.1.0 | mapped | localOnly | The steps the world settings menu's slider for the Flame level that removes the Shroud's fog offers, in the menu's order (1 to 11 on this build). Since 0.2.0-dev.32.2. Read by game clients only. |
Entries
- Add (stage add, id
<your mod id>:<name>): no. The menu's sliders are the game's: a mod changes their steps, it cannot add a slider. - Remove: no. The menu reads every slider's steps: one cannot be removed (an empty list is an edit of its steps).
- Raw game paths in edits (the Advanced tier): allowed.
Edit it from a data pack
This registry has one entry, game:difficulty_ui: the steps of the world settings menu's sliders on the player's own game.
Its display name is Difficulty Sliders. Each field is the ordered list of numbers one slider offers when a player creates a world
or changes its settings (enemyDamage is the enemy damage slider: 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2 and 2.5 on this build).
- A list is the whole slider:
"field": "enemyDamage", "list": {"replace": [0.5, 1, 2, 4]}gives the slider those four steps, in that order. The menu shows them in the order you write them; several of the game's own lists run from high to low (playerHealth: 4 down to 0.25), so keep the order you want players to see. One step:"field": "enemyDamage[2]", "op": 0.8. - A list may be longer or shorter than the game's:
{"append": [3]},{"remove": [0.25]}and{"clear": true}work as on every list of plain values (README, "Lists"). dayTime,nightTimeandstarvingTimeare in minutes, as the menu shows them (dayTime: 2 to 60). The other lists are the factors the menu shows (or, forflameLevelFogRemoval, Flame levels 1 to 11).- The steps change what the menu offers. They do not change a world's settings, the bounds the game clamps a Custom world's
settings into (difficulty), or the named presets (
difficultyPresets). A step outside those bounds is offered, then clamped by the game where it clamps. durabilityandworldRefreshTimeare in the game's data, but no game code is known to read them on this build: an edit of them is refused with that reason, never silently kept.
Every field applies after a restart of the player's game, and only from GameStart.
Edit it from C#
[RegistryEntryPoints(RegistryEntryPoint.GameStart)]
public sealed class FinerSliders : Mod
{
public override void OnRegistry(RegistryContext context)
{
if (!Kiln.Registry.Registries.Available) return;
Kiln.Registry.Registries.For(context).Alter(stage =>
{
var menu = stage.DifficultyUi;
menu.EnemyDamage.Replace([0.1, 0.25, 0.5, 1, 2, 4, 8]);
menu.DayTime.Append(90); // minutes
});
}
}
RegistryStage.DifficultyUi is the one DifficultyUiEntry; each slider is a list of doubles. On a dedicated server the stage
skips these edits with an informational line (client-only field: it applies on each player's own game): the server has no
settings menu.
Views
RegistryViews.Find("difficultyUi") is the stable view of the one entry and the lists the stage composed on this player's game.
It is not a world's settings: those are the server's or the hosting game's.
Worked example
A menu with finer enemy damage steps and longer days to choose from:
{
"format": 1,
"registry": {
"alter": [
{ "registry": "difficultyUi", "select": "game:difficulty_ui", "field": "enemyDamage", "list": { "replace": [0.1, 0.25, 0.5, 1, 2, 4, 8] } },
{ "registry": "difficultyUi", "select": "game:difficulty_ui", "field": "dayTime", "list": { "append": [90, 120] } }
]
}
}
A pack of these edits alone is a look each player chooses for their own game: give it "side": "client". The server needs
nothing.
In multiplayer
The values are client-authored: each player's game composes its own lists from the mods it has, at its own start. They are
never sent to a server, never received from one and never compared when a player joins (joinedClient: localOnly; they are
not part of the join's registry values, kiln.registry.boot). A server cannot change a player's menu, and one player's lists
change nobody else's. In a mod that runs on both sides ("side": "both"), the dedicated server skips these edits (an
informational line in kiln.log and registry.json skipped, never a refusal) and applies its shared ones.
Known limits
- Not checked in a real game yet: the native tests write the lists into a copy of the menu's data with Kiln's real boot writer (in place and longer or shorter), and Kiln's offline client proof, run with the release, reads, writes and reverts each list on a copy of the client's own data; a player's menu showing the new steps has not been seen.
- The menu copies the steps when it builds its settings section; a list of no steps, or of many, has not been tried in the game.
durabilityandworldRefreshTimehave no known reader on this build: their edits are refused.- The menu's preset descriptions and comparisons are copies of their own, not in this registry.