To debug workers from Visual Studio, you need to set up the commands in VS to start up a local SpatialOS deployment in Unreal Editor for you, running in the background. Once you have set this up, you can run server-workers and game clients direct from Visual Studio, without switching to the Editor.
To debug a game client, you must also set up your project to auto-start a server-worker type in a local deployment, this is so the game client has a server-worker instance to compute the server side of the game. For guidance on this, see the Auto-start server-workers.
- In VS, right-click on your project name and select Properties.
In the left column, select Debugging.
- Inside Command Arguments you see the following:
Here, you need to add extra arguments that the local SpatialOS Runtime uses when you launch your server-worker instance or game client in a local deployment.
- Specify a URL for a game client or a MapName for a server-worker instance. This must immediately follow the executable name. For example:
- Specify a mode for the Editor;
-gamefor a game client,
-serverfor a server-worker instance.
- Specify the server-worker type or game client. For example:
- Now you can debug from VS. Full command arguments will look something like this:
"$(SolutionDir)$(ProjectName).uproject" 127.0.0.1 -game -workerType UnrealClient
"$(SolutionDir)$(ProjectName).uproject" MapName -server -workerType UnrealWorker
- To output logs to an external console window as well as the Visual Studio output window, add
-logto your arguments.
- To add any additional arguments, see Unreal documentation.
2019-07-19: Page added with editorial review
Updated about a year ago