tolerate internet latency for initial inputs
All checks were successful
build / image (push) Successful in 1m49s
All checks were successful
build / image (push) Successful in 1m49s
This commit is contained in:
@@ -11,6 +11,10 @@ import type {
|
||||
|
||||
export interface ServerEngineOptions {
|
||||
historyTicks?: number;
|
||||
/**
|
||||
* Maximum transport delay accepted for an input. Late inputs are applied on
|
||||
* the next simulation step; they never rewrite authoritative history.
|
||||
*/
|
||||
maxPastTicks?: number;
|
||||
maxFutureTicks?: number;
|
||||
}
|
||||
@@ -63,7 +67,7 @@ export class AuthoritativeEngine<State, Input> {
|
||||
) {
|
||||
this.game = game;
|
||||
this.historyTicks = options.historyTicks ?? game.tickRateHz * 2;
|
||||
this.maxPastTicks = options.maxPastTicks ?? 2;
|
||||
this.maxPastTicks = options.maxPastTicks ?? game.tickRateHz;
|
||||
this.maxFutureTicks = options.maxFutureTicks ?? game.tickRateHz;
|
||||
this.snapshotEveryTicks = game.tickRateHz / game.snapshotRateHz;
|
||||
this.state = game.createInitialState();
|
||||
|
||||
Reference in New Issue
Block a user