Help understanding multiplayer framework

NullPointGames
Sun, 02 Feb 2020 00:22:51 +0000
Blueprint

To start I read down through the network compendium by Cedric ‘eXi’ Neukirchen and still have a few questions I cant seem to find answers to. I have been trying to understand the higherachy of network flow because I am tired of brakeing down and having to rewrite projects. I either end up putting something in the wrong place or not understanding the best place to replicate variables from.

Up till now I have been putting almost everything into the player pawn say like the variable that contains all the objects in the players inventory that the server usually controls. In the compendium however it had a thing about the player state that if the player disconnects it can keep those variables for when they reconnect. Now I have heard these things depend on the type of game your trying to make and what type of multiplayer it is and so on. I figured I would be able to find a tutorial on the best practices but as of yet I have not the information is spread out or doesnt exist.

Alrighty well I could write a blog with all the questions I have on this subject. So I would like if anyone knows a tutorial or a more in depth description on the best practices for dealing with multiplayer flow control. I mean this really should be a thing like I just learned that you can use a function in game mode using the player controller to change the players name. Now I could only access this variable from the player state but if you look up the node for change name other than where to find it; almost nothing exists to tell me how best to use it. I had a chat system I copied from a tutorial where they made a custom variable on the controlled pawn for the player name and set that. Now while that works as you can see these functions already exist but without a best practices thing to help dev’s find these simple things already built in they get missed.

The tutorial dosent need to be super extensive like the compendium some basic knowlage of coding would be expected. Just go into details of what these (game instance, game mode, game state, player state, player controller, and controlled pawn) are best used for and how to utilize what’s already built in. As I would assume depending on what your doing in single player these will mostly be utilized in multiplayer games since there isnt much light shed on them in many of the tutorials.

Oh also something on smooth gameplay would be soooooo helpful like how to do something client side and then do basicly the same thing server side and overite the relivent info on the client side. Best example I have which is a problem I am dealing with at the moment is I want to drop an object from the player inventory. Now without going into to much detail about the code I spawn the object client side to keep it smooth so the player if say is lagging a little bit doesnt have a brake in game play. Then I spawn the object server side and multicast to everyone that this was spawned. This however spawns 2 of the same object for the owning client and what I’m looking for is the server side to overwrite the object the client spawned. This is just one example but I have come to believe it’s best practice to do it this way. It seams to get either ignored, overshadowed or not even considered when people make tutorials on multiplayer mechanics.

Anywho before I drone on to much longer I really hope someone can point me in the right direction. In my opinion this should help people and possibly make games more stable having a clear idea of best practices and use what’s already there.

9 posts - 1 participant