cancel
Showing results for 
Search instead for 
Did you mean: 

Fixes for common UE4 + Oculus Platform issues before submitting to Store

Mohammed_hashim
Expert Protege
In this post, you will find potential fixes for UE4 issues with VRC.PC.Input.3, VRC.PC.Input.2VRC.PC.Input.10, VRC.PC.Functional.3, Leaderboards, Achievements, and Online Sessions. Feel free to jump to the point you need instead of reading everything, but I'm sure you will read these tips more than once.
🙂 

----------
Background:
It's been almost 2 months since I started to implement the Oculus platform in my game to be compatible with the Oculus Store guidelines, and it's been a bumpy journey for many reasons. Thanks to the UE4 community and the Oculus Developer Support team with their fast and active responses, all has been solved in a short time. Below, I will describe in detail every single issue I faced, which should help you if you're facing the same problems:
  • Main reason for me was bad timing, Oculus had a bug on their "online session" (but the fix is available now and probably merged with 4.21.1 ) , as for Official Epic launcher version of UE4 still have bugs regarding "online session" and "Re centering VRC.PC.Input.3"  which makes it total useless as both "online session" plugin and "OculusVR plugin" is old and have bugs that will prevent you to make successful session or pass " VRC.PC.Input.3" so the only path you have to take is to download latest Oculus branch of UE4 from github.
  • Another reason was lack of clear and updated information on the Oculus + UE4 integration. I couldn't find any YouTube videos on how to implement any of the platform services. The only information you get is from the Oculus documentation, which is not always clear if it's referring to the official Epic UE4 branch or the Oculus branch of UE4. nodes that will be shown available from sample project called since in the document it mention how to obtain top 10 from leader-board with BP using array but there was no such node with array input or unlocking achievements which never worked (only tested on epic launcher version regarding achievements). https://forums.oculusvr.com/start/discussion/71115/how-to-get-top-10-from-leaderboards-with-bp-in-ue4#latest
  • UE4 has many Blueprint nodes like "Unlock achievements" and "Leaderboards", which you expect to work out of the box but doesn't. If you are new to submitting to the Oculus store like I am, you will first blame yourself and spend days fixing your code, finding out later the node is broken in the engine itself.  
Hopefully when you read this, most of the issues I faced here will already be fixed. I will also mention some tips on how to fix some major issues in your project before you submit to the Oculus store. When I first submitted my project, I got a list of issues below of test results I needed to fix:
  • VRC.PC.Input.3 - Selecting Reset View in the Universal Menu must reset the user’s position and orientation.
  • VRC.PC.Input.2 - Single-player apps must pause while the Universal Menu is open.
  • VRC.PC.Input.10 - In-application hands and controllers should line up with the user’s real-world counterparts in position and orientation.
  • VRC.PC.Functional.3 - Single player apps must pause when the user removes the HMD.
I will describe these in order.

----------
VRC.PC.Input.3 - Reset View should work properly: 
  1. Make a new actor 
  2. To fix this issue, use the Oculus 1.32 plugin which has the fix already and is (for now) only available on Oculus branch of UE4.21.1.
  3. Or fix the code from the source of UE4 which i'm not sure if its possible using epic launcher, if its possible then its not easy as the plugin is Engine run-time plugin. 
  4. You need to call "Set tracking origin" on your "Event begin play" to "Floor level" and not "Eye level" (unless your game uses "Eye level"). Otherwise, the engine will use "Eye level" as default. 
  5. You need to make a new actor and call it something like "OculusHMDNotifications" and drop it on every level you have. *(images i use in this post is from my own project and its named "mainmenu_bp" instead of "OculusHMDNotifications" )
  6. Add a VRNotifications component to it from left side then drop it on your graph as a reference so you could bind below 3 event from it just like the image  "hmdputonheaddelegate", "hmdremovedfromheaddelegate" and "hmdrecentereddelegate"
  7. Once you done your result would be like below image.
  8. Now add pause and reset position nodes to it just like below image, since we added HMD Remove/Put node here then we already fixed "VRC.PC.Functional.3" issue here too 🙂 
  9. Done! It will work now as it should
t4334lq3rw7a.png

----------
VRC.PC.Input.2 - Game should pause while the Universal Menu is up
  1. Remember the actor we created named "OculusHMDNotifications"? Open it and go to "Class Default " on the top side when you click on it 
  2. You will see a detail panel of your current actor, make sure to checkbox on "Tick even when pause" so when you pause your game you will able to unpause it again later. 
  3. Now add Set game paused and connect it to "has system overlay present" just like below imagine on event tick. 
  4. Once you done it will work as it should.
4cau49j8u5ta.png

----------
VRC.PC.Input.10 - Hands and controllers should line up with the user’s real-world 
In Oculus branch of UE4.21.1 from github you need to open sample project located in UnrealEngine/Samples/Oculus/HandSample
after that migrate the hand to your project and add the hand/controller to your character hand and recenter/rotate your game hand to match with the sample provided then you can delete it: https://developer.oculus.com/blog/implementing-quality-hands-with-oculus-touch/

----------
Achievements:
Achievements are broken on UE4 and you can't unlock Oculus Achievements using built-in BP nodes (not sure about Oculus github version of UE4  since i only tested Achievements on Epic launcher version) so what you have to do is to move the source of working code from SDK project "Samples\UnrealSample" and add it to your project then compile your project and use the new nodes just like in the sample project. (Its not as easy as it sound but its the only way) 
- Make sure to add your achievements on your portal/dashboard.oculus with ID that match your game Achievements ID just like steam.
-And config your app for Oculus on DefaultEngine.ini like below (not sure if the last line "Achievement_0_Id=" is required like  steam or not but i kept it for now) and make sure to change YOUR_APP_ID for OculusAppId to your actual App ID:

[OnlineSubsystem]
DefaultPlatformService=Oculus
bHasVoiceEnabled=true

[Voice]
bEnabled=true

[OnlineSubsystemOculus]
bEnabled=true
OculusAppId=YOUR_APP_ID

Achievement_0_Id="NEW_ACHIEVEMENT_1_0"

pyi0g5yhx3ql.png

----------
Leaderboards :
Same story as Achievements but it gets even worse even when you move the codes regarding Leaderboard from the sample project you won't able to control on how many entry you want to get or even get your own rank or friend list rank, luckily one of UE4 dev helped me to local player rank and it needed to adjust the source code of sample project so i will post it here later. as for now i believe when you read the leaderboard it will get top 100 (no confirmation). 
- Make sure your app is DefaultEngine.ini like above i mentioned for  Achievements.
- Don't forget  to Setup Leaderboard on Portal/OculusDash before anything else.

avx3zudxl71i.png

----------
Online Sessions:
This one was the biggest headaches of all time -

- First you need 2 separate machine or VM for testing just like Steam session. and make sure you add the 2nd account as developer or invite him to RC channel (this is very important part) i believe alpha channel doesn't work but i can't remember so make sure you do your online test with uploading your game on RC channel.
- Online session using Epic launcher UE4 is total useless and broken and on top of that Oculus version of UE4 on github had its own bug but fix issued and probably its merged by now "https://github.com/Oculus-VR/UnrealEngine/pull/25" 
- If you need session like steam when 1 player make session and the 2nd one find it from the list and join then make sure to make a pool on your portal with "Browse" mode like below image and give it the session name "Pool Key" before you even start with coding your session on the engine side.

xd2s2gyg6cso.png

- For creating session use node "Create session " using Oculus session plugin not the default engine one. and put the Pool name same as the one you created on above image "Pool Key" then open level with "listen" parameter so the client travel to the server map once he join. 
n26smk6ofblp.png

- As for finding and joining session use "find matchmaking session" same from Oculus plugin as for join use default engine join session node, no need to open map from join session on BP since client will travel to the server map just like steam version if the server opened the map with "listen" parameter.
xblmccznw28d.png

- Make sure your DefaultEngine.ini is using the Oculus OSS Net Driver - see below. I've left in the changes I've made from the Achievements and Leaderboard sections above so you can look at the entire picture. I've also added extra lines to increase network bandwidth (optional). Make sure to change YOUR_APP_ID for OculusAppId to your actual App ID:

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemOculus.OculusNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")

