Session creation+join without level change

Hi!

I’m just wanting to know if it is possible to create/join sessions without having to open a new level with listen, or to join the session and not need to update the current level to the same as the server’s current level.
If this requires C++ that’s no problem either! Currently utilizing both blueprints and C++ classes.
(Using Steam Subsystem)

To give context to what I’m trying to achieve here, I currently have a menu with creating, finding, listing and joining sessions set up.
My current design was to give players the ability to launch a new session from the menu, which opens a panel listing currently connected players.
From there, I’d like them to be able to stay in the menu screens with the session running, and allow other players/friends the ability to find the running session through their menu and join the session, without having to leave their menu either.
Once the host is ready to start, they can then select the level they would like to start, and everyone else would then travel with them.

Thanks!
Steve.

So this probably isn’t going to be the neatest/easiest post to read(since I’m doing it in a very awkward way of course).

My solution via Blueprints is whenever you “Create a Session” using the Create Session node in Blueprints, during the way time(the upper right node), you could most likely doing a “loading screen” or just force it to do nothing and whenever you successfully you complete the action of “Creating the Session”, you get rid of what you have on the screen(either by removing all widgets of class or just remove all widgets, caution if you have a custom mouse cursor; this will get rid of it.) and then bring up what I like to call a “Hosts Selection Menu” which allows them to pick a gamemode(if you have that), pick the map by generating a lists of maps with a Combo Box(if you have that) and then every time you switch in the Combo Box, you promote a variable called, “Map”(or any other name) and then from there whenever the host clicks “Start, Ready” or something like that, it pulls whatever what was inserted into that variable and sends it to the map.

I know it’s pretty confusing(to me, at least); but that’s the way I have it in my game.
Here are some images of what I’m doing in my game, Lurking in the Shadows:
HostSelection.png
In this picture, we basically go ahead and see if they want it to be LAN(with a Checkbox) and see if they want to enable VALVe’s Anti-Cheat(with a checkbox) upon clicking, “Host”


We get the player controller that did it, get the maximum player count(which depending on the gamemode is different for me, you don’t have to include a variable to see how many players are going to be in a game and can just set it in the node. We see if it LAN is enabled(you’re probably wondering where VAC plays a part in this? I’ve disabled it on this graph to replicate without the use of any external third-party plugins which are being used in my game.)
So we create the session and while waiting, I display a “starting screen” widget and put that on the screen while it transitions and then remove that widget when it’s done and show a “Host Game” Widget, which is basically going to display something where it gathers the players and you can choose the map and extra settings.

Now in the backend of that screen where we host:


We do some things with selecting a map
:HostSelection.png
In here, we get a combobox and put some map names and then when we “switch on string” we set a variable that changes based on what map we’re playing. And then whenever they click start:

We just get the maps name and travel to it!

If you need me to clarify, just ask me. Clients are a bit different in this approach, but works the same way essentially.

Hey, thanks so much for taking the time to respond in such detail! I really appreciate it :slight_smile:

So to try and explain where the issue lies, I have a somewhat similar setup. Not quite as fleshed out at this stage, but I’m just trying to build the bare-bones for now.


Right here after we use the create session node, a session begins. This is where my understanding of what happens in the back end goes awry.From what I can see, one of two (or both?) things happen.
Either the server is unable to accept incoming queries until a new level has been loaded with the session started, or the local player is actually not included in the session until they open a level.
I’m hoping I’m doing something really really wrong here and that it’s an easy fix…

Here are two screenshots of a server and a client prior to the connection being established.


This is all within my main menu (which I’d love to keep everyone on the main menu the entire time).
First shot is the server after launching the session, second is the client finding the session, prior to joining.
Below are the relevant blueprints:


(“Update Session Active” simply calls logic within my UI blueprints to give a visual indicator that a session has been joined, no servertravel occurrs)




Above is attached to show where the numbers are coming from.

Upon clicking join, the client will reload the main menu, which I don’t really want to happen (I haven’t explicitly told it to do this). Ideally, I’d love them to just start being able to communicate.
On the server’s end when a client connects, nothing happens, even though there is logic that should (as far as I know?) be running. Perhaps it’s here where I’ve got a misunderstanding of what’s going on.
As shown below. I’m not entirely sure when the postlogin event fires, but I thought it was on successful connection.

TLDR; I’m wanting both server and client to be able to connect to one-another without the need to load or reload any additional maps with the listen parameter.
I believe I’m still launching the main menu map at the moment with listen running, prior to actually launching a new session.

I believe Event on Post Login is only fired once a player has connected to the session and changed Player controller so Event Player connected is not being fired?

Not sure if you’re still on this, but if you are, or someone is is viewing this wondering the same thing, in short this isn’t really possible with unreals build in networking system to my knowledge, so there are two ways around it, but is circumstantial:

The first is easy that if you don’t have any background scene, ie its all UI covering the screen, then you obviously can just change it with a loading screen or something subtle, and make it bring up the same UI from the menu scene, in the “Lobby” scene, so it looks like nothing has changed, but obviously with a proper scene this wont work.

So the second option is that you can use level streaming, so you have menu and lobby level, but then you have another level which is your actual scene, which is level streamed on load to both these levels, ie its the same on both, therefore when you join, you just need to have it set the camera/player setup/position to the same as it was in the menu, obviously there would be a delay between this from joining and if the server has to set it, so you can try sneak in a loading screen inbetween but if thats not what you want just letting the client have the same view when they load first in should be enough