Skip to content

fix(npcs): grounded on real blocks, brighter avatars, per-NPC variety - #714

Merged
marceld23 merged 2 commits into
mainfrom
feat/npc-appearance-grounding
Aug 3, 2026
Merged

fix(npcs): grounded on real blocks, brighter avatars, per-NPC variety#714
marceld23 merged 2 commits into
mainfrom
feat/npc-appearance-grounding

Conversation

@marceld23

Copy link
Copy Markdown
Owner

closes #711

Settlement/station NPCs floated half a block over the ground, rendered near-black, and looked like identical clones. Three fixes in one branch:

Grounding (server)

  • The +0.5 hover was a regression from feat(worldgen): the worldgen overhaul — per-body identity, real seas, calibrated caves/ore, altitude climate, volcanoes #492: markers are converted to world space with a cell-centre +0.5, and the settlement spawner's Max(Min.Y + 1, markerY) clamp never fired. Spawn Y is now Floor()ed — the same fix the station-crew spawner already carried — while template upper-floor markers keep their storey. Bandit-camp guards get the same Floor().
  • Bandits + planet enemies ground on real blocks now: they snapped to the pure noise SurfaceHeight, blind to stamped structures and player edits, so camp guards floated over their own carved camp floor. Both now use the creatures' GroundFeetYAt probe (Creatures are blind to real blocks: they walk through player-built walls and float over dug pits #650), falling back to the noise surface only when the chunk isn't loaded. Spawns use it too.
  • Settlement NPCs re-ground each step (new TryGroundFeetYAt, capped at ±2 blocks): doorsteps lift them, mining the floor out from under them drops them instead of leaving them hanging forever. Unloaded/blocked columns fall back to the home marker's floor Y — never the noise surface, which inside a stamped settlement can be metres off.

Darkness (client)

  • The tintable avatar textures average ~100/255 grey and LitColor computes _Color * tex, so every avatar rendered at ~40 % of its authored perceptual brightness. LoadTex now mean-normalises the texture toward ~200/255, keeping the pixel detail.
  • The NPC outfit palettes were widened 3 → 6 tones per theme and lifted out of the mud; the client-side arms darkening eased 0.85 → 0.9.
  • Bandit/Guardian materials never set _Floor/_Fill and ran at the shader defaults (0.35/0) — ~2× darker on the shadow side than every other humanoid (avatars/creatures use 0.62/0.3). They now share the standard lift.

Variation

  • Per-NPC Size 0.92–1.08 (the wire field existed but was hardcoded 1f).
  • Independent trouser colour via additive NetNpc.LegsRgb (contractless MessagePack; 0 = older server → client derives from the outfit as before).
  • Android chassis tones vary, and only ~60 % of researchers are androids now (was: all of them, all one grey).
  • Client-side deterministic per-NPC face jitter (eye spacing/brow/mouth/pupils) + hair (7 tones, some bald), seeded from NPC id + name through a stable hash — .NET string GetHashCode is per-process randomised and would have re-rolled every face each login.

Tests

🤖 Generated with Claude Code

marceld23 and others added 2 commits August 4, 2026 01:22
…ety (#711)

Floating: Floor() the +0.5 marker Y at settlement/camp spawns (regression
from #492; stations already had it), ground bandits/enemies via the
creatures' real-block probe instead of the noise SurfaceHeight, and
re-ground settlement NPCs each step (+-2) so mined floors drop them.

Darkness: mean-normalise the grey avatar tint textures at load (~40 % of
authored brightness before), widen + lift the outfit palettes, and give
bandit/Guardian materials the standard _Floor/_Fill lift.

Variety: per-NPC size, independent trouser colour (additive
NetNpc.LegsRgb), varied android chassis tones (~60 % of researchers
robotic, was all), and stable-seeded face jitter + hair on the client.

Co-Authored-By: Claude Fable 5 <[email protected]>
@marceld23
marceld23 merged commit 91478a1 into main Aug 3, 2026
12 checks passed
@marceld23
marceld23 deleted the feat/npc-appearance-grounding branch August 3, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NPCs float above the ground, look uniformly dark, and all look identical

1 participant