[/Script/OnlineSubsystemOculus.OculusNetDriver]
NetConnectionClassName="/Script/OnlineSubsystemOculus.OculusNetConnection"

[/Script/Engine.Player]
ConfiguredInternetSpeed=20000
ConfiguredLanSpeed=25000

[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=32000
MaxDynamicBandwidth=7000
MinDynamicBandwidth=4000

[OnlineSubsystem]
DefaultPlatformService=Oculus
bHasVoiceEnabled=true

[Voice]
bEnabled=true

[OnlineSubsystemOculus]
bEnabled=true
OculusAppId=YOUR_APP_ID

Achievement_0_Id="NEW_ACHIEVEMENT_1_0"

----------
Other Tips:
  • Make sure you enable HRTF sound since it really makes a difference in VR. Enabling and using Oculus 3D spatialized audio is easier than you think - setting it up in your project should only take a few minutes: https://forums.oculusvr.com/start/discussion/70889/how-to-enable-hrtf-on-ue4-4-20-solved#latest
  • If you face performance issues, try to disable/enable Oculus Dash to see if your project might have a problem with it. I encountered a performance issue before, but I couldn't confirm if it was due to Oculus Dash. Make sure to test this yourself.
As you can see, a lot of info is out there in the documentation and Oculus samples, but it's scattered about and it's not always obvious which info is correct and up-to-date.

----------
My Wishlist:  
  • Oculus needs to expose their platform services (VOIP, Achievements, and Leaderboards) to Blueprints without the need to use source code from the SDK sample project. We need to be able to pass variables when we create online sessions with Blueprints, so hopefully this will be implemented soon since the "Advanced Session" plugin doesn't work with the Oculus online subsystem.
  • Oculus needs to push Epic to update their Oculus plugin to the latest one for 4.22. 
  • Since I was able to use the Leaderboard Blueprint from the SDK sample project and had one of the UE4 devs adjust the code for me to get local ranks, the only thing left is to expose Friend Leaderboards to Blueprints. Hopefully, this last piece of the puzzle can be figured out with the Oculus and UE4 community's help. Once it's figured out, I'll come back here and update the Leaderboard section.

----------
Hopefully this info will help speed up your work! As I think of myself as a beginner with UE4 and Oculus development, if you see any wrong info here - please correct me. I also may have missed some important info you need, so please ask me and I will try my best to help you. Have a nice dev day! 


----------
Tagging the Oculus Developer Support team in case I have misleading information that need to be corrected. @NinjaGaijin
29 REPLIES 29

Mohammed_hashim
Expert Protege


I am experimenting with Oculus 1.34 Audio SDK on a rebuilt UE4.21 and running into some issues. Just curious I can't access the link you provided to enable HRTF figure I should read that maybe there are some solutions.

Yeah sorry looks like I made that post on Start section (you need to be start member to see it). but it doesn't matter now as the answer isn't available there anymore as the member who responded isn't available so his post is gone. if you explain your issue here I might able to help you.

Bro3ep
Explorer
@Mohammed_hashim
Hi thanks for tips its amazing.

KuckiVR
Protege


move the source of working code from SDK project "Samples\UnrealSample" and add it to your project then compile your project and use the new nodes just like in the sample project.

  Do I also have to do that for Oculus Sessions? Or can I just use the nodes from the Oculus Plugin

@@Mohammed_hashim
@@NinjaGaijin

Edit: Ok I tried the Plugin nodes and got it working.

JSY911
Honored Guest
.

PilarFeijoo
Explorer
thanks for the info

Anonymous
Not applicable



----------
Leaderboards :
Same story as Achievements but it gets even worse even when you move the codes regarding Leaderboard from the sample project you won't able to control on how many entry you want to get or even get your own rank or friend list rank, luckily one of UE4 dev helped me to local player rank and it needed to adjust the source code of sample project so i will post it here later. as for now i believe when you read the leaderboard it will get top 100 (no confirmation). 
- Make sure your app is DefaultEngine.ini like above i mentioned for  Achievements.
- Don't forget  to Setup Leaderboard on Portal/OculusDash before anything else.

avx3zudxl71i.png

----------




@Mohammed_hashim  was re-reading this post as I'd like to implement the leaderboards feature however stumbled into the problem of getting the local player rank - you mentioned you would post the code modifications required for this however it seems you may have forgotten? If you're still around it would be great to get that code adjustment! Many thanks in advance

Mohammed_hashim
Expert Protege





----------
Leaderboards :
Same story as Achievements but it gets even worse even when you move the codes regarding Leaderboard from the sample project you won't able to control on how many entry you want to get or even get your own rank or friend list rank, luckily one of UE4 dev helped me to local player rank and it needed to adjust the source code of sample project so i will post it here later. as for now i believe when you read the leaderboard it will get top 100 (no confirmation). 
- Make sure your app is DefaultEngine.ini like above i mentioned for  Achievements.
- Don't forget  to Setup Leaderboard on Portal/OculusDash before anything else.

avx3zudxl71i.png

----------




@Mohammed_hashim  was re-reading this post as I'd like to implement the leaderboards feature however stumbled into the problem of getting the local player rank - you mentioned you would post the code modifications required for this however it seems you may have forgotten? If you're still around it would be great to get that code adjustment! Many thanks in advance


Unfortunately, the guy who helped me to expose Oculus leaderboard to BP had a bug on the code, the code didn't work as it should once you have many users registered on the leaderboard, So I left it as it is during that time. 

Right now can you get the top 10 players using BP? if so how? from UE4 itself or using OSS widget sample of Oculus which?

Have you tested to get rank 0? Rank 0 must give you your local score if I'm not mistaken. 

I will try to look at my project later and see If I could find the code which might help you. 

Mohammed_hashim
Expert Protege
@aussieburgerVR

Hey, Not sure if you saw this, worth chcking it, Thanks for the dev who published it a couple of days ago, https://www.innerloopllc.com/oculusplatformbp

+ User Identity

+ Rich Presense

+ Leaderboards

Let us know if it works or not. 

Anonymous
Not applicable


@aussieburgerVR

Hey, Not sure if you saw this, worth chcking it, Thanks for the dev who published it a couple of days ago, https://www.innerloopllc.com/oculusplatformbp

+ User Identity

+ Rich Presense

+ Leaderboards

Let us know if it works or not. 


Hey sorry forgot to reply here earlier. That plugin does look interesting but seems to be requiring 4.25 which I've not been able to upgrade to yet - still a good backup option if upgraded in the future. 
In the meantime I'm actually trying to use the free epicleaderboards plugin as it supports non-oculus devices as well with full blueprint support (less features though)

ItsNotMeTrustMe
Protege




@aussieburgerVR

Hey, Not sure if you saw this, worth chcking it, Thanks for the dev who published it a couple of days ago, https://www.innerloopllc.com/oculusplatformbp

+ User Identity

+ Rich Presense

+ Leaderboards

Let us know if it works or not. 


Hey sorry forgot to reply here earlier. That plugin does look interesting but seems to be requiring 4.25 which I've not been able to upgrade to yet - still a good backup option if upgraded in the future. 
In the meantime I'm actually trying to use the free epicleaderboards plugin as it supports non-oculus devices as well with full blueprint support (less features though)


 Hey, @Mohammed_hashim thanks for posting about it here! It's cool to know someone's interested in it, haha. I wasn't planning on mentioning it outside of the Start Discord until I added a bit more to it. But I guess the cat's out of the bag. I put it up there early so people could use it for the game jam.

@aussieburgerVR
So, there's really nothing in the plugin that should require a specific engine version. The main requirement is that it needs Oculus Platform SDK 1.40+, which has been in each of the Oculus UE4 branches since 4.23. You can update the platform SDK separately, if you need to try building it for an earlier engine version. I can't assure compatibility yet because I just haven't tested it. But it might work. No promises.

If you want to try an earlier engine version, open up 'OculusPlatformBP.uplugin' and change "EngineVersion": "4.25" to another number. Odds are it'll work back to 4.23 without much more modification, but again... I haven't tested it yet.

After the game jam, I'll try to take some time to get branches made for earlier engine versions.

Also, check out PlayFab if you need a cross-platform solution with more features.