Skip to content

1681-engine / index / CADENCE

Variable: CADENCE ​

ts
const CADENCE: object;

Defined in: src/net/cadence.ts:8

Every repeated player action with a timer — the basic attack, a skill's cooldown, the cast and attack locks, a potion — runs on a schedule, not on "the last time plus some slack". An action may arrive up to its slack early (network jitter bunches packets), but the next one is then due a whole interval after the later of the arrival and the time this one was due, so the slack never adds up: a client sending every 0.8 of an interval lands at most one per interval (67 in 100), not 100. A server must run the same arithmetic.

Type Declaration ​

attackEarlyShare ​

ts
readonly attackEarlyShare: 0.2 = 0.2;

A basic attack may arrive this share of its interval early.

cooldownSlackMs ​

ts
readonly cooldownSlackMs: 40 = 40;

A skill may be cast this long before its cooldown ends.

lockSlackMs ​

ts
readonly lockSlackMs: 60 = 60;

The cast lock and the attack lock a cast leaves may be cut this short.

potionSlackMs ​

ts
readonly potionSlackMs: 150 = 150;

A potion may be drunk this long before its kind's cooldown ends.

Released under the MIT License.