Commit Graph
12 Commits
Author SHA1 Message Date
adminandClaude Fable 5 066e308cde Docs: reduce over-documentation across gameplay scripts
Trim restated narration, dead commented-out code, and oversized class
headers; keep all why-comments (authority, timing, edge cases), tooltips,
and serialization caveats.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 10:08:28 +02:00
adminandClaude Opus 4.8 ff034870fc Freeze hiders (pose + transform) during the resolution phase
While a match is in the resolution sub-phase, hiders that have not
been found hold their current pose and position: the pose graph is
frozen (mixer speed 0, current frame re-asserted) and owner input is
disabled while gravity/grounding keep them planted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 21:52:46 +02:00
adminandClaude Opus 4.8 c54e0cf502 Add see-through X-ray reveal overlay for players
Add a second, additive HDR emission color (_XRayColor) that reveals a
player through walls as a pulsing energy glow, driven during matches:

- Shader: XRayOverlay pass (ZTest Greater, additive) for occluded parts
  plus a matching additive term in the forward fragment for visible
  parts, so the glow shows everywhere and never double-blends. Exposes
  _XRayColor, _XRayPulseSpeed and _XRayPulseStrength for a breathing pulse.
- Render it after opaques via a RenderObjects feature (custom XRayReveal
  light-mode tag) on both PC and Mobile renderers, so the through-wall
  test is depth-sort independent and no longer drops out at some camera
  angles/distances.
- MeshPainter drives _XRayColor alpha through a framerate-independent
  fade (xrayFadeDuration) rather than a hard toggle.
- Reveal is driven per avatar on every client: all remaining un-found
  hiders glow during the Resolution phase, and a hider whose
  ConcealmentMeter EmbeddedPercent exceeds MatchManager.embeddedRevealPercent
  glows via an owner-authoritative NetworkVariable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 12:22:17 +02:00
adminandClaude Opus 4.8 fe8f12b8bb Spawn converted hunters in place and smooth their reveal
Fix the in-place Conversion respawn snapping to the origin (0,0,0),
which surfaced when a hider was tagged mid wall-climb. The owner holds
authority over the NetworkTransform, so the server's Instantiate
position is ignored on the owner. Deliver the tagged world position
through a replicated _spawnOverride the server writes in OnNetworkSpawn,
and have the owner re-assert it before PlayerCharacterController's first
Update snapshots the kill-plane rescue target. This replaces the fragile
SpawnedMidSeek phase check.

Also hide a freshly converted hunter on other clients for a short
settle window (conversionRevealDelay) so nobody sees it pop in or
interpolate from the spawn frame; the shot hider is already despawned,
then the hunter cleanly materializes in its place.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 16:18:53 +02:00
adminandClaude Opus 4.8 f485d1676b Add the conversion match mode
Introduce a second match mode alongside Classic. In Conversion mode
hiders are invisible to each other (and to hunters during Hide), and a
hunter hit converts the hider into a full hunter in place instead of
sending them to the spectator freecam. The mode is replicated to all
clients through the existing phase named-message byte; visibility is
computed locally per client per mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 15:20:54 +02:00
adminandClaude Opus 4.8 5b3fe1d3d1 Add the hide/seek/resolution match state machine
Drive the match through three server-authoritative phases (hide, seek,
resolution) with per-phase durations, broadcasting the active phase and
countdown to clients over the existing named-message infrastructure so
MatchManager stays a plain MonoBehaviour and Main keeps zero in-scene
network objects.

During hide, hider meshes are culled on hunter clients only (each client
computes visibility locally from role, phase and found state). During
seek, hunters shoot a single raycast from the first-person camera centre
(left click, cooldown-gated); a validated hit marks the hider found,
which hides its mesh for everyone and binds the owner to spectator
freecam. Seek ends early once every hider is found, then resolution runs
before returning to the lobby.

Force AlwaysAnimate on remote replicas so the animator keeps writing bone
transforms while the body is hidden or off-screen. The Paintman animator
is authored CullUpdateTransforms, so a culled renderer froze the pose on
the rest pose and the skinned collider baked that frozen pose, landing
replicated paint stamps on the wrong body location and leaving the
painting desynced after hiders were shown again.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 13:59:46 +02:00
adminandClaude Opus 4.8 c1a13f6338 Pick role-specific spawn areas with a shared fallback
Choose the spawn area by player role: Hunter avatars look for a
HunterSpawnArea-tagged collider, Hiders for HiderSpawnArea. When the
role-specific area is missing, fall back to the shared SpawnArea tag, and
when that is absent too, keep the existing client-id ring placement.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 12:03:22 +02:00
adminandClaude Opus 4.8 bd70f3b8b9 Add lobby/match-start matchmaking flow with additive scene management
Replace the connection-approval role selection with a server-authoritative
match flow built on NGO additive scene management:

