Download

Server Replication and Events Questions (Multiplayer Games)

If I call an event on the server to perform a task (Simulate physics on an object) it will not work because I need to call a multicast event as well so that it runs both on the server computer and on the clients’ computer and this is also true for calling variables.

But if a new player enters the session will all changes made to server before this player enters the server be downloaded to him? Or do I have to create custom events to get the state of the object and variables on the server to set for this new client that joined?

Note that I always replicate all variables and static meshes and blueprints as well.

If a new proprietary client that entered the session obtains a variable that has been set by the server, before it obtains this variable, the new client will need to obtain the server variable to make this owner client see the variable when calling a client event for the server to get the server variable and set it on the client itself? do I have to do these dynamic custom events to allow the multiplayer game to work correctly for players who join later?

Or will it be that automatically when a player enters he will load everything that is replicated on the server and changed and set for himself? If not, now I understand why some games wait for all players to enter before starting the match and without allowing new players to enter until the match restarts and when the game is over the game simply restarts the level. But I still have many doubts.

Why do some events need to be called in multicast to work on clients and why can some events be called only on the server that is automatically run on clients?

That’s all for now, I’m developing a game but these doubts shake me a little.

Well, You refer to OK, if a pawn/character felt into ragdoll, And client joins you want to see that pawn/character into ragdoll. well you have the repnotify varaible kind,

If a client joins and a variable is tagged as repnotify that event will be called in the moment that he joined and so it will fall into ragdoll.

you could also assign it on the tick but that would be a waste

That is what I know about networking. https://www.youtube.com/watch?v=OFQ6…2Ee2i3kgo0PbGm

In here you see all the ways to replicate something.

Don;t take my knowledge as solid as it’s not I just know how to replicate something for all clients, when they are ingame and when they are joining…
I have not studied TCP IP libraries and stuff like that… I’m not a pro by any mean…

For instance if you wanted to play an animation all the time, and so you want the client that joins see that animation, you’d have to use repnotify, replicate the startTime, name and all other animation variables, So in the repnotify event would look something like that.

OnRep ConstantAnimation
{
pawn.StartAnim( MyAnimName, StartTime(CurrentTimeCachedFromServer), allother parameters here )…
}

That didn’t answer my question much and I also work with blueprints