Single/Multiplayer, Touch & Vive blueprint only Template

,

I just got everything running on your newest template that you updated on 8/8, and would like to commend you on your hard work and efforts! I did encounter one small annoying bug, and I have yet to find what is causing it, but when I am teleporting around, I don’t always end up where the arrow is facing. I think this has something to do with the way the head turning can affect the teleportation, sometimes it seems like it is using the forward vector of my play space rather then where my head is looking, any idea what could be causing this? I haven’t made any changes to the way teleport was in the template, so you should be able to reproduce it by teleporting around a lot, testing with turning your head and not turning your head. Any help on this is much appreciated! Keep up the good work! I should also add that I did my testing with a Vive as the host, using unreal 4.16.3 version.

@finn7390 Ok I’ll test that tonight. I received also a suggestion on how to fix the Oculus Guardian boundaries on 4.17, I’ll try that tonight.

Hi , thanks for the feedback, i went back to 4.15 with v2.3 meanwhile :wink:
Im sorry if its a little bit OT my question, but i´m struggling with this issue, trying to replicate an animated door through the network, attached is a screenshot of my current BP, it has replication on but not working on either client or server side. Tried to figure out how did you solve the HAT_BP for networking, but dont know how to apply it in my case…
Thanks in advance!

@malcriado

So in Unreal it’s always a question of who is the owner of the actor? Who spawned it?
To make short, you can have actors spawned by other actors, or actors spawned by the level (e.g. the level blueprint)
In multiplayer, the level exists in 2 versions: one version for the listen-server (Authority), and one version for the clients (Remote). As an example, if you spawn a cube mesh in the level blueprint, it will spawn 2 versions of that cube: one visible and accessible only by the server, and one visible and accessible only by the remotes. You could easily choose to spawn the cube just on the server, or just for clients with a Has Authority Switch. The same with functions. You can do a Remote Procedure Call (RPC) from server to client and from client to server. Finally, you can also replicate variables from server to client. So as an example, if you want a pawn opens a door, you have to ask the question who owns this pawn? Following that, you ask yourself the question who should be aware / affected by this action? Only the player itself, like having and HUD with health points, or everybody, like detonating a bomb among everybody? By asking these 2 questions will know what to do.

Now with the pawns. Usually in a level the pawns are spawned by the server, as in the template, where the GameMode (which exist only on the server) spawns the AvatarMaster pawns. When these pawns spawn, they are spawn as multiple copies. The player which is the host of the game will be spawn as an Authority, Locally-controlled copy, which is the one receiving inputs from the controller (or things such as HMD position and motioncontrollers position and inputs). At the same time, another “silent” copy is spawned, which is the Remote, Not-locally-controlled copy of the pawn. This copy is the one which will be seen and will interacts with other players (clients). The tricky thing is that this copy of your pawn, following is birth (spawning) in the level, has his own independent life! So if you want your actions or the color of your hat be seen by other players, you have to make sure that your Authority, Locally-Controlled pawn (the one you control) dictates his will to the Remote, Not-locally-controlled copy. You do this with variable replication, and with RPCs.
To complicate things, there are 2 other copies of actors possible. These are the Remote, Locally-Controlled pawns (the one controlled by each clients), and the Authority, Not-Locally-Controlled pawns (the copy of the Remote, Locally-Controlled pawn), visible and interacting with the Authority, Locally-controlled pawn.
So all these copies of pawn have to be tracked and taken care of. It’s always possible to communicate between copies of actors, whether through simple replication or one or multiple RPC.
So in short:
Authority, locally controlled pawn exists in 1 copy, which is directly controlled by the host. Its copy is Remote, Not-Locally-Controlled pawn, which is visible and interacts with Remote, Locally-Controlled Clients.
Each client directly controls a Remote, Locally-Controlled pawn. Its copy is Authority, Not-Locally-Controlled pawn, which interacts with the Authority, Locally-Controlled pawn. Plus, to be seen by other clients, he will have to be sure to spawn a second copy of himself, this time as a Remote, Not-Locally-Controlled Pawn.
So authority needs only a copy of himself to be seen by all others; clients have to have copy for the player host, and another copy for all other player clients.
What I’ve done in version 3.1 and up is that I separated the functions for each different copies of pawn (Authority, Locally-Controlled / Remote, Locally-Controlled / Authority, Not-Locally-Controlled / Remote, Not-Locally-Controlled). Why? For 3 reasons:

  1. Each copy doesn’t have to fire all the same functions, but they must be fired in specific order. The solution was to put delays (but it was annoying and not clean) or control what every copy is doing.
  2. I needed also every copy to act differently for Oculus Avatars
  3. It gives a finer control over each copy

