Please help with ultra basic listening server question

If I want to just make a game where multiple people can connect to a listening server, run around, and see each other, how would I go about that?

I think my biggest question is how to make it so people can connect from different computers.
Do I put my ip somewhere?
Do I have to set up my router to a certain port?

I know it’s better to do a dedicated server, but I’m just trying to get something up and running while I figure out more.

I know there are networking tutorials out there, but none of them just answer this question.

Thanks

You can start a listen server with the command:


<UE4Editor.exe path> <*.uproject path> <Map Name>?listen -game

and then connect a client with:


<UE4Editor.exe path> <*.uproject path> <Server IP> -game

Note that everything wrapped in <> should be replaced by you and don’t type the <> signs.

Alternatively you can use the Online Subsystem.

To start a server you use the “Create Session” node followed by an “Open Level” node with the added Option


Listen

Then a client will need to use “Find Session” followed by “Join Session” to join.

If you add this to your DefaultEngine.ini file


[/Script/Engine.GameEngine]  
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

You should also be able to connect over the internet. You can’t connect to yourself on Steam though so you will need several PC’s and several accounts.

Hi Garner,

Thank you for responding.
I’m not very well versed in coding.
Is there some Blueprint I could use to do this?

It seems like there should just be a blueprint that says “connect to server”, then you put in the ip or have a field where the player can put in the ip.
Then a place in Blueprints to input the port.

There are a lot of tutorials out there, but they all use multiple players on the same computer. I’m thinking/hoping it’s something so simple that people don’t think mention it. :slight_smile: