Commit Graph
175 Commits
Author SHA1 Message Date
adminandClaude Opus 4.8 dadf9d88d4 Fix paint HUD settings not persisting until a panel is dragged
The debounced auto-save compared painter values against the on-disk
baseline, so after any slider/toggle change the values stayed different
every frame and the 0.5s timer was pushed forward endlessly, never
firing. Saving only happened via the direct drag-end path. Compare
against the previous-frame snapshot instead so the timer fires once the
values settle. Also pin hudSaveId to a stable key so the layout is
shared across scenes instead of split per-scene.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 14:21:03 +02:00
adminandClaude Opus 4.8 96bcf84b1e Make session panel Disconnect button an Exit in Main scene
In Main (no active session) the context-sensitive button now reads "Exit"
and quits the application (stops play mode in the editor), so the player
can leave the build without Alt+F4. Connected behaviour is unchanged:
"Disconnect" leaves the session, "Back to Lobby" ends the match for the
map authority. The button is now interactable whenever idle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 14:00:03 +02:00
adminandClaude Opus 4.8 f22ca4765f Persist HUD layout on drag-end instead of only on teardown
HUD panel positions and brush values were written only from
OnApplicationQuit/OnDestroy, which is not guaranteed in a build (Alt-F4,
process kill, crash), so layout work was lost. DraggablePanel now exposes
an IEndDragHandler callback that saves the layout the moment a panel is
dropped. Brush-value changes are detected against a disk baseline in
LateUpdate and flushed after a 0.5s debounce so per-frame slider drags
do not write every frame. The teardown save path is removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 13:56:02 +02:00
adminandClaude Opus 4.8 2a6fc163b1 Add persistent global mouse sensitivity setting with slider
MouseSensitivity is a static, PlayerPrefs-backed multiplier (default 1,
clamped 0.1-4.0) that scales the mouse-look delta in the FreeCam,
FirstPerson and ThirdPerson controllers. Writes flush immediately so the
value survives a hard build exit. MouseSensitivitySlider binds the
Settings-panel slider to it (range read from the inspector) and mirrors
the value into its label, syncing on panel open via OnEnable.

Main.unity now contains the session-manager canvas directly (the
Online Session Manager prefab was unpacked) and wires the slider binder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 13:55:53 +02:00
adminandClaude Opus 4.8 cdfec364b2 Toggle session panel with Escape as in-game pause overlay
- Panel shows in Main while disconnected, auto-hides once a connection is
  established, and toggles open/closed with Escape in the Lobby or on a Map.
- Escape now pauses gameplay (active mode exits, cursor freed, paint and
  movement disabled) instead of ending the match directly; closing restores
  the prior mode via SwitchTo.
- Disconnect button is context-aware: leaves the session in the Lobby, acts
  as "Back to Lobby" (EndMatch) for the match authority on a Map, and stays a
  plain disconnect for non-authority clients on a Map.
- Removed the Escape->EndMatch handler from MatchManager; match end now routes
  through RequestEndMatch with the same authority routing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 11:34:13 +02:00
adminandClaude Opus 4.8 d27ee16004 Bind online session browser to canvas, drop IMGUI
- OnlineSessionManager: remove OnGUI/IMGUI state; now a logic-only layer
  exposing Host/Refresh/Join/Disconnect plus Status/IsBusy/IsConnected/
  InSession/Sessions and Changed/SessionsChanged events
- OnlineSessionBrowserUI (new): drives the Servers canvas — 4 buttons,
  session list from Entry Template clones (name + players), row selection,
  state-driven interactability, status footer
- Main scene: attach binder, add status footer line, wire 8 refs; dev
  bootstrap panel disabled
- Online Session Manager.prefab (new)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 11:03:26 +02:00
adminandClaude Opus 4.8 286473930a Close the paint HUD when shutting down to player-less Main
ReleaseToNoPlayer tore down the mode cycle but never raised ModeChanged,
so the paint HUD - which only hides via that event - stayed open after a
shutdown that happened while PaintMode was active. Invoke ModeChanged(null)
after the teardown so any mode-following UI hides.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 10:39:07 +02:00
adminandClaude Opus 4.8 f8b11be290 Add UGS Sessions online hosting with no port-forwarding
Players can now host and join over the internet without port-forwarding
via Unity Gaming Services Relay + Lobby, exposed through the unified
Multiplayer Services SDK (Sessions API).

- OnlineSessionManager: anonymous auth, CreateSessionAsync (public,
  relay-backed), QuerySessionsAsync server browser, JoinSessionByIdAsync,
  and session leave wired into the existing net-stop teardown.
- Per-install auth profile derived from the project path
  (mirror_<sha1(dataPath)>) so junction-mirror clones get distinct UGS
  player ids, avoiding the same-machine 409 LobbyConflict on join.
- Install com.unity.services.multiplayer 2.2.4 (pulls Relay/Lobby/
  Authentication/Core) and attach OnlineSessionManager to the
  NetworkManager in Main.

Loopback dev flow (NetworkBootstrap H/C/J/K) is left untouched; the
online path is additive. MatchManager and gameplay are unchanged since
Sessions starts the host/client through NGO as before.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 10:17:28 +02:00
adminandClaude Opus 4.8 f706cdb5a7 Grant match-start/end authority to first client on dedicated server
Host keeps authority as before; a dedicated server (no host player) hands
start/end authority to the first connecting client and reassigns it if that
client leaves. The Start Match trigger now polls a server-side physics overlap
instead of relying on OnTriggerEnter, so it fires for the authority client's
remote avatar (moved by NetworkTransform, no CharacterController.Move on the
server) as well as the host's owned avatar. Esc-to-end routes a named message
from the authority client to the server when that client is not the host.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 09:34:18 +02:00
adminandClaude Opus 4.8 9d6570f7fe Carry painting across lobby/map respawns with isolated snapshot transfers
Persist each owner's paint snapshot on the MatchManager across the
despawn/respawn that happens on a lobby<->map scene switch, then reload
and rebroadcast it onto the freshly spawned avatar so painted meshes
survive the transition. Cleared on disconnect/shutdown to avoid stale
carry across sessions.

Isolate concurrent snapshot transfers by id so a respawning replica's
late-join request and the carry broadcast no longer share one reassembly
buffer (which decoded a mixed deflate blob -> "Corrupted data"), and drop
transfers with an older cutoff so a blank late-join cannot overwrite the
carried image.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 01:21:39 +02:00
adminandClaude Opus 4.8 b00c415c8c Fix HUD persistence breaking across additive scene switches
The HUD save key was derived from the active scene name, which now changes
across the additive lobby/map loads (Main -> Lobby -> Test Map). Save and
restore landed in different files, so settings appeared lost. Derive the key
from the HUD's own (stable, persistent) scene instead.

Brush settings also live on the avatar's painter, which is despawned and
respawned on every scene switch, resetting them to prefab defaults. Mirror
the brush values into an in-memory snapshot on the persistent HUD and seed the
freshly bound painter from it, so in-session edits carry across the respawn.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 00:51:59 +02:00
adminandClaude Opus 4.8 91ce8ff329 Replace stripped-player spectator with a minimal dedicated prefab
Mid-match joiners now spawn a dedicated empty Spectator prefab (NetworkObject
+ SpectatorSetup only) instead of a fully stripped Player prefab. The FreeCam
rig is a standalone scene object in Main, so the spectator needs no avatar body,
renderer, collider, or CharacterController -- eliminating the leftover-body
artifact and the fragile per-peer strip path entirely.

- SpectatorSetup.cs (new): owner binds GameModeManager.BindSpectator (FreeCam-only)
- Spectator.prefab (new): empty avatar (Transform + NetworkObject + SpectatorSetup),
  registered in DefaultNetworkPrefabs, wired on MatchManager in Main
