Commit graph

139 commits

Author SHA1 Message Date
c320fa5b2b feat(skadi): add Rime Feather hover trinket (Mountain faction feature)
Utility-slot item cloned from Megingjord: holding Space while airborne climbs
at a steady rate (stamina-gated), letting go caps the fall speed into a free
Drake-glide-inspired float instead of a hard drop, and feather fall is always
on while equipped via the item's own m_fallDamageModifier equip effect.
Independent of DrakeFormBehavior/Character.m_flying on purpose.

Crafts at a plain Forge for now (FreezeGland x5 + Silver x5) - the Factions
merchant-gate item and a race lock on the fall-damage effect are still open,
see MOUNTAIN-FACTION-BRAINSTORM.md.
2026-08-06 18:35:09 +02:00
b34deef2de chore: ignore local Factions/session reference notes
Personal knowledge-dump notes, kept out of version control.
2026-08-06 16:06:36 +02:00
a0f0b46579 Merge pull request 'create-config-file' (#16) from create-config-file into main
Reviewed-on: #16
2026-08-06 15:55:15 +02:00
4b5d60d4b6 feat(trol): make ability numbers and keybinds BepInEx-configurable
Adds TrolConfig.cs, following the established per-race pattern: one
Configuration Manager section per topic (Passive Combat, Throw Rock,
True Form, Log Weapon, Farming), plus the two ability keybinds (Throw
Rock, True Form). Defaults match the previous hardcoded constants
exactly.

Fixes a real sync risk found while wiring it: True Form's scale (2.0
normal / 2.5 at tier 7+) was hardcoded independently in two places - the
local transform routine in TrolRace and the remote-player sizing postfix
in TrolPatches. Both now read the same TrolConfig.TrueFormScaleNormal/
TrueFormScaleAdvanced, so a retuned value can no longer make a Trol one
size to themselves and another size to everyone else.

Tier-gate thresholds and the small hardcoded "normal size by tier" table
(1.2/1.25/1.30) stay untouched, same boundary drawn for every other
race's progression data.

Config sections stay bound alphabetically by race (Aswid, Draugh,
Dvergar, Fenrir, Furling, Skadi, Skeleton, Trenta, Trol) in
RacesOfValheim.Awake() - this is the last of the nine.
2026-08-06 15:34:05 +02:00
14648aaf62 feat(trenta): make ability numbers and keybinds BepInEx-configurable
Adds TrentaConfigManagement.cs rather than reusing the TrentaConfig name,
same reasoning as DvergarConfigManagement: that existing class holds
identity constants that must never change (RaceId, status effect and
prefab names), hand-tuned cosmetic placement numbers (skin colour, crown
position), and design-time tables (HealthBonusByState, the per-biome
AwakenedSeedFoods list) left alone under the same boundary drawn for
every other race's progression table.

Only the genuine ability knobs move: Photosynthesis, Purple Rain, Last
Stand/Thorns, Homecoming Portal, Hornet's Nest, Muspell, and the vegan
food duration bonus each get a Configuration Manager section, plus the
three transform/ability keybinds (Purple Rain, Portal, Muspell).
TrentaConfig's fields for those now forward to TrentaConfigManagement
(same const-to-property trick used for Skadi and Dvergar), so every
existing call site kept working unchanged except the three keybind
consumers in TrentaAbilities, which now read the live configured key.

