Problems of effortlessly Joining Servers for LAN and Online
Author: Jairo Manon
Hello! What I was mainly dealing with was player connectivity with each other for both LAN and through the Internet. In the simplest form, I could've just made a widget that is able to enter a map as a listening server and join a computer through an IP. The problem with this approach is that: 1) Players might not know what an IP is and won't figure out how to get that information to join, and 2) it would only work on LAN. In order to fix this, I had to do more searching for other ways of making a network connection through the tools that are provided to me. This is where I came across OSS (Online Subsystems). This is basically an interface of interfaces from useful features like creating a session, joining a session, finding a session, etc...
Through the Unreal Engine Documentation (Online Subsystem in Unreal Engine | Unreal Engine 5.2 Documentation) of OSS, I figured out some of this API's key features that would help facilitate the connectivity between a host and a client. I made several widgets for this to work fluently; first I created a proper main menu that would ask you to host or join a session.
If you host, it will change to a widget that would prompt you for a server name to which to join. The server's name is not really important since all the code needs to get the address of a session, is the session's ID. However, it would be more appealing for the player to look for a name instead of a bunch of numbers.
Finally, the solution I found to make this work with private networks (without paying for servers) is to use Steam's Online Subsystem (Online Subsystem Steam Interface in Unreal Engine | Unreal Engine 5.2 Documentation). This would work very similarly to the regular one I use for debugging (OSS NULL), but it will allow you to use Steam's Servers to connect multiple clients across the internet.




Comments
Post a Comment