Replace the flat binary .paint format with a folder per painting under
Paintings/<key>/: albedo/emission as sRGB PNGs, the packed MSO map split
into human-readable metallic/occlusion/smoothness grayscale PNGs, and the
non-baked scalars (name, size, emission intensity, camo/height knobs) in
painting.json. MSO.B is always 0 (pack shader), so the split round-trips
losslessly with no alpha ambiguity. Public API (SavePaintAs/LoadPaintByName/
ListSavedPaintings/PaintExists/DeletePaint) and the network snapshot path
(WriteCanonicalMaps/ReadCanonicalMaps) are unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Count spawned role variants from a client-side avatar registry in
NetworkPlayerSetup (network objects exist on every machine), so the
counts work without server-only match state. MatchHud binds the two
count texts and rewrites them only on change.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Authored HUD count widgets (Hunter/Hider label + count) wired to new
_hunterCount/_hiderCount serialized fields; phase labels switched to English.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove Assets/FR2_Cache.asset (+ .meta) and gitignore it - it is a
regenerated Find References 2 editor tool cache, not source.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the MatchHudCanvas (TopBar > Phase/Time, Crosshair > H/V) and move
PaintHud onto a scene-authored canvas, matching the binder rewrites. Your
scene authoring, kept in its own commit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the code-gen canvas/EventSystem bootstrap and the layoutPrefab
instantiation; the canvas and its panel now live in the scene, so PaintHud
binds to its first child at startup instead of building the UI at runtime.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the runtime IMGUI (OnGUI) HUD with a binder that drives the authored
MatchHudCanvas widgets via [SerializeField] references (Canvas / Phase /
Time / Crosshair). Visibility toggles Canvas.enabled instead of the
GameObject, so Update keeps polling while hidden; an Awake guard disables
the component on unwired references. Drop the AddComponent<MatchHud>()
bootstrap in MatchManager - the component now lives on the scene canvas.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Paint RTs were ARGB32 (8 bpp). Repeated source-over at low alpha rounds
back to the previous value once the per-stroke decrement dst*alpha drops
below half an LSB, so it freezes at a grey floor (~0.5/alpha in 255ths) -
e.g. black at low opacity never reaches 0. Switch the accumulation buffers
to ARGBHalf (16-bit linear). The sRGB round-trip stays at the byte boundary
(seed decodes on upload, ReadRtPixels re-encodes on readback), so canonical
bytes and CPU/GPU parity are unchanged - only the accumulation gained bits.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Main: hunterCount 0 -> 1, wire connectTimeoutSeconds = 25 on the session
manager. The Room: player prefab tag Player -> Untagged, deactivate an object.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Relay host/join/refresh/sign-in could hang forever: none of the UGS
Sessions 2.2.4 calls accept a CancellationToken, so a stuck op left _busy
true and locked the whole browser UI with no recovery.
Wrap every hangable call in a Timed() helper (Task.WhenAny + Task.Delay,
the only option the API allows) driven by a new connectTimeoutSeconds
inspector field (default 25s, 0 = wait forever). On timeout the status is
reported, _busy is cleared and the event-driven UI recovers immediately.
Guard the two ways a late/partial op can corrupt shared state:
- LeaveIfDisplaced: an aborted CreateSessionAsync keeps running and may
materialise a ghost host seconds later; leave it, but only when the user
has no tracked session (_session == null), else it would tear down the
shared NetworkManager and kill a fresh host.
- Partial-start shutdown: only for connection-owning ops (host/join), so a
refresh timeout during hosting can't shut down the user's own host.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Introduce PersistentPlayerId: a stable id that survives an app restart and is
unique per install (built on the UGS install-path-namespaced anonymous
PlayerId, with a local PlayerPrefs GUID fallback for loopback). Clones on the
same machine stay distinct.
Each client reports its id to the server on connect via a new Match_Identity
named message (mirroring Match_ReportHit, so no ConnectionApproval timing
risk); the host records its own directly. The server keeps an ephemeral
clientId -> persistent id map, exposed via PersistentIdOf(clientId) as the
foundation for later reconnect recognition. Map entries are cleared on
disconnect and net stop.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The freshly converted hunter's body was hidden for the settle window via a
WaitForSeconds coroutine. If the object was disabled or the converting owner
disconnected mid-settle, the coroutine was stranded and _renderGate stayed
true forever, leaving the avatar invisible on every remote.
Replace it with a frame-driven Time.time deadline (_renderGateUntil) lifted
in UpdateVisibility, which runs every frame the component is active and can
never get stuck. Remove the coroutine and the now-unused System.Collections
using. Visible behaviour in the normal case is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The FreeCamera's CharacterController stayed enabled permanently, so its
invisible capsule sat in the play area at (0,1,0) and blocked players even
when the freecam was not in use: the controller script disables only itself
in Awake, not the independent CharacterController collider.
Keep the capsule out of the physics world unless the freecam is actually
flying: disable it in Awake and toggle it with SetActive (enabled before the
teleport in SyncToCurrentView, which preserves the current enabled state).
Also ignore collision against all live players instead of just the first on
each activation, since Physics.IgnoreCollision is reset when the capsule is
toggled off and back on.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The orbit camera suppressed wheel zoom whenever Shift/Ctrl was held, to
reserve Shift/Ctrl+wheel for the paint brush resize. But Shift is also
the sprint key, so sprinting blocked zoom outside paint mode.
Gate the reservation on PanEnabled (set only by PaintMode.Enter/Exit), so
the wheel is only claimed for brush resize while actually in paint mode;
otherwise it zooms normally.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
MapPropIds (in MeshPainter.Backend.cs) referenced the *Id fields from the
MeshPainter.cs partial in its field initializer. Static field-initializer
order across partial-class files is unspecified in C#; after the script
reorg the composite array initialized before the *Id fields and captured 0
for every property id. HasProperty(0) is always false, so AssignMapTexture
bound no maps at all -> the shader fell back to its white default textures,
making every fresh avatar fully glossy (smoothness 1) and emissive.
Build MapPropIds lazily on first access (runtime, after all static
initializers) so the file order no longer matters. The per-stroke allocation
savings are preserved; only a single null-check per call is added.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move scripts under Assets/Scripts/ into Components, GameMode, Helper,
Network, Enum, Struct and ScriptableObject folders. Pure file moves
(plus folder .meta files); no code changes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
Extract byte-identical duplicated code into shared helpers (behaviour-neutral):
- New InputUtil.cs: single source for mouse-delta/scroll/cursor-lock, modifier
and mouse-button reads, previously copied verbatim across camera controllers,
MeshPainter, FirstPersonMode and PlayerCharacterController.
- GetMatFloat/SetMatFloat replace the 12x material-instance + HasProperty guard
pattern for the camo/height float properties.
- Route two inline button hooks through the existing Hook() helper.
Bespoke variants deliberately kept local (FreeCam SprintHeld = LeftShift only,
MeshPainter.TryGetMouse with out-params).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Force the local avatar out of Paint mode and block the switch key from
re-entering it while the match is in its resolution (reveal) window.
Painting is off for the local player regardless of role. No restore
needed: the match ends by despawning/respawning the avatar, rebuilding
the mode cycle at index 0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Select the whole pre-filled painting name one frame after activating the
input field so the first keystroke replaces it. Done explicitly so it works
regardless of the field's authored "On Focus Select All" toggle.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ramp the along-surface climb velocity via a gentle acceleration instead of
snapping to full speed, so a brief tap nudges only a little. Sprint scales
the accel so it stays snappy; releasing decelerates at the ground decel rate.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the fixed additive brush-size step with a fraction of the current
size, so small brushes resize a texel at a time (fine control) while large
ones jump in bigger increments. Always moves at least one texel per notch.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the symmetric sine with a raised cosine raised to
_XRayPulseShape: a long near-zero plateau, a slow rise and a short
full peak. Both shader halves use the identical formula to stay in
phase.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
The pipette now reads the height (occlusion) value from the own
paint mesh and enables the height toggle; picking anything else
disables the toggle while leaving value and alpha untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brush radius now derives from the mesh-wide average UV density instead of
the hit triangle's own density. Per-triangle density varied up to ~7.6x
across the mesh (spiking at UV seams and stretched islands), so the same
brushSize painted a visibly larger patch on seam triangles than on
evenly-mapped ones. A single global scale keeps the brush the same physical
size everywhere; the stamp remains a 3D box, so seams are still bridged.
Also decouple the hover preview opacity from the brush albedo alpha: the
preview now stays fully opaque and is scaled only by the Preview Opacity
property, since the ring is a size/shape indicator, not a paint-strength
preview.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A slab that spans a concave silhouette (e.g. a table side = two legs
plus a top rail, all coplanar and thin) produced one convex hull that
filled the open gap between the legs, so a player standing between them
counted as embedded. Add a refinement pass: each slab whose in-plane
coverage grid shows its convex-hull footprint is less than a
configurable fraction (hullFillThreshold, default 0.6) covered by real
surface is recursively halved along its larger PCA axis until every
piece hugs actual geometry. Solid boards (the shelf) are ~fully covered
and pass through untouched. Verified over a 9600-point grid: zero
bridging (no collider interior lies >6cm from the source surface),
shelf output unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Generate multiple convex collider proxies from a mesh by growing
triangles into thin slabs (PCA minor-axis thickness gate) and hulling
each slab, so shelves and open compartments stay hollow while boards
count as embedding surfaces. Baked meshes get readable, deterministic
asset names (scene/prefab path + hierarchy + collision index) instead
of GUIDs. ConcealmentMeter now also excludes a furniture's own concave
mesh collider when a ConcealmentColliderBaker sits in its parent,
symmetric to the existing ConcealmentVolume rule.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SkinnedMeshRenderer.BakeMesh(mesh) bakes the renderer's world scale
into the vertices. SkinnedColliderBaker already accounts for this and
divides it back out, but ConcealmentMeter did not: it lifted the
already-scaled verts to world via localToWorldMatrix (scale again),
yielding scale-squared voxel positions. This threw off the embedded
broadphase box, the EmbeddedPercent computation (which now drives the
X-ray reveal) and the debug gizmos whenever PlayerScaler != 1.
Rescale the baked mesh to unit scale right after baking (no-op at
scale 1), matching the SkinnedColliderBaker convention documented in
PlayerScaler, so world = localToWorldMatrix holds on unit geometry.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
Set occlusion to 0.5 (the new neutral for painted height) so Reset
HUD/Values lands on neutral, and adjust the default brush colour,
metallic/smoothness, active brush and alignment.
The pipette now samples only what is painted (albedo, metallic,
smoothness, emission), not how strongly - the albedo alpha,
metallic/smoothness opacity and emission alpha are preserved instead
of being forced to 1 in every pick path and in FinalizePick.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the occlusion-shift, normal-intensity and parallax-intensity slider
instances to the HUD layout prefab under their stable widget names so the
binder wires them to the painter's material knobs.
Wire three material-backed look sliders (occlusion AO shift, relief normal
intensity, parallax intensity) through the paint HUD, its layout/state
persistence, the .paint slot format (bumped to v4), owner-authoritative
network sync and the runtime reset, mirroring the existing camo-knob path so
they save, restore, replicate and reset alongside the brush values.
Change the occlusion AO mapping from a division threshold to a linear shift:
AO fades from 1 down to (1 - shift) at the deepest painted hole, so a 0 shift
no longer leaves black spots. Enable _NORMALMAP alongside _PARALLAXMAP so URP
transforms the painted relief normal into world space (otherwise it discards
normalTS and the relief is invisible), and pin the added keyword in the build
keep-alive material.
Stop the pipette from picking the occlusion/height value and turn its toggle
off after a pick. Default the knobs to 0.2 shift / 1.4 normal / 1.0 parallax
across the shader, painter, network and HUD fallbacks.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reuse the existing occlusion paint channel (no new map, MAP_COUNT stays 3):
0.5 is neutral, above 0.5 raises a hill, below 0.5 sinks a hole and also
fades ambient occlusion (saturate(2*occ)). Bind the MSO map to _ParallaxMap,
enable _PARALLAXMAP, derive a relief normal from the height gradient, and
reseed unpainted occlusion to 0.5 so untouched surfaces stay visually neutral.
Pin the _PARALLAXMAP runtime variant in the build keep-alive material.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Load now applies the selected slot immediately instead of going through a
confirmation dialog. Save keeps its OK button enabled even when the name
already exists (the warning text stays, purely informational) and writes
through with overwrite, so re-saving under the same name replaces the slot.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove the second HeroCutout from the Main Camera (the GameManager host is the
intended, single driver), set the GameManager cutout radius/feather, and set
hunterCount to 0.