feat(desktop): calmer, more realistic pet roam + split roam modules - #55400
Merged
Conversation
The floating pet wandered almost constantly: every idle beat picked a new walk and hops fired ~45% of the time, so it read as nervous rather than alive. Make movement the exception, not the default, and split the overgrown roam hook into focused modules. Behavior (per ambient game-AI: GameAIPro ch.36 + idle/wander state machines): - Loaf, don't pace: most decision beats just keep resting (REST_CHANCE 0.62) instead of always re-walking. - Memoryless dwell: pauses now draw from an exponential distribution (mostly short rests, the occasional long loaf) instead of a uniform 1.8-5.2s window, so the cadence never reads as a metronome. - Hops dialed back 0.45 -> 0.2 (the jumpiest, noisiest motion). Structure (no god-file; a hook should own one narrow job): - roam-behavior.ts - what to do & when (dwellMs, chooseMove, pickStrollTarget) + tuning. Pure, rng-injectable. - roam-geometry.ts - where it can stand (snapshotLedges, overlayLedge, resolveLedge, overlapsX, groundTop). DOM measurement + pure ledge math. - use-pet-roam.ts - the physics/RAF loop only. Tests: deterministic, rng-seeded unit coverage for the decision + geometry helpers (behavior contracts, not snapshots).
OutThisLife
enabled auto-merge
June 30, 2026 03:52
OutThisLife
disabled auto-merge
June 30, 2026 03:53
DRY: the roomier-side bias computed its probability two ways (STROLL_TOWARD_ROOM and 1 - STROLL_TOWARD_ROOM). One draw XNOR'd against the roomier side says the same thing more plainly.
OutThisLife
enabled auto-merge
June 30, 2026 03:54
1 task
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…almer feat(desktop): calmer, more realistic pet roam + split roam modules
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…almer feat(desktop): calmer, more realistic pet roam + split roam modules
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…almer feat(desktop): calmer, more realistic pet roam + split roam modules
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…almer feat(desktop): calmer, more realistic pet roam + split roam modules
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…almer feat(desktop): calmer, more realistic pet roam + split roam modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The floating desktop pet wandered almost constantly — it works, but it never sat still. Two causes: every idle beat picked a new walk, and hops fired ~45% of the time. The result read as nervous, not alive. This makes movement the exception, not the default, and splits the overgrown roam hook into focused modules.
Behavior — calmer & more realistic
Grounded in ambient game-AI practice (GameAIPro ch.36 "Breathing Life into Your Background Characters" + standard idle/wander state machines, where idle dwell times are modeled as exponential/memoryless):
REST_CHANCE = 0.62) instead of always re-walking.0.45 → 0.2(hopping is the jumpiest, noisiest motion).Net effect: the pet still strolls, hops, and falls exactly as before — just far less often, with natural variation between bouts.
Structure — no god-file
The 459-line
use-pet-roam.tsmixed DOM surface measurement, behavior decisions, and the physics loop. Per the repo TS style ("a hook should own one narrow job; prefer colocated modules over god hooks") it's now three focused files:roam-behavior.ts— what to do & when:dwellMs,chooseMove,pickStrollTarget+ tuning constants. Pure,rng-injectable.roam-geometry.ts— where it can stand:snapshotLedges,overlayLedge,resolveLedge,overlapsX,groundTop. DOM measurement + pure ledge math.use-pet-roam.ts— the physics/RAF loop only.Tests
Deterministic,
rng-seeded unit coverage for the decision + geometry helpers — behavior contracts (clamping, rest-bias majority, ledge resolution), not snapshots.apps/desktopvitest: 25 passed.Test plan
vitest runon the new + existing pet tests — 25 passedtsc -p . --noEmit— cleaneslinton all touched files — clean