#multiplayer

1 messages Β· Page 134 of 1

dark parcel
#

What actually go down when u call it? Like which part don't work

ocean dust
dark parcel
#

πŸ˜” well hope someone experienced have the answer for you.

I will have to deal with it eventually, so maybe if it work for me, I will let you know

ocean dust
#

What? Then why use an engine at all? It's supposed to provide an easier way to do things like multiplayer.

dark parcel
#

Can't tell if you are trolling or not tbh

ocean dust
#

What LOL ok, dude

#

What? I have no idea what you're going on about. Seriously is this a chat bot? Their response for Seamless Travel issues is "Multicast it, bro". And then tells me to fuck off and use Unity instead. I legit have no idea what's happening here...? @dark parcel Any ideas?

dark parcel
#

@ocean dust have u enabled seamless travel in game mode?

ocean dust
#

Even though some of them probably shouldn't have it enabled in the future, I'm trying everything

ocean dust
#

UGH

#

Ok, great, thanks!

sinful tree
#

Nice

dark parcel
#

I will take a note lmfao

#

Incase I run into the same prob

ocean dust
#

So far only works with Main Menu -> Game Level, but progress is progress

#

This dude is so toxic and nonsensical

#

at the same time. It's really something else

#

Yeah still doesn't work for Game Level -> Game Level

#

Will report back when I have more findings, thanks!

sinful tree
#

<@&213101288538374145>

north stone
#

rule number 1:
Be excellent to each other
Don't harass, threaten, or impersonate others. Don't encourage hate or violence. Don't engage in public shaming or witch hunts. Keep discussion civil and thoughtful. In general: Act in good faith, assume good faith in others, and be constructive.

ocean dust
#

I got it to work! I had a bad cast for my Get Game Mode, so I was calling on None, so it wasn't working in my Game Level. With that fixed, it now WORKS!

#

Similarly, I'm happy to report that I found something REALLY HELPFUL: Seamless Travel now works in PIE! But it is disabled by default. You can enable it by starting PIE, opening the console (with the ~ key), and typing in net.AllowPIESeamlessTravel 1

grand kestrel
#

@ocean dust Just ignore him, he came here last night to troll

#

He's trying to get people wound up

ocean dust
#

(I'm using UE 5.3.2, btw, so the net.AllowPIESeamlessTravel thing may not work for earlier versions, but works for latest)

true stream
#

is there a way to detect potential desyncs?

#

to check if Im replicating everything I should

#

other than eyeballing it of course

twilit radish
#

Probably not. Not replicating certain properties could be a valid approach in one game while it isn't in a different one.

#

It's also extremely context dependent I guess.

dark parcel
#

there is a way to visually check for CMC De-sync

#

it will draw the error and corrected sphere for you

#

Forgot the command tho

true stream
#

also to learn if I need to replicate all the things

#

or not

dark parcel
#

you probably pick the hardest genre, best of luck

dark parcel
#

I mean at the end of the day

#

the server is the Authorated one

twilit radish
#

@dark parcel The CMC can potentially correct based on packet loss despite not having an actual issue regarding everything being set up. Not sure I would rely on that πŸ˜›

grand kestrel
true stream
grand kestrel
#

It also has verbose logging

#

A console command

true stream
#

right

#

but I mean what does it do

grand kestrel
#

When any desync occurs it will draw capsules showing where it occurred (red) and where it corrected to (green)

true stream
#

should I be seeing this error corrections while testing on my PC?

#

or can I cause them somehow if not

#

basically I wanna make sure Im not seeing a version of the game other players are not

grand kestrel
#

You can use network emulation settings to simulate normal network conditions (with latency), and you can introduce pkt loss too

true stream
#

and to avoid some weird zoom call with screen sharing

grand kestrel
#

You will find them here

dark parcel
#

Just emulate some lag like Vaei said

true stream
# dark parcel wdym

if Im not sure if Im doing the things correctly, checking if what I see in my game is the same as the other guy, helps

dark parcel
#

Play as listen server

#

3 players

true stream
#

I do

dark parcel
#

Server , Client, Client

#

and emulate some lag

true stream
#

ah ok

#

then I would start seeing the error correction right?

sinful tree
#

p.netshowcorrections will display when a replicated character position is corrected by the server. I don't think it'll help with an RTS.

dark parcel
sinful tree
#

Exactly :/

dark parcel
#

you have to elaborate on "error correction"

true stream
#

only units and buildings that are all actors at most

true stream
dark parcel
#

Afaik for Position correction on CMC only

true stream
#

position correction, what about hitpoints/alive/dead correction? is that a thing

dark parcel
#

Have some widget that show those attributes

true stream
#

that makes sense

grand kestrel
#

Oh, you're not using characters, guess that should have been obvious with RTS, sorry 😦

#

If you're using pawns then you'll need to build all that functionality yourself

#

They're not even going to desync until you build the functionality for them to do so

sinful tree
#

if you're using replicated actors with replicated properties, then there can never be a guarantee that their values will always be in sync as there is always going to be some network delay involved and under bad network conditions it could take longer for some replicated properties to arrive. That said, the server would be the authority in regards to replicated actors, so whatever the server has is the real value.

If you're talking about actors that are not replicated, then they don't technically exist other than on the instance of the game that spawned them, so there's no appropriate way to reference them between the different instances to even know if their values are out of sync or not and since each instance is spawning their own copies there's no means to know what the correct value should be as each has their own version of the value. All you could technically do is as Cold Summer suggested and maybe visually see what the values are yourself.

quartz iris
#

Why do the player name tags only work properly for the server?

#

this is the gamestate

dark edge
#

use an array of names or something

quartz iris
#

whys that?

#

just curious

sinful tree
# quartz iris

widgets don't replicate, so even though you may be setting the text in the widget on the server, other clients wouldn't necessarily know to do the same. Unless you have similar code in an OnRep on a replicated actor then clients wouldn't know what to set the value to in the widget.

dark edge
#

They both are integers at the end of the day but names are more for, well, naming things while enums are basically for an extension of booleans or representing state.

#

It's a lot easier to add/remove names than enums

quartz iris
dark parcel
dark edge
#

replicate what DRIVES the widget

#

Where does the Name variable live?

#

I'd guess playerstate or pawn

quartz iris
#

pawn yeah

dark edge
#

replicate that

#

the local widget just shows it

dark parcel
#

Read Only

quartz iris
#

with onrep?

#

I tried the onrep before but I probably did it wrong

dark edge
#

I'd start with just polling for now

quartz iris
dark edge
#

onrep it later

true stream
#

but if the listen-server can take care of that, no problem

dark edge
# quartz iris

don't have replicated variables in your widgets. They do nothing

dark parcel
#

a lot of bad things can happend in multiplayer

#

it's hardβ„’

quartz iris
#

A different method?

sinful tree
# quartz iris

This is fine, you jsut don't need replicated variables within the widget. You use replicated variables in replicated actors which then can change the widget πŸ™‚

dark edge
true stream
dark edge
#

you're always desynced

#

how much is up to the design

dark parcel
#

Your biggest enemy is latency

dark edge
#

I'm so glad I'm not doing any prediction in my project

#

I'd go nuts

dark parcel
#

Is it possible to detach from client prediction and server rewinding completly in a networked game?

sinful tree
#

I'd argue that Maru doesn't need prediction either since its an RTS they're going for... There's still latency inovlved, but you'd only ever be seeing what played out on the server.

dark parcel
#

I mean for a specific game

dark edge
true stream
#

Tower A shoots projectile towards tower B, which also shoots a projectile to tower A, in 1 client the projectile arrives for some reason faster, causing one tower to die in one client and be alive on the other

dark parcel
true stream
#

what kind of situation would that be

sinful tree
dark edge
#

Civilization

dark parcel
#

Oh yeah ofc

sinful tree
#

Also makes the CMC client authoritative if you do so πŸ˜›

dark edge
#

Kerbal Space Program

#

Stellaris

dark parcel
#

but like, lets say you click a button to add resource, you don't really want to wait 2 seconds before the resource update right? Assuming u are under intense lag

quartz iris
sinful tree
true stream
sinful tree
#

Like... I may have 300ms latency while you only have 50ms. So what you see is vastly more recent than what I see.

modest coral
dark edge
#

vehicle vs vehicle collision is insanely hard to predict anyway, ask PUBG (bad) and Rocket League (good)

modest coral
#

they seem upset i made online injection of coins also not that i am flexing πŸ˜Άβ€πŸŒ«οΈ for my mmo

true stream
dark edge
#

CounterStrike

#

vs chess, when a little delay is fine

#

a FPS without prediction would feel like absolute ass

#

an RTS without it feels fine, you don't even notice

true stream
dark parcel
#

I would do damage on server side

#

you can do the effect instantly

#

the blood etc

#

But let server decide if they deserve to die or not

dark edge
#

If you want them to die INSTANTLY on your screen vs ping ms later when you click

sinful tree
#

I can remember talking with someone making an ARPG on here, and they were saying they didn't want to use prediction.... I was a bit confused.

modest coral
#

@ocean dust at times you may get a player drop when a player hosting travels another map that gets fixed by ,...

dark edge
#

for an RTS though just go without prediction, it's fine.

#

that's why they have the "roger roger" voice lines and the animated click arrows etc

true stream
#

Dota/LoL for example, it shouldnt be using prediction

dark edge
#

to hide it

#

LoL uses prediction but I'm pretty sure Dota doesn't

#

but dota is slower paced so it's fine

true stream
#

in LoL you kill and cast spells instantly regardless of latency?

#

didnt know that

dark edge
#

idk if it's just for movement or for everything

true stream
#

in Dota you click, then move X ms later

#

with everything the same

dark edge
#

Probably the most impressive netcode in my mind is Path of Exile

dark parcel
#

It depends on the game design

true stream
#

can the server "revive" actors if something got fucked up

#

or its always about properties, like position, etc

sinful tree
#

Client Prediction:
Allowing a client to do something immediately and letting the server correct/rewind if it disagrees with what you were trying to do.

Server Authoritative:
Clients can only request to do something and the server then plays out that request. Would always take your ping*2 to get any response.

dark parcel
#

Imagine shooting without prediction, and u have 0.5 sec lag. Your grenade launcher will spawn ball 1 second later after you click a button

#

for an FPS game, that's not playable or acceptable

true stream
#

got it

dark edge
modest coral
#

why you guys flood useless nonsense ?

true stream
#

great news then

dark parcel
#

ye another troll begging to get hammered

true stream
modest coral
#

no seriously why dont u go private ?

dark edge
#

We're talking multiplayer here

dark parcel
#

He is trolling

true stream
#

these kind of quick talks are very useful for people without vast knowledge

#

some things are very hard to google

dark parcel
#

Just read chat history

#

dude need some help

modest coral
#

i unmask a advice not good after i try help

#

first of all you put a map far far away you have 2 post process to deal with and one sky sphere ?

dark parcel
modest coral
dark parcel
#

Nah, Im a trash bag. Never released a game
Too much skill issue. Working on it

modest coral
#

sorry i not reply or engage with or to lower developers

#

not mis directions other either they can come to me for advice if want see ya

true stream
#

I always enjoy reading a good troll, but this is not up to the task.

#

lower troll... smh.

modest coral
gritty lantern
#

I've got a dynamic multicast delegate FMyDelegate that's declared as a UPROPERTY(BlueprintAssignable) FMyDelegate Delegate. It's assigned in a blueprint and both the server and the client call Delegate.Broadcast() but only the server triggers the code in the blueprint. Is that expected behaviour?

sinful tree
gritty lantern
#

right, but I have a function called on both the client and the server that calls Delegate.Broadcast(), but only the server's blueprint event handler gets triggered. Not the client

#

go to sleep lol

sinful tree
#

It is on a replicated actor that is relevant to the client?

#

There really shouldn't be any problem with delegates if you've bound them on both the client and server, and you're calling the broadcast on both, and yea, assuming it's a replicated actor that is currently relevant.

ocean dust
gritty lantern
ocean dust
gritty lantern
#

What I'm seeing though, is that on both the client and the server:

template <class UObjectTemplate>
void ProcessMulticastDelegate(void* Parameters) const
{
    if( InvocationList.Num() > 0 )
    {

InvocationList correctly contains the bound function, so I assume so?

ocean dust
#

Can you place a breakpoint in the BP on Bind Event to ...?

gritty lantern
ocean dust
#

And verify that is called on both the client and the server?

gritty lantern
#

It's a BlueprintAssignable delegate that's on a component, so the actor that owns the component just has it...there, like how you can assign something to OnComponentActivated

#

like this

modest coral
#

maybe i did not replicate the coins well but i seeing mario and lugi one one side as GM and other side as Gm also

gritty lantern
#

OKAY I found my problem. It was being called correctly on both client and server, but there's an if statement somewhere down the line that was checking for something that wasn't replicated and it's empty on the client so it returned early

#

thank you for being my rubber ducks

modest coral
#

oh shucks glad to help good luck to all mmo πŸ˜‚

magic vessel
#

Is it possible to get a return value from a RPC?

sinful tree
#

You can send an RPC, and then have the other side send an RPC back, but it's not technically a return value.

magic vessel
#

I'm getting this error:
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor

#

It's for an actor that should be server owned as it is in the level

sinful tree
#

You're either trying to send a client RPC or send a server RPC from a client that doesn't own the actor.

magic vessel
#

It's a Server RPC from a client

sinful tree
#

Can only send RPCs to the server on client owned actors.

magic vessel
#

Okay, so through player controller?

#

for example

sinful tree
#

Controller, their controlled pawn, or their playerstate, or any replicated component owned by one of these actors.

magic vessel
#

Good job the next task was refactoring then

compact flame
#

Can someone help me why does this not work in multiplayer?

fossil spoke
#

If not, it wont be able to process RPCs

compact flame
#

Im a bit stupid

#

tx

pseudo wagon
#

When IsNetRelevantFor return false , in client, it take several second to destroy actor, do you guys know why. I don't think it delay for that long.

fossil spoke
fossil spoke
#

Imagine you are sitting right on the NetRelevancy Distance value and you pop in and out constantly

#

That would be wasteful

#

So it waits to close it just to make sure you really are going to stay out of relevancy.

pseudo wagon
#

So there is any parameter control that delay. I can not find it anywhere.

fossil spoke
#

Not that I am aware of, you likely do not want to change it if it exists.

echo snow
#

Do I call the normal function or the _Implementation of an RPC or does it not matter?

pseudo wagon
#

Does LoadLevelInstance work on multiplayer, I use LoadLevelInstance on Server, it works but client see nothing.

lethal blade
#

Did anyone help me out to replicate PCG seed from host to all clients ?

raw thunder
#

Hello everyone,
I am trying to make a projectile using the ProjectileMovement component but I'm struggling a bit on the replication part.
I spawn the projectile on the server and replicate it on the clients. It's works great but when I try to change the initial speed it does not work. How am I supposed to do it correctly ?
I can't put the set initial speed on the constructor since the property has not replicated yet on the client.
Should I overrite the speed directly on the client ?

upbeat basin
#

I have two design related questions

  • There are 2 different player roles in the game and I would like to store their specific state related variables in PlayerState so we can use CopyProperties and OverrideWith. However I don't like the idea of having a single PlayerState and having 2 different set of variables where one of the set won't be ever used for that PlayerState. What is the common solution for this, is it possible to have different player states for different players? Is it logical to do that if it's possible? Should I go with another way?
  • Related to above question, there are components which kind of defines the actions and abilities of players according to their roles. On the demo we added those components to Character, since that's the Actor with mesh that players interact with. Howerver they also store some state variables in them, Inventory for example, holding references to items that player carries. And we would like them to be handled on reconnection as well. Would it be better to add those components to PlayerState? Or should there be a variable/struct that stores that information about those components on PlayerState and we should assign them back to the components on Character once player reconnects?
carmine canopy
#

Wondering, what's the best way to handle game wide events (singleplayer) that can be triggered by other (singeplayer) players.
E.g. similar to messages in elden ring (where players can leave messages for other players)

Dedicated server with beacons for setting the data or some kind of other solution?

upbeat basin
drifting heath
#

Starting to think it's not the replication that's the issue.. Still digging.

#

Got it. It was my save/load file - Save wasn't saving the stats.

sinful tree
# carmine canopy Wondering, what's the best way to handle game wide events (singleplayer) that ca...

You wouldn't need to use an Unreal server to do that and would actually be kind of wasteful, and not well set up for the task.
You'd need some kind of system that calls an external API to both retrieve and post messages. That API would likely call into a database somewhere to retrieve and save messages.

While I'm not super familiar with elden ring or any of the dark souls games, I imagine you only come across messages sporadically, so you wouldn't want to download them all. This also means you probably would want messages to be stored by "Areas" and the messages have a TTL so they don't persist forever in the database.

So then it would end up being something like, a player wants to write a message, so your game calls out to an external web address where your API resides, making a POST request, including the "Area" and "Location" (literal X, Y Z position, possibly even Yaw) of where the message should exist. The API saves the message to the database with a 2 hour TTL or something like this, however long you want messages to persist.

When players are playing the game and they enter an area, you make your game to request from the API to get some messages indicating they are in "Area A" - the API could return a number of active messages in a random assortment for the area, and includes their location. The game can choose how many messages it wants to display, and loop through the messages provided, ensuring they are in valid locations, not overlapping too closely with an existing message that's already been spawned and making sure they are spawned on the floor so you don't have any floating messages in the air.

You probably could use some of the functionality of a BaaS provider like BrainCloud or PlayFab to do something like this without having to set up hosting of your own database and API.

fiery wadi
#

Can someone tell me why the "Client" returns none for InteractionWidget please.

#

It works perfectly server side but the client creates the widget and then it wont remove itself when the player is no longer in range of the NPC.

#

Or do i need to do DestroyWidget (Execute on Owning Client) ?

strange frigate
mossy helm
#

is this correct?

#

I keep getting this error for some reason

sinful tree
fiery wadi
#

You can see on the Blueprint that I posted that the widget is created and then a Variable is set to the new Created widget and when the Widget is removed from the parent the Widget Variable is set to none.

#

It works for the Server but the Client creates the InteractWid Var (Which is not replicated) I think i might have realised my error.

#

hmm nope now the server clones the widget automatically to clients.

#

I thought Execute On Owning Client would only Execute on the Client who initiated it ?

sinful tree
#

It executes on the client that owns the actor.

fiery wadi
#

So if the Actor is a Client it should only run on itself, Is this correct?

sinful tree
#

A client isn't an actor.

fiery wadi
#

Ok im thinking about this wrong i think xD

sinful tree
#

So this is a "Character" blueprint based on the target being "BP Top Down Character".
The "Character" can have an owner which can be a client, for example, if the character is possessed by a player controller.

fiery wadi
#

Ok.

sinful tree
#

If you aren't possessing this character with a player controller, then you'd have to assign ownership if you want a specific client to own that actor. Once ownership is established, then "Run on Owning Client" events will execute for that particular client (if called from the server of course)

fiery wadi
#

When i run Listen Server it shows me 2 players who are both using the same player controller class, The server "player" works and InteractWid sets and clears correctly But the client displays the widget but fails to "set" the variable which is what im not understanding

sinful tree
fiery wadi
mossy helm
#

the begin quest node that exists in the first img will call this begin task event

#

I was trying to make a quest that will run on the server and client

sinful tree
# fiery wadi

You can't do this.
If you need that data sent to the server, you have to have it as an Input in your RPC to the server. This also not required to have a client call to the server just to call back to the client. The client can do things clientside if so desired without requiring the server at all.

Additionally, the run on server event would also only work for a client that owns the actor, so it can work on the server as the server would always be able to call to itself, but not for any other client that either doesn't own or is posssessing the actor.

fiery wadi
#

Ahh ok

#

So this Widget could only be done "ClientSide" as no other player needs to see it only the player interacting with the current NPC.

sinful tree
#

Yes.

fiery wadi
#

That makes sense!

sinful tree
#

If they're not valid, they shouldn't be used πŸ˜›

fiery wadi
#

LOL just when i think i got it i get stuck again xD

mossy helm
fiery wadi
#

Server is on NPC

sinful tree
fiery wadi
#

Client is on NPC

mossy helm
fiery wadi
#

I haI have it all being created clientside as its not replicated. XD

sinful tree
#

The problem is because this variable is attempting to be accessed when it has no value set in it, which means it is invalid when it is being accessed.

mossy helm
winged vault
#

I’m trying to play as a listen server with 2 players but the second player doesn’t spawn the pawn

#

The pawn being the ship of class Pawn

echo snow
#

I get these lines from replicated simulated objects when I enable NetShowCorrection. What are these lines supposed to be showing?

nocturne quail
#

what sound is best on network travel?
mono or stereo?

sinful tree
#

Can you rephrase the question? Not sure what network travel has to do with sound.

#

Especially in regards to stereo or mono.

nocturne quail
sinful tree
#

These are assets you've imported to the engine yea?

nocturne quail
#

i want to know if this don't make any big difference to use the stereo for owner and client

nocturne quail
#

want to know if this is a good practice

sinful tree
#

That's not how the engine works in regards to assets.

#

You wouldn't replicate the entire sound file every time.

#

You'd be replicating a reference to the asset which is only a few bytes.

#

And even then, you don't necessarily need to replicate that reference to the asset.

#

And if you did, you should only ever do it once.

nocturne quail
#

hmm, so the size of the files don't matter right?

sinful tree
#

It does in terms of how big your packaged game would be, but not in terms of replication time/costs.

nocturne quail
#

thanks very much, i got it )

sinful tree
#

Take this as an example.... No replication of the asset required as the BP_Gun actor itself is defining the asset to use for the sound. All that's replicating is the event to actually make the sound play locally on a client.

#

If you did it this way, you would be making the server tell the client what sound should be playing, but it's somewhat pointless to do this. In this instance I believe it's about 80 bytes for the first time the asset is referenced, and then it'd be only like 4 bytes every other time it's replicated. The above example uses effectively 0 bytes in regards to the sound.

feral spear
#

I'm designing a game that will have up to 50 players in a single level. Each player can produce a lot of units (pawns) they can control. I was wondering how hard on a technical level will be this to implement using Mass while running smoothly on multiplayer.

I was researching on how Stormgate achieved it and they claim to be using a custom solution based on GGPO/Rollback, common in fighting games.

Anyway, anyone with the expertise and time/patience to explain to me how to combine Mass + Rollback on UE5 and if it is at all possible? Or it is too ambitious to have that many entities on a single instance.

twin juniper
#

Hey I managed to fix this before but I can't rember can y'all help me this is in the gameplay blueprint I have made. it will get rid of the widget (NewVar 1) on the servers but not clients and when trying to remove it from the clients it just removes it from the servers instead

dark edge
true stream
#

when it comes to updating widgets that all players should see, through events that run on the server only, whats a good practice?

#

I'm reading something about using PlayerState/GameState

#

to pass this information to the clients

#

does that make sense?

sinful tree
#

It depends on the context of what the widget is associated to and whether what you're doing is tied to a replicated property.

true stream
#

I'm replicating the float health property

#

But unsure how to update the widget

sinful tree
#

So then all that should be needed is your health property being set to OnRep.
When the OnRep function is fired, you can have it update the health bar.

true stream
#

Never used onRep

#

Is there a BP node ?

sinful tree
#

You mark the property as Replicated W/ Notify.

#

Doing that will create an OnRep function for that variable - it gets called on clients and the server when the new value is received.

true stream
#

Ah great

dark edge
#

Specifically in BP it fires whenever it changes.
In C++ it's triggered by actual replication and does not run serverside

true stream
sinful tree
#

You use RepNotify variables for any variables that clients need to know about that should also trigger some functions on the client side.
You technically don't need to use an OnRep and could just use plain replicated variables, but then you don't have a function that gets trigger when the value changes, which means you'd need something running all the time if you need to do something based on the value changing.

true stream
#

Ah great then for this case is a good fit

feral spear
dark edge
#

with prediction, good luck

#

without, probably not too bad

feral spear
dark edge
#

I wouldn't want to try do that but if you can do it then great. If you're a good enough programmer to make a rollback system that works with that many units then you're good enough to make it performant

feral spear
dark edge
#

Its kinda rediculous

#

but if they know their stuff they'll tell you if it's impossible or not

#
feral spear
modest coral
#

so i am not sure do i solve it with log in ?

dark edge
#

I can't think of why you'd need rollback anyway but I don't know where your design is on the action -> RTS spectrum

modest coral
#

i mean it does not make sense

dark edge
#

Welcome back

feral spear
#

to be fair, James Anhalt is a pretty good programmer to say the least

feral spear
modest coral
#

why does it load mario if game 2 does not ?

#

well the issue is your connecting to my server that has Mario even you don't have it you some how loading Mario on your side ?

meager spade
#

Please keep your random chatter out of this channel.

true stream
modest coral
#

so yeah like i was saying do you load character on the server side ?

mossy helm
#

any good multiplayer blogs?

#

I have a problem that I mostly understand every concept alone but I still don't get how everything connect together and work

fossil spoke
#

Try looking through the Pinned Messages here

twin juniper
#

I'm stumped old_man_yells_at_unreal so when the client dies it is supossed to remove the HUD right? well no it removes the servers HUD (Not good) and when the server dies only the server loses its HUD (Good) anyway to fix that?

#

I've reposted this to many times to count I'm desperate please help someone 😭

twin juniper
burnt wadi
#

Hey guys, I was wondering what is the most common solution people use to get dedicated servers running on player request? (for example playfab)

sinful tree
# twin juniper I'm stumped <:old_man_yells_at_unreal:989354160925327400> so when the client die...

All this indicates is when you call the interface, it'd reduce the Current Amount of Players -1, and then attempt to call the Multicast which if executed by clients would attempt to remove the "The HUD" widget from the screen of the client that received the multicast.

That said, Multicasts can only be called by the server. The actor itself needs to be spawned by the server and marked as replicated for it to go through - guessing this is a GameState based on the name you have for it so this should be fine. "The HUD" variable would also need to be populated with an actual reference to a widget on the client, and if the multicast is successfully being called, but it's not getting removed, you'd probably have an error message indicating "None Accessed".

quasi tide
#

You also really only need to be removing the HUD locally. As it is an entirely local thing.

fossil spoke
burnt wadi
lost inlet
#

Though cloud is expensive so there are other game server companies that do their own custom thing too

burnt wadi
plucky prawn
#

You can probably get away with a vps to host your server. They are cheaper than a whole dedicated server, not sure how they compare to other services like playfab though. This is usually something you look at scaling once you have a product and a decent player base.

modest coral
#

anyone know a solution for player joining host loading the wrong players it seem my problem maybe comes from maybe character settings ? i don't have character selection maybe that will solve it ?πŸ’‘

lost inlet
#

But we definitely used a bunch of Vultr and DigitalOcean early on

#

Though Vultr once terminated one of our instances because of sustained high CPU usage and probably thought we were mining crypto

echo snow
#

Is this a normal interaction between a client charcter and a simulated physics cube?
The cube has Replicates and Replicate Movement checked. The client character gets stuck on it constantly when trying to push it

#

It's just a cube with these settings. There is no other logic, I don't understand why correction would happen unless unreals replication system can not handle physics

#

No special code going on in the character either. its the default character

carmine canopy
queen escarp
#

hey guys im still looking for a solution for this when im rotating my actor (client side) its verry stuttery
im RPCing the action, but the problem being as i was told is that the server cant catch up to it to the same time the client is doing it, but then the PMC is repliacted how would i use the PMC to rotate istead of RPCing like this ?

sinful tree
# queen escarp hey guys im still looking for a solution for this when im rotating my actor (cli...

This doesn't seem like a great idea as you're attempting to add a delta rotation which would likely result in things being out of sync across clients as there's no guarantees of when the multicasts will be received or that they would be received at all. Rather than multicasting, make the desired rotation a RepNotify property that ignores the owner for the replication condition, and rather than using a delta world rotation, just determine what the actual rotation should be, replicate that to the server and have the server set that value into your replicated property so that in the OnRep function it can just set the actor world rotation to what it should be -- as the property won't replicate to the owner, their own rotation will not be modified so they should be able to freely rotate without any stuttering.

queen escarp
#

hm

untold grove
#

Hi all, there is a problem with multiplayer. In the engine everything works, but here I throw the build to friends, sessions seem to be created, but they are not looking for others

queen escarp
#

@sinful tree ok im going to try that erhm

#

@sinful tree but how would i erhm

#

how would i ignore the owner ?

#

replication "skip owner" ?

sinful tree
#

There's "Replication Conditions" on properties. Yes.

queen escarp
#

hm ok

#

and @sinful tree

#

like this ?

unkempt tiger
native tapir
#

I'm planning to creating mobile game using unreal engine.
My game will contain multiplay contents and I want to know which services is good to implement about my cases.

  1. Authentication (Android)
  2. Session support (for P2P)
  3. admob and in app purchase

In this cases, which services is good to go?
I'm testing EOS (Epic Online Services) right now but I don't know this services is good for android and ios..

twin juniper
#

It removes the servers HUD when clients die (bad)

tardy fossil
twin juniper
thick vector
#

I have some enemies that only run on server, they are always relevant but when the client player is far from server player animation curves attached to enemies become null and GetCurveValue retuns 0 on server, I don't know why this happen and how the network culling works for the client, can someone give me a clue?

modest coral
tardy fossil
thick vector
#

Also the enemies already checked Always Relevant

tardy fossil
#

hmmm it might be something else other than culling causing it then

thick vector
#
Epic Developer Community Forums

I would like to use animation curves for providing control information to custom pawn movement component (using blueprint). When I call GetCurveValue on server for character who is far from listening-server’s character (out of sight), the blueprint returns 0. For example, if I use it as multiplier for rotation speed, it can’t rotate. So, all cli...

#
Epic Developer Community Forums

It appears as if dedicated servers don’t have access to the curves defined in an AnimMontage. Create an AnimNotifyState BP which has a tick function in it. The tick function looks up the curve value and prints it out. GetAnimInstance(Mesh Comp)->GetCurveValue(β€œTest”)->Print String. Create a Montage with any animation and add the above AnimNoti...

#

Both without answer!

echo snow
echo snow
#

So I found a workaround that produces less jittery results for the client without any code. I just wrapped my character capsule with another capsule that only collides with physics actors on the server side. This gives plenty of time for the client to move towards the object without actually colliding, but still applying force to that object

#

problem happens when there is no space and the physics actor is between the capsule and a wall so the client thinks there is room to move but there isn't

twin juniper
#

I'm attempting to set up a replicated UObject. I have a property that successfully replicates to clients when set through cpp. When I set this property through blueprint script however, it will not replicate to clients. Should I be expecting replicated variables setup in cpp, but set through blueprint to replicate properly? Or is there some sort of special code I would need to implement to allow a replicated variable on a UObject to replicate when set through blueprints?

#

Here is code from the meant-to-be-replicated objects header file. CounterTest is the property that will not replicate when set through blueprints.

// ControllablePropertyManager.h
    // Add replication support.
    virtual void GetLifetimeReplicatedProps(TArray< class FLifetimeProperty >& OutLifetimeProps) const override;
    bool IsSupportedForNetworking() const override;

    UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated)
    int CounterTest;```
#

Here is code from the meant-to-be-replicated objects cpp file.

// ControllablePropertyManager.cpp
void UControllablePropertyManager::GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(UControllablePropertyManager, CounterTest);

    // Add any Blueprint properties
    // This is not required if you do not want the class to be "Blueprintable"
    if (const UBlueprintGeneratedClass* BPClass = Cast<UBlueprintGeneratedClass>(GetClass()))
    {
        BPClass->GetLifetimeBlueprintReplicationList(OutLifetimeProps);
    }
}

bool UControllablePropertyManager::IsSupportedForNetworking() const
{
    return true;
}
#

Here is code from the class which creates the meant-to-be-replicated ControllablePropertyManager. This is in its header.

// ControllableCharacter.h
protected:

    // Called when the game starts or when spawned
    virtual void BeginPlay() override;

public:

    // Controllable Property manager. This is how I will replicate the object that is created on the server, over to the client.
    UPROPERTY(Replicated, BlueprintReadOnly, VisibleAnywhere, Category = "Controllable Properties")
    TObjectPtr<UControllablePropertyManager> ControllablePropertyManager;

    UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
    void InitializeControllableCharacter();

    // Add replication support.
    virtual void GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const override;
    void TestPrint();
};```
#

Here is the code from that cpp file.

// Called when the game starts or when spawned
void AControllableCharacter::BeginPlay()
{
    Super::BeginPlay();

    InitializeControllableCharacter();

    // Test if counter test is able to replicate via cpp code.
    if (HasAuthority())
    {
        FTimerHandle TimerH;
        GetWorldTimerManager().SetTimer(TimerH, this, &AControllableCharacter::TestPrint, 8.0, false);
    }
}

void AControllableCharacter::InitializeControllableCharacter_Implementation()
{

    // Construct the loadout manager.
    LoadoutManager = NewObject<ULoadoutManager>(this, ULoadoutManager::StaticClass());

    bReplicateUsingRegisteredSubObjectList = true;
    // Construct the controllable property manager.
    if (HasAuthority())
    {
        ControllablePropertyManager = NewObject<UControllablePropertyManager>(this, UControllablePropertyManager::StaticClass());
        ControllablePropertyManager->CounterTest = 12;
        AddReplicatedSubObject(ControllablePropertyManager);
    }    
}

void AControllableCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(AControllableCharacter, ControllablePropertyManager);

    // Add any Blueprint properties
    // This is not required if you do not want the class to be "Blueprintable"
    if (const UBlueprintGeneratedClass* BPClass = Cast<UBlueprintGeneratedClass>(GetClass()))
    {
        BPClass->GetLifetimeBlueprintReplicationList(OutLifetimeProps);
    }
}

// This code successfully updates and replicates the CounterTest variable.
void AControllableCharacter::TestPrint()
{
    ControllablePropertyManager->CounterTest = 20;
    UKismetSystemLibrary::PrintString(this, "Updated");
}
#

In blueprint script, all im doing is this. This code exists on a subclass of AControllableCharacter.

#

This variable set does not replicate. Even though if i do the same in cpp, it does replicate.

#

Checking the variable with this simple hotkey.

queen escarp
#

@sinful tree got any feedback πŸ™‚ ?

sinful tree
queen escarp
#

@sinful tree how would i do that ?

sinful tree
#

Change the variable type to a float rather than a rotator.

queen escarp
#

ah true

#

hm its not doing anything tho

#

what am i missing :/?

#

hm the value is changing but its not rotating :/

magic vessel
#

Maybe the actor rotation needs to be set on the server as well?

queen escarp
#

its being replicated

#

and run on server

magic vessel
#

What do you mean? That this behaviour doesn't work on a listen server?

queen escarp
#

huh?

#

i mean its being set on the server

queen escarp
#

hm yeah so its working on the listen server but not for the clienjts

#

should i rpc the function also ?

versed prawn
#

Where do you usually store each player resources?
Player state, controller, or character

magic vessel
#

Depends on who you want to be able to see those resources

#

Player state and character are replicated to all clients (plus server)

#

Controller only exists on server and owning client

regal moat
#

need help with a homing projectile. It does home but only towards its self when fired by the person who host and to the host when fired from whoever joins. I know how to switch it to the parson who joins but I thats if I change a 0 to a 1. the problem is I dont know how to change this depending on who fires. Im still researching things about it but If anyone has good advice Im more than willing to listen. currently Im thinking of using an array of locatplayers and going from there:

AActor* AAdrian_Projectile::FindTarget()
{
    TArray<ULocalPlayer*> LocalPLayers;

    if (HasAuthority())
    {
        APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);
        APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(this, 0);
        if (PlayerPawn)
        {
            ACharacter* PlayerCharacter = UGameplayStatics::GetPlayerCharacter(this, 0);

            if (PlayerCharacter)
            {
                SetInstigator(PlayerPawn);
                return PlayerPawn;
            }
        }
    }
    else
    {
        APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 1);
        APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(this, 1);
        if (PlayerPawn)
        {
            ACharacter* PlayerCharacter = UGameplayStatics::GetPlayerCharacter(this, 1);

            if (PlayerCharacter)
            {
                SetInstigator(PlayerPawn);
                return PlayerPawn;
            }
        }
    }
    APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 1);
    APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(this, 1);
    if (PlayerPawn)
    {
        ACharacter* PlayerCharacter = UGameplayStatics::GetPlayerCharacter(this, 1);

        if (PlayerCharacter)
        {
            SetInstigator(PlayerPawn);
            return PlayerPawn;
        }
    }

    return nullptr;
}

this method is called in Tick() whenever a projectile is fired

magic vessel
#

I'd recommend looking to into Net Roles, cause Player index 0 will always return the host when on the server. If you are calling this on the client, then their (client) player index will always be 0

#

So by doing it this way, if authoratitive target the host, if remote then target the host (assuming 2 players 1 host 1 client)

#

You could hold a ref to the targetted actor as a member property that is set on the server, and remove this entirely

#

So when you fire the missile, it passes through which actor to target

#

Cause by doing what you are doing each frame, never mind the networking, is going to be a massive performance hit

queen escarp
#

@sinful tree yo got a sec to se where im doing it wrong πŸ™‚ ? it works as listen but on clients nothings happening

raw thunder
#

Hello everyone,
I am trying to spawn a projectile with a InitialSpeed parameter.
Is it possible to replicate a variable with along the spawn of the actor? Such as the variable is already replicated when calling let's say PreInitializeComponents.

I spawn my projectile like this on the server:

ARPGProjectile* URPGGameplayAbility_Projectile::SpawnProjectile(TSubclassOf<ARPGProjectile> ProjectileClass, const FTransform& Transform, 
    const FGameplayEffectSpecHandle& DamageEffectSpecHandle, AActor* Owner, APawn* Instigator, float MaxPredictionPing, float InitialSpeed, float Range)
{
[...]
    ARPGProjectile* Projectile = GetWorld()->SpawnActorDeferred<ARPGProjectile>(ProjectileClass, Transform, Owner,
        Instigator, ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
    Projectile->DamageEffectSpecHandle = DamageEffectSpecHandle;
    Projectile->SpawnOnOwningClient = Role != ROLE_Authority;
    Projectile->InitialSpeed = InitialSpeed;
    Projectile->FinishSpawning(Transform);
[...]
}

And need to set the property InitialSpeed on the ProjectileMovementComponent before Begin Play, else it does not work. So I did it in the PreInitializeComponents

void ARPGProjectile::PreInitializeComponents()
{
    Super::PreInitializeComponents();
    ProjectileMovement->InitialSpeed = InitialSpeed;
}

Maybe my way of doing things is not right, can someone help me on this?

thin stratus
#

@raw thunder if you just mark the variable as replicated it should at least be correct on BeginPlay

#

Not sure about PreInit

raw thunder
#

Maybe I'm over-complicating stuff here. I just want to replicate a projectile on other clients, do you know how I can do it? With a InitialSpeed parameter

#

My Owning client has a Dummy projectile and do not see the "real" projectile which is spawned on the server. But I have issues with other clients

#

(The server is fine)

#

Maybe I should use the "Replicate Movement" on the projectile actor itself instead of the Projectile Movement on the other clients?

#

Ok here I managed to move the InitialSpeed on the BeginPlay updating directly the Velocity of the projectile and it seems to work fine. I can't find a good exemple on how to do it properly online :x Kinda new on this stuff.

void ARPGProjectile::BeginPlay()
{
    Super::BeginPlay();
    ProjectileMovement->Velocity = ProjectileMovement->Velocity.GetSafeNormal() * InitialSpeed;
}
swift turret
#

Any ideas why i have multiple different replication problems after server traveling (changing map) few times? Breaks many things, destroyed on server actors stays on client, some variables are not replicated. But overall all players still can play, shooti, win, loose. Its like only some things broke? There are never any issues with replications at the start of game, only after changing map few times (at least 6)

thin stratus
#

You probably have NetGUID related logs

#

More and more people are fighting this. It's been an issue since at least 4.26 or so

thin stratus
quiet cairn
#

hey folks, is it possible to blacklist certain console commands so they're not read from the ini files? i'm trying to prevent cheating in multiplayer

quiet cairn
# thin stratus For example?

r.Tonemapper.Gamma or r.Tonemapper.Quality or anything tonemapper related, really.
right now players can abuse it and make the night time maps look like daytime

thin stratus
quiet cairn
thin stratus
#

Bit dirty but might work

quiet cairn
blissful island
#

hi, im currently trying to make on the firstperson template shooting function to work on both the server and the client, but it doesnt seem to shoot from the client side. not sure if i need to do more than what i have but here is what i have currently in my c++ code. any ideas?

raw thunder
queen escarp
#

Hey guys Question, how would i make a Custom event that RPC, not fire on client also ? in this chase when i wanna play a montage and use the notify begin i think rpcing the montage to the server but localy use a nonrpc action or how would i do it ?

#

to optimize

thin stratus
#

You can't really. You can only locally filter to not play it twice

mossy helm
#

how do I generally remove a widget in a multiplayer game?

#

I want to remove it just for one player, the one who created it

#

not sure if this is right, but it's not working

dark edge
#

What is the ACTUAL trigger to remove the widget? You want this widget to go away..... when?

mossy helm
#

I was just making a box, when I touch it, it shows UI, when I go away, UI gets deleted

dark edge
#

Only for the local client right?

mossy helm
#

yes

dark edge
#

Then gate by that, IsLocallyControlled

mossy helm
queen escarp
#

@thin stratus wdym like is local player sumsum ?

#

like so ?

#

nah

echo snow
#

Is creating a component just for a single float a good idea?
For example I would write a class that has a replicated float and call it UReplicatedFloatComponent, then add it to my character and treat it as a stamina or health bar. And I can add as many components to my character as I need without having to write code for replication for each variable

#

I can maybe even create delegates to add extra functionality for when variable changes and for validation?

twin juniper
dark edge
#

All roads lead to GAS at the end of the day

echo snow
#

it really does, I think I should start learning GAS

thin stratus
queen escarp
#

@thin stratus

#

aye that makes sense -.-*

#

ty and im gussing is locally controlled is the one ?

thin stratus
#

Yes

queen escarp
#

its about the rotation

#

he suggested to use a repNotify and change it on the server only

#

it works for the host(listenserver) but not for the clients

thin stratus
#

Didn't I already say that a Character with a CMC uses the ControlRotation?

#

And that this is basically already replicated?

queen escarp
#

yeah well i dont get how i would use that tho :/?

thin stratus
#

AddControlYaw?

#

The same thing you'd do when adding Yaw rotation via Mouse

queen escarp
#

well its not being replicated tho :/

#

the CMC components are set to replicate also*

thin stratus
#

CMC doesn't need to be set to replicate. It replicates through the Character

#

What are you even trying to do? the Character should replicate Rotation just fine if using ControlRotation

#

That's how every First and Third Person character works by default

queen escarp
#

im just trying to change the rotation of the character

#

basicly move and steer with rotation instead of axis i suppose

#

i dont get it then why is it not being replicated tho rotation,

dark edge
#

is it using ControlRotation?

queen escarp
#

no

dark edge
#

What is it using?

queen escarp
#

its using my system or rather nothing atm then

#

thats the thing im using set actor rotation , thats it

#

and it works on host, not clients

dark edge
#

It'd be a lot simpler to use control rotation and NOT use it for your camera or whatever you're using it for right now

#

Do you only need the yaw or is there more to a characters rotation?

queen escarp
#

well basicly ive done a "world of warcraft controller" where using A,D rotates the charcter based on its own rotaion

#

and if you hold down RMB it rotates the camera and then rotates the actors Yaw based on cameras X,Y

dark edge
#

keyboard turning! nooo

#

jk

#

I'd use control rotation for the char

#

and something else for the camera rotation

queen escarp
#

i mean

#

well ive got everything working on the host side its just that it dosent work on the client side thats the issue

#

since i was RPC it before it was verry stringgy stuttering rotation on the clients

#

then i was suggested to use Rep notify to "set rotation" inasted

#

the weird thing is

#

the values are changing

#

(first one is Client) 2nd (server)

#

adn the repNotify is Skiping owner as condition,

#

hm.. if i changed the "skip owner" it acctually works

#

but verrrrry stringy

#

this is client

dark edge
#

I have a feeling you're fighting with ReplicateMovement probably

queen escarp
#

you know what.... i think i solved it

#

almost

#

since im repNotifying but skipping self

#

then i set the actor rotation locally ofc

#

then it worked for the running around and rotating

#

but the standing still with keybord input to rotate is not hmmm

dark edge
#

I think you're fighting the system too hard and should use ControlRotation for the character orientation and handle camera rotation on its own (optionally replicated if you must replicate a look direction)

queen escarp
#

well ive tried that but was unabvle to get that to work to -.-'

#

but i mean this runs smootly

#

just need to figure out why this standing still part wont work:/

#

its rotating on the server the client just not on the client for some reason

#

ok ill try the control rotation i suppose

#

use controller desired rotation only right ?

#

and pawn use rotation yaw* ?

dark edge
#

That should do it

queen escarp
#

yeah well that kinda cleared it

#

altho

#

if i need to add controller yaw,roll,pitch at the same time

#

is there a node to handle them all ?

dark edge
#

why do you need roll and pitch?

#

does your character lean over?

queen escarp
#

no

#

this part

#

im setting rotation based on 2 axis from the spring arm

#

so i need to include them when rotating

dark edge
#

what

#

this is WoW style movement and rotation right?

queen escarp
#

y

#

ill show u

#

so if i rotate the camera and then wanna start walking

#

it needs to rotate towards camera angel

#

basicly

dark edge
#

Mouse -> update SpringArmRotation
Tick -> is RMB held down? -> ControlRotation = SpringArmRotation
A/D -> add control rotation yaw

queen escarp
#

yeah i mean i got everything working

#

i just cant find the Set controller ?

#

set controller rotation

#

only each one individually ?

dark edge
#

target is controller

#

not pawn

#

get controller -> set control rotation

#

only on locally controlled of course

#

Tick -> locally controlled? -> get controller -> set control rotation

queen escarp
#

yeah well it works better

#

still not 100%

#

but i guess thats unachievable on BP

dark edge
queen escarp
#

i mean the rotation is abit cluncky

dark edge
#

the camera or the control rotation?

#

the control rotation should be butter smooth everywhere

queen escarp
#

kinda hard to show it

dark edge
#

Make sure you'd doing nothing with rotations beyond that

#

you should'nt have anything replicated etc right now

queen escarp
#

yeah im not

dark edge
#

basically default 3rd person character but you feed the values into ControlRotation differently

#

with RMB held down it's 100% the same

queen escarp
#

yeah some other stuff could be interfearing ill have to look at that but ty for help Aw

#

this is way better then be4 πŸ˜›

#

last thing tho

#

its not showing on the client :/..

#

ideas?

dark edge
queen escarp
#

Hm i have to go now ill try and solve it 2morrow otherwise ill dm u πŸ™‚ thanks for the help !

echo snow
#

Is replicating a number of individual floats the same as replicating a TArray<float> with the same number of elements?
Does TArray send the entire array on change, or just a float?

fossil spoke
#

Arrays will only send what gets changed

#

There is no guarantee that the arrays layout will be the same on client/server.

#

Never rely on that

echo snow
#

Where can I read about how tarray replication works?

magic vessel
#

What's the first stage on the player pawn that guarantees a valid player state on the server?

#

I know OnRep_PlayerState exists, but what's the equivalant with authority?

fossil spoke
#

APawn::PossessedBy

#

This calls SetPlayerState for the Authority

magic vessel
#

I'm having trouble with my widget component replicating

fossil spoke
#

They are cosmetic only

#

And exist locally

magic vessel
#

I know widgets don't replicate, I'm trying to replicate a widget component

#

In world space

fossil spoke
#

Well a Component will generally speaking follow its attached to Actor

#

If that Actor isnt set to replicate

#

Then the Component wont be either

magic vessel
#

Sorry if I come across a bit frustrated

#

It is the player pawn that it is attached to and both are set to replicate

#

I'm setting some variables on the widget component's widget instance, and that is what isn't replicated

fossil spoke
#

Ok well I just mentioned above that Widgets are not replicated.

#

I'm setting some variables on the widget component's widget instance,

#

Thats your problem

magic vessel
#

How can I update the widget on all clients, ideally without a multicast?

fossil spoke
#

Depends on what your trying to update I guess.

magic vessel
#

Player Name

fossil spoke
#

Why isnt the Widget reading that from the PlayerState?

magic vessel
#

It is, I have a component that holds that information

fossil spoke
#

You shouldnt need that, given the PlayerState already has functionality for PlayerName

#

Which is replicated

magic vessel
#

Here is the code that I'm using. It's being called on PossessedBy

if(HasAuthority() && GetPlayerState()->Implements<UPlayerProfileComponentInterface>())
    {
        UPlayerProfileComponent* ProfileComponent = IPlayerProfileComponentInterface::Execute_GetPlayerProfileComponent(GetPlayerState());

        if(IsValid(ProfileComponent))
        {
            UPlayerProfileWidget_Base* ProfileWidget = Cast<UPlayerProfileWidget_Base>(PlayerNameWidget->GetWidget());

            if(!IsValid(ProfileWidget))
            {
                UE_LOG(LogDevExercise, Error, TEXT("Profile Widget on [%s] is Invalid"), *GetNameSafe(this));
                return;
            }
            
            UE_LOG(LogDevExercise, Display, TEXT("Profile Widget  Cast to PlayerProfileWidget_Base"));
            ProfileWidget->SetPlayerProfileComponent(ProfileComponent);
        }
        else
        {
            UE_LOG(LogDevExercise, Warning, TEXT("Profile Component is not Valid"));
        }
    }
    else
    {
        UE_LOG(LogDevExercise, Warning, TEXT("Player State does not Implement Player Profile Component Interface"));
    }

fossil spoke
#

You are going about this backwards.

#

Your Pawn should not be managing the state of the Widget.

#

The Widget should be able to handle updating itself given the context it understands it to be being used in.

#

As a side note, why on earth are you using an Interface to get a Component, when there is literally a FindComponentByClass function.

magic vessel
magic vessel
fossil spoke
#

It also understands what Player its attached to

#

Your widget shouldnt need anything more complicated than this

mossy helm
#

how can I send data from server to client?
are there different ways? what are they?

#

I knew the OnRep one, not sure if there's something else

fossil spoke
#

@mossy helm A multicast RPC.

#

Or a Client RPC

#

You should read the Network Compendium

#

Its likely linked in the Pinned Messages for this channel.

silk thunder
#

Hello! I'm a little bit confused about player states, I currently have a variable for "AssignedTeam" in the player state, is there a way for one client to get the "AssignedTeam" value of a different client?

echo snow
#

With Fast Array, should I call MarkArrayDirty after I empty the array and repopulate it or right after I empty it (before I repopulate it)?

#

And does marking the array dirty eliminate the need to use MarkItemDirty?

fossil spoke
#

Then other Players can use each others PlayerStates to read the value of that property

#

@echo snow Good questions. I would think that just simply calling MarkArrayDirty at the end might be sufficient.

#

However, if that doesnt work, just call the relevant functions in order they expect.

#

MarkArrayDirty after you empty it, and then MarkItemDirty as you add the new elements.

echo snow
#

I'll try thank you

#

When we say the replicated array order might not be the same for client and server, do we mean that the network can screw up every now and then and not match up, or will it frequently be different from each other

silk thunder
fossil spoke
#

It might be in order, it might not be

echo snow
#

Oh I see, it's literally not even considered

fossil spoke
#

Nope

fossil spoke
echo snow
#

Replicated variables are sent to clients when they are changed on the server, does that mean I have to rely on RPC's from the client to initiate change in these variables?

fossil spoke
#

And by extension, affect change in variables that replicate to others, yes.

#

Clients can still change replicated variables on their side, but it is a local only change.

#

It will also only remain that way until the Server updates that variable again (because it changed on the Server).

echo snow
#

Thank you for the explanation πŸ™

silk thunder
fossil spoke
#

Replication isnt instant

echo snow
#

Does calling a Server RPC from the listen server use bandwith?

fossil spoke
#

Why would it?

echo snow
#

I'm not exactly sure how it works behind the scenes so it could've been either way as far as my knowledge goes

fossil spoke
#

The Listen Server is the Server. So calling a Server RPC on the Server just simply calls the function body.

echo snow
#

Got it thanks

#

I set up a fast array and it works so thank you for all the help :D

fossil spoke
#

πŸ‘

nocturne fog
#

Hello. I'm making a multiplayer game. On joining a session, only the host is responding to the input, not the clients. On top of that, both the client and host have the same character selected.

I'm maintaining the selected character in the game instance. Can anyone help me with this issue?

echo snow
#

Setting mobility has effects on server??
I have an area that deals damage when players walk into it. I was observing that only the client was taking damage. Setting the mobility of the sphere collision (the area of damage) fixed the problem and started dealing damage to the listen server as well. Why is it behaving like this?

thin stratus
upbeat basin
upbeat basin
#

I'm still looking for an answer or pointer to my design related question for PlayerState #multiplayer message

queen escarp
#

Can Someone explain to me how this works ???

i have a function that checks for accuracy Int value roll, if "Random int in range" is heger then true otherwise false,

#

but it always trues no matter what ??

#

or dose each line taken from the function calculate their own ?=

kindred gazelle
#

Each line is a new random int

nocturne fog
queen escarp
#

@kindred gazelle omg is that really so,,, so i have to store the value then

kindred gazelle
#

only for pure functions, impure it will be the same

queen escarp
#

wdym

#

this woill work ?

nocturne fog
#

As demonstrated in the video, while playing as standalone games, it works fine. As soon as I join the session, the client loses its HUD and controls. Only the host is retaining it's state.

nocturne fog
upbeat basin
# queen escarp this woill work ?

They meant storing the result of "Rand int in range" node. If there is no execution pin (white ones), it's a pure function. And pure functions are executed for each result pin connection. So the random int used on print and comparison might be different. If it's not a pure function (have execution pins, like your GetMeleeAccuracy function) the result (at the execution point) will be stored and will be the same value all the time. So if you want to debug your random integer you need to store that. Coming at your problem though, none if these are related with that, you need to debug and see what your accuracy and random int are to decide what's wrong

queen escarp
#

@upbeat basin thanks for explaining, however it was related to that since my print value was not the same that occured so its fixed now πŸ˜‰

nocturne fog
tardy fossil
#

is there a way to make a level thats loaded without the ?listen url become a listen server without reloading the map?

drifting furnace
#

can sm1 pls tell me in simple words when i should just do Run on Server and when i should do both Run on Server and Multicast

dark edge
river swallow
#

Is there an easy way to create a LAN between an android/oculus and a PC listen server? Just need one user of each, just a small

thin stratus
mystic estuary
#

Hello, has anyone implemented game pausing in multiplayer? I'm trying to do this for my game, but I have found an edge case. So, as I understood due to the latency server usually tells the clients the time the game needs to be stopped at. As I understand it's the UTC time, or something that we can rely on time wise. However, what if some client doesn't get the RPC notifying them about the pause in time? So, if I have some system that tells that the game will be stopped after 3 seconds, what if the RPC doesn't get to the client within that time limit? What will happen if the game will be stopped after it actually needed to be client-side? Might it break anything?

graceful flame
mystic estuary
#

But what I'm saying that it might not get in time if the player connection becomes extremely bad just for that moment. It's just hypothetical btw

graceful flame
#

but if its marked as reliable they will get it (eventually)

#

that's kinda the point of reliable, just remember not to use reliable on all your RPC events especially ones bound to user inputs or else they'll overflow the reliable buffer and cause themselves to disconnect

mystic estuary
#

I do understand that it'll get to the client at some point, but I'm asking what would happen if the client doesn't pause the game at the same moment as others?

graceful flame
#

So in other words its okay to use reliable RPC on events that MUST happen but not okay to use them on events that don't really need to happen and can probably be dropped without it affecting the game too much

#

What do you mean what will happen? Since the server is authority of what the game's state is all the connected clients are simulating whatever the server says. So if a client requests a pause via RPC and the server performs the pause you can multicast it out to all other clients using a reliable event. So therefore they all get paused.

mystic estuary
#

I don't wanna sound rude, but I do know how RPCs work, so you can avoid explaining them to me. So, I'll change my question a little bit. What will happen if the server pauses the game without notifying the clients?

graceful flame
#

Desync

#

The clients will try to keep playing but the server will keep issuing corrections so expect lots of jittery character movement

echo bough
#

iirc, client would chug hard

mystic estuary
echo bough
#

yeh

mystic estuary
#

But how is that a thing? Isn't the server paused? How would it rollback the clients position?

graceful flame
#

The frames keep running though

echo bough
#

tick is still going

#

its just not updating anything, game related

graceful flame
#

Gameplay is paused but ticks are still going

mystic estuary
#

Isn't the CMC game related though?

#

gameplay*

graceful flame
#

The client's character transform would be different and so on the next frame the server would be like "hold up...you're cheating! I'm going to roll you back to the correct position".

winged vault
#

How do I replicate buoyancy smoothly? It works fine in standalone, but when I run it in a netmode client it's all jerky

mystic estuary
#

Is there any good way of testing the pause properly? I've tried to test in viewport PIE, but the clients get paused regardless, even if I don't send any RPC

graceful flame
#

I haven't really dug all that deep into pause but I think client's can pause their own simulation but in a multiplayer environment other connected clients would see that paused client in an unpaused normal state.

#

aka desync

#

So that's why most multiplayer games don't allow clients to pause themselves

#

Because its just a pointless desync me button lol

mystic estuary
#
bool APlayerController::SetPause( bool bPause, FCanUnpause CanUnpauseDelegate)
{
    bool bResult = false;
    if (GetNetMode() != NM_Client)
    {
        AGameModeBase* const GameMode = GetWorld()->GetAuthGameMode();
        if (GameMode != nullptr)
        {
            bool bCurrentPauseState = IsPaused();
            if (bPause && !bCurrentPauseState)
            {
                // Pause gamepad rumbling too if needed
                bResult = GameMode->SetPause(this, CanUnpauseDelegate);

                if (AWorldSettings* WorldSettings = GetWorldSettings())
                {
                    WorldSettings->ForceNetUpdate();
                }
            }
            else if (!bPause && bCurrentPauseState)
            {
                bResult = GameMode->ClearPause();
            }
        }
    }
    return bResult;
}
#

Doesn't seem to be the case

#

I mean, clients cannot pause

graceful flame
#

I thought there was some project settings override for it? maybe not

mystic estuary
#

Yeah, but still GameMode has another SetPause function, and GM exists server-side only

graceful flame
#

Maybe that's for singleplayer games then, that's probably what I'm thinking of

thin stratus
#

Server itself can't pause, unless ListenServer. Pretty sure there is a ServerRPC somewhere though. Game can only be paused for all or none and the pausing player is saved

mystic estuary
#

Pretty sure there is a ServerRPC somewhere though.

APlayerController.h

UFUNCTION(reliable, server, WithValidation)
ENGINE_API void ServerPause();

Are you talking about this one?

native sparrow
#

sorry if this is a basic/common question but... in UE4, are all communications done on a single thread? is it different in UE5?

fathom aspen
#

Afaik it's all done on the game thread. Iris is trying to do it in such a way where replication is on a separated thread

native sparrow
#

and with a multiplayer game, all those updates are going thru the central point that is the server

#

which group would be the best group to post to regarding synchronizing objects across multiple clients?

fathom aspen
#

Group? You mean channel? This one.

You don't need to go low level to understand how to do synchronization. Unreal engine already has an inherent support for that. All you need to do is read through the channel pins to know how to do it properly

fathom aspen
native sparrow
#

my understanding is the communications are done over a single thread, which would definitely bog down if not optimized

fathom aspen
#

Of course, since why you need to integrate some optimization techniques. Unreal engine peformance multiplayer optimization doc page is a good start.

modest coral
#

anyone know about index replicated to a different client?

frozen wraith
#

Do I need to pay the fee for a game in order to use the Steam SDK just for testing with friends etc?

modest coral
#

sorry cant explian any better is just out the box to much to explain

#

i even del the BP and as soon i join host shows both

#

if it load from the host always then i cant do this and wont ever work

#

another way to see it if, i have 5 guys one client another client will have 4 ...who ever does the host decide the char to be chosen ?

#

and amount...

#

from my testing

#

but i want...host 5 and player client that has 4 wont use 5 ....that!!!!!

#

.. the end

dark parcel
winged vault
dark edge
#

Is your water surface perfectly flat or dynamic?

frozen wraith
dark parcel
#

you will have to play via steam

#

but you don't need to upload a package to steam, no

winged vault
dark edge
#

turn waves off, get it to work with perfectly flat ocean for now

#

the physics replication settings in project settings are what you want to tune, they are very strict by default

#

Does it look like it's hard snapping/correcting all the time?

winged vault
dark edge
#

Try waves off but dropped from a height so it does some drastic movement

#

like you just dropped a boat from 2 floors up

winged vault
#

It’s not correcting. It’s just jerky rather than smooth

dark edge
#

show your physics replication settings

winged vault
dark edge
#

I'm assuming this system replicates through the physics replication settings, dont' quote me on it

winged vault
versed atlas
#

how would i get this to work on my other client?

dark edge
#

they're project-wide

dark edge
#

Widget can't network, client can't possess.
You need to go Widget -> SomeClientOwnedActor -> ServersideVersionOfThatActor

versed atlas
#

ooo okay

#

thank you

winged vault
dark edge
#

This is basically an error-based system that nudges the local bodies to align with the replicated data from the server over time

true stream
#

Question, I notice many variables I add to actors I need replicated dont need to be marked as replicated, it works just fine, so, in which cases do I need to explicitely mark a variable as replicated?

winged vault
#

But thank you

true stream
dark edge
#

But it works pretty well.

dark edge
#

If Mario always spawns with 100 hp, it's not suprising that he has 100 max hp on both machines

#

but it's not guaranteed to be in sync, he may miss a buff locally but get it on the server, giving his serverside version more max hp than the local one.

true stream
#

or depends on what my game does

#

for example if I want my currentHealth to update the widget hp bar I need it to be repNotify

#

something like that

dark edge
#

I'd always replicate what needs to actually be kept in sync and has some mechanic to actually change

true stream
#

what about current position? is that replicated by default?

#

Im moving the actors on tick

#

seems to work fine without it

dark edge
#

I would certainly replicate position in some way unless you're doing some sort of deterministic lockstep thing

true stream
#

So I guess by default it is

versed atlas
#

i guess i didnt understand @dark edge ahahaahaha

dark edge
versed atlas
#

player controllers are client owned though right?

dark edge
#

ok first step, in the on clicked event, call some event on the local playercontroller

lethal girder
#

Hi, I'm tring to add a float or int32 value (instead of flags) to my custom CMC network data, did anyone already managed that?
I tried adding my var to FSavedMove, pushed the int onto the serialization array then in MoveAutonomous i've updated the server side int with the one coming form the network data, but still not getting it...
There are any blogs or tutorials? Thx

cosmic badge
#

alright, I finally hit my breaking point with this crap, I can't get seamless travel to work correctly, it seems related to this bug, and I applied there solution, but still when I join a session, I don't move to the correct level, and then it eventually just times out, I'm using 5.2, anyone got a clue how to fix this?

heres the solution/thread about the issue: https://forums.unrealengine.com/t/ue-5-1-steam-sockets-problem/696726/32

Epic Developer Community Forums

It looks like an issue has been opened for this. UE-174140 Unreal Engine Issues and Bug Tracker (UE-174140)

#

for context, my specific issue is I join a session, I see the player connect on the server in the log, but they never get a controller or state, and the client never loads in the servers level, just sits on the main menu and reports timeout errors

#

scratch that, now I can't seem to get ANY travel to work.

fossil spoke
#

@cosmic badge Make sure that you are calling Super:: in all your functions. These sorts of oddities can be caused by the most inocuous issues. Such as forgetting to call Super::

cosmic badge
#

ugh, god ignore me, I'm stupid

#

my second computer didnt recompile source

#

what a headache, at least it works now

#

something to note ,those cvars were required to get it to work so yea steam socket is messed up in 5.1-5.3

hollow saffron
#

any way to get DestroyComponent to propagate in multiplayer?

#

calling DestroyComponent on the server doesn't remove the component on the clients

hollow saffron
#

yea

dark edge
#

show your code

hollow saffron
#

` UStaticMeshComponent* InitComponent = NewObject<UStaticMeshComponent>(Outer, Name, RF_Public | RF_Transient);
InitComponent->SetStaticMesh(StaticMesh);
InitComponent->SetIsReplicated(true);
InitComponent->SetCollisionProfileName(FName(TEXT("Lootable")));
InitComponent->Mobility = EComponentMobility::Movable;
InitComponent->bNavigationRelevant = false;
InitComponent->ShadowCacheInvalidationBehavior = EShadowCacheInvalidationBehavior::Rigid;
InitComponent->SetGenerateOverlapEvents(false);
InitComponent->SetupAttachment(ParentComponent);

        InitComponent->RegisterComponent();`
#

i see it on the client, so it's replicating

#

stepping through the code, I'm not even seeing anything that looks like it would be responsible for propagating the deletion of a single component of an actor

keen thorn
#

Anyone has experience in how to make a character vs physics simulated object feels smooth across network? I have tried fixed timestep as well as the new physics prediction experimental feature. But whenever i run towards a box client side it would stop my character then a bit later shoot the cube flying. When playing standalone the cube gets pushed smoothly as expected.

native sparrow
#

if it looks normal from the bystander-client then you're seeing the object created (2*server-ping) ms after you fired it.

mossy helm
#

I made this code and it's working, but I don't know why/how it's working, can someone please explain to me what does it exactly do?

#

the begin quest ros event is being fired from a button in a widget (on click button event)

latent nest
#

Any tips on how to do multiplayer using steam. I’ve followed basic tutorials and stuff to get it where you create servers yourself and look for servers, but I want to get more advanced. I want to make it like all the big games, where you search and that’s it. How do I do this?

keen thorn
keen thorn
#

and i test in editor as well

lost inlet
frozen wraith
lost inlet
#

but if you want to pay the $100 you can have your very own app ID and distribute via steam

frozen wraith
lost inlet
#

there aren't any OSS BP nodes built into the engine, and I would class it as a C++ job, but there are third party plugins like advanced sessions

frozen wraith
cunning moat
#

So I have a few questions as I am working on a design document though not super familiar with several of the new things that UE5 brings, With the new level streaming and nanite landscaping. At what point would a multiplayer game like say rust/ark become to much for it to handle or would it at this point be solely on how good the server is? (I guess I should ask this here as well.)

frozen wraith
lost inlet
#

you vaguely referred to some warnings

#

without specifying what they are

cunning moat
#

I guess I should also be less vague lol I'm worried specifically on player/npc count

frozen wraith
#

ah, well I kinda just spotted them as I was reading through some forums on this whole steam ordeal and I've kinda forgotten what it said exactly. But I guess if it's not a wide practice to not use 5.2 for multiplayer it may not be as big of a issue. I'll see if I can find the page where it stated the issues though

lost inlet
#

but 5.3 has a hotfix or two so it should be safe enough to upgrade, just as long as you use source control

frozen wraith
frozen wraith
lost inlet
#

yes

#

every day you don't look into it, the greater the risk

frozen wraith
lost inlet
#

losing your project

#

or part of it

frozen wraith
#

so what source control should I use ? I have Github but I'm newb at it lmao. I see a bunch of different options when I google it πŸ˜… overwhelming lol

rich dune
#

Hey, I'm running into a strange issue with animation changes in Multiplayer. I have simplified it as much as possible for testing. A Player in an Multiplayer game can get knocked down and changes the pose. Other players should be able to kill him or revive him.

The issue is, the hit boxes are sometimes messed up. If the player knocked down did not move while getting knocked, everything works fine. If he moved, it's not possible to kill him or revive him as the hitboxes seam to be totally of (HitBoxes = Physic Asset).

The strangest part is, sometimes it does fully work.

Any ideas whats going on?

lost inlet
#

git or perforce

frozen wraith
lost inlet
#

for git, azure devops has a better offerring than github

frozen wraith
#

I can't afford to pay anything atm tho, I didn't see any free plan with Azure

lost inlet
#

it's free for 5 users

frozen wraith
#

ahh

frozen wraith
lost inlet
#

I'm not sure how that is relevant. people use gui clients, some people use the cli

frozen wraith
#

well in UE, git needs a path for git exe

lost inlet
#

I guess using the in-editor integration is a bit more optional since you can just stage the files from your normal git client

#

it's a bit less optional for perforce

frozen wraith
#

starting to feel like daily backups is way less of a pain than this πŸ˜…

rich dune
upbeat basin
#

I have two design related questions

  • There are 2 different player roles in the game and I would like to store their specific state related variables in PlayerState so we can use CopyProperties and OverrideWith. However I don't like the idea of having a single PlayerState and having 2 different set of variables where one of the set won't be ever used for that PlayerState. What is the common solution for this, is it possible to have different player states for different players? Is it logical to do that if it's possible? Should I go with another way?
  • Related to above question, there are components which kind of defines the actions and abilities of players according to their roles. On the demo we added those components to Character, since that's the Actor with mesh that players interact with. However they also store some state variables in them, Inventory for example, holding references to items that player carries. And we would like them to be handled on reconnection as well. Would it be better to add those components to PlayerState? Or should there be a variable/struct that stores information about the components on Character and we should assign them back to the components on Character once player reconnects?
lost inlet
#

Since you only have a snapshot

#

So if something breaks without you realising when you make a backup, how do you track the culprit?

frozen wraith
#

well setting up perforce and azure proved more than a challenge and overwhelming to me. I got SC sort of working with github, my files just won't appear in my repo

#

like I got git to connect to SC, I connected it to my repo url but no dice

frozen wraith
#

not sure, is this done in UE? is it the Submit Content option?

#

yea i've done it a few times. still can't see anything on the repo though. I'll move over to that channel.

azure vessel
#

Hey Guys! I'm trying to make one, randomly selected character out of 3 display a ui widget. I'm a beginner and right now it looks like this- sometimes returning 1 or 2 random selects or none at all..

mystic estuary
#

btw there's a Random node in the array

azure vessel
mystic estuary
#

Yeah, that will work. Did you understand the part about the indices though?

azure vessel
mystic estuary
azure vessel
mystic estuary
#

The original approach has the same flaw regardless of the amount of players.

Subtracting one from the Length would yield the same result as using Random node, which is just more convenient/shorter way of doing what you were trying to achieve.

azure vessel
#

because i thought that i'm only selecting one controller out of the array

mystic estuary
#

I don't get you. Do you want every player to receive some UI on the screen?

azure vessel
mystic estuary
#

There are many approaches to do that depending on your needs.

One way of doing that is by having different character blueprints. In that case you would need to spawn players manually rather than leaving it up to the engine. You would need to remove a default pawn from the game mode settings, and make so that at some point in the game, which can be the game mode begin play, you would iterate though all the present players in the game, and assign them a character class (create a character class property in the controller). After you do that, you would need to somehow make use of that, which could be GetDefaultPawnClassForController in the GameMode.

After the randomization is out of the way, all you are left with spawn wise is spawn. All it takes is calling RestartPlayerAtPlayerStart, which is a GameMode function, with every player.

#

However if you aren't familiar with the Unreal framework yet, you shouldn't be trying to make multiplayer games, as it has a pretty high entrance level. It's too frustrating for a beginner to deal with multiplayer

azure vessel
mystic estuary
#

Oh, all right, I didn't mention the core idea. Following my "separate character blueprint per character type" (which can be edited anyhow you like, I'm just trying to give a clear idea) you would have CreateWidget with the UI related to that character type on its BeginPlay.

Using one single character blueprint for every character type supports that approach as well, but it has to be edited. Here's a dead simple example. It's far not the best, but it's meant to give you an idea πŸ˜„

azure vessel
mystic estuary
#

It's the character blueprint

azure vessel
mystic estuary
#

Anywhere that works for you. Since it's something all characters initialization related, perhaps it should be inside the game mode. When the game starts, you iterate though all the players, and assign them a role

#

The role should be assigned either to the player controller or the player state depending on your needs. If only the owning client and the server needs to know the role, the player controller should have it, as it's not replicated to others. If everyone should know that, then player state is the right place, as it's replicated to every player

#

However the example I sent would make the project difficult to extend exponentially. If you'll have 10 character types, you would have a switch with 10 different output for everything, not just UI.

A far better approach is creating data assets called CharacterDefinition or something containing the character related data, and then dispatch it in the character blueprint or anything that suits your needs. The CharacterDefinition would have the widget class the player should see upon starting, what skills the character has etc.

#

Again, it all depends on your very own project

azure vessel
#

Yeah, i'm only having two different types, so i will keep it simple πŸ˜…

honest bloom
#

anyone has an idea how can I Auto-respawn my character when out of bounds ?

frank birch
#

from just a server authoritative teleport to a server authoritative kill the son of a gun and respawn it πŸ€”

mystic estuary
honest bloom
#

uuhh .. but I really wanna do it from the game mode as the player should only stop respawning if he died X number of times

#

I could easily just trace or use the onDestroyed on the actor as you said, but I wanna try making it properly

#

unless this is one of those cases where there is no proper way of doing it

shrewd ginkgo
#

are there anybody knows turkish? If you know can you pm to me? I dont have good english

honest bloom
shrewd ginkgo
#

ty

mystic estuary
queen escarp
#

Question About Rep Notify

#

if i call a Rep Notify like this but the function is empty inside

#

Will it set the "target Actor" variable to server/rpc anywayws ?

pallid mesa
#

Variable replication isnt related to RPCs, RPCs is one thing, variable replication another

#

If you dont need logic to fire when the variable replicates to the client, dont make it an onrep, make it a normal replicated variable

#

and yes, even if its empty, it will set the target actor in the client and server, as long as u set this variable in the server

queen escarp
#

ah ok thanks

#

yeah im just testing around since im debugging

#

but i think i found the issue

#

i have a Actor Commponent on a Parent class, and both the "server/Client" is getting the reff to the same character

#

wich is weird since im doing on owning client :/

#

and that worked for me before

pallid mesa
#

there are 2 things wrong in your code

#

beginplay already gets called in the client so no need to RPC anything

#

and 2nd, you shouldnt set replicated variables in the client

queen escarp
#

hm

pallid mesa
#

replication goes in this direction

#

server -> client

#

so setting replicated variables should be only done in the server

queen escarp
#

yeah that was my mistake*

#

y i know