This is a Unity integration for the incredibly useful Clumsy network conditions simulation tool.
Install the package from its git URL or from a local copy.
- Create a
ClumsyConfiguration
asset using theAssets > Create > Clumsy > Configuration
menu.
- Open the Clumsy window using the
Window > Clumsy > Clumsy
menu:
- Toggle the
Enabled
button and pick (using the dropdown) theClumsyConfiguration
that you created earlier:
-
Modify the configuration according to your needs.
-
Enter Play mode. An external
clumsy.exe
window should spawn (minimized). -
If you wish to modify the configuration during Play mode, untoggle the
Enabled
button, make your modifications, and toggle it to relaunch Clumsy with the new config. -
The external window/process will be destroyed when Play mode is exited.
- Custom Installation Directory: This package comes with a bundled version of Clumsy, but you can specify another version. Although at the moment this package only works with a specific fork.
- Window Style: The external Clumsy window can be launched minimized or completely hidden.
Some projects might not be compatible with the auto-start workflow, ex if the connection ports aren't constant.
In that case the filter string can contain parameters in curly brackets, ex udp and (udp.DstPort == {port} or udp.SrcPort == {port})
.
The user can provide those arguments at runtime using the Runner.Instance.SetParameter
function call. Clumsy will automatically start once all the parameters in the filter string have been provided (this behavior is opt-out).
Additionally Clumsy can be controlled manually with the Runner.Instance.SetConfiguration
, Runner.Instance.Start
, and Runner.Instance.Stop
function calls.
The CLUMSY_LOG
scripting define symbol can help trace the flow of all the above.
In summary there's a few different ways to launch Clumsy:
- Enable
Auto Start
in the configuration: Will launch automatically when entering Play mode. - Disable
Auto Start
in the configuration: CallRunner.Instance.Start
manually. - The configuration's
Filter
contains parameters that need to be set at runtime:Runner.Instance.SetParameter
with parameterautoStart = true
: Will launch automatically once all parameters have been provided.Runner.Instance.SetParameter
with parameterautoStart = false
: CallRunner.Instance.Start
manually after providing the parameters.
A fork was necessary to apply a small patch. The patch ensures command line arguments are processed even when Clumsy launches in a minimized or hidden window.