Make a Co-op Multiplayer Game in Unreal Engine 4

preview_player
Показать описание

Here are the chapters:

0:00 Introduction: Quick introduction to the project and what you'll need to continue. You'll learn how to test multiplayer with both the server and the clients. It's important to test with both so you can find errors and fix any behavior that isn't working. You will want to test EVERYTHING when making your game for multiplayer. We'll first get the Player UI drawn on clients in this first section.

13:51 Jump Powerup: Next we want to get the jump powerup blueprint replicated for multiplayer. When the player walks over the power up, it's supposed to show on the player's UI that it has been activated, and the player can jump super high for a few seconds. The power up is also supposed to disappear from the level and then reappear 3 seconds later. So we'll get this working for multiplayer. You'll learn more about server events and the playercontroller, and how powerful it is when it comes to multiplayer games.

23:06 Death and Respawn: Getting a player to die and respawn in a single player game is easy. For multiplayer? Not so much. We need to set up some server events that will inform the server that a client has died and has requested to respawn. In order to do this, the client needs to inform the server. The server then needs to check where the player should be respawning. Once everything is good to go, the server can then tell the client where to respawn. All of this logic is happening on the server, including the respawning function. You always want to spawn actors on the server, unless it's an object just for one particular player that no one else will ever see.

35:40 Checkpoint: The checkpoint isn't too difficult. All we want to do is store the location of the checkpoint on the player. We need to use a server event to do this because we want the server to have this information for the player when the player gets respawned. So, we use a server event to send the Transform to the playercontroller. It will store this value. Once the player dies and requests a respawn, we send that location to the Spawn Actor function and respawn the player at the checkpoint location. Pretty easy!

45:24 Coins: This part with coins is important because it will teach you how to pick up objects in the world and update text values on the player's UI. Lots of good multiplayer goodies in this lesson. The player overlaps with the coin. The server gets the current coin amount on the player and then adds however many coins the player is collecting to that number. The server then sends this number to the client to update it on the UI. Yay!

54:30 Door and Key: Now let's get a door working for multiplayer. You will learn about multicasts in this lessons because we use them to update all clients on the position of the door when the player opens it. We will also update the Key blueprint we made in the previous video so that players can pick up the key and open the door. But we have to redo this code completely for multiplayer. It's not as easy as just adding variables to the gamemode and continuing. Can't do things that way in a multiplayer game!

By the end of this Multiplayer beginner's tutorial, you will have a pretty good understanding of how to do programming for games that have multiple players. Multiplayer blueprint isn't easy, and this is probably the easiest indepth multiplayer tutorial you'll ever find. So take it slow, pause often, backtrack, and TEST all the time.
Рекомендации по теме
Комментарии
Автор

Been watching tutorials on multiplayer functionality for months now, but after 30 mintues of watching this video, I learned more than all the other tutorials combined. That goes to show the quality and DevAddict's ability to explain / simplify complicated blueprint work. Keep doing what you do man! I love how learning oriented every video is

Zerbexian
Автор

If your Client is having fits trying to jump on the moving platforms, be sure to set your Level Sequence Actors to Replicate Playback so it syncs up with the Server. Found this after a few minutes of head-scratching as my Client dude fell to his death repeatedly.
Thanks for the tutorial @DevAddict. Much appreciated!

fletchlockgaming
Автор

For JumpPowerUP section, make sure you don't use ToggleVisibility but Set Actor Hidden in Game as DevAddict has modified in previous video. Otherwise you will run into issues.

denizorsel
Автор

If anyone has any issues with not having a character between Starting New Player and On Post Login, make sure you delete Starting New Player off your BP grid. I tried both and neither worked (4.26.3). I didn't get a character. It was only after I messed with it and deleted both, and re-added On Post Login that I found this.
14:30 Setting actor to Replicates didn't work, so I went back and setup Set Actor Hidden In Game and removed the Set Visible in BP_jumpboost.

GaryParkin
Автор

so much value in these lessons, I think watching someone debug a problem is one of the greatest lessons because you can be told how to do something right, but when there are unforseen errors learning how to resolve them on your own can be very difficult

KillerBearsaw
Автор

@23:08 Index 0 is not always the server. In split screen multiplayer, what you're saying is correct, however in networked multiplayer, get player at index 0 is just the client.

TorQueMoD
Автор

Great tutorial, your the best. I changed mine so that if one player activates the checkpoint it stores the location on the server so that if the other dies they both will respawn at the checkpoint. I also changed it so that they both share the coin count. I went for more of a Co-op rather then a 1v1.

unrealdevop
Автор

one of the best multiplayer tutoreal on ue4..

naza
Автор

Thanks, Addict, You made multiplayer really easy! I just started learning unreal 4 days ago but still, I can understand this tutorial.

nabeelbaghoor
Автор

Awesome video man! I am a beginner but I noticed something when I follow along with your checkpoint part, and I thought maybe someone had the same issue as me. When I play with 2 clients only one of them could activate the checkpoint, to solve this in the BP_Checkpoint blueprint after the on component begin overplay the true condition was unconnected and I thought simply just connecting it or maybe deleting it altogether works. The connecting part worked for me. Thank you for this awesome tutorial!!

crehera
Автор

No cap bro love your content it helps me be a game dev

nutterbuter
Автор

This just came out yesterday and I've been looking for a video exactly like this one for a year now...
Luckily I've been subbed and notified since I first found one of your vids because I knew your vids were going to be gold.

HyperCazual
Автор

Literally every unreal developer should see this video. Thanks for this!

chutneystudios
Автор

This is brilliant. Buying your courses man!

skinnylizardstudios
Автор

I discovered your channel 3 days ago and I subscribed right away because I really like the way you teach things.

And then you uploaded this video... just amazing!
I learnt so much today!

Please keep doing this server/client tutorials... and next time maybe with interfaces instead of "castings"?
It would be wonderful!

Thanks for the great tutorials!

brunoverde
Автор

Worth noting that if you just load up the project from the marketplace without doing the previous tutorial there won't be a HUD to display. The HUD asset will be blank by default, and it took me a bit to figure out why it wasn't showing up.

meathelix
Автор

It’s been a few months since I saw your other video on how you set up the level environment and now I’m watching this one lol

blackheartgaming
Автор

This was AMAZING! Thank you so much for answering my questions, and letting us see how you were debugging the multiplayer functionality. I took like 5 pages worth of notes by about the halfway mark. I'll for sure be sending people to watch this. (I totally thought you were going to keep the "as hanging" in the code. :P)

Gatlen_Shado
Автор

You are litteraly Brackys for UE4.
Thank you for your great Tutorials ❤

desawwww
Автор

Great beginner friendly content! I love ur explanations XD

AphixDev