diff --git a/Mod/Mod.cs b/Mod/Mod.cs index 5f26671..b2ba2dd 100644 --- a/Mod/Mod.cs +++ b/Mod/Mod.cs @@ -125,17 +125,14 @@ static void InitializeSimulation() simulation.Reset(config); // Advance the simulation by specified ticks. - if (config.TicksToAdvanceOnStartup > 0) - { - Logging.Out("Advancing simulation for {0} ticks...", config.TicksToAdvanceOnStartup); + Logging.Out("Advancing simulation for {0} ticks...", Simulation.Limits.TicksToAdvanceOnStartup); - var elapsed = Utils.Measure(() => - { - simulation.FastAdvance(config.TicksToAdvanceOnStartup); - }); + var elapsed = Utils.Measure(() => + { + simulation.FastAdvance(Simulation.Limits.TicksToAdvanceOnStartup); + }); - Logging.Out("... done, took {0}.", elapsed); - } + Logging.Out("... done, took {0}.", elapsed); } simulation.EnableAutoSave(simFile, 60.0f); @@ -279,7 +276,7 @@ static void GameUpdate() // Check for pausing. { var isPaused = GameManager.Instance.IsPaused(); - if (simulation.Config.PauseWithoutPlayers && simulation.PlayerCount == 0) + if (simulation.PlayerCount == 0) { isPaused = true; } diff --git a/Mod/Windows/SimulationMap.cs b/Mod/Windows/SimulationMap.cs index eac1e9e..a1fd3cc 100644 --- a/Mod/Windows/SimulationMap.cs +++ b/Mod/Windows/SimulationMap.cs @@ -188,7 +188,7 @@ private void RenderUpdate() UpdateColors(); nextUpdate = DateTime.Now; - nextUpdate = nextUpdate.AddMilliseconds(1000 / 30); + nextUpdate = nextUpdate.AddSeconds(1); RenderRoadsToTexture(); diff --git a/Tests/LoadSaveTests.cs b/Tests/LoadSaveTests.cs index b95ab20..b412bbc 100644 --- a/Tests/LoadSaveTests.cs +++ b/Tests/LoadSaveTests.cs @@ -19,7 +19,6 @@ private void CompareSimulations(Simulation simA, Simulation simB) Assert.AreEqual(configA.RandomSeed, configB.RandomSeed); Assert.AreEqual(configA.MaxAgents, configB.MaxAgents); - Assert.AreEqual(configA.TicksToAdvanceOnStartup, configB.TicksToAdvanceOnStartup); Assert.AreEqual(configA.StartAgentsGrouped, configB.StartAgentsGrouped); Assert.AreEqual(configA.GroupSize, configB.GroupSize); Assert.AreEqual(configA.StartPosition, configB.StartPosition); diff --git a/Viewer/FormMain.cs b/Viewer/FormMain.cs index 13f3aed..0a7671f 100644 --- a/Viewer/FormMain.cs +++ b/Viewer/FormMain.cs @@ -314,17 +314,14 @@ private void StartSimulation() GenerateColorTable(); - if (CurrentConfig.TicksToAdvanceOnStartup > 0) - { - Logging.Out("Advancing simulation for {0} ticks...", CurrentConfig.TicksToAdvanceOnStartup); + Logging.Out("Advancing simulation for {0} ticks...", Simulation.Limits.TicksToAdvanceOnStartup); - var elapsed = Utils.Measure(() => - { - simulation.FastAdvance(CurrentConfig.TicksToAdvanceOnStartup); - }); + var elapsed = Utils.Measure(() => + { + simulation.FastAdvance(Simulation.Limits.TicksToAdvanceOnStartup); + }); - Logging.Out("... done, took {0}.", elapsed); - } + Logging.Out("... done, took {0}.", elapsed); simulation.Start(); updateTimer.Start(); diff --git a/WalkerSim/Config.cs b/WalkerSim/Config.cs index ff71227..2c61a59 100644 --- a/WalkerSim/Config.cs +++ b/WalkerSim/Config.cs @@ -95,9 +95,6 @@ public class DebugOptions [XmlElement("MaxAgents")] public int MaxAgents = 10000; - [XmlElement("TicksToAdvanceOnStartup")] - public int TicksToAdvanceOnStartup = 0; - [XmlElement("StartAgentsGrouped")] public bool StartAgentsGrouped = true; diff --git a/WalkerSim/Simulation.Limits.cs b/WalkerSim/Simulation.Limits.cs index cb9f1e7..97022ea 100644 --- a/WalkerSim/Simulation.Limits.cs +++ b/WalkerSim/Simulation.Limits.cs @@ -4,6 +4,7 @@ internal partial class Simulation { public static class Limits { + public const uint TicksToAdvanceOnStartup = 100; public const int MinAgents = 1; public const int MaxAgents = 30000; public const int MaxQuerySize = 128; diff --git a/WalkerSim/Simulation.cs b/WalkerSim/Simulation.cs index 6cd5e6e..4f2bdd3 100644 --- a/WalkerSim/Simulation.cs +++ b/WalkerSim/Simulation.cs @@ -36,11 +36,11 @@ public void Stop() Logging.Out("Simulation stopped."); } - public void FastAdvance(int numTicks) + public void FastAdvance(uint numTicks) { var oldScale = TimeScale; TimeScale = 512.0f; - for (int i = 0; i < numTicks; i++) + for (uint i = 0; i < numTicks; i++) { Tick(); } diff --git a/WalkerSim/WalkerSim.xml b/WalkerSim/WalkerSim.xml index f41cec6..99252bb 100644 --- a/WalkerSim/WalkerSim.xml +++ b/WalkerSim/WalkerSim.xml @@ -4,13 +4,11 @@ false 1337 - 6000 - 100 + 10000 true 100 RandomLocation RandomBorderLocation - true true diff --git a/WalkerSim/WalkerSimSchema.xsd b/WalkerSim/WalkerSimSchema.xsd index 9f5c7d5..745b5a8 100644 --- a/WalkerSim/WalkerSimSchema.xsd +++ b/WalkerSim/WalkerSimSchema.xsd @@ -2,7 +2,8 @@ + elementFormDefault="qualified" + vc:minVersion="1.1" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"> @@ -179,11 +180,6 @@ Agents will be assigned to a group, this specifies how many members a group will have - - - In case a new simulation starts this is the amount of ticks it will advance in one go - - This will put agents of the same group closer together at initial start of the simulation @@ -203,11 +199,6 @@ - - - The option specifies if the simulation should be paused when no players are on the server - - Specifies if the simulation should be paused during blood moons