#multiplayer
1 messages ยท Page 301 of 1
https://www.youtube.com/playlist?list=PLZlv_N0_O1gYqSlbGQVKsRg6fpxWndZqZ I've been following this playlist, I'll grab a screenshot from the lobby bps quickly
this is from the lobby game manager
Connected player widget, the text in the widget is bound to the required vars mentioned in the video
This is all from the tutorial?
Why the hell is a PlayerController array in the GameMode set to replicate
Ok so, one step after another.
What do you mean "as soon as the game starts"?
@winged raft
I never done this tutorial and I don't really have time going through it
And what do you mean with PlayerNames to appear
You get it in the widget from the PlayerInfo
Where are you actually setting that variable?
Sorry, I'm back now, there is more but I'm not sure how much to show in here
this shows the problem, the widget which has "host and not ready" are also meant to show the players name, character selection image and avatar
Well, the Lobby showing in the MainMenu is probably cause you call to show it somewhere
Is the MainMenu an extra level?=
it is a level in itself, same with the lobby
Then you are, for what ever reason, adding the lobby in the mainmenu too
I can't tell you where, cause it's your code after all
So search for Create Widget nodes in the blueprints that the MainMenu uses
and check that you don't add the Lobby there
For the PlayerName, my question persists: Where do you set the PlayerInfo that you query in the Contruct method of the Widget?=
As far as I know, the players names and avatars are set from the connectedplayer widget http://puu.sh/su8h6/0d923ddb93.png
when a player joins, it is displaying the not ready message which makes me think it's in the widget itelf but it could be throwing me off
The bottom row for this has the struct array which collects the player settings such as name, avatars and then passes the information on to the player controllers connected players array
it then calls update player info which is then used to call update player window called creating the connected player widget and that adds the child
yes
Weird that hey have RPCs and Replicated Variables there
Only the Server has this Class anyway, but ok
Sooo
What does "initializeSelf" do?
The line beginning with Event onPostLogin?
The function being called inside of the PlayerController
That calls the check save game function and then calls the callupdate event
check save game checks whether the game has a save in slot 0, if not create a new save if it does, it saves over the old one and loads from it
The thing is
I still can't see where that PlayerName is actually set
OnPostLogin gets called
The PlayerController gets added to an PlayerController array (why ever his is replicated)
Then we get the GameIntsance, which is the one of the Server, and fill in the Replicated Variables
Where I also don't get why that happens
It's always on the Server, it's always the same GameIntance
And the replicated Variables can't be queried by the Clients, as the GameMode doesn't exist there
Further on, you cast the PlayerController to the LobbyPC, which is ok
then call Initialize Self, where you do some savegame stuff, what ever that is
Then setup Lobby Name does probably give the Client the ServerName ,so he knows it
cause, remember, GameMode doesn't exist on clients...
Then UpdateLobby Settings is also on the Client, which passes image, mapname and maptime, that's also fine
Then it respawns the player
Which is replicated to Server (makes no sense, we are on the server) and destroyed any possesed pawn (ok) and creates a new one
Then again a Server RPC (not needed to be an RPC) which goes through all PlayerControllers and tells them the new number of Players (is ok, but not the best way)
The we have another loop that passes all PlayerInfo to the all Players
That's ok, but at this point, the PlayerInfo already needs to be filled
It adds the PlayerInfo of the PlayerController to that array and passes it
So before that happens, you need to have filled this information somewhere
I see what you mean, I'm not really sure what to say
it is one of their playlists on their youtube channel
-.-
yeah, I've been going through the videos a couple of times double checking
Guess I need to talk with who ever made that tutorial
Anyway, where do you fill that "PlayerSettings" Struct of the PlayerController
it needs to happen before EveryoneUpdate is called
This should also be stored in the PlayerState and not PlayerController
That's what the PlayerState is for
@winged raft As far as I saw, you have a Function in the PlayerController (LobbyPC) which is called "Initial Setup"
This is called on the Client
THis is passing the Server the PlayerSettings
yeah, I'm just taking a look through it all, see if i can follow the chain
I have no idea, I've been following this to learn how to set up networking and create a lobby system
Uff
Ok so, an RPC shifts the call over to the Server/Client or everyone
That implies that there is a Server Version /Client Version or everyone has it
A Widget only exists on the Client
Of course everyone sees the Lobby
but each Lobby instance is local on the client
There is nothing to call an RPC on
welp
I will ask around a bit to get some info about who and why this was done
But in the meantime (it doesn'T hurt, it's just not doing anything and is kinda useless)
let's find where the playername is set
Ok, so the PlayerInfo stuff gets loaded
In the load game function
in the LobbyPC
There is no custom info in episode 16 yet
The reason why you don't see anything is, that there is nothing
You don't have any savegames that actually have data
that's probably coming in a later video
ah, I might have been a bit confused then because in the video when they tested it all out it showed the same name for both players along with the avatars
Yeah, he's setting up some random stuff in the variable at some point
I'm searching that
So on the first launch
it will check if there is a savegame
if not
it will save the game
So I assume, there it saves the data wrong
I've just taken a look in the options where you can set your name and avatar and the info appears to save
Ok so the Info gets passed when the widget gets created
so it's not default set in the widget
that means the PlayerInfo Variable in the PlayerController needs to have values
Default values
And you need to make sure, after you entered them, that you go into your project folders
and delete the savegame file
so it's freshly created
Means, ProjectFolder/Saved/SaveGames
yep, just deleted them, about to check now
Alright, appears to show the names I put into the default values along with the images
Cheers
YO so
I put up this
Hey everybody,
most of you might know, that I'm in love with Multiplayer things. That's why I wrote my Network Compendium.
Today, I gave someone on the Discord Server some help, while he was fighting with the "Blueprint Multiplayer" tutorial on the Unreal Engine Youtube Channel.
He posted me some screenshots and I was kinda confused by what I saw.
Before we start, I want to make something clear:
Aye @thin stratus ^^ Those are some of the very reasons I tell people to be careful when following those tutorials.
well written, im excited now for my upcoming need to learn how to do multiplayer... yay.....
Thanks!
@twin juniper would currently not suggest taking that series
It teaches too much crap that you would need to unlearn again
Rather read my compendium first
ah thanks for that info! I was going to do it the other way around, assuming that the youtube series just did some bare minimum
so knowing that now, I'll do your compendium first and their youtube series later or not at all depending on how things look at that point
You'll find tons of things in the series where you will be like:"Why the fuck do they do that, it makes no sense. "
Like stated on my forum post
Just skip it for now
If you have network questions, just ping me
@twin juniper
Hey guys I have some questions
I am trying to setup a time attack mode but I dont know how to handle timers for each player ( like TrackMania for exemple )
For now; the gamemode is updating all playuer's timers
But I cant let the gamemode replicate a variable every ms
And on the other hand if i let each client update their timer themselves they can cheat right ?
I'm not the best when it comes to multiplayer but would it not be better to start the timer on each client rather than monitor it all at once?
@civic vessel Put the timer into the PlayerState
Each client has one and it is replicated
Game mode is not made to track game data
It's really just for rules and setting up the game
The timer is in the playerState, i'm incrementing it form the Gamemode @thin stratus
Because I dont from where should I update them
Or for a global timer use the GameState
What does your timer look like
An actual timer
It's just a float that i'm incrementing every tick
Yes
If i do it this way, the timer wont update smoothly on client no ?
Why not?
I dont know, I'll try
I mean
You can let it run on server and client
So the client doesn't have a feeling of lag
But let the variable be replicated so that he still has authority about it
He = server
Okay
Should other players see the time?
Yes
Yeah okay then this should be the way
Thanks I'll try ! ๐
Awesome ! It seems to work as expected !
Cheers
Where should the GUI be spawned / stored for a multiplayer game?
Gonna put spawn it in level blueprint + store it in the game instance, looking at the multiplayer sample.
@native axle, depend of what kind of informations you want to show
does replication work with int64 ?
@eternal anchor, Yes I use it for experience and gold on my game
Oh I use uint64 but int64 will work too
ha
so someone can overflow gold and experience in your game
I wonder how many thousands of years they'd need with an int64
@cloud ledge, with an int32 you can only store around 2 million (2^31) ๐
I wish with updates it was something to look forward to but it seems like every UE release I spend most of my time fixing bugs.
@golden granite, update when you need it and stay when the version seem to be stable for your project
I needed the features in the update, but it also broke several things.
like ?
The set input mode bug. Some reason I have to set input any time I exit window focus. Also, box collision component simply doesn't register touches on mobile anymore. Not sure if overlaps still work.
Touch works in PIE, but not once compiled.
@rare cloud thanks ๐
@rare cloud oh i probably shouldn't have said GUI, I was talking about the main menu.
this is in the server screen widget
this in the game instance (called from the server row widget)
can anyone see what I'm doing wrong with the advanced sessions plugin? Using the create / find session normally works but the plugin nodes don't.
This is just to show a server list, not testing the joining part yet.
@native axle, to make a Main menu simply create a Level, and override the GameMode with your MainMenuGameMode
create an HUD and create your widget object and add it to the player viewport
set the class to your game mode
I guess this tutorial can help you ๐
@rare cloud Thanks for the help, I know how to create a menu but I had a problem where playing multiplayer spawned 3 menus on top of each other when you had 3 players. Luckily I figured it out that I just had to turn off auto-connect to server.
@native axle if you have this, then you probably added the menu on begin play
In an actor that was replicated to everyone
So the begin play for that actor got called once for each player on every other player
Aka 3 menus for 3 players
Makes it 9 in total
Pawn seem to be a good place to replicate with other players
@thin stratus yea that's what I had setup, put it in the begin play in the player controller. I looked at the network compendium thingy and it seems like the only things which aren't replicated are the hud and widgets? So following the unreal samples I put it in BeginPlay of the menu level.
@rare cloud The problem is I don't want it to be replicated
Auto connect to server should be turned off in mainmenu, yes
PlayerController would only make the Server go spawn multiple menus
Clients only have their own anyway
In general, you wouldn't use a game mode or any other special class for the mainmenu
You can though, but spawning the main menu in the level blueprint begin play and letting the GameInstance handle the creation and reference
Is good enough for most cases
@native axle
@thin stratus Thanks for the clarification. I think I need to follow the samples more carefully instead of guessing how things work ๐
oh you're the guy who made the network compendium, really helpful so far ๐
Cheers
What is the best way to update a value in the player state from the client ?
If I update the player state from a server rpc, it takes ~1sec to update
Client wants to push a value to other clients?
Well yeah, ServerRPC and then set Replicated variable
Calling client should set variable himself too, so he doesn't need to wait for server to push it back to him
I tried something like this, but the client puts himself wrong values, the server does not overwrite it
Then your logic seems wrong
If you use the same value for the RPC and the local set node, it cannot be different
First set, then RPX
RPC*
Yes but for exemple, if client's PlayerState has some wrong values, and then the value of on the server's PlayerState updates, it should overwrite client's values no ?
yes, Server is authoritative
I managed to get it working ๐
Someone can help about enable Steam on dedicated server on Linux ?
It crashes on launch
You'll have trouble finding people knowing about steam ded server on windows
So good luck on the linux part :/
hi slackers! i have a weird bug, i have network replication code that works perfectly in PIE (and was working in an earlier build), but no longer works at all when i package my project... has anyone come across anything like this before?
does it work when unchecking use single process?
am having a bit of confusion over network replication ....
why is client's controller Has Authority getting false
isn't client the owner the controller. hence the ability to run RPCs?
@orchid cairn
has authority simply returns true on the server and false on the clients
I think what you want is "is locally controlled" but I am not sure
@snow cliff so it's not a refelction of Network Owner?
from what I know only owner can run RPC
clients can run functions on the server on objects they own
the server can run any function on any client
yeah is there a way to return the ownership?
thanks for the idea of using locally controled it seems to work. but this only works for pawn
return the ownership?
so clients can modify other clients?
Pawn --> GetOwner in blueprint gives null..
no
client can modify itself right
can run RPC..
@snow cliff problem is still there when i select dedicated server
get owner gives you the controller IIRC
sorry what do you mean uncheck "use single process"?
press the little triangle between play and launch, go to advance settings, the option is at the bottom
what do you even want to do @compact gulch
maybe its easier that way around
unchecked that option, still works in PIE
@snow cliff there's no particular issue i'm encountering. manage to solve it with locally controlled. but just a bit perplexed that an Owning Client can have Authoriy = False
just checking if my assumptions are right
is locally controlled will return true for both client and listen server wont it?
has authority is a bad name, I got confused by that aswell
but it simply returns whether you are on the server or not
@compact gulch You got Copys of the Controllers across Clients/Server. Has Authority is just to see if its a Server
I think there are some exceptions when you change the base structure of the multiplayer in C++, but for most cases, its as simple as that
Is Localy Controlled only true if its your Controller
the only thing i can think of, is i was playing around with nativising blueprint assets (but didn't work as one of the plugins i use doesn't compile correctly)... could there still be some blueprints which are compiled? whats the UE4 version of clean and rebuild solution in blueprints?
copy your network code into a blank project, and see if it works there
right . thanks for your feedback.. this is really really a 'my life is a lie' moment.
btw is there a way to do GetNetMode() in blueprint?
Is the spectator pawn only supposed to fly around or we can actually see trough player's camera ?
Hi, OnPostLogin is called when i hit play button not when the player joins the game. How to change so that it works whenever new player is connected to the game
@spark igloo look at advanced settings there is an auto connect option to uncheck
@rare cloud This doesn't solved the issue. OnPostLogin Event is called When play button is Hit
I amusing GameMode class n currently i am developing in Version (4.11)
@spark igloo, Ok I haven't got the 4.11 but I can create a 4.14 blank project with a GameMode and try if I can reproduce your issue
are you using C++ or blueprint ?
I am Using Blueprint for this [ multiplayer ]. But the project have few C++ Files to fetch data from server
Ok well your GameMode is only used by Server not client
client has an another GameMode
Ha But in my code i used OnPostLogin Event in GameMode n it inturns check if the playerisconnected event which is in the game state. So that I can check if all the player are connected so that the game will begin. How do i make it work so that when the client is connected to the session only when the client joins not when the play button is hit
@spark igloo, you have the same gamemode client and server side ?
Ha i used same GameMode
and PostLogin is called on client side
To try something like this I guess you need to launch as standalone game
because Global Default Server Game Mode doesn't work with PIE, or maybe I'm wrong
The idea is to create ServerGameMode and ClientGameMode if you use a dedicated server
Ha i used Switch has authority node too n run in the standalone mode but this issue still raises. I am using it as a ListenServer
iirc someone was interested in SpatialOS here, Improbable sent me an email about game that using it, Devs giving away Steam keys for betatesters: http://www.playlazarus.com/
Lazarus is a top-down action-oriented sci fi twist on Groundhog Day where thousands of players survive together in a huge persistent real time world, where dogfights, foraging for resources, and exploring exciting new tech combine into a tumultuous 'MMO Roguelike' that turns back in on itself every week like some kind of ultra-futuristic Ouroboros.
are there any docs on how to use winsock in UE4 ?
some one is asking about "websocket client library"
dayamn.. seems that a level has to be "visible" on a server for a client to be able to walk on it ๐ฆ
trying to do a multi-room co-op game, and only have each player's current room visible to them (so turning them on and off as they go through doors), but if I toggle "should be visible" for the level on the client only.. they fall through the floor.
Works if I also toggle visibility on the server, but then a listen server will have multiple rooms visible. Suppose I could just not support a true listen server and always run dedicated
anyone know if in RPC, _Validate functions are run on server (for example if u call from client)
so would it be comparing local client value with server to validate ?
No, you'll usually use that to compare the parameter or something like that, it is run on the server
The validate function runs on the server when the RPC is called
ah cool, so calling it on client, will then validate it on server
Sorry, shouldn't have said no ๐
cool thanks xD
Does anyone know of a site or group that offers mentoring for unreal?
@brittle sinew Are you saying that when a server runs a Client, WithValidation RPC the validation runs on the server?
From reading the generated header files for a UCLASS with validation, it is my understanding that the RPC validation always runs wherever the RPC runs. (The code is pretty much if (!this->Func_Validate(Params)) { RPC_ValidateFailed(...); return; } this->Func_Implementation(Params);)
So for a Server RPC it runs on the server, for a Client RPC is it runs on the client (it is also my understanding that the server is always the originator of a client RPC that runs remotely -- clients cannot invoke client RPCs on other clients' actors)
I couldn't tell you for sure either way, I just saw he was asking about a server RPC
Plus, not really sure what the outcome of a client validation function would be, it's not like you'll be disconnecting the server ๐ , and the server is meant to be authoritative over clients, so I'm not sure you would want to let clients decide if a value is correct or not.
@brittle sinew Actually, that's exactly what the docs say it could do: https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Actors/RPCs/#validation "it could notify the system to disconnect the client/server who initiated the RPC call"
Designating function replication across the network
I mean...I guess?
(and I believe that's what actually happens)
Then at that point you have a client-side way to tell the server to disconnect itself, that just doesn't seem like a great idea to me, not sure
Oh, no
The client disconnects from the server if the server sends an RPC that fails validation
The other clients remain connected
Well reading from what you linked... it disconnects the server who initiated the call, no?
Right
I haven't really messed with that, I couldn't tell you. I wasn't looking to say anything ๐
Yeah and I guess you're right there, I was just misunderstanding
I welcome conversations about this topic, because I find the networking docs a little bit lacking / unclear overall.
So I've spent some time digging in the engine source and doing trial & error to figure things out, but there's definitely room for error in my understanding. ๐
But yeah, I think FObjectReplicator::ReceivedBunch returns false on the client after a WithValidation validate call fails, which causes UActorChannel::ProcessBunch to drop the connection -- which would mean the server disconnecting the client or the client disconnecting the server, depending on which way the RPC went. The RPC validation code seems to be invoked from the UHT generated header for your UCLASS, where it creates an execMyMethod function that is responsible for calling the MyMethod_Validate, and if it fails, RPC_ValidateFailed followed by an early out, and if it succeeds it calls MyMethod_Implementation, which seems to imply to me that it's running validation on whatever endpoint is receiving the RPC.
Ok so I'm probably doing like 1000 things wrong but I do have just one question at the moment, how do I define the server separate from the client? For instance for a dedicated server do I package a specific build that has the server specific stuff? Or do I just package everything normally and have some setting I check to tell it that it's a server and has authority?
I ask because I'm using Switch Has Authority nodes but I'm not sure where to actually set who has authority
@unique canyon You dont manage network roles yourself, in a dedicated environment the Server (dedicated server running on a box somewhere) is Authority, any Clients (the actual players) are the Remote machines.
So unreal just defines it on it's own?
I don't necessarily need to specify what is and isn't a dedicated server or a client?
The Networking architecture that UE4 uses which is called Server Authoritative dictates what is the Authority (always the Server) and who is Remote (always a player)
Right I'm asking if I need to do something specific to setup the server. I'm following the documentation and that PDF about multiplayer networking and I don't know what I need to do to keep the server-specific stuff on the server only like they suggest
Using SwitchHasAuthority ensures that you manage your code either on the Authority (Server) or Remote (Client) side
So the code exists on both but only executes on the one that's specified as authority? So my question then is how do I specify who has authority, do I build a specific dedicated server build?
Or just have some option in game?
In a Dedicated Environment, you need a Source Build to create an Dedicated Server executable, you cant have a Dedi Server with Blueprint only projects.
If your running a Local Environment then the Host is considered the Server (or Authority)
Hmm, so I guess I'd be limited to listen server setups until I do some dedicated server executable?
I'm also trying to figure out a method to get players to 'log in' (rather just for testing I just want them to enter a name and connect to a designated IP)
However there isn't a login node so I guess I have to figure out how to make that function myself
The Online Sub System collection of nodes should help you there.
Unless you are running on a C++ build?
I read that was only for stuff like steam/xbox/etc.? I just want to connect to an IP, I dunno if there's something for simple testing using the subsystem
And I'm not sure, so far I've only used blueprints so I guess not
I should specify I'm more art oriented haha so coding is still pretty nebulous to me, I'm trying to learn though
You can use OpenLevel to connect to remote machines
Passing an IP address as the levelname will assume that connection
Ok I'll look into that. That sounds perfect, one last thing, when I first start the game, would I give the player a playercontroller right away, or would I wait until they connect to a server?
Like does the main menu/login screen need a playercontroller to function?
A PlayerController is ALWAYS assigned to the player as soon as the GameMode is created (for a Server Environment)
Or PostLogin has been called
Gotcha, so I'll need a gamemode with a playercontroller for the main menu/login screen as well?
Login Screen you could stick with the default, its up to you how you handle it.
Oh there's a default login screen?
No i meant the default PlayerController
Oh, gotcha
And then give them the specific controller I want them to have when they connect to my server?
That sounds perfect
Thanks for your help! I'm struggling with this but hopefully I'll have something half functional today haha
You assign a "specific" controller via the GameMode, the Server assigns the PlayerControllers to players as they connect
Yeah
Generally i have a dedicated GameMode and PlayerController for the out of game Menus
Gotcha
That's a good idea since I can do fancy stuff like having a little environment that moves and stuff to give it a bit of interest
Oh, and actually, I'm not exactly sure how to send variables to the client, or have the client read it, or something. I have them set to replicate but I'm not sure how to actually read them
I specifically want the players health to show up, as well as progress of capturing the point
Where does the variable live? Did you put it on the player controller or on the character?
You might want a custom player state for that, then.
Yeah I was following that
The player controller only exists on the server and the client that owns it, not on other clients (IIRC)
The player state exists on all clients
You shouldnt replicate on the PlayerController
Right... So it's the player State that needs the health variable and stuff?
I see, Ok! That explains that haha
How about an object in the map, like a capture point, how would I have the player hud reflect the progress of capturing?
Replicated variables are only replicated when they change on the server. If a client changes a replicated variable, it is not updated on the server.
So you would typically use a server RPC to update the variable
Right I don't want to change it I just want a bar on the players screen to change fill progress based on the control point on the server
What's the node for the RPC? I can't seem to find it with the search function
Custom Events are used as RPCs
You can set their role on the details of the Custom Event node you create.
Alright, that's about all the confusion I had, thanks a ton guys
You're a great help
Good luck
@fossil spoke Thanks for the assist, I haven't done any RPC stuff in BP ๐
No worries, if you have further issues just ask.
Where is player state exactly? Googling says each player controller has it, that it's defined by the game mode, but I can't find the actual player state file
Should I just make a new one that inherits?
You need to make a new one yourself
Oh, ok, that solves that, thanks haha
Ok I think I've hit another roadblock. Trying to have the gamemode assign a character pawn to the players once play begins, but the node I get from click-dragging the character blueprint into the gamemode blueprint isn't connectable to the pawn possess node
A Character is an spawnable Actor, you need to Spawn it in the world and have a reference to that Character before a Player can Possess it
Oh, so, do I need to spawn all characters that a player would be able to select and have them in some far away spot?
I can't refer to a saved prefab or anything?
Not particularily, if your allowing the player to select a particular character like in an RPG for example, once the Player makes their choice, then you would spawn that Character
I see so I'd have a selection screen that spawns the character and once they confirm their pick then it would have them possess it
Ok that makes more sense
A selection screen could probably only just display the "characters" mesh, since the Player is only making a choice at this point you only need to show a graphical representation of the Characters that they can choose from, once they make their choice you can spawn the actual Character they chose
Hmm I was following a guide to set up the pawn possession but the option to create a reference to the character doesn't seem to be showing when I right click on the blueprint
Yeah
Oh, right, that guide has you right click on the level blueprint... hm
Spawn the Character, assign it to a variable so you cana ccess it later, possess the character for that Player
Unless you have specifically multiplayer questions i recommend you ask your BP questions in #blueprint
Just keeps the channels on topic is all ๐
No worries
Er, one last thing before I switch over since you're here, is there a method to just tell it to use the playerstart spawn?
It will always spawn at a playerstart
If you have one in the level
Or are you talking about Spawning the Character Actor?
The spawning node, yeah, it's giving me an error saying it needs a transform
When using the SpawnActor node you need to supply the Transform for it to spawn the actor, the Transform defines where in the world to spawn the actor, you would need to get the Transform of the PlayerStart and feed that into the SpawnActor node for it to spawn the Character at that position.
Gotcha
I was able to just plug in origin (0,0,0) and it compiled however curiously once I click play it doesn't give me a pawn and I'm just floating around
Not sure exactly why
You probably spawned it inside some geometry which exists at 000
Ah, I see, lemme try your technique then
It can be frustrating.
We all go through that. And it's even worse if you haven't learned the framework of UE4 yet or at least got most of the stuff learned to create a decent Singleplayer game
networking isn't as bad as it seems.
at first its challenging but once you get the concept things go fairly well
just do a whole night nolife and you'll get thru
What are the best resources for learning networking? We've only done offline games but are looking to do a multiplayer one now. 1vs1 duels, like how online CCGs work
I've got exi's network compendium
Your best bet @vernal wave would be to check out the pinned messages for this channel ๐
I'm lurking on this channel to learn network stuff, and I'm starting to go through tutorials
it's great that people are so helpful on here!
Its why the community was created ๐
Who's want to be my private MP tutor?
๐
I have about a month off of school, I think I am going to divide my time between Tech Art (Materials/Particles) and Multiplayer
Do you pay with pats on the back? I enjoy those the most.
I would help but the time zone difference is crazy ๐
@fossil spoke Ha, since I don't have an actual time schedule on breaks...I can be awake at anytime ๐
@wary willow wanna join my "let's learn multiplay" crew?
Hey guys, Pls help me with this issue
I'm trying to create a mutiplayer. When i keep 2 players, the server is picking the default pawn but the client is showing at (0,0,0) in the viewport. \
That might mean that it had some sort of error either spawning or possessing the pawn, I would check GetPawn() when this happens to see if it's valid
Hey all, quick question. If I'm trying to set up P4, what's the best way to do it? I followed their 5minute tutorial, and I tried port forwarding my router, but no dice. ๐ฆ
It reads it internally but not externally.
Thanks @regal hazel
@wary willow Personal multiplayer teacher? Payed? :P
@Jackietkfrost P4 is not really multiplayer related or don't you mean perforce?
You might have more luck in the more general channels
is anyone here running multiple dedicated servers in one windows instance? if so, could you share your launch script that ensures each instance is running individually? i can get singular ones going ok (like how ARK does it) but the second you have multi instances things get complicated (or at least in this corner ive painted my self in it is)
What exactly fails?
Afaik, you should be able to host with different ports
and that seals the deal, depending on the subsystems though
since 4.12 I've had random crashes, epic has made changes but it still happens
and I am running multiple ports right now
nothing in the logs no, it does give me a crash dump which ive provided to epic
there were changes in 4.14 related to the issue i reported but they didnt work
so anyway, if you check arks dedicated server, they use a technique that brings a instance back up if it fails
cd %~dp0
start ShooterGame.exe
procdump.exe -ma -e -64 -w ShooterGame.exe
exit
no wait, im confused, i got that first technique somewhere else
Well, you could simpyl google on how to keep a process alive
And apply that to your servers
yep thnx
so the fix made that log entry not show up anymore.. but the crash still happens
and on newer server OS's it wouldnt actually crash out the server so i started experimenting with taskill but really the fix was changing windows policy
thats where i got confused i should go back to my first solution now that i've fixed the policy issue
yea.. id really love to learn how to do it on linux to save on hosting fees
Is there a relatively easy way to recreate Souls style peer to peer multiplayer?
passive peer connections? like the old test drive unlimited?
I think so, that one has a similar system
basically you'd need a master server to figure out when peers should connect
if I wasn't concerned with maintaining connection between levels, would having the host player act as a listen server work?
yea.. you thinking of doing this on steam?
possibly, I'm keeping my port options open until a limitation says otherwise
well a limitation steam will remove for you is nat punchthrough
but im not a steam expert.. just trying to do it "the other way"
but if what I'm trying to accomplish is made simpler through a single platform, I'm not against exclusivity
I don't think I can help you from here on in, probably time to start playing with the tech
Hello, I found this discord channel from Reddit, and I was wondering if I could get some help with a question regarding multiplayer for a game I'm working on. Is this the right place for some questions?
Yep, go for it ๐
Awesome. So I have at the moment a multiplayer couch game I'm working on, and I wanted to get started on implementing online networking. However, I was thinking that I'd also want to keep local multiplayer as an option (e.g. two+ controllers on one machine). I was wondering how I would go about doing this?
A little more background, I have gotten started with networking, and have managed to correctly create a dedicated server and client builds, but the problem I'm coming across with keeping local multiplayer is that my client-built versions can't run server events needed for game initialization. I'm wondering what's the best option to work around this.
If you want to go the dedicated server route for online play, you'd have to have a way that your client can additionally act as a listen server to facilitate local gameplay
Is there a setting possible to do this?
I don't think it's something as simple as a settingโthough I haven't used a dedicated server system. I don't know exactly where the divide comes in what makes the server, and if a client can open a level and simply act as a server
So I myself haven't particularly decided whether or not a dedicated server or a listen server is the most ideal for an online game, so I'm kinda unsure if I should be using a dedicated server in the first place.
The biggest issue I seem to be coming across with listen servers is that port forwarding seems to be a problem. Would you happen to know if there's a way to make a listen server game in which port forwarding isn't needed for players to play online?
Personally, I would think that a "couch" type game would lend itself towards P2P, since there's no major need for great connections, and it would allow friends to play always ๐
You can use the Steam subsystem to allow sessions to be used. Though if you're not planning on going through Steam, it's unfortunately up to you to handle networking and matchmaking
I do plan on going through Steam. I haven't gotten started however with integrating Steam, but for sure, you're saying that Steam will handle port forwarding for me?
Yep, they do everything from matchmaking to the actual NAT punchthrough, which handles the connection itself
I haven't found much information online that I can understand regarding much of this, so this has been an AMAZING GREAT help for me. Thank you so much by the way.
No problem, I'm sure there are others here who could help you a bit more with the dedicated server side if that's something you still want to look at ๐
I think you have convinced me to go with the listen server. So far the only thing keeping me from doing so was the port forwarding issue, and I wasn't sure if it was going to continue being a problem once the game is packaged and sent to people. But now that I know Steam's subsystems handle all that for us, I'm likely going with the listen server.
Once more, thank you soooooo much for the help!
@spiral junco if you design your game right, you can have a client also able to host a game as well as render out a dedicated server
@spiral junco its easiest to do it only thinking of one way, but you can handle both scenarios if you do your research - the shooter sample is a good example, mind you its a tad complicated, I'm pretty sure generic shooter operates this way
The biggest thing is if you design it around a listen server from the start, you really don't have to make any modifications for offline. You just need a way to get the second player in, and it's basically the same system
just when you develop, set it to 2 players and uncheck dedicated, test all 3 scenarios - single player, dedicated and peer
takes a while to get a feel for it, but its possible and easy to manage
@wary willow Who spawns and owns that actor?
The one you want to destroy
Why does it need to be always relevant?
What amount of damage are you passing in the Apply Damage node of the projectile?
Why do you call a reliable server RPC if you are already on the server(authority)
Does the RPC get called at all? (print string right before you call destroy actor)
Destroying a replicated actor as the server will destroy it for the clients too. Of course with a small delay
So you may want to destroy it on the local client too (the one that shot) so he doesn't have a delay until the actor gets removed
@wary willow I am currently having this issue as well, you are right this started in 4.13, they said in the 4.14 notes they've attempted to fix this but looking at github I think they are still working on it
@wary willow I can't find exactly the information that makes me think that, I'm pretty sure its related to this 4.14.0 note "Bugfix: Fixed various issues with remapping objects that lose/gain relevancy."
anyone about who's good with smoothment? I've got a minor issue going on with my player's visuals after i recreate their inputs after PostNetPhysicsUpdate
i say minor, its pretty awful
@wary willow @thorn merlin I will try to recreate this later and check what's happening.
Currently learning about PBR rendering, so no time
Also @thorn merlin Do you ahve a second account here as I can tag you twice? If yes, I may remove the other one
@thin stratus sorry i had isues authenticating the first time i started using discord, ill try and delete the other account
@thin stratus my issue is with child actor components getting messed up with replication / relevancy
I kicked your second account for now
Hm, ok. Idk about that. Was talking about Victors problem
i think its related because of the sub component issue, sorry if im misleading that issue with my own but i think its related
sometimes my hitboxes or other things linger after being destroyed on the server too when the server is under load
Might be, but Victors code is not really good neither does it make sense
I first want to refactor it, as soon as he's online
and check if we can fix this
Because this is not normal at all
good call, thx for your help
After that we can look into your problem, but it seems like you already found out that's actually an engine problem
So no idea if I can help at all
I will redo the snippet in a bit, that was just a first attempt and I know it wasn't probably the right way, but I tried all the methods I could think of with all the combinations that made sense. I just didn't feel like taking 20 different pics
It is wierd because it isnt like DestroyActor doesnt work, it is just somehow bugged on client
networking talk!
Consider the following scenario:
You have two players (A and B) in one room (Room 1), and two players (C and D) in another (Room 2). The two rooms are never visible to one another, so Players A&B are not relevant to C&D and vice versa, but it is possible events in Room 1 can have an effect on the state of Room 2 and vice versa - for the sake of example, let's say there's a switch in either that turns a light on and off in the other room.
How does one approach that from a UE networking perspective?
I mean, you could replicate everything as per normal, but that's massively inefficient
A&B don't need to know what C&D are doing in their respective room after all, so they do not need events occuring in Room 2 to be replicated - with the exception of the light switch
is there a means of filtering relevancy like that?
could it be as simple as simply not spawning the relevant actors on clients that don't need to know?
(or do replicated events for networked actors still get broadcast to everyone anyway?)
hmm, this as a bad example, as normal relevancy rules probably apply
I guess I need to see how one can write custom relevancy conditions
@past bear Hm ,so I never played around with that
But remembering the tutorial of epic, you can adjust the cull distnace
I did it a bit in the past, but forget the example
Or with some C++, add your own rule
imagine it isn't based on distance, and you need to control on a per-actor basis what is relevant to whom
The main thing is, the Server will change the State of what ever is in room 1 or 2
So if Player A and B, in Room 2, change something and tell the Server to do stuff, he will update the replicated State of an Actor in Room 1
Since Player C and D, in Room 1, are in range of the Actor, they will get the update
So ok, let's take away the distance
Then you have, currently, nothing that you can use to make them relevant, or not
afaik
So you would need to add a layer/check to the IsRelevantFor function
And check something that you want to have for the condition
yeah, I think this is what I need to look into
The function is called IsNetRelevantFor
a custom relevancy check sounds about right
I don't think that's exposed to BPs though
Information about Actor relevancy and priority
Here you can read how the native implementation works
So what it checks to determine if the actor is relevant
It would still be easy to just use the distance though
like I said, ignore the example, because that would work with normal relevancy :p
Hi guys, please how does the world composition exactly work in multiplayer?
I have an enemy which is spawned on server side. When I hit it I call launch character.
I want to call launch character on the client's side before calling launch character on the server.
From what I've read, character functions such as launch character or add movement input can only be called on the client that owns the character.
Anyone know a way to do this?
sorted it out? @native axle
Hit event is called on Server and Clients. So you can call that directly after the hit and the client will call it earlier anyway
No idea about the owning client only though
But if it is limited to that, then set the velocity of the movement component directly by hand
bit of an odd question here, but when are onrepnotifies called within a tick?
OnRepNotifies are called on the client when the variable got replicated and has the new value
On rep is nice
OnRep on tick is a bit weird though
The whole idea about onrep is to notify you when the replication is done, so you can react to it
Spamming it will probably even override calls
Yes
Also if you always set and replicate, there is no need to notify anymore
I just use on rep for join during play stuff
I've been using it to store snapshots of locations to an array
as described here: http://gafferongames.com/networked-physics/snapshots-and-interpolation/
the problem is, when I interpolate between the snapshots, I occasionally get frames that stay the same over 2 frames
so I'm just wondering if the onrepnotify is being called after I've done my interpolation
(in the tick)
Well the onrep takes time
Replicating is not instant
So if you don't wait for ut
Iz
Goooood
It*
Then you will probably call it too early
My goodness. Bus + cold fingers +phone just doesn't work
But idk how to do that properly. Could be that you need to interpolate based on the last velocity as long as the new data isn't there
In a long ping environment, this should not really have an impact or?
yeah I'll definitely have to do replicate the velocity
I wonder if it would cause the same issue though, where the velocity/location will be the same between two frames causing a visual stutter
hmmm
Well you use the velocity to change the location for the second frame
You only need to sort out when it's actually missing data or when the actor stood still :D
Although if replicated data has same location, the velocity should be 0
So that's fine i guess
Question: if I do a multicasted function call, it's not guaranteed that some replicated variables set to a new value just before invoking said call will be correctly synced on the server, is it?
No, if you really need those values you might have to ship them through as a parameter
@hybrid igloo @brittle sinew Correct. You can only guarantee that a variable is replicated if you set it to repnotify and pack your logic into the bound function. Or you use the multicast with a parameter
Though the multicast, if not set to reliable, might be dropped under network load
Yeah I set it to reliable and made the variable be passed as parameter to it
@twin juniper Are you asking for a general tutorial of world composition?
(I can't really give one, I don't know which parts of our streaming logic is custom in our build)
System for managing large worlds including origin shifting technology.
Question: How come Steam segregates NA vs EU or any other region when we are doing OSS Steam in UE4? What I mean is when let's say an American hosts, Europeans typically can't see that hosted server. Is that a UE4 limitation or Steam limitation?
I am thinking it's more of a Steam limitation due to the "Download Region" trick we've been using in Gamejams.
But, I feel like I've never had to do that when playing other Online MP games on Steam, like I've actually played with others around the world, but perhaps that's me thinking about other games not on Steam.
I wonder if this is due to dedicated servers being used and maybe getting proxied across the world?
there are ton of steam games that are still bound to the download region
Right, so my question I guess is, how are the games that AREN'T, doing it?'
What backend services are there for this type of stuff, and are there any recommendations, things people have used themselves, etc.
@wary willow Presence
what? @thin stratus
That's why they are sorted in regions
The study of massively multiplayer games and playful multiuser interaction based ideally just on simple presence information, as in large crowd games such as Mexican Wave
?
The hosting uses presence
Presence is a thing that checks for Servers based on your friends and your region
Oh, you're talking about Steam
Yes
And if you deactivate that, you register to the master server
like good old counter strike
And we can do that in engine?
oh, update 2 days ago
I just wanted to let everyone know that this pull request has been assigned to one of our engineers, and is currently waiting to be reviewed. Unfortunately we do not have any expected time frame for when that will take place.
wonder why it took so long for them to even take a look at that
after all, PR was made almost one year ago
@thin stratus does that work without dedicated servers? like with listen?
(bypassing region setting)
Ok so
Dedicated Servers can't have presence
It makes no sense to have it if you think about it
Steam added presence to their server things so that people get matched with others out of their region and friendlists
For example for matchmaking in Counter Strike GO
(afaik)
Right
If you deactivate it (it's a boolean in c++, not exposed to BP)
Damn newbs
But that's an easy thing
Even as a Listen Server
I don't get why is region and friendlists connected?
your friends could be anywhere in the globe
I mean the feature
you'd think they would be two different options
Oh
Like Dead By Daylight
I agree
Hmm, so what's the "easiest" way to accomplish a world server
Obviously with a dedicated server setup
Pull the PR that Olento linked
(lan on mars)
And then you can host them
Otherwise the Dedicated Server doesn't register correctly
and will not get listed
So, they don't use Steam's server system at all @thin stratus ?
is this related? https://forums.unrealengine.com/showthread.php?73739-Master-Server-with-Unreal-Engine-4-Plugin
This is a plugin for Unreal Engine 4 that adds super simple server registration, deregistration, etc with a master server.
This is not mean't as a complete Online Subsystem, just as a way for people with a need of getting an up to date serverlist they can serve up to clients and adapt it to their own needs (I am open to suggestions of functionality you want included by default!).
Once the plugin has been installed you will be able to use this to receive server lists of all active servers
RL has crossplatform play too
you'd think they need custom solution to be able to connect different networks (steam, ps4)
I'm still curious about the listen server approach with steam
?
I really should look into ue4 networking more
yes
but I mean if you want to host a game that can be found globally
It's a lot to learn though
But once you get the basics down, it's manageable I suppose
without doing dedicated server
Ah
Yeah, that's probably not going to happen
And I think for good reason tbh
Latency
but steam cuts regions still even there would be acceptable connection
cheating sure
But, that's just overall thing, nothing to relate to global
Define "acceptable"
Because battle.net never was able to do it
for example, in RL, we get great pings to middle east servers
You might...
from finland
Boys
I can even get to UK players by default settings I think
Host as ListenServer
We suffer a lot
and that's close
so that's possible out of the box?
that's all I wanted to know ๐
but I still have to go into C++ to toggle that off
need to find where that is exactly
I know cheating will be a problem, but would love to still keep listen servers as primary option to guarantee there's always maximum amount of games you can attend
having gamers split by regions will be a death sentence to small indie games MP
you can still allow players to run dedicated servers too if that kind of thing gains traction
about the cheating
I just played Grid 2 online yesterday.. I haven't played that game for ages
one player hosts automatically the game there
but yeah, that was the first time I've seen people cheating on that game
haha
host bypassed all timers on time trials
wow
and also warped into finish on a long race with his friend
I didn't stick on there for long, makes no sense trying to race against people like those
same thing happened to other online racer (blur)
when that kind of games get older, they seem to start get infested with cheaters only
but then again, we don't live in a world where we can always host dedicated servers infinite amount of time around the globe either, especially if the game isn't a huge hit
so, compromizes have to be made
Yeah, but for game jams
(which is why I was curious about it in the first place)
this could be a good solution
yeah, listen would be good
so we don't have to do the stupid steam region trick thing
Sorry for not reading your posts so fast
ranked games are long and puases are short
Ehm the boolean is passed when you create the session in c++
so that's not that easy to just turn off
you can use the plugin though
Yep
And it can totally be
that the PR for dedicated Servers
is needed for that too
idk if listen servers register correctly to the master server
I guess it's fast to test though
just set two steam clients to different download regions
or, different enough regions
Well, it's more like checking if you can find the Server in the Server List by searching its ip
@thin stratus Do you know if it's possible for a client to host the dedi and act as a client without being server?
Hm
eg: dedi + client + client, not client server + client
So there is only
Dedi
Which is no client
And listen
with is client + server
anything else not really a thing
Yes, but I was wondering if it were possible to run dedi on same machine as client
so if you say don't have a server to host dedi on
but you want to write the code as though there will never be a client server, but only dedi
yeah, that's what I was thinking. steam might be a problem
but you could still theoretically release a dedi package. steam does that for CSGO and such
Was thinking it would be great if you could bundle them though, so player could click 'launch server' and good to go
Well it tells you it can't run both
if you try
but that might be just a steam restriction if you use the same account
and not a tool
Have fun (:
@sharp sequoia Haven't fixed it yet
@thin stratus Tried setting velocity manually but that also didn't work
I forgot to mention that it's only with replicate movement off
Seems like the character movement component doesn't work on the client side
So you can't use velocity or pretty much any character stuff to move besides addactorlocation / setactorlocation
Hm, well you can if you actually replicate it
So set it everywhere via multicast
If that still doesn't work, then no idea
has anyone tried using the blueprint multiplayer tutorial for an actual project? Does it work okay?
@slender cloud why wouldn't it?
It works as intended EXCEPT for the LAN
LAN is broke
ยฏ_(ใ)_/ยฏ
Can't do everything right ;0
Ahhh, ok. I saw on the foriums that was broken, but the only complaints were on LAN
Right, LAN is broke, which I'd like to look at soonish
Because it can't be that hard to fix
Hm?
Too much on menu/front end side of things though
I wish he had actually covered what the tutorial series was named
@thin stratus the bp mp series, LAN is broken with it
Either he didn't set it up right or just something was off
I never looked into it myself because I just followed along and just got back into looking into MP
I just want it for a VR multiplayer project. Just need a friend with vive to test with and figure out how to put only hands showing on the player and full body for everyone else. Already went through the tuturial making the system though
@thin stratus yes
Because that's probably broken af
It was
In the latest tut it was updated for one VR user
but they only took like almost year to make that
Thats the other issue I am having. I cant ever get 3D widgets to work, even with the new widget interaction componant
I know the basics now
But, there a lot of new stuff in 4.14
like Replication Conditions
that came from C++
epic should definitely hire cedric to make one ๐
Mine is pretty good
And just make a barebones version tutorial?
whats it called?
Probably Muliplayer Lobby
damn close
Should rename it at some point
Network systems like a Lobby, Chat, Groups (invite through the Chat), Character Select and more!
But there is also a small chat and party system in it
so /shrug
And no, there is no "barebones"
Either you make a working lobby or not
That's my point, you don't need chat
haha right on. I would rather buy an out of the box then beat my head trying to make one. I do mostly art
@thin stratus Could you implement voice?
there was that plugin I just linked a while ago
$$$$
If I ever make a plugin, then my Audio viz
or was it another?
I think steam has that built in doesn't it?
I think there was one to get voice working though
Steam, yes. The Subystem, i don't know
But yeah, about the tutorial on youtube:
Hey everybody,
most of you might know, that I'm in love with Multiplayer things. That's why I wrote my Network Compendium.
Today, I gave someone on the Discord Server some help, while he was fighting with the "Blueprint Multiplayer" tutorial on the Unreal Engine Youtube Channel.
He posted me some screenshots and I was kinda confused by what I saw.
Before we start, I want to make something clear:
I personally hate voice chat on every online game I play with random people
text chats are bad enough already
voice is 10x worse
people just can't behave
True
Its a must for games like siege though or Onward
Kinda. In the higher overwatch elo it's actually ok
yeah, I get the need for more serious games
but casual gameplay and people are idiots
๐
more serious gameplay I mean
Even then...
Competetive
Competitive gaming is not more serious and can't be more fun with voice...
I need to make a complex voice chat in my game
League is the worst example
But that's my point
it's the most toxic community you can ever have
95% of competitive gaming is?
Take overwatch, the Voice chat i nthe higher elo is ok
@thin stratus that system looks awesome man! Does it have teams built in or would I just implem,ent myself?
I didn't notice if you talked about voice chat stuff for UE4 above?
I can see how voice is nice for co-op games though
@slender cloud Build in
You haven't experienced ANY toxicity in Overwatch?!
Is there anything I can use for voice in UE4?
@wary willow Not in the voice chat
Ideally, we need a multi-channel solution, not just one voice channel but two channels (or more)
Written, yes
And I won't, I would never get anything done
Lower elo voice chat might have frustrated people
League scarred me for life
but most people don't even join that on lower elo
league is just bad
the community is dead
Brain dead*
๐
I mean, if the company needs a tribunal for players
then you already know how fucked up the community is
Well tribunal sucked anyway
it had so many false positives
and spam reporters
ยฏ_(ใ)_/ยฏ
Our game is supposed to have one really bad voice chat channel
And one good one
The former being highly distorted
I got banned for a week because I told the top laner to build armor instead of mr against 3 AD/1AP/1Sup where one AD was already starting to snowball
ggwp riot
Haven't played the game for a few months
I can't remember when I quit, sometime back in March I think
I always want to go back and troll as teemo
I think I stopped before the kled guy came out
or something like that
anyway, time for bed
@thin stratus LoL ranked is byfar the worst part of LoL
I usually play normals and ARAM, thought it would be fun to play ranked. What a freaking mistake that was! It felt like I was playing with people well below average IQ in almost every game.
I posted this in #mobile but I'll throw it here too just in case:
"Hey guys, I'm trying to make a multiplayer app on android but there's hardly any useful docs on it. I've seen that Google Play Services is often used with UE4 to keep track of achievements and leaderboards, but no realtime multiplayer. However, google gave this tutorial: https://developers.google.com/games/services/cpp/realtimeMultiplayer
Any ideas on how I could do this stuff?
I have a week to develop a working prototype for a multiplayer android app made in UE4, so this is starting to get stressful"
@vivid siren I'm not directly sure, but I think GooglePlay is not exposed to the Subsystem
I mean
for Session stuff
How it normally works is, that UE4 has wrappers for the Subsystems
Such as Steam
So if you call "Create Session" or "Find Sessions" etc, it grabs the current Subsystem implementation and uses that.
Means, if you use Steam, it uses Steam, if you use Playstation4, it uses PS4
You might want to check if the googlePlay stuff is also wrapped
If not, you need to manually include the googleplay library and implement it yourself via the docs of google
As Epic is not really responsible for google stuff
@thin stratus I replied to @vivid siren in mobile - basically right now I use HTTP and my own webservice, but I really think if someone made a plugin that used firebase to provide these services to unreal engine, they'd earn some decent money
(from android devs)
Isn't there already one?
if there is im going to kick myself really hard lol