- GameModeManager: add BindSpectator/BuildSpectatorModes; drop the spectator
  branch from BindLocalPlayer; ReleaseToNoPlayer frees the cursor on teardown
- MatchManager: independent entropy-seeded RNG for fair hunter pick (was sharing
  the global engine RNG and always landing on the same client); spawn the
  spectator prefab for mid-match joiners; cursor-safe return-to-Main teardown
- FreeCamController: guard IgnorePlayerCollision against a disabled capsule

Also bundled (unrelated user asset/UI edits): PaintHudPanel layout tuning,
font atlas (arialroundedmtprocyr_bold SDF), forestpack_foliage material.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 00:31:49 +02:00
adminandClaude Opus 4.8 be6db5b0a9 Add match-end, spectator-hold join, and shutdown scene teardown
- Host presses Esc to end a running match: swap Test Map back to Lobby and
  respawn everyone as the neutral Player (server-gated, host-only).
- A client joining mid-match is spectator-held (no avatar) and spawns into
  the lobby when the match ends.
- On shutdown/disconnect, unload every gameplay scene so only Main is left
  loaded & active (NGO's Dispose does not unload additively-synced scenes).
- Generalize RespawnAll to a prefab selector + position so match-start
  (role variants) and match-end (neutral Player) share one path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 23:29:28 +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 301f7e64cb Add Ctrl+Z/Ctrl+Y undo/redo with command-based network sync
Pointer-based per-painter history of the canonical maps with copy-on-write
sharing (only maps touched by a stroke are cloned). A stroke (press..release)
is one step; a Load resets the history to the loaded maps as the sole baseline.

Network sync replicates undo/redo as tiny checkpoint/restore commands instead
of broadcasting full map snapshots: every peer runs the same COW history keyed
by owner-assigned checkpoint ids and reproduces restores locally. A peer that
cannot reproduce a target (undo across its join boundary) requests a targeted
snapshot from the owner as fallback.

Hardening: ordered send FIFO keeps stamps + checkpoints + restores in
production order (a marker never overtakes the stamps it finalizes); stamp
overflow carries over to the next frame instead of being decimated, so remote
content matches the owner; remote always inserts the checkpoint id to stay
1:1 aligned. Owner-authoritative snapshot fallback replaces the silent
host no-op. Adds a logSync toggle (default on) tracing when each
checkpoint/restore/snapshot is sent, applied, or falls back.

Also includes paintings-panel layout tuning in PaintHudPanel.prefab
(inspector edits).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 20:19:36 +02:00
adminandClaude Opus 4.8 ee482905f9 Replace auto paint persistence with a named painting library
Persistence rework:
- Drop auto-load on setup and auto-save on teardown; the painter now always
  seeds fresh from the material.
- Named slots under MeshPaint/Saved/<name>.paint via the existing CHMP
  machinery: SavePaintAs / LoadPaintByName / DeletePaint / ListSavedPaintings /
  PaintExists. Slot files carry the display name in the header.
- Remove the obsolete persistence partials (PlayerCharacterController,
  PlayerPoseController, ThirdPersonOrbitInput) and their references.

Paintings HUD panel:
- Authored Panel_Paintings + Save/Load/Delete dialogs into PaintHudPanel.prefab
  (TMP throughout); PaintHud.Library.cs is now a pure binder that clones the
  entry template per slot.
- Save dialog blocks empty/existing names; Load and Delete confirm first.
- Fix dialog z-order: open dialogs SetAsLastSibling so a dragged panel can no
  longer cover them.
- Lib_ListContent horizontal offsets corrected to 0 (was clipping entry labels
  out of the masked viewport).

Multiplayer:
- Loading a painting re-syncs to all peers via the snapshot broadcast path
  (BroadcastLoadedPaint), covering later late-joiners for free.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 18:39:20 +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
adminandClaude Opus 4.8 dec537a60f Sync emission intensity across the network
Replicate MeshPainter.emissionIntensity (a global material multiplier, not
baked into the paint maps) as an owner-authoritative NetworkVariable<float> on
PlayerPaintSync. The owner publishes on change; remotes subscribe, seed the
current value on spawn (covers late-join) and let MeshPainter's per-frame
RefreshEmissionColor push it onto the material.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 16:40:58 +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 ae84bb99dd Add late-joiner paint snapshot sync over chunked transfer
Send the accumulated paint maps as a one-time compressed baseline to
clients that join after painting has happened, instead of streaming raw
pixels.

- MeshPainter.Net.cs: TryCaptureSnapshot reads the canonical maps via
  ReadCanonical and Deflate-compresses them; ApplyPaintSnapshot inflates
  and re-seeds the backend through the same island/dilation path as
  SwitchBackend; IsPaintReady gate.
- PlayerPaintSync.cs: tag late-join transfer and live stamps with
  sequence numbers. Joiner requests the snapshot on spawn; server chunks
  and throttles it (1200 B/chunk, 8 chunks/frame) to stay under the
  6144-byte payload cap and the reliable window. Joiner buffers live
  stamps during transfer and replays only those with seq > capturedSeq,
  so no stroke is lost or applied twice across the join window. Disable
  persistence on network-driven remotes to avoid shared-save-key clobber.

Also resets the dynamic TMP font atlas glyph table (editor artifact,
unrelated to networking).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 15:44:02 +02:00
adminandClaude Opus 4.8 e04868f9c0 Fix first-person camera target and paint HUD rebind after networked spawn
Point the first-person camera at the dedicated FirstPersonTarget anchor
(eye height) instead of the shared CameraTarget, in both the runtime
SetPlayer rebind and the editor ResolveReferences fallback.

Rebind the paint HUD to the locally spawned avatar's MeshPainter via a
new GameModeManager.PainterChanged event. Since the spawn-on-connect
refactor, no player exists at PaintHud.Start(), so the HUD bound to a
null painter (no brush masks shown, color/settings were no-ops).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 15:22:23 +02:00
adminandClaude Opus 4.8 69e185d969 Sync paint strokes across the network via command replication
Replicate brush strokes as self-contained commands instead of texture
pixels: the owner emits each committed stamp (local placement plus brush
state, byte-quantized) and remotes replay it through the same draw path,
reproducing identical maps without streaming megabytes.

- MeshPainter.Net.cs: PaintStampNet serializable stamp, OnStampCommitted
  owner-capture event (no-op without listener), ApplyNetworkStamp remote
  replay, seedable spray for deterministic speckle.
- MeshPainter.cs: emit stamp after drawing, seed spray only when synced.
- PlayerPaintSync.cs: NetworkBehaviour batching owner stamps reliably
  (ServerRpc -> ClientRpc) with echo guard; remote disables local painting.
- Player/Hider/Hunter prefabs: PlayerPaintSync plus NGO GlobalObjectIdHash.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 15:02:33 +02:00
adminandClaude Opus 4.8 7f2f4e5999 Sync per-pose index and locomotion state across the network
Add PlayerAnimationSync NetworkBehaviour with owner-authoritative
NetworkVariables for pose index and locomotion category (idle/walk/run/fall).
Remote avatars switch their PlayerPoseController into network-controlled mode,
skipping local input, sprint reset, capsule resize and camera framing, and
take pose index plus locomotion externally. Disable pose persistence on
network-driven remotes so foreign avatars can't overwrite the local save.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 14:44:11 +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
adminandClaude Opus 4.8 3b26f2e622 Add per-pose fall animation state and clip
Play a dedicated falling animation when the player is airborne and
descending past a scale-aware velocity threshold.

- PlayerCharacterController: new IsFalling state + Fall Animation Speed
  threshold (true only when !grounded && !wallClimbing && descending,
  scaled via CapsuleScale); explicitly false during wall/ceiling climb.
- PlayerPose: per-pose Fall Clip + Fall Clip Speed (mirrors walk/run).
- PlayerPoseController: select the fall clip while falling, fall back to
  the idle clip when a pose has none (no regression).
- Author content: Paintman-Fall.anim assigned to Pose_Idle; UMotion
  project, Player prefab and scene authoring.
- Docs: check off the fall animation in GAME_DESIGN.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 13:49:16 +02:00
adminandClaude Opus 4.8 0a1859cab1 Camera-relative wall climb up/down keys to fix grab/release twitch
When running backwards toward the camera into a wall, the grab decided on
the camera-relative world direction (S pushes into the wall -> grab) while
the base release decided on the raw S axis (v < 0 -> immediately let go),
causing a per-frame grab/release flicker.

Mirror the existing _wallStrafeSign A/D latch with a new _wallClimbSign:
the camera picks, per climb-key press, which of W/S climbs up (the one
pushing into the wall) via Dot(camForward, wallNormal) and latches it.
All up/down tests now run through the effective climb axis vEff -
wall->ceiling handoff, top-out detach/hop, the alongSurface mapping and
the base release - so grab and release can no longer contradict each
other. Reset on grab and in ExitWallClimb. Facing the wall and grabbing
with W is unchanged (vEff == v).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 13:20:15 +02:00
adminandClaude Opus 4.8 cfb767f6cb Add first-person camera mode with pose-aware eye offset and yaw facing
Introduce a FirstPersonController / FirstPersonMode pair (mirroring the
free-cam mode) wired into the GameModeManager Tab cycle. In first person the
mesh is hidden, the eye sits on CameraTarget plus a per-pose
firstPersonCameraTargetYOffset, and the character body yaw is driven to match
the camera via a new single-writer FaceYaw hook on PlayerCharacterController.

Also includes user content edits (poses, prefabs, scene) carried along.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 13:03:52 +02:00
adminandClaude Opus 4.8 8c89e95014 Smooth free-camera flight and look
FreeCamController: ease movement via dt-correct Vector3.SmoothDamp on a world-space velocity (accel/decel ramp) and lag the look with Mathf.SmoothDampAngle. Both are framerate-independent and collapse to instant at smoothTime 0; smoothed state is snapped on activation (SyncToCurrentView) so entering freecam never jumps to catch up.

Bundles accumulated deferred work: PlayerScaler uniform-scale helper, scale-aware wall/ceiling climb probes and the double-scale skinned-collider bake fix, plus user content authoring (Sit pose + animation, font SDF, scene/prefab edits).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 11:49:43 +02:00
adminandClaude Opus 4.8 120d3b6675 Fix wall/ceiling corner rotation twitch by latching the climbed surface
In an inner wall/ceiling corner the body's facing flipped ~9 deg every
frame. Recorded frame data showed the wall/ceiling classification flipping
160 times: _wallNormal.y swung the full range (0.0 wall <-> -0.966 ceiling)
each frame, far past the hysteresis band, so the Schmitt trigger could not
hold it.

Root cause: _wallNormal had two competing per-frame sources.
- The contact-normal blend (Update) mixes ceiling and wall contacts in the
  corner into ~(0,-0.97,-0.26), classified as ceiling.
- ProbeWall raycasts along -_wallNormal, which tilts toward the wall, so the
  ray clips the wall and returns (0,0,-1), classified as wall.
Wall and ceiling drive different rotation targets (snap to face-wall vs.
face movement direction), producing the per-frame twitch.

Fix:
- The contact blend no longer overwrites _wallNormal during an active climb
  (it only seeds the initial grab); the probes own the normal while climbing.
- Surface-aware probing: on a ceiling, probe straight up (ProbeCeiling)
  instead of along -_wallNormal, so the angled ray can no longer clip the
  wall and demote us. Stay latched on the ceiling until it is genuinely gone
  overhead, then fall back to the wall probe.

Also retains the ceiling-class hysteresis (Schmitt trigger on the normal's
downward tilt) from the prior attempt as added stability.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 10:25:05 +02:00
adminandClaude Opus 4.8 52f9ace9e0 Replace ceiling Y offset with per-pose CharacterController capsule
Each PlayerPose now carries its own collider center Y, radius and height,
eased and routed to the CharacterController via a SetCapsule single-writer.
This lets crawl poses (Ball/Star) shrink the capsule to fit under furniture.
The ceiling Y offset is removed; poses without authored sizes fall back to
the base capsule, so existing poses keep their collision.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 09:55:10 +02:00
adminandClaude Opus 4.8 13de058819 Add baked voxel concealment volumes for concave furniture
Replace unreliable raycast parity on open-shell meshes with editor-baked
voxel grids. ConcealmentVolume bakes an inside-mask per object using the
union of a generalized-winding-number test (solid material, robust to open
shells) and an exterior flood-fill (enclosed cavities). ConcealmentMeter
now prefers baked volumes via an O(1) world-space lookup through a registry,
falling back to the old concave parity only for un-baked colliders.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 09:10:47 +02:00
adminandClaude Opus 4.8 a3ef7055b4 Add free-camera mode with player-equivalent collision
Introduce a free-fly camera as the next entry in the Tab mode cycle
(Player Control -> Paint -> Free Cam):

- FreeCamController: dedicated CinemachineCamera plus a CharacterController
  mirroring the player capsule (radius 0.1, height 1.3, slope 59, step 0.15)
  so the free camera collides with walls/ceiling/floor exactly like the
  player. WASD/Q-E (and Space/Ctrl) fly relative to view; mouse looks.
- FreeCamMode: plain-C# GameMode mirroring PaintMode, with an Exit() that
  restores camera priority and re-enables player control + camera input.
- GameModeManager: register freeCam in the Tab cycle (gated like player).
- Scene: FreeCamera object wired, Main Camera custom blends (0.4s) for the
  vcam priority hand-off.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 23:01:14 +02:00
adminandClaude Opus 4.8 0edc59555a Add per-pose camera target Y offset and route ceiling offset to camera
Add cameraTargetYOffset to PlayerPose so each pose can offset the
Cinemachine ThirdPersonCamera follow/look target independently of the
body mesh. PlayerCharacterController gains a cameraTarget reference
(auto-resolved via the "CameraTarget" child, base position captured in
Awake) and a single-writer SetCameraTargetLocalYOffset. PlayerPoseController
eases the per-pose camera offset and composes it with the shared ceiling
offset, so the camera target follows the ceiling lift in lockstep with the
mesh. Wire cameraTarget explicitly in SampleScene.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 22:01:43 +02:00
adminandClaude Opus 4.8 f652cdeca0 Add ceiling rotation drag and refine ground/wall pose offset controls
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 19:34:51 +02:00
adminandClaude Opus 4.8 080b2a1c39 Disable foot IK on pose playables and add ball pose
- PlayerPoseController: add applyFootIK toggle (default off) and apply it
  to each pose playable so straight-knee idles render straight; Mecanim
  foot IK was bending the knees to plant the feet (162° instead of 180°).
- Add Pose_Ball / Paintman-Ball animation and reorder the pose list.
- Move StraightenKneesTool editor utility under Assets/Unused/Editor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 18:20:56 +02:00
adminandClaude Opus 4.8 5dd35dd0f9 Integrate humanoid walk/run animations and per-clip pose speed sliders
- Import Mixamo humanoid Walking + Running FBX, switch rig type to Humanoid
- Wire walkClip/runClip with per-clip speeds on Pose_Idle (walk 1.4, run 1.5)
- Add per-animation speed sliders (Range 0.1-3, default 1) to PlayerPose SO,
  applied per frame in PlayerPoseController for live tuning
- Reorganize pose assets: replace Pose_TPose with Pose_Hold, prune legacy
  Paintman-Run/-TPose .anim and paintman_UV.FBX
- Ignore UMotion plugin data/editor folders

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 17:04:21 +02:00
adminandClaude Opus 4.8 dcfd668422 Add concealment meter and skinned collider baker; reorganize assets
- ConcealmentMeter: standalone component measuring the percentage of the
  character volume embedded inside environment geometry (bake -> voxelize via
  column ray-stabbing parity -> classify interior voxels against box/sphere/
  capsule/convex colliders and terrain). Always-on, throttled, gizmo debug.
- SkinnedColliderBaker: sole per-frame collider bake owner for skinned rigs.
  MeshPainter now delegates baking and only borrows BakedMesh for the GPU
  raster and cache refresh, so the collider stays fresh outside paint mode.
- Move pose assets to Assets/Poses, retire unused Insect scripts to
  Assets/Unused, restore Paintman.controller; mode scripts and scene updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 12:37:02 +02:00
adminandClaude Opus 4.8 def10541ab Add crossfade pose transitions and eased ceiling Y-offset
Replace the hard pose snap with a 2-input AnimationMixerPlayable crossfade:
the running pose moves to input 0 (keeping its play time), the new pose to
input 1, weight ramps over poseBlendDuration (smoothstep). Per-frame rest
reset stays, so empty/partial clips still resolve to rest during and after
the blend. Ceiling Y-offset now eases via MoveTowards (ceilingOffsetSpeed)
on enter/exit/pose-change instead of snapping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 08:47:37 +02:00
adminandClaude Opus 4.8 c41fb398e4 Add pose-switching system with continuous hold and sprint reset
New PlayerPose ScriptableObject (AnimationClip + ceiling Y-offset) and
PlayerPoseController that drives poses via a PlayableGraph, overriding the
Animator controller. Poses are held continuously (idle, moving, on wall/
ceiling) so cycle and sprint changes show immediately. Sprinting in any
state resets to pose 0. Non-keyed bones fall back to a captured rest pose
so empty/partial clips apply fully. Ceiling Y-offset is folded into the
controller's single mesh-offset writer.

PlayerCharacterController gains IsIdle / IsSprinting / IsOnCeiling /
AnimatorOverridden accessors and SetPoseLocalYOffset; SetAnimatorRunning is
guarded while a pose owns the Animator. Removed obsolete Paintman.controller.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 08:21:28 +02:00
adminandClaude Opus 4.8 d867c617df Wall-climb mesh lean + separate climb/mantle/sprint speeds; reworked rig
PlayerCharacterController:
- Wall lean now moves only the visual model + its paint collider (auto-resolved
  mesh root parenting both renderer and bones), not the CharacterController
  capsule, so the mesh can sink into the wall (wallMaxInset) as well as lean out
  (wallMaxOffset); capsule stays flush.
- Lean eases back to the authored pose when leaving the wall instead of snapping.
- Sprint multiplier now also applies while wall/ceiling climbing.
- Separate wallMantleSpeedMultiplier for pulling up over the top edge,
  independent of the climb speed.

Assets:
- Re-exported paintman_UV.FBX and added Paintman.blend: rescaled armature to
  mesh, merged seam duplicate vertices, fresh automatic weights, inner-thigh
  weight fix (no webbing on leg spread).
- Updated anims, animator controller, font SDF and scene.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 20:57:15 +02:00
adminandClaude Opus 4.8 cda1373979 Persist player and third-person camera state across sessions
Add player position/rotation/wall-climb persistence and camera
orbit (yaw/pitch/radius) persistence, auto-saved on quit/play-stop
and auto-loaded on start. Also includes the wall-climb fixes
(directional top-out, base detach on push-away).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:38:32 +02:00
adminandClaude Opus 4.8 fa7082817e Fix frozen rim pixels via GPU coverage stamp; add brush masks
Replace the CPU island-mask dilation guard on the GPU backend with a
coverage pass rendered through the same brush rasterizer, so sub-pixel
rim texels that the GPU brush can never reach fall into the gutter and
stay paintable (no more frozen loaded pixels at island edges).

Also includes user content: additional brush masks (dirt) with an
expanded mask selector in the HUD prefab, and CharacterController /
wall-climb inspector tuning.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:11:27 +02:00
adminandClaude Opus 4.8 c14525a2c8 Add HUD brush mask selector and fix dilation seam artifacts
- Add mask selector with previews to the brush card (data-driven from
  painter.brushMasks); persist activeBrushIndex with HUD layout.
- Fix alpha/coverage artifacts when overpainting after load or backend
  switch: derive the dilation source marker from a deterministic UV island
  mask instead of resetting it to "unpainted" on every seed.
- Import the two final brush mask textures (Brushes/).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 06:23:08 +02:00
admin 95fa5cc22d Persist painted maps and HUD layout across sessions
Add MeshPainter.Persistence.cs: auto-save the three canonical paint maps
(albedo, MSO, emission) as PNGs under persistentDataPath on quit/play-stop
and auto-load them as the backend seed on start, so painting survives
sessions. Reuses the existing ReadCanonical/SetupBackend seed round-trip;
no new color-space code.

Add PaintHud.Persistence.cs: auto-save draggable panel positions and the
widget-bound painter values to a small JSON layout file, restored on start
via the painter -> SyncFromPainter -> widgets path. Complete SyncFromPainter
to also cover the spray sliders.
2026-06-25 05:11:36 +02:00
adminandClaude Opus 4.8 9dab4a742e Fix cylinder wall-climb strafe lock and add terrain pipette support
- PlayerCharacterController: latch the wall-strafe sign once at strafe
  start instead of re-deriving it from the camera every frame, which
  flipped at the 90-degree point while circling a cylinder and caused a
  back-and-forth lock. Flat walls stay bit-identical; reset on enter/exit.
- MeshPainter.Pick: dispatch terrain hits to a splat-layer blend (full
  PBR channels), terrain trees / grass / sky to rendered screen-color,
  keeping texel-accurate picks for the paint mesh and foreign materials.
- Includes Unity auto-reserialization of SampleScene and three Supercyan
  pack assets (URP material upgrades, skybox/lighting) from the import.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 22:33:29 +02:00
adminandClaude Opus 4.8 69e793c910 Auto-deactivate pipette after pick and remap wall-climb rotation to RMB
Reset the pipette toggle after a successful pick so each pick is a
one-shot action (HUD toggle follows via the Picked sync). Split the
wall-climb pose drag so the lean-out offset stays on LMB while body
rotation moves to RMB, letting both be held independently. Also pulls in
the terrain physics module and the user's scene setup for the terrain
test area.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:50:26 +02:00
adminandClaude Opus 4.8 9df8c6076d Raycast any object for pipette and read foreign materials texel-accurately
The pipette now raycasts the nearest collider of any object, not just the
paint mesh. On a foreign hit it reads all channels texel-accurately from the
object's material maps (BaseMap/MetallicGloss/Occlusion/Emission) combined
with the material scalars per URP/Lit conventions, falling back to scalar
properties where a map is missing or the collider yields no UV. Includes
scene test props and materials for verifying foreign-object picking.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:05:35 +02:00
adminandClaude Opus 4.8 3df855597a Sync HUD and enable all paint channels on pipette pick
After a successful pipette pick the painter now enables all four paint
channels (albedo, metallic/smoothness, occlusion, emission) and raises a
Picked event. The HUD subscribes and re-syncs every widget (toggles,
sliders, both colour pickers) to the adopted brush values.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:38:11 +02:00
adminandClaude Opus 4.8 24a36c0e61 Add pipette (eyedropper) brush mode and wire it into the HUD
Pipette samples all painted channel values (albedo, metallic, smoothness,
occlusion, emission) at the clicked texel and adopts them into the brush
with every opacity forced to 1, instead of painting. The screen raycast is
extracted into a shared TryRaycastPaintMesh helper used by painting, preview
and the pipette. A pipette toggle is added to the HUD panel prefab and wired
in PaintHud.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:25:14 +02:00