Source Control
How to navigate the different needs for source control of React Native code and Unreal Engine projects.
This section assumes some basic familiarity with different approaches to source or version control, and only aims to add some context to people familiar with one ecosystem but not as much with the other.
Depending on whether you come from a React Native or Unreal Engine background, you may be familiar with slightly different source control software.
React Native for Unreal Engine plugin
The rnue plugin is currently distributed to integraiton partners via a GitHub repository.
Typical workflows in each ecosystem
React Native only teams
React Native projects can use git for source control. A forge is a web application that hosts and manages git repositories.
git is excellent for repositories containing mostly text, and offers powerful diffing, patching and flexible branching workflows.
git handles text files well. Unreal Engine projects also contain large binary assets, which need different storage and locking workflows.
git-lfs stores large binary files outside the main git object store. Teams must add separate tools when they need locking or media review.
Unreal Engine only teams
In the gaming and 3D world one of the primary requirements from source control software is the ability to handle binary file workflows.
Unreal Engine projects contain binary assets such as images, materials, and Blueprints. These assets need suitable storage, locking, and review workflows.
Do what is right for your team
The following advice by no means the only way to do this and doesn not presume to be perscriptive for your team. Do your own research and choose the way that you and your team are comfortable with.
Working with both React Native & Unreal Engine
With the above tendencies in mind we can define the challenges and constraints of a workflow that combines team members and software from both ecosystems:
rnuewill come from agitrepository- The native portion of your React Native code that interfaces with C++ code in Unreal Engine will likely feel most at home in a
gitrepository - Your Unreal Engine team will likely prefer to work with a well established source control software that supports workflows for binary content
Tip: Stay idiomatic, and work with the tools that make sense for each part of your ecosystem
Use git for JavaScript and a binary-friendly source control software for your Unreal Engine project
Should we attempt automatic synchronization?
Though most of the game source control software offer some sort of git sync capability, it is often gated behind an enterprise license or does not work reliably.
The options that work well are:
- Create a series of explicit scripts written in either Bash/PowerShell or a scripting language like Python that pull changes from
git, only storing a version tag. The downside of this method is that it requires some additional orchestration when the time comes to create CI/CD workflows. The upside of this method is that nobody can ever accidentally modify the native modules andrnueplugin, eroding the notion of a single source of truth in the project. - Store a copy of the
rnueUnreal plugin and the various native modules that bridge JavaScript and C++ in the same repository the game is using, and manually reconcile divergences fromgit. The downside is that it can create unnecessary conflicts if team members edit in both places. The upside is that it skips the need for additional steps during CI/CD and release workflows
This guide uses the first option because it keeps git as the source of truth.
Tip: Keep things simple, conflict-free and maintain a single source of truth
Do not attempt to automatically sync the two source control repositories. Do not attempt to duplicate the content. Rather, treat git as a source of truth for all things rnue and create scripts to clone and pull latest changes during local development, CI/CD and release workflows.
A typical workflow therefore is:
Sync your game from the remote repository to your local environment
At this stage it will still be missing some files.
Run the various sync scripts to fetch rnue plugin, and the various native modules
It is an intuitive workflow for an Unreal Engine project because you would likely be running scripts like Setup.bat (or Setup.sh) if you're working with an Unreal Engine from-source build.
Whenever prompted by an update upstream, repeat previous step
This keeps things simple and makes git the single source of truth for all things rnue, preventing conflicts where a team member accidentally commited code into the Unreal project that could be overwritten by conflicting updates from upstream.