Fixed PVS changes. (#10740)
This commit is contained in:
@@ -45,6 +45,8 @@ using Robust.Client.Input;
|
|||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Client.State;
|
using Robust.Client.State;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
|
using Robust.Shared;
|
||||||
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.ContentPack;
|
using Robust.Shared.ContentPack;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
@@ -129,6 +131,7 @@ namespace Content.Client.Entry
|
|||||||
IoCManager.Resolve<PlayTimeTrackingManager>().Initialize();
|
IoCManager.Resolve<PlayTimeTrackingManager>().Initialize();
|
||||||
|
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
|
IoCManager.Resolve<IConfigurationManager>().OverrideDefault(CVars.NetBufferSize, 2);
|
||||||
|
|
||||||
_escapeMenuOwner.Initialize();
|
_escapeMenuOwner.Initialize();
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<Label Text="{Loc 'ui-options-net-interp-ratio'}" />
|
<Label Text="{Loc 'ui-options-net-interp-ratio'}" />
|
||||||
<Control MinSize="8 0" />
|
<Control MinSize="8 0" />
|
||||||
<Slider Name="NetInterpRatioSlider"
|
<Slider Name="NetInterpRatioSlider"
|
||||||
MinValue="0"
|
ToolTip="{Loc 'ui-options-net-interp-ratio-tooltip'}"
|
||||||
MaxValue="6"
|
MaxValue="6"
|
||||||
HorizontalExpand="True"
|
HorizontalExpand="True"
|
||||||
MinSize="80 0"
|
MinSize="80 0"
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
using System;
|
|
||||||
using Content.Shared.CCVar;
|
|
||||||
using Robust.Client.AutoGenerated;
|
using Robust.Client.AutoGenerated;
|
||||||
using Robust.Client.Graphics;
|
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.XAML;
|
using Robust.Client.UserInterface.XAML;
|
||||||
using Robust.Shared;
|
using Robust.Shared;
|
||||||
using Robust.Shared.Maths;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Client.GameStates;
|
||||||
using Robust.Shared.Localization;
|
|
||||||
|
|
||||||
namespace Content.Client.EscapeMenu.UI.Tabs
|
namespace Content.Client.EscapeMenu.UI.Tabs
|
||||||
{
|
{
|
||||||
@@ -17,6 +12,7 @@ namespace Content.Client.EscapeMenu.UI.Tabs
|
|||||||
public sealed partial class NetworkTab : Control
|
public sealed partial class NetworkTab : Control
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||||
|
[Dependency] private readonly IClientGameStateManager _stateMan = default!;
|
||||||
|
|
||||||
public NetworkTab()
|
public NetworkTab()
|
||||||
{
|
{
|
||||||
@@ -26,6 +22,7 @@ namespace Content.Client.EscapeMenu.UI.Tabs
|
|||||||
ApplyButton.OnPressed += OnApplyButtonPressed;
|
ApplyButton.OnPressed += OnApplyButtonPressed;
|
||||||
ResetButton.OnPressed += OnResetButtonPressed;
|
ResetButton.OnPressed += OnResetButtonPressed;
|
||||||
NetInterpRatioSlider.OnValueChanged += OnNetInterpRatioSliderChanged;
|
NetInterpRatioSlider.OnValueChanged += OnNetInterpRatioSliderChanged;
|
||||||
|
NetInterpRatioSlider.MinValue = _stateMan.MinBufferSize;
|
||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
@@ -45,7 +42,7 @@ namespace Content.Client.EscapeMenu.UI.Tabs
|
|||||||
|
|
||||||
private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
|
private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
|
||||||
{
|
{
|
||||||
_cfg.SetCVar(CVars.NetInterpRatio, (int) NetInterpRatioSlider.Value);
|
_cfg.SetCVar(CVars.NetBufferSize, (int) NetInterpRatioSlider.Value - _stateMan.MinBufferSize);
|
||||||
_cfg.SaveToFile();
|
_cfg.SaveToFile();
|
||||||
UpdateChanges();
|
UpdateChanges();
|
||||||
}
|
}
|
||||||
@@ -57,13 +54,13 @@ namespace Content.Client.EscapeMenu.UI.Tabs
|
|||||||
|
|
||||||
private void Reset()
|
private void Reset()
|
||||||
{
|
{
|
||||||
NetInterpRatioSlider.Value = _cfg.GetCVar(CVars.NetInterpRatio);
|
NetInterpRatioSlider.Value = _cfg.GetCVar(CVars.NetBufferSize) + _stateMan.MinBufferSize;
|
||||||
UpdateChanges();
|
UpdateChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateChanges()
|
private void UpdateChanges()
|
||||||
{
|
{
|
||||||
var isEverythingSame = NetInterpRatioSlider.Value == _cfg.GetCVar(CVars.NetInterpRatio);
|
var isEverythingSame = NetInterpRatioSlider.Value == _cfg.GetCVar(CVars.NetBufferSize) + _stateMan.MinBufferSize;
|
||||||
ApplyButton.Disabled = isEverythingSame;
|
ApplyButton.Disabled = isEverythingSame;
|
||||||
ResetButton.Disabled = isEverythingSame;
|
ResetButton.Disabled = isEverythingSame;
|
||||||
NetInterpRatioLabel.Text = NetInterpRatioSlider.Value.ToString();
|
NetInterpRatioLabel.Text = NetInterpRatioSlider.Value.ToString();
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public static class PoolManager
|
|||||||
(CCVars.GameMapForced.Name, "true", true),
|
(CCVars.GameMapForced.Name, "true", true),
|
||||||
(CCVars.AdminLogsQueueSendDelay.Name, "0", true),
|
(CCVars.AdminLogsQueueSendDelay.Name, "0", true),
|
||||||
(CCVars.NetPVS.Name, "false", true),
|
(CCVars.NetPVS.Name, "false", true),
|
||||||
(CCVars.NetInterp.Name, "false", true),
|
|
||||||
(CCVars.NPCMaxUpdates.Name, "999999", true),
|
(CCVars.NPCMaxUpdates.Name, "999999", true),
|
||||||
(CCVars.GameMapForced.Name, "true", true),
|
(CCVars.GameMapForced.Name, "true", true),
|
||||||
(CCVars.SysWinTickPeriod.Name, "0", true),
|
(CCVars.SysWinTickPeriod.Name, "0", true),
|
||||||
|
|||||||
@@ -6,8 +6,11 @@ using System.Threading.Tasks;
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.GameStates;
|
using Robust.Client.GameStates;
|
||||||
|
using Robust.Client.Timing;
|
||||||
using Robust.Server.GameStates;
|
using Robust.Server.GameStates;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
|
using Robust.Shared;
|
||||||
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
@@ -35,7 +38,7 @@ namespace Content.IntegrationTests.Tests.Networking
|
|||||||
[Test]
|
[Test]
|
||||||
public async Task Test()
|
public async Task Test()
|
||||||
{
|
{
|
||||||
await using var pairTracker = await PoolManager.GetServerClient(new (){Fresh = true, DisableInterpolate = true, DummyTicker = true});
|
await using var pairTracker = await PoolManager.GetServerClient(new (){Fresh = true, DummyTicker = true});
|
||||||
var server = pairTracker.Pair.Server;
|
var server = pairTracker.Pair.Server;
|
||||||
var client = pairTracker.Pair.Client;
|
var client = pairTracker.Pair.Client;
|
||||||
|
|
||||||
@@ -45,8 +48,12 @@ namespace Content.IntegrationTests.Tests.Networking
|
|||||||
var sEntityManager = server.ResolveDependency<IEntityManager>();
|
var sEntityManager = server.ResolveDependency<IEntityManager>();
|
||||||
var cEntityManager = client.ResolveDependency<IEntityManager>();
|
var cEntityManager = client.ResolveDependency<IEntityManager>();
|
||||||
var sGameTiming = server.ResolveDependency<IGameTiming>();
|
var sGameTiming = server.ResolveDependency<IGameTiming>();
|
||||||
var cGameTiming = client.ResolveDependency<IGameTiming>();
|
var cGameTiming = client.ResolveDependency<IClientGameTiming>();
|
||||||
var cGameStateManager = client.ResolveDependency<IClientGameStateManager>();
|
var cGameStateManager = client.ResolveDependency<IClientGameStateManager>();
|
||||||
|
var cfg = client.ResolveDependency<IConfigurationManager>();
|
||||||
|
var log = cfg.GetCVar(CVars.NetLogging);
|
||||||
|
|
||||||
|
//cfg.SetCVar(CVars.NetLogging, true);
|
||||||
|
|
||||||
EntityUid serverEnt = default;
|
EntityUid serverEnt = default;
|
||||||
PredictionTestComponent serverComponent = default!;
|
PredictionTestComponent serverComponent = default!;
|
||||||
@@ -72,14 +79,12 @@ namespace Content.IntegrationTests.Tests.Networking
|
|||||||
// Run some ticks so that
|
// Run some ticks so that
|
||||||
await PoolManager.RunTicksSync(pairTracker.Pair, 3);
|
await PoolManager.RunTicksSync(pairTracker.Pair, 3);
|
||||||
|
|
||||||
// Due to technical things with the game state processor it has an extra state in the buffer here.
|
// Check client buffer is full
|
||||||
// This burns through it real quick, but I'm not sure it should be there?
|
Assert.That(cGameStateManager.CurrentBufferSize, Is.EqualTo(cGameStateManager.TargetBufferSize));
|
||||||
// Under normal operation (read: not integration test) this gets corrected for via tick time adjustment,
|
|
||||||
// so it's probably not an issue?
|
|
||||||
await client.WaitRunTicks(1);
|
|
||||||
|
|
||||||
// 2 is target buffer size.
|
// This isn't required anymore, but the test had this for the sake of "technical things", and I cbf shifting
|
||||||
Assert.That(cGameStateManager.CurrentBufferSize, Is.EqualTo(2));
|
// all the tick times over. So it stays.
|
||||||
|
await client.WaitRunTicks(1);
|
||||||
|
|
||||||
await client.WaitPost(() =>
|
await client.WaitPost(() =>
|
||||||
{
|
{
|
||||||
@@ -97,7 +102,7 @@ namespace Content.IntegrationTests.Tests.Networking
|
|||||||
|
|
||||||
// Client last ran tick 15 meaning it's ahead of the last server tick it processed (12)
|
// Client last ran tick 15 meaning it's ahead of the last server tick it processed (12)
|
||||||
Assert.That(cGameTiming.CurTick, Is.EqualTo(new GameTick(16)));
|
Assert.That(cGameTiming.CurTick, Is.EqualTo(new GameTick(16)));
|
||||||
Assert.That(cGameStateManager.CurServerTick, Is.EqualTo(new GameTick(12)));
|
Assert.That(cGameTiming.LastProcessedTick, Is.EqualTo(new GameTick(12)));
|
||||||
|
|
||||||
// *** I am using block scopes to visually distinguish these sections of the test to make it more readable.
|
// *** I am using block scopes to visually distinguish these sections of the test to make it more readable.
|
||||||
|
|
||||||
@@ -173,7 +178,7 @@ namespace Content.IntegrationTests.Tests.Networking
|
|||||||
// Assert timing is still correct, should be but it's a good reference for the rest of the test.
|
// Assert timing is still correct, should be but it's a good reference for the rest of the test.
|
||||||
Assert.That(sGameTiming.CurTick, Is.EqualTo(new GameTick(18)));
|
Assert.That(sGameTiming.CurTick, Is.EqualTo(new GameTick(18)));
|
||||||
Assert.That(cGameTiming.CurTick, Is.EqualTo(new GameTick(20)));
|
Assert.That(cGameTiming.CurTick, Is.EqualTo(new GameTick(20)));
|
||||||
Assert.That(cGameStateManager.CurServerTick, Is.EqualTo(new GameTick(16)));
|
Assert.That(cGameTiming.LastProcessedTick, Is.EqualTo(new GameTick(16)));
|
||||||
|
|
||||||
{
|
{
|
||||||
// Send event to server to change flag again, this time to disable it..
|
// Send event to server to change flag again, this time to disable it..
|
||||||
@@ -244,7 +249,7 @@ namespace Content.IntegrationTests.Tests.Networking
|
|||||||
// Assert timing is still correct.
|
// Assert timing is still correct.
|
||||||
Assert.That(sGameTiming.CurTick, Is.EqualTo(new GameTick(22)));
|
Assert.That(sGameTiming.CurTick, Is.EqualTo(new GameTick(22)));
|
||||||
Assert.That(cGameTiming.CurTick, Is.EqualTo(new GameTick(24)));
|
Assert.That(cGameTiming.CurTick, Is.EqualTo(new GameTick(24)));
|
||||||
Assert.That(cGameStateManager.CurServerTick, Is.EqualTo(new GameTick(20)));
|
Assert.That(cGameTiming.LastProcessedTick, Is.EqualTo(new GameTick(20)));
|
||||||
|
|
||||||
{
|
{
|
||||||
// Send first event to disable the flag (reminder: it never got accepted by the server).
|
// Send first event to disable the flag (reminder: it never got accepted by the server).
|
||||||
@@ -359,6 +364,8 @@ namespace Content.IntegrationTests.Tests.Networking
|
|||||||
Assert.That(clientComponent.Foo, Is.True);
|
Assert.That(clientComponent.Foo, Is.True);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cfg.SetCVar(CVars.NetLogging, log);
|
||||||
await pairTracker.CleanReturnAsync();
|
await pairTracker.CleanReturnAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ namespace Content.Shared.Entry
|
|||||||
IoCManager.Resolve<MarkingManager>().Initialize();
|
IoCManager.Resolve<MarkingManager>().Initialize();
|
||||||
|
|
||||||
var configMan = IoCManager.Resolve<IConfigurationManager>();
|
var configMan = IoCManager.Resolve<IConfigurationManager>();
|
||||||
#if FULL_RELEASE
|
#if DEBUG
|
||||||
configMan.OverrideDefault(CVars.NetInterpRatio, 2);
|
|
||||||
#elif DEBUG
|
|
||||||
configMan.OverrideDefault(CVars.NetFakeLagMin, 0.075f);
|
configMan.OverrideDefault(CVars.NetFakeLagMin, 0.075f);
|
||||||
configMan.OverrideDefault(CVars.NetFakeLoss, 0.005f);
|
configMan.OverrideDefault(CVars.NetFakeLoss, 0.005f);
|
||||||
configMan.OverrideDefault(CVars.NetFakeDuplicates, 0.005f);
|
configMan.OverrideDefault(CVars.NetFakeDuplicates, 0.005f);
|
||||||
@@ -50,7 +48,6 @@ namespace Content.Shared.Entry
|
|||||||
// just leaving this disabled.
|
// just leaving this disabled.
|
||||||
// configMan.OverrideDefault(CVars.NetFakeLagRand, 0.01f);
|
// configMan.OverrideDefault(CVars.NetFakeLagRand, 0.01f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitTileDefinitions()
|
private void InitTileDefinitions()
|
||||||
|
|||||||
@@ -169,4 +169,8 @@ ui-options-function-shuttle-brake = Brake
|
|||||||
|
|
||||||
## Network menu
|
## Network menu
|
||||||
|
|
||||||
ui-options-net-interp-ratio = Network Smoothing
|
ui-options-net-interp-ratio = State buffer size
|
||||||
|
ui-options-net-interp-ratio-tooltip = Increasing this will generally make the game
|
||||||
|
more resistant to packet-loss, however in doing
|
||||||
|
so it effectively adds slightly more latency and
|
||||||
|
requires the client to predict more future ticks.
|
||||||
|
|||||||
@@ -130,7 +130,6 @@
|
|||||||
- type: Construction
|
- type: Construction
|
||||||
graph: LeverGraph
|
graph: LeverGraph
|
||||||
node: LeverNode
|
node: LeverNode
|
||||||
- type: Fixtures
|
|
||||||
- type: SignalTransmitter
|
- type: SignalTransmitter
|
||||||
outputs:
|
outputs:
|
||||||
Left: []
|
Left: []
|
||||||
|
|||||||
Reference in New Issue
Block a user