Commit graph

13 commits

Author SHA1 Message Date
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
892b970df4 fix(skeleton): let everyone see the burning skull
The head flame was built inside SkeletonRace, a single MonoBehaviour that only
ever looks at Player.m_localPlayer, so the fire existed on one client and on one
player. Everyone else saw a bare skull. Same shape as the Draugh aura, same fix:
the build moves to SkeletonVisuals.HeadFlame, which takes a Player, and
RacesVisualController grows one for every remote skeleton it can see. Held per
player rather than statically - a static would hand the second skeleton in view
the first one is fire. Nothing is networked and nothing needs to be: the tier is
already on the ZDO, so each client works out for itself who should be alight.

The remote path also still collapsed the jaw at Fader, the charred-twitcher
leftover that was removed from the local path two commits ago - so other players
would have gone on seeing a Fader with no mandible. It is a restore there now
too.
2026-08-05 18:22:57 +02:00
67e445014f feat(trenta): grow a crown of branches, and fix(draugh): let everyone see the rot
Trenta: a greydwarf shaman trophy is hung on the player head bone and sunk into
the skull until only the horns and branches clear it - the Furling wears a goblin
head the same way, aimed at the opposite result. A trophy is a plain static mesh,
so unlike the Dvergar hood there is no rig to collapse: the player own head does
all the hiding, which makes the three offsets in TrentaConfig the entire look.
They are a first pass and want eyeballing in game.

Draugh: the smoke and the cloud of flies only ever existed on the client of the
player wearing them. DraughRace is a single MonoBehaviour that looks at
Player.m_localPlayer and nothing else, so in multiplayer every other player saw
an ordinary, unrotted Viking. The build moved to DraughVisuals, which takes a
Player, and RacesVisualController now grows the same aura on every remote Draugh
it can see. Nothing is networked and nothing needs to be - each client reads the
race off the ZDO and makes its own particles.

Both hang off VisEquipment.UpdateVisuals or the visual controller, the two hooks
that already run for remote players, so neither had to invent a sync path.
2026-08-05 13:40:09 +02:00
668a017a91 fix(fenrir): hide the human body in every form, not just shrink it
Wolf, Ulv, Fenring and Cultist all hid the player by scaling the Visual child
to a thousandth of its size. That has quietly stopped working: the scale reset
that keeps a non-Trol player at normal height runs from a postfix on the same
update and puts the scale straight back to 1, so the man reappeared standing
inside his own wolf a frame after transforming. Fenrir is not one of the races
listed as sizing itself, so nothing exempted it from that reset.

Use PlayerVisualHider, the same fix Skadi and the Aswid already carry: renderers
go off with forceRenderingOff and are re-swept periodically, so nothing that
touches the transform can undo it, and the Animator is never disabled - which is
what made reverting look like respawning back when this was solved for the
dragon forms.

Both the local form and the copy other players see are switched over; the remote
path in ZdoVisualSync used the same scale trick and had the same bug.
2026-08-05 11:05:25 +02:00
5febc588ea feat(dvergar): rename from Dvergur, and give it a lightning affinity
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
11e64e0df1 Merge remote-tracking branch 'origin/aswidfix2' 2026-08-03 21:57:11 +02:00
Ferdinando
1dbfbd02b6 fix(aswid): center Vampiric Aura on the caster and stop transforms from casting the real Guardian Power
Vampiric Aura was centered 2m in front of the player instead of on
them, and its Blood Magic scaling only ever added up to +1 damage at
level 100; rebalanced to a 1 base + up to 5 scaled split.

Aswid Bat Form, Skadi Cold Spell, Skadi Drake/Moder Form and Fenrir
Wolf Form all borrow the native "gpower" animator trigger for its
arms-raised casting pose. That clip carries a baked-in Animation Event
that calls Player.ActivateGuardianPower(), which fired regardless of
who triggered the animation - borrowing it silently cast the player's
real Guardian Power (and burned its cooldown) whenever one was
available. Added a brief, time-based suppression window in RaceInput
around each borrowed trigger so only that one call is swallowed.

Also includes AswidSpectralClaw.cs, a boss-scaled bare-fist damage
item for Aswid, currently disabled pending equip-state fixes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-03 21:37:58 +02:00
79a54fb533 fix(dvergur): correct the health malus, body scale and hood
Health: the malus was taken off Character.GetMaxHealth, which only made the
getter lie. Character.SetMaxHealth is the one thing that clamps current health
to the new maximum and it never saw a lower number, so the bar shrank while the
value stayed where it was. Player.SetMaxHealth also flashes the bar whenever the
new maximum is above GetMaxHealth(), so against a getter that always read low
every food tick looked like an increase and re-triggered the flash. Taking the
malus off Player.GetTotalFoodValue instead puts it upstream of both, and leaves
Valheim to do its own clamping on an honest number.

