Every paragraph of the compendium pages now reads from compendium.json.
Values computed from the config become $1, $2; the Sverm fire clause, which
had two wordings folded into one sentence, is two sentences. The pages'
titles are tokens that the game's Texts dialog localizes, and since those
titles are also the pages' keys in the saved m_knownTexts, the refresh
clears the old English keys too. Boss names use the game's tokens.
Song titles and quotes stay in the original, in every language.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds DvergarConfigManagement.cs rather than reusing the DvergarConfig
name: that existing class is a different kind of thing - identity
constants that must never change (renaming RaceId would orphan saved
characters), hand-tuned cosmetic placement numbers (eye/hood position),
and per-tier tables (health malus, smithing/trader discounts) left alone
under the same boundary drawn for every other race's progression table.
Only the genuine ability knobs move: Runic Ping and Runic Overcharge
(cost, radius, duration, cooldown, marker light) each get a Configuration
Manager section, plus mining and weapon-affinity percentages under
Passive Combat, plus the two keybinds. DvergarConfig's fields for those
now forward to DvergarConfigManagement (same const-to-property trick used
for Skadi), so all 109 existing call sites across 11 files kept working
unchanged except the two keybind consumers (DvergarAbilities,
RaceCompendium's in-game ability text), which now read the live
configured key so a rebind stays reflected everywhere it's shown.
Weapon-affinity DamagePercent/StaminaPercent are overridden with the live
config value inside DvergarProgression.GetRules rather than baked into
the static WeaponAffinities array, since that array evaluates at
class-load time - before RacesOfValheim.Awake() calls Bind - and would
risk a null-reference on the ConfigEntry.
Config sections stay bound alphabetically by race (Aswid, Draugh,
Dvergar, Skadi) in RacesOfValheim.Awake().
The pair is placed symmetrically and does not come out symmetrical, because the face is not flat: near the midline the skull juts forward, near the temple it falls away, and a 24mm ball spanning that curve shows more of itself on the receding side.
Rather than shrink both and give back the socket depth just gained, the eye that comes out proud is taken to 0.85 on its own. If the wrong one shrinks, the sideways axis resolved the other way round and the multiplier belongs on the other index - which is written down where it is applied.
A centimetre deeper is a centimetre more radius. The ball cleared the face by 2mm at a 15mm radius, so moving the centre in on its own would have buried it - growing the radius to 24mm lets the centre sit at 63mm and still reach through. Same size of eye, deeper socket, flatter cap.
Down about 15mm as well, and the glow scaled to 0.5 across all three tiers.
EyeForward 0.096 to 0.094, which sounds like nothing and is not: at this radius the ball clears the face by 4mm and shows a 20mm eye, and 2mm of clearance shows about 16mm. 0.090 would bury it outright, so depth is a fine adjustment here rather than a coarse one.
Glow scaled to 0.65 as well. The colours are the game's own HDR values - one star is (0, 4, 3.3) - and everything past 1 clips to white before the bloom pass, which is why the centres read as white lamps instead of teal ones. Dimming them brings the colour back as much as it lowers the brightness.
The buried-ball idea is right and the first sizing of it was not: a 30mm radius clearing the face by 9mm showed a 43mm cap.
Radius halved to 15mm and the centre pulled out to keep about 4mm of clearance, which gives roughly a 20mm eye. Halving the radius also halves how hard the cap reacts to a millimetre of depth, which matters more than the size itself - the big ball made every adjustment an overshoot.
Your idea, and a better shape for the problem than balancing a small sphere on the surface. A large ball centred well inside the skull breaks the face with a slice of itself, so the face bounds the glow, it cannot float off the cheek, and the visible size is set by how deep the centre sits rather than by the sphere alone.
Sized from the two depths already measured: visible at a centre of 82mm with an 8mm radius, gone at 74mm with the same, which puts the face surface around 85-90mm from the head bone. A 30mm radius centred at 65mm clears that by about a centimetre.
0.014 was 11mm across on a Dvergar, which buried enough of the sphere that the visible cap read as a flat decal rather than an eye. Up to 0.026, past the 0.020 it started at, so more of the ball stands clear of the skull and gets its roundness back.
0.067 buried them, so the floor at the eye line is now measured too: the usable band runs from just under 0.105 to about 0.140, and 0.105 is the far end of what reads as inset.
Depth being spent, the remaining lever is size. What reads as protruding in profile is mostly the bloom halo rather than the ball, and both scale together - so EyeSize drops from 0.020 to 0.014, which pulls the halo in and leaves less cap standing out without moving the centre back onto the cheek.
EyeForward 0.105 to 0.067, which is 3cm on a Dvergar.
This goes well past the depth that buried them before, but that reading was taken with the eyes 10cm lower and on tilted axes, so it does not necessarily describe the face at the eye line. If they vanish, the real floor at this height is now known and 0.105 is the way back.
EyeForward 0.115 to 0.105, about a centimetre on a Dvergar. Agreed on the profile - they were still reading as sitting on the face rather than in it.
Also records the usable range, which is narrow: 0.095 buried them completely and 0.140 stood them off the skull, so the whole band is four centimetres and the eye is a two-centimetre ball. Most of it is meant to be inside.
EyeForward 0.140 to 0.115 - the axis is depth into the face, and 0.025 before the race scale is about the 2cm asked for on a Dvergar. In profile the glow was sitting off the front of the skull rather than in it.
0.140 to 0.200 before the race scale - about five centimetres on a Dvergar, half again as much as the last nudge, since the glow was still sitting a full eye below the ones on the skin.
Placement is right and the trace proves it - 0.095m from the head bone, exactly the offsets after the race scale, parented to Head and following it. They were simply still inside the skull, and the shader that resolved is depth-tested, so the head hid them completely.
The bone sits at the base of the skull and a face is further forward than it looks. Offsets raised to land about 0.109m out on a Dvergar. The trace now also reports how far up the eye ended up and whether it is on the face side of the head at all, so the next look distinguishes too shallow from the wrong direction entirely.
The trace found it. An eye sat at local (0, 0.0066, 0) on a bone with a scale of
78, which is 0.513m straight up - exactly the distance being reported from the
head. The offsets in play are 0.0007 local units, three orders of magnitude too
small to account for that, so the drift was never in them.
It was the origin. The previous version started from Character.m_eye on the
reasoning that it is the game's own answer to where a player's eyes are, and it
is not: it is where the camera goes, half a metre above the head bone. Everything
after that was correct arithmetic applied to the wrong point, which is why five
rounds of adjusting the offsets changed nothing.
Placement now starts at the head bone and nowhere else. The offsets return to
real distances for a face - forward to the surface of the skull, up from its base
- and the frame conversion is left alone, since the same trace proved it right:
0.0002 local units on a bone scaled 78 rendered as a 0.016m eye, exactly as
asked.
Three attempts have now placed these by picking a distance from a bone and hoping,
and all three landed somewhere wrong - above the head, on the camera, and inside
the skull. The distance was never the thing to fix.
Character.m_eye is the game's own answer to where a player's eyes are. Asking the
head bone to express that point in its local space gives an offset that is
correct by construction: no working out which way the bone points, no hand-picked
distance from the base of the skull, and because the result is local it rides
every head animation without being recomputed. The config offsets stay as small
nudges in metres on top of that, with EyeForward pushing out of the skull to the
surface of the face.
Also logs the bone name, its scale and the measured eye point once per session,
so the next round starts from numbers rather than from another guess.
Both faults reported came from the same wrong anchor. Character.m_eye is the
camera's eye point, not the model's: it lives outside the scaled rig, so on a
Dvergar - who renders at 78% - the quads hung where a full-height human's face
would have been, a foot above the head. And it turns with the look direction
rather than with the face, so they pointed wherever the player was looking rather
than wherever the head was.
They now hang off the player root, unscaled, and are placed onto the head bone in
world space every frame: position from the bone, orientation from the player's
own facing, and every offset multiplied by the race's visual scale so they shrink
with the body. That also means the placement constants are honest metres measured
from the base of the skull, which is what makes them tunable at all.
Driven per frame from the two places that already tick a Dvergar - the race
script for the local player, the visual controller for remote ones - because
world-space placement has to be re-applied rather than inherited.
A player's eyes are painted into the skin texture, and Custom/Player has no
emission channel to light them with - the shader survey in the last commit is
what established that. So a Dvergar wears two small emissive quads over them
instead. There was no working example to copy: the Aswid's red eyes were never
built, only cleaned up, which is why they never glowed.
Colour comes from the same LevelSetup list the skin tint does. One star is
RGBA(0, 4, 3.3), two stars RGBA(12, 0, 8.8) - both far past 1, which is what
makes them bloom rather than merely look bright. Only the base tier's colour is
ours to choose.
The quads hang off Character.m_eye, which already sits at eye height and already
faces the look direction, so the offsets are plain metres in an obvious frame:
no working out which way a rig bone points, and no fighting the 100x scale the
player armature is authored at. Everything about the placement is a named
constant, since none of it can be judged without seeing it.
Applied from the UpdateColors postfix rather than UpdateVisuals so that the
refresh DvergarRace already forces when a boss falls recolours the eyes in the
same frame it recolours the skin. It runs before the race check so it also takes
them off again.
The glow shader is resolved from a list and the winner is logged, because Unity
strips shaders nothing references and assuming one would be a silent failure.
Deriving it from the creature's own two-star offset put the tier a shade away
from ordinary human skin, and no amount of clamping fixes that, because the
derivation is asking for something a multiplier cannot do. Those offsets
brighten and desaturate a dverger's own texture. Ours multiplies the human skin
map, where less saturation means less tint, and less tint means more flesh - the
opposite direction from the one intended.
A multiplier can darken and it can bias. It cannot desaturate: the pink lives in
the texture and survives being multiplied by grey, only dimmer. So two stars now
states a colour outright - dark, and cold enough to sit on top of the flesh tone
rather than under it.
One star keeps deriving from the prefab, since that tier reads correctly.
SkeletonRace hides it every frame, but that script only ever runs for the local
player in a loaded world - so the moment the body swap started working in the
menu, the helmet came back with it. Hiding it from the visuals postfix instead
covers the preview, remote players and the first frame after a race change, none
of which reach SkeletonRace. Scaled to zero rather than deactivated, since
Valheim re-enables the instance on every refresh, and restored only from zero so
another race scaling the same helmet is left alone.
Armour is untouched, as asked.
fix(dvergar): stop the two-star tier turning back into a pink human
The star offsets are authored against a dverger's own texture, where a brightened,
desaturated result is a pale dverger. Ours multiplies the human skin texture,
where the same result is white - and a white multiplier is no tint at all, which
is exactly what two stars produced: an ordinary human. One star survived only
because its offset was smaller.
Saturation now has a floor and value a ceiling, so a tier can shift the colour but
never wash it out. The resolved offsets and the colour each one lands on are
logged once per session, so if a tier still reads wrong it can be tuned against
the real numbers rather than by eye.
The body swap read the race off the ZDO and gave up when there was none, which
is exactly the situation on the menu preview - FejdStartup instantiates a Player
and calls PlayerProfile.LoadPlayerData on it, so the preview knows its own custom
data and therefore its race, but it has no business owning a network view. It now
falls back to m_customData the way every other race in the mod already does, so a
Skeleton character looks like one before you press Start.
The tier falls back the same way. In the menu there is no world loaded to have
killed anything, so the preview is the base skeleton whatever the character has
done elsewhere.
feat(dvergar): age into a starred dverger's colours
One star at Bonemass, two at Fader.
Nothing is picked by eye. A starred creature in Valheim is not a second model: it
is the same one recoloured by LevelEffects, whose LevelSetup list holds a
hue/saturation/value offset per star. Those offsets are read off the Dverger
prefab at runtime and applied to the race's own slate blue-grey, so the tiers land
on the tints the game itself uses and keep following them if the prefab changes.
The tier comes from the ZDO key DvergarRace already publishes, so a remote Dvergar
is coloured at their own standing rather than the observer's - which matters as
soon as anyone runs personal progression.
Crossing a tier pushes a colour refresh through immediately, since the tint is
only written from the UpdateColors postfix and Valheim runs that on its own
schedule. Same treatment the health malus already gets a few lines above.
The hood is deliberately untouched.
Rename covers the folder, all seven filenames and every identifier, status
effect name and display string. Valheim's own Dverger/dvergr prefab references
are untouched - the names never collided.
The race id is what sits in m_customData and the ZDO, so renaming it alone would
have handed every existing character the selection menu again. DvergarRace
migrates the old id on spawn, before anything else reads it.
Runic Spark is modelled on Skadi's Ice Affinity and deliberately shares its
shape: live from the base tier and growing a flat step per progression state, so
+2 at Base through +16 after Fader. Lightning rather than frost, and like
Skadi's it rides every blow rather than melee only. AddFlat gained the elemental
channels while it was there - lightning would otherwise have landed in generic
damage.
The Trol remote-sync trace fired on a two-second timer for as long as a remote
player existed, which in the main menu is forever: Player.m_localPlayer is null
there, so the character preview counts as remote and it never stopped. Keyed on
the state it reports instead, so it still catches a remote player being sized
wrongly without narrating an idle menu.
2026-08-04 00:22:58 +02:00
Renamed from JotunnModStub/Dvergur/DvergurConfig.cs (Browse further)