Update Unreal 5 Template authored by David Gilbert's avatar David Gilbert
**Table of Contents** **Table of Contents**
[[_TOC_]] [[_TOC_]]
## Overview ## Overview
Here is explained how to add our template to Unreal Engine and how to use it. Here is explained how to add our template to Unreal Engine and how to use it.
- VR Group Unreal Template: [Link](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/unrealprojecttemplate) - VR Group Unreal Template: [Link](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/unrealprojecttemplate)
- RWTH VR Toolkit Plugin: [Link](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit) - RWTH VR Toolkit Plugin: [Link](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit)
- RWTH VR Cluster Plugin: [Link](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-cluster-plugin) - RWTH VR Cluster Plugin: [Link](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-cluster-plugin)
- RWTH VR DTrack Plugin ([fork of ART](https://github.com/ar-tracking/UnrealDTrackPlugin)): [Link](https://github.com/VRGroupRWTH/UnrealDTrackPlugin) - RWTH VR DTrack Plugin ([fork of ART](https://github.com/ar-tracking/UnrealDTrackPlugin)): [Link](https://github.com/VRGroupRWTH/UnrealDTrackPlugin)
## Adding the Template to Unreal Engine ## Adding the Template to Unreal Engine
Just clone the [template repository](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/unrealprojecttemplate) to the `Templates` folder of your Unreal Engine installation. Just clone the [template repository](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/unrealprojecttemplate) to the `Templates` folder of your Unreal Engine installation.
```bash ```bash
# go to your local Unreal Engines' templates directory # go to your local Unreal Engines' templates directory
# (e.g. C:/Unreal/UE_5.3/Templates) # (e.g. C:/Unreal/UE_5.3/Templates)
cd your/UnrealEngine/Templates cd your/UnrealEngine/Templates
# clone branch according to your Unreal version (here 5.3) # clone branch according to your Unreal version (here 5.3)
git clone -b 5.3 https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/unrealprojecttemplate.git git clone -b 5.3 https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/unrealprojecttemplate.git
``` ```
There are also [official docs](https://docs.unrealengine.com/5.3/en-US/converting-a-project-to-an-unreal-engine-template) for adding a project as a template. There are also [official docs](https://docs.unrealengine.com/5.3/en-US/converting-a-project-to-an-unreal-engine-template) for adding a project as a template.
## Creating a new Project ## Creating a new Project
When [creating a new Project](https://docs.unrealengine.com/5.3/en-US/creating-a-new-project-in-unreal-engine/) using Unreal you can find the template under `New Project -> C++ -> RWTH-VR`. When [creating a new Project](https://docs.unrealengine.com/5.3/en-US/creating-a-new-project-in-unreal-engine/) using Unreal you can find the template under `New Project -> C++ -> RWTH-VR`.
Then you should: Then you should:
1. Add plugins 1. Add plugins
2. Change the remote to your personal repository 2. Change the remote to your personal repository
3. *Optional:* Create/Remove branches 3. *Optional:* Create/Remove branches
4. Push to your personal repository 4. Push to your personal repository
## Adding Plugins to a Project ## Adding Plugins to a Project
A plugin is simply saved in the `Project_Folder/Plugins/` folder. This can be either done via copy or by adding a git submodule. A plugin is simply saved in the `Project_Folder/Plugins/` folder. This can be either done via copy or by adding a git submodule.
As git submodules offer much more versatility (update the Plugin, change branches, ...) and are therefore preferred. See below for an example. As git submodules offer much more versatility (update the Plugin, change branches, ...) and are therefore preferred. See below for an example.
```bash ```bash
# Go to your project folder # Go to your project folder
cd my/project cd my/project
# Add the rwth-vr-toolkit plugin as git submodule # Add the rwth-vr-toolkit plugin as git submodule
# (here the dev/5.3 branch is used, adapt to your unreal version) # (here the dev/5.3 branch is used, adapt to your unreal version)
git submodule add -b dev/5.3 https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit.git ./Plugins/rwth-vr-toolkit git submodule add -b dev/5.3 https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit.git ./Plugins/rwth-vr-toolkit
# Add the rwth-vr-cluster-plugin as git submodule # Add the rwth-vr-cluster-plugin as git submodule
# (here the dev/5.3 branch is used, adapt to your unreal version) # (here the dev/5.3 branch is used, adapt to your unreal version)
git submodule add -b dev/5.3 https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-cluster-plugin.git ./Plugins/rwth-vr-cluster-plugin git submodule add -b dev/5.3 https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-cluster-plugin.git ./Plugins/rwth-vr-cluster-plugin
# Add the dtrack plugin as git submodule # Add the dtrack plugin as git submodule
git submodule add https://github.com/VRGroupRWTH/UnrealDTrackPlugin.git ./Plugins/DTrack git submodule add https://github.com/VRGroupRWTH/UnrealDTrackPlugin.git ./Plugins/DTrack
# If you want to remove a plugin added as submodule: # If you want to remove a plugin added as submodule:
# git rm ./Plugins/Stupid_Plugin # git rm ./Plugins/Stupid_Plugin
# (add --force if it doesn't work without) # (add --force if it doesn't work without)
``` ```
#### Necessary Plugins #### Necessary Plugins
- [RWTH VR Toolkit Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit) - [RWTH VR Toolkit Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit)
- [RWTH VR Cluster Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-cluster-plugin) - [RWTH VR Cluster Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-cluster-plugin) (For CAVE Usage only)
- [DTrack Plugin](https://github.com/VRGroupRWTH/UnrealDTrackPlugin) - [DTrack Plugin](https://github.com/VRGroupRWTH/UnrealDTrackPlugin) (For CAVE Usage only)
#### Some additional plugins (non-exclusive) #### Some additional plugins (non-exclusive)
- [Unreal Study Framework Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/unreal-study-framework) - [Unreal Study Framework Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/unreal-study-framework)
- [Universal Logging Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/universallogging) - [Universal Logging Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/universallogging)
- [Unreal VA Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/unreal-va-plugin) - [Unreal VA Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/unreal-va-plugin)
- [Character Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/character-plugin) - [Character Plugin](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/character-plugin)
## Update Repository ## Update Repository
The created project still points to the [template repository](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/unrealprojecttemplate). The created project still points to the [template repository](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/unrealprojecttemplate).
Thus, you now need to configure git to point at your personal repository for this project and push it. Thus, you now need to configure git to point at your personal repository for this project and push it.
Additionally you can configure more, e.g. which branches to create or delete before pushing. Additionally you can configure more, e.g. which branches to create or delete before pushing.
```bash ```bash
# Setup new remote # Setup new remote
# ---------------- # ----------------
# rename origin remote to template origin # rename origin remote to template origin
git remote rename origin template_origin git remote rename origin template_origin
# add new remote pointing to your repository # add new remote pointing to your repository
git remote add origin https://git-ce.rwth-aachen.de/OWNER/REPOSITORY.git git remote add origin https://git-ce.rwth-aachen.de/OWNER/REPOSITORY.git
# Optional: Create/Delete Branches # Optional: Create/Delete Branches
# -------------------------------- # --------------------------------
# Checkout to develop # Checkout to develop
git checkout -b develop git checkout -b develop
# List all branches (locally) # List all branches (locally)
git branch git branch
# Delete any branch you want (locally) # Delete any branch you want (locally)
git branch --delete [branchname] git branch --delete [branchname]
# Push to Repository # Push to Repository
# ------------------ # ------------------
git push -u origin --all git push -u origin --all
git push -u origin --tags git push -u origin --tags
``` ```
### Potential Fixes ### Potential Fixes
If LFS makes some problems, try below commands. If LFS makes some problems, try below commands.
```bash ```bash
git lfs install # Needs only to be done once per machine git lfs install # Needs only to be done once per machine
git lfs fetch --all origin # Download LFS content git lfs fetch --all origin # Download LFS content
``` ```
If git is annoyed about your upstream, you may try this command. If git is annoyed about your upstream, you may try this command.
```bash ```bash
# Fix potential upstream annoyance # Fix potential upstream annoyance
git branch --unset-upstream git branch --unset-upstream
git push --set-upstream origin develop # Assuming you have the develop branch checked out locally git push --set-upstream origin develop # Assuming you have the develop branch checked out locally
``` ```
## Open your Project ## Open your Project
There are [multiple ways](https://docs.unrealengine.com/5.3/en-US/opening-an-existing-unreal-engine-project/) how to open/start your fresh project. There are [multiple ways](https://docs.unrealengine.com/5.3/en-US/opening-an-existing-unreal-engine-project/) how to open/start your fresh project.
#### Open directly with Editor #### Open directly with Editor
Just double click the `(ProjectName).uproject` file in your project folder. Just double click the `(ProjectName).uproject` file in your project folder.
#### Open with IDE #### Open with IDE
For this you first need to generate a VS Solution file (`.sln`). For this you first need to generate a VS Solution file (`.sln`).
Rightclick the `(ProjectName).uproject` file in your project folder and click on `Generate Project Files`. Rightclick the `(ProjectName).uproject` file in your project folder and click on `Generate Project Files`.
Afterwars use [Visual Studio](https://visualstudio.microsoft.com/de/) or [Rider](https://www.jetbrains.com/de-de/rider/) to open the `(ProjectName).sln` file. Rider is an IDE tailored for Unreal development and [is free for students](https://www.jetbrains.com/de-de/community/education/#students). Afterwars use [Visual Studio](https://visualstudio.microsoft.com/de/) or [Rider](https://www.jetbrains.com/de-de/rider/) to open the `(ProjectName).sln` file. Rider is an IDE tailored for Unreal development and [is free for students](https://www.jetbrains.com/de-de/community/education/#students).
If this does not work, make sure you installed all Visual Studio packages as listed [in the official docs](https://docs.unrealengine.com/5.3/en-US/setting-up-visual-studio-development-environment-for-cplusplus-projects-in-unreal-engine/#newvisualstudioinstallation) If this does not work, make sure you installed all Visual Studio packages as listed [in the official docs](https://docs.unrealengine.com/5.3/en-US/setting-up-visual-studio-development-environment-for-cplusplus-projects-in-unreal-engine/#newvisualstudioinstallation)
### Configure Project ### Configure Project
When opening the project the first time, it will probably need to rebuild dependencies. Everything should then work out-of-the-box. When opening the project the first time, it will probably need to rebuild dependencies. Everything should then work out-of-the-box.
Nevertheless, some things you should look out for: Nevertheless, some things you should look out for:
- `Edit -> Project Settings -> Project -> Maps & Modes` - `Edit -> Project Settings -> Project -> Maps & Modes`
- `Default GameMode: RWTHVRGameMode` (unless you know what you're doing) - `Default GameMode: RWTHVRGameMode` (unless you know what you're doing)
- `Editor Startup Map: YourMap` (choose the Level you want to open per default in editor) - `Editor Startup Map: YourMap` (choose the Level you want to open per default in editor)
- `Game Default Map: YourMap` (choose the Level you want to open per default in build) - `Game Default Map: YourMap` (choose the Level you want to open per default in build)
- To show the content of the RWTH VR Toolkit in the [Content Browser](https://docs.unrealengine.com/5.3/en-US/content-browser-in-unreal-engine/), hit `Settings` on the Content Browser and check `Show Plugin Content`. - To show the content of the RWTH VR Toolkit in the [Content Browser](https://docs.unrealengine.com/5.3/en-US/content-browser-in-unreal-engine/), hit `Settings` on the Content Browser and check `Show Plugin Content`.
#### Preparing CAVE applications #### Preparing CAVE applications
If you want to deploy applications on CAVE, Vulkan is used as a renderer (due to Linux). If you want to deploy applications on CAVE, Vulkan is used as a renderer (due to Linux).
As the image and stability may very between DirectX and Vulkan, it is advised to equalize your Windows setup to the CAVE (Linux) Setup. As the image and stability may very between DirectX and Vulkan, it is advised to equalize your Windows setup to the CAVE (Linux) Setup.
Below, we also adjust the Vulkan shader model to support SM6. This may introduce instability, but offers more up-to-date shader functions. Below, we also adjust the Vulkan shader model to support SM6. This may introduce instability, but offers more up-to-date shader functions.
Check the Shader format for Linux in `Edit -> Project Settings -> Plattforms -> Linux` first: Check the Shader format for Linux in `Edit -> Project Settings -> Plattforms -> Linux` first:
- Targeted RHIs - Targeted RHIs
- Check Vulkan Desktop (SM6) :heavy_check_mark: - Check Vulkan Desktop (SM6) :heavy_check_mark:
Then check the Shader format for Windows in `Plattforms -> Windows` to match: Then check the Shader format for Windows in `Plattforms -> Windows` to match:
- D3D12 Targeted Shader Formats - D3D12 Targeted Shader Formats
- Check SM6 :heavy_check_mark: - Check SM6 :heavy_check_mark:
- Uncheck everything else :x: - Uncheck everything else :x:
- D3D11 Targeted Shader Formats - D3D11 Targeted Shader Formats
- Uncheck everything :x: - Uncheck everything :x:
- Vulkan Targeted Shader Format - Vulkan Targeted Shader Format
- Check SM6 :heavy_check_mark: - Check SM6 :heavy_check_mark:
- Targeted RHIs: Vulkan - Targeted RHIs: Vulkan
If development becomes unstable under Windows, switch back to D3D12. If development becomes unstable under Windows, switch back to D3D12.
#### Preparing HMD applications #### Preparing HMD applications
As HMD apps are most probably running on Windows, you can adjust the settings in `Edit -> Project Settings -> Plattforms -> Windows` as you like. As HMD apps are most probably running on Windows, you can adjust the settings in `Edit -> Project Settings -> Plattforms -> Windows` as you like.
\ No newline at end of file