1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Support dynamic tick rates

This commit is contained in:
tobspr
2020-05-18 12:53:01 +02:00
parent 65529cce1a
commit ca0e17f3dd
16 changed files with 265 additions and 114 deletions

View File

@@ -23,13 +23,8 @@ export const globalConfig = {
statisticsGraphSlices: 100,
analyticsSliceDurationSeconds: 10,
// [Calculated] physics step size
physicsDeltaMs: 0,
physicsDeltaSeconds: 0,
// Update physics at N fps, independent of rendering
// physicsUpdateRate: 55,
physicsUpdateRate: 120,
minimumTickRate: 30,
maximumTickRate: 500,
// Map
mapChunkSize: 32,
@@ -76,7 +71,7 @@ export const globalConfig = {
debug: {
/* dev:start */
fastGameEnter: true,
// fastGameEnter: true,
noArtificialDelays: true,
// disableSavegameWrite: true,
showEntityBounds: false,
@@ -111,7 +106,4 @@ export const IS_MOBILE = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
// Automatic calculations
globalConfig.physicsDeltaMs = 1000.0 / globalConfig.physicsUpdateRate;
globalConfig.physicsDeltaSeconds = 1.0 / globalConfig.physicsUpdateRate;
globalConfig.minerSpeedItemsPerSecond = globalConfig.beltSpeedItemsPerSecond / 5;