- Scenes: Main is the persistent foundation (NetworkManager, GameModeManager,
  cameras, HUD); Lobby and Test Map load/unload additively. Add Lobby + Test Map
  to the build settings; remove the obsolete SampleScene.
- MatchManager (plain MonoBehaviour singleton): loads Lobby on server start,
  StartMatchTrigger lets the host start the match, rolls one random Hunter (rest
  Hider), swaps Lobby -> Test Map (strictly serialized per NGO), respawns each
  player as its role variant. Forces additive client sync mode so clients keep
  Main instead of single-loading it (fixes "Destination scene is not valid").
- Server-driven spawning: null out NetworkConfig.PlayerPrefab at runtime to
  disable auto-spawn, then spawn players after the lobby floor exists (fixes
  falling through the floor) with double-spawn and transition guards.
- StartMatchTrigger: server-gated OnTriggerEnter, only the host's own player
  starts the match.
- NetworkBootstrap: drop role selection / connection approval; everyone spawns
  as the neutral Player prefab. Host/Client/Server/Shutdown buttons stay.
- NetworkPlayerSetup.ScopedModes flag (baked on Hunter/Hider prefabs): lobby
  avatar gets the full mode set, match variants get the role-scoped set.
- GameModeManager.BindLocalPlayer reads ScopedModes and rebinds the painter
  unconditionally (fixes stale painter binding on respawn -> brush painting in
  every mode).
- MeshPainter.PaintingEnabled defaults to false (unbound/pre-spawn/remote never
  paints); PaintHud visibility now also gates on a bound painter (fixes the HUD
  showing at startup before any avatar exists).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 22:44:18 +02:00
adminandClaude Opus 4.8 56caa0edd8 Add Hunter/Hider role selection on connect with role-scoped modes
Roles are chosen in the bootstrap dev panel before Host/Client. NGO
ConnectionApproval is enabled at runtime and maps the role payload to
the matching prefab variant per connection (Hunter/Hider), so each peer
spawns the correct avatar including the host.

- PlayerRole.cs (new): single source of truth enum { Hider, Hunter }.
- NetworkBootstrap.cs: role toggle, ConnectionApproval + role payload,
  server ApprovalCheck mapping role -> PrefabIdHash.
- NetworkPlayerSetup.cs: serialized PlayerRole field + Role property.
- GameModeManager.cs: BuildModes(role) - Hunter -> [First Person, Paint],
  Hider -> [Third Person, Paint, Free Cam]; binds role from spawned avatar.
- Hunter.prefab: role = Hunter override.
- SampleScene.unity: NetworkBootstrap prefab references wired.

Also includes user inspector scale tuning (Hunter 2.5->2.4, Hider 0.5->0.7).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 17:01:43 +02:00
admin 10f2518640 Exclude other players from climb probes and spread network spawns
Wall/ceiling/ground climb probes now skip any player collider (own and
remote) instead of only the local hierarchy, so running into another
chameleon no longer triggers the climb mechanic. New players are placed
on a per-clientId ring at spawn (host stays at origin) to avoid stacking
into one collision pile.

Also persists the serialized defaults of the recent network fields into
the Player prefab (incl. the spawnRingRadius inspector tuning) and a TMP
dynamic-atlas reset artifact.
2026-06-27 16:26:54 +02:00
adminandClaude Opus 4.8 eedba5f0e6 Sync mesh lean offset and disable concealment meter on remote avatars
Replicate the composed wall-lean/ground-raise/ceiling-lean mesh offset
(meshOffsetTarget.localPosition) as an owner-authoritative NetworkVariable
so remote avatars lean and raise instead of staying rigid; remote eases it
onto the visual root. Disable ConcealmentMeter on remotes (its per-frame
skinned bake, voxelization and physics overlaps only feed the local player).
SkinnedColliderBaker stays active on remotes because the paint replay
rasterizes its live BakedMesh for UV mapping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 15:59:25 +02:00
adminandClaude Opus 4.8 4fa443f630 Add NGO networking with owner-authoritative player position sync
Install Netcode for GameObjects 2.13.0 + Unity Transport 2.6.0 and wire up
the first networking milestone: syncing player position/rotation across clients.

- NetworkBootstrap: Host/Client/Server controls (OnGUI + H/C hotkeys) for
  local clone testing over loopback 127.0.0.1:7777.
- NetworkPlayerSetup: per-avatar owner gating. The local owner binds the
  GameModeManager and cameras to itself; remote avatars disable their
  controller/CharacterController and receive transform via NetworkTransform.
- GameModeManager.BindLocalPlayer: central runtime rebind to the locally
  spawned player.
- FirstPersonController.SetPlayer: explicit runtime rebind hook.
- Player prefab: NetworkObject + NetworkTransform (owner-authoritative,
  position + rotation) + NetworkPlayerSetup; registered as PlayerPrefab.
- Scene: NetworkManager + UnityTransport added; the fixed scene player
  instance removed in favor of spawn-on-connect.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 14:33:18 +02:00