
SkillLoss
Server-synced death skill loss and XP: loss % per category or skill, loss cap, catch-up XP after deaths, XP multipliers and death-cause multipliers (e.g. no loss on PvP). Supports modded skills. Admin-only config.Skill Loss
Controls how much of each skill players lose when they die, and how fast skills level up. The config is admin-only and synced from the server, so every player on the server gets the same values.
Features
- A death loss % per category (Combat, Utility, Crafting, Movement, Modded) or per skill
- Optional cap on how many levels a skill can lose in one death
- Optional catch-up XP: skills below the highest level the character ever had level up faster until they're back
- Optional XP gain multiplier
- Optional loss multiplier depending on how you died (creature, PvP, fall, drowning, environment, accident, other)
- Every feature can be set per category or per skill, chosen with one toggle per feature
- Its own section for every skill added by another mod, created automatically
- Optionally takes the loss from the skill's total XP instead of its level, so progress towards the next level isn't wiped
- Optionally scales losses by the world's Death penalty modifier
- Vanilla rules still apply: the No skill drain buff after dying and the skills reset on death world modifier work as normal
Configuration
BepInEx/config/txc.skillloss.cfg. The toggles at the top pick, for each feature, whether it's off or which sections it reads: the category sections ([3 - Categories - Combat], ...) or the skill sections ([4 - Skills - Combat - Swords], ...). Every category and skill section holds all the options, so the values you don't use are simply ignored.
[0 - Toggles] # Off / Category / Skill
Loss = Skill # Off = vanilla: the world's Death penalty decides (Normal 5%, Hard 7.5%...)
MaxLevelsLostCap = Off # Off = no cap
CatchUpXp = Off # Off = no catch-up bonus
XpGain = Off # Off = normal XP
DeathCauses = Off # Off / On (global, see [2 - Death Causes])
[1 - General]
LossMode = Level # Level = % of the skill level, bar reset (vanilla); TotalXp = % of all XP earned, bar kept
ApplyWorldDeathPenalty = false # true = multiply the configured Loss by the world's Death penalty (Normal x1, Hard x1.5...)
[2 - Death Causes] # loss multiplier: 1.00 = normal, 0.00 = no loss, 0.50 = half, 2.00 = double
Enemy = 1.00
PvP = 1.00
Fall = 1.00
Drowning = 1.00
Environment = 1.00 # burning, freezing, poison, smoke, water, Ashlands lava/ocean, cinder fire
Accident = 1.00 # trees, carts, boats, structures, traps, stalactites, catapults, obliterators...
Other = 1.00 # self-inflicted, edge of the world, unknown
[3 - Categories - Combat] # also Crafting, Modded, Movement, Utility
Loss = 5 # % lost on death (0-100)
MaxLevelsLost = 0 # most levels lost per death, progress bar included; 0 = no cap
CatchUpPerLevel = 0.00 # extra XP per level below the character's peak (0.10 = +10% per level)
CatchUpMax = 1.00 # upper limit of the catch-up bonus (1.00 = at most double XP)
XpGain = 1.00 # XP multiplier: 1.00 = normal, 1.50 = +50%, 0.50 = half
[4 - Skills - Combat - Swords] # same options; one section per vanilla skill
Loss = 5
...
[4 - Skills - Modded - Ranching (276088460)] # added automatically for skills from other mods
Loss = 5
...
When a toggle is set to Skill, a skill that has no section of its own (a modded skill that hasn't been discovered yet) uses its category section.
All XP multipliers stack by multiplying: XpGain × catch-up bonus × the world's Skill gain rate.
Vanilla throws away any XP beyond a level-up, which would swallow most of a bonus at low levels. While a multiplier above 1.00 is active, the extra XP it added is kept towards the next level instead of being thrown away (vanilla's own leftover is still discarded, so 1.10 stays +10%; at most one level-up per XP gain, as in vanilla).
The loss cap counts the progress bar too: a skill at 40 with a 90% bar and MaxLevelsLost = 1 ends at 39 with a 90% bar, even in Level mode (where vanilla would otherwise wipe the bar).
Death causes
The cause is the type of the hit that killed you. Damage over time (burning, poison) counts as Environment even when a creature or another player caused it; only direct player hits count as PvP.
Catch-up XP
The mod remembers the highest level each character has had in each skill (saved in the character file). While a skill is below that peak, every bit of XP is multiplied by 1 + min(CatchUpMax, CatchUpPerLevel × levels missing). With CatchUpPerLevel = 0.10 and CatchUpMax = 1.00, a skill 3 levels below its peak gets +30% XP, and one 10 or more levels below gets double. The bonus shrinks as you get closer and stops at the peak. Characters from before this feature start tracking at their current levels.
Loss modes
- Level (default, vanilla): lose the % of the skill level, and the progress towards the next level is reset.
- TotalXp: lose the % of all XP ever earned in the skill. The level and progress bar are recalculated from what's left, so you only drop as far as the lost XP takes you. Higher levels cost more XP, so the same % is gentler here: 5% of XP is roughly 2% of the level (a skill at 40 with a half-full bar drops to 39 with a 66% bar). About 12% of XP matches vanilla's 5% of the level.
Modded skills
When a player loads a character, the mod adds a [4 - Skills - Modded - Skill Name (id)] section for every skill added by another mod, starting from the [3 - Categories - Modded] values. The number in brackets identifies the skill; the name is only a label.
A dedicated server has no character, so it can't find modded skills on its own. Launch the game once with the same modpack, then copy the updated config to the server. The server loads every section in the file at startup and syncs it to players.
Console commands and debug log
skillloss_skills: lists your skills with their level, stored peak, loss % and current XP multipliers (also written to the log).skillloss_cleardeath(needsdevcommands, so admins only on a server): ends the No skill drain period after a death, so the next death applies the loss right away. Meant for testing.[1 - General] DebugLogging = truewrites the details of every death (each skill's level before and after, the % used, the cap) and the XP each skill gains (summed every 10 seconds, with the multipliers used) toBepInEx/LogOutput.log. It's a local setting, not synced from the server.
Upgrading from 1.1
The old layout is converted automatically the first time 1.2 loads: UseCategories = true becomes Loss = Category (false becomes Loss = Skill), and every loss value, LossMode, ApplyWorldDeathPenalty and modded skill moves to its new place. The old sections are removed.
Notes
- The server and every player must have this mod (version-checked on connect).
- It replaces Valheim's death skill loss, so don't combine it with other skill-loss mods (for example CustomSkillLoss).
- Skills from mods built on the common SkillManager library (for example Ranching) use this mod's values; their own "Skill loss" setting is ignored, so the skill isn't lowered twice.
- If something goes wrong while applying the loss, it logs an error and falls back to vanilla.
Changelog
- 1.2.0: New config layout (toggles + a section per category and skill, old config converted automatically), loss cap, catch-up XP, XP gain multiplier, death-cause multipliers.
- 1.1.0:
[General] LossMode: newTotalXpmode takes the loss from the skill's total XP, keeping progress towards the next level. - 1.0.0: First release.