So now for your door!
First question to ask: Who owns the door? As your door is probably in the level at level start and Netload on Client is selected, your door is owned by no one so it exists as 2 copies: one seen and interacting with the host (Authority), the other one seen and interacting with each client (Remote).
The second question is a) who is interacting with the door, and b) which player is affected / see this?
So your BP tells me that you want to be able to open the door with the trigger when your are in close range (by triggering a trigger volume). The answer is a) whether the Authority, Locally-Controlled pawn or Remote, Locally-Controlled pawns and b) everybody
Check first that your motioncontroller meshes are able to trigger the triggerbox of your DoorBP. That done, ensure that your DoorBP is set to replicate and replicate movement.
Now we know that the Authority copy of DoorBP will dictates its behaviour to Remote-DoorBP, so we just have to talk to Authority-DoorBP. So the simplest way is that Authority, Locally-Controlled pawn directly fires OpenDoor in Authority-BP, and that all clients, that is, Remote, Locally-Controlled pawns first send an RPC to the Authority, Not-Locally-Controlled pawn, and the latter will fire OpenDoor in Authority-DoorBP. This is the simplest way to do it. This way everybody should see the door opening.
Note that if DoorBP would have been spawned (so owned) by another player, that would have played differently but not so much difficult, if you ask the questions. That’s it. Hope that’s not too much confusing, and for the purist I know I used not always the right terminology but its for sake of understanding.

&stc=1

As a side note, there’s a list of known bugs and a small fix

  1. Bug #1: Affecting ONLY version 4.17, and ONLY Oculus Rift: In 4.16, setting the origin to Floor Level would result in the position and rotation of your play area being considered the origin, effectively putting it in ‘roomscale mode’.

This is no longer the case in 4.17- regardless of whether the tracking origin is set to Floor Level or Eye Level, the rift will begin at the origin in XY and its starting yaw will be taken as the rotation ‘zero point’. Bug presently reported in AnswerHub at Oculus center of play area wrongly assigned to HMD in 4.17.0 - Rendering - Unreal Engine Forums

Small fix for that in 4.17: In Avatar master/Set Boundaries for Chaperone & Guardian, change the following:

&stc=1

This will give you the correct Guardian playground size, but still does not correct the HMD correct position within the playground.

  1. Bug #2: Affects Unreal 4.16.3 and 4.17.0: UE-44947: Extra Sphere collision is shown when setting it to not be hidden in game for the MotioncontrollerBP
    Unreal Engine Issues and Bug Tracker (UE-44947) You can resolve this by unchecking “Instanced Stereo” in Project Settings, but doing that could decrease VR performance.

  2. Bug #3: Affects Unreal 4.16.3: UE-45908: Widget interaction debug line only shows when hitting a widget Unreal Engine Issues and Bug Tracker (UE-45908)

