From 5ca42599ef52236274938dba9bd6e113611cb734 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 19 Mar 2024 13:35:55 +1100 Subject: make timescale a server command and add a tickrate command --- source/game/StarWorldServerThread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/game/StarWorldServerThread.cpp') diff --git a/source/game/StarWorldServerThread.cpp b/source/game/StarWorldServerThread.cpp index c03c938..5d126ab 100644 --- a/source/game/StarWorldServerThread.cpp +++ b/source/game/StarWorldServerThread.cpp @@ -207,7 +207,7 @@ void WorldServerThread::run() { double storageInterval = root.assets()->json("/universe_server.config:worldStorageInterval").toDouble() / 1000.0; Timer storageTimer = Timer::withTime(storageInterval); - TickRateApproacher tickApproacher(1.0 / ServerGlobalTimestep, updateMeasureWindow); + TickRateApproacher tickApproacher(1.0f / ServerGlobalTimestep, updateMeasureWindow); double fidelityScore = 0.0; WorldServerFidelity automaticFidelity = WorldServerFidelity::Medium; @@ -217,6 +217,7 @@ void WorldServerThread::run() { LogMap::set(strf("server_{}_update", m_worldId), strf("{:4.2f}Hz", tickApproacher.rate())); update(fidelity); + tickApproacher.setTargetTickRate(1.0f / ServerGlobalTimestep); tickApproacher.tick(); if (storageTimer.timeUp()) { -- cgit v1.2.3