Motion controllers and networking

When i use more than one vive into a multiplayer game, motion controllers are all getting transformations from the same client.
I think it’s about “player index” input.

My questions are:

  1. What is that player index in a multiplayer game ?
  2. Get tracked Device position and orientation has a device id input - it’s the player index ?

Hope you can answer me, thanks in advance,

here is my rough guess, haven’t been able to run VR preview yet with my Vive CV1. But controller idea is pretty much the same. You are in a Pawn, you need to get the pawn owner(a PlayerController), and then get the player index from there(on server), then set the index.

I will have to setup my UE4 first, and possibly just compile from github source to make it work, cause both UE4 and SteamVR is a moving target, compile and update is probably a safe bet.

It’s hard to even find someone that have a vive to do multiplayer test I guess, so gotta find a buddy soon.(I have a few in local indie dev group that owns pre dev kit, so I can ask them to test with me once I got a build going.)

edit: oh, and I don’t know about the answer to 2nd question. not even a guess. ^^;

Thanks PenguinTD,
I don’t know how to get the player index from server… i wonder it was only for local playing…
There is a function : Get my player index… but for turn base … don’t know how it functions.
I have a second Vive (not local) to test.

  1. Get tracked Device position and orientation has a device id input - it’s the player index ?


I just figured this out so not entirely sure with multiplayer, but ID 2 is left and ID 3 is right for the first player controller. If you run it through a loop you can get 1st ID and 2nd ID. I believe the first will always be left and the second right.

Hey Fantasifall, thank you, it’s a good approach i think,
Not “controller” below, but Tracking Reference - 2 entries in solo mode
I’ll test this afternoon for 2 Vives connected if it’s ok
And then i’ll test the value of this into “player index” of motion controller, or using the function “Get Hand…” instead of !
I’ll post my results.

First results not good, not in multiplayer mode:
When using Device Type Controller : there is 2 controllers detected - 2 ids: 1 and 2
When using Device Type Tracking Reference: there is 2 controllers also detected… - 2 ids: 3 and 4
Dont know what is what ?
When apply theses values to Get Hand Position and Orientation, no result. It’s like “controller index” and the values “ids” was not the same
Any idea ?

Ok, we have found a solution:
if you want to use Motion controllers in a VR Multiplayer Game, don’t use Motion controllers Components !!!
The solution is simple finally: use a replicated variable for transformations, ask “locally” with Get Hand Position and Orientation (controller 0 - each client has a controller 0) and that’s all…
We have explored many solutions… because components seems to replicate automatically, and impossible to avoid that… in 4.11.1 (others, i don’t know)

A shame that that is still not fixed.
Maybe someone should add an official bug report in Answerhub?
I can’t upgrade to 4.11.1 yet so I can’t do it now.

Can we please get an update on this from Epic? Is it fixed internally, I know it’s a known issue internally Wes talked about it in a stream once and even offered up code to fix it. I used it and didn’t work but Im not a programmer so it couldve been poor implementation.
@benicourt are you setting the transform of the controllers with an event tick? Have you noticed a performance drop in your game. I was using a similar setup when I was using the hydras and felt it was a little slower.

Just jumping in here to say that I’d really like to see this fixed!

Yes, we have to use tick event to refresh positions of the motion controllers… it’s possible that there is a “little” drop in performance, but very little… and it’s only for multiplayer VR mode.

Dang, I was hoping this was fixed.

Updating/sending the values manually in tick is not ideal, as that means you’ll also have to set up your own interpolation.

I’ve already tried to lerp the location of the motion controllers: good idea in theory, but the result was bad for VR. You must not add a gap between hand movements and result to screen. In theory, this is only a kind of smooth. But, our brain don’t like this… But, it’s just my opinion after testing.

Ah, glad to see I’m not the only one finding this functionality broken in multiplayer.
Will go ahead with the get position on tick approach until this is looked at by Epic :frowning:

There are several functions in SteamVR(OpenVR actually) API doesn’t seem to get used by Unreal Engine 4 last time I check the 4.11 on github(about 2/3 days ago).
I think majority of function have some sort of wrapper in place, but then I couldn’t find where they got called. (And then Paul and Proteus gets their templates up so I then work busy on that.)
There is a few function that are really interesting, like getting the predicted position and orientation of tracked device with a float sec amount, so like 0.006 is like 6 ms ahead.

On top of this, any movement generated by HMD or controller should have their own polled events. If you check the default Pawn net update frequency, it’s 100Hz just slightly higher than the display.
It has nothing to do with rendering side of thing and I think inputs have their own thread polling input changes to generate events.(ie. the axis events of a trigger), and we just need that to be implemented and replicate the location of motion controller components. Those functions should be exposed so as dev we can do other fancy stuff(like finding the throwing tangent).

I do think this is kinda high priority, if there is already an answer hub ticket, we should up vote that question(and the trello board if there is one.)

I have two VIVE to run my network game, the vive controller and headset on the server control the two players ( the server and the client) , the controller on the client can not controll itself . but the trigger and the button worked right

looking for solution…

I am starting to wonder if Epic is in bed with Oculus and doesn’t want to support Vive/roomscale. They never comment on Vive topics nor do they seem to care about them.

At GDC they where exclusively using Oculus Touch controllers to show off VR. Bullet train is Oculus only. Etc.

I have two VIVE to run my network game, the vive controller and headset on the server control the two players ( the server and the client) , the controller on the client can not controll itself . but the trigger and the button worked right

Hi nurbsyang, don’t use motion controller component, use the BP functions to determine the location of MC, and don’t forger “Is Locally controlled” before :wink: