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 organisation.
A file sharing solution for your binaries, such as Dropbox, Google Drive or a NAS
In Anchorpoint, import the Unreal Engine Binary Sync Action and enable it. You can access it from GitHub
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.
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 to Anchorpoint. To speed things up, you can disable the automatic binary detection check in “Project settings / Git” -> “Automatically track binaries as LFS files”.
This check will automatically generate a .gitattributes files, so that all binary files are pushed as LFS. For an initial commit with almost 200k of files this can take some time. You can use this .gitattributes file and disable the check. Once your initial commit is pushed, it’s recommended to enable this check again.
4. Build and distribute your binaries#
Create your build using the Unreal Build Tool (UBT). Use -Target="Submit To Perforce For UGS"
as the build target.
Once the build is complete, you need to put the ZIP file created by UBT into your shared folder on Dropbox or similar. Rename the zip file and use the commit id as the filename. You will end up with something like 6a04ac10c60ed51f192731119d3249c9911b6324.zip
Now you need to add a git tag to your commit, so that Anchorpoint knows that this commit has an editor binary attached. Git tags must be unique, so you cannot just add the tag “editor” to every commit. Combine a base tag name with an incremental number, such as “Editor-1”, “Editor-2” and “Editor-3”, and so on.
Here is an example bash script, that gets the latest tag and creates a new one on a dedicated commit (the one from which you build the binaries) with an incremented editor number.
latest_tag=$(git tag --list 'Editor-*' --sort=-v:refname | head -n 1)
number=$(echo "$latest_tag" | grep -o '[0-9]\+$')
new_tag="Editor-$((number + 1))"
git tag "$new_tag" <commit-hash>
Finally, you need to push your added tag using `git push origin –tags’.
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.
Make sure “Sync Setup Dependencies” is checked if you are on a different machine. This does essentially the same thing as running setup.bat and installing all the Git dependencies. You can disable this after the first sync.
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.