Syncing binaries#
For larger Unreal projects where you are building the editor from source, you will need a solution for distributing your editor and game binaries. In the Perforce environment, you would normally use Unreal Game Sync from Epic Games. Anchorpoint allows you to perform a similar activity by syncing the editor binaries to the correct commit id.
The whole process is based on adding a git tag to a commit containing an editor binary. To set up this workflow, you will need to be familiar with building the Unreal Editor from source and setting up a proper build pipeline with your CI/CD system.
Note that this feature is still a work in progress.
Prerequisites#
The Unreal Engine source code from Epic Games on GitHub. You will need to get an account from the Epic Games organization.
A file sharing solution for your binaries, such as Dropbox, Google Drive or a NAS
In Anchorpoint, activate the “Unreal Binary Sync” Action under “Workspace Settings” / “Actions”
A proper build pipeline that allows you to add git tags and configure the name and location of the zip file that contains the editor binaries. Code snippets are shown below.
Setup#
1. Get the Unreal Engine source code#
Get the Unreal Engine source from GitHub and set up your project properly according to Epic’s instructions. This includes running setup.bat and generating the project files, so that you can compile and run the Unreal Editor from source.
Set up your project structure by removing the sample content and adding your game project content.
2. Create a new Anchorpoint project#
Create a new Anchorpoint project with a corresponding Git repository. Do not use the .gitignore template provided with Anchorpoint. This template is used for Unreal projects that use the editor from the Epic Games Launcher.
Once the project is created, you will need to customize the .gitignore that comes from GitHub. Add these rules at the end:
### Custom adjustments ###
# Allow everything in GitDependencies, otherwise setup.bat will not run
!/Engine/Binaries/DotNET/GitDependencies/**
# Allow the uprojectdir file
!Default.uprojectdirs
#ignore .ap folder
/.ap
# Precompiled Binary lists
extracted_binaries.txt
/Engine/Build/PrecompiledBinaries.txt
# Allow the game folder. It will use it's own .gitignore. Use your own game folder name here
!Samples/
!Samples/**
Replace “Samples” with your game folder. This rule will allow everything in your game folder. You need to use a different .gitignore that only applies to your game folder. You can use this one.
3. Commit and push your changes#
You can now commit and push your changes in Anchorpoint to your Git server.
4. Build and distribute your binaries#
Create your build using the Unreal Build Tool (UBT). Download this configuration and unzip the folder “Anchorpoint” inside YOURGAMEPROJECTFOLDER/Build
Then, open the PowerShell script MoveAndRenameWithCommit.ps1
and set the target folder, where all your ZIP files will be placed.
Example Usage
".\Engine\Build\BatchFiles\RunUAT.bat" BuildGraph -Script="Samples/Games/YOURGAMEPROJECTFOLDER/Build/Anchorpoint/Anchorpoint.xml" -Target="Upload Anchorpoint Binaries" -set:EditorTarget=LyraEditor -project="Samples/Games/Lyra/Lyra.uproject"
Make sure that you are in the Git repository. The build configuration runs two PowerShell scripts. The first TagEditorIncrement.ps1
is setting the correct Git tag to the commit, from which the binary was created. The second MoveAndRenameWithCommit.ps1
is placing the binary out of the project directory and moving and renaming it to your shared folder.
5. Sync the binaries and run your project#
Now you (or your team member who will be using the binaries) can download the binaries so that Anchorpoint can unpack them and run the Unreal editor. If you are on a different machine, you will need to join the project and download the files first.
Make sure the Unreal Engine Binary Sync action is enabled in the workspace settings. You may need to restart Anchorpoint after activating it. Then you need to open your Project Settings / Unreal. There are two types of settings. “Local Settings” need to be configured on each computer and “Shared Settings” are only configured by admins as they apply to the whole project.
Set your ZIP folder location to the folder containing all the ZIP files named with the correct commit ID.
Set a launch project that the Unreal Editor will open after a successful sync
Now apply the tag pattern. This is basically the base name of the tag. So if you have tagged your binary with “Editor-1” for example, just type in “Editor” as Anchorpoint will only look at the base name of the tag. This setting will apply to everyone in your team.
Finally, close the Project Settings and click the Sync Editor button in the left sidebar. This will trigger the sync. You may have to accept a pop-up on Windows if you have enabled the “Sync Setup Dependencies” option for installing UE prerequisites.
Debugging
If something is not working as it should, you can also enable “debug mode”, which basically prints every step, but skips the actual sync. It will e.g. check for matching commit ids in the ZIP filename and tags etc.