Before i start, i would like to say sorry if my English isn’t very good, i’m french, but i hope you’ll understand the point ^^
Well, Recently i started working on Unreal Engine 4 (4.20). My objective is to make an RP Game like Gmod Dark RP, and actually, he looks pretty good i think ! But anyway…
I started making this game without anticipated the multiplayer side. I made this game entirely like a solo game for now and i watched some video who speak about the multiplayer point and i have to say than i’m very affraid to begin this part x)
My question is the following :
Is the multiplayer part meaning a lot of rework for a game thinked previously for a solo game ?
For example, i would like to know if my main Character BP have to be all rethinking for multiplayer ?
If like, always for example, i have some variable set for animation transition when i’m doing some action, i’m affraid than one player make an action, and all player on the map get in the animation.
I have to make that, so i’m not affraid to learn how to adapt the point.
It might look rather simple at first but you quickly have too many balls in the air and those ball are not the same weight so you don’t know which one to catch first. You need a solid understanding of where the different Blueprint classes live and who owns them.
Is it only on the server? e.g GameMode
Is it only on the client? e.g UserWidget
Is it on the server and owning client? e.g PlayerController
Is is it on both the server and all the clients? e.g Character
Is the Actor you are calling a RunOnServer event owned by the Client calling the event? If not the call will be dropped.
It is also important to know that only the server can replicate things so if you set a replicated variable on a client it is never replicated to the other clients or the server.
UE4 makes networking very easy to implement (at least for fps/tps local lan games), so you shouldn’t really need to rework your project much at all…
In simplest terms, to create a networked game (local lan at least), pretty much all you have to do is call the “Create Session” node on the client you want to be the host, and call the “Join Session” node on the client you want to join, and UE4 handles all the rest for you
UE4 also uses an “actor replication” approach, which means that any actor on the host is automatically replicated - shown and location/animation/variables automatically updated - on all connected clients (you can also set whether you want any/all of the actor/blueprint variables to also be replicated to clients or not)…
There’s a good example to get you started…
In the UE4 launcher go to the “Learn” page and scroll down to “Gameplay Concepts”, open and download the “Multiplayer Shootout” tutorial project… If you look at the blueprints its pretty quick to see how it sets up and replicates a networked game (it also has a documentation link on the download page)…
@GamerP57 I wish I’d read your comment before I attempted my multiplayer game. Would have saved me months of frustration! I would like to add that Character classes with CharacterMovement component are special, as they actually DO replicate, smooth, and predict movement between them and the server (whereas nothing else in the engine does unless you code it to), via the SetControlRotation and AddControlMovement (I think that’s the name) functions.
Every other kind of actor in the engine does not work like that so you have to explicitly tell the server what moves to make and it has to explicitly tell all the clients what happened when any actor on any client moves.
You will get choppy lag and rubber banding on everything except Character class and anything you have coded your own special network movement code into, and except on replicated Timelines.