x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Understanding Steam and LAN multiplayer

Hi I'm new to the multiplayer world using the Unreal Engine and I have this question that's been haunting me for a couple of days, as far as I understand you cannot find LAN games while making use of the OnlineSubsystemSteam because Steam doesn't look at connections, only online sessions. If that is true then how can I (connected to Steam) create and find LAN matches? is there a way to switch the OnlineSubsystem being used for that?

To add a bit more context I'd love for someone to clarify me some other things. At the moment my game can be played over Steam, I'm using the SteamDevAppId=480 (Spacewar) and for some reason I cannot find a match hosted by a steam friend living in Portugal (while me being in Germany), so maybe there is some region lock as well? I can play an online match over Steam with my laptop using another Steam account. As far as LAN goes I can host and find a LAN game on my same computer only if Steam is offline and opening two different stand alone clients, I cannot do the same using the PIE option from the Editor.

I'm using the built-in Steamworks shipped with UE 4.16 (version v139)

Product Version: UE 4.16
Tags:
more ▼

asked Jun 27 '17 at 03:03 PM in C++ Programming

avatar image

virtual_nomak
361 16 17 25

avatar image virtual_nomak Jun 28 '17 at 12:27 AM

Update: to be able to connect to LAN while having Steam opened I just added a check like this: IOnlineSubsystem* UHKGameInstance::GetOnlineSubsystem() { return bEnableLan ? IOnlineSubsystem::Get(NULL_SUBSYSTEM) : IOnlineSubsystem::Get(); }

This fixes the problem since I'm no longer using the Steam subsystem to create and join LAN matches anymore, but unfortunately this works to create a session, when trying to join it it fails, shows me that no players are connected (there should be at least 1, the one that created the session is connected). If Steam is offline then this still works, I'm so confused here :S

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You can use the SteamNetDriver for LAN matches. When you open the map make sure you append ?bIsLanMatch=1 to the URL.

Should look like this.

 MapName?listen?bIsLanMatch=1
more ▼

answered Jun 29 '17 at 03:07 PM

avatar image

HailstoneRyan
714 40 27 54

avatar image virtual_nomak Jul 01 '17 at 11:20 AM

Thank mate! it does work :) Now I'll have to read about the possible options and about the SteamNetDriver.

The only problem I still face is that for some reason the "NumPublicConnections" (MaxPlayers) and the "NumOpenPublicConnections" are still the same even though I have 3 clients connected, for a game with max 4 players and 3 clients online I should have "NumOpenPublicConnections" set to 1.

In case anyone happens to come here for the same issue I did this:

 FString levelOptions = "listen";
 if (bEnableLan)
 {
     levelOptions.Append("?bIsLanMatch=1");
 }
 
 UGameplayStatics::OpenLevel(GetWorld(), "Lobby", true, levelOptions);
(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question