From df4b144df4a345932f06eda2003ea692d189a8c2 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Thu, 5 Nov 2009 22:32:47 +1300 Subject: [PATCH] timestep control (rate=N); not failing at SharedRandom seed --- OpenRa.Game/Game.cs | 4 ++-- OpenRa.Game/MainWindow.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index dd2e713ecb..355221665c 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -132,7 +132,7 @@ namespace OpenRa.Game } static int lastTime = Environment.TickCount; - public const int timestep = 40; + public static int timestep = 40; public static void ResetTimer() { @@ -259,7 +259,7 @@ namespace OpenRa.Game return BuildingInfluence.GetDistanceToBuilding(b); } - public static Random SharedRandom = new Random(); /* for things that require sync */ + public static Random SharedRandom = new Random(0); /* for things that require sync */ public static Random CosmeticRandom = new Random(); /* for things that are just fluff */ public static readonly Pair SovietVoices = diff --git a/OpenRa.Game/MainWindow.cs b/OpenRa.Game/MainWindow.cs index 8dabc19aca..012892877c 100755 --- a/OpenRa.Game/MainWindow.cs +++ b/OpenRa.Game/MainWindow.cs @@ -51,6 +51,7 @@ namespace OpenRa.Game UiOverlay.ShowUnitDebug = settings.GetValue("udebug", false); UiOverlay.ShowBuildDebug = settings.GetValue("bdebug", false); + Game.timestep = settings.GetValue("rate", 40); WorldRenderer.ShowUnitPaths = settings.GetValue("pathdebug", false); Game.Replay = settings.GetValue("replay", "");