feat: player run/walk gaits (run by default, hold Shift to walk) #177
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo#177
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a run/walk gait to player movement. Today there is a single speed (
MoveCooldownTicks = 2, ~200ms/step); this splits it into a faster run (default) and a slower walk (hold a modifier), server-authoritative.Design reviewed via
critical-design-review(Invariants Check below). ModernUO/UO reference: the client sends the movement direction + a "running" bit; the server enforces the rate floor (fastwalk-prevention) and, in UO, gates run on stamina — we defer stamina (see follow-up).Scope
Shared/Protocol) —MoveRequest(Direction, bool Running)andPlayerMoved(…, bool Running); bumpProtocolVersion.Currentin the same change.GameOptions:WalkCooldownTicks(default 3, ~300ms — a touch slower than today) andRunCooldownTicks(default 1, ~100ms).MovementSystempicks the base cooldown from the intent'sRunningflag, then scales by terrain move-cost as today (marsh slows both). The run cooldown is the floor — a modified client claimingRunningalways cannot move faster than run. Broadcast carriesRunningso observers animate correctly.GameInputControllersendsRunningand matches its send cadence to the active gait. The entity scales its glide duration + walk-anim fps by gait (shorter glide + faster legs when running); the self from its own intent, other players fromPlayerMoved.Running.human/run_*animation (body 0x190, action group 2 = Run) from the classic.mulclient and bake it into the pack (UO-derived placeholder, like the existing walk/stand/attack — to be redone with original art later). Fallback: if the run frames are absent, reusewalk_*at higher fps (no placeholder shape).docs/architecture.mdmovement note; document the two newGameOptions.Invariants Check (agreed)
Runningas intent; server picks the cooldown and enforces the run floor; position validated as today. Protocol versioned ✓ MoveRequest+PlayerMoved gain a field → bump in the same change. String catalog N/A (no new text this MVP). Single-threaded sim ✓ gait selection inMovementSystem, sim thread only.World.csHARD GATE ✓ logic inMovementSystem, World only delegates.ScreenHARD GATE ✓ input→intent inGameInputController, glide/anim on the entity, gait from the dispatcher. Client engine-independence ✓ gait→(glide,fps,sendInterval) mapping is pure (Client.Core), unit-tested. Gameplay/Networking separation ✓ rule inGameplay/, wire inProtocol/. Extend by type not switch ✓ gait is a movement parameter (bool/small enum), a cooldown lookup — not a polymorphic type. Server-paced actions ✓ run = shorter per-step cooldown, not compressible below the floor. Persistence ✓ gait transient, nothing new serialized. Typed options ✓WalkCooldownTicks/RunCooldownTicksonGameOptions, default in one place. Broadcasts absolute / AoI ✓PlayerMovedkeeps absolute X,Y (+Running), reconciled in AoI, no new event type. Multi-platform ✓ pure .NET; Shift via existing input. Assets ✓ real UO run art (placeholder family), missing → reuse walk faster, never a placeholder shape. Asset naming ✓human/run_*descriptive. ModernUO ✓ follow "client requests gait, server enforces floor"; diverge by deferring stamina. Docs & DoD ✓ this issue + architecture note.Verification plan
ProtocolJsonround-trip for the newRunningfields onMoveRequest/PlayerMoved.Definition of Done (delta)
Runningdrives their glide + animation).ProtocolVersion.Currentbumped in the same change; wire round-trips.Stamina (deferred from this MVP) tracked in #178.
Implemented in #180 — timed in-game: walk 3.35s vs run 1.21s over the same 10-tile path (2.77x), real UO
human/run_*extracted, all DoD items covered.Marco aiutami invece di farti le unghie a tema pokemon 💅
Risolta: run/walk gaits su main (#180).