Simulate Lag/Packet loss for debug purposes

Hello everyone,

I recently discovered this networking engine on Reddit and started exploring and experimenting with it.
While testing, I couldn’t find any way to debug latency or packet loss. In NGO, it’s possible to debug these settings under the Unity Transport component — are there any similar options available here?
I searched in the documentation but couldn’t find anything.

I also have one last question to make sure I understood correctly:
I want to create a 2D game where 2–4 players fight inside an arena. Based on your documentation, it seems that the best approach would be to use server authority with input queues and client-side prediction to prevent cheating. Is that correct?
Additionally, would it be possible to initially build the game without server authority to reduce complexity, and implement it later? Or would that create too much trouble down the line?

Thank you for creating this network engine — it looks really promising!

Hi and welcome!

For the purposes of debugging your current conditions, we have a profiler in the built-in Unity profiler that’ll show you a bunch of debugging info regarding coherence on the network:

From the SDK, you can also check out Client.Ping, e.g.

        CoherenceBridge bridge;
        if (CoherenceBridgeStore.TryGetBridge(gameObject.scene, out bridge))
        {
            Debug.Log(bridge.Client.Ping.ToString());
        }

If you’d like to change your network conditions to different scenarios, a tool we use internally is Clumsy: clumsy, an utility for simulating broken network for Windows Vista / Windows 7 and above

Regarding server authority to prevent cheating - you have it correct. You are also correct that you’ll find it much easier to develop and iterate your game without setting up server authority and input queues. It’s always recommended during early dev of your game to implement it without a simulator/input queues to prove out your game design. The great thing about coherence is that we are built from the ground up to support dynamic authority, so as you decide that you truly need server authority it is much more straightforward to refactor in that direction. I won’t lie and say it will be easy but we provide all the necessary tooling in the SDK to make this change as you decide you need it.

Thank you for the tips! Anyway, I was referring to something to change network conditions, like Clumsy, but directly within the editor (maybe through a specific component or from the bridge component?).
Is there any plan to add something like this? For now, I’ll use Clumsy and create a first version/prototype without server authority.

1 Like

We don’t currently have plans for a feature like this but I’l make a note of the request

There is an undocumented option that you can try:

void DebugSetNetworkCondition(Condition condition);

Is accessible from the bridge.Client. There are some settings in the Condition class that might be what you’re looking for. No promises that this option persists across versions though. Drop values are % from 0 -1

1 Like

I tried it and it’s working well, thank you.
I think it should be documented because it could be useful to debug gameplay with bad network conditions.

1 Like