Skip to main content

Research Preview

Unreal Game Sync for Diversion is a research preview and is available to selected studios only. Behaviour may change before general availability. To request access, contact support@diversion.dev.
Unreal Game Sync (UGS) is Epic’s tool for keeping a team on a known-good build of a source-built engine: pick a change, sync to it, and get editor binaries that match it without compiling. The Diversion build of UGS is the same application, connected to Diversion instead of Perforce. Your team keeps the UGS workflow it knows, and the repository, history and files live in Diversion.
If you only need to hand precompiled binaries to your team, Diversion can do that without UGS. See Binary distribution for Unreal Engine.

How UGS concepts map to Diversion

Prerequisites

Prepare the repository

Do this once per repository, on any machine, and commit the result.

Ignore the files UGS and the editor create

UGS keeps its own state in a .ugs folder at the workspace root, and the editor writes build output and caches into the project. None of it belongs in the repository. Add these rules to the .dvignore at the repository root:
The Binaries and DerivedDataCache rules cover every top-level folder except Engine. The engine folder is left to Unreal’s own .gitignore, which Diversion also reads and which keeps some engine binaries tracked on purpose. New ignore rules take effect after Diversion finishes its next scan of the workspace. On a full engine tree that can take several minutes.

Tell UGS where the precompiled binaries are

Skip this step if your team compiles the editor locally. UGS reads the location of the binaries zip from Build/UnrealGameSync.ini in your project folder. Add a section named after the project’s path in the repository:
Dev-Binaries is the default name of the branch the build machine publishes to. Keep it unless you pass a different branch to the build script, and use the same name in both places. See Publish precompiled binaries.

Open your project in UGS

1

Clone the repository with Diversion

Create the workspace with the Diversion app or dv clone, and wait for the first sync to finish. See Get an existing project.
2

Open the project file

Start UGS. In the Open Project window, select Local File, click Browse…, and choose the .uproject file inside the workspace.
3

Sync

UGS lists the commits of the workspace’s branch, newest first. Double-click a change to sync to it.
Open one workspace per UGS window. See Not available in the research preview.

Syncing

Sync

Sync moves the whole workspace to the commit you picked, forwards or backwards. Afterwards the workspace is detached from its branch, even at the latest commit. This is deliberate: Diversion moves a workspace that is on a branch forward as soon as someone commits, and files would change under UGS and the editor. Because a sync replaces the workspace’s files, UGS refuses to sync while you have uncommitted edits. The message gives the number of files and names the first five:
The full list is in the workspace’s pending changes in Diversion. Commit, shelve or reset those changes in Diversion, then sync again. Files you added and never committed are kept.

Sync (Just This Change) and Sync (Just Content)

  • Sync (Just This Change) brings only the files of that one change to their version at that change. The workspace stays at its current commit. UGS offers it for changes newer than the one you are on.
  • Sync (Just Content) syncs to the change but leaves shader source files (.usf, .ush) at their current version, so the editor binaries you already have keep working. Use it for a change that UGS shows as having no binaries yet.
In both cases the files that differ from the workspace’s commit show up in Diversion as pending changes, next to any changes of your own. Do not commit or reset them. The next full Sync to a change that includes them clears them. See What you will see in Diversion.

Sync filter

Sync Filter… in the Options menu works as in Perforce: excluded categories are removed from disk, and including a category again brings its files back. The excluded files show in Diversion as pending deletes for as long as the filter excludes them. Do not commit them. After a filter change UGS lists the whole workspace before it syncs. On a full engine tree this takes a few minutes.

Clean Workspace

Clean Workspace… in the Options menu lists files that are on disk and not in the repository, and deletes the ones you tick. Diversion’s own .diversion folder and the .ugs folder are never listed. UGS also removes folders that end up empty. If such a folder is tracked in the repository, it shows in Diversion as a pending delete until your next sync to a different change, which restores it.

What you will see in Diversion

A workspace used through UGS always shows a few pending changes that you did not make:
  • Engine/Build/Build.version, which UGS rewrites after every sync.
  • Files held back by Sync (Just This Change), Sync (Just Content) or a sync filter.
  • Empty folders removed by Clean Workspace….
Leave them as they are. When you commit your own work from this workspace, select only your own files.
Two improvements are planned. Diversion will show the changes UGS made separately from your own, so they no longer mix in the pending changes list. And you will be able to commit from the commit UGS synced you to, with Diversion resolving your changes against the branch’s latest commit.

Publish precompiled binaries

A build machine compiles the editor for a commit, zips it, and commits the zip to a dedicated branch. UGS then offers those binaries for that change and for the content-only changes after it, exactly as with Perforce. On the build machine, with the workspace on the branch you build from and no local changes:
The script compiles the editor and tools, builds Editor.zip, creates the archive branch if it does not exist, and commits the zip there with a message that tells UGS which change it was built from. -set:ArchiveStream names the archive branch. Leave it out and the script publishes to Dev-Binaries, the default. The branch in ZippedBinariesPath in UnrealGameSync.ini must be the same one. BuildEditorAndToolsWithDiversion.xml and its helper SubmitPCBToDiversion.bat come with the Diversion build of UGS. Commit both to your repository under Engine/Build/Graph/. On team machines, tick Sync Precompiled Binaries in UGS. A change that alters code and has no archive yet is greyed out until the build machine publishes one. Until then, Sync (Just Content) takes its content.

Differences from Perforce

  • A sync is refused while you have uncommitted edits. Perforce keeps files you have checked out; Diversion asks you to commit, shelve or reset first.
  • A sync waits for Diversion to finish scanning the workspace. Diversion scans after an ignore-rule change and when it starts or updates itself. On a full engine tree a sync started during a scan can take several minutes longer than usual.

Not available in the research preview

  • Creating a workspace from UGS. The New… button in the Open Project window answers:
  • Switching streams from UGS. UGS answers:
  • Shelved changes. UGS shows none.
  • Cancelling an operation that is already running. It finishes first.
  • Two projects from different workspaces in one UGS window. Open one workspace at a time.
  • Deleting a workspace from UGS only removes it from this machine’s list. The files and the workspace in Diversion stay.
If your team depends on one of these, tell us at support@diversion.dev.

Troubleshooting

UGS reports that it could not read the pending changes.
UGS checks your uncommitted changes before every sync, and stops if Diversion does not answer in time. Make sure Diversion is running and has finished syncing, then sync again. A sync stays on “Syncing” for many minutes. Diversion is scanning the workspace. The sync continues by itself when the scan ends. A change is greyed out. It changes code and no binaries have been published for it yet. Wait for the build machine, or use Sync (Just Content).