NetworkSimulation

Options
Morton
edited August 2011 in DotNet
Hi guys!
I'm testing the possibilities of usage of Photon MMO for our project for sometime and i must say that it's great solution!
But now i am struck in a small problem.
Trying to simulate bad network quality i've tried to modify Peer's Network Simulation Settings. For example:

public PhotonPeer(IPhotonPeerListener listener, bool useTcp)
: base(listener, useTcp)
{
this.ChannelCount = Settings.ChannelCount;
//!!!!!
NetworkSimulationSettings.IncomingLossPercentage = 50; //Yep, that's a REALLY bad network! :)
NetworkSimulationSettings.IncomingJitter= 10;
NetworkSimulationSettings.OutgoingJitter = 10;
NetworkSimulationSettings.OutgoingLossPercentage = 50;
NetworkSimulationSettings.IncomingLag = 500;
NetworkSimulationSettings.OutgoingLag = 500;
NetworkSimulationSettings.IsSimulationEnabled = true;
}
Stopping on a breakpoint durning application run shows that every setting is still set and active.
But it seems like these settings have no effect at all. Even if i set LossPercentages to 100 everything (ops/events) still works perfectly! o_O
Is there any other way to simulate network errors without physical damage of our wires? %)
P.S. Excuse me my bad english please :)

Comments

  • Tobias
    Options
    It looks like everything is correctly setup. The simulation is enabled, too.
    You use UDP?
    And the dll from the "Debug" folder (the "Release" lib does not have Network Simulation)?

    Are you sure you don't notice any difference? It's more or less just additional lag: In UDP, we will repeat reliable commands if needed, so a high loss causes more random lag, too. Or (depending on timing) it might cause disconnects. But you have no effect?

    Which client library version are you using?
  • PhotonDotNet.dll version is 6.3.1.0 (From PSS SDK 2.6.0)

    Yep it is from Debug folder (in fact i run client App under the studio debugging :) )
    I use tcp and udp (position events and commands - through udp peer and radar/diagnostics peer is tcp)

    Well... I think that setting LossPercentage =100 in that case will cease all communications between Clients and Server. Because all packets should be lost. But indeed it seems like all commands come to server without any significant delay.

    And i've set IncomingLag and Outgoinglag to 5000, set two breakpoints (In client - just before game.Peer.OpCustom and in server - onOperationRequest) and it looks like operation being sent from client arrives to server onOperation processor not after 5 seconds delay but immediately.
  • Tobias
    Options
    I just opened that SDK, modified the Realtime Demo in it and got the expected delay.
    It must be something in your code, which I can't see.

    Please verify with the Game.cs from the SDKs Realtime Demo. At line 294, add this:
    this.peer.NetworkSimulationSettings.IsSimulationEnabled = true;
    this.peer.NetworkSimulationSettings.OutgoingLag = 1000;

    Start and watch the RTT. There is even the expected delay for connecting.
    I'm not sure where your code fails.
  • Thanks a lot, Tobias. Hope i'll find where the bug is.
  • Tobias
    Options
    Another customer had a similar issue with Unity Client Lib v6.4.0. After an update to v6.4.3, this worked.
    The simulation should work in the latest client library. I hope you updated already and it's not an issue anymore.