Bound the first simulation step after a long pause

Analysis

By Juliet Ramos, Playable Production Editor3 min read

View author profile
Bound the first simulation step after a long pause

Bound the first simulation step after a long pause. A runnable teaching fixture with synthetic cases, a broken branch, and explicit untested cells.

A resumed frame can carry a much larger elapsed time than the normal loop expects. This fixture checks a bounded simulation step rather than allowing an object to jump across the stage.

This edition is a laboratory fixture. Node and the companion HTML page execute the authored functions against synthetic cases. No physical device panel was run, no ad network reviewed the build, and no campaign result is inferred from a passing test.

What the documentation actually supplies

MDN: frame delta is the governing reference for the browser primitive. MDN explains that requestAnimationFrame callbacks provide a timestamp and are commonly paused in background contexts. It recommends using elapsed time rather than assuming every display has the same refresh rate. The fixture policy around that primitive is ours.

The failure the fixture isolates

The fixed branch clamps negative intervals to zero and caps a single model step at an illustrative one hundred milliseconds. The broken branch applies the raw difference. This is a simple teaching policy: a production simulation might instead use fixed steps and controlled catch-up, depending on what its rules require.

The broken branch is retained so a producer can see the exact mistake, not only the repaired output.

Reference table
CaseInputExpected (fixed)Broken output
normal frame`[100,116]``16``16`
long pause`[100,5100]``100``5000`
out-of-order sample`[100,90]``0``-10`

All 3 fixed-branch cases matched the spec when executed in Node on 19 September 2026.

What a pass does not prove

The passing result proves the cap for the supplied timestamps. It does not show that the actual game remains physically accurate or that a catch-up strategy is visually acceptable. A cap trades simulated elapsed time for stability, so the timer design must be explicit about which clock represents gameplay and which represents real time.

Untested cells in this edition: physical devices, host SDKs, network packaging limits, store-opening callbacks, and campaign performance. Those remain empty on purpose.

Next check on a real build

Instrument consecutive callback timestamps in a real build and test pause, resume and slow frames. Decide whether to reset the previous timestamp when activity resumes. Keep that decision consistent with the visibility gate; otherwise two individually sensible fixes can double-discount or accidentally reapply the hidden interval.

Open the runnable fixture to re-execute the cases in a browser. Download the case record to keep inputs, expectations and limits with a QA ticket.

Background in the archive: Playable ad device testing matrix and Playable spec sheet before you build. Those guides describe practice; they are not a substitute for this fixture and this check does not recertify their every claim.

Featured

Related posts

measurement

playable ads

·

1 min read

Playable completers vs video viewers: downstream payer quality

measurement

playable ads

·

3 min read

Stop simulation time while the document is hidden

measurement

playable ads

·

3 min read

Fit the whole playable stage inside a narrow viewport

measurement

playable ads

·

2 min read

Require both intersection and document visibility before advancing

More from the Measurement desk

measurement

·

2 min read

Airbridge adds Amazon Ads as an app measurement channel

measurement

·

2 min read

When to freeze a cohort for payback review (and when not to)

measurement

media buying

·

1 min read

Using predicted LTV in bids: disclosure checklist for the UA team

measurement

media buying

·

1 min read

Blended ROAS targets that hide channel failure in F2P portfolios