§ TECH · APTOS MOVE · EXEC CAP 9,200 GAS
How it works
Fit a collision search against an entire school of fish inside a single transaction's execution limit, then settle strictly in game-time order. Here's how it's done.
§ 01 · The life of a shot
Carries only a direction and a bet. Rate limit: a sustained 1 shot per second per player; extra shots are deferred, by up to 2 seconds.
Follows the trajectory (with bounces) to find the earliest fish touched on the whole field, and when; if it touches nothing, the bet isn't charged.
Placed in a circular timing wheel by hit time; locks a max payout of 100× the bet and takes a refundable deposit.
Every later fire first settles other players' bullets in due order; when nobody is firing, the sweep settles them.
On-chain randomness is drawn only at settlement; a kill's payout goes to the room balance, and the deposit returns to whoever paid it.
The school: anyone can recompute it
A 4800 × 2700 px field, one slot every 50 ms. The slot determines the species; the path is chosen from (room seed, fish index) via splitmix64 and follows a multi-point Catmull-Rom path table (one per room, stored on-chain). ~225 fish are on the field at once. The client recomputes them bit for bit with the same integer formulas and matches the contract.
Collision search: conservative advancement
When far away, it takes big steps bounded by "the farthest a fish can swim"; only up close does it step millisecond by millisecond. It enumerates by species in stages: first 600 ms, then 1,500 ms, then the full range, and once it finds a hit, that hit becomes the upper bound for the rest.
Why the search has to be on-chain
Finding collisions on the client and verifying them on-chain looks cheaper, but then the client could skip the fish in the way and pick only big fish, growing variance about 95×. With the search on-chain, the "pick a fish" degree of freedom disappears from the protocol.
Sweep keeper
When nobody is firing, due bullets are settled by sweep. Anyone can call it; the keeper only makes sure "someone gives it a push" and provides no trust: settlement rules don't depend on who calls it.