Single/Multiplayer, Touch & Vive blueprint only Template

Hi . We went ahead with our investigations on how to use Oculus Avatars and we finally succeeded in replicating an Avatar and its movements.
We followed a different approach compared with the one suggested by you some posts ago.

Basically, we didn’t use the RemoteAvatar, only LocalAvatar (since both use OvrAvatar, wich actually is the avatar). So we spawn a LocalAvatar for each player and, with the GameMode, we call [FONT=courier new]Possess on the right PlayerController.

Secondly, in the LocalAvatar’s [FONT=courier new]Restart method, we set OvrAvatar’s [FONT=courier new]PlayerType as Local or Remote, just by checking if the avatar is controlled by me or not:


void ALocalAvatar::Restart() {
    if (IsControlledPawn()) {
        AvatarComponent->SetVisibilityType(ovrAvatarVisibilityFlag_FirstPerson);
        AvatarComponent->SetPlayerType(UOvrAvatar::ePlayerType::Local);
    }
    else {
        AvatarComponent->SetVisibilityType(ovrAvatarVisibilityFlag_ThirdPerson);
        AvatarComponent->SetPlayerType(UOvrAvatar::ePlayerType::Remote);
    }
}

bool ALocalAvatar::IsControlledPawn() {
    return Controller == GetWorld()->GetFirstPlayerController();
}

Finally, the replication part, we defined a custom struct, called OculusTransform, which simply lets us convert an [FONT=courier new]ovrAvatarTransform in a “replicable” format (since a property has to be a USTRUCT, UCLASS or UENUM in order to be replicable).
In OvrAvatar we defined these three properties:


    UPROPERTY(Replicated)
        FOculusTransform RightHandReplicatedTransform;
    UPROPERTY(Replicated)
        FOculusTransform LeftHandReplicatedTransform;
    UPROPERTY(Replicated)
        FOculusTransform BodyReplicatedTransform;


So we applied this logic in the OvrAvatar’s [FONT=courier new]TickComponent method:

  • If the pawn is controlled by me, I put the data from [FONT=courier new]HandInputState[ovrHand_Left].transform, [FONT=courier new]HandInputState[ovrHand_Right].transform and [FONT=courier new]BodyTransform in these three structures (passing them to the server with an appropriate server-replicated function, so that they can be replicated).
  • Otherwise, I pick the data from these three structures and put them in [FONT=courier new]HandInputState[ovrHand_Left].transform, [FONT=courier new]HandInputState[ovrHand_Right].transform and [FONT=courier new]BodyTransform. In this latter case we also need to call [FONT=courier new]ovrAvatarPose_UpdateHands and [FONT=courier new]ovrAvatarPose_UpdateBody, because [FONT=courier new]UpdateTransforms does nothing on remote avatars (as you can see from code).

This is all. Hands and body are now correctly replicated. We are now working on replicating fingers’ position.

Further details:
Obviously we also set [FONT=courier new]bReplicates = true in LocalAvatar and OvrAvatar constructors, and also [FONT=courier new]bAlwaysRelevant = true in LocalAvatar. Also added all the other stuffs in order to have variables correctly replicated.

In LocalAvatar’s [FONT=courier new]SetupPlayerInputComponent we do nothing if the pawn is not controlled by me.

Write me if you need/want to know something else.

Hey , thanks for this great template! Any news on leap motion integration?

Hi!

  1. For the DefaultEngine.ini file, it’s mostly a trial and error thing. If you do a search within this forum or Google, you’ll see there’s not a lot of things there.
    For Steam and Oculus Home it’s straigthforward (see precedent post)
    OnlineSubSystemUtils contains the basic functionalities of networking, so if it doesn’t find Steam it will naturally fallback to this.
    I’ve tested IPDirect, LAN and dedicated server with null subsystem just to be sure to not use Steam if it’s still open somewhere

That’s true the VOIP through DirectIP is halfway done and needs customization to your project, that’s why I left it like this.
As I did not have any paid project demanding this we (as a company) dit not pursue more in that field; however I should have a project requiring it soon so I’ll give soon more complete guidance on this!

As you may have noticed there’s 2 ways to do a pick up object: Book_BP (as an example) and BP_PickUpObject. The first one have been designed by me, but the second one is from the VR_Essential_Kit, which @jamis kindly allowed me to put it in the template, so the bp inside BP_PickUpObject is his.

That being said, for both methods you could 1)Make a blueprint for every object to pickup or 2)use a common bp but with tags, and change mesh/materials on the fly during class initialization (construction script) like that (photos).

You could also find zillions other ways of picking up objects. Just be aware of subtilities like collision presets, using/turning on or off physics actor (need to be on to use gravity and fall).
If the object sticks to your hand, check the Drop function within motioncontrollerbp and object bp :slight_smile:

Yes! I’ve finished it yesterday (both single and multiplayer). I’ll find the time to post it at the latest monday night Jan 22.

Hello! The VREssentialKitMap is there because a lot of people asked me how to do these kind of interactions, and @jamis coincidentally had the perfect level for this, and agreed to provide it for free to everyone. However, this map is “as is”, and hasn’t been developed with multiplayer in mind.

That being said, I’m pretty confident that the functions can be easily adapted for multiplayer in mind. I just need a lazy morning with a big coffee to do that! I’ll note your remarks, and I’ll certainly do that very soon (maybe for 4.19). Thanks!

Thank you very much! I spent soooo much time in this last month, I think I was able to tell you by heart all the code of OvrAvatar!
I’ll will definitely plunge again into Avatars, God save my soul from madness again, and together we should vanquish!
Give me the week to have a look and I’ll definitively pm you about it.

Thanks again. I did not saw the latest posts from January since and Hololens project took all my time since the last 3 weeks: https://youtu.be/ukWy7FbvP7k Now that it’s done, I’m back for it.

Hi Perfect. Thanks!

Once someone joins a hosted steam game, backs out and trys to join the same game, it is not visible. Not visible to anyone else nor the person who just left.

Does the connection close once someone joins the game? Is this intentional or what is the fix to this?

Thanks

If you could get the advanced multiplayer working on multiplayer that’d be a blessing!! I love the template and it makes it a breeze to get into VR.

If you dont have time to do the advanced interactions, what is the best way I can learn to make them work myself?

Thanks!!

Hey, I’ve been using your tempalte for a while now. So far is good, but it does take some time to get it set up with how I wanted it. Anyways I currently have 1 issues I need help with.

I create a LAN server and the player goes over to a map with the MultiGM game mode running. Then, the 2nd pc joins the server, and we can interact and all in with each other! However, the game log for the 2nd pc (client) get’s spammed with the following.

[2018.01.24-16.15.15:134][918]LogNet: Warning: UIpNetDriver::ProcessRemoteFunction: No owning connection for actor AvatarMaster_C_0. Function Tick Teleport Rotation will not be processed.

[2018.01.24-16.15.15:134][918]LogNet: Warning: UIpNetDriver::ProcessRemoteFunction: No owning connection for actor AvatarMaster_C_0. Function Head Position will not be processed.

I’ve been trying to look online about this, but I don’t seem to find anything clear on how to solve this issue. If anyone got any help I’d appreciate it.

It all seems fine in-game. However I do like to have a clear log because when a issue come sup, it’s just easier to read through.

Quick offtopic question:
Is there a way to disable the voice integration and implement another?
I cant find the spots where you implemented the system. Can you walk trough the steps? or is that just the bVoice=true and everything else is native ue4?
I wanted to implement the ultimate voice chat trough the marketplace. but now i hear both systems at the same time.

Hi - (and anyone else) - anyone know if/how i can use this with 4.18.3? - does it work? i tried but with no luck - but i can not find way to install 4.18.2…:frowning:

Any help is very very much apreciated :slight_smile:

I may have a similar project because I’m also trying to get an older template to work. The fun thing is, everything is okay in the editor, but as soon as I try to package the project, I encounter some problems:

The player doesn’t spawn exactly at the playerStart.
The player doesn’t have any hands - they are not on the ground either, so I suppose they don’t spawn.

There are no errors, but some warnings. The ones mentioned in the above quote. I tried to get rid of some of them by following the quoted steps. I have a few questions though:

"2) Replace “hmd pdmin 2” with “vr.oculus.PixelDensity.min 2"”
- even if I use HTC Vive?
“3) Remove “hmd pdadaptive on””
- can’t find this one
“4) Replace “hmd mirror x” with “vr.MirrorMode x”; replace x by the correct number: (0 now -3; 1 now -2; 2 now -4; 3 now -1; 4 now -5)”
there are nodes with “hmd mirror x” and “hmd mirror mode x” - should I replace both with the new vr.MirrorMode?

I did everything except #3 since I couldn’t find it.

Does anyone know what to do? Or can anyone point me to a download with the regular upgraded (I don’t need all the multiplayer and ui components from the new set in the first post). Or can someone take a look at my project?

Hey

Hi I am realy looking forward to the leap motion integration. :slight_smile: Could you please give me an update. Thanks again for providing this template!

Basically it’s the UE4 native system;
It should work well in all cases (Steam, Oculus Home, LAN)
The only VOIP which require some work is direct IP
I did not tried yet XBox Live VOIP

I think I fixed it in next release. Should be soooon (see comment below) :slight_smile:

Latest version works with 4.18.3 – excepted Windows Mixed Reality version (4.16.2)

So everything is completed. I added also grab and pinch detection to ditch the controllers.

Sorry for the lack of update. We are currently setting up our new office with our dream setup – 2 VR rooms with each Rift+Vive all on TPCast + Hololens room.
We have moved 2 weeks sooner than anticipated so I’ve been moving boxes and I am literaly lying on the floor connecting tons of cables day and night.
I reserved half a day tomorrow to publish the leap update. All the headsets and gears are being pulled out of the boxes as we are speaking!!