Support Thread: Oculus VR Production for Unreal Engine

Happy to!

I did finish the course and I highly recommend it despite the hiccups.

That said, it wasn’t simple, and my decision to try and go a Quest 2/App Lab route that did not exist when the course was created added some complexity to getting through this. Not the course’s fault of course, all of this is hitting a moving target, but maybe someone will read this and there can be an update for Quest 2/App Lab considerations.

In the end, I was able to get a functional and 72fps performant version to Rift, and a Quest version to App Lab that, while not performant (50fps), is proof of concept.

I was able to do the project in 4.26.2 and also I downloaded the 4.24 OculusVRDartsGame project from Epic (as well as DartsAssets), which I had side by side with my own Darts project in a second instance. I wouldn’t have been able to complete this otherwise.

Here are my notes (repeating some stuff from above) in one place broken out by section. I hope this is helpful to people beginning with that course, and again, I’m really new to this and none of this is “official”.

Prepare Unreal for VR Dev/Identify Graphics & Rendering Considerations for VR

These two sections were fine, but if you do make it through the course I recommend coming back to Rendering Materials and VR Considerations once you start looking into analyzing performance

Understand & Implement Locomotion & Ergonomics

This is where I first ran into the Guardian issues, where I wasn’t able to see the Guardian Debug View and was getting the “Warning: Oculus: Failed Oculus login” message. The latter turned out to be because I had not done the Data Use Checkup.

Once I resolved that issue, I still wasn’t able to see the Guardian Debug View, and was not able to confirm “Is Guardian Configured”. Only much later in the tutorial (PSO Cache System), when I learned how to launch the app to my headset, did I see the Debug View (when in Dev build). So it works, it just won’t work from running it through VR Preview AFAIK.

Another thing to mention on the subject of Entitlement and AppID, is that if you are like me you were eager to build this as a Quest App Lab instead of Rift in order to be able to be able to share it to someone someday. This added challenges, but I succeeded (though, as I said, it is not performant). Do not necessarily treat this DefaultEngine.ini step as best practice for reasons that I’ll go more into later:

I made two Apps, one Rift and one Quest, so that I could edit the DefaultEngine.ini and AndroidEndgine.ini as quickly as needed for A/B testing whenever I got errors.

In the end, my final DefaultEngine.ini looks like:

[OnlineSubsystem]
DefaultPlatformService=Oculus
[OnlineSubsystemOculus]
bEnabled=true
OculusAppId=[my Quest App ID]
RiftAppId=[My Rift App ID]

The reason they were not both the same ID is because of an error message I got much later in the tutorial, when I was using the Oculus Platform Tool.

Capture3

Incorporate Handpresence & Interaction

Capture4

I added “Oculus VR Assets Only” directly to my Darts project from Epic Store, but was worried when I was not seeing everything I saw in the Darts project the instructor was working from. So when he referred to something I didn’t have (like the C2 Lobby), I would migrate it from the OculusVRDartsGame project without overwriting anything.

Capture8

This worked out ok, but I saw compilation errors that would alarm any newbie like myself, but should this happen to you, don’t worry, it doesn’t affect anything in this section. I think it entirely UMG stuff addressed in the next section.

The most challenging thing to debug in this section was in “Grabbing Objects”, where, as opposed to in the OculusVRDartsGame project, I needed to add both the PickUp Actor and Pickup Actor Darts Interface to the BP_Darts class setting. I still have no idea why this must be done differently than in OculusVRDartsGame.

Implement UI with Unreal Motion Graphics

Here is where the compilation errors I got when I imported assets come more into play.
Capture6Capture7

For these, I just located and ruthlessly stripped out any blueprint logic that generated errors because they are going to explain how to build everything.

I also feel like there were often, if not bugs, incomplete blueprints in both the OculusVRDartsGame/Darts Assets that were usually as simple as fixing some missing connection, a wrong datatype, or various references in dropdown slots. Almost(!) as if they wanted you to actually go through and understand the logic (or maybe these were somehow migration errors).

An example of this type of thing was in the Determine Quadrant function of BP_Dartboard, where my version the connection to “Set” from Determine Quadrant of Hit was just not there, and I needed to set it myself even though it was not mentioned in the course.

Another example of this was when the tutorial had me create this (which did not work):

While both the OculusVRDartsGame and the provided Darts Assets Only has this (which did work):
Capture11

So yes, I need to revisit the missing Bonuses functionality, but as I am just learning Blueprints, it was a little weird that OculusVRDartsGame doesn’t actually demonstrate it working.

Capture9

One thing I learned when creating the UI_CoreButtonPressed function in BPP_Pawn_Darts is to make sure the “Button Action” and “Variable” variables created here are of the same data type as the similarly named Enumeration in Dev. I think I was unable to create the variables the tutorial wanted because I was naming them the name of existing variables, and had not yet set the data type, and this led to some issues.

Demonstrate Level Load Optimization

This section was fine until I got to PSO Cache System, and, again, being very new to this, I did not even know the Quest 2 is Android OS (which I have never worked with before) so I spent a lot of time learning about Android and Launching to Quest.

In addition to what was in the course, this particular videowas very helpful:
https://www.youtube.com/watch?v=0tzrsEm6V9Q

then this boilerplate project helped me as proof of concept that I could get something onto the Quest 2:
[FREE]Oculus Quest Starter - a boilerplate project with environment setup tutorial

Additional learnings:

  • only use Android version 3.5.3
  • if you run the setupandoid.bat, it should have set your computers environmental variables for the SDK, NDK and java, and no need to set those paths in Unreal Project Settings (leave blank)
  • if you ever need to uninstall/reinstall Android Studio, read this including the comments
    How to completely uninstall Android Studio from windows(v10)? - Stack Overflow
  • If you need to relaunch your project, close project, delete Saved and Intermediate folders, and reopen
  • if you get a black screen, debug your project settings against the ones in the boilerplate project
  • When launching, if your project seems to take forever at “Launching On”, try putting on the headset and that may awaken it and complete the build.
  • Should you launch a custom profile for PSO caching purposes you must be sure to set the tick in Deploy.
Sound Design for Virtual Reality

I watched these, but I think this is more for general knowledge. I don’t think there is any audio in the Darts game.

Create a Social VR Experience

This section was straightforward until it got to the “Blueprint to C++” section.

Most importantly, when they have you import the Dart.Build.cs file, you will need to make a minor edit to it if you are using UE 4.26.2 and replace “LibOVRAvatar” with “OculusOpenXRLoader”, which has been renamed since 4.24, otherwise, the build will fail.

Using VisualStudio2019 is fine for this, I had never used it before, but I learned to ignore the many thousands of Intellisense errors, and only pay attention to Build Errors. I believe that one adjustment fixed every one of the 25 Build errors I got, but if anyone experiences issues beyond that, it may be that I had also needed to explicitly tell Darts.sln where the plugins were.

In the “Destinations and Rich Presence” Section, I’m not sure this is still current with the Quest App Lab era. Grouping does not seem work as it did when the tutorial was made, and I have had no luck with Grouping my Quest and Rift apps together, so I’m not sure if any of that is still possible, though I do see my Leaderboard stats are working and that the new C++ class I added works.

My Destination that I had added in this section is perpetually held at “Pending Review”, so I do not know whether this is testable.

The next big learning was 7 minutes in to “Destinations and Rich Presence”, when we are instructed to “package the build and upload it into our Alpha channel”, simple words that took much time to research, understand, and complete, and it might have been nice to have a few more resources included here.

But in fairness, much of this was because I wanted to build for Quest 2 App Lab. To be clear, Rift wants an .exe and Quest wants an .apk, which is mostly why this got hard.

As I mention in my other thread that I linked to above, the OCStarter project is again very helpful in showing me the Package Settings to export for Quest.

[FREE]Oculus Quest Starter - a boilerplate project with environment setup tutorial

I also think I watched this, from about 15 minutes in:
https://www.youtube.com/watch?v=4SY2Za6j7UY

You will also want to understand what an Android Manifest is, which is controllable through Unreal’s Advanced APK packaging section.

https://docs.unrealengine.com/en-US/SharingAndReleasing/Mobile/Android/AndroidManifestControl/index.html#androidmanifestlocation

And add the following Extra Tag to your package settings:
Capture14

Adding this application tag that sets allowBackup to false is a security measure that Oculus will want in a Security check, and I think may even be necessary to upload.

Also, Oculus now prefers an arm64 package as opposed to armv7, and to generate an arm64 build from Unreal you will need to enable the Online Subsystem GooglePlay plugin.

You will also need to learn about how to sign an APK for distribution, so watch this:
https://www.youtube.com/watch?app=desktop&v=-GSBX4ZdgCA

and I also recommend watching this as an orientation for what App Lab is:
https://www.youtube.com/watch?app=desktop&v=tj412PFUJiY

So when I built my Darts package (Shipping, for ATSC), I generated dozens if not hundreds of errors in my output log.
Capture24.PNG

And here were the debugging steps I had to take to get this project packagable:

  • turn off warning for “engine version”
  • delete BP_C2UMGDemo.uasset, delete W_Module2Demo
  • repair “RightHand_AnimBP” by rebuilding it to match the version in OculusVRDarts
  • M_Blend materials shaders needed to be fixed by adding the Linear Gradient texture in to a missing reference in the graph and parenting each material to the m_blend
  • I deleted the duplicated Grip enumerator (though I think that doing this caused my non-Dart throwing hand animations to be gone, and maybe this was not necessary since it was only a warning)
  • ignored “on component hit warning”, I assume it’s a 4.26 thing
  • and, note to self: get SSD to avoid the “Slow Derived Data Cache” problem, per this thread
    Very slow derived data cache problem - #8 by unit23

Capture16

Finally, once I had an apk build that was good (and this took many tries), I needed to learn about the OculusVR plugin that is accessible from Project Settings, in order to upload this to my Oculus Dev Dashboard.

Mostly the Oculus Platform Launch Window functionality is what matters, which is what allows you to upload to the Alpha Channel. This is a simpler way to do what is described here:
https://developer.oculus.com/distribute/publish-reference-platform-command-line-utility/?device=RIFT#access-token

And worked easily for Rift and less easily for Quest. This gets in to what I mentioned at the beginning, about my Entitlement settings probably not being best practice, where one was a Rift ID and one was a Quest ID. I feel like I was unable to upload this without having at least one valid Rift AppID regardless of whether my Target Platform was Quest or not. I would get an error that there was no valid App ID, which was really weird and I should retest this.

But I did get it onto the Alpha Channel for both Rift and Quest, and so I was able to be done with this section.

Oculus Mixed Reality Capture

I watched these, but do not yet have a 5ghz router, so I’ll come back to that.

Tools & Principles for Project Optimization

This section is all still valid, and all these tools work as described. The one exception is Android Systrace, which did not work for me, but there is a now a tool called Perfetto that does. I was able to get this to work, but have not actually used it yet.
https://developer.oculus.com/blog/how-to-run-a-perfetto-trace-on-oculus-quest-or-quest-2/

This also helped me understand that a bit more:
https://www.youtube.com/watch?v=9kNhB_z704I

Analyze Performance & Apply Common Optimizations

All of this section was clear. So far, I have focused more on learning RenderDoc, which, in tandem with the OVR Metrics tool, seems to be a little easier for me to start with. In addition to what is covered in the course, I also found these helpful:

https://www.youtube.com/watch?v=aoqfzk-lQgY
https://www.youtube.com/watch?v=V5b32PPvlwY&t=494s

I also felt this link on Android Vulkan would be good to anyone creating for Quest 2 App Lab at this point, as I gather this is pretty necessary for understanding how GPU profiling would work for this.

Much of it was beyond me, but Android Vulkan must be enabled in APK package settings.

https://www.youtube.com/watch?v=piDcBkUY7aQ

Prepare Your Oculus VR App for Submission

This was all pretty straightforward too, and explained Quest performance targets and Draw Calls and why I don’t think this Darts game could easily become a Quest 2 app.

Capture22
Capture23

So, for now, I’m satisfied that I was able to get my 50fps version of Darts onto my Beta and send invitations to a friend. I also downloaded the OculusAppStore.psd so that I can place the correct imagery for the app when I get a chance.

I’ve now moved onto my own 3d environment. I think that, in addition to draw calls, the main performance issue with Darts may have been the complex lighting setup and maybe the translucent railing glass which I take it is very expensive on Quest2, but I’m very curious about that.

I’ve seen this video on high performance VR glass, which is allegedly the best possible approach to glass for Unreal to Quest, but I have so far been unable to achieve anything close to that through dithering.
https://www.youtube.com/watch?v=UJwHjIQs2fY

A final note, when I successfully uploaded my APK to the Alpha Channel, Oculus Developer Dash will do security tests on the build.

I don’t know how necessary it is to address those for App Lab, but I looked into the “Enable Android NSC” vulnerability and was curious about creating a “network_security_config.xml” and found these two threads

Network Security Configuration File

Android: how to add an xml file to res/xml - Mobile - Epic Developer Community Forums

So if anyone has any insight on if this fix is easy for a non- C++ programmer, I’d be curious. The second OpenSSL issue I haven’t looked into, but suspect one would need to get an SSL license to address that.

Anyway, I feel like I know a lot more about Quest 2 than when I started the course and it is was very very helpful, and I thank those who created it!

5 Likes