Download

multiplayer hosting and joining

hello community,
i am working on implementing multiplayer to my game.
so i tested everything using the ‘number of clients’ in the engine.
but now i want to test with friends, and idont know how to make the hosting and joining system.
if anyone knows or have a tutorial, please let me know.

I believe it is done with command line options like described here: Command-Line Arguments | Unreal Engine Documentation

two quastions:

  1. i dont know how to use command line. are these parameters or what?
  2. is there any way to do it via console commands (so i can make it in the in-game menu)?

I’m still working on it but take a look here:
https://wiki.unrealengine.com/Blueprint_Basic_Multiplayer_HUD

right now its just how to makea menu… there are no events yet… i guess ill just wait for it to be done.
thank you anyways.

Look at the handle clicks section, it has the console commands, the tutorial is complete, just may be a few gaps in explaining things.

but again, what is the ip my friend should use?
how can i set the host event to host the server on a specific ip?
the ip we are using is from hamachi

There are a few ways to do this. In engine, one of the users runs the game (Play in editor) as a listen server, the other user launches the game normally, opens the console with the ~ button and types open 192.168.1.155 (replace that with the ip address of the listen server)

alternatively, package the game, this creates an executable of the game you are working on. From here create a shortcut to the exe file and add the following to the end of the path:
?listen -game

this will cause the game to launch as a listen server

so for me the shortcut was D:\Builds\WindowsNoEditor\TitanGame\Binaries\Win64\TitanGame.exe ?listen -game

if you are using hamachi, that will assign you an ip address, if you cant find it displayed on hamachi, open up a command prompt and type ipconfig /all this will show you your ip address assigned to your pc. Look for the IPv4 address

Have a read of this too:

You may find that when a player connects, they are not spawned in with a character, this is more than likely due to not enough spawn points / unblocked spawns, either add more, or move players away from the spawn point. This is an issue I was having when first starting to get networking behaving.

while in game using the blueprint “Execute Console Command”:
To start a listen server(Host) the command is Travel Mapname?listen
To join a server its Travel <IP address>
and to move the server and client to a new level it is ServerTravel MapName.
Examples in the handle the click areas of the tutorial I posted.

so the server ip is automaticly the ip from hamachi?

If hamachi is open when you launch your game with the ?listen -game command, then yes it is