I invite you to upvote for these issues (bug #1 and #2, since bug #3 is resolved in 4.17) to increase Epic attention and will to resolve these!

Awesome job updating the template! I tested the new 3.2 version with 4.17 and now the steam hosted session and joining it works well.

Regarding what @finn7390 posted, I’ve had the same teleportation direction issue through all of the versions of the template I’ve tested. For me the forward direction seems to be the “right->” direction of my playspace.

I’m still experiencing the laggy behaviour on the client side though. I wonder if I’m the only one? It’s really apparent; for example when I’m just waving my hand around, the hand movement is quite glitchy.

Quick update on the bugs. Bug #1 have been updated to official unresolved issue UE48260
Unreal Engine Issues and Bug Tracker (UE-48260)

" Play area bounds are offset so that the player’s spawn position is at the center of the player start"

Description
The play area is offset in game from the player start. In previous version the play area would be centered on the player start area. Now the player spawn exactly on the player start and the bounds are shifted.

Steps to Reproduce
Download the attached project
Open the project
Stand off to the side (so as not to be in the center of the play area)
Play in VR preview
Result: The player start (as marked by the debug sphere) will be centered on the player
Expected: The Player start would be centered on the play area

So now the list of issues are

  1. Affecting ONLY version 4.17, and ONLY Oculus Rift: UE-48260 Play area bounds are offset so that the player’s spawn position is at the center of the player start Unreal Engine Issues and Bug Tracker (UE-48260)

  2. Affecting Unreal 4.16.3 and 4.17.0: UE-44947 Extra Sphere collision is shown when setting it to not be hidden in game for the MotioncontrollerBP
    Unreal Engine Issues and Bug Tracker (UE-44947) You can resolve this by unchecking “Instanced Stereo” in Project Settings, but doing that could decrease VR performance.

  3. Affecting ONLY Unreal 4.16.3: UE-45908 Widget interaction debug line only shows when hitting a widget Unreal Engine Issues and Bug Tracker (UE-45908)

Any luck reproducing the issue with teleport rotation on the vive? There are times it seems like I’m 90-180 degrees from where I’m supposed to end up and its really confusing sometimes. I haven’t been able to figure it out myself .

Hello everybody,
I have a problem with Unreal version 4.17.
I have a computer that hosts the game. If I search this game from another computer in LAN it is displayed twice and as soon as I press on Launch, the editor crashes.
Do you have an idea?

**Version 3.2.1 - August 18, 2017

Files can be found at Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.
GitHub version at GitHub - ProteusVRpublic/ProteusTemplate: Single/Multiplayer VR Template for Touch/Vive Controller * (you need to be logged to Github to open the link)

**
What’s new in version 3.2.1?
*
I’ve had a dozen reports about “What the hell, can’t see my hands!”. ALL these problems were due to Guardian or Chaperone not correctly set during Rift/SteamVR setup. After each person redid their setup, the hands magically went back. So now I’ve put a safeguard for that see fix #1.

What I recommend: Try the 4.17 packaged version on the OneDrive (Template 3.2.1 packaged). If there is problem there, it’s on your side, probably setup based.

NEW FEATURE:

Spectator mode toggle (4.17 only)
I put a simple static SceneCapture2D in MultiMap to represent the spectator view but you could do a lot of things like move it with Sequencer or control it via another player. Lot of fun in perspective. See Input Map for toggle button.

**FIXES: **

Motion controllers meshes not spawning if Guardian or Chaperone are not set [FIXED]
Now a default Guardian or Chaperone will be used if boundaries are not set correctly, so motioncontrollerbp will still be able to initialize

Debug line is not set correctly in multiplayer [FIXED]

(VIVE) Left and Right Grip buttons on Vive controllers are not mapped correctly [FIXED]
Left and Right Grip buttons on each Vive controllers are now mapped at the same function

(VERSION 4.17 with OCULUS) Guardian boundaries and corners not detected correctly [FIXED]

NavModifiersVolume (NavAreaNull) have inconsistent behaviour since Unreal 4.16[TEMPORARY FIX]
For now I ditched the NavMesh and teleport on static mesh, deny teleportation with floor angle and CustomNavArea NavModifierVolume, until Navigation is more stable in Unreal.

Reworked a bit the input map for consistency between Rift/Vive and to accommodate the fact that since 4.16 the left and right grip buttons on the Vive controllers are no longer differentiated.

What is the default input mapping for the Oculus Rift Touch Controllers?
· Both controllers
o Thumbstick directions / Controller orientation: Playground rotation before teleportation
o Index Trigger: Grab / Release
· Right Controller
o A Button: Teleport
o B Button: Widget Interaction
o Thumbstick Button: Chaperone/Guardian corners on/off
· Left Controller
o X Button: Teleport
o Y Button: Spectator Mode on/off (Unreal 4.17 only)
o Thumbstick Button: VR Keyboard on/off
**
What is the default input mapping for the Vive controllers?**
· Both controllers
o Trackpad directions / Controller orientation: Playground rotation before teleportation
o Trackpad release: Teleport
o Trigger: Grab / Release
· Right Controller
o Menu Button: Widget Interaction
o Left or Right Grip Button: Spectator Mode on/off (Unreal 4.17 only)
· Left Controller
o Menu Button: VR Keyboard on/off<
o Left or Right Grip Button: Chaperone/Guardian corners on/off

REPORTED BUGS / NOT BEEN ABLE TO REPRODUCE

*“**I’ve had the same teleportation direction issue through all of the versions of the template I’ve tested. For me the forward direction seems to be the “right->” direction of my playspace. Any luck reproducing the issue with teleport rotation on the vive? There are times it seems like I’m 90-180 degrees from where I’m supposed to end up and its really confusing sometimes. *I haven’t been able to figure it out myself »

I’ve tested the template with 4.16 and 4.17 version with a Vive; did not have any problem with playground orientation. Something to do with SteamVR setup?

“I’m still experiencing the laggy behaviour on the client side though. I wonder if I’m the only one? It’s really apparent; for example when I’m just waving my hand around, the hand movement is quite glitchy”

As already reported, I’ve had vastly different experiences concerning lag, mainly with Steam: depending on the hour and the network load, lag is sometimes unnoticeable, sometimes heavy. Barely noticeable in LAN. Slowest through Oculus Network with Avatars.
I’ve had also few reports on lagginess increasing with time. Again, I did not notice that but I would suggest to play with Project Settings / Garbage Collection. From what I’ve tested I don’t have mem leaks but it surely can be improved through better garbage collection.
**
KNOWN BUG WITHOUT A FIX (FOR NOW)**
No VOIP through Direct IP Connection: I’ve tried many tricks / solutions, nothing works (yet). Maybe using Advanced Session Plugin? I’ll try that. If someone has a trick for enabling VOIP through direct IP give me a shout.

Physics objects: It’s normal to experience client-side lag on physics objects (i.e. Interactive Objects). Many tricks exist to fix that problem; search for “multiplayer physics objects”. This would be an entire different topic and is not specifically related to VR.
**
Oculus Avatars Version with 4.16.3**: Remote Avatar is not controlled by Remote Player : Working on it.
**
BUGS WHICH WON’T BE FIXED**
Affecting ONLY Unreal 4.16.3**: UE-45908 Widget interaction debug line only shows when hitting a widget Unreal Engine Issues and Bug Tracker (UE-45908) - Bug has been resolved in 4.17**
**
BUGS REPORTED TO ANSWERHUB**
Affecting ONLY version 4.17, and ONLY Oculus Rift**:** UE-48260 Play area bounds are offset so that the player’s spawn position is at the center of the player start Unreal Engine Issues and Bug Tracker (UE-48260)

Affecting Unreal 4.16.3 and 4.17.0: UE-44947 Extra Sphere collision is shown when setting it to not be hidden in game for the MotioncontrollerBP
Unreal Engine Issues and Bug Tracker (UE-44947) You can resolve this by unchecking “Instanced Stereo” in Project Settings, but doing that could decrease VR performance.

Hi,

I can’t seem to make LAN mode work. I tried this with both 4.16 and 4.17, the packaged version from your dropbox, then another I packaged myself. Here are the steps I took :

1/ Both computers are on same WI-FI network, they can see each other on the network and are in the same homegroup. I play with two Vives.
2/ Exit Steam on both computers
3/ I launch the packaged game on both computers, allowing them through windows firewall when asked
4/ Host a session with first game
5/ Try to find a session with second game : no sessions found. Direct connect do not work either

I tried with another network without luck, in case my router was causing trouble. Nothing found.

I’m pretty sure this is not a template related problem, but some kind of hidden Windows config. What am I missing here ?

Thanks a lot on that work anyway, hope to be able to help soon !

How does one ensure the lazer pointer will be ON in a shipping build?

Or atleast where is the line trace from the hands being called in order to make some sort of visual representation of this?

Many thanks!

@clav

You’re doing this right. Windows firewall exception has to be ON for the host, doesn’t seem to matter much client side, on or off.

Just to be sure I’ve just retried LAN with the 4.17 packaged version with a Vive and a Rift, and it works. Windows 10. I haven’t change anything special or open ports on my router.

Check things like Windows Homegroups / Workgroups to be sure your computers are on the same. Try resetting router. Don’t despair!

@anonymous_user_d59090d5

The “laser pointer” is in fact the debug line in the MotionControllerBP/Widget Interaction. By default I’ve linked them to options in the MainMenuPC VRSettings panel, but you can also manually switch it on or off in the MotionControllerBP. I’ve put the related boolean in a RepNotify, and ensured that the debug line is coming only from right controller.

Keep also in mind there’s a bug in 4.16 and 4.17 with the debug line and the Instanced Stereo Option.

Version 3.2.2
August 29, 2017

What’s new in version 3.2.2?
UNREAL 4.17

2 important fixes:

  • “NavModifiersVolume (NavAreaNull) have inconsistent behaviour since Unreal 4.16. For now I ditched the NavMesh and teleport on static mesh, deny teleportation with floor angle and CustomNavArea NavModifierVolume, until Navigation is more stable in Unreal.” [NOW FIXED]
  • *“**I’ve had the same teleportation direction issue through all of the versions of the template I’ve tested. For me the forward direction seems to be the “right->” direction of my playspace. Any luck reproducing the issue with teleport rotation on the vive? There are times it seems like I’m 90-180 degrees from where I’m supposed to end up and its really confusing sometimes. **I haven’t been able to figure it out myself » ***[NOW **FIXED]

What I recommend: Try the 4.17 packaged version on the OneDrive (Template 3.2.2). If there is problem there, it’s on your side, probably setup based.

@finn7390 That should solve the Vive teleport position problem.

I’ve greatly simplified the teleport functions. Note that the HMD position problem within playground is still there with Oculus, an inherent problem since 4.17
Deleted all NavMesh agents, seems to solve the navmesh teleport problem but I recommend playing with RecastNavmesh settings for fine-tuning.
Fixed only the 4.17 version, PM me if need the 4.16 fixed version.

KNOWN BUG WITHOUT A FIX (FOR NOW)
No VOIP through Direct IP Connection: I’ve tried many tricks / solutions, nothing works (yet). Maybe using Advanced Session Plugin? I’ll try that. If someone has a trick for enabling VOIP through direct IP give me a shout.
Physics objects: It’s normal to experience client-side lag on physics objects (i.e. Interactive Objects). Many tricks exist to fix that problem; search for “multiplayer physics objects”. This would be an entire different topic and is not specifically related to VR.
Oculus Avatars Version : Remote Avatar is not controlled by Remote Player : Working on it.

BUGS WITH NO FIX
Affecting ONLY version 4.17, and ONLY Oculus Rift**:** UE-48260 Play area bounds are offset so that the player’s spawn position is at the center of the player start Unreal Engine Issues and Bug Tracker (UE-48260)

Affecting Unreal 4.16.3 and 4.17.0: UE-44947 Extra Sphere collision is shown when setting it to not be hidden in game for the MotioncontrollerBP
Unreal Engine Issues and Bug Tracker (UE-44947) You can resolve this by unchecking “Instanced Stereo” in Project Settings, but doing that could decrease VR performance.

Thank you , have been very busy lately so it will take me a few days+ to get to your newest build, will let you know though! Thanks again for your hard work!

Hello , how can I use Vive Tracker? I have ViveTracker and I want to connect Spectator-Screen to that tracker and use it as a virtual camera. and use my cell phone as real-camera, then I want to merge this 2 videos together, how can I do it?

Also, I have started to test it now, there is some problem with brightness in spectator view, it’s very dark for some reason. Can you please look what is happening with it? Also can you please tell me how to disable rotation from the trackpad on Vive, it’s very distracting my navigation, I want to see and teleport there without rotation, you don’t have this option in your settings as I see?
Thank you.

upd1: How to fix stretching? I have picked SingleEye CroppedToFill, but it seems very stretchy. How about green screen option for the avatar?
Thank you.

upd2: I have found good image to present what I actually looking for:
https://masterofshapes.com/wp-conten…RS_tracker.jpg
basically, vive+tracker+cell phone and walk around person in VR and shoot it and make video in After Effects combining 2 layers (Desktop capture +Cellphone video together)

upd3:
I made it work, I needed to have Vive-Tracker as Virtual Camera, it’s all working okay, only things is a reverse motion from vive-tracker, I going to need to invert it. I don’t know what is the issue with brightness when I created my own texture brightness was fine from the beginning.

Thanks for the template its great. How would i enable the left hand to also be used to give widget interaction, I would like both hands to be able interact. ?

Is the problem in networking or is it the audio? If the latter, have you seen this thread and the linked pull request? Might not be at all related, but…
https://forums.unrealengine.com/development-discussion/audio/1343970-voip-muted-with-audiomixer-enabled

  1. For the Vive Tracker that’s how I do it – image1. I’ll put it next iteration. As far as I love Oculus, that’s way more easy to do it with a Vive Tracker than with an Oculus. Remove also the static SceneCapture2D from the scene.
  2. You can change the post-process settings of the CaptureComponent2D to adjust image
  3. For the trackpad teleportation, just remove the link between LViveTrackPadX and Y, as well as right controller in AvatarMaster
  4. For the cellphone I would just stick the ViveTracker on the phone or better 3d print a mount for it. Of course you’ll need a greenscreen for compositing image.
  5. That’s the way I use the tracker as a camera (image2). That way it works all right as if it’s a camera