// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Cap catch-up simulation work // Not compiled or tested in-world // Setup: Put in a spare owned prim. Set nonnegative ACCUMULATOR/ELAPSED, positive STEP, and MAX_STEPS1..100. Owner touch prints calculations only. // Stop / restore: Disable/remove. No prim motion or appearance is changed. // Notes: Explicitly reports discarded backlog to avoid a spiral of excessive catch-up work. This is a planning demonstration. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Motion planning only. float ACCUMULATOR=0.02; float ELAPSED=0.4; float STEP=0.05; integer MAX_STEPS=4; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(ACCUMULATOR<0.0||ELAPSED<0.0||STEP<=0.0||MAX_STEPS<1||MAX_STEPS>100) { llOwnerSay("Invalid step configuration."); return; } float available=ACCUMULATOR+ELAPSED; integer count=llFloor(available/STEP); integer run=count; if(run>MAX_STEPS)run=MAX_STEPS; float leftover=available-count*STEP; llOwnerSay("Run steps="+(string)run+" discarded seconds="+(string)((count-run)*STEP)+" remainder="+(string)leftover); } }