Skip to content
PONGITDOCUMENTATIONGitHub ↗Back to arcade ↗
V4 · Testnet
Docs/Technical reference

Technical reference

Physics, prediction & latency

The contract determines collisions; the browser makes the motion readable.

Integer event physics#

This section first describes the archived V4 arena. Current rooms use the engine transport described below; both keep contract state authoritative.

The V4 deployment reuses GameV3 and PhysicsV2. Solidity and TypeScript share an event-driven model: positions and velocities have a 1,000,000 scale, time is in integer microseconds, division truncates toward zero and event times round up.

The logical court is 1024 × 576, ball radius is 6 and default paddle half-height is 48. Agent rules 17 and human rules 18 use 300 logical units per second for both paddles. Earlier rules retain 180; an old match never changes speed when a new version is deployed. Human games end at seven points. Chaos adds individual half-heights and speed multipliers. Old deployments have an intermission; rules 5 and 6 immediately serve after each non-decisive point.

Local input predicts only the picture. An unacknowledged command cannot confirm a paddle collision, impact sound or point. Prediction waits at an uncertain contact until live confirmation arrives. Results published on Monad remain distinct from both the live picture and finality after the challenge period.

The match clock#

Game time advances from active block numbers at 300,000 microseconds per block. The game accounts for paused blocks; this is a virtual clock, not a promise that every wall-clock block takes exactly 300 ms.

Player or relayer timestamps cannot rewrite past collisions. An input takes effect at inclusion, after due events are resolved. Catch-up is bounded and resumable; Chaos stops at an intermission before resuming with fresh handicap values.

Input pipeline#

The client sends a signed intent without waiting for the previous receipt. The relayer retains one submitted, unconfirmed input per player plus the latest eligible pending intention. Intermediate unsent intentions can be superseded; signed transaction bytes are immutable.

The existing onchain Input nonce remains strictly sequential. A dependent command waits for its predecessor on the server. After failure or expiry, the client refreshes state and re-signs the latest intention rather than creating a nonce gap.

Preview and reconciliation#

The renderer reconstructs from a confirmed snapshot and relevant local intents, using a monotone browser clock. Prediction is bounded and corrections are smoothed. It stops extrapolating old snapshots indefinitely; SYNCING / PREVIEW PAUSED reports that limit. Contract collisions and scores remain authoritative.

Read the latency panel#

Network details separates server round-trip, relayer queue/preparation, broadcast, chain/receipt observation, snapshot age and visual correction. Those measurements are not interchangeable. Client and server clocks must not be subtracted without synchronization.

Moving the web frontend alone does not remove relayer queuing or Monad inclusion delay. Historical benchmarks are workload-specific, not present-day service guarantees. The source and test records include 10,000 differential physics cases per mode; those checks are correctness evidence, not a latency guarantee.

Current rooms: pushed state and recovery#

Current rooms use 10,000 microseconds per engine block, starting ball velocity 192/96 units per second and 10% acceleration on each successful paddle return. Speed resets after each point. Classic and Chaos serve immediately after nonfinal points; only Chaos uses queued authenticated paid totals to calculate the next paddle heights. An unavailable financial checkpoint preserves the existing pressure and does not stop game time.

Rooms can receive the contract's Snapshot events over one applied-event WebSocket per tab. Successful SDK receipts update the same cache. The initial getter supplies participants, nonces and clock metadata; events do not invent missing fields. A gap, restart, changed delegation or missing terminal winner requires an authoritative read. A consistency check runs every ten seconds while events remain fresh.

If the stream is unavailable, reads are serialized with a 500 ms active-game interval and a two-second waiting interval. Remote Retry-After takes precedence. A failed write is reconciled with its receipt, state and SDK nonce before another command can be signed. A missing reply does not prove failure.

Player A drives idle ticks at most every 300 ms. Player B takes over after 900 ms without progression; the VPS is the last fallback after 1.5 seconds. Successful inputs already advance the game and suppress unnecessary ticks. The server's maintenance scheduler can make its fallback later than the threshold.

The browser still bounds preview when state is stale. A stream reduces repeated reads and stale-state corrections; it does not turn a live engine result into an irreversible Monad settlement or guarantee a particular network latency.

Rules 6: events and continuous collisions#

The 24-event Chaos catalogue belongs to the new immutable generation. Archived rules-5 matches retain their original rules and financial bindings.

Its Solidity kernel and TypeScript mirror use integer arithmetic. Positions use 10¹² units of precision and time is in microseconds. Forces are integrated on a fixed 10 ms grid, with continuous collision searches inside each interval. In rules 8, a bounded catch-up continues in a later command: force-grid slices span at most 100 ms and plain slices at most one second, with gas reserved to store progress and finish a ranked result. Rules 6 did not bound the complete game advance this way and could freeze after a long interruption. A detected numerical impossibility explicitly cancels the match rather than selecting a winner.

Eight packed words carry both balls, the two effects, paddle positions, actual rally number, scores and simulation metadata. The atomic chaosState read adds the current participants, input nonces, draw request and pending verified draw. The event wire format remains version 6 for both rules 6 and 8. Snapshot events contain the version, explicit control/nonces word and eight physics words. ChaosCollision identifies an actual physical collision; a speed change alone cannot produce a bounce sound.

The renderer uses the same kernel for a bounded preview. It does not publish predicted goals or choose random events. Ball trails are separated by ball identity, epoch, rally and teleport revision. Replays retain the typed state for both balls and effects, subject to the shared retention policy.

Future drand rounds are committed before revelation. A missing proof delays only the event. Gameplay commands do not carry a BLS proof; a dedicated permissionless transaction submits it once per draw. The server proof worker shares its signer's existing nonce journal with other public engine operations.

Reusable rules 14#

Rules 14 carries the bounded Chaos kernel into independently delegated arenas. The physical slot is reused, while all commands and results retain the logical match ID and epoch. Pending controls preserve the latest intent while catch-up resumes. A human match beyond thirty minutes of engine time is cancelled without a winner or ELO, so recovery does not need to simulate an arbitrarily long outage.

The initial countdown requires both three timestamp seconds and 300 ticks of the existing 100 Hz engine clock. This avoids losing countdown digits when the hosted execution timestamp jumps between publication batches. A result or readiness observation does not restart a separate browser timer.