IsSameFaction read player.m_customData directly, which is local save
data never networked - correct only for whichever client is asking,
wrong for a remote player as seen by whatever peer owns the mob's ZDO
(the common case in multiplayer). Switched to the ZDO-synced race
value with the same fallback DraughVisuals/TrentaVisuals already use.
Also adds FactionConfig.ShareHostilityWithParty (off by default): when
on, a player's truce covers every faction any connected player's race
belongs to, not just their own - a Dvergar and an Aswid playing
together are left alone by both the Mountain's mobs and the Swamp's.
Three per-race item chains had accumulated uncommitted. They land
together because FactionMerchantCatalog.cs carries hunks from all
three and cannot be split without interactive staging.
Skadi (new this session):
- SkadiNokkel - "Skadis Nokkel", a StaffSkeleton clone recoloured to
ice, stripped of its eitr and health costs and of the skeleton
summon, opening an ice-blue portal to a troll cave the player
claims as their own. Crafted at the forge after Moder from a
1500-coin Greater Frost Heart, a DragonTear and a TrophySkeleton.
- SkadiFrostHeart - the bought leg of that recipe, sold by the
Cultist bench.
- SkadiHollow / SkadiHollowPortal - claims one existing TrollCave02
in the Black Forest, half a world radius out and south of the
equator, and opens a linked local portal pair to it.
- RaceCaveBuilding - Skadi and Trol may build inside any troll cave.
Two facts worth keeping, both paid for the hard way:
- a troll cave counts as a DUNGEON, so the flag that refuses a piece
there is the per-piece Piece.m_allowedInDungeons, not the
per-location Location.m_noBuild. Player.m_placementStatus names the
exact refusal reason and is now logged.
- Object.DestroyImmediate is forbidden inside an animation event
callback, and a staff cast runs in one - it fails silently there.
Also carried in, from earlier sessions and unverified in game:
- Dvergar contract bank and barrel (DvergarBanco*, DvergarBotte*)
- Fenrir Ulvsblod trough (FenrirMangiatoia*)
- the Wolf -> Ulv merchant bench move, so tameable wolves stop
answering the E key with a shop window
Status: compiles clean with no new warnings. The Skadi chain has NOT
been confirmed working in game - the most recent fix to the troll
cave detection is still untested.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Joining a server after v1.4.0 threw "An item with the same key has
already been added" in ObjectDB.UpdateRegisters and bounced the
player back to the start menu. Rather than guess the exact colliding
prefab offline, this strips any duplicate-hash entries from m_items
right before the vanilla rebuild runs and logs their names, so the
join no longer crashes and the log now names the actual offender.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
RaisedThrall is the common servant base (leash, wither timer,
follow command, anchor), used by Draugh, Skeleton and Trol.
ModelBorrow lends a vanilla prefab's look without its behaviour.
PieceDensityLimit caps how many of a piece fit in an area.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Same root cause as the Factions fix (9287bd0): mobToTrophyMap keyed the
Goblin family by "Fuling"/"FulingShaman"/"FulingBerserker" - none of which
are real prefab ids - instead of "Goblin"/"GoblinShaman"/"GoblinBrute".
The trophy icon lookup was unaffected (it already used the correct
TrophyGoblin/TrophyGoblinShaman/TrophyGoblinBrute ids on the dictionary's
value side), but the food-tuning block gated on
PrefabManager.Cache.GetPrefab<GameObject>(mobName) succeeding silently
never ran for any of the three - so their food fell back to generic
CookedMeat nutrition instead of a Goblin-scaled amount, and never got the
20-minute humanoid-prey burn time the "StartsWith Fuling" check was meant
to grant them. Renamed the check to "StartsWith Goblin" to match.
Verified in-game.
FactionHostilityPatch's NeraForestaMobs set and FactionMerchantCatalog's
Shops dictionary both keyed the base Goblin by its in-game display name,
"Fuling", instead of its actual prefab id. Confirmed against the game's own
asset paths (Assets/Characters/Goblin/, TrophyGoblin.prefab) rather than
assumption - "Fuling" appears nowhere as a real prefab, only as flavor text
(kept as-is on the shop's own DisplayName, which is just UI label text).
Neither peace nor merchant status ever actually applied to a plain Goblin
for any Black Forest race (Trenta, Trol, Furling) as a result - only the
GoblinBrute/GoblinShaman entries, which already used their real ids, worked.
Confirmed a related but separate bug while investigating, left alone per
request: AswidRace.cs's mobToTrophyMap also keys off "Fuling" and feeds it
into a live prefab lookup for food nutrition tuning - same wrong-id pattern,
milder failure mode (falls back to generic values rather than breaking
anything). Not fixed here.
The head-flame VFX clones only the source torch's ParticleSystem subtree,
then stripped components with a blocklist (every MonoBehaviour, every
Collider) to leave a bare flame. The blocklist missed Rigidbody - not a
MonoBehaviour in Unity - so a torch whose fire-particle node carried one kept
being acted on by physics independently of the parent GameObject that tracks
the head each frame, and visibly fell away from the skull.
Switched to an allowlist: keep only Transform/ParticleSystem/
ParticleSystemRenderer/Light, destroy everything else on the clone. Can't
miss a component type this way, whatever it turns out to be next.
Documents everything that landed on main since 1.3.12 (Factions peace +
merchants, BepInEx Configuration Manager across all nine races, Dvergar/Aswid
eye glow, Skeleton head-visibility and menu-preview fixes) and bumps the
version accordingly.
Also fixes a real bug found while writing this changelog: Trol's True Form
log-grab was piggybacked on pressing the True Form key a second time, with no
on-screen hint it existed. It now has its own keybind (default E, configurable
like every other race's keys) and a proper crosshair prompt patched onto
vanilla's own HoverText component - the first attempt added a second,
competing Hoverable component to the log and it was silently never reached,
since Unity's GetComponentInParent<Hoverable>() only returns the first match
and vanilla's own HoverText was already on the object.
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.
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().
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().
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().
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().
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().
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().
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.
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.
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.
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>
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.