cancel
Showing results for 
Search instead for 
Did you mean: 

[UE4.18.3] "JoinSession" node is not traveling to the Servers map

eXifreXi
Level 3
Hello everyone,

I'm currently setting up a test project to make sure everything related to hosting and joining a session is working.
I enabled full debugging on the Logs of UE4 as well as using the Tools you provide for listing active rooms.

The setup:

I'm using the Launcher Version of 4.18.3. The project was created with that version, so not updates happened.
I'm packaging the projected and using this version on both PCs.
Both PCs have Oculus Home running and a Rift connected.
The "MainMenu" map is called "TestMap", while the "GamePlayMap" is called "GamePlayMap".
Creating a session opens "GamePlayMap" as a ListenServer.

What does work:

Both Player's Entitlement check is successful.
PlayerA can "Create" a Session for a BROWSE POOL (CUSTOM_POOL).
PlayerA travels to the "GamePlayMap" as a ListenServer.
PlayerB can "Find" the Session via that BROWSE POOL (CUSTOM_POOL).
Calling "Join Session" on the Session result connects PlayerB to PlayerA.
Dumping the Session Information on PlayerA shows PlayerBs ID etc.
Your online tool shows both people in the same room.

What does not work:

PlayerB is not actively traveling to the correct map. The log files show that he's trying to travel to the "TestMap", while PlayerA is on the "GamePlayMap".

What did you try to resolve this:

  • I went ahead and made sure it's not caused by the GameMode class. That was GameModeBase and is now GameMode. No change though.
  • I tried calling "open ID.oculus", didn't work at all.
  • I tried hosting with PlayerB and let PlayerA join. Same result.
What is your desired endresult:

Once hosting and joining via the normal "Create", "Find" and "Join" Session nodes works, I would like to use the "FindSessionById" function to join a room directly.
For that I forced my way into your private headers to get access to the UniqueNetID of Oculus and retrieve the ovrID as a String for now.
That will then be send to GameSparks, which sends this ID to all Players (here PlayerB) so they can search the Session and join.

Now for this I would love the JoinSession function to work first though.

Any help would be appreciated.

Kind regards,
Cedric
15 REPLIES 15

eXifreXi
Level 3
Hello there,

seems like I still haven't been precise enough, sorry.
Was that called from PlayerB's side and calling with PlayerA's id?
I tried to join the Player that was hosting. At this point that should have been PlayerB calling open with PlayerA's ID.
Also JoinSession() doesn't automatically load the host's map. That's part of the UE4 interface.
This is true, if we are talking about the C++ function. I did however use the BlueprintProxyBase class as a BP node for this. And that already calls the "GetResolvedConnectString".
if (Sessions->GetResolvedConnectString(NAME_GameSession, ConnectString) && PlayerControllerWeakPtr.IsValid())
{

UE_LOG(LogOnline, Log, TEXT("Join session: traveling to %s"), *ConnectString);
PlayerControllerWeakPtr->ClientTravel(ConnectString, TRAVEL_Absolute);
OnSuccess.Broadcast();
return;

}
The UE_LOG at that point prints the "traveling to OCULUSID.oculus /game/Maps/WrongMap".
So I assume the "GetResolvedConnectString" method is either doing something wrong in general here or, if you override it, wasn't correctly implemented.

Let me know, if you need any other information.

eXifreXi
Level 3
Hello there,

I'm sorry, it seems like I haven't been clear enough yet.
Was that called from PlayerB's side and calling with PlayerA's id?
PlayerA was hosting, so I called it on PlayerB via the ID of PlayerA.
Also JoinSession() doesn't automatically load the host's map. That's part of the UE4 interface.
This is true, as long as we are talking about the C++ function. I, however, used the JoinSession Node, which is a BlueprintCallProxyBase (or whatever the parent class name is), which successfully calls this after joining the session:

// Client travel to the server
FString ConnectString;
if (Sessions->GetResolvedConnectString(NAME_GameSession, ConnectString) && PlayerControllerWeakPtr.IsValid())
{
UE_LOG(LogOnline, Log, TEXT("Join session: traveling to %s"), *ConnectString);
PlayerControllerWeakPtr->ClientTravel(ConnectString, TRAVEL_Absolute);
OnSuccess.Broadcast();
return;
}
The UE_LOG prints: 
LogOnline: Join session: traveling to 1455739501133326.oculus
After that, the LogNet prints:
LogNet: Browse: 1455739501133326.oculus//Game/Maps/TestMap
While "TestMap" is wrong here. It should go to GamePlayMap. And this is nothing I specify somewhere. It works totally fine outside of your Subsystem. So I assume somewhere a function got overridden and is not doing what it should do.

If you need more information, please let me know.


eXifreXi
Level 3
So, looking further into it, calling "ClientTravel" with the ConnectString that has been retrieved will then be forwarded to the "GEngine" (class UnrealEngine), which then updates its WorldContext with a TravelURL.

That will be processed in the next Tick of "GameEngine", which then calls "TickWorldTravel" of "UEngine". Further, this calls "Browse", which then results in this call "UE_LOG(LogNet, Log, TEXT("Browse: %s"), *URL.ToString() );"

I went ahead and used the NULL Subsystem to check what the connection string and the BrowseURL look like.
Without changing anything despite the Create and FindSession nodes (previously used the once you provide), this is the result:
LogOnline: Join session: traveling to 192.168.0.185:7777
LogNet: Browse: 192.168.0.185//Game/Maps/TestMap
So what does that mean now? Well the "TestMap" is still wrong, but this test properly loads the GamePlayMap.
So it seems like something else goes wrong AFTER that step 😕

It then goes on like this in my NULL Subsystem log:

