Come Learn Blueprint Multiplayer with me! (aka 's a Glutton for Punishment)

Chek bool?

There seems to be a small mistake with the image.
I recreated it using the bool that you created in the Gamemode’s function output ‘Found Player Start’, that you didn’t appear to actually use in the Pawn construction script.
If I don’t make use of it, my guys spawn at the same place, and if I do branch off the bool, it works as expected.

Strange. You’re right that I didn’t end up using that bool as I did some better coding in the PlayerStart function. However, I seem to remember having some issue like yours (it was a while ago!) and that’s why it was left there. Looking at the code, I think it might bug-out if there aren’t enough PlayerStarts in the level tho. But that doesn’t explain it working when you branch from the bool.

pawn movement

Strangely enough, when I don’t branch I get no errors but the pawns land on each other. When I do branch they start apart but I get errors/warning when I close PIE… the kind of errors that dont’ seem to refer to what’s actually causing the problem.
I gave up and went to sleep.
One of my moving pawns was updating one both monitors and the other was not (and I couldn’t control it when that window was active).

There’s a little gap in my knowledge … your input events (like move forward and turn) must be repeated exactly, or they only apply in the context of your game example?

Thanks for this, . I’ve been following your work as I find my way through replication in UE.

Has anyone had issues related to cosmetically destroying the player’s pawn? I think I’ve implemented the respawn functionality correctly, but I believe I’m destroying my pawn incorrectly. The client’s connection is occasionally dropped when destroying the pawn before detaching the player controller. This feels specific to the way I’m dealing with the vehicle movement and mesh components, but I’d figured I’d ask here anyway.

I created an answer hub question here, in case anyone can share any insight: Client connection dropped due to GUID with no object on server error - Programming & Scripting - Epic Developer Community Forums

It’s been interesting looking at the solutions on this thread. However, while these work when run locally or over a fast LAN, they are useless when used over the internet with any sort of latency. If you open the console in one of the clients and set the simulated latency to 100ms, you’ll see what I mean. The game would be unplayable.

I’ve been experimenting with my own solution, which simulates things on both ends (so client side prediction) but finding that the server authority makes me skip backwards all the time - I’m not sure if this is because the simulated lag is poorly implemented or not though.

One thing I’ve been trying to find is the setting to make the client authoritative, because in my case I don’t need the server to be authority all the time. Anyone happen to know where that setting is?

EDIT: I think I’ve confirmed it, simulated lag set on a client only simulates the sending the data from the client, not receiving from the server, which is instant if run locally. This I believe causes strange issues you wouldn’t see with real world lag.

I think 100ms is already sorta unplayable even for shooter with client side prediction, so let’s not even go with some demanding game like fighting games.
Yes, there are other genre that can survive well even at 150~200ms, but generally speaking, below 75ms is common sense, and for action oriented game you want to have below 50ms.
Depending on what type of games you do, hiding the latency does not mean it’s gone for good, for example Battlefield that plagued with robber banding, I’ve even saw people that prefer just pause their game if it’s out of sync too much.
(What’s good if your client prediction is hiding so well that you thought everything going your way and suddenly reverted and you are the one getting killed?)

server side management is good for game you want to prevent cheating, but you might need to plan things out and even re-write some underlying input update module.
I believe it’s also part of Epic’s road map to update this bit so client input could use less bandwidth if it’s action heavy.(ie Tekken 7 will use UE4, I don’t know if Epic will offer help on input side, but fighting game needs constant input buffering/updating and syncing)
So for any server side checking for legit client movement(to prevent illegal super speed, teleport etc), there will be trade off.

It just occurred to me that this might be relevant to this thread. A week or so ago I ran into an issue with replicated ProjectileMovement components, where releasing them from a fast-moving vehicle in networked games caused them to stutter on all client machines. I implemented a poor man’s client-side prediction to smooth the movement out quite a bit. There is no rewind/replay, so it’s imperfect, but it feels like a step in the right direction. I am planning to revisit this in a future iteration. Thanks to user HateDread for the idea.

Details: Replicated projectile movement components are choppy - World Creation - Unreal Engine Forums

I hope you don’t mind me hijacking the thread, but I guess my issue might be quite informative.

Alright, so in my setup the player character blueprint is using the controller rotation yaw to set the rotation of the character mesh. Upon keypress, the “Use Controller Rotation Yaw” option is set to false, meaning the camera rotates freely around the character, without the mesh rotating along. This is kind of vital for the gameplay, so it basically should only be executed when having authority. The usual approach would be the following:

And the notify function:

This is NOT working. All clients as well as the server see the mesh rotating while it should not. Only when playing as the server the mesh stops rotating, and only for the server of course.

After fiddling around a little, I came up with the following solution:

Now my problem is that I don’t understand why it works and if it has become vulnerable for hacks.

Edit: I might also want to stress that this is the only working solution I have found.

I moved to SE Asia and play with my friends in the UK. My ping is around 240ms to 300ms. Most games are playable without rubber-banding (yes, it can be a bit frustrating at times) - for example, Nosgoth plays just fine, Risk of Rain is good and Robocraft is great fun. None of these games suffer much from 200+ pings, so I have to disagree with your comment. They also all use client-side movement tied to server-side authority, though I hardly ever notice the server force-updating my position.

You can disagree but those those games you mentioned, I’m not really familiar about(except Risk of Rain).
There are one type of prediction/syncing that for example Borderland/Monaco can survive with high ping, because of their syncing only apply to selective importance, it’s not “unplayable” but still degrades the experience.
As in online games, where games mentioned above usually don’t update mob states. Sometimes it’s out of sync so much that we kill the same thing at different time and location(its really obvious in Borderland 1).
And that for any sync heavy multiplayer (team) game(ie say DOTA2, CS:GO, Fighting games in general), high lags are solved with lag spikes to ensure stuffs are in sync and fair.
Those games are what I meant that will be unplayable above certain ping, not those games you mentioned.

Also, some tricks for games especially for MMO oriented shooters, deals with very careful updates( almost not updating things not in proximity and not in your view ), or creates fake in sync appearance when in reality it’s out of sync.
ie. critical miss for your shot, moves things and slide them over a long(~2 seconds or above) time span, and other limitations/tricks(ie damage over time/fire rate/etc so hit scan can still work fairly well.)
Like I said, it depends on what type of game you are going to design and see if the mechanism allows you to survive high ping, not the other way around.
With fighting game, even with GGPO that people liked a lot, still people wonder why it can’t be better. duh, latency is physical, hiding it can only go that far for a fighting game.

Great stuff! I’m looking forward to seeing more!

You seem to have focused on the wrong point, though not knowing the games I mentioned would cause confusion I guess. Two of them are multi-player third person shooters.

My one and only point is that 100ms (or more) is a completely normal ping for about 70% of gamers on many servers, so if you have a networking model that makes the game functionally unplayable (ie server side movement only), I would say that’s a bad design. The only games I have played where server-side rules and there is no client side, are games like DOTA2 and Lead of Legends, and they aren’t so bad because input is mouse driven, so the visual feedback of moving the mouse and clicking is still instant, its just the player pawn has a delay before responding.

For my own project I tried many variations on physics multilayer, and short of server-only movement which felt like wading through treacle on anything but a LAN, you’re left with options that simply de-sync and cause horrible movement issues. In the end, I resorted to using the standard movement component, which is physics based internally I believe, which handles client & server side movement all wrapped up for you, with client side predication and sync, and works lovely even up to 300ms. It’s slightly limiting if you wanted to apply complex custom physics but there we go, that’s the trade off.

Of course high ping degrades the experience, but there is a difference between “degrades” and “I can’t play this”.

Btw, there is another thing on cloud gaming I saw today, might as well share it here. Although it’s not something every dev can afford to have, but the concept is there.

Maybe in the future we can even have this locally, instead of cloud rendering the frames, our own GTX 10K could do the job and server sends confirmation about what you did and render.
But branching for multiplayer game would be headache though, haha.

@Durandle, yes, if you feel that 300ms still seems to be playable with simulation, so be it. Playable or not is purely biased based on conditions and personal preference.
Like my explanation for Battlefield 4, some people prefer to just pause and not rubber band, while guys like you prefer rubber-band-ish smooth interpolation.

This is a very informative thread, I will be following the progress!

Just to do a response to Durandle, I clean up my blueprint posted in this thread, set the lag simulation up to 300ms(Net PktLag=300), still seems to be playable.(no, I can’t test over actual internet yet.)
So apparently you didn’t try both method. note if you intentionally delay a packet to send by 300 ms, and then have a instant round trip, it’s still 300ms lost between control input and action(as all force applied on server).
What you might actually be mention is the variance in lag, and possibly packet lost. Even epic are using those to try find exploits, not for actual real world conditions.

My test multiplayer game now consist of following.

  1. same setup for movement by applying force and torque on server side.
    all my post are still viable just remove most of the “reliable” from RPC call.
    My original post was done before I read this article, I edited my post to reflect this point a few days ago.
    http://wiki.beyondunreal.com/Everything_you_ever_wanted_to_know_about_replication_(but_were_afraid_to_ask)#Reliability

  2. proper respawn initiated by client’s controller, same blueprint as I posted in wiki. this has not changed. since it’s important, so it’s set to reliable.

  3. spawn projectile that hit and cause state change(health) and knock back if projectile hits another ship, you have physical hit response(cause offset of position and orientation).
    if you are with in radial force range, then your ship are pushed away from explosion point.

  4. fire rate is 0.1 per projectile, so even if I press to let it continuously fire, lag sim turn on, still playable.

And, this is even before I try to implement any optimization/client prediction.

So, I just have a test with friend over actual internet situation. Same city, he didn’t feel any lag at all, but complaint about the control method(6-DOF is hard to make it right for everyone before user binding is implemented).
Next time I’m gonna test with another friend from another coastal city so it’s cross Canada test( Vancouver-Montreal).

Here are some useful info.
When you test games before you have UI to do connect/host games, when you create package, using the development build. this allows you to use command line argument and console to connect/host.
If you build with shipping preset, you can only have win32 binary and all the command line arguments and console seems to be stripped off as well.
Like others posted, you need to port forward UDP 7777 from your router to your server machine, client only requires server IP to join.

Hi everyone,

maybe someone of you could help me please. I think I’m in the right location.

I’ve got a problem with a multiplayer scenario. I try to send the position and rotation of a player on a listen server to all clients. Each client will modify the rotation from the server to look in the right direction.

I’ve got this far:

This is the part of the blueprint that (at least that’s my intention) sends the location and rotation of the player pawn at listen server sets it for the player pawns at all clients.

In this case, the client should rotate -45 around his Z-axis (yaw).

The following screenshot shows the state right after spawning:

The rotation of the client is as I wish it to be. It’s rotated -45 degrees around the z-Axis on the server and on the client.

But as a rotate the player pawn on the listen server the clients player pawn is not rotated anymore:

The player pawn on the listen server that is representing the client is rotated correctly.

It seems like the rotation is only set once at the beginning of the “session”.

Can you help me, please?

EDIT: SOLVED!

I got it! Finally! The key component was the replication of the root component of my player character.

I forgot to set the actor root component replication to true. It seems a replication of an actor is not necessarily able to set the rotation of an other actor. The default player pawn of my scene, set in a custom Game Class, contains all logic for the component replication. I made sure the pawn is not rotated by the controller as well as my camera is independent from it.

At “Event Begin Play” I set the replication for the root component, the camera component and a (I guess the right name is) scene component (acting as a child of the root component but as a parent for the camera component) to true.

For the authority in the game: Mouse and keyboard input move the root component of a character “with authority”. So I made sure my whole blueprint is mostly executed on a machine with authority by the node “Switch has Authority”. The root component only gets rotated around its yaw. Only the child scene component gets rotated around pitch and roll. The camera component has a relative rotation of (0; 0; 0), relative to the scene component.

For all remote players: Their location is determined by the authority. So the location of the root component just gets replicated and can be read by the remote clients. Their root component yaw rotation is set by the authority/server. Their scene component pitch and roll rotation is set by the authority, too (based on its pitch and roll). For each remote controlled player in the game, the camera component gets a relative rotation around yaw: Index in array multiplied by 45 (from 45°, I have eight cameras in this scene for a 360 degree projection) and substract 45°, so the second remote player is seeing the same as the server.

In the end not that complicated, if you understand the principles of pawn replication, variable replication and component replication. In this case no pawn replication nor variable replication is set. Only component replication.

This is the final result:

END OF EDIT

Best,

Huppys

Hey Guys,
Thanks for the great Work really helped me set up my TableTop Game.

I solved the leaning problem by removing the Roll,

Is this the best way to do this ?

And Secondly I’m trying to apply a different Mesh to each Pawn
So that the Host has a Crown and the Rest are Pawn Pieces

3.png

Here is my Code

3.png

How ever when I do this…

It Does This

Why does the Event Begin even with a delay cause this to happen ?

Any Help Would be Appreciated

I would love to see a tutorial done on this for the 3rd person blueprints. Although the movement is replicated crouching doesn’t seem to work. Jumping does seem to work… :frowning: The tutorials from EPIC don’t get into player movement replication instead they talk about ghosts and opening chests :frowning:

EDIT:
Found the solution. On to Inventory replication now (pain in the *****)

Kool…are you making listen server or dedicated? I’m very interested in your progress. Being able to make listen servers from clients and also dedicated servers from blueprints will greatly affect whether or not I go with UE4 or other engine.