Oculus Quest multiplayer

You could start with taking a look at the “Collab Viewer Template” that ships with UnrealEngine by default.
There is a whole section about it in the docs: docs:Collab Viewer Template

The template caters in a basic way to the requirements you described (including lazors :wink: )

1 Like

Hi,

we want to create an Oculus Quest multiplayer (social) application for our company. We want to show some avatars and their hands of the players in one room. They should be able to (laser) point at a certain 3D object. The application is developed for our company and doesn’t need to be in the Oculus store. The players also won’t have oculus accounts. It can be either LAN (usually all headsets will be in the same room) or through a dedicated (or cloud-based) server. Any idea how we should get started? I can’t find much information related to Oculus Quest and Multiplayer.

Thanks in advance for all your advice and help!

With kind regards,
Sven

Hey,
you can just package the collab viewer template for android (File->Package Project->Android->Android (ASTC) ) and then you can have a look yourself. Fire up a server on your PC and then try to connect with the Oculus Quest. It should work out just fine, as long as both the PC and the Quest are in the same network.
There might however be issues with the UserInterface on the Quest, as I’m not sure whether the collab viewer template is optimized for this scenario.
But all the network code should work out just fine.

I’m currently also working on a network project involving the Oculus Quest and we also use the Unreal’s built in network capabilities to host listen-server on the Quest and connect to it with other devices.
There is absolutely no limitation as to whether you’re hosting on the PC and trying to join with the Quest or whether you host on the Quest and join with the PC.

Thanks G4mble270 for the information.
I did look at the collab viewer template but I was under the impression that it was aiming at desktop-VR like Oculus Rift since the PC can then handle the server-part. However, because a Oculus Quest is a standalone headset (it’s not linked to a computer), I’m not sure how both should be able to communicate with eachother.

Hey G4mble270. That’s really great feedback. I’ll definitely give it a try in the upcoming weeks. The userinterface is something we should be able to fix ourselves.

Will mark this thread as answered for now.

Thanks again for your quick response!

hey! Did the template work with the quest? We’re also about to start a multiplayer project for quest2 but we don’t have it to test yet…

Hi Jackal,

I had some other priorities but in between, I started modifying the template. It does work out-of-the box using Oculus Link (cable) which could get you started. However, in order to make it work for the quest, I do need to convert the widget that asks to enter the username and select the server to operate inside the Quest (and not through the desktop). This means converting it to a 3D widget and ensuring the quest controls are responding to the widget (currently, I’m having a problem with the latter). Also, I want to avoid typing in a username by providing an array with usernames to select from. I hope to have this done in a week or two. I will only test it for local LAN since an external host would require an IP address to be filled in (thus the need to have some sort of virtual keyboard unless it’s an hard-coded IP).

Honestly, I really wished UE4 would at least provide us with a good VR multiplayer template that could also be used for Quest but since there isn’t any (or I don’t know about any other), It’s the best option I have.

1 Like

I also started looking at this thread, what I want to do is somebody from a different network joining someone (Quest) else on another network (PC), so once Server and one Client, do you think if I do the same alteration that BioMedKUL is mentioning, I can achieve that? Is the IP Address that you enter upon joining the server, the server IP address? (new to the Server/Client relationship)

It shouldn’t be a problem to “crossplay” between Quest and PC. It works with Rift and PC so Quest should work as well. You can do this when you’re both connected with the same network or indeed connect to the IP adress that is used by the host server. It should be the host IP address. There always needs to be one PC that serves as a host.

By the way, engine version 4.26 should now support the oculus on screen keyboard (which could be handy for data entry such as the user joining the session) and has an updated collab viewer template. Unfortunately the template is still not compatible with mobile VR by default but it look a bit better and is supposed to be a bit stable compared to the one in older versions. If you use this template, also don’t forget to update your project settings to optimize for Android/Quest packaging. This video provides a good overview of the settings that are required. I’m going to work on the template now, trying to convert it to work on the quest. I’ll share my thoughts once there’s progress on the template conversion.

2 Likes

Okay, so I tried the new updated Collab Viewer template from 4.26. The weird thing is that it does support the Quest in its blueprints (e.g. by creating custom user names to join thus removing the need for the online keyboard) but whenever I load it on the Quest, it shows me the default level without a way to join a session. I did manage to make it work on the Quest using a 3D widget and the virtual keyboard.

First of all, if you haven’t used this template before, I propose you first try it onto your computer to understand how it works. Package the Collab Viewer Template, then create a host session. Then, on the same computer join the session you just created. If you are using the Oculus Link, you can even see it directly in your Quest by clicking on the VR icon (top right) in the session (it will not automatically switch to VR).

When you are familiar with the Template, here’s what you have to do to get it working on the Quest:

  1. Download and install engine version 4.26 or higher

  2. You will need to update Android SDK and NDK. Check here for more details.

  3. Create a new project using the Collab Viewer Template

  4. Update the project to make it fit for mobile platform. Click here for a video.

  5. Create a blueprint actor and add component: Widget. In the properties, assign the Widget_Mainmenu give it a resolution like 1.500 x 800.

  6. Drag your blueprint actor in the scene, near the Player Start 6. Then set a proper scaling to the actor (like 0.4 or so) so it fits inside your scene.

  7. Enable the oculus keyboard overlay so you can enter text (your name) in the widget. Click here for a tutorial.

  8. Click on the Terrain Actor in your scene and disable Dynamic Shadow in the properties. This you give a performance boost.

  9. Now, deploy by using the launch button in the editor (make sure your Quest is checked). When it’s running, it’s possible that it will not work properly in the quest. On my system, it closed down whenever I joined the session with the host. I had to restart the Quest and then it works fine.

Please note that you also need to deploy a version on your computer which will be the host to which the quest will connect to. If you’re both on the same Wi-Fi, they should find eachother without a problem. Only when the host is ready, you will be able to join that session on your Quest. I packaged the default collab viewer template (not the mobile one) to make the host session on my PC.

Now, you’re good to go.
This procedure is just to get you started. Obviously, you should then start modifying things the way you want. For example, remove the widget once the join succeeds as it will block your view in the level and its input focus may cause performance issues.

I hope this helps.

2 Likes

Hi I’m facing proplems running the Collab Viewer on Quest. I followed all the steps above, but as soon as I launch the app on the Quest, it finds the Server PC running a session on the same network, then I click to Join session and the app crashes. So it seems that the problem is related to the Join session code, but I don’t know how to debug the app on Quest at runtime.
Also I tried the same app on Quest2 and the virtual keuboard does not get any input from the stick, so I’m not able to use it in order to write in the Text box element inside the HUD.
Does anyone have a suggestion?

thanks

Hi algmighty,

whenever I get a black screen after joining, it usually means the acutal join failed. There can be a few reasons for that but there are several ways to test it:

  • You could assign an action to the node Join Session when the join failed (e.g. a sound to alert you that it indeed failed). The node is located in the Widget_MainMenu (Connecting to server). I’m not sure that the “on failure” connection will work though.
  • Try running the application using the Link setup when connected with the default Quest USB cable to directly preview from the editor (In editor: Play > VR Preview). This should also allow you to do some debugging from within the editor. Please note that when you’re launching from inside the editor, you may need to click on the VR icon in the application menu in the upper right before it will switch to your headset.
  • One thing I try to test possible issues with firewalls and such, which may prevent you from joining, is to use my home network or set my phone as a hotspot (either through 4G or company network). Set your phone in hotspot mode and allow both my pc (host) and my VR headset to connect to the hotspot. This way, it should work fine and you could rule out security issues on your network as a possible cause.
  • One other thing, although not always useful, is to check the log files on the device. When connecting your quest to your computer, should see your quest as an additional hard drive (similar to a USB stick) in Windows explorer. Navigate to UE4Game > YouProjectName > YouProjectName > Saved > Logs.
  • Also make sure you do not use the app immediately after deploying (running). That didn’t work on my side. I had to close the app on the Quest and manually run it again. Also try to reboot your quest first, if you still encounter issues.

I hope this helps.

Haven’t tried it yet on a Quest 2 so cannot comment on the input issue. With the Quest 1, the virtual keyboard works fine. I didn’t change anything to the widget to allow input to that 3D widget. It worked out-of-the-box.

One other thing I’ve noticed, at least on my side, is that the version on your desktop should have the same project (application) name, or even use the same source, as the one used for your quest. Whenever I package a collab viewer to host the windows session with a different project name, I can join the session but it doesn’t load my level properly resulting in a black screen with only my widget visible but no means to connect again.

Hi BioMedKUL, thanks a lot for your help it was really helpful. Now I’m able to run the demo on Quest (both 1 and 2), I followed your suggestion and it seems to work, but I had to correct another issue that could couse the problem which is the ID (the assigned number) of the player starst inside the Map. I noticed that in the template that comes with 4.26 the Map has only 2 players start with the number 5 and 6, so as soon as Iaunch the app on the Quest it seems that it is looking for a player start with ID number 1, not finding it the cycle will break and the app comes back to the login menu. As soon as I added 4 more players start (ranging from 1 to 4) the app runs without problems. Anyway thanks for your help.

Best

Would it be possible to host a session from one quest and have remote access from another quest, using vpn on the oculus? Also wondering if the host version packaged for pc would need to be the exact same?

The application on Quest doesn’t open immersively, it opens in windowed mode, and even when changing the mode to VR mode, it stays in windowed mode and it doesn’t recognize the glasses movements and stays still.
I thought of changing the menu scene to the VR game template, as this is perfectly recognized by Quest in VR mode, and creating the Menu there. But that should take some work and I don’t know where to start.