{"id":"superdupernairobi/nerp","name":"nerp","scope":"superdupernairobi","platform":"roblox","description":"Interpolates server driven floats on the client. Buffers timestamped values and plays them back on a fixed delay behind the newest one.","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"f2c74a720161bc977daa4ae0bff371f7aeb4c23a0af0be4414d91ea8fc46082d","likes":0,"downloads":0,"install":"forest install superdupernairobi/nerp","url":"https://forest.dev/p/roblox/superdupernairobi/nerp","files":"https://api.forest.dev/ai/package/roblox/superdupernairobi/nerp/files","readme":"# Nerp\r\n\r\nInterpolation for server driven transforms and the server stamps a `CFrame` with a time, the client buffers it and plays it back slightly late, so 20Hz of updates becomes continuous motion at your framerate.\r\n\r\nIt does not do any networking. You simple send the batch, then you receive it.\r\n\r\n![Nerp smoothing a streamed CF](/nerp-example.gif)\r\n\r\n## Install\r\n\r\n**Wally**\r\n\r\n```toml\r\n[dependencies]\r\nNerp = \"superdupernairobi/nerp@0.1.0\"\r\n```\r\n**Studio users:** download `Nerp.rbxm` from the latest releasse and right click `ReplicatedStorage` and pick Insert > Import Roblox Model\r\n\r\n## Use\r\n```lua\r\nlocal Nerp = require(game:GetService(\"ReplicatedStorage\").Nerp)\r\n\r\nlocal store = Nerp.new(20, \"SMOOTH\") -- OR LOW_LATENCY\r\nstore:track(workspace.with_nerp)\r\nstore:start()\r\n\r\nremote.OnClientEvent:Connect(function(t, cf)\r\n    store:feed(workspace.with_nerp:GetFullName(), { { t = t, cf = cf } })\r\nend)\r\n```\r\n# The delay is a multiple and not a time\r\n`\"SMOOTH\"` is two samples of intervals, `\"LOW_LATENCY\"` is one and a half, so, at 20Hz that is 100ms and 75ms.\r\n\r\nBasically, two intervals leaves one whole sample of slack, so a single late packet still has a pair to interpolate between. At one interval the clock sits on the newest sample and any jitter pushes it past the end, which is where extrapolation starts. `LOW_LATENCY` is the one that can extrapolate, so it is for close combat and not for vehicles.\r\n\r\n## What it isn't\r\nNo lag comp, no bandwidth work, no camera, no prediction, Roblox already interpolates player characters, so Neerp does not do that by default.\r\n\r\n## Links\r\n- Docs: https://superdupernairobi.github.io/Nerp/\r\n- Wally: https://wally.run/package/superdupernairobi/nerp","readmeTruncated":false}