Set up Visual Studio

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.

  1. In VS, right-click on your project name and select Properties.
    In the left column, select Debugging.
  1. Inside Command Arguments you see the following:
    "$(SolutionDir)$(ProjectName).uproject" -skipCompile

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.

  • Remove -skipCompile
  • Specify a URL for a game client or a MapName for a server-worker instance. This must immediately follow the executable name. For example: "$(SolutionDir)$(ProjectName).uproject"
  • Specify a mode for the Editor; -game for a game client, -server for a server-worker instance.
  • Specify the server-worker type or game client. For example:

Game client: -workerType UnrealClient
Server worker: -workerType UnrealWorker

  1. Now you can debug from VS. Full command arguments will look something like this:

Client: "$(SolutionDir)$(ProjectName).uproject" -game -workerType UnrealClient
Server: "$(SolutionDir)$(ProjectName).uproject" MapName -server -workerType UnrealWorker

  • To output logs to an external console window as well as the Visual Studio output window, add -log to your arguments.
  • To add any additional arguments, see Unreal documentation.

2019-07-19: Page added with editorial review

Updated about a year ago

Set up Visual Studio

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.