diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 63ac5f67fa..8707737e4d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -158,7 +158,7 @@ namespace OpenSim.Region.Framework.Scenes /// One can tweak this number to experiment. One current effect of reducing it is to make avatar animations /// occur too quickly (viewer 1) or with even more slide (viewer 2). /// - protected float m_minFrameTimespan = 0.089f; + public float MinFrameTime { get; private set; } /// /// The time of the last frame update. @@ -552,6 +552,7 @@ namespace OpenSim.Region.Framework.Scenes bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) { m_config = config; + MinFrameTime = 0.089f; Random random = new Random(); @@ -1293,7 +1294,7 @@ namespace OpenSim.Region.Framework.Scenes if (Frame % m_update_physics == 0) { if (m_physics_enabled) - physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, m_minFrameTimespan)); + physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, MinFrameTime)); if (SynchronizeScene != null) SynchronizeScene(this); } @@ -1421,7 +1422,7 @@ namespace OpenSim.Region.Framework.Scenes } maintc = Util.EnvironmentTickCountSubtract(maintc); - maintc = (int)(m_minFrameTimespan * 1000) - maintc; + maintc = (int)(MinFrameTime * 1000) - maintc; m_lastUpdate = Util.EnvironmentTickCount(); diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 8d62b16cd5..35cd025c01 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -106,6 +106,11 @@ namespace OpenSim.Region.Framework.Scenes private float m_timeDilation = 0; private int m_fps = 0; + /// + /// Our nominal fps target, as expected in fps stats when a sim is running normally. + /// + private float m_nominalReportedFps = 55; + /// /// Parameter to adjust reported scene fps /// @@ -114,7 +119,7 @@ namespace OpenSim.Region.Framework.Scenes /// However, we will still report an FPS that's closer to what people are used to seeing. A lower FPS might /// affect clients and monitoring scripts/software. /// - private float m_fpsCorrectionFactor = 5; + private float m_reportedFpsCorrectionFactor = 5; // saved last reported value so there is something available for llGetRegionFPS private float lastReportedSimFPS = 0; @@ -165,8 +170,9 @@ namespace OpenSim.Region.Framework.Scenes public SimStatsReporter(Scene scene) { - statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000); m_scene = scene; + m_reportedFpsCorrectionFactor = scene.MinFrameTime * m_nominalReportedFps; + statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000); ReportingRegion = scene.RegionInfo; m_objectCapacity = scene.RegionInfo.ObjectCapacity; @@ -212,7 +218,7 @@ namespace OpenSim.Region.Framework.Scenes // We're going to lie about the FPS because we've been lying since 2008. The actual FPS is currently // locked at a maximum of 11. Maybe at some point this can change so that we're not lying. - int reportedFPS = (int)(m_fps * m_fpsCorrectionFactor); + int reportedFPS = (int)(m_fps * m_reportedFpsCorrectionFactor); // save the reported value so there is something available for llGetRegionFPS lastReportedSimFPS = reportedFPS / statsUpdateFactor;