You are viewing a potentially older version of this package. View all versions.
TXC-SkillLoss-1.2.0 icon

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.

By TXC
Date uploaded 2 days ago
Version 1.2.0
Download link TXC-SkillLoss-1.2.0.zip
Downloads 270
Dependency string TXC-SkillLoss-1.2.0

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2351 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2351
ValheimModding-Jotunn-2.30.2 icon
ValheimModding-Jotunn

Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.

Preferred version: 2.30.2

README

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 (needs devcommands, 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 = true writes 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) to BepInEx/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: new TotalXp mode takes the loss from the skill's total XP, keeping progress towards the next level.
  • 1.0.0: First release.

CHANGELOG

Changelog

1.2.0

  • New config layout. [0 - Toggles] at the top picks, per feature, whether it's Off or reads the Category sections ([3 - Categories - Combat], ... Crafting, Modded, Movement, Utility) or the Skill sections ([4 - Skills - Combat - Swords], [4 - Skills - Modded - Ranching (id)], ...). Every category and skill section holds all the options: Loss, MaxLevelsLost, CatchUpPerLevel, CatchUpMax, XpGain. [1 - General] and [2 - Death Causes] sit in between.
  • New [1 - General] DebugLogging (local, not synced): logs every skill's level before/after each death, XP gained per skill with the multipliers used, level-ups and stored peaks.
  • New console commands: skillloss_skills lists your skills with level, peak, loss and XP multipliers; skillloss_cleardeath (needs devcommands) ends the "No skill drain" period so the next death loses skills again.
  • Ride moved from the Movement to the Utility category (its section is renamed and its values carried over automatically).
  • Loss = Off uses vanilla's loss for the world's Death penalty setting (Normal 5%, Hard 7.5%, ...).
  • The 1.1 config is converted automatically on first load (UseCategories = true becomes Loss = Category); the old sections are removed.
  • New loss cap (MaxLevelsLost, toggle MaxLevelsLostCap): the most levels a skill can lose in one death, progress bar included. Off by default.
  • New catch-up XP (CatchUpPerLevel / CatchUpMax, toggle CatchUpXp): extra XP while a skill is below the highest level the character ever had in it, scaling with how far below it is. Off by default. Peaks are saved in the character file; existing characters start tracking at their current levels.
  • New XP gain multiplier (XpGain, toggle XpGain). Off by default.
  • New [2 - Death Causes] (toggle DeathCauses): a loss multiplier per kind of death (Enemy, PvP, Fall, Drowning, Environment, Accident, Other). Off by default.
  • With an XP multiplier above 1.00, the extra XP it added is carried over a level-up instead of being thrown away (vanilla discards the overflow).
  • Multipliers are written with two decimals (1.00, 0.50); loss values stay percentages.
  • Everyone on the server needs 1.2.0 (version check is per minor version).

1.1.0

  • New [General] LossMode (default Level, same as 1.0.0). TotalXp takes the configured % from all XP earned in the skill, then recalculates the level and progress bar from what's left, so progress towards the next level is no longer wiped.
  • Everyone on the server needs 1.1.0 (version check is per minor version).

1.0.0

  • First release.