Skip to content

Commit 794f059

Browse files
authored
Merge branch 'develop' into chore/expose-websockets
2 parents 43e0985 + f34ded4 commit 794f059

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Additional documentation and release notes are available at [Multiplayer Documen
99

1010
## [Unreleased]
1111

12+
### Changed
13+
14+
- The debug simulator in `UnityTransport` is now non-deterministic. Its random number generator used to be seeded with a constant value, leading to the same pattern of packet drops, delays, and jitter in every run. (#2196)
15+
1216
### Fixed
1317

1418
- Fixed ILPP `TypeLoadException` on WebGL on MacOS Editor and potentially other platforms. (#2199)

com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public struct SimulatorParameters
349349
PacketDropRate = 0
350350
};
351351

352-
internal uint DebugSimulatorRandomSeed { get; set; } = 0;
352+
internal uint? DebugSimulatorRandomSeed { get; set; } = null;
353353

354354
private struct PacketLossCache
355355
{
@@ -1337,7 +1337,7 @@ private void ConfigureSimulator()
13371337
packetDelayMs: DebugSimulator.PacketDelayMS,
13381338
packetJitterMs: DebugSimulator.PacketJitterMS,
13391339
packetDropPercentage: DebugSimulator.PacketDropRate,
1340-
randomSeed: DebugSimulatorRandomSeed
1340+
randomSeed: DebugSimulatorRandomSeed ?? (uint)System.Diagnostics.Stopwatch.GetTimestamp()
13411341
#if UTP_TRANSPORT_2_0_ABOVE
13421342
, mode: ApplyMode.AllPackets
13431343
#endif

0 commit comments

Comments
 (0)