#multiplayer
1 messages ยท Page 554 of 1
they account for about 30% of ridiculous bugs on this channel, actually
like no matter which player got killed, the listen server host died
ahaaaa
if you ever have a bug where it seems wires got crossed in that way
its almost certainly because you used one of those functions incorrectly
Welcome to multiplayer hell ๐
haha
I likely have a lot of stuff that is wrong even for singleplayer. But its just weeks of diddling around on my own trying to figure stuff out
Just take every blueprint tutorial you've ever seen, and throw it all away ๐
Awesome!
preferably use c+ for networking
Even Epic's official MP tutorials are... questionable
i absolutely hate doing any networking in BP
+1
So. Quick question. (I think)
I have a function in my player controller class which handles respawning the player.
Would you put that in the character class or the controller?
agreed
all spawning and respawning of players belongs in GM
There is a "RestartPlayer" function which does essentially that, it'll spawn a new pawn and give you control of it
Ahh yeah
and it does exactly that even if you didn't make a custom GM
its what spawns your default pawn
I do have a custom GM. It just doesnt do a lot at the minute
The base GM does a fair bit
well yeah. But I havent added anything to it
But it's where all the "rules" of your current game mode apply and generally belong, so respawning, how scoring works probably etc etc.
note that GM doesn't quite work out of the box if your game is not a match based shooter
That figures ๐
And what about storing health and energy? And functions for restoring those over time?
i have components for that
and an attribute component they automagically hook into
Usually yeah. relevancy / data locality matters a lot more in MP
so they can respond to changes in MaxHP, Regen... instantly
So anything relevant to a specific pawn belongs in that pawn.
If there's a persistent player variable, it generally belongs in the player state.
E.g, seeing a "Health" variable in a player controller should make you feel sick.
But it all starts clicking and making sense at some point..
So health stuff should belong in the player state?
In the pawn
ohh
Player State = something persistent to the player themselves, so their display name etc.
unless you happen to have the game where you're skipping pawns but keeping health from previous one
Yeah or that
then a case could be made that it belongs in PS
OK. So I do all my respawning a bit weird.
The idea is to have the player teleport to a certain location on death. Based on a few factors
gets the ๐ฟ for the MP 101 course for free! :)
hahaha
So I have these nodes in my player character, for getting around quickly.
They dont seem to work on anyone other than player 1 however
60,000 walkspeed wtf
has seen it all
i hope you have super high friction to go along with that
cause moving at 60K is ridiculous
We use 50000 as a hack in HLL to cross the maps quickly in testing ๐
Can't imagine how that works when using it legitimately ๐
haha
50k is super fast tho
i can just click and teleport on the world map ๐
to where i need to go
"James, did you do these important tasks for the deadline?!"
"Ehhhhm, yeah, I'm just finishing something else quickly. It's sort of important."
Don't we all wish to have time to create the perfect debug/cheat system.
Kaos made a terribly ugly one, but upgraded it once he saw he gets killed every time when he doesn't use it ๐
After i servertravel to a map, how do I wait for everyone to connect and load completely before starting the game again? is it a node in the GameMode?
don't let it start match until NumTravellingPlayers == 0
i think in BP there is a CanStartMatch function you can override
in the GameMode, BeginPlay doesn't trigger until ReadyToStartMatch is true correct?
StartMatch calls DispatchBeginPlay
then World starts calling BeginPlay on all Actors
it also sets new MatchState in the GameState
and OnRep_MatchState calls DispatchBeginPlay on clients
yeah but when does StartMatch get called? Like if I override Ready to Start Match like this
will that prevent the match from starting until everyone has arrived?
speaking of cheats, do you place it all in a cheat class to be safe or is an if WITH_EDITOR enough?
CheatManager ๐
what do you mean kinda?
it gets stripped out in Shipping builds
i have my own custom CheatManager based on CheatManager
just assign it in the player controller, and voila
What about if you want one kind of Pawn to have access to a cheat, but no others
fair enough
Hi guys. I was wondering the following: If I want to create a multiplayer racing game. Would you say that dedicated servers are a must have or what server/player structure would fit best in your opinion?
Hey people. I'm trying to set up a simple test using the third person template. I'm trying to create a dedicated server which I connect to using open {IP}:7777. I can connect to it from LAN if I use 127.0.0.1, or my local ipv4, but when I try to connect from a different network using my public IP it doesn't seem to connect. Any ideas why this might be the case?
My plan was to get this working then I'd move on to putting it on AWS gamelift, but I don't want to do that until I've got my own dedicated server working
I think you need set a online subsystem. The original subsystem is work only to LAN.
ahhh
@buoyant wedge so what can I use? Due to limitations, we can't use steam, we need some kind of standalone system. Eventually we will be deploying to a Android VR headset if that helps at all?
I've currently set :
[OnlineSubsystem]
DefaultPlatformService=Null
@viral harbor I only try the p2p with steam.
For prototype I think you can use a third part software (Hamachi) to make a virtual Lan.
But I'm really new on ue4 so is my guess.
when I travel to a new level with a different gamemode, pc, gamestate etc, are the ones from the previous level destroyed?
I have a Lobby GameMode and Lobby PlayerController, so when we travel to the game map, they get the Gameplay GameMode and PlayerController for that map
What a hell in 4.25 with debug networking (multiplayer options)?
Client -1? ๐
Where server going on?
@twin juniper you have set in the play setting. Listen server?
@buoyant wedge I nothing to understand in this new version..
net mode -> client
I tried to Print String at Event BeginPlay in my Pawn, and I see all msg twice for client and twice for server
and how I must understanding where is logics will be correctly?)
Solved..
Hello everyone,
Just wanted to know, what is a good solution to transfer data in these situations for example:
1- Player hosting a game and selecting game mode, level, game settings and transfering that data to process after the MP level is opened?
2- Similar to the lobby but if you have a Lobby, so basically Offline Client -> Mp Lobby -> Mp Level when ready.
Would the GameInstance be a good holder for that?
a subsystem would probably be better organization
either localplayer, or GI
i use a local player subsystem to load/hold my player's profiles, their character setups between Offline -> Lobby etc...
as for transferring data from MP Lobby to Play on Host
persist an Actor will all the data through seamless travel
the GameInstance persists right/
yeah, but its also not a garbage bin for everything you don't have a better way of persisting through level transitions
Kind of seems like its entire purpose if it's one of the only things that just persists all the time
leverage seamless travel first, if you can, then use subsystem with same lifetime as GI afterwards
its not
GI Subsystem and LocalPlayer Subsystem live as long as GI
How do i know if i'm using seamless travel?
currently from my lobby i use servertravel /Game/Maps/MyLevel
whenever the host starts the game
Hello, I'm having an issue with replication.
When I press a button, that sets the progressbar to 0, the progressbar on my screen stays filled, eventhough the value goes to 0
Never mind i found it
UI is local only
so if you have a problem with replication @weary badge i'd guess its because you assumed you can replicate a variable inside a widget
Widgets only exist on the local machine
if you need to replicate something from them you have to store it somewhere that can be replicated like the player state
or use an RPC to send it to the server and tell it to update
I'm having an issue with seamless travel. In my Lobby_GameMode I have a custom event that says executes the console command "servertravel /Game/Maps/MyLevel"
This works totally fine when seamless travel is off
when I tick seamless travel on my Lobby_GameMode, then the custom event to servertravel doesn't do anything and i'm just stuck on a black screen infinitely
I have my transition map set to an empty level
do i need to do something more with my console command?
something in my understanding must be off
Hey, bro! I have a problem with replication of the shot, I am using Line Trace By Channel ... Can we make a call tomorrow? Am I going to show you what's going on? Here is a picture:
From what I understand it is the replication, right?
@empty matrix Hmmm, I'm still a beginner, but did you replicate the bullet actor itself ?
As well?
Anyone ever had issues with multiplayer clients spawning in the wrong place? I have hard coded the spawn location in my game mode class:
It seems like it spawns at the right location initially, but then shifts to a distance away
I have "Always Spawn, Ignore Collisions" set, so it shouldn't be trying to adjust the location
@empty matrix I'm beginner to but I think you need to do on the server and after make a multicast event to spawn on all player the projectile.
@winged badger Hello, what do you mean by Subsystem? ๐
is there a way to do a unique build ID in my game like how the engine has one?
im using the steam online driver or whatever and it looks like it filters out by unique build ID
but i see other people also using UE4 in the server list i got
Is there a good example around of using OnlineSubsystemNull when running in editor and OnlineSubsystemSteam standalone?
Can someone tell me why this works when Seamless Travel is OFF, but if I turn it ON, it doesn't ever load the level? I have a transition map set to an empty map.
could someone join me on a sharescreen and help me solve a replication problem pls ?
german english french are all ok
An overview of programming subsystems in Unreal Engine 4.
Thank you ๐
Anyone know how to Replicate An actor (in the gamemode) with a dynamic material exposed on spawn variable when my actors spawn in on the client they have default material.
that is not replicating actor in the GameMode
fortunately for you, since that wouldn't be possible
GameMode doesn't exist on clients
any ExposedOnSpawn variable gets set before Actors call BeginPlay
as long as your Flag Actor is replicated itself, and the expose on spawn (Team) variable is replicated
every client will have that variable at a correct value before it calls BeginPlay
so you just need to set the material depending on the value of Team on BeginPlay
dormant actors wont accept server RPC calls ?
@winged badger ok thanks
can't say that i've tried but dormancy shouldn't stop them from receiving RPCs
having a dormant client owned actor is a pretty awkward setup
so would it be normal for the construction script in the gamemode to spawn actors?
nvm just tried
cant copy and past ๐
what does that mean client owned actor ? the owner is the player controller ?
its a replicated actor spawned by the server, with playercontroller set as owner to send rpc
and those actors tend not to use dormancy
as client owned actors tend to be gameplay critical
i thought since the properties on it only change threw rpc i can set to dormant, and do forceNetUpdate() inside those serverrpc for performance
domarncy has one problem
when someone enters the domrant actor's net relevancy range
dormant actor won't bother to update it with the latest info
because its dormant
ah this is a real problem for what this actor does then
we use dormancy only for simple pickups, we spawn them dormant and we turn the dormancy off as soon as they are interacted with
and btw, the dormancy doesn't exist to save bandwidth
it exists to save the CPU time spent evaluating actors for replication on the server
also, in general, you want to do optimizations like that for Actors you have 100+ instances of on the level
client owned actors tend not to fit in that category
(doesn't have to be 100, but a lot of)
dormancy time for a youtube video ๐
Is there a way to reliably replicate Add Impulse?>
Everyway I try it's always off on clients
Simple question, how do u get the number of connected player to a server?
i tried getPlayerNum() but its not working
when i press alt f4 its like its still connected
@agile lotus the best way is to do custom movement is to override the movement component class, there used to be a a tutorial in the old wiki but its probably lost since the old wiki is gonne, if that is 2 much of a hassle you can do it the second best way which is calling the add impulse function both in the client AND the server at the same time (or at least aprox)
u basicly call add impusle and imediatly after send the server rpc
GameMode->GetNumPlayers() @limber gyro
well it doesnt lol
ive tried it
when you alt f4 even the player character stays there
you overrode something you shouldn't had? because the PlayerPawns being gone after DC/crash works pretty much out of the box
does LogOut trigger?
logout doesnt trigger
the onlye thing i am doing diferent is that i spawn the characters and posses manualy
instead of the engine doing that
so do i, never had your problem
strange
im gonna try and mess with network error
i am doing some stuff in the game module
because i had to integrate with playfab
might be that....
just don't do what my junior did
he assumed that unreal needs help to transition you to main menu/default level after you lose connection
so he handled network error by opening main menu
result: anyone disconnects for any reason, that client and server get a network error, server hard travels to main menu, everyone else gets booted
you using c++ @limber gyro ?
ye
breakpoints in GameMode::Logout, PC's EndPlay, GI's HandleNetworkError
i dont have endplay overriden
i was gonna do the heandle network stuff now
seemed like the only option
if it happens in editor you can catch it
if it doesn't you can just override EndPlay calling Super, if will be enough to catch a breakpoint
im looking at my override now, and it is indeed strange because i rememeber seeing some ue_logs i have here being writen in the log
so something happened that doesnt let logout run
even if logout doesn't run it should timeout after default 60 seconds
after the 60 seconds the getplayernum should reflect the actual player number then?
by default 60 seconds without any signal is connection timeout
but it should pretty much happen immediately
i never saw a pawn hanging around after the player DCed or crashed
in 4.24 I can't seem to find net pktlag or any relevant commands when typing them in the console
2020.07.09-01.47.47:040][425]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 127.0.0.1:60151, Name: IpConnection_2147482577, Driver: GameNetDriver IpNetDriver_2147482584, IsServer: YES, PC: GameplayPlayerControllerBP_C_2147482573, Owner: GameplayPlayerControllerBP_C_2147482573, UniqueId: Null:LAPTOP-N4NI7FM1-2532912945BE4F87FC5FE6A07220023A
does this mean that the server saw the player leaving?
no whitespaces around =
they aren't working
so the server sees the player leaving but logout doesnt get called LOL
well, it gets called from APlayerController::Destroyed
so if you overrode anything in the chain of functions leading up to it and made a mistake...
pretty sure i didnt
so strange
anyway i can see that chain without digging through source
since its sending close bunch
OnNetCleanup in PC should get called
it eventually leads to LogOut
ok so i jsut noticed that i forgot to call super on begin play in the PC
could that be the reason?
that rarely ends well
ahahah
but yeah, it could leave it in invalid state for the entire session
that might be calling somethign that later gets used
i am not even using the function no idea why i have it overriden
have you ever looked at your code and thought, "wtf was i doing here?"
its been some years since that happened last time for me
i always code my games alone so when stuff starts getting big and complex and i dont see certain parts of the code for a a month or 2
boy does my brain start spinning some times hahaah
ye, the logout fucntion is getting called now
im laughing at how stupid that issue was hahaah
now we both know that beginplay does end game stuff aswell, its always good to know
Destroying an Actor doesn't do the same thing if Actor never began play
had an issue with that few years ago
Hey, I'm getting this error and any help would be appreciated.
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor UnloadedGameBase_0. Function AddNewTeamForward will not be processed.
I've got some teams stored in GameInstance and in order to have it replicate to the client, I've added wrappers in my GameStateBase class with replication turned on
client can't send RPCs through Actors it doesn't own
I see, do you have any advice where to store the RPCs?
anything you own
PlayerController, PlayerState, PlayerPawn, any components on them, any Actor or its component you called SetOwner() on server side with owner being any of the previously listed
Alright, thank you very much
i would like to have a replicated Map of Enum values to Arrays of actor components
problem 1: maps arent replicated (at least in blueprint)
problem 2: i can't make a map of arrays
i can solve problem 2 by just creating a struct that contains an array, and just making the map a map of those structs
i could potentially fix problem 1 by adding the enum value (the map key) into the structs, creating an array of those structs that is replicated, then generating a map from that array of enum values to structs on both client and server separately.
are there issues replicating arrays of structs that contain arrays?
No there isn't. It's pretty tricky to replicate something map-like in BP only.
In C++ you could probably craft something that works similar.
So I was getting help on this the other day. Regarding input within the player controller or playercharacter (pawn)
https://docs.unrealengine.com/en-US/Gameplay/Framework/Controller/PlayerController/index.html
This page says basically to use the player controller
The PlayerController implements functionality for taking the input data from the player and translating that into actions, such as movement, using items, firing weapons, etc.
The page says that it depends.
Which is what I would tell you too
There is no "one rule".
or the ability to change characters dynamically at runtime, it might be better to handle input in the PlayerController
That sentence is fundamentally backwards
and this
In this case, the PlayerController decides what to do and then issues commands to the Pawn (e.g. "start crouching", "jump").
bloody docs man.
Ahh @chrome bay I was hoping youd have an opinion haha
What would be a good way to get a reference to a pawn in a player controller for use with multiplayer?
There's a GetPawn() function which gives you access to the pawn that controller is currently possessing
Similarly the pawn class has a GetController() method too
OK cool. And what about referencing a function or event from one to the other?
yep same deal, just get it from there
Honestly though Epic's advise there is silly. Put input that is relevant to a pawn in the required pawn class, put game-level input in the controller IMO.
E.g. I have vehicles and character pawns in my game - would make zero sense for me to put input for both pawn types in the controller when the pawn manages it just fine and can remain self-contained.
close Health stream each time when sending Health ping can be problem? this happens with the REST Api because the grpc stream gets closed on each request
Can someone tell me why this works when Seamless Travel is OFF, but if I turn it ON, it doesn't ever load the level? I have a transition map set to an empty map.
@clear copper Seamless travel option used for (open level ) function not the execute console command
oh, that makes sense lol
you talking about Seamless Travel option of the game mode yes?
glad you figure it out!
Hello
I have a problem that I created a pendulum object
and it is jittery on client side
it all looks quite nice except for then the pendulum goes to the very edge where its speed is the smallest
Could anyone assist me?
What would be the best way to go about replicating MoveToActor to a specific client?
I can't run it on the owning client as the ai controller doesn't exist for the client.
Is it acceptable to access the game mode from the player controller blueprint or is that a no-no?
hey, I'm looking for somebody with experience in voice chats / VoIP to ask some questions about integrating this kind of stuff with Wwise or using in-engine handling. Anybody up to have a chat?
have you found any reference materials or examples so far? I'd be curious too
Hey, theres plenty of posts on host transfer but i havent found anything concrete yet
has anyone tried, or know any info on how to, transfer the host to a client, im fine if theres a loading screen or takes a while
umm for some reason when second player joins in it doesnt go to the server function no more
Hey, I have a problem that one of my objects has to rotate, but on client view it is jittery
@winged badger you mentioned the other day that you can wait for all players to join before starting the game
if in my GameMode i tick delayed start and override the ready to start match function with this:
is that all that's necessary to wait for everyone to load?
RE: I am using multiple process to debug my dedicated server setuped game
It works fine with first player and gets in the SetInventory_S Server function
however when I login with the second player
server doesnt even go in the server function
it does come to the SetInventoryCaller
yet it doesnt reach the serverside after second player joins in
I have no idea why and I assume its because I have a shitty pc
and my pc cant handle 3 instances
or something else I am lost please help
you should never use this node in a networked game
you can get the controller of the pawn
also a client doesn't know of another client's controller
for Dockerfile this can be the form for unreal multiplayer project ? :
FROM ubuntu:18.04
WORKDIR /unrealproject
COPY Builds/Server/ ./
CMD sleep 2 && ./UnrealSimpleServer.x64
i use Agones component from the game mode inside the game instance and this one of Agones SDK actions..that usefull ?
here more actions...both of "Connect" and "Health" are automatically kicked off in the BeginPlay of the component.
@clear copper are you testing in STANDALONE or in VIEWPORT?
you have to use standalone to do seamless travel
ah ok
How do I pass options through the "join session"? I know you can pass options through the "?" on the open level node, but when you're a client joining a host, you just call "join session" on the session. There doensn't seem to be a place for you to define any options (like a player name, etc) as part of the join
The source just says @param Options game options passed in by the client at login but I'm not sure what exactly calls this or passes this on from the client.
@fossil spoke You previously mentioned https://discordapp.com/channels/187217643009212416/221799385611239424/722662681613566012 this function UGameplayStatics::OpenLevel(GetWorld(), ServerAddressForConnection, true, FinalOptions); I am finally getting around to setting up the multiplayer parser for options, but when I look at gameplay statics, I do not see that function with those options on gameplaystatics. The only function i find is: static void OpenLevel(const UObject* WorldContextObject, FName LevelName, bool bAbsolute = true, FString Options = FString(TEXT(""))); can I replace the fname levelname with a server name? I don't quite think it works like that does it?
Yes, it doesnt have to be a LevelName, it can be an IP Address.
Also UGameplayStatics has functions to parse the Options string already.
You dont need to make your own parser.
I have custom things like skins and stuff that need parsed
Yes. I'm just trying to figure out how to pass those to the server. Can I call that after calling join session?
OpenLevel passes that for you
Calling join session makes me open the level anyway when I join
JoinSession should have an Options FString as well?
Just takes a player controller and blueprint session info
Maybe you should do some googling on how to pass Options when using JoinSession.
That's what I'm doing and coming up dry that's why I was asking you. I'll keep looking
Maybe I'll see if there is a way to put options into that session
Yeah you may need to write your own JoinSession function in C++ to expose Options.
Im not entirely sure.
(
ULocalPlayer * LocalPlayer,
const FOnlineSessionSearchResult & SearchResult
)``` that's the function used to join now, I can't see anywhere in those search results for me to insert a string. Any idea what function on the client side interacts with gamemodebase::login ? is that something called by the client or does the host call that themselves after a connection is established?
Only the Server has a GameMode, so only the Server calls AGameModeBase::Login
Okay, I'm just trying to follow the path of how that options string is passed from client to host normally
Via the OpenLevel function.
It is appended to the URL.
Which gets sent to the Server to notify of an incoming connection.
and then it takes in that url and pulls the options off the back?
the only other option I can think of right now is to store the string on the client's game instance and on post login go to the player controller and ask it to get that from the local game instance.
UWorld::NotifyControlMessage calls AGameModeBase::PreLogin which takes in the Options from the URL.
and those same options are then passed on to login?
So the options string that prelogin and login see are the same data?
@clear copper Seamless travel option used for (open level ) function not the execute console command
@crude coral so how do i do with as a host with players connected? Because when i used ServerTravel console command without seamless travel it brought everyone to the next level. But when I use Seamless Travel and Open Level, it disconnects all the clients
AGameModeBase::Login is called by UWorld::SpawnPlayActor which also extracts the Options from the URL.
Options are always the same. They are appended to the URL.
When you change levels, the URL changes, generally you get a choice to retain Options for that pending URL.
Yeah it looks like with join session there is no clear way to access that URL.
I'll ask on the advanced sessions thread on the forum to see if there is an included way there to pass it on
UJoinSessionCallbackProxy is the class that implements the JoinSession node in Blueprint.
FString ConnectString;
if (Sessions->GetResolvedConnectString(NAME_GameSession, ConnectString) && PlayerControllerWeakPtr.IsValid())
{
UE_LOG_ONLINE_SESSION(Log, TEXT("Join session: traveling to %s"), *ConnectString);
PlayerControllerWeakPtr->ClientTravel(ConnectString, TRAVEL_Absolute);
OnSuccess.Broadcast();
return;
}```
It contains this.
You could easily recreate this class and inject your Options onto the URL.
that would be the connect string? Just append the options to the back of it? I'll give that a shot
Well it may not be that simple, you may have to see what the result of that function looks like first.
Actually
Yeah
Append it to the end
const TCHAR* Tmp = *Connection->RequestURL;
for (; *Tmp && *Tmp != '?'; Tmp++);```
This is what gets the start of the Options
So its only looking for the first ? anyway.
okay, i'll give that a shot, thanks!
now when i close the game from the editor UE4 i can see the new log message : Shutdown request has been received! and when i reopen the play from editor the server update and start recieve calls again
because the server SDK interact with my game instance (shutdown event).... this setup (Shutdown) is ok? the first printstring about the success have no reason to be there but is ok ๐
Hey guys, was wondering the pros and cons between doing line trace in server vs client. If anyone has some insights to share, thank you
LogBlueprintUserMessages: [BP_Drone_01_C_1] Server: Translation: X=1177.828 Y=672.405 Z=266.803 Rotation: P=0.000000 Y=-96.557098 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000
LogBlueprintUserMessages: [BP_Drone_01_C_1] Client 1: Translation: X=1177.830 Y=672.410 Z=266.800 Rotation: P=0.000000 Y=-97.031265 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000
LogBlueprintUserMessages: [BP_Drone_01_C_1] Client 1: Translation: X=1177.830 Y=672.410 Z=266.800 Rotation: P=0.000000 Y=0.000000 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000``` So...some weirdness here. After the game mode spawns a pawn of the selected class, the pawn is spawned at a player start. Initially the transform is correct, but it looks like as soon as its possessed, the pawn rotates 90 degrees or so. The rotation is reset. This only happens to the client. This only happened when I removed the pawn class from the game mode since pawn classes will be passed in. the correct class is being spawned in the correct transform, but then it's immediately being rotated 90 degrees. Anyone ever seen anything like that?
it looks like the client controller is being spawn with the rotation 0,0,0 and even if I set controller rotation before possessing the pawn, it remains 0,0,0 instead of lining up with the pawn. Since the pawn follows controller rotation it rotates in the loading screen, fixed: I needed to call a run on client on the controller to set the rotation, having the server set it didn't result in it actually change it since movement is client side.
@somber glade glad you fixed
I'm not sure why the player controller doesn't first take the rotation of the pawn it's told to possess.
I might keep that in mind
I'm also not sure why it only affects the client and not the host. The host spawns a pawn and possesses and has the correct rotation
because by default the host is the server no?
Yes, but he's also spawning a pawn and possessing it. I'm not sure why the host controller jumps into the pawn with the correct rotation but not the client.
can someone point me into the direction or give me some ideas on why multicast rootmotion montage would some times be jerky and sometimes be smooth on the client side?
Quick question. The playerstate ping (which is divided by 4) how EXACTLY does it work and what does the number represent? Is it the time it takes between client to server? Or is it the time it takes between client - server - client? Also why is it divided by 4? I would like to have the exact milliseconds it takes to send something from the client to the server. How would I use the ping node in this case?
so from A to B and back to A?
Yes
ok thanks
The A to B time is not measurable
'Exact Ping' is only available to the local client and the Server (a more accurate version anyway). The replicated ping value itself is inaccurate anyway so is stored and quantized as a byte for non-owner players (that's why it's divided by four)
but shouldn't A to B be pretty much the same as B to A ?
in ideal circumstances anyway?
most of the time no
since the packet bounce time also includes processing time at the other end
Generally ping values are never a perfect 50/50 split
I need the exact time in milliseconds it takes for the client to send a request to the server for a melee blocking system with which I want as much accuracy as possible.
can test the ping with local server?
Ok I'll try that. Can I get ExactPing in blueprint?
I don't think so
or is it code only?
and what is the difference precisely between GetPing and GetExactPing?
code only. FYI we use the ExactPing value to do lag compensation which often requires knowing the one-way ping, and it works okay for us within some acceptable tolerances
GetPing IIRC comes from the replicated ping value which is inaccurate
yeah I want to use it purely for lag compensation
ExactPing comes from the network driver and its more accurate, but only owning connection and server update it with some level of accuracy/frequency
But yeah just bear in mind it's never going to be perfect 50/50
Getting that value accurately is pretty widely accepted as impossible though
Yeah, I guess it doesn't need to be perfect, but as close as possible
It's basically to avoid situations where the user blocks an attack but still gets damage because the damage was faster than the replicated block
and what mean HealthPing?
So what I'd like to do is add a delay in milliseconds which is equal to the blocking players latency (A to B) at that moment to at least wait for a possible block given the user's latency
Sure, makes sense.
If you want my advice, make sure you add a small time tolerance too to account for jitter / spikes in the connection
Just have to balance it for tolerance vs responsiveness though.
I failed to factor that into our first version and it gave low-ping players a shooter advantage
Good morning.
I'm wondering why my replicated dynamic material instance isn't valid on the client? Can large data structures such as this not be replicated maybe?
it's an object, not a struct - so that won't work
replicate your parameters manually and set up the same material on the client side with rep notifies
replicating object references only works if the object is either an asset (from the content browser) or replicated itself (generally, only actors and components)
Okay. That's very helpful to know. So would creating the material and assigning it inside of a multicast event be the most efficient way to go?
depends on the use case
you should use rpcs for events and replicated variables for state
replicated variables are the only way to send state to late joiners
I generally stay away from RepNotify since my game is a fixed camera space shooter where every player sees the same view at all times so everything is relevant to every player.
Much like Overcooked.
And I read that Multicasts are appropriate for one-time events while RepNotifys are better for updating players who "come along later".
Thanks for your time, by the way.
RepNotify has no bearing on relevancy or Camera whatsoever
Oh. I must be misunderstanding something then.
Misunderstanding the use cases for RepNotify vs Multicast.
RepNotify == when this variable is set or received via replication, execute the OnRep_ function that gets automatically createin BP
But that won't work with objects like a dynamic material instance?
it will work with DMI parameters
you set a replicated Vector, OnRep sets the VectorParameterValue on DMI to its value, for example
Okay. And is that more efficient than creating the material on each client via multicast?
dynamic materials and references to them can't be replicated anyway
and OnRep is more efficient then a multicast
multicast is there for non stateful changes that need to be replicated to clients
Went into quite a lot of detail here as to why rep notify is nearly always better than multicast:
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1785130-i-need-a-clear-explanation-of-the-replication-conditions?p=1785266#post1785266
For state anyway, and sometimes even for events
Multicast is ok for one off things that are fire and forget
but i prefer replicated props and use them more
yeah
Wow, thanks everyone.
If you're pushing an event really often too (like "please play firing effects for this weapon") - then a rep notify with a replicated counter is gonna scale better than a multicast
I've been sticking pretty exclusively to multicasting so far.
its even better if you replicate that the weapon is firing and have the clients simulate the rest
that too ๐
Although doesn't work as well for semi-autos/one-shots and stuff sometimes
So setting a dynamic material instance to Replicate does nothing? No effect?
it does not
It will replicate a nullptr yes
Wow.
So, useless ๐
BP networking is full of them
yeah
Epic could make it infinitely easier if they didn't allow you to rep things which just don't support networking
but... there ya go
it can be made to support networking though
Yeah I guess so..
completely wasted effort, but it could
๐
here is an example of replicating a counter to update clients
in my buffs, the replicate Duration, but they do not replicate RemainingDuration, as it changes on Tick
cough ahem http://jambax.co.uk/better-burst-counters/
instead if i want the client to reset remaining duration to Duration, i increment a replicated uint8 counter
and client just resets its own side OnRep
@waxen socket
Trying to wrap my head around that.
Jambax, will this blog post you shared be translatable into blueprints?
You could do it, but it's a lot more work to translate it.
TBH, BP and multiplayer is a pain anyway.
comparing them to the most recently โackedโ properties on each connection this is technically incorrect 
blueprints have about 10% available networking tools in unreal
@chrome bay issue i saw with BurstCounter, is if a player walked into relevancy, they sometimes randomly see a player shoot
@fleet raven it is??
you can technically make a multiplayer game with them, but you'll cry before its done
unless that was cause i f*cked up ๐
Yeah I fixed that with the timer check @meager spade
But yeah I ran into that a lot too
it will compare to last sent state in the changelist manager, not the last acked one (other way would result in many duplicate changes being sent)
Ahhh right, of course. Yeah should update that..
interesting video
Lol, yeah I really should pull this website idea out of my backlog :/
Seems like a good idea until you realise how much extra work it is
could had guessed that by the number of posts on it ๐
You've all given me a lot to read. I feel I've misled myself on the use cases of repnotifys and multicasts so I'll be studying them again.
I wish there was more information on creating small (four-player) co-op games like Overcooked. Everything I find is about massively multiplayer competitive shooters and so I find it difficult to translate into what I need.
For the most part I think the same concepts still apply to be honest
Except for relevancy. Since everyone is always meant to see the same screen. And also, most of the information about cheat prevention is unnecessary I find.
just ignore relevancy then
Thanks for the advice. ๐
Hello everyone !
I'm trying to make a widget properly communicate for a multiplayer, but I can't seem to find on how to setup the Timer handle.
Could anyone spare some time for me ?
how a widget functions has nothing to do with multiplayer
they are not and cannot be networked
I mean, I understand that much, but my issue is, that the widget works fine
nvm
I guess i'll ask in blueprints section
Greetings, I was wondering if anyone has had any experience with creating a small matchmaking system before. I am currently working on Dedicated server -> Dedicated server connectivity or data managing but I am having issues on with some RPC events. I suspect the issue to be withthin the UDP sockets but not quite sure. Has anyone had experience with UDP sockets?
I'm having trouble using Seamless Travel and Server Travel. With seamless travel OFF, I use the servertravel console command and it brings the host and all clients to the level no problem. But if i turn seamless travel ON, server travel no longer works. Someone said try using Open Level, so i did that but it kicks all clients from the game and only moves the host. Am I missing something?
hello people, does any 1 know how to make the players return to the main menu after a session has ended? (or any map rly)
i saw some one saying that if u destroy the PC's then players would automaticly disconnect but that doesnt sound like the proper way to handle things, any 1 has any info on that?
I think there's a return to main menu function in the game mode
So just call it from the host/server
Then it will disconnect everyone and return them to the menu
@limber gyro
Does anyone know How I can spawn an actor at different locations based on if the player is locally controlled or not
yes but how does that function know what map is the main menu?
yes but my default map is my login map so theres that issue haha
Ohh then I'm not sure
You could send some message or call an event on each player to go back to the menu
Then keep checking if they've gone before closing the game
Is attachment replicated?
what do u mean
like attaching a weapon to a player?
i ve never done that but i assume u would need to use an rpc so that the attachment would be called on the server
check the logs see if u can find anything
log gets stuck there
Its probably because of toast computer
will try again now
restarted
might be, looks like its trying to do rendering related stuff
nah I spam this play button
probably died lol
nah
it doesnt go forward no more
๐ฆ
what happens if I remove scalability.ini
would it generate again ?
no idea sorry
deleted binaries, interm, saved, .vs, sln and regenerated
still getting stuck in the same place
oooooh
never mind
its not stuck
lol
It didnt join for once and I paniced 
Hello everyone I just completed the QuickStart guide for networking a ThirdPerson game, everything is working great except for one thing. I Have it setup where when a player takes damage it debugs a message to the screen. Currently it's debugging the message on everyone's screen not just the screen of the one taking damage. I've followed the tutorial 100% and it even says at the end of it, that only the client should be seeing when they are hit and if they have died, but that's not working properly for me. Would love some help on this, thank you!
@hoary hornet cause you having server and player display the message?
is deaded a word?
I have a third person multiplayer game im working on. everything actually works great, I can get animations syncing movement seems smooth. but when clients are standing still, the camera seems to jitter a lot. only on client, and only when standing still on 90% of meshes (There is one when standing on it the jittering stops) I cannot figure out why
@clear copper : you working with dedicated server or no?
do you have your skeletal mesh component replicated @subtle snow ?
have to ask cause i have seen many people with that issue
cause they replicated the skeletal mesh component
I dont think so, I did uncheck all component replication in hopes of resolving it
I did enable Ignore Client Movement Error Checks and Correction (Bad Idea) just to ensure its a correction issue. and it is resolved. Just not sure where the issue is originating as everything works great unless standing still.
if I want to make a component replicate via ForceNetUpdate only, do I disable SetIsReplicated and keep DOREPLIFETIME() variables?
no
it has to be replicated
ForceNetUpdate does not replicate it
set it replicated
make it dormant
and call FlushNetDormancy when you want to update it
or switch it back to non dormant
Is Component Dormancy a thing?
So is there any way to update a component slower than the overall actor?
nope
What about Push Model?
I see, thanks
I read the header documentation in Push Model, but there was a lot of theory to wrap my head around, is there an example somewhere?
just a simple usage example?
@clear copper : you working with dedicated server or no?
@crude coral No, listen server. Host opens a listen level, players connect, host server travels
@meager spade there's a lot of nice diagrams out there about the lifecycle of an actor in the engine, or the lifecycle of the engine itself, and which classes exist on different net owning connections, but is there one which shows the overall lifecycle of a replicated property in a component/actor
Like, which functions are called, how often, which classes are involved, etc
Maybe I should make one ๐
What would be an example of a rare case where the client would have authority in a "Switch has authority"? Ive heard it can happen and I cant find anything online about that
in my game theres a first person mesh and theres a third person mesh this also applies for guns
what i want to do now is spawn a projectile at the muzzle of the gun
But I only want to spawn one
so im asking how i can spawn that same projectile at the muzzle of the gun depending on which gun is being seen by said player
like how the player himself can see his gun
and others can see the third person gun
I'm not sure why you need a third and first person mesh for your gun. I understand the player model, but not the gun. The gun should be attached to the first person mesh and the third person mesh should be a child of the first person mesh and parented to it.
inside visual studio there option for build Android and inside it more options about the build like you see in the picture...that mean use them to build my multiplayer Android game ( dedicated game server=Shipping Server and the Client game= Shipping Client)? or for the server i need use the options of win64?
@clear copper Where are you doing that, PIE?
I am having a weird bug where the skeletal mesh generates the hit and overlap events only on the server and never not on the client, any one knows what I am doing wrong?
@twin juniper no, but you can call it manually if net mode is NM_Standalone i guess
@fringe sinew not sure, but it happens to me that when some actors are moved by replication they skip collisions detection
Yeah that's just weird.
Definitely xD
hey guys anyone here can help me setup charactermovementcomponent file?i wanna inherit from existing one
i cant find any resources that can help me inherit from existing one
Just create a new class that inherit from CharacterMovementComponent
no i dont want to do that the cmc im inherit from already have some fucntion and i wanna inherit from that ..here the file
im trying to inherit from this
what should i do do i override and call the super class ?
it's the same, inherit from this class
yeah i know but then i need to dfo a bit of setup and call the super class of existing fucntion like fsavedmove or fnetworkpredictiondata
I guess just override the functions and call super when you need it
yeah i did that 2 days ago and i tried to call the existing function from owscmc the startsprinting and it wont work but if i just inherit and dont call the super class of the fucntion like above it works just fine
are you overriding StartSprinting()?
no
i wanna override the FSavedMove_OWS,FNetworkPredictionData_Client_OWS,OnMovementUpdated,UpdateFromCompressedFlags,GetPredictionData_Client,Clear,GetCompressedFlags,CanCombineWith,SetMoveFor,PrepMoveFor,FNetworkPredictionData_Client_OWS,AllocateNewMove,
i think these are the fucntion i need to override to make the inherit cmc works
but im not so sure
sounds more complex than I thought
have you considered to modifiy OWS class instead of inheriting?
no because i wanna make the upgrading process easier when upgrading to the new version of the plugin
so i go with inherit method
I see, right. However calling super should work even from the inherited class, not sure why it's not working for you
that what i thought as well but idk what went wrong
Good morning. If one sets a RepNotify property to have the same value as it already had, does it call its OnRep_ function?
no
Thank you!
I don't want it to so it's ideal for me already. ๐
{
// pack bitfield with flags
uint8 Flags = (bIsFatal << 0) | (bIsCritical << 1) | (bIsShield << 2) | (bIsShieldDestroyed << 3);
Ar.SerializeBits(&Flags, 6);
bIsFatal = (Flags & (1 << 0)) ? 1 : 0;
bIsCritical = (Flags & (1 << 1)) ? 1 : 0;
bIsShield = (Flags & (1 << 2)) ? 1 : 0;
bIsShieldDestroyed = (Flags & (1 << 3)) ? 1 : 0;
bOutSuccess = true;
bool bOutSuccessLocal = true;
Location.NetSerialize(Ar, Map, bOutSuccessLocal);
bOutSuccess &= bOutSuccessLocal;
Normal.NetSerialize(Ar, Map, bOutSuccessLocal);
bOutSuccess &= bOutSuccessLocal;
Ar << HitActor;
Ar << DamageAmount;
return true;
}``` does this look like a valid NetSerialize?
does anyone know why it lagges for the clients when they connect to the host? listen server thingy (im new to programing)
Hello again. Should all movement logic be run on the server? For instance, would it be best practice to have a RunOnServer event running this logic instead of running it right off of InputAxis?
@clear copper Where are you doing that, PIE?
@thin stratus No, stand alone.
Hey everyone, im trying to get the gender from my game instance and use it to specify my player's character but its not working and i have no idea how to fix it... id appreciate help. Thanks
@thin stratus hey i remember you helped me so much before i hope you can spare a minute to help me with this
General networking question: Should practically every property that needs to be set be set on server? Examples: VerticalSpeed, ProjectileClass, LastTimeFired.
Should all this setting be run by a RunOnServer event and then replicated if needed?
When we pass an Actor to a Run on Server event... is it just the reference to the Actor that gets sent over to the network, to minimize bandwidth, or is it the entire Actor (i.e. all of its state and members as it exists on the client), that gets transmitted to the server?
Is there much in the department of server authoritative physics?
When populating Steam leaderboards, how can you get the current Username from the CSteamID? EDIT Found it: SteamFriends()->GetFriendPersonaName(CurrentEntry.m_steamIDUser);
ah hmm, seems they are adding a new networking plugin that seems to be write down this alley
Guys I m implementing Beacons, and its failing at handshake
Sat Jul 11 21:08:51 IST 2020 Log LogBeacon EOSPartyBeaconClient_0[IpConnection_13] Client received: Challenge
Sat Jul 11 21:08:51 IST 2020 Log LogBeacon Beacon close from unexpected control message```
Server accepts the connection, but handshake fails from client side and connection gets interrupted.
I think I found the issue, the default implementation of Beacon Client doesn't handle this case ```DEFINE_CONTROL_CHANNEL_MESSAGE(Challenge, 3, FString); // server sends client challenge string to verify integrity
Does it matter whether I call an OnRep_ function on the server or on the client?
I think its automatically triggered , you dont need to call it. Engine will call once the variable is updated.
Thanks. But should I only be updating those variable on the server? Via RunOnServer events for instance.
I'm not sure if this would go here or under animation but I have a 1D aim offset used for looking up and down on my character.
i got it working and all for the character.
but if I have one game host a game, and another connect to it, the aim offset still works but, clients cant see other clients or the server look up or down but the server can see everyone look up or down.
the rotation is based off of the owning character's control rotation. and Ive heard that pitch is not replicated. How would I replicate pitch on control rotation?
@somber glade but that doesn't make sense . I'm not going for true first person so both meshes have different animations
Hey everyone, im trying to get the gender from my game instance and use it to specify my player's character but its not working and i have no idea how to fix it... id appreciate help. Thanks
@tacit pecan why is it in your GI not the player state?
not a specific reason ive just gotten used to doing it that way
is there a difference?
generally easier to get player information from their player state, but even still what's the issue you're having?
Anyone knows if multi-threading can cause issues with RPCs or network functionality?
@clear copper its not acting like its supposed to
this is my setup
then this is the Male boolean rep notify
all im trying to do is to get the gender from the game state and based on that randomly pick an int that selects a character from either a male characters array or a female one.
its not working though and ever since i added the is locally controlled check its not picking a character at all
@waxen socket only the server can set replicated variables, so yes you will want to run on server when setting
@tacit pecan try adding a delay before the local check
Your pawn probably isnt possessed when that is called
that fixed the server but the client is spawning the same thing as the server instead of a male character like it should
@placid sparrow
Use a switch has authority node if you need to run something different on the client
Or add another bool to check if its the server or not
Listen server i assume?
ok so now its working except for the client cant see the listen server pawn
yep
@placid sparrow
Thanks so much. I'm struggling to understand what should be set locally and what should be set on the server. A rule of thumb would really help me out.
Ah id have to be at my pc to look into it. I dont deal with listen servers
Anything gameplay relevant to both server and client should be set on the server
@waxen socket
its doing the exact same if i run on dedicated server
actually its doing one extra mistake - its printing string an index and spawning a character that is not that index
Oh i think you need a change that to a multicast and those variables dont really need to be replicated. Just have the server call the multicast on begin play
so keep everything as is and change it to run multicast?
The way you have it set up you may need to do a bit more. But i assume you want it to show the same across all clients?
@tacit pecan this trick should work, you need to get index from game instance instead of skeletal mesh, you can add multiple meshes here based on index, it should work
@placid sparrow yes exactly
@wheat magnet The issue is before that , its not even showing the character sometimes
Yeah you need to rework your logic to be a multicast and get rid of the locally controlled check
And just have the server call the multicast and you should be good
does this inheried cmc setup correct anyone have done create a new cmc inherit from an existing cmc
@waxen socket doesn't matter, just update value
quick question does repnotify not work on the client that just changed the variable?
my setup gets the gender and updates the repnotify which works for all other clients and the listen server but not the client itself i have to call the same function again for it personally
When i try and look around on my client with the server in my game, my Y axis view snaps to 0. When i leave and play as a solo client, everything is fine.
@foggy idol it seems like more work to make them not match then match. Now you need an extra gun and there is no way to spawn a projectile like you want. If the animations are different the gun positions are different so just pick one and use that as the "real" gun
Yh I realised that earlier
So I'm just going through try and match up the gun positions as best as possible
Then use the fp gun as the source
@heady python why are you setting the relative location of the camera
Just use pawn control rota
*rotation
Then add pitch input
If your doing that to replicate the camera pitch then follow this https://answers.unrealengine.com/questions/181581/how-do-i-replicate-my-camera-rotation.html
It will show you how to replicate the camera rotation
I use it in my game and it works well especially for spectators
Hello im trying to replicate an AI ped being ragdolled when killed. When the server kills it everyone can see it, but when the client kills it none can see it. Anyone know what I done wrong?
well
you cant call server RPC's
from an AI
the multicast will work sure
but that server rpc, nope
hmm so what is the solution here, im trying to learn ๐
just call the multicast
drop the server rpc
also
doing HasAuthority after a server rpc is pointless
cause that IS the server
and it HAS authority
FYI.
so that is redundant
okay thanks i will try it out
it will work
that is all you have to do
btw don't call DestroyActor on multicast
calling it on the server is just fine
as its replicated
you meant like this?
hmm cause now when the client kills it it can see the ragdoll but the server cant
so where is the logic being run?
you only shown half the stuff
Multicast runs on server and clients in BP
if called from the server
@foggy idol thank you for your help. I have no idea why but it just started working. . . . I went to go eat came back and my clients Y input just worked flawlessly. . .
Oh ok
here
maybe I jsut stick to make it singleplayer cause this networking stuff is kinda hard o understand ๐
To be honest once you know the basics it's not that hard
And Kaos said you should call the destroy on multicast
Just call it normally since Ai exist on the server
I want to make a multiplayer fps game. Cant be that hard right?
Tbh depends on what you plan to make , how many players , game modes ....
Save the hostages
20 players
5 terrorists 15 fbi
8 bots as hostages
And a game chat
ye I fixed that now but i still dont udnerstand when the client kills the ai only the client can see it but when the server kills it everyone sees it
Okay.
Hello! under the actor replication there is net dormancy options can help performance net frequency ?
basically, dormancy is something one should not be concerned with until you have a game that mostly works already
@winged badger my stat is ok?
for the amount of stuff on screen, it way too heavy
i need lower them?
can't say if your CPU or GPU locked
you know better way for take exactly stat info?
when i use app for the screenshot the fps drop without the app screenshot is 118 fps
you should not worry about performance until its a problem
its one of more common beginner mistakes - they imagine that accounting for performance in advance helps them in any way
is there any way for test that and be sure about performance? the game for android
to handle performance you need experience, and you get that after you screw up real bad then fix it couple of dozen times
i test the android version of the game on lot mobiles ( low and midium) and i don't see lag is there other solution for testing inside the computer itself?
emulateur can be good for testing?
just double checking, if the server changes a replicated variable without a multicast the variable would change on all the clients?
Is it possible to give people ranks? Like moderator for multiplayer games. If someone hacks or is spamming in chat.
What actor do you use for SetOwner generally? I know the client needs to own the actors it is sending RPCs on but not sure how to set that for my local character
oh never mind, the playercontroller already has ownership, just realized I was calling it on a second client by accident
@twin juniper You can do whatever you want, you just have to code for it.
That sounds strange, can you post your code/graph for the attachment?
Is the sword and its root component replicated?
nice, thanks
How should I go about interacting with another object from a client?
I understand I should be sending RPCs as "input", but how should I represent to the server what the other actor/component is?
I see GetUniqueID for UObject but I don't know if these are replicated
I guess this is more of an XY problem, the real thing I should be asking is how do I talk about the same object between the client and the server
Hello! I could use some help with a replication issue... Situation:
- Characters are indirectly controlled via AIController (Player owns an intermediate pawn which does pathfinding, characters move along that path)
- Characters can enter different poses (lean left/right), effectively changing the position of their weapon
- Firing the weapon is done entirely on the server (auto-fire)
Problem: while the animations play fine, the updates of the weapon location (attached to a socket on the hand bone) will only be reflected on the server if this character happens to be visible to the hosting player. Now if the character is not visible to them, the animation for leaning left/right plays fine, but any shots originate from the unmodified weapon location.
We're mainly implementing in C++, the animations are currently done via "Blend Poses" in the BP, based on a (properly replicated) enum value that defines which direction the character leans towards.
How can I make sure that pose updates are always known on the server?
Thanks!
@void pasture animation notifies don't fire unless they happen close to the host's / server's camera
we had to move all notifies in our animation assets to montage assets
i assume your animation plays fine, then doesn't throw a notify that swaps the socket attachment
montage assets don't have the same... optimization, so they notify just fine
basically, while the weapon looks ok on the client, server never changed the socket
oh hmm you can just send references directly over the network and it gets translated into a guid?
@winged badger thx, but we don't even use notifications, we just rely on the socket positions being updated
what causes your socket position to update?
the dedicated game server when running need CPU just? or little GPU too?
@still cape any network reference is a NetGUID
although first time around, it might send a full path for some things, like asset references
hmm interesting
@void pasture you need to change your visibility based rules
to always update bone and transforms
is no way to know how much GB need be the virtual processor for be able to run like 50 sessions for 50 players each session ? because i thought each match of 50 players have his own instance of dedicated game server so for 50 match will be 50 instance of dedicated game server no? so the question will be how much instance of dedicated game server Can handle the 3.75 GB virtual processor?...
3.75 cpu ..no way to testing that locally?
Would it be possible to simulate AI on clients (like ones out of range of any single player, give a unique list of NPCs to run on a client, send results to server) and then once a player is in range the server takes over of the AI from last update so there is no latency when a player is in range?
But that would still take CPU time on the server?
What's the difference between a session and a listen server?
Does the session not take part in the game itself
but listen server does as a player
listen server is a server that has a local player
it has no other difference from dedicated server
sessions and servers are not nearly the same thing
Is there an easy way to run a debugger on a dedicated server?
@twin juniper you would need to do optimizing ie when its dormant
disable CMC tick, etc
Is there more to do for a client to properly leave a session more than DestroySession + switching levels?
huh TMaps arent replicated
nope
Would it be more efficient to set a struct separately on each client or to set it on the server with replication?
if the clients can figure out what the struct data is without replication, then option#1 without question
Is that only because it's a struct?
never replicate the same thing twice because it seems to make your life easier at the time
it doesn't
that goes for any data
not just structs
Basically Zlo means if there is a way to replicate a smaller amount of "data" and have the clients locally imply what that means, go for it
I could find the struct in the data table separately on each client.
Then I wouldn't have to replicate ProjectileInfo or CurrentProjectile.
Replicating the name is better
So this would be a use case for a multicast?
Player gets powerup that changes projectile. Powerup calls multicast event that sets the projectile on each client?
and if one of your clients walks in from outside relevancy range or joins late
then it has incorrect info
But if I use RepNotify, then isn't that just replicating?
it is, you repnotify the name and you call set projectile inside OnRep
The name, gotcha.
mutlicasts are for fire & forget
something thats gameplay relevant now, and is irrelevant later
So the Powerup actor will get a reference to the pawn that overlapped it, it will set "ProjectileName" on the pawn, which will RepNotify all the clients to set their projectiles.
yes
Okay, but I do have to run that initial setting of ProjectileName on the server somehow.
Otherwise it won't actually replicate, yes?
that you'd do the same way as if it was a single player game
if the idea is to overlap pwoerup which sets projectile
that is all you need to do
if client can select its projectile, then its ServerRPC with Name as payload
I'm intending on the former.
So why wouldn't I have to RunOnServer when setting Name?
Oh, right.
๐
Thanks so much for your time, Zlo. You're always so helpful.
I have a general question for you: Do you think Listen Servers are still a valid option for games?
Yeah, mine's four-player co-op.
then yes, its a valid option
And there's no persistent world that needs to run when no one is around.
even if there was, its possible to save it
Okay. Sometimes I feel like I'm going down an antiquated road that no one is interested in anymore with listen servers but I'll take your word for it.
Is there more to do for a client to properly leave a session other than DestroySession + switching level?
Dedicated server not showing up in online tab
Ive stopped trying a few months back and now I am back on it
It might have to do with ports and such and I will try with actually setting it up for VS as well
but the tutorial I have followed was able to list it under online tab and it was recorded a month ago
I am using advanced sessions and also find session doesnt find it as well
Engine.ini
OnlineSessionAsyncServerSteam.cpp
Build.cs
ServerTarget.cs
Target.cs
Inbound Rules
Outbound Rules
Router Port Forward
Creation of Session
D:\UE4Source\UE_4.24.1\Engine\Binaries\Win64\UE4Editor.exe "D:\UE4_Projects\EONRemastered\EON\EON.uproject" -log -server
I am using shortcut as this to test the server
I am using 4.24.1
Our game is registered in steam same goes for the dedicated server, it does show up in games filter
@twin juniper just glancing id say probably cause the port you have setup
its not always 7777
do like 7777-7796
Im uploading to the actual server right now and will check
that fixed my issue before
it does come up as 7777 in lan browser tho
give me a min I will check with server
appreciate the help ๐
nah it doesnt come up
Hello every one, does any 1 know how you are supposed to handle the server starting with a random map?
is this suposed to be handled by the backend service or does unreal have a way to do this?
is steam supposed to be open on the VS
I dont think it does tho
It does successfully creates the session but doesnt list it
@limber gyro I never did it but i think the way that would have to work is you need to have a separate server build for each map you want to use. Then have your client connect to which one you want
@wicked brook that sounds terrible to be honest
i mean i could be wrong but im pretty sure a server can only have one map so if that is correct then that's how it would have to be done as far as UE4 is concerned. Now you could leverage something like SpatialOS which could be better but i have not messed with that much for what you intend to try
I'm pretty sure the server can just change maps to whatever it has available
An overview of how travelling works in multiplayer.
Actually i think i was thinking of server default map
because i have match making going
so i think if you build all the ones you want into the server build maybe it would work
I mean, you need to pick the level somewhere, whether it be random or whatnot and UWorld::ServerTravel seems just be the way you switch levels.
in that case i think you would need separate builds with default server map set for each one?
because I did what you told me @wicked brook and made 7777-8000 for inbound-outbound
firewall or forwarding
For example in my batte royale. I have different maps. Each one is a separate build and depending on what is selected in the lobby then thats the server map it connects to
I would just restart then
no way to really know whether it would be cached or whatever
@twin juniper why have it open on tcp and udp. Should only be UDP right?
well I wouldnt know since its my second attempt to try setup the steam integration
also I should mention
I checked 7785 as well
and port was showing up as closed
but I could join just fine traditional way
on port 7785
i mostly use gamelift so it could be a bit different setup perhaps
Hey guys, I'm having trouble setting up the OnlineSubsystemSteam plugin. I can't get the Steam Overlay to show up on my packaged Mac game. When I open the logs, it says Unable to load plugin 'OnlineSubsystemSteam'. Aborting.. I have imported and enable the AdvancedSessions plugin. Enabled OnlineSubsystem and OnlineSubsystemSteam. Setup my DefaultEngine.ini file. What could I be doing wrong/