I’m not sure how you haven’t found material for this topic. Have you tried YouTube? I thought UE4 was well-known for its built-in multiplayer system.
There are many ways around this depending on how you want your players to connect to each other.
Let’s talk about the server first.
You do not need a dedicated server. You can have one of the clients (phones) host the server in the background whiles they play the game. This is similar to how most co-op games work and how a lot of Xbox 360/PS3 online games worked, i.e. Call of Duty.
The notable downsides to this solution are:
- whoever is hosting the server needs to have their ports forwarded.
- the host of the server can ‘mod’ the server.
Ideally, it is better to use dedicated servers but that costs money and isn’t usually worth it for co-op games.
Now let’s talk about how your players can connect.
1. Joining through IP address
The player gets the IP address of the server and then executes the following command open {ip address}
. You can always add a UI which then calls that command.
2. Joining through a server browser
A server browser is really just an online database containing all the info of registered servers. Therefore, it requires a server to host the database. This usually costs money but a lot of platforms offer you free server to use for server browsers, i.e. Steam, EOS and PlayFab.
But this approach requires quite a bit of research to understand how to use them.
Note: servers must be registered. If someone hosts a server but it is not registered with the server browser, then no one will see it. Sometimes this is automatically done by the platform.
3. Matchmaking
Similar concept to the server browser but usually more money. I’m sure you can do your own research once you get to this point.
This document is almost essential when it comes to learning UE4 multiplayer: https://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf