Skip to content

scripting: camera shake + procedural kick/sway primitives #176

Description

@shadow-kernel

Context

Recoil, weapon sway, breathing bob, damage flinch and scare rumbles are all the same primitive: procedural, time-decaying transform noise composited onto a camera or socket offset. Per the gameplay-in-scripts philosophy the recoil LOGIC belongs in project scripts — but scripts need engine primitives: perlin/curve noise utilities, a spring-damper, and a composable offset stack so recoil + sway + bob don't fight each other or the socket transform.

Goal

Vortex.CameraFX (or equivalent) utility layer: additive offset channels on camera and attachment transforms with spring-damper recovery, seeded noise, and amplitude/frequency/decay parameters — deterministic, allocation-free, callable per frame from VortexBehaviour.

Acceptance Criteria

  • Offset channels: scripts push impulses (Kick(rotational, positional)) and continuous noise (Sway(amp, freq)); engine composes and recovers via spring-damper
  • Channels stack: recoil impulse + idle sway + walk bob compose without snapping
  • Applies to the camera AND to socket local offsets (weapon kicks back in the hand while camera kicks up)
  • Deterministic with seed (replay-stable), zero per-frame allocations
  • Decay curves configurable (snappy pistol vs heavy shotgun feel)
  • Demo script in the template: pistol recoil pattern + breathing sway on the flashlight

Technical Notes

Keep it math-utility-level in the engine (no gameplay semantics — 'recoil' is a template script concept). The offset stack must compose AFTER the socket transform so attachments stay glued.

Dependencies

  • animation: bone socket system (offset composition point)
  • scripting: runtime light control API (flashlight sway pairing, soft)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-highHohe Priorität – als Nächstes einplanenarea:scriptingVortexAPI, VortexBehaviour, Game-APIsize:M1–3 Tagetype:featureNeues Engine-/Editor-Feature

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions