Unreal + AWS + VR

Daniel Sanchez
UNC Blue Sky Innovations
5 min readApr 22, 2020

Introduction

AWS has fundamentally changed the way that software is developed. It provides instant access to an incredible amount of computing services each with almost infinite scale, but this post is not about how amazing AWS is on its own. This post is about how pairing AWS with another great piece of software can expand the range of applications developers can make.

The Unreal Engine is an incredible tool that can be used to make things from huge AAA games (Fortnite) to architectural visualization to VR experiences. Combining the capabilities of Unreal and AWS opens the door to making incredibly cool experiences, but currently, there is only a tiny amount of AWS services that can be utilized from Unreal.

At the Reese Innovation Lab, we use the Unreal Engine to create VR experiences for the Oculus Go and Quest that help expand the classroom in higher education. This inability to completely integrate with AWS became a problem for us as we began planning to scale our educational VR experience, so we created our own way of quickly integrating AWS services into Unreal that we think can be beneficial to the whole Unreal development community.

This post will give a more in depth explanation of how to use our AWS plugin generation tool to integrate AWS services in your own Unreal project. Currently, the plugins that you create will work for Windows and Android (works on both Oculus Quest and Go), but the project is open source so if anyone wants to contribute to make it accessible on other platforms or expand it in any way please feel free to contribute!

The Problem

Most people are first introduced to AWS through the web interface, but they eventually transition to interacting with the services through a combination of the command line tool and software development kits (sdks). AWS offers sdks in a wide range of languages with the most popular being JavaScript and Python. These popular languages allow developers to quickly import the sdk and begin communicating with AWS services. Ideally, an Unreal developer should have the same ease of access to AWS service as developers working in Python or JavaScript.

The Starting Point

The Unreal Engine runs on C++ because of its high performance capabilities, and after a quick google search, you can find that AWS released an open source C++ sdk in 2015. Great! If there is an sdk in the language that Unreal runs on then it should be as simple to use as the more sdks for the most popular languages. The problem is that unlike Python and JavaScript, C++ is compiled language meaning the source code must be compiled before it can be used as an external library.

Compiling the AWS C++ sdk is not what we want to focus on in this blog as that will require its own entire blog post (which will be coming in the near future). To help developers avoid time wasted on compiling the library we have compiled the entire sdk for Windows and Android and hosted the files publicly, and our tool helps with downloading the files that you want.

Once we have access to the compiled versions of the AWS sdks, the next step is to link these compiled sdks to our Unreal projects. We will be using Unreal’s plugin system, which allows developers to create reusable code for different projects. A plugin consists of one or more modules that represent a build-able set of code for the engine. Our tool will help you create the plugin and subsequent modules for the AWS sdks that you want.

Design Choices

It is an infeasible solution to link the entire compiled AWS sdk in a single Unreal Project because the sdk is too large and most people only need a few of the services for each project. To overcome this issue, we made a design decision that each individual AWS sdk should be wrapped in a thin Unreal module that does not contain any additional code that are called Third Party (TP) Modules. Then other modules that want to access that sdk will link to the TP module. Modules that depend on the TP modules are called client modules and are where you can do things like write business logic that depends on AWS or write functions that expose the sdks to blueprints.

Example creation of a plugin

We will now go through the steps for creating an AWS plugin that has the S3 and SQS sdks linked using our AWS plugin generation tool.

0. Make sure you have python 3.7+ on your path so you can run the script from the command line

  1. Clone the plugin generator repo and install the requirements with
pip install -r requirements.txt

2. Run

python Script/plugin-generator.py make-plugin

If it is your first time making a plugin you will need to set some settings:

Binaries Directory: Where the downloaded compiled binaries will live on your file systemOutput Directory: Where the final plugin with be outputted to

3. Provide the name of your plugin and a brief description

4. Provide the information for a client module

5. Do the same but for the SQS client module

6. After all the files have been generated, check in your output directory for the plugin

7. Copy the generated plugin to the plugin folder in your Unreal Project (Note your project must be already be a C++ project and can not be blueprints only)

Next Steps

If you do not need to expose your functionality to blueprints, you should be in a good place to start using the AWS provided documentation to connect your game to AWS. If you want to expose AWS calls to blueprints, you can continue the next blog post to see some implementation patterns that help expose the functionality to blueprints.

--

--