Fixes a BepInEx startup crash caught while testing: the Hornet's Nest
section name used a straight ASCII apostrophe, which
ConfigDefinition.CheckInvalidConfigChars rejects outright (section/key
names may not contain = \n \t \ " ' [ ]). Switched to the typographic
apostrophe (U+2019), which reads the same and isn't on the forbidden list.

Config sections stay bound alphabetically by race (Aswid, Draugh,
Dvergar, Fenrir, Furling, Skadi, Skeleton, Trenta) in
RacesOfValheim.Awake().
2026-08-06 15:20:10 +02:00
0a3f82e955 feat(skeleton): make ability numbers BepInEx-configurable, add fire VFX toggle
Adds SkeletonConfig.cs, following the established per-race pattern: one
Configuration Manager section per topic (Passive Combat, Fire Aura,
Resurrection). No keybinds section - every Skeleton ability is passive,
triggered by tier and combat events rather than a key press. Defaults
match the previous hardcoded constants exactly.

The per-tier progression table itself (max health bonus, lifesteal
percent, max summons) stays untouched, same boundary drawn for every
other race's progression table.

Also adds a client-side "Head Fire VFX Enabled" toggle under a new
Skeleton - Visuals section, gating both places the burning-skull effect
is triggered (SkeletonRace for the local player, ZdoVisualSync for every
other skeleton-race player this client renders) - disabling it stops the
flame rendering for this client only, without changing what other
players see.

Config sections stay bound alphabetically by race (Aswid, Draugh,
Dvergar, Fenrir, Furling, Skadi, Skeleton) in RacesOfValheim.Awake().
2026-08-06 15:11:39 +02:00
4b382e7fad feat(furling): make ability numbers BepInEx-configurable
Adds FurlingConfig.cs, following the established per-race pattern: one
Configuration Manager section per tier ability (Passive Combat, Master of
Shadows, The Wickerman, Grave Robber, The King Is Dead, In the Mist). No
keybinds section - every Furling ability is passive, triggered by tier,
biome, or combat events rather than a key press. Defaults match the
previous hardcoded constants exactly.

"Dance of the Dead" (tier 4+) has no numeric knob and stays untouched: it
doubles craft yield by crafting a literal second copy rather than
multiplying a configurable amount.

Also fixes a latent truncation bug found while wiring the trophy drop
multiplier: it was applied as `amount *= 2` (int), which would have
truncated any non-integer multiplier a player configured (e.g. 1.5x
rounding down every time). Now computed as
Mathf.RoundToInt(amount * multiplier).

Config sections stay bound alphabetically by race (Aswid, Draugh,
Dvergar, Fenrir, Furling, Skadi) in RacesOfValheim.Awake().
2026-08-06 14:25:23 +02:00
6755c263f3 feat(fenrir): make ability numbers and keybinds BepInEx-configurable
Adds FenrirConfig.cs, following the established per-race pattern: one
Configuration Manager section per topic (Keybinds, Passive Combat, Form
Buffs, and one per transformation form - Fenring, Cultist, Wolf, Ulv),
covering every attack's damage/radius/push-force number across all four
independent form behaviors, plus the four transform/howl keybinds.
Defaults match the previous hardcoded constants exactly.

Only the four transform/howl keys are rebindable - unlike Skadi's dragon
forms, which share one unified attack-button scheme, each of Fenrir's
four forms is an independent MonoBehaviour with its own hardcoded mouse
reads, so making all eleven attack buttons rebindable was left out as a
much larger, separately-scoped change.

The Form Buffs section opens with a non-editable note (the CustomDrawer
trick from ConfigurationManagerAttributes) explaining that those specific
values are baked into status effects once at mod startup and need a
relog to pick up a change - everything else reads live.

Config sections stay bound alphabetically by race (Aswid, Draugh,
Dvergar, Fenrir, Skadi) in RacesOfValheim.Awake().
2026-08-06 14:12:07 +02:00
3607d7323d feat(dvergar): make ability numbers and keybinds BepInEx-configurable
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().
2026-08-06 13:56:00 +02:00
8595b7108a feat(draugh): make abilities BepInEx-configurable; reorder Skadi sections
Adds DraughConfig.cs, following the SkadiConfig/AswidConfig pattern: one
Configuration Manager section per tier ability (Passive Combat, Sunken
Menace, Rotting Edge, Undead Fortitude, North Wind, Undying Will, Swarm Of
Terror, Steal Their Breath). No keybinds section - every Draugh ability
triggers off a game event (parry, hit taken/landed, death) rather than a
key press. Defaults match the previous hardcoded constants exactly.

Also reorders SkadiConfig so Passive Combat binds right after Keybinds,
matching the Aswid/Draugh section order (Keybinds, then Passive Combat,
then the rest).

Config sections stay bound alphabetically by race (Aswid, Draugh, Skadi)
in RacesOfValheim.Awake().
2026-08-06 13:42:44 +02:00
629a534bc3 feat(aswid): make abilities and special attacks BepInEx-configurable
Adds AswidConfig.cs, following the SkadiConfig pattern: one Configuration
Manager section per topic (Keybinds, Passive Combat, Vampiric Aura,
Superhuman Senses, Eclipse, Devour, Domination), covering every tunable
number and all five ability keybinds (Bat Form, Mist Form, Eclipse, Tame,
Toggle Devour). Defaults match the previous hardcoded constants exactly.

Also fixes a real mismatch found along the way: the tame hover-text
hardcoded "[K] Tame" while the key that actually triggered taming was U.
Both now read the same configured Tame key, so the hint stays correct if
it's rebound.

Config sections are bound alphabetically by race (Aswid before Skadi) in
RacesOfValheim.Awake(), since Configuration Manager's category list
follows bind order.
2026-08-06 13:33:39 +02:00
7708599ff9 feat(skadi): add rebindable keybinds for abilities and special attacks
Adds a Skadi - Keybinds config section (bound first, ahead of the other
Skadi sections) covering every ability/attack trigger: dragon primary
attack, cold spell cast, breath attack, Fader spin, flight toggle, and the
three transform keys (Drake/Moder/Fader). Defaults match the previous
fixed inputs exactly. SkadiAttackPatch's kick-suppression check now reads
the configured Cold Spell key instead of a hardcoded Middle Mouse, so it
stays correct if that key is rebound.

Entries within Keybinds carry an explicit Order (via the new
ConfigurationManagerAttributes shim, per CONFIGURATION-MANAGER-HOWTO.md)
so they list as attack -> cast -> breath -> spin -> flight -> the three
transform keys, rather than alphabetically.
2026-08-06 13:08:05 +02:00
c088eb74f4 feat(skadi): make abilities and special attacks BepInEx-configurable
Binds every tunable number behind Skadi's Cold Spell, frost aura, bonus
frost damage, dragon-form scale/melee/ranged attacks, and directed flight
as BepInEx ConfigEntry values (SkadiConfig.cs), following
CONFIGURATION-MANAGER-HOWTO.md. Defaults match the previous hardcoded
constants exactly, so this is config-only, no gameplay change.

BepInEx writes these to BepInEx/config/com.nandor.racesofvalheim.cfg on
first run regardless of whether Configuration Manager is installed - a
plain, commented, hand-editable text file - so players without the plugin
can still retune values by hand.
2026-08-06 12:45:53 +02:00
ab91aa5102 chore: ignore local CONFIGURATION-MANAGER-HOWTO.md
Personal setup notes for Configuration Manager, kept out of version control.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-06 12:21:58 +02:00
12e93d359a Merge pull request 'fix(skeleton): hide beard and skinned helmet pieces correctly' (#15) from fix-skeleton-head-parts-visibility into main
Reviewed-on: #15
2026-08-06 12:13:28 +02:00
2f890f95f7 fix(skeleton): hide beard and skinned helmet pieces correctly
The hair/beard hide called into m_hairItemInstances/m_beardItemInstances
(plural), fields that don't exist on VisEquipment - every other race uses
the real singular m_hairItemInstance/m_beardItemInstance, so the beard was
never actually hidden. Fixed the field names and made the helper handle
both a GameObject and a List<GameObject> defensively.

Helmet hiding only scaled the wrapper to zero, which does nothing for a
skinned-mesh piece bound to the player's own bones - it ignores its
wrapper's transform. Added SkeletonVisuals.SetEquipmentPieceHidden, which
scales to zero and disables every child renderer, and used it everywhere
the helmet is hidden (local player, remote players, main-menu preview).

Also added an F8 debug dump of the hair/beard/helmet instance state
(active, renderer enabled, scale) for diagnosing any future visibility
regressions in-game.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-06 12:12:30 +02:00
Ferdinando
ce87e987c9 factionsmerchants 2026-08-06 10:13:57 +02:00
Ferdinando
46f45ed1e3 aswid eye fix 2026-08-05 22:52:05 +02:00
10e0485540 Merge pull request 'add-dvergar-color-and-skeleton-menu' (#14) from add-dvergar-color-and-skeleton-menu into main
Reviewed-on: #14
2026-08-05 22:08:38 +02:00
c3c8494137 style(dvergar): dim the eyes to 0.3
Applies to all three tiers, so the base teal, the one-star cyan and the two-star magenta come down together and keep their relative brightness.
2026-08-05 22:02:07 +02:00
ef8fae888a style(dvergar): shrink the model's left eye on its own
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.
2026-08-05 21:59:26 +02:00
e6bf266eea fix(dvergar): derive the sideways axis so both eyes sit at the same depth
One eye reading correctly while the other creeps up the forehead is what an out-of-square frame looks like. The three axes were each rounded to the nearest one independently, which guarantees nothing about the angles between them - and a right that shares an axis with forward is no longer sideways, so the separation pushes one eye out of the face and pulls the other into it.

Right is now a cross product of the other two, which cannot be anything but perpendicular to both. Symmetric by construction rather than by luck of the pose the head was in when the eyes were built.
2026-08-05 21:54:26 +02:00
e3ade9aa63 style(dvergar): sink the eyes a centimetre, drop them, and dim to half
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.
2026-08-05 21:50:46 +02:00
dae1f96852 style(dvergar): sink the eyes slightly and take the glare off them
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.
2026-08-05 21:47:41 +02:00
bd27bd8fd4 chore(dvergar): retire the eye trace and the shader survey
Both were built to answer questions and both answered them: the trace found the camera anchor sitting half a metre above the head bone, the counter-rotating axes, and the tilt that put the eyes at the jaw; the survey established that Custom/Player carries no desaturation control and never will make a pale Dvergar.

Neither belongs in a session log now that the answers are known, so the trace goes and the survey's finding stays as the comment that stops anyone re-deriving it. The one-line reports that remain are the ones a game update could invalidate - which glow shader resolved, and the star offsets read off the creature prefab.
2026-08-05 21:44:50 +02:00
aee34caafd style(dvergar): shrink the cap from most of a face to an eye
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.
2026-08-05 21:40:22 +02:00
fc608d677a feat(dvergar): make the eye a buried ball showing only its cap
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.
2026-08-05 21:37:43 +02:00
38ba444f64 style(dvergar): make the eyes bigger and round again
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.
2026-08-05 21:35:58 +02:00
db482ede87 style(dvergar): back to the deepest depth that still shows, and smaller eyes
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.
2026-08-05 21:31:09 +02:00
f4f575b181 style(dvergar): sink the eyes three centimetres
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.
2026-08-05 21:29:28 +02:00
8c004e3d7f style(dvergar): sink the eyes another centimetre
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.
2026-08-05 21:09:02 +02:00
376000da49 style(dvergar): sink the eyes into the sockets
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.
2026-08-05 21:06:13 +02:00
e323530a58 style(dvergar): raise the eyes again, onto the painted ones
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.
2026-08-05 21:04:06 +02:00
d752dba10d style(dvergar): raise the eyes to the eye line
They were sitting at cheekbone height. Up from 0.100 to 0.140 before the race scale, which is about three centimetres on a Dvergar.
2026-08-05 21:02:00 +02:00
7c9c1ca630 fix(dvergar): square the skull's axes so the eyes sit on the eye line
The trace showed the offsets arriving tilted: 0.109m of forward and 0.078m of up came out as 0.124 forward and 0.059 up, which is the jaw rather than the eyes. towardFace read 0.99, so the direction was never wrong - only leaning.

The axes are measured from whatever pose the head is in on the frame the eyes are built, and a head pitched a few degrees hands back a forward that leans down and an up that leans back. A bone's real axes are square, so the measurement is now rounded to the nearest one. The tilt was the pose at the moment of asking and nothing else.
2026-08-05 20:59:01 +02:00
196e413573 fix(dvergar): measure the skull's axes once, so the eyes turn with the head
The eyes were parented to the head bone and still ignored every head animation,
which should have been impossible - a child cannot refuse its parent's rotation.
It was not refusing it. It was being handed the exact opposite every frame.

The offsets were built from directions computed as
headBone.InverseTransformDirection(playerRoot.forward), and that was recomputed
on every placement. As the head turns, the same world direction expressed in the
head's local space rotates by exactly the negative of the head's rotation - so
the local offset counter-rotated and cancelled the animation out. The eyes rode
the head's position perfectly and its rotation not at all, which is exactly what
it looked like from the first screenshot onwards.

The axes are now measured once, at build time, while the head is still looking
where the body is, and kept on the eye holder. Fixed in the skull's frame, they
ride every animation for free - which was the whole point of parenting to the
bone in the first place.
2026-08-05 20:54:30 +02:00
e512dcfb93 fix(dvergar): push the eyes out to the surface of the face
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.
2026-08-05 20:51:11 +02:00
f93b57ceff fix(dvergar): stop measuring the eyes from the camera anchor
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.
2026-08-05 20:47:17 +02:00
7651a07279 chore(dvergar): trace where the eyes actually are, not where they should be
The arithmetic puts them 7cm from the head bone and the screen puts them metres away, so the offsets are not the thing to keep adjusting. Traces position, parent, local and world transforms and the distance from the head, six times over the first few seconds - enough to tell a bad offset from an object that is not parented, or one that is parented and then moved.
2026-08-05 20:43:24 +02:00
c974977f64 fix(dvergar): hang the eyes on the bone the mesh is actually skinned to
A child transform cannot ignore its parent's rotation, so eyes that followed the
body but sat out every idle bob of the head were never parented to the head that
was moving. They were parented to the Animator avatar's HumanBodyBones.Head,
which on this rig is a transform that travels with the player and is not the one
the animation drives.

The rest of the mod has never used the avatar for this. The hood, the Skeleton's
body swap and the Furling's head all take the bone off
VisEquipment.m_bodyModel.bones - the array the skinned mesh deforms with, which
is by definition the rig that moves. The eyes do too now, with the avatar left as
a fallback only for the case where the body model is not up yet.

The one-shot log prints both candidates side by side and says whether they are
the same transform, so the next report confirms or kills this outright rather
than leaving it to inference.
2026-08-05 20:37:45 +02:00
e7d60f61ba fix(dvergar): measure where the eyes go instead of guessing at it
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.
2026-08-05 20:33:13 +02:00
8014986f0a fix(dvergar): socket the eyes into the head bone instead of following it
They were placed from the player root's axes every frame, which follows where the
body faces and knows nothing about where the head is looking - so an idle
animation turned the head and left the eyes behind, reading as attached to the
camera rather than to the face.

They are children of the head bone now, so position and rotation are inherited
and no longer computed. The reason that was avoided in the first place was not
knowing which way a rig bone points, and the answer turned out to be to stop
guessing: the body's forward and up, expressed in the head bone's local space,
are exactly the directions wanted, and because they are local they go on meaning
the same thing as the head turns. Measured once at build time, while the head is
still looking where the body is.

Scale is the only thing still asserted each frame, because it can change under
us. The bone carries the armature's hundredfold scale multiplied by whatever the
race renders at; dividing it out leaves the holder standing at exactly the race's
scale, which keeps the offsets underneath honest metres and keeps the eyes
shrinking with a Dvergar.
2026-08-05 20:28:01 +02:00
bb952ac4c2 fix(dvergar): make the eyes solid, so the camera angle stops deciding whether they exist
Two symptoms, one cause each, and both were choices from the first version.

Vanishing from certain angles: the eyes were quads. A quad has no thickness, so
seen edge-on it is a line and there is nothing to draw. Now spheres, which read
the same from every direction.

Drawing in front of the face, and visible from behind: the shader resolver was
asked for Sprites/Default first and got it. That is a transparent shader with
depth writing off and backface culling off - so the eyes drew over whatever was
in front of them and stayed visible through the back of the head. The resolver
now asks for an unlit opaque shader first, which the skull occludes like any
other solid thing.

Between them, an eye is now a small solid glowing ball in a face rather than a
sticker that only exists at some angles.
2026-08-05 20:20:53 +02:00
76b89a8e5a fix(dvergar): put the eyes on the head instead of on the camera
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.
2026-08-05 20:14:08 +02:00
9dc072f0a5 feat(dvergar): give the eyes a glow, and take the colour from the stars
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.
2026-08-05 20:05:52 +02:00
0b6a61a852 chore(dvergar): survey the body shader, and record why pale is out of reach
Custom/Player carries 13 properties and exactly one colour among them,
_SkinColor. No _Hue, no _Saturation, no _Value, no _Brightness, no _Grayscale.

That closes the question the last three commits kept circling. A real dverger
turns pale at two stars through saturation -1 on the creature shader, which
genuinely desaturates its texture. The player body has no equivalent control:
_SkinColor multiplies the human skin map, and a multiply can darken or bias but
never desaturate, because the pink lives in the texture and survives being
multiplied by grey. White is the multiplier's identity, so "paler" and "more
human" are the same direction - which is exactly what every attempt walked into.

Reaching it would mean swapping _MainTex for a desaturated copy of the skin
texture, a per-player blit through a custom shader. Disproportionate for a
cosmetic tier.

The survey stays as a check rather than being deleted, in case a game update ever
changes the player shader, and the finding is written where the next person will
look for it.

The star offsets read off the prefab, for the record:
  Star 1: hue +0.100, saturation +0.200, value 0, emissive RGBA(0, 4, 3.294)
  Star 2: hue 0, saturation -1.000, value 0, emissive RGBA(11.984, 0, 8.784)

Both emissive colours are HDR and are what a starred dverger's eyes glow with.
2026-08-05 20:00:15 +02:00
760ddffc27 feat(dvergar): give two stars a stone tone instead of deriving one
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.
2026-08-05 19:42:38 +02:00
9f6308ec94 fix(skeleton): hide the helmet on the menu preview too
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.
2026-08-05 19:34:41 +02:00
eabc1c54bf feat(skeleton): show the race on the main-menu character preview
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.
2026-08-05 19:27:34 +02:00
93157632a4 Merge pull request 'fix-skeleton-bugs' (#13) from fix-skeleton-bugs into main
Reviewed-on: #13
2026-08-05 18:39:16 +02:00