Scale: applied from the plugin MonoBehaviour, it was overwritten on the same
frame by Trol's Player.Update postfix, which forced every non-Trol player back
to scale 1. Sizing now happens in a postfix on that same method, the way the
Trol does it, and RaceScale records which races size themselves so they stop
undoing each other. This also fixes the Furling, which was losing the same race.

Hood: the Dverger Circlet is a metal band, not the hood, and instantiating a
skinned mesh leaves its bones pointing at the source prefab so it renders
nowhere. The headgear is now lifted off the Dvergr NPC and rebound to the
player's own bones by name, as the Skeleton does for whole bodies.

Skin is tinted to a dvergr grey, saved and restored through the same
OriginalSkinColor keys the other tinted races use.

Adds a dumpdverger console command: prefab contents live in the asset bundles
and cannot be read outside a running game, so this is how the hood mesh and the
per-star LevelEffects colours get identified.
2026-08-02 22:58:11 +02:00
3ec51aeb45 feat(dvergur): add the Dvergur race scaffold
An eighth race built on the existing per-race pattern: a MonoBehaviour driver
registered from Awake, a progression table keyed on the boss state, an SE_Stats
carrier, and Harmony patches for the individual perks.

The helmet slot stays free. Whatever the player equips keeps every one of its
stats and only its mesh is swapped for the dvergr hood, which is the Skeleton's
helmet handling turned into a replacement rather than a plain hide.

Every percentage the spec left open lives in DvergurConfig as a named value and
is marked TODO there, so tuning the race never means touching the logic. The
knobs are static readonly rather than const so that switching a perk off with a
zero does not fold its guard into dead code.
2026-08-02 21:45:44 +02:00
4793811978 fix(transform): return from monster forms without replaying the spawn animation
Hiding the human body with SetActive(false) on the player's "Visual" also
disabled the Animator that lives on it, and Unity rebinds an Animator when it
is re-enabled: the controller restarts from its entry state, which for the
player is the get-up clip played when joining a world. Every Skadi dragon form,
Bat Form and Mist Form therefore ended with the player standing back up off the
ground.

PlayerVisualHider hides the body by suppressing its renderers instead, leaving
the GameObject active so the Animator and ZSyncAnimation keep running for the
whole transformation. Hiding uses forceRenderingOff on top of Renderer.enabled,
which nothing else in the game writes on a character, so the body cannot be
un-hidden behind our back.

Applied to the local and remote paths of both races, and to the ZDO sync's
revert so a remote player who dies mid-form cannot stay invisible.
2026-08-02 18:56:51 +02:00
Ferdinando
1bdf77e8d6 aswig and multiplayer fixes 2026-08-02 17:54:39 +02:00
5350ebda5d Add the Race Menu Ward; WIP on remote Trol/Skadi visuals
Race Menu Ward: a buildable ward (2 wood, hammer/Misc, no crafting station)
that manages your race outside the debug console - reset the race, switch
between the server's boss progression and your own, and advance that personal
progression by offering a boss's secondary drop to it. One is placed near the
sacrificial stones on first load of a world, by the host only.

BossProgressionManager grows a personal mode alongside the world one. The tier
is stored on the character rather than the world, so a personal tier travels
with the player between servers instead of being tied to whichever world
unlocked it. resetrace and the ward now share RacesOfValheim.ResetRace so both
paths clean up identical state.

Also in progress, and NOT yet working: remote Trol sizing and remote Skadi
flight. Both are computed from the observer instead of the observed -

- Remote Trols are scaled from the observing player's own progression, and
  never show True Form, because SE_TrolTrueForm only exists on the transformed
  player's client. Each Trol now publishes its state and True Form flag onto
  its own ZDO for others to read.
- Remote Skadi dragons sink to the terrain regardless of the altitude being
  replicated: Character.m_flying is only ever set on the flying player's
  client, so observers run grounded motion under gravity. Flight is mirrored
  through the ZDO and the remote copy's rigidbody gravity is disabled while it
  lasts.

Neither has fixed the symptom yet, so both paths keep a throttled diagnostic
log reporting what each observer actually computes. Committed to get the
instrumentation onto the branch, not because it works.

Packaging no longer hardcodes another machine's desktop path: Thunderstore and
Nexus zips go to dist/ on Release builds only, and the DLL is copied into
Valheim only when VALHEIM_INSTALL actually points at a plugins folder.
2026-08-02 08:45:47 +02:00
Ferdinando
c4a24c9fdf Initial commit 2026-07-30 19:00:13 +02:00