LogNet: Welcomed by server (Level: /Game/Maps/GamePlayMap, Game: /Script/Engine.GameMode)

LogLoad: LoadMap: 192.168.0.185//Game/Maps/GamePlayMap?game=/Script/Engine.GameMode

This never happens when using Oculus Subsystem. Could this be a problem with the NetDriver of Oculus?


brian_jew
Level 5
Thanks for the additional details. 

>This never happens when using Oculus Subsystem. Could this be a problem with the NetDriver of Oculus?

You mentioned that you are in 4.18.3 of the launcher version of UE4.  IIRC there was a new challenge protocol introduced by Epic in either 4.17 or 4.18 for NetDrivers to establish a connection between the host and client before they can send game data to each other.  We've updated our NetDriver to handle this new challenge and this can be found in our github version of UE4: https://github.com/Oculus-VR/UnrealEngine.  Looking at Epic's engine source code on github, it looks like this updated Oculus NetDriver is going into their 4.19 release.  It unfortunately is not in the 4.18.3 launcher version.  (If you want more detailed information on how updates gets pushed and merged for UE4, we have a handy chart here: https://developer.oculus.com/documentation/unreal/latest/concepts/unreal-engine/)

 To get the updated netdriver you could either:
- download the 4.19.0 preview version from the Epic Launcher
- pull Unreal Engine source code off of Oculus' github and build from source (https://github.com/Oculus-VR/UnrealEngine).  This is also where Oculus will push the latest features/fixes for UE4


eXifreXi
Level 3

brian_jew said:


- pull Unreal Engine source code off of Oculus' github and build from source (https://github.com/Oculus-VR/UnrealEngine).  This is also where Oculus will push the latest features/fixes for UE4


Hello there,

thanks for the update. I would most likely try to dodge the project update from 4.18 to 4.19 if it's possible.
If I get that correctly, I could simply grab your Plugin's SourceCode, compile it for 4.18.3 and replace the Plugin of my Launcher Version with the updated version? Or would I also need 4.18.3 Source?

Currently trying to find the fastest fix for this. Could also wait for 4.19, but yeah, updating a project can also cause issues.

Cheers,
Cedric

gavmacca
Level 4
Hi Cedric,

I am just using the blueprint function library for Oculus so no C++ at this point. I'm just trying to do a simple connection between two clients and I just can't seem to get anything working. (Create session, find sessions, join session)

In your original post you mentioned that the player could find the browse pool session. Currently when I try to find matchmaking sessions, it's returning success but the session results are 0. Did you run into anything like this? Again this is using the blueprint nodes. Also on 4.18.3

Just doing anything I can to try to connect two clients together at this point...

Thanks!

eXifreXi
Level 3
Sorry for the super late response. This is a bug on Oculus end and got resolved in 4.19.
Just get the latest UE4 version and you should be able to join again.

Mohammed_hashim
Level 5
@imperativity

Could you please confirm about BP node Join session will let the client travel to the server listen map?
I spent the whole day testing on all version of Epic launcher engine 4.16, 4.19 , 4.20 and 4.21 and i have same above problem which is creating/finding and joining is success except the client doesn't travel to the server map. here is my log for both server and client.

Client : 
[2018.11.12-00.42.07:016][328]LogBlueprintUserMessages: [map1_C_1] joined
[2018.11.12-00.42.07:032][328]LogNet: Browse: 2270842802956973.oculus//Game/Maps/map1

Server:
[2018.11.12-00.41.47:261][634]LogBlueprintUserMessages: [map1_C_1] successCreateSession
[2018.11.12-00.41.47:277][634]LogNet: Browse: /Game/Maps/map2?listen
[2018.11.12-00.41.47:277][634]LogLoad: LoadMap: /Game/Maps/map2?listen

As you can see the client still stuck on "map1" which should travel to "map2" on server.


Mohammed_hashim
Level 5
Hi @imperativity i'm going to ask here since that post was regarding timeout and seems that issue is solved. as for my issue (client doesn't travel to the server map) could you help me with this?

Btw this is first time i'm trying to make Oculus online subsystem so please check below my code and tell me if there is anything missing. and i'm using
browse mode not quickmatch.

* using Oculus online plugin from official epic launcher engine 4.21 (tested on 4.20 and 4.19 same issue) 
I attached an image here showing my code. https://i.imgur.com/NvYGMCw.png

1- I created browse pool in my app.
2- added below code to my engine config:

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

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

[Voice]
bEnabled=true

[OnlineSubsystem]
DefaultPlatformService=Oculus
   
[OnlineSubsystemOculus]
bEnabled=true
OculusAppId=1829062873855832

3- Create session with the name above i made and open Map2 as listen (success) .
4- opened another instance on the same PC .
5- Find session with above name and join (success).
But the problem is the client still stay in "map1" and it doesn't travel to the server map "map2" as it should.

Below is the log 
Client : 
[2018.11.12-00.42.07:016][328]LogBlueprintUserMessages: [map1_C_1] joined
[2018.11.12-00.42.07:032][328]LogNet: Browse: 2270842802956973.oculus//Game/Maps/map1

Server:
[2018.11.12-00.41.47:261][634]LogBlueprintUserMessages: [map1_C_1] successCreateSession
[2018.11.12-00.41.47:277][634]LogNet: Browse: /Game/Maps/map2?listen
[2018.11.12-00.41.47:277][634]LogLoad: LoadMap: /Game/Maps/map2?listen

As you can see the client still stuck on "map1" which should travel to "map2" on server. and why "LogNet: Browse" to map1 instead if map2?  btw server never log anything about establishing connection to the client when join is success from client side which i think it should.