UE4 Local Multiplayer and LAN Setup

Alright so, I’ve spent the last 3 hours surfing the web and piecing tutorials together to try and achieve what I want. With no luck, I turn here.

Basically what I am asking for is, some guidance, advice and maybe even some tutorial links if possible, for a system similar to minecraft’s multiplayer system. (I know obviously for the ps4 I’d need to be a Corporation Entity and have an agreement with sony to use their dev pack for the ps4) But I am looking for a way to set it up so a player can either join split screen with player 1 (the host) or join from their own PC or (eventually) their own ps4. I’ve never done any networking before with UE4, and I have no idea where to start for split screen. I’ve seen a lot of references to player controllers being assigned to a specific number, but I’ve already set up a bunch of blueprints referencing player controller (0) does this mean that I have to also assign all these blueprints to player 1-8? If It’s an 8 person server or whatever? Not sure what keywords I should type into google to find answers to my questions?

Really could use some insight here

I’m trying to figure out how to do this too. Make sure you have read this article: http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf

And then keep in mind that the server has a player index for each player on its machine, and since it’s the server, I THINK this means that includes all the network-connected players and the local players as well. Haven’t had a chance to test that yet as I just barely got local multiplayer working WITHOUT networking.

the client machines likewise have one player index per player that’s on that machine, but not for any of the other players that are connected on the server.

Hope this helps you figure it out. If you figure it out before I do, let me know how you did it!


Eight local players interact with each other using their respective contact points in their respective areas。
I hope you can help me or give me some ideas, thank you very much

This doesn’t sound like it’s related to networked multiplayer, but rather allowing multiple people to use a touchscreen at the same time. A really, really big touchscreen.

If that’s correct, then here’s my first idea on how to try doing this:

  1. Use the appropriate event handler node in blueprint, probably on the Player Controller. You only need 1 player controller. I think the event handler node is called Multitouch(?)
  2. The multitouch event node gives you an array of structs representing all contact points and with their locations and other information. Do the math or use actors as reference points to compare against to see which of the 16 regions each touchpoint is in. to make things easier for you afterward, you can then push each Touch struct into a different Array, one for each region of the screen (compare it against each X coordinate limit), unless there are already 2 Touches stored in that region’s data structure (whatever kind you decide to use), in which case just leave it off – it’s an extra touch beyond the two you’re allowing.
  3. When a touch releases from the screen, remove it from the Array it’s in to make room for the next touch. This can be detected by another event handler (which I don’t remember the name of). Not sure if the event handler has to be bound to the Touch object or if it is in the player controller. Dig around and find out.
  4. In a level blueprint, your Game Instance, or your Player Controller, whichever makes the most sense, then Every Tick, loop through all the regions and check the Deltas of the Touches to see how they moved. Update your game logic and pawn actions etc. accordingly.

You could also just have one array of Touches and filter by X coordinate on the Tick if that makes more sense to you. It would be slightly more efficient, so you can skip step #2 if it makes more sense to you to do it that way.

There might be a more playercontroller-centric way to do this, but I consider the touchscreen to be a single input device, just like a keyboard, and Unreal Engine tends to think in terms of one PlayerController for each input device.

On the other hand, you could divide the game up into 16 clients, one of which is also a server, and have them send network code to each other. You may have to do it this way if you have 16 big touchscreens instead of one enormous wall-sized touchscreen. In that case then your question is totally a LAN/network multiplayer question. In that case, then you are running 16 different instances of the game, running their own personal copy of the game world and whatever is supposed to be happening in it, and it’s a matter of doing the following:

  1. Make the touchscreen controls work for the player on its own touchscreen device as it normally would. Handle multiple touches on the one screen simultaneously using that Multitouch (?) event node.
  2. Make all actions and movement controls “Run on Server” in the blueprint code.
  3. Have the Server perform the same actions authoritatively, overriding what the clients all would see happening .
  4. if the pawns use the CharacterMovementComponent or are a subclass of CharacterPawn, then the rest is done for you by the charactermovementcomponent. It makes sure the movement is replicated as smoothly across the network as the network will allow. I don’t remember but you might even be able to skip steps #2 and #3 for pawn movement with this component.
  5. Other actions than movement still have to be handled by your blueprint code, Use Run on Client blueprint nodes for things that only the target client should see, or MultiCast for things everyone should see.
  6. Remember that Game State and Player States replicate themselves and their variables over network connections, but Game Instance does not, and Player Controllers kind of don’t either, unless you implement replication in their C++ code. You can still send remote procedure calls (Run on Server, Run on Client, Multicast) through Player Controller class though, and handle it on the same blueprint of the target machine. I think. It’s been a long time for me since I played with this stuff.

So whether you have to handle network code or not really depends on whether you’re running 16 touchscreen devices with one copy of the game each, over network, or just one game on a really really big touchscreen device that you have divided visually (and not physically) over 16 regions of its screen.