#multiplayer

1 messages Β· Page 733 of 1

shell forum
#

I could just manually set the world time for each of those on begin play using a C++ BPFL

#

at least I'm trying it right now

fathom aspen
#

Yeah this might work

shell forum
uneven mulch
#

Hi there !
In C++, I've created a UPROPERTY(ReplicatedUsing=OnRep_MyVariable), along with a UFUNCTION() virtual void OnRep_MyVariable();
The OnRep_MyVariable is called in C++.
However, if I create a Blueprint based on my C++ Class, I cannot override the OnRep_MyVariable function.

Is there a way to do it ?
It's not in the Override functions dropdown list, and if I try to create a new function with that name, it says I cannot because a function with that name already exist.

#

I suppose I could fire an Event in the OnRep function, and that Event could be overriden.
Just trying to make things as they should be

fathom aspen
#

I don't think you can override an OnRep in BP

uneven mulch
fathom aspen
#

Just make that event BlueprintImplementableEvent

shell forum
#

Is the "ToggleSpeak 1" command the same thing as StartNetworkedVoice?

fathom aspen
#

ToggleSpeak1? There is no function like that

#

You probably mean ToggleSpeaking which is yes the same as StartNetworkedVoice, as it calls it

shell forum
#

Thanks.

tiny zephyr
#

Hey guys

#

pls does anyone know how i can possess a spawned pawn on client

#

Any time i press a button to spawn a pawn there is a possess code attached to it

#

but when it happens it does not possess

#

it just spawns

#

Doing this in character blueprint

fathom aspen
#

Ok from the sounds of it you are clearly not doing it right

#

Send code so we are on the same page

tiny zephyr
#

aiit

fathom aspen
#

Whole code, not parts

tiny zephyr
fathom aspen
#

Ok input is fired where the local controller exists, which in your case it's on the client

#

Possess is called only on server

#

You see the sign up right on the Possess function node

#

That means it's called for authority, aka server

tiny zephyr
#

Yea I do know that

fathom aspen
#

Also you said you are spawning the actor on client. In that case the server has no idea about that actor, so you can't replicate it to clients

tiny zephyr
#

I tried using the run on server and multicast

#

Did not still work

fathom aspen
# tiny zephyr

Also don't use GetPlayerXXX nodes, they can result in getting a reference to something else literally unexpected

tiny zephyr
#

Calling multicast on run on server event

fathom aspen
tiny zephyr
scarlet turtle
#

Would somebody be able to help me with something, I have my movement setup this way cuz the player is a ball, but if my pc is hosting, im alot faster than the client, and if they are hosting, they are faster than before but im still faster still. I just want them both to go the same speed lol

fathom aspen
#

Find the compendium in this server pinned channel and read it a few times

#

Spawn the pawn on server and make sure it's replicated

#

And whenever it's spawned on server possess it

tiny zephyr
#

Did not work

fathom aspen
#

By looking at your code you didn't seem like you did it honestly

#

Give it a try after you read the compendium

tiny zephyr
#

I tried a lot of things

fathom aspen
#

You shouldn't be

tiny zephyr
#

And what I showed you was one of them

fathom aspen
#

Trying totally wrong things doesn't justify what you're facing right now

shell forum
#

I use it everywhere. Only in widgets and run on owning client calls though

fathom aspen
#

Yes

#

Those are the safe places

#

If called on server, it returns the first player's thing

#

But there are always other ways to get that thing you want

#

For example in UMG you do GetOwningPlayer

tiny zephyr
#

Now it only works on server

fathom aspen
#

I have no idea what you changed

tiny zephyr
#

All I did was have an event with run on server and passed it to the Input action

#

The issue is with the posses and not the spawning of the pawn

fathom aspen
#

That's wrong

#

Use GetController

tiny zephyr
#

Now the client can’t spawn the pawn

#

Cos the event is on server

fathom aspen
#

Clients never spawn replicated actors

#

You only spawn them on server

tiny zephyr
#

Ok pls how then would I be able to spawn on client

fathom aspen
#

Again you don't. You spawn it on server and make the spawned actor replicated

tiny zephyr
#

It is

#

The pawn variable spawned is replicated

fathom aspen
#

That doesn't make it replicated though

#

Go to the pawn class defaults and make sure Replicates is set to true

tiny zephyr
#

It is already

fathom aspen
#

Then it should be replicating

#

Nothing special about that

tiny zephyr
fathom aspen
#

Paste code here so I see what's going on

#

And not guess

toxic lion
#

I'm trying to get some delegates to fire, and have the actor update
I'm firing the delegates on the server, and rightfully so, they're not firing on the clients.
I'd rather not multicast since I want the objects updates to remain persistent.
How can I get the delegates to fire on the clients as well?

fathom aspen
#

Delegates fire locally

#

You want RPCs

#

Or replicate properties

toxic lion
#

ah okay, that explains the delegates not firing.

#

so trying to instead figure out how to do it via RPC rooThink1

#

I can't really do replicated properties cleanly, since I'm updating a value in a struct, and want to fire some event that I can implement in a BP.

#

the struct contains one of 3 values that I'd like to fire an event off for each one individually if updated

fathom aspen
#

Whenever an update comes, only the changed property in the struct will be sent

#

So you filter what's being sent and do stuff accordingly

#

You will have an OnRep so it fires on clients

toxic lion
#

well, okay it gets a bit tricky
there's a 'manager' (subsystem with a replicated actor) that's holding an array of structs.
the structs have the values I'd like to change, as well as a list of affected actors

fathom aspen
#

And inside that OnRep you bind to a delegate so the other class does what needs to be done

toxic lion
#

when one of the values changes, I'm trying to loop through affected actors in the manager, and send a notification to them

#

basically, the affected actors don't hold the actual replicated struct

#

so i guess the bottom line is
how can I get Actor A to tell Actor B to fire an event that replicates on both server and client, and is implementable via BP

fathom aspen
fathom aspen
#

But by the sounds of it, you don't seem like you want to multicast

#

Multicast isn't stateful

toxic lion
#

yeah, unfortunately multicast won't work.
Okay, it's not a huge deal to add the extra properties on the actor since it'll only ever be 3 extra properties. unfortunate that I need to mud up the class a bit, but πŸ€·β€β™‚οΈ beggers can't be choosers

#

Thank you @fathom aspen

toxic lion
# potent coral try components

Yes you're right.
I'm doing this on a component to not mudd up any specific actor class
should have stated that more clearly.

wet bridge
#

Hey, is there any reason to think world partition will update to work on listen servers without requiring the server to load the entire map at once?

potent coral
#

i dont think listen server is the correct way to go for open world maps

wet bridge
#

Whys that?

#

The idea isn't to have many people on it. 2-4 players at once

#

Well 1-4, but when multiplayer, 2-4

potent coral
#

how is a client supposed to handle all the server AND client stuff for a huge map without using some nasa computer?

wet bridge
#

with world partition, I wouldn't imagine it being too computationally intensive

potent coral
#

it depends on ur game i guess, but something like ark survival etc obviously cant use listen servers

wet bridge
#

Maybe you can correct me on this, but a dedicated server solution would require me paying for the servers correct? Which would be quite expensive, and extra risk I wouldn't feel comfortable with.

potent coral
#

tbh i dont see the point in making listen server except in some very niche situations

#

dedicated server will always perform better

potent coral
#

and it even allows u to assign ur cpu cores manually to ur server / client whatever u prefer

wet bridge
#

I understand you can, but that adds complexity to the user to setup the server doesn't it. Port forwarding etc.

#

which is something that has a negative impact on user experience

potent coral
#

and bad multiplayer performance will not?

#

personally i would just go for better performance instead of catering to people who dont know how to set up a server etc

#

i mean u can always put a guide out

wet bridge
#

Yeah, but adding difficulty to users is a key way to reduce sales

#

a guide makes it easier, but not easy

potent coral
#

and in most cases its desirable to have a dedicated server instead of having to rely on some other persons online times

wet bridge
#

In this case it's a coop game. Hence the 2-4 players

potent coral
#

you can also just run the dedicated server without the player even noticing i guess

#

if you use steam subsystem or something

#

i think u dont even have to portforward

#

the whole point is to have a separate process for the server

wet bridge
#

So I will admit to not having too much experience in multiplayer programming for unreal, so can you explain the issue with the listen server solution (other than the fact that world partition doesn't work with it yet)

potent coral
#

like i said it depends on the scale of ur game, but in general you dont want a listen server because the host will run server and client shit in the same process with no control over it

#

so basically if the host client lags, the server WILL lag with no exception

#

as opposed to being able to better manage your resources if you have a separate server and client process

#

you could give the server process a higher priority

#

and reduce lag for others when your client lags

#

listen server surely has it perks but it will always perform worse than a dedicated server

wet bridge
#

Just double checking, when you say: when the client lags the server will lag too, in that context when you say client you mean the listen server local user and not external clients right?

#

Because an external user lagging shouldn't matter right?

wet bridge
#

wouldn't a dedicated server be more computationally expensive overall? As both the server and client have to manage the map data at the same time, rather than the listen server where they are only handled once??

potent coral
#

nope because of net culling

wet bridge
#

net culling?

potent coral
#

so if you have adequate hardware it should be no issue

potent coral
wet bridge
#

yeah, but there would still be a server and client copy wouldn't there?

#

because they are separate instances

potent coral
#

thats true but the server and client process stuff in different ways

#

it wont have much of an impact

wet bridge
#

are dedicated servers that light weight?

potent coral
#

in general yes

#

they can usually handle like 50-100 players with just standard hardware

wet bridge
#

But with a large map, they still require to load in the entire map at once right?

potent coral
#

net culling

wet bridge
#

So there would be a decent memory footprint

#

yeah I know net culling is a thing, but it still requires the full mesh to be loaded due to systems like world partition and world composition not working on servers

#

so the actors won't have loaded in, but the map would have to

potent coral
#

yeah obviously the map data needs to be loaded

wet bridge
#

Yeah, but if the partitioning systems worked on servers that requirement could be reduced to just the map chunks

#

reducing memory usagge

potent coral
#

doesnt it work on dedicated servers?

wet bridge
#

not yet apparently

potent coral
#

also memory shouldnt be an issue these days

wet bridge
#

atleast world partition

#

not sure on composition

potent coral
#

i have 32 gb in my pc and 32 gb extra lying around because i dont need that much fkin ram lol

#

not even when developing in unreal engine i dont need that much ram

#

and ram is way cheaper than other components

wet bridge
#

Ideally you'd want to limit ram requirements to 8gb on the lower end though

potent coral
#

idk i would just go with the flow of time and dont spend too much time with supporting outdated minimalist systems πŸ€·β€β™‚οΈ

#

at least when it comes to ram

wet bridge
#

How different is developing a dedicated server solution vs a listen server solution. Overall they wouldn't be that different to program to my understanding but I could be wrong

potent coral
#

well

#

think of multicast

#

if you want a sound to play on all clients in a listen server u would just multicast

#

but on a dedicated server u dont want the multicast to run on server

wet bridge
#

so you'd just call not authority multicast?

potent coral
#

yes

wet bridge
#

so slightly different but not strictly harder?

potent coral
#

yeah its almost the same

pallid mesa
#

World partition might work in listen servers in a use case where you only keep relevant cells loaded... those with streaming sources and cull fx from those cells not relevant for the local player hosting

#

cell streaming and whatnot

wet bridge
#

just double checking, If I wanted a single player mode that didn't require the server how would I program that as well?

pallid mesa
#

also running a dc server on the host computer is also taxing and icurs its own issues ideally you'd want it in another machine

#

multiplayer code works singleplayer

wet bridge
#

I know it does in listen servers, but if I called something to run non-authorative, would that also just work fine or just never be called?

#

just double checking so I don't run into this problem later

#

i.e. multicast rpc with a if(!authority) in it

#

would that if statement ever be called in single player?

potent coral
#

if the multicast is run on server then yes

#

i mean it gets sent to the clients

#

but its not run on server

wet bridge
#

yeah but I meant if I didn't want to have to use a server in single player mode

#

just to remove that extra computational cost if I didn't need it

potent coral
#

thats a good question actually

#

but i think it should be run

#

its shroedingers authority lol

wet bridge
#

the solution around this is I could just check if it is a single player game and run it locally in that case but no other

pallid mesa
#

you dont use a server in your singleplayer game

wet bridge
#

if it wouldn't allow it

pallid mesa
#

ypu just run the instance instandalone

#

and it will worl

#

work*

potent coral
#

if you run it in standalone with HasAuthority

pallid mesa
#

You do have authority

#

is like a standalone listen server setup

potent coral
#

i.e. multicast rpc with a if(!authority) in it

so if he runs this it will not run in standalone?

#

it would make sense in standalone to just ignore authority

pallid mesa
#

multicasts also get called on the owning client so multicasts will be run although they'll run only in the standalone instance

#

without a need of a server

wet bridge
#

yeah I understand it'd run on the local system, but the local system would have authority, so saying "don't run if you have authority" could cause an issue

#

but might also just be ignored

potent coral
#

i bet it runs authority and no authority the same in standalone

#

but i guess u can easiely test that

wet bridge
#

if it doesn't, I can add a if(!authority || NM_Standalone) and solve the problem

pallid mesa
#

yeah test it and you'll see what im speaking about

wet bridge
limber gyro
#

Does any 1 know if its possible to use 2 net drivers, or switch them when needed? for example if i want to use steam sessions for player hosted games with steamnetdriver, but then switch for the regular ipnetdriver when i wanna run my own server on my own machine?

limber gyro
#

theres this variable "bUseSteamNetworking" can i set it to false as a start argument?

potent coral
#

you can try

#

but dont drive

rocky stag
#

What does strip animation data do on dedicated server ?

#

Is it means animations will not play on dedicated server ?

limber gyro
#

I font think animation data is passed at all

#

Animations replicante through the ANIM BP state or u gotta call a multicast to play montages

rocky stag
#

Does that affect on anim instance tick ? is it disabled on dedicated server ?

sonic dock
#

Hello guys, my character is jittering at high speeds, this clip is from flying movement mode. Also it jitters when falling after certain time.
First I thought that this multiplayer related issue but it is even happening on listen server and standalone too.

Can anyone help with what might be causing this issue? I am literally stuck.

potent coral
#

ure just too far away from center of map

rocky stag
sonic dock
#

Distance effects?

rocky stag
#

Check the situation when you blend on another pose in your anim instance

potent coral
#

does it work when you are closer to the ground?

sonic dock
sonic dock
potent coral
#

how close?

sonic dock
rocky stag
sonic dock
sonic dock
potent coral
sonic dock
#

But When I am falling, it is just one single pose and no transition, so I don'

#

I don't think it could be blend issue either.

sonic dock
#

Then doesn't

#

I think its related to speed

potent coral
#

ok then its fpp issue

rocky stag
#

How much velocity do you have ? is that in the bounds of max velocity of ue?

sonic dock
potent coral
#

fpp = floating point precision

sonic dock
potent coral
#

basically ur distance is bigger than a float allows

wet bridge
potent coral
sonic dock
#

I don't think that should be issue

potent coral
sonic dock
sonic dock
wet bridge
#

wouldn't that just be fp not fpp

sonic dock
#

You can call anyway

sonic dock
#

Maybe issue with character movement component?

potent coral
#

it shouldnt

#

maybe some stuff is conflicting

#

wait

#

in ur video i see that ur character is trying to rotate

#

and go into like a dive down position

#

but it looks like he rather wants to stay in that gliding position

sonic dock
potent coral
#

it looks like the 2 animations are fighting eachother or something

#

and it cant decide which one to pick

sonic dock
#

Maybe its the camera that shaking?

#

Let me confirm that

potent coral
#

do you have this issue in standalone too or just multiplayer?

sonic dock
#

That's why I am a bit sure it is camera issue

potent coral
#

i dont think its camera issue

sonic dock
potent coral
#

because the map doesnt spaz around

#

its just the character

rocky stag
sonic dock
#

right

pure onyx
# potent coral

I was thinking of learning this flying off and land of the filed like this based on cod type of games. May I know if you could share resources to me to so I can practice these to learn:) any course or else also fine if you like to suggest to get some experience with such thing:)

sonic dock
#

I had some complex logic in the player camera manager and that was causing the issue. Fixed a little and now it works so smooth in networked also!!! Thanks a lot πŸ˜„

potent coral
#

ask Danii instead

worn wagon
#

Does anyone know a good alternative function to BeginPlay for setting up the HUD? The issue I'm having, is that the listen server host doesn't think it is locally controlling its character in BeginPlay after a respawn, I guess there are a couple of game ticks where it doesn't for whatever reason. There's the OnPossessed override but that is only called on the server, and I need it on the client.

#

I feel like i'm gonna have to use an event outside of the pawn, maybe in gamemode. But I wanted to check if there was a better solution.

#

There should be some clientside event for when the pawn is possessed, right?

potent coral
worn wagon
sonic dock
potent coral
#

^

worn wagon
#

I'm sure there's a way to do that from the playercontroller too

potent coral
#

or just remove old hud on begin play and then make new one?

worn wagon
#

Well yeah that's what i've been doing

#

Like I said it doesn't work for the listen server host after a respawn

#

What I'm looking for is a pawn class specific way of adding a hud when it is possessed, and removed when it is destroyed

sonic dock
#

There must be some other function too but for now you can do that OnRep_Owner in pawn

worn wagon
potent coral
#

why would u even need it when ure basically sending it from the listen server?

#

you already know its replicating

#

so u dont need OnRep

worn wagon
#

Yeah but then where would I call the hud creation for the listen server

potent coral
#

after u do the rep or something

sonic dock
#

Yes I think I remember it was called PawnClientRestart. You restart a pawn and locally it calls pawnClientRestart. You can check that.

worn wagon
#

I'll give it a try, thanks

worn wagon
potent coral
#

yes

sonic dock
worn wagon
#

Ah okay

sonic dock
#

Was jittering close to ground too

potent coral
#

in source 2 fpp hits really hard

#

im glad i got away from that shitty engine

worn wagon
#

Yeah it's a shame source 2 didn't progress much from the first engine

#

I was excited for it a while ago

potent coral
#

i had dev access to s&box but got banned for pointing out some gamebreaking issues lol

worn wagon
#

xD

#

Yeah I got access a while back but haven't touched it

potent coral
#

its not worth, unreal 5 is way better

#

and they probably revoked ur access already

#

the mapping tools in s&box are really nice but the tiny map size limit basically kills it all

#

valve confining devs to 800 mΒ² maps in 2022 xD

sonic dock
#

Ofc coz I am working on a mobile game

potent coral
#

well whole point of mobile dev is to scam kids for money so i kinda can relate xD

sonic dock
#

Lol

potent coral
#

like honestly show me 1 mobile game with actual gameplay value

sonic dock
#

I wished that it brings something out of the box and we have to least worry about android performance

potent coral
#

phone just cant compete with other gaming platforms, and other platforms cant compete with pc

sonic dock
#

people going crazy with 10 fingers xD

potent coral
#

the only mobile games that i actually had fun with were EVE until they made it paid, and pocket mortys lol

#

other games just provide minimal gaming experience and are basically designed just to get u to pay for every shit u want to do

#

like bruh...

#

at least provide some fun mechanics if you want my money

pliant moss
#

noob question:
when i play with 2 players with listen Server. the event begin play on the client playercontroller also runs on the server. So if i want to setup UI widgets and bindings etc. i have to create an event and set it to "only execute on owning client"? right?

potent coral
sonic dock
potent coral
#

sadly it didnt let u add ur own songs, and only had very few and mostly very shitty songsd

#

and obviously u had to pay for every new song u wanted xD

sonic dock
sonic dock
# sonic dock In my case it was camera issue

The issue was the lag speed and when the lag exceeds the camera instantly shifts to the target without smooth lerping. So at high speed lag was getting accumulated which was causing this issue.

pliant moss
#

Thanks

pliant moss
#

If i create a custom event in the gamestate and mark it as execute on server. And then call it from the client. nothing happens. but if i call it from the server it gets called. seams like the client should be able to call the event on the server? what am i missing?

#

i guess it has something to do with the gamestate not beeing "owned" by the client

limber gyro
#

i might be wrong but it might be cause the client needs to own the object which it calls the function from

#

try calling it through the player controller

pliant moss
#

like this?

pliant moss
#

It worked. thanks. but i still think its a bit weird πŸ™‚

limber gyro
#

thats just how ue works

pliant moss
#

yeah. just need to wrap my mind around it.

sinful tree
# pliant moss If i run this trough the client PC. will it use the client PlayerID or the Serve...

If this is being run on the player controller, the thing to keep in mind is that the instance of the player controller exists on both the client and the server. If this is a listen server, then the server has it's own player controller as well, so there would be 3 player controllers that exist, two on the server, and one on the client, but the one on the client is replicated from the server, so really, there are only 2 "real" player controllers, your client is just using a replicated copy from the server.

When you call a "Run On Server" event, what you're attempting to do is tell the server to execute something on the instance of the object that the "Run On Server" event exists on. So if your client is calling this event on a player controller object, then it's in regards to that client's player controller.

Eg:
Lets say both you and I join a game where there is another person hosting the game, so it's a listen server. There would be 3 player controllers in existence on the server, one for me, one for you, and one for the server. My player controller and your player controller are both replicated from the server, so they are copies.

When I press something in my UI (something that only exists on the copy of the game that is running, ie. the server or other players don't know about my UI) that executes the "SetPlayerReady" event, it would be getting called on my player controller on my client. So then when the server receives the command, it knows it's my player controller, and it reads my value for the PlayerID.

When you press something in your UI that executes the "SetPlayerReady" event, it would be getting called on your player controller on your client. Again, when the server receives the command, it knows it's your player controller and will read the value of your PlayerID when passing it on to the game state.

When the server presses that something in the UI, the same thing would happen, but in regards to their player controller.

#

The gist is, you have multiple copies of a single object type doing things. If it's a replicated object, the server knows which instance of the object is doing the RPC, so when it's asked to execute something, it'll be using the instance of the object that requested the call in the first place.

pliant moss
pliant moss
#

But then shouldnt a replicated client have a gamestate on the server. just as it has a playercontroller on the server?

#

so when i create an event on the GameState and mark it as run on server, it should run that on the server instance of my gameState?

sonic dock
pliant moss
#

Or hmm.. how do i make the client own something? is it owned by default if it is created by the client?

#

lets say i spawn an actor

sinful tree
# pliant moss lets say i spawn an actor

When you're spawning the actor you have the option of setting the owner on the spawn node. Later on, you can also change the owner of an actor by using the "Set Owner" node, but this also needs to be done while running on the server.

#

GameState is a replicated actor, but only one instance ever exists between the server and all clients, so the server has to be the owner.
Playerstates are player owned actors that everyone knows about, but only the owner can call RPCs on.
Same with any of the player's controlled pawns - they are normally owned by the player who is possessing them.

Generally speaking, you really should only set the owner of an actor to a player if that player is going to be in control of that actor and while the player is in control of that actor they may need to make some RPCs. You shouldn't need to, and sort of doesn't make sense to, constantly swap around ownership just to make it easier to RPC to a specific class - you can always just RPC through the player controller and then when running on the server go to the appropriate actor to perform whatever functions may be necessary. (Eg. "Run On Server" RPC on PlayerController > Get Game State > Run Required Gamestate Function)

pliant moss
#

Okay yeah, it all starts to make sens now. Thanks everyone for explaining

pliant moss
#

In short. when do you use RepNotfies for varibles?

dark edge
#

That is, whenever I can solve the problem by using RepNotify, I do.

pliant moss
#

okay so its more optimised then replicated? i should probably read up a bit on repNofies before i ask so i have more context πŸ™‚

dark edge
#

Repnotify means you get a function that runs every time it's updated.

#

That's useful. Very useful

pliant moss
#

okay. so i can do additional logic when something gets updated?

dark edge
#

Yup

#

That's the whole point

pliant moss
#

like a health varible. i could make a call to update the UI aswell. that kind of things?

dark edge
#

Opening a door can just be the server setting a bool. Then in the onrep you actually move the door.

pliant moss
#

alright cool. thanks

shell forum
#

SessionSettings.bAllowJoinInProgress = false

What determines whether the game is in progress?

dark edge
#

I think the base versions don't have that. That's a part of the whole match based system.

shell forum
# dark edge GameMode/GameState

What would I set in the gamemode? Or would I just set the sessionsettings to bAllowJoinInProgress=false once the game starts?

dark edge
#

Idk anything about it, I don't use the match state stuff. Are you trying to disallow connections when the game is started?

dark edge
#

Start the match I'd assume. You using GameMode or GameModeBase?

shell forum
#

GameMode

#

So afaik StartMatch() only changes the game state enum, no actual logic is done?

#

Let me double check

graceful flame
#

My understanding is that the stuff that comes with GameMode is just there as a placeholder. So in other words its up to you if you choose to make use of functions like Start or End match.

pure onyx
#

Thanks for the response, not so familiar yet but will try. If you can share some resources that would be also great to look into as well.

shell forum
# graceful flame

RestartGame() does actually restart the gamemode though, so not just for your own logic.

karmic shuttle
#

could someone explain to me why i cant run authority only functions from the gamemode with a proper reference in the player controller with a run on server event? what alternatives should i use

shell forum
#

Multicast, etc will not work

karmic shuttle
#

ah i see

#

is there any alternative?

shell forum
#

Any other object would work

#

Depending on your use case, PlayerController, GameState, Character, etc

fathom aspen
#

You can't call server RPCs in GameState

karmic shuttle
#

maybe gamestate right? im making an admin panel but players get culled out so i cant reference them at a certain distance

fathom aspen
#

Cause this can be read two ways

karmic shuttle
#

i go from widget -> playercontroller (owning client) -> playercontroller (run on server) -> gamemode (run on server)

fathom aspen
#

Okay this would work. You just don't need that Server RPC at the end in GameMode

#

As it's not replicated

karmic shuttle
#

i see

#

one problem is that this does work except for the fact that authority only functions dont run for whatever reason in the gamemode

fathom aspen
#

GameMode is authority only

#

So I have no idea what you're talking about

karmic shuttle
#

this is a screenshot from the gamemode, for whatever reason "kick player" doesnt work but teleport does

karmic shuttle
fathom aspen
#

It should be working fine. Breakpoint it and see what happens

fathom aspen
#

But I'm not sure how you are saving that reference, but that doesn't matter

#

Breakpoint, debug, etc..

karmic shuttle
#

appreciate it

harsh lintel
#

I have an On_Rep variable and it's triggering the OnRep Function on the server

#

only on the server

fathom aspen
#

You have to do it yourself to trigger on server

#

They auto trigger on client only

harsh lintel
#

I switch the variable on the server, but the OnRep function is being triggered on the server, I didn't do anything special

fathom aspen
#

Did you read what I wrote?

#

They won't. It's just how they work

#

You have to do it manually

#
OnRep_MyProperty();```
#

So it looks like this

harsh lintel
#

Maybe I didn't explain properly my issue, I don't need anything to happen on the server, I'm just saying that when I change the variable on the server, the OnRep function doesn't trigger on clients, printing logs says that the OnRep function logic is happening on the server, and I need it on the clients, and I was wondering if I did something wrong

fathom aspen
#

This sounds like the impossible has become possible

#

Provide me with context

#

It doesn't seem like it should be this way

harsh lintel
#

this is how I change the variable on the server

#

maybe because the actor is not replicated?

fathom aspen
#

Huh?

#

How would it replicate properties if the actor itself is not replicated?

harsh lintel
#

I forgot to make the actor replicated, but I don't know if that could cause the issue, I'll test

#

ah, yeah that did it 🀦

#

my bad, thanks

karmic shuttle
fathom aspen
#

Not working doesn't tell me much

#

Does that mean it's not getting executed?

#

So the breakpoint isn't getting hit

karmic shuttle
#

i have to test in game as this is a modkit unfortunately

karmic shuttle
#

what i do know is that every part of code works until the "kick player" part which is an authority only function

#

that should not be an issue though as im running this in the gamemode

fathom aspen
#

You just didn't know it

#

If it's a cpp function then add the breakpoint to that function and attach a debugger and use DebugGame Editor

karmic shuttle
#

would this work within a modkit where the player controller and game mode are both proxies though? sorry i’m away from my pc

fathom aspen
fathom aspen
#

Without debugging I would have quit programming since I started it

ripe basin
#

Are there any plugins that can fetch Steam Avatars that aren't direct friends with the Player? I'm guessing I should just do an HTTP GET to the Steam API and pull it for each player.

Advanced Sessions as far as I'm aware and tested only fetches a direct friend's Avatar.

red furnace
#

What's the workflow for sending an actor ref from client to server? I need the server to "do something" to an actor when the client clicks on it (RPC right), but since the actors are technically different versions I'm not sure how to tell the server which object to "do something to".

sonic dock
#

For blueprint just add an input parameter of Actor object reference in the rpc event

red furnace
shell forum
#

At least that’s how I’m using it and it seems to be working so far

elder sage
red furnace
clear copper
#

I have a replicated array on an actor in the world. When the server adds items to the array, the clients see it. But when a client adds items, only they can see it.

elder sage
red furnace
#

networking workflows are though to wrap my mind around. its getting there but phew its rough lol!!!

elder sage
#

client can't replicate to others and will be overwwritten

elder sage
clear copper
elder sage
red furnace
clear copper
elder sage
#

in fact, you might find that to be the issue after testing

#

multicasts are used for things that can't be replicated, like playing sound, spawning particles, while replicable data can just be run from the server, like spawn/destroy actors and setting replicated values

#

multicasts are primarily for cosmetic stuff like UI and sound, in my experience

clear copper
elder sage
#

just call the server's event and set the variable

clear copper
#

Like this?

elder sage
#

a replicated variable sort of multicasts it already

#

yep

#

I believe that would work if you test it

clear copper
#

unfortunately not 😦

elder sage
#

you can put a breakpoint on the Append node and try to see what the values are at that moment to get a clue as to what's not being sent over

#

another thing would be to look for other times you're using that array, because you might be trying to set the value from the client or something

#

the reason that the server has to be rpc'ed to replicated values is that it's authoritative, and a consequence of that is any changes the clients make for themselves will be ignored/overwritten

clear copper
#

This is the only time i'm trying to set that actor's array. The server is saying that the Hit Result Grid variable is not valid

#

when i try to update it from the client

elder sage
#

I'm going to assume no, so you could either replicate the actor or get the information before calling the rpc and pass it in through the event

clear copper
elder sage
#

oh

#

spawned by the server?

clear copper
#

it is in the level

#

so i would assume that means yes?

elder sage
#

correct

winged badger
#

loaded from level implies its net addressable

#

not that it is replicated

#

there is a difference

clear copper
#

It's late. a fresh set of eyes tomorrow will probably help. Thanks!

wet bridge
#

Hey, if I have a finite grid represented by an array and I want make sure that the values in the array are consistent between server and client, what is the best way do this?

#

The array is an array of actor pointers representing what is in that grid

#

it will likely be atleast 10k long

bitter oriole
#

10k entries of actors?

#

That's probably not gonna work at that scale imho

marble gazelle
bitter oriole
#

If you have that many actors, you have to replicate the seed / save data used to generate that and have the actors be local only

wet bridge
#

It's not that many actors, just that many pointers

#

it's so you know what actor is in what grid point

bitter oriole
#

Then have each actor replicate its coordinates instead

marble gazelle
#

yeah better add a GridPosition component, that updates it's entry in your grid

wet bridge
#

I was considering that option, my only concern is that if you're not in a relevant range then they wouldn't spawn until you got within range. And then once they spawn they would have to call a function to find out what grid points the object occupies. This would likely cause a lag spike.

wet bridge
bitter oriole
wet bridge
#

which thing is controllable specifically?

bitter oriole
#

Relevancy

wet bridge
#

you thinking make it always relevant?

bitter oriole
#

Dunno, depends what you want?

marble gazelle
#

I mean, you can also impl it like this: ON connection you send a List of all filled entries with the actor ID (as it might not be spawned) And then you just replicate it with RPCs, or you write some custom replication / use the fast array serializer

bitter oriole
#

If you're concerned that an actor spawning would have to find its position - if you replicate the coordinates on the actor like I suggested I'm not sure there's an issue here

#

Finding the grid location from coordinates should be extremely cheap

wet bridge
#

yeah it is pretty cheap, though I do call a scan line to find the ground level and also make sure the area below it is the correct type

#

but yeah I imagine unless I am doing this with literally thousands of items it shouldn't impact it too much for too long

#

but at the same time, if the objects are spawned I don't need to do the scan line as I can just assume they are in the right spot

#

sorry, took my brain a minute to catch up

vagrant lichen
#

Hi everyone
Unreal Engine has a feature called "Pixel Streaming"
it's a roughly-speaking gameplay stream, you can connect to it from multiple devices via browser (<video /> tag)
And transfer by webRTC - events from the keyboard-mouse, and it turns out even to play on the running instances of the stream.
A working example - MetaHuman software, you generate a model of the character in the browser, without downloading UE5 on your computer and without deploying its instance, the application instances for you to deploy to the cloud on a car with a graphics card, and stream it to your browser

Key question:
Does it make sense to deploy a single instance of UE in the cloud, in which a large scene is loaded (photogrammetry model of 80gb, but with asynchronous tiling), and for each user/player - spawn a camera on the scene, give it under his control, and render on this instance, what sees each such camera - and then streaming to the user/player what he sees his camera?
Or is it a dead-born idea?

will it consume a lot of resources to give each user a camera, and a separate rendering of this camera?
and will it save a lot of graphics card resources if several users are viewing the same scene from different cameras

grizzled stirrup
#

Quick question: if a PlayerState has a ServerRPC that is part of a function called by all clients locally, will it only succeed when called on the client that owns the player state?

#

Or if I want it to only succeed for that player, should I add a local player check before calling the RPC?

latent heart
#

You can only call server rpcs on player states that you own as the client, so, yes, it will only call for 1 client

#

However if you're using a listen server, it will call for every client

#

So, you should check for a locally controlled client.

grizzled stirrup
#

Ok thanks will do!

#

Just out of curiosity, how come it calls for every client on a listen server?

#

Surely only the listen server itself and the client that owns it will succeed in calling it?

latent heart
#

Because if you call a Server RPC on the server it will execute like a local function

#

So a listen server can call any rpc.

grizzled stirrup
#

Right but it wouldn't call for every client, just server + owning client?

#

Ah I guess you mean on the server for every client

#

So it effectively is on every client being called twice

latent heart
#

If you do something like foreach (PlayerState in PlayerArray) PlayerState->CallServerRPC() it will call it for all of them if done on the server or listen server

#

But only 1 if don't from a client

grizzled stirrup
#

Ok perfect so I'll do something like

if (ACharacter* OwnedC = Cast<ACharacter>(PlayerState->Pawn))
{
  if (OwnedC->IsLocallyControlled)
  {
    ServerRPC();
  }
}
#

And that should mean that even on a listen server, only the local client will ever call the RPC

latent heart
#

Ya

grizzled stirrup
#

Great thanks for the help

faint parcel
#

Continuing with teams from yesterday I have this struct for a team (used as a variable in my GameState):

USTRUCT(BlueprintType)
struct FSSPTeam
{
    GENERATED_BODY()

    UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "SSP|Teams")
    FText Name;

    UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "SSP|Teams")
    FColor Color;

    UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "SSP|Teams")
    FGenericTeamId TeamID;
};
  1. Should I keep an array of players inside the same struct or in another type in GameState? (TArray, Struct, Class, UObject?)
  2. When referring to players in the GameState, should I use Controllers, PlayerState or something else?
latent heart
#

TArray<APlayerState>

#

Or TSet<APlayerState> might be more appropriate depending on your usage.

faint parcel
#

Oh yeah the controllers don't exist on the other clients

marble gazelle
latent heart
#

I can't imagine it is!

#

But I may be wrong.

faint parcel
#

Ah there is already a TArray<TObjectPtr<APlayerState>> PlayerArray; in the base class, nvm πŸ™‚

latent heart
#

But you can add an arra yof players to each team too

faint parcel
#

Should I use the FSSPTeam struct or a separate type? And is a struct good when adding and removing from the array inside it?

#

I think I remember something about changing struct instance variables bringing problems, but I suppose I can just assign a new one when the array inside changes?

#

I might be mis-interpreting something though

tight isle
#

Can anyone tell me why im keep getting this (pic 1),
I have a camera with player controller, and have pawn with ai controller

when i click on pawn, im invoking RPC to server to set the owner of that pawn to player controller (pic 2)

Update owner function invokes inside pawn(that is ACharacter class) (pic 3)

After that im trying to invoke server RPC inside pawn but getting this warnings, also i checked that on client and server owner of that pawn is set to my controller (pic 4)

sonic dock
#

Hi, have a replicated ship which is a pawn and keeps moving at a constant rate. The movement is a bit jittery on client, any one knows why this happens? Is this the limitation of the pawn class?

bitter oriole
latent heart
faint parcel
sonic dock
#

But adding movement input on both should technically fix it right? But it don't.

bitter oriole
#

Replication will happen twice per frame, or once every second

#

It's unpredictable, fundamentally

#

Just a fact of life in multiplayer

#

If it's client-driven, server-auth movement then you need interpolation + rollback/replay

#

Which is a lot harder

#

But again, fact of life

twin juniper
#

https://youtu.be/oO3lc2UyJgk hey guys im having an issue where unpossessing a pawn causes game breaking lag back and fourth, jittering, breaking animations, and some other problems as you can see in the video, its worse when you unpossess while moving because the player actor simultaneously follows the formerly possessed actor, despite it not having a controller which should make it stationary, and sits where it originally dismounted

sonic dock
twin juniper
#

im sure i just make basic mistake but idk what to do about it

grizzled stirrup
#

Does it ever make sense to set a replicated property on the client locally just until the server updates it with the same value for everyone?

#

As in to only allow the client to do something once (like set a clientside ability on cooldown), but still update the value for everyone else. I guess a simpler form of the question is: if a client changes a replicated array of structs locally, will the replicated version from the server simply overwrite it and make sure it matches what is on the server?

bitter oriole
grizzled stirrup
#

An even simpler way to phrase my question: is it fine to change replicated properties temporarily on the client to represent locally updated state that will match what the server will replicate down to all in the future? As in

// Some clientside ability activation where Array is replicated
if (Client->Array.Contains(Value) == false)
{
  // Update the array for all 
  Client->ServerAddToArray(Value);

  // Update it right now locally to prevent the client calling another ServerRPC before Array replicates down
  Client->Array.Add(Value);
}
silent valley
grizzled stirrup
#

Yeah! Perfect, thanks. Good to know it makes sense for stuff like this

#

And that it's fine to set replicated properties on client knowing that the server will refresh with the same thing later or an updated value

silent valley
#

yeah the only thing to be aware of is that if the client changes it but the server doesn't, then they will remain out of sync

sonic dock
winged badger
tight isle
#

why in first example i get
Client1: PlayerController_C0

but on second i get
server: PlayerController_C0
client1: (empty)?

Its a player state BP

winged badger
#

no PlayerController thats not your own on clients

#

you do get a bunch of accessed none in the message log instead

tight isle
#

no, nothing about errors in logs

#

that strange

grizzled stirrup
#

My main question is that if you have a replicated array and you add an element on the client, will the server nicely overwrite the array when it replicates?

#

It seems to do that based on my log tests

winged badger
#

if everyone simulates their stuff locally, simulated proxies should run their own cooldowns

#

and not require replicated data

grizzled stirrup
#

Yeah ideally but there's some stuff that is triggered serverside (like spawning replicated actors when a cooldown expires) and some that is clientside (like local projectile logic) so rather than calling loads of server RPCs from the clients I just have it replicated for now

winged badger
#

and also, use a fastarray, much easier to control

grizzled stirrup
winged badger
#

im not entirely sure what happens

#

fastarray breaks

#

tarray, don't know

#

it is exceptionally bad practice

#

so i never tried

grizzled stirrup
#

Ok thanks, it APPEARS to work similarly to if you set a single replicated property on a client

#

I'll see if I can rework this system to be better πŸ˜„

grizzled stirrup
#

So on every local machine it's correct but it's also updated on the server to allow for the server spawning stuff

winged badger
#

it doesnt matter what simulated proxies do

#

as long as it looks close enough

grizzled stirrup
#

Yeah true in the heat of battle players are simply not going to notice it being a bit off

winged badger
#

so having cooldowns updated on them is just a waste of resources

grizzled stirrup
#

Well not entirely in this case as it can drastically change how bullets look and behave in this case without having all clients sending big RPCs to all other clients telling them what the bullet they just fired looks like (a lot of stuff is determined by current cooldowns)

winged badger
#

they can just do best guess

grizzled stirrup
#

Sorry yeah misread, I think you mean to just update cooldowns on all machines locally, don't care about replicating and it'll all line up close enough to what each local player is seeing

#

Off by whatever latency but completely acceptable and won't change the result of the simulation drastically

#

They can be updated on both client and server without replicating to allow for the serverside spawn logic where needed so it all works out!

pliant moss
pliant moss
#

Will this node return the locally controlled PC if its run on the server? i mean. since the Server has all player controllers?

bitter oriole
#

No

#

You cannot guess what it will return

#

Don't use it in multiplayer

plucky prawn
#

i mean, it will return the 0th (first) player controller on the server

plucky prawn
pliant moss
#

alright okay. so i need to think about how to handle this.
I Have an actor that is AI controlled. But i want this actor to have a reference to a playerController becous it need to query some values from the PC from time to time. The Actor is spawned on the server. So i guess if i pass a reference of the playerController at the time of spawning. it will be the Server instance of the PC that gets passed. So basically null when a client is using that reference?

#

Do i set the PlayerController reference on the actor as replicated? or Should i try to avoid having the PlayerController referenced at all on the actor. maybe its bad practies?

ripe basin
#

@shell forum Where are you calling the Avatar fetch from?

fathom aspen
fathom aspen
pliant moss
#

another question. Do abilities with GAS need to be executed on the server??

#

looks like it is not the case in the Lyra project since they are checking "is locally controlled"

fathom aspen
#

You also have the option to SkipOwner

grizzled stirrup
#

Thanks! In this case I still want the owner to get updated cooldowns from the server but just set the variable locally to prevent the client triggering the ability multiple times before they get the "is cooling down" info from the server

#

But will likely just simulate it locally everywhere to prevent any edge cases where it may not work as anticipated

thin stratus
#

Can one replicate TSharedPtr<FMyStruct>?

#

Preferably as an RepNotify var

bitter oriole
#

I don't believe you can

thin stratus
#

I mean there is FGameplayEffectContext and its Handle

bitter oriole
#

GAS massively replicates shared ptrs but IIRC they have a custom serializer everytime

#

Look at that

thin stratus
#

Right

#

I just need a bit more advanced state machine than enums

#

But not as complex as object driven

#

sigh

clear copper
# elder sage correct

I found the issue but not the solution. The client cannot update a variable on an actor unless that client owns the actor. But the client doesn’t own any actor in the world and I don’t know how to have them ask the server to set them as the owner.

silent valley
clear copper
#

I’ve tried creating a run on server event

#

But the server says that the actor reference is invalid

#

So when the client passes the actor they want to be the owner of, the server can’t see it. Even though it’s replicated.

silent valley
#

Er well that should work assuming the actor is replicated, but it's not advisable to pass a reference like that in an rpc as it's a security risk.

clear copper
#

So how do I use the RPC to tell it which actor I want to be the owner of then?

#

If I’m not passing that actor

silent valley
#

The usual approach is that player walks up to something, presses Interact, and the server checks what is in front of the player is and does it that way. Can also pass the actor ref too as long as the server validates that it's possible to interact with that actor (line of sight / range /etc)

#

But what you have described should work

#

Unless the actor you're passing a ref too is not replicated

clear copper
#

I had to step away but I’ll show you the simple version in a bit. If the code is right then it’s a replication setting somewhere

silent valley
#

and your Server RPC to take ownership is on the player controller or pawn?

clear copper
#

Pawn

silent valley
#

should be ok then

#

the actor you want to take ownership of... how is it spawned?

clear copper
#

It starts in the level

silent valley
#

ok it's set to Replicate?

clear copper
#

This is the code in the character blueprint.

#

This is the code in the actor i want to be owner of

silent valley
#

what error are you seeing?

clear copper
#

No error, the client thinks they are the owner no matter who else is

#

in that log, the server set itself as the owner. when the client did GetOwner, it got itself. But if the client tries to set itself as the owner, it doesn't work.

ripe basin
#

@shell forum Nvm I figured it out. It was just a race condition with the async load.

For anyone dealing with Steam Avatar loading issues, you'll likely need to do a 'Request Steam Friend Info' and put a check against the data fetch before the Get Steam Friend Avatar. I guess you could also properly Async or delay the Get Avatar, but it always returned 'Success' even when it was still loading.

vagrant grail
#

Does anyone have a website or a video explaining where each of these components:

  • Game Timer
  • Game Manager (changing the rounds between lobby, game start, round, round end)
  • Leaderboard
  • Achievements
  • Roles assignement (killer vs innocent, tank / dps / heal in moba,)
  • Team Assignement
  • Quests
  • Win / Loose Condition
  • ...etc
    need to be in what class between :
  • Game Mode,
  • Player Controller
  • Player State
  • Game State
  • Client (Widget BP)

If there's no resource showing where each of these common stuff in games need to be, how do you decide where each of these need to be please ? πŸ™‚

Please ping me if any answer πŸ™‚

latent heart
#

That's asking too much.

#

Read the docs...

unkempt tiger
#

If I have some replicated property A in my actor, and another property B, completely separate of A, and they both change at the same time, I forget - how certain can I be that the client will see the change in both properties in the same frame/update cycle?

vagrant grail
fluid summit
# vagrant grail Does anyone have a website or a video explaining where each of these components:...

πŸ§‘πŸ»β€πŸš€Support us on our πŸ’²Patreon for awesome benefits: https://www.patreon.com/kekdot

In this video we talk about the Unreal Engine Multiplayer Framework. We discuss the most relevant multiplayer classes such as the GameMode, GameState, PlayerState, PlayerController, Pawn class (Character), and the relationship between the PlayerController and Wi...

β–Ά Play video
#

EspaΓ±ol?

#

No, i mean you. "Laura" is latin name. So hard to see spanish speakers here jaja

vagrant grail
#

why ? I need to understand how you decided that instead of the Character_BP and the Player_Controller to understand the logic I need to have when I'm deciding where to put stuff in the future

#

argh 😦

#

and ?

latent heart
#

A non-replicated Username variable, I hope!

vagrant grail
latent heart
#

That would be his player name, then, not a "username."

#

When I see username, I read login credentails.

fathom aspen
#

PlayerState is where you save stuff that should persist a pawn death

#

Anything character/pawn related goes to Character

#

Anything else PlayerController

vagrant grail
fathom aspen
#

How do you know what goes to what is you go to the source code and see what stuff exist in each class

#

That's how you get what are they used for

fathom aspen
#

PlayerState is still there though

vagrant grail
#

tho, then why not putting everything in the player state ? πŸ€”

fathom aspen
#

Because that's a bad architecture. First thing first, that will bloat your PlayerState. Also why would the pawn health stay in memory if it's not needed after the player's death

#

So too much stuff in memory or probably even repliacting at all times

#

And that's bad... like really bad

twilit radish
#

Is the point light actor replicated?

#

If it is, just set the owner on the server. If it's not replicated just disable the entire point light client side whenever you want.

grave lynx
#

it's a point light inside a replicated actor

#

so I can't set owner of a point light component

bitter oriole
#

Obviously the owner of the component is the actor

#

So its actual player owner will be the actor's

grave lynx
#

yea ok

golden warren
#

Hey I have a problem
Although I use "Destroy Actor" when the bullet actor is hit, It still remain like afterglow
It's only happened in client side, not in server side
I checked "Replicates" and "Replicated Movement" and "Component Replicates", but it doesn't work
how to fix it?

#

Also, I replicated hit event, but it doesn't work

kind ember
#

Does ForceNetUpdate() work on replicated variable marked COND_InitialOnly?

latent heart
#

Probably not

dark edge
#

and is the hit on server or client?

young kestrel
#

The last three lines don't work (that's why they are commented out). But probably I'm doing it the wrong way.

Does someone know what I need to do to get this working?

kind ember
alpine flower
#

Hello, i have a problem with replication. Is there a way to call "run on server" event from client? When i set this event (pic.1) Server can open the door and it is replicated to both server and client but client can't open it. When i set this event to not replicated both can open it but it opens only on 1 game client. Static mesh is replicated, blueprint is also replicated. Client player BP is child of Server player BP.

dark edge
#

you don't want your player to own the door

#

they DO own their pawn

#

do the run on server in the PAWN

#

The client tells the serverside pawn to tell the door to open.

#

do the RPC inside the pawn

alpine flower
dark edge
#

no, inside the player's pawn

#

do they have a character or something like that?

alpine flower
#

sorry i dont understand exatcly what u mean

dark edge
#

Do you know what a Pawn is?

alpine flower
#

i do

dark edge
#

ok, so you need to do the RPC inside the pawn or playercontroller (probably pawn in this case)

ripe basin
#

Make all the players be doors. Problem solved thinkingguy

dark edge
#

It'd go something like this in your pawn.

Clientside
Input -> Run on server event

Serverside
Run on server event -> do thing (tell door to open)

#

Is this general interaction or just some specific door thing?

alpine flower
#

general

dark edge
#

ok so it'd go like

Clientside
Input -> Choose what to interact with -> Run On Server Event (passing over the actor to interact with)

Serverside
Run on server event -> Call Interact (Interface call probably) on ThingToInteractWith

#

Or you could just do

Clientside
Input -> Run On Server Event

Serverside
Run On Server Event -> Choose what to interact with -> Call Interact on it

#

This is all inside your pawn. The door needs no RPCs at all.

alpine flower
#

okay ill try to do it

#

It works now, thank you! I had to rebuild key check system but it works

subtle patrol
#

hello, need your knowledge. How you could handle a melee system in multiplayer, when there is a latency between server and client?

bitter oriole
subtle patrol
#

generally, my big problem is, if someone is doing melee, ok the calculations are on server side, and after that it tells the player, you hitted that, take that info back. If now there is a latency, and the player spamming the melee, the server could lag at this point and become unresponsible

#

one way is , when melee, he can be able to melee again, if he got the information back from server

#

i dont know, i need your knowledge

bitter oriole
#

As a default you'd probably want to have a MeleePlayer() event taking a target Character as parameter, have the server run basic checks (is the distance between both reasonable?) and then replicate the modified health, send a multicast with the damage info so that you can play a sound on the victim's client, etc

#

The time between two melee hits should be checked both on client and server

young kestrel
# young kestrel The last three lines don't work (that's why they are commented out). But probabl...

Just to make it more clear:

I want to create new custom movement types, which need to be replicated. Two of my compressed flags are used to send the custom movement flags and the current movement mode.

When using any of the custom movements I have the issue that the player will wall run, when sprinting just after walljumping.

Another issue I have is that my climbing movement mode doesn't work. The only thing that happens is the server correction.

If someone knows how to handle replication with more than 4 movement types and how to update the compressed flags... Well I'd be happy. I'm stuck for 3 months now on this issue.

subtle patrol
#

@bitter oriole is there any way to add fake latency for testing?

young kestrel
graceful flame
subtle patrol
#

found it ty

lusty sky
subtle patrol
#

yep found it tyyyyy

graceful flame
#

That was my approach. My code was too messy for me to properly understand and debug so I ended up disabling all of the custom flags except for one and just tried to get that one fully working. Then I had a path forward for how to make the other ones work.

graceful flame
#

But feel free to try the Average and Bad profiles too.

young kestrel
pallid viper
#

Hey, I have a camera prop to which IΒ΄ve attached a Scene Capture Component. Than I attached the whole camera BP to the character as child actor component. Everything works fine in standalone but in multiplayer the scene captures what the other player sees and I canΒ΄t seem to figure out why

#

Can someone help?

#

Ik there must be some clash because of all the clients knowing about each others scene component but idk how to solve it

graceful flame
pallid viper
golden warren
elder sage
golden warren
sour hamlet
#

Hi, I am working on a project. its a local multiplayer game. but my 2nd player controls are not working. can anyone please help me out ?

livid arrow
#

anyone know how to do a multiplayer compatible knockback effect? like a destiny boss stomp or a lucio boop

thin stratus
stiff nebula
#

are event dispatchers replicated in multiplayer?

fathom aspen
#

No

#

Executed locally

livid arrow
#

but it seems to be working pretty good

#

thanks man

stiff nebula
# fathom aspen No

does this mean i shouldn't use event dispatch to try and replicate something, i have On Use Item to fire my gun and i've been having issues with my weapon, could that be it

fathom aspen
#

Replicate an event means: call it from client, and execute it on server, OR, call it from server, and execute it on client.

#

Can an event dispatcher do that? No

#

Can an RPC do that? Yes

#

What other than RPCs can do it? None

fathom aspen
stiff nebula
#

gotcha

thin stratus
#

As a local player you might still notice a hickup on 50ms+, not sure.
After all, the AI is a Server Character, so the impulse isn't predicted

livid arrow
wispy ingot
#

Hi everybody - I am having some trouble with setting up and connecting to my dedicated server through remote desktop, and I would really appreciate any assistance.

We are making a simple multiplayer mobile game in UE5. I followed the official docs regarding setting up a dedicated server. I have built the engine from source, created Server.Target.cs, built and packaged it. I did not make a separate client target but rather just packaged the default build target (as per the docs).

Everything works fine locally when I run the game and server exe's separately. But when I copy the packaged server files over to the remote desktop (where the actual server is running), run it and try connecting to it as a client I get this error:

"FailureType = OutdatedClient, ErrorString = The match you are trying to join is running an incompatible version of the game. Please try upgrading your game version., Driver = PendingNetDriver IpNetDriver_21******"

I tried googling this and had no luck. The builds/packages are identical with what I have locally and what I copy to the server desktop. I tried packaging Shipping versions, rebuilt the engine from source and retraced all the steps - all with no avail.

An associate with a lot more experience recommended us to change to UE4, which would be less than preferable to say the least.

Any help would be much appreciated!

plucky prawn
#

You might also have more luck posting in #packaging than here

wispy ingot
#

Thanks, I will post there as well. By revert to UE4, I mean change to it - we were always using UE5 for this project.

twin juniper
#

If i'm calling ForceNetUpdate before Destroy on an actor, does it guarantee me that every properties will be replicated (and so execute all OnRep_ needed) before the server destroy the actor ?

winged badger
#

and override them to return the same value for both builds

thin stratus
#

I got a Component (Replicated) and a Struct Variable (Replicated).
The Struct Variable has a Boolean and an AActor Pointer, both marked with UPROPERTY()

The Server sets the Boolean and the Actor Pointer and calls OnRep.

The Actor the Pointer points to is Replicated and exists long before the Struct Variable is modified (on Server and Client).

Problem: The Client calls OnRep with the correct Boolean, but the Pointer is null.

Did I miss a step? I have a similar setup in an Actor (basically the Actor that the Pointer is pointing to), just with a different Pointer and that works fine.

#

The Component sits on the Character.

#

The only things I could imagine are:

  • The Actor isn't marked as replicated. (It is)
  • The Actor doesn't exist yet. (It does, and if it would get valid later it should call the OnRep with a valid Pointer iirc)
  • Magic
#

Ah, it was Magic (: A restart fixed it for now. Lovely.

split siren
chrome bay
#

If they're stationary they can't move?

#

Should get a bunch of warning spam if you try to move a stationary component

split siren
#

My apologies, by stationary I mean they can move, have physics but have not moved in couple of frames.

#

Those two ball actors are the same, but the one that was not placed on the ramp (and has no movement after falling down on the floor) takes much longer to rep movement and then teleports

chrome bay
#

What are their network update frequencies?

split siren
#

120

#

Always relevant

chrome bay
#

Both Min and Max?

thin stratus
#

You can see it trying to move though

chrome bay
#

Almost certainly looks like client and server are fighting

split siren
#

It is trying to move, true. It jitters when it should be moving

#

So it's getting some data from the server

chrome bay
#

Could also be the smoothed physics replication causing it

#

You can try fiddling with 'PhysicsErrorCorrection" in project settings, or with the console vars

#

There are both time and distance tolerances before it snaps to the Servers' physics IIRC

#

And since you're only applying the impulse on the Server, the client will be relying on a snap to get back in sync

split siren
#

Thanks I will give it a go

chrome bay
#

Where possible you should simulate all physics on all connections

dark edge
#

Give those tuning parameters a good look too

#

the default parameters are very strict IMO

chrome bay
#

But if the clients move something and the server doesn't, it's permanently out of sync too

#

Tl;DR Physics networking sucks

dark edge
#

I've actually found it to not be too bad if you DON'T need prediction

split siren
#

Yeah, the overall case is a bit more complex, this is just boiled down to the core problem.

dark edge
#

I'm working on multiplayer player-built vehicles lol. It's rough.

split siren
dark edge
split siren
#

Looking into AActor::SyncReplicatedPhysicsSimulation() atm

dark edge
#

I know sleeping is screwed up in UE5 rn

split siren
#

Interesting, I will try it in ue4 just out of curiosity

#

Might be worth going back to UE4 just for the stability sake

dark edge
#

or just disable sleep to rule it out

split siren
#

Stupid question, but how?

split siren
split siren
#

Just fyi, I have tested the same setup in 4.27 and it works as intended.

thin stratus
#

Chaos vs PhysicX?

split siren
#

Chaos

winged badger
#

all the transitional plugins are of very unstable quality

#

the ones that are supposed to start working on 5.1, none of them work now

#

not fully

split siren
winged badger
#

there is very little guarantee those systems will behave flawlessly with 5.1

#

and no

#

we had to implement multiple fixes to common UI

#

because its just broken

#

and Chaos has even more troubling history as it was supposed to be ready from 4.22 or 4.23

bitter oriole
winged badger
#

but 5.1 means that Epic is semi-comfortable calling UE5 production ready

chrome bay
#

57 pages of open issues on issues.com atm that are assigned to 5.1, so not for a while methinks

winged badger
#

that pushes it even more into the unknown

sacred spire
#

Wait for 5.3 at minimum at least.

bitter oriole
#

Or don't. Plenty of stuff works fine already

#

5.64 will still have bugs

#

5.0 already has working things

chrome bay
#

We're in full prod on 5.0, it's pointless to wait if you're not launching for a while

winged badger
#

its fine as long as you can fix engine bugs yourself

sacred spire
#

I mean 4.27 seems very stable. Without 5.0 features. So like 5.3 could be lesser bugs for whatever existed so long

winged badger
#

when you really need to

chrome bay
#

The issue is the 5.0 pipeline is pretty different to UE4 if you want to take advantage of the newer features

bitter oriole
sacred spire
#

Yeah

winged badger
#

yeah, we're starting new project soon

#

and it will be on 5.whatever

chrome bay
#

Definitely some stuff that needs improving though, as always

winged badger
#

as the engine will also get upgrades during our development

bitter oriole
#

We don't even know what's gonna be in 5.1, speculating on what could be in 5.3 a full year from now is just.... weird?

chrome bay
#

Can keep an eye on UE5_main to see what epic's focuses are

sacred spire
winged badger
#

this damned project (took too long and it bores me now) started on 4.7, released on 4.27

chrome bay
#

Lol I feel that

bitter oriole
sacred spire
bitter oriole
#

So saying wait for 5.3 (again, next year stuff) makes no sense, nobody knows what will be in that

#

Maybe it's gonna drop DX11 support

sacred spire
#

I can agree

bitter oriole
#

Maybe it's gonna be Windows 12 exclusive

#

Nobody knows

winged badger
#

if you're about to release, upgrading to 5.xx would be suicidal

#

if you're starting a project, 5.xx is fine

bitter oriole
#

I would say 5.0 is way too unstable for release. Pretty sure at least 5% of my demo's downloads ended in GPU crash

#

Hoping that 5.1 improves on that

dark edge
uncut atlas
#

Is the game instance valid on a dedicated server?

quasi tide
#

Yes. On every running UE instance.

#

One per instance.

fluid summit
#

Hi! does anyone know why "simple move to location" may not be working on client but yes on server?

thin stratus
#

Client has no NavMesh maybe?

fluid summit
#

is it necessay if i'm doing the request on server?

split siren
fluid summit
#

i just checked and navmesh seems to be okey on client

#

also the client is constantly floating, i can't figurate out what is wrong with the replication here.
Floor is being added to the client OnRep, everything seems to be set to replicate on the pawn and the floor.
If i move with "Add movement input" it works okey on both server and client 🧐

limber gyro
#

Does any 1 know if its possible to connect to "IP" servers using steam net driver?

#

or has any one changed the engine in a way that allows it?

limber gyro
bitter oriole
#

Not by exposing IP addresses to clients so that they can DDOS the others

limber gyro
#

thats not what i asked...

bitter oriole
#

You don't want to use IP addresses

#

You don't need to

limber gyro
#

ok so how would u go about creating dynamically spawned ranked sessions?

bitter oriole
#

Dedi creates session, players join session

limber gyro
#

what if i am using a back end as service like playfab?

#

or aws

bitter oriole
#

Then you might not want to use Steam matchmaking in the first place

limber gyro
#

there has to be a way

#

if pubg does it

#

all i am asking is if any one knows how

bitter oriole
#

Sure there are many ways, like not using the Steam online subsystem, or by letting your servers use it

#

I expect PUBG has their own service and only uses Steam for identification

#

Personally for a competitive indie game I would certainly want to use Steam sockets & matchmaking

#

DDOS resistance free of charge is kind of a no brainer

limber gyro
#

bu then i cant do ranked game modes

bitter oriole
limber gyro
#

well from my understanding i cant use just regular ip server with steam

#

and thats what i gathered from what u said aswell

#

so how am i gonna spawn or even host ranked servers somewhere, i would have to write a custom backend matchmaker

bitter oriole
#

Normally you would simply have your hosted ranked servers start a Steam session and have players join it

#

No idea what the issue is here

limber gyro
#

thats what u need to have a ranked experience

#

so ur gonna need a matchmaker regardless if u write it or if u have it on the baas

#

ive never wrote one so i would rather not

#

i wouldnt even know where to start tbh

bitter oriole
#

So if you've already understood that you need your own matchmaking, what does Steam has to do with anything here?

limber gyro
#

well i wanted to use playfabs matchmaker for ranked, and steam for just regular "player creates sessions to play with friend"

#

thats why i asked if those 2 could play nice with each other

bitter oriole
#

You don't want to maintain two parallel matchmaking systems, it would be a huge waste of time

#

Once you've got a competitive ranked matchmaking system up and running, playing with friends is an easy-mode cherry on top

limber gyro
#

well ive got the competitive stuff going with playfab

#

but playfab doesnt have a master server kind of thing as far as i know

bitter oriole
#

You're looking at anti-cheat, server hosting, DDOS mitigation, player reports, and of course the advertising budget for a competitive game; you're looking at custom matchmaking - I promise you playing with friends will be a nice afternoon's worth of work after that

limber gyro
#

then if it works it works

#

if it doesnt it doesnt

#

im doing this alone and looking for easy solutions to see if it can be done

bitter oriole
#

My personal advice would be to start with a purely Steam-matchmaking-based system without ranking and stuff, and then see if you have enough players that ranking is possible

#

Because when your game has 3 online players you can't exactly do ranked matches

limber gyro
#

thats why i actualy started with playfab ranked first

#

and got it going

#

but now , like u said, i feel its probably better to have that simpler stuff with friends

#

but i wanted to keep the ranked aspect

#

so i am a bit stuck

bitter oriole
#

I'm just saying your ranked competitive game is only possible with very successful games

#

So maybe think a bit about that

limber gyro
#

i understand

#

im probably gonna have to redo some things then

#

i have playfab fully integrated and stuff

#

its just kinda hard to throw that work away

bitter oriole
#

You don't have to throw it away, you can simply pause it, keep it on a branch in source control, and spend the rest of today implementing Steam sessions with friends. When your game has 10 players online all day long, which is a massive success as far as i'm concerned, you can look at how a ranked game could work. That would be my personal advice to ensure you don't spend time developing unused features.

limber gyro
#

well tbh i only need to redo the UI and leave the playfab stuff hanging

#

if im going the steam sessions route im probably gonna need to do some coop mode aswell

still owl
#

πŸ‘‹

Any suggestions on how to mitigate client corrections?

When I play a listen server with my friend over the network, if they collide with me or any other server authoritive moving object they get corrected quite a lot.

How best to mitigate this? I'm expecting corrections to happen but not at 50ms with standard gameplay collision

limber gyro
#

by the way @bitter oriole do u have experience with multiplayer games, in like very big games, or a failed attempt at launching a ranked multiplayer game

limber gyro
#

if its not

#

try this

#

GetCharacterMovement()->bIgnoreClientMovementErrorChecksAndCorrection = true;
GetCharacterMovement()->bServerAcceptClientAuthoritativePosition = true;

fluid summit
clear copper
#

what persists when you server travel to a new level?

limber gyro
limber gyro
#

what exactly is not moving properly?