Download

Networking examples?

I wasn’t able to find much information about multiplayer game structure using UE4 and decided to create this thread with a few questions:

  • What’s the standard networking model? Each clients connects to a server which dictates the games? Or is it P2P?
  • Is there a server browser example somewhere?
  • How many players can be connected at the same time? 64?

By P2P I’m assuming you mean that players connect to each other and one of them hosts the game, rather than Epic providing dedicated server space somewhere. The engine is configured based on the Authoritative Server/Client model, where one player is the server and maintains authoritative control over the game. Core engine classes also rely on this behaviour in many instances, such as the CharacterMovementComponent etc, so changing to a P2P method would be quite a challenge. You can configure your game to build a Dedicated Server .exe, and a player/dedicated server unit can run those if neccesary.

No server browser example that I’m aware of (it’s difficult to show one working across the internet when nobody has your assets, let alone running them). Though I’m sure somebody made a version that worked across LAN, and would therefore work accross the internet too. Not entirely sure where I saw that, probably on a deep YouTube hunt somewhere.

The ShooterGame content example from Epic is probably the best networked game example you’ll ever find, and enables gameplay through internet/LAN, I believe you connect through an IP Address, but it uses the Unreal GameSession classes and whatnot.

AFAIK there’s no upper limit to the amount of connected players outside of the hardware/OS limits, and the optimization of your game. MMO/Planetside-style is certainly possible! Unreal has an amazingly powerful networking system which takes care of most of the work for you, including things like relevancy etc, it’s just up to you to implement everything correctly :slight_smile: Here’s a few links to resources:
https://youtube.com/watch?v=TbaOyvWfJE0https://wiki.unrealengine.comhttps://www.youtube.com/watch?v=TbaOyvWfJE0/Replication

https://answers.unrealengine.com/questions/29017/gamemode-multiplayer-c.html

Thanks a lot for the info! :wink: