- Key considerations
- Implementation guidelines
- Related media
- Related repositories
Containerised microservices are an extremely popular architectural paradigm for implementing server-side applications. Unreal Engine containers allow this same architecture to be applied to microservices powered by the Unreal Engine. Infrastructure for integrating existing RPC frameworks allows developers to implement Unreal microservices using familiar technologies, while the NVIDIA Docker runtime allows Unreal microservices to perform 2D or 3D rendering with full GPU acceleration. Compatibility with container orchestration technologies means developers can deploy and scale Unreal microservices in exactly the same manner as traditional microservices.
This page only discusses topics that are specifically relevant to Unreal microservices. If you are creating microservices that perform rendering then be sure to also read the cloud rendering page and familiarise yourself with the relevant details.
Because NVIDIA Docker only works with Linux containers running under Linux host systems, microservices that perform rendering cannot run inside Windows containers. Although Windows containers can be used to run microservices that do not perform any rendering, Linux containers are still strongly recommended due to better compatibility with container orchestration technologies and easier installation of runtime dependencies using system package managers.
Any third-party C++ libraries that will be integrated with the Unreal Engine under Linux must be built against libc++ instead of libstdc++, since the Unreal Engine itself is built against its own bundled copy of libc++. Third-party libraries that rely on dependencies which are also bundled with the Unreal Engine may also encounter issues related to symbol interposition. See this article discussing the creation of the conan-ue4cli project for a detailed explanation of these issues.
Integrating an RPC framework
Note that the Web Remote Control feature introduced in Unreal Engine 4.23 only works in the Unreal Editor, not in packaged projects. This means it cannot be used as an RPC framework for deployed microservices.
Integrating RPC frameworks natively in C++
The most performant option for integrating native RPC frameworks with the Unreal Engine is to do so in C++. However, there are a number of complexities that must be addressed in order to correctly integrate third-party C++ libraries with the Unreal Engine under Linux which make manual compilation or the use of prebuilt system libraries difficult or impossible. We strongly recommend making use of infrastructure such as the conan-ue4cli project to build any third-party C++ libraries in a manner that will ensure the resulting binaries are compatible with the Unreal Engine.
Existing solutions are available for building Unreal-compatible binaries for the following native RPC frameworks:
- gRPC: developed by Google, this framework is extremely popular and has been adopted as a project of the Cloud Native Computing Foundation. gRPC provides bindings in a wide variety of languages, including C++. A recipe for building an Unreal-compatible version of the gRPC C++ bindings is bundled with the conan-ue4cli project.
Integrating RPC frameworks using other language integrations
RPC frameworks for non-native programming languages can be integrated by making use of community-maintained projects that add support for these programming languages in the Unreal Engine. Although additional complexity is introduced by the integration of another programming language, RPC frameworks written for these languages do not require special compilation to work with the Unreal Engine.
There are a number of community-maintained projects that integrate non-native programming languages with the Unreal Engine. The following list comes from the Unreal Engine For Research initiative:
UnrealEnginePython: this plugin adds runtime support for the Python programming language and provides comprehensive bindings for the Unreal Engine API. Code running through this plugin can make use of any RPC framework with Python bindings.
MonoUE: this plugin adds runtime support for the C# and F# programming languages and provides bindings for the Unreal Engine API. Code running through this plugin can make use of any RPC framework with .NET bindings. Note that this project is still under development and there are a number of features that are yet to be implemented.
Building container images for deployment
See the relevant sections from the cloud rendering page for details on selecting an appropriate base image and building your own container images for deployment.
This content is landing soon!
Be sure to check out the Unreal Containers Twitter feed for news about content updates.