#multiplayer

1 messages ยท Page 554 of 1

chrome bay
#

Those GetPlayerController() and GetPlayerPawn() by-index nodes are basically useless in multiplayer most of the time

winged badger
#

they account for about 30% of ridiculous bugs on this channel, actually

#

like no matter which player got killed, the listen server host died

frigid solar
#

ahaaaa

winged badger
#

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

frigid solar
#

Well I learnt something new today!

#

That has cleared up my massive PIE message Log

chrome bay
#

Welcome to multiplayer hell ๐Ÿ˜„

frigid solar
#

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

chrome bay
#

Just take every blueprint tutorial you've ever seen, and throw it all away ๐Ÿ˜„

frigid solar
#

Awesome!

winged badger
#

preferably use c+ for networking

chrome bay
#

Even Epic's official MP tutorials are... questionable

winged badger
#

i absolutely hate doing any networking in BP

chrome bay
#

+1

winged badger
#

those are borderline criminal

#

MP BP tutorials

frigid solar
#

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?

chrome bay
#

Neither ๐Ÿ˜„

#

Game Mode is probably a good place for that

winged badger
#

agreed

frigid solar
#

I did wonder about that

#

BUT I DONT USE THE GAMEMODE CLASS!!! haha

winged badger
#

all spawning and respawning of players belongs in GM

chrome bay
#

There is a "RestartPlayer" function which does essentially that, it'll spawn a new pawn and give you control of it

frigid solar
#

Ahh yeah

winged badger
#

and it does exactly that even if you didn't make a custom GM

#

its what spawns your default pawn

frigid solar
#

I do have a custom GM. It just doesnt do a lot at the minute

chrome bay
#

The base GM does a fair bit

frigid solar
#

well yeah. But I havent added anything to it

chrome bay
#

But it's where all the "rules" of your current game mode apply and generally belong, so respawning, how scoring works probably etc etc.

winged badger
#

note that GM doesn't quite work out of the box if your game is not a match based shooter

chrome bay
#

That figures ๐Ÿ˜„

frigid solar
#

And what about storing health and energy? And functions for restoring those over time?

winged badger
#

i have components for that

frigid solar
#

Ahh

#

And you add those components to the character?

winged badger
#

and an attribute component they automagically hook into

chrome bay
#

Usually yeah. relevancy / data locality matters a lot more in MP

winged badger
#

so they can respond to changes in MaxHP, Regen... instantly

chrome bay
#

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..

frigid solar
#

So health stuff should belong in the player state?

chrome bay
#

In the pawn

frigid solar
#

ohh

chrome bay
#

Player State = something persistent to the player themselves, so their display name etc.

winged badger
#

unless you happen to have the game where you're skipping pawns but keeping health from previous one

chrome bay
#

Yeah or that

winged badger
#

then a case could be made that it belongs in PS

frigid solar
#

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

meager spade
#

gets the ๐Ÿฟ for the MP 101 course for free! :)

frigid solar
#

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

meager spade
#

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

chrome bay
#

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 ๐Ÿ˜„

frigid solar
#

haha

meager spade
#

50k is super fast tho

#

i can just click and teleport on the world map ๐Ÿ˜„

#

to where i need to go

chrome bay
#

...why don't I have that

#

I'm going to do that RN

thin stratus
#

"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.

winged badger
#

Kaos made a terribly ugly one, but upgraded it once he saw he gets killed every time when he doesn't use it ๐Ÿ˜›

clear copper
#

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?

winged badger
#

don't let it start match until NumTravellingPlayers == 0

#

i think in BP there is a CanStartMatch function you can override

clear copper
#

in the GameMode, BeginPlay doesn't trigger until ReadyToStartMatch is true correct?

winged badger
#

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

clear copper
#

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?

meager spade
#

yes

#

well

#

kinda

lavish cypress
#

speaking of cheats, do you place it all in a cheat class to be safe or is an if WITH_EDITOR enough?

meager spade
#

CheatManager ๐Ÿ˜„

clear copper
#

what do you mean kinda?

meager spade
#

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

lavish cypress
#

What about if you want one kind of Pawn to have access to a cheat, but no others

meager spade
#

i gate mine behind authority

#

that is up to you to do

lavish cypress
#

fair enough

grim lintel
#

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?

clear copper
#

peer to peer is probably fine

#

but im no expert

#

lol

viral harbor
#

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

buoyant wedge
#

I think you need set a online subsystem. The original subsystem is work only to LAN.

viral harbor
#

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

buoyant wedge
#

@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.

clear copper
#

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

twin juniper
#

What a hell in 4.25 with debug networking (multiplayer options)?

#

Client -1? ๐Ÿ˜„

#

Where server going on?

buoyant wedge
#

@twin juniper you have set in the play setting. Listen server?

twin juniper
#

@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?)

twin juniper
#

Solved..

gusty slate
#

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?

winged badger
#

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

clear copper
#

the GameInstance persists right/

winged badger
#

yeah, but its also not a garbage bin for everything you don't have a better way of persisting through level transitions

clear copper
#

Kind of seems like its entire purpose if it's one of the only things that just persists all the time

winged badger
#

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

clear copper
#

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

weary badge
#

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

clear copper
#

Never mind i found it

winged badger
#

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

weary badge
#

๐Ÿ‘€

#

yes...

#

@winged badger widget dont work ?

clear copper
#

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?

weary badge
#

something in my understanding must be off

empty matrix
#

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?

weary badge
#

@empty matrix Hmmm, I'm still a beginner, but did you replicate the bullet actor itself ?

empty matrix
#

As well?

proven axle
#

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

buoyant wedge
#

@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.

gusty slate
#

@winged badger Hello, what do you mean by Subsystem? ๐Ÿ™‚

leaden atlas
#

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

fathom dust
#

Is there a good example around of using OnlineSubsystemNull when running in editor and OnlineSubsystemSteam standalone?

clear copper
#

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.

weary badge
#

could someone join me on a sharescreen and help me solve a replication problem pls ?

#

german english french are all ok

winged badger
gusty slate
#

Thank you ๐Ÿ™‚

twin juniper
#

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.

winged badger
#

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

half jewel
#

dormant actors wont accept server RPC calls ?

twin juniper
#

@winged badger ok thanks

winged badger
#

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

twin juniper
#

so would it be normal for the construction script in the gamemode to spawn actors?

#

nvm just tried

#

cant copy and past ๐Ÿ™‚

half jewel
#

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

winged badger
#

and those actors tend not to use dormancy

#

as client owned actors tend to be gameplay critical

half jewel
#

i thought since the properties on it only change threw rpc i can set to dormant, and do forceNetUpdate() inside those serverrpc for performance

winged badger
#

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

half jewel
#

ah this is a real problem for what this actor does then

winged badger
#

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)

twin juniper
#

dormancy time for a youtube video ๐Ÿ‘

agile lotus
#

Is there a way to reliably replicate Add Impulse?>

#

Everyway I try it's always off on clients

limber gyro
#

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

winged badger
#

GameMode->GetNumPlayers() @limber gyro

limber gyro
#

@winged badger that doesnt work

#

i need to detect alt f4's and crashes

winged badger
#

it counts the player controllers on server

#

so it has to work

limber gyro
#

well it doesnt lol

#

ive tried it

#

when you alt f4 even the player character stays there

winged badger
#

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?

limber gyro
#

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

winged badger
#

so do i, never had your problem

limber gyro
#

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....

winged badger
#

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 ?

limber gyro
#

ye

winged badger
#

breakpoints in GameMode::Logout, PC's EndPlay, GI's HandleNetworkError

limber gyro
#

i dont have endplay overriden

#

i was gonna do the heandle network stuff now

#

seemed like the only option

winged badger
#

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

limber gyro
#

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

winged badger
#

even if logout doesn't run it should timeout after default 60 seconds

limber gyro
#

after the 60 seconds the getplayernum should reflect the actual player number then?

winged badger
#

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

agile lotus
#

in 4.24 I can't seem to find net pktlag or any relevant commands when typing them in the console

winged badger
#

it doesn't offer autocomplete suggestions

#

but they work

#

net pktlag=200

limber gyro
#

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?

winged badger
#

no whitespaces around =

agile lotus
#

they aren't working

winged badger
#

it does

#

they don't work if you put a whitespace there

agile lotus
#

nvm

#

im dumb

#

lmao

#

ty

#

๐Ÿ™๐Ÿป

limber gyro
#

so the server sees the player leaving but logout doesnt get called LOL

winged badger
#

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...

limber gyro
#

pretty sure i didnt

#

so strange

#

anyway i can see that chain without digging through source

winged badger
#

since its sending close bunch

#

OnNetCleanup in PC should get called

#

it eventually leads to LogOut

limber gyro
#

ok so i jsut noticed that i forgot to call super on begin play in the PC

#

could that be the reason?

winged badger
#

that rarely ends well

limber gyro
#

ahahah

winged badger
#

but yeah, it could leave it in invalid state for the entire session

limber gyro
#

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?"

winged badger
#

its been some years since that happened last time for me

limber gyro
#

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

winged badger
#

Destroying an Actor doesn't do the same thing if Actor never began play

#

had an issue with that few years ago

graceful niche
#

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

winged badger
#

client can't send RPCs through Actors it doesn't own

graceful niche
#

I see, do you have any advice where to store the RPCs?

winged badger
#

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

graceful niche
#

Alright, thank you very much

vivid seal
#

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?

thin stratus
#

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.

gleaming vector
#

its easy in C++

#

just a custom netserializer

frigid solar
thin stratus
#

The page says that it depends.

#

Which is what I would tell you too

#

There is no "one rule".

chrome bay
#

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.

frigid solar
#

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?

chrome bay
#

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

frigid solar
#

OK cool. And what about referencing a function or event from one to the other?

chrome bay
#

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.

crude coral
#

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

clear copper
#

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.

crude coral
#

@clear copper Seamless travel option used for (open level ) function not the execute console command

clear copper
#

oh, that makes sense lol

crude coral
#

you talking about Seamless Travel option of the game mode yes?

clear copper
#

Nah i figured it out

#

appreciate it

crude coral
#

glad you figure it out!

faint lintel
#

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?

placid sparrow
#

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.

waxen socket
#

Is it acceptable to access the game mode from the player controller blueprint or is that a no-no?

ancient flare
#

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?

safe spade
#

have you found any reference materials or examples so far? I'd be curious too

twin vault
#

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

twin juniper
#

umm for some reason when second player joins in it doesnt go to the server function no more

faint lintel
#

Hey, I have a problem that one of my objects has to rotate, but on client view it is jittery

clear copper
#

@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?

twin juniper
#

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

empty matrix
#

Hey guys! Can you help me?

#

This is a video

lost inlet
#

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

crude coral
#

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

crude coral
#

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.

green delta
#

@clear copper are you testing in STANDALONE or in VIEWPORT?

#

you have to use standalone to do seamless travel

clear copper
#

ah ok

somber glade
#

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

somber glade
#

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?

fossil spoke
#

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.

somber glade
#

I have custom things like skins and stuff that need parsed

fossil spoke
#

?Skin=Hulk

#

That can be parsed with a single function

#

In UGameplayStatics

somber glade
#

Yes. I'm just trying to figure out how to pass those to the server. Can I call that after calling join session?

fossil spoke
#

OpenLevel passes that for you

somber glade
#

Calling join session makes me open the level anyway when I join

fossil spoke
#

JoinSession should have an Options FString as well?

somber glade
#

So I should use this open level instead of join session

#

It does not

fossil spoke
#

Well then im not sure.

#

Ive never used the integrated Session stuff.

somber glade
#

Just takes a player controller and blueprint session info

fossil spoke
#

Maybe you should do some googling on how to pass Options when using JoinSession.

somber glade
#

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

fossil spoke
#

Yeah you may need to write your own JoinSession function in C++ to expose Options.

#

Im not entirely sure.

somber glade
#
(
    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?
fossil spoke
#

Only the Server has a GameMode, so only the Server calls AGameModeBase::Login

somber glade
#

Okay, I'm just trying to follow the path of how that options string is passed from client to host normally

fossil spoke
#

Via the OpenLevel function.

#

It is appended to the URL.

#

Which gets sent to the Server to notify of an incoming connection.

somber glade
#

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.

fossil spoke
#

UWorld::NotifyControlMessage calls AGameModeBase::PreLogin which takes in the Options from the URL.

somber glade
#

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
#

@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

fossil spoke
#

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.

somber glade
#

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

fossil spoke
#

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.

somber glade
#

that would be the connect string? Just append the options to the back of it? I'll give that a shot

fossil spoke
#

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.

somber glade
#

okay, i'll give that a shot, thanks!

crude coral
#

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

crude coral
#

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 ๐Ÿ™‚

wheat edge
#

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

somber glade
#
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.

crude coral
#

@somber glade glad you fixed

somber glade
#

I'm not sure why the player controller doesn't first take the rotation of the pawn it's told to possess.

crude coral
#

I might keep that in mind

somber glade
#

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

crude coral
#

because by default the host is the server no?

somber glade
#

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.

quiet tendon
#

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?

void nest
#

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?

bitter oriole
#

It's the ping, so the round trip time

#

Use ExactPing for the non-divided version

void nest
#

so from A to B and back to A?

bitter oriole
#

Yes

void nest
#

ok thanks

bitter oriole
#

The A to B time is not measurable

chrome bay
#

'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)

void nest
#

but shouldn't A to B be pretty much the same as B to A ?

#

in ideal circumstances anyway?

chrome bay
#

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

void nest
#

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.

crude coral
#

can test the ping with local server?

chrome bay
#

You can't get it exactly

#

But you can get it close by using ExactPing * 0.5

void nest
#

Ok I'll try that. Can I get ExactPing in blueprint?

chrome bay
#

I don't think so

void nest
#

or is it code only?

#

and what is the difference precisely between GetPing and GetExactPing?

chrome bay
#

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

void nest
#

yeah I want to use it purely for lag compensation

chrome bay
#

ExactPing comes from the network driver and its more accurate, but only owning connection and server update it with some level of accuracy/frequency

void nest
#

Ok perfect

#

thanks for the info

chrome bay
#

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

void nest
#

Yeah, I guess it doesn't need to be perfect, but as close as possible

chrome bay
#

cool cool, yeah we use it for lag comp and it works well

#

well enough anyway ๐Ÿ˜„

void nest
#

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

crude coral
#

and what mean HealthPing?

void nest
#

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

chrome bay
#

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

waxen socket
#

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?

fleet raven
#

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

waxen socket
#

Oh, seriously?

#

So setting objects to Replicate is never useful?

fleet raven
#

replicating object references only works if the object is either an asset (from the content browser) or replicated itself (generally, only actors and components)

waxen socket
#

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?

fleet raven
#

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

waxen socket
#

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.

winged badger
#

RepNotify has no bearing on relevancy or Camera whatsoever

waxen socket
#

Oh. I must be misunderstanding something then.

#

Misunderstanding the use cases for RepNotify vs Multicast.

winged badger
#

RepNotify == when this variable is set or received via replication, execute the OnRep_ function that gets automatically createin BP

waxen socket
#

But that won't work with objects like a dynamic material instance?

winged badger
#

it will work with DMI parameters

#

you set a replicated Vector, OnRep sets the VectorParameterValue on DMI to its value, for example

waxen socket
#

Okay. And is that more efficient than creating the material on each client via multicast?

winged badger
#

you only need to create DMI once

#

then its all parameters afterwards

chrome bay
#

dynamic materials and references to them can't be replicated anyway

winged badger
#

and OnRep is more efficient then a multicast

#

multicast is there for non stateful changes that need to be replicated to clients

chrome bay
#

For state anyway, and sometimes even for events

meager spade
#

Multicast is ok for one off things that are fire and forget

#

but i prefer replicated props and use them more

chrome bay
#

yeah

waxen socket
#

Wow, thanks everyone.

chrome bay
#

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

waxen socket
#

I've been sticking pretty exclusively to multicasting so far.

winged badger
#

its even better if you replicate that the weapon is firing and have the clients simulate the rest

chrome bay
#

that too ๐Ÿ˜„

#

Although doesn't work as well for semi-autos/one-shots and stuff sometimes

waxen socket
winged badger
#

it does not

chrome bay
#

It will replicate a nullptr yes

waxen socket
#

Wow.

chrome bay
#

So, useless ๐Ÿ˜„

waxen socket
#

What a trap.

#

They got me.

winged badger
#

BP networking is full of them

chrome bay
#

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

winged badger
#

it can be made to support networking though

chrome bay
#

Yeah I guess so..

winged badger
#

completely wasted effort, but it could

chrome bay
#

๐Ÿ˜„

winged badger
#

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

chrome bay
winged badger
#

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

waxen socket
#

Trying to wrap my head around that.

#

Jambax, will this blog post you shared be translatable into blueprints?

chrome bay
#

You could do it, but it's a lot more work to translate it.

#

TBH, BP and multiplayer is a pain anyway.

fleet raven
#

comparing them to the most recently โ€˜ackedโ€™ properties on each connection this is technically incorrect br_anim_thinking

winged badger
#

blueprints have about 10% available networking tools in unreal

meager spade
#

@chrome bay issue i saw with BurstCounter, is if a player walked into relevancy, they sometimes randomly see a player shoot

chrome bay
#

@fleet raven it is??

winged badger
#

you can technically make a multiplayer game with them, but you'll cry before its done

meager spade
#

unless that was cause i f*cked up ๐Ÿ˜„

chrome bay
#

Yeah I fixed that with the timer check @meager spade

#

But yeah I ran into that a lot too

fleet raven
#

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)

chrome bay
#

Ahhh right, of course. Yeah should update that..

fleet raven
chrome bay
#

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

winged badger
#

could had guessed that by the number of posts on it ๐Ÿ˜„

waxen socket
#

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.

chrome bay
#

For the most part I think the same concepts still apply to be honest

waxen socket
#

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.

fleet raven
#

just ignore relevancy then

waxen socket
#

Thanks for the advice. ๐Ÿ™‚

weary badge
#

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 ?

winged badger
#

how a widget functions has nothing to do with multiplayer

#

they are not and cannot be networked

weary badge
#

I mean, I understand that much, but my issue is, that the widget works fine

#

nvm

#

I guess i'll ask in blueprints section

worn lodge
#

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?

clear copper
#

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?

limber gyro
#

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?

foggy idol
#

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

limber gyro
#

yes but how does that function know what map is the main menu?

foggy idol
#

It's assumed that your default game map is the main menu

#

So it sends them there

limber gyro
#

yes but my default map is my login map so theres that issue haha

foggy idol
#

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

plush wave
#

Is attachment replicated?

limber gyro
#

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

twin juniper
#

any idea why editor dedicated server gets stuck here ?

limber gyro
#

check the logs see if u can find anything

twin juniper
#

log gets stuck there

#

Its probably because of toast computer

#

will try again now

#

restarted

limber gyro
#

might be, looks like its trying to do rendering related stuff

twin juniper
#

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 ?

limber gyro
#

no idea sorry

twin juniper
#

yeah trying to figure out why

#

it is still getting stuck

twin juniper
#

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 kappaross

hoary hornet
#

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!

wicked brook
#

@hoary hornet cause you having server and player display the message?

meager spade
#

is deaded a word?

subtle snow
#

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

crude coral
#

@clear copper : you working with dedicated server or no?

meager spade
#

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

subtle snow
#

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.

lavish cypress
#

if I want to make a component replicate via ForceNetUpdate only, do I disable SetIsReplicated and keep DOREPLIFETIME() variables?

meager spade
#

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

lavish cypress
#

Is Component Dormancy a thing?

meager spade
#

no

#

Replication only works on actor level

lavish cypress
#

So is there any way to update a component slower than the overall actor?

meager spade
#

nope

lavish cypress
#

What about Push Model?

meager spade
#

doesnt work with components

#

only properties

lavish cypress
#

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
#

@clear copper : you working with dedicated server or no?
@crude coral No, listen server. Host opens a listen level, players connect, host server travels

lavish cypress
#

@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 ๐Ÿ˜›

terse prawn
#

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

foggy idol
#

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

somber glade
#

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.

crude coral
#

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?

thin stratus
#

@clear copper Where are you doing that, PIE?

fringe sinew
#

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?

oak hill
#

@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

fringe sinew
#

Yeah that's just weird.

oak hill
#

Definitely xD

karmic briar
#

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

oak hill
#

Just create a new class that inherit from CharacterMovementComponent

karmic briar
#

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 ?

oak hill
#

it's the same, inherit from this class

karmic briar
#

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

oak hill
#

I guess just override the functions and call super when you need it

karmic briar
#

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

oak hill
#

are you overriding StartSprinting()?

karmic briar
#

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

oak hill
#

sounds more complex than I thought

#

have you considered to modifiy OWS class instead of inheriting?

karmic briar
#

no because i wanna make the upgrading process easier when upgrading to the new version of the plugin

#

so i go with inherit method

oak hill
#

I see, right. However calling super should work even from the inherited class, not sure why it's not working for you

karmic briar
#

that what i thought as well but idk what went wrong

waxen socket
#

Good morning. If one sets a RepNotify property to have the same value as it already had, does it call its OnRep_ function?

meager spade
#

no

waxen socket
#

Thank you!

meager spade
#

in C++ we can make it do that

#

but BP no

waxen socket
#

I don't want it to so it's ideal for me already. ๐Ÿ‘

meager spade
#
{
    // 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?
eager flume
#

does anyone know why it lagges for the clients when they connect to the host? listen server thingy (im new to programing)

waxen socket
clear copper
#

@clear copper Where are you doing that, PIE?
@thin stratus No, stand alone.

tacit pecan
#

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

waxen socket
#

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?

versed socket
#

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?

still cape
#

Is there much in the department of server authoritative physics?

grizzled stirrup
#

When populating Steam leaderboards, how can you get the current Username from the CSteamID? EDIT Found it: SteamFriends()->GetFriendPersonaName(CurrentEntry.m_steamIDUser);

still cape
#

ah hmm, seems they are adding a new networking plugin that seems to be write down this alley

rich ridge
#

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.

rich ridge
#

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

waxen socket
#

Does it matter whether I call an OnRep_ function on the server or on the client?

rich ridge
#

I think its automatically triggered , you dont need to call it. Engine will call once the variable is updated.

waxen socket
#

Thanks. But should I only be updating those variable on the server? Via RunOnServer events for instance.

terse prawn
#

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?

foggy idol
#

@somber glade but that doesn't make sense . I'm not going for true first person so both meshes have different animations

clear copper
#

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?

tacit pecan
#

not a specific reason ive just gotten used to doing it that way

#

is there a difference?

clear copper
#

generally easier to get player information from their player state, but even still what's the issue you're having?

worn lodge
#

Anyone knows if multi-threading can cause issues with RPCs or network functionality?

tacit pecan
#

@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

placid sparrow
#

@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

tacit pecan
#

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

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?

tacit pecan
#

ok so now its working except for the client cant see the listen server pawn

#

yep

#

@placid sparrow

waxen socket
#

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.

placid sparrow
#

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

tacit pecan
#

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

placid sparrow
#

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

tacit pecan
#

so keep everything as is and change it to run multicast?

placid sparrow
#

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?

wheat magnet
#

@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

tacit pecan
#

@placid sparrow yes exactly

#

@wheat magnet The issue is before that , its not even showing the character sometimes

placid sparrow
#

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

rich ridge
#

@waxen socket doesn't matter, just update value

tacit pecan
#

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

heady python
#

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.

somber glade
#

@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

foggy idol
#

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

#

It will show you how to replicate the camera rotation

#

I use it in my game and it works well especially for spectators

solemn crypt
#

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?

meager spade
#

well

#

you cant call server RPC's

#

from an AI

#

the multicast will work sure

#

but that server rpc, nope

solemn crypt
#

hmm so what is the solution here, im trying to learn ๐Ÿ™‚

meager spade
#

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

solemn crypt
#

okay thanks i will try it out

meager spade
#

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

solemn crypt
meager spade
#

yes

#

as long as it runs on server

#

which AI should

#

then its good

solemn crypt
#

hmm cause now when the client kills it it can see the ragdoll but the server cant

meager spade
#

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

heady python
#

@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. . .

foggy idol
#

Oh ok

solemn crypt
#

maybe I jsut stick to make it singleplayer cause this networking stuff is kinda hard o understand ๐Ÿ™‚

foggy idol
#

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

twin juniper
#

I want to make a multiplayer fps game. Cant be that hard right?

foggy idol
#

Tbh depends on what you plan to make , how many players , game modes ....

twin juniper
#

Save the hostages

#

20 players

#

5 terrorists 15 fbi

#

8 bots as hostages

#

And a game chat

solemn crypt
#

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

gleaming vector
#

go for it

#

i would suggest looking at some multiplayer shooter tutorials

twin juniper
#

Okay.

crude coral
#

Hello! under the actor replication there is net dormancy options can help performance net frequency ?

winged badger
#

dormancy is tricky to use

#

and it is mostly there to save CPU time, not bandwidth

winged badger
#

basically, dormancy is something one should not be concerned with until you have a game that mostly works already

crude coral
winged badger
#

for the amount of stuff on screen, it way too heavy

crude coral
#

i need lower them?

winged badger
#

can't say if your CPU or GPU locked

crude coral
#

you know better way for take exactly stat info?

grizzled stirrup
#

What is your hardware

#

For a medium end laptop 90FPS isn't bad

crude coral
#

when i use app for the screenshot the fps drop without the app screenshot is 118 fps

winged badger
#

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

crude coral
#

is there any way for test that and be sure about performance? the game for android

winged badger
#

to handle performance you need experience, and you get that after you screw up real bad then fix it couple of dozen times

crude coral
#

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?

terse prawn
#

just double checking, if the server changes a replicated variable without a multicast the variable would change on all the clients?

meager spade
#

YES

#

yes

twin juniper
#

Is it possible to give people ranks? Like moderator for multiplayer games. If someone hacks or is spamming in chat.

still cape
#

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

still cape
#

oh never mind, the playercontroller already has ownership, just realized I was calling it on a second client by accident

somber glade
#

@twin juniper You can do whatever you want, you just have to code for it.

pastel hollow
#

That sounds strange, can you post your code/graph for the attachment?
Is the sword and its root component replicated?

still cape
#

github gists

tacit jetty
#

nice, thanks

still cape
#

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

void pasture
#

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!

winged badger
#

@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

still cape
#

oh hmm you can just send references directly over the network and it gets translated into a guid?

void pasture
#

@winged badger thx, but we don't even use notifications, we just rely on the socket positions being updated

winged badger
#

what causes your socket position to update?

crude coral
#

the dedicated game server when running need CPU just? or little GPU too?

winged badger
#

@still cape any network reference is a NetGUID

#

although first time around, it might send a full path for some things, like asset references

still cape
#

hmm interesting

meager spade
#

@void pasture you need to change your visibility based rules

#

to always update bone and transforms

crude coral
#

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?...

still cape
#

3.75 GHz cpu or 3.75GB ram?

#

either way it will be dependent on your game

crude coral
#

3.75 cpu ..no way to testing that locally?

twin juniper
#

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?

meager spade
#

you could mark them dormant

#

and just update locally

twin juniper
#

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

winged badger
#

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

still cape
#

Is there an easy way to run a debugger on a dedicated server?

meager spade
#

@twin juniper you would need to do optimizing ie when its dormant

#

disable CMC tick, etc

gusty slate
#

Is there more to do for a client to properly leave a session more than DestroySession + switching levels?

still cape
#

huh TMaps arent replicated

meager spade
#

nope

waxen socket
#

Would it be more efficient to set a struct separately on each client or to set it on the server with replication?

winged badger
#

if the clients can figure out what the struct data is without replication, then option#1 without question

waxen socket
#

Is that only because it's a struct?

winged badger
#

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

gusty slate
#

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

waxen socket
#

Then I wouldn't have to replicate ProjectileInfo or CurrentProjectile.

gusty slate
#

Replicating the name is better

winged badger
#

yes, that is preferable

#

no point in replicating static data, ever

waxen socket
#

So this would be a use case for a multicast?

winged badger
#

it is stateful

#

so no

#

replication, with repnotify

waxen socket
#

Player gets powerup that changes projectile. Powerup calls multicast event that sets the projectile on each client?

winged badger
#

and if one of your clients walks in from outside relevancy range or joins late

#

then it has incorrect info

waxen socket
#

But if I use RepNotify, then isn't that just replicating?

winged badger
#

it is, you repnotify the name and you call set projectile inside OnRep

waxen socket
#

The name, gotcha.

winged badger
#

mutlicasts are for fire & forget

#

something thats gameplay relevant now, and is irrelevant later

waxen socket
#

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.

winged badger
#

yes

waxen socket
#

Okay, but I do have to run that initial setting of ProjectileName on the server somehow.

#

Otherwise it won't actually replicate, yes?

winged badger
#

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

waxen socket
#

I'm intending on the former.

#

So why wouldn't I have to RunOnServer when setting Name?

winged badger
#

because overlap happens on server

#

you don't need it

waxen socket
#

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?

winged badger
#

the game im working on is listens erver

#

but its co-op so that helps

waxen socket
#

Yeah, mine's four-player co-op.

winged badger
#

then yes, its a valid option

waxen socket
#

And there's no persistent world that needs to run when no one is around.

winged badger
#

even if there was, its possible to save it

waxen socket
#

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.

gusty slate
#

Is there more to do for a client to properly leave a session other than DestroySession + switching level?

twin juniper
#

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

#
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

wicked brook
#

@twin juniper just glancing id say probably cause the port you have setup

#

its not always 7777

#

do like 7777-7796

twin juniper
#

Im uploading to the actual server right now and will check

wicked brook
#

that fixed my issue before

twin juniper
#

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

limber gyro
#

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?

twin juniper
#

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

wicked brook
#

@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

limber gyro
#

@wicked brook that sounds terrible to be honest

wicked brook
#

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

twin juniper
#

I added server ip to favourites in server browser

still cape
#

I'm pretty sure the server can just change maps to whatever it has available

twin juniper
#

and when I to refresh the server

#

this error comes up

still cape
limber gyro
#

the thing is, i dont need to travel

#

i need the server to start with a diferent map

wicked brook
#

Actually i think i was thinking of server default map

limber gyro
#

because i have match making going

wicked brook
#

so i think if you build all the ones you want into the server build maybe it would work

still cape
#

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.

wicked brook
#

in that case i think you would need separate builds with default server map set for each one?

twin juniper
#

after changing firewall settings for ports

#

should I restart ?

still cape
#

depends on the router mostly

#

or well

twin juniper
#

because I did what you told me @wicked brook and made 7777-8000 for inbound-outbound

still cape
#

firewall or forwarding

wicked brook
#

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

twin juniper
#

firewall

still cape
#

I would just restart then

#

no way to really know whether it would be cached or whatever

twin juniper
#

restarting now

#

it was also closed for 27015 as well

wicked brook
#

@twin juniper why have it open on tcp and udp. Should only be UDP right?

twin juniper
#

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

wicked brook
#

i mostly use gamelift so it could be a bit different setup perhaps

violet frost
#

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/

thin stratus
#

Try launching the game through your Steam Client

#

Add it as a Non-Steam game

#

That's at least what the docs suggest