#multiplayer

1 messages · Page 181 of 1

graceful flame
#

then you'd just modify the state for bp_box with id 25

lament flax
#

sorry if i sound rude, but from my point of view you are not answering my main question

graceful flame
#

i am tho

lament flax
graceful flame
#

you'd use the ID to target which box you want to change collision instead of having to make a unique channel

lament flax
#

because both have issues

#

server :
client 0 and all other clients will have the same access to box 25 than client 1
client :
the issue i have rn

graceful flame
#

always have the server as the authority and the client should follow (but can also predict correctly to help out with lag compensation)

lament flax
graceful flame
#

listen is still the server tho

lament flax
graceful flame
#

what's the issue?

lament flax
#

if you run on server :
for the collider of id 25, disable collision

all clients can now go inside box 25

graceful flame
#

So if you just want a specific client to go inside of box 25 but not others then you just need to expand the system a little bit so that you have an ID for the client as well. Then you can make an access list something like:

Box 23 - None
Box 24 - None
Box 25 - Player 7
Box 26 - None
Box 27 - Player 4

lament flax
#

you are not explaining the collision part

#

how do you deny/authorize a capsule to overlap within a box using those infos

graceful flame
#

That list would be replicated to all clients and would be used to determine IF the collision should change. So say there's a hidden box collider positioned just in front of the cell bars and OnBeginOverlap it calls some event "CheckCollision" with the box id and player id as arguments. Then you could check incoming data against the access list stored on GameState and adjust accordingly for the actor that triggered the event.

lament flax
#

this wont work
if multiple players are inside/outisde and gets in/out this would fk up

graceful flame
#

no because you'd set it up to only change the collision on the actor that triggered the event if the box id and player id are valid according to the access list

#

if theres other players inside of the overlap area then they'd just fail the check silently and nothing would happen

lament flax
#

i see what you mean

#

ill try that

#

this way i would only need 1 custom channel

graceful flame
#

yes exactly

sweet sage
#

if (GetMesh()->GetAnimInstance() && GetLocalRole() == ROLE_SimulatedProxy)

Why does it returns true for game server?

#

Under editor

#

Are not simulated proxies a client only thing?

#

I think it is a problem of Iris networking somehow

honest hinge
#

If it's advised to handle animations and sounds on the client, notify the server, then have the server play those same animations and sounds for the rest of the clients, how do we avoid playing an animation or sound twice on the client?

thin stratus
honest hinge
#

Right, but what does that look like in terms of implementation?

thin stratus
#

Depends on what you got so far

quasi tide
#

I typically just check if the role is autonomous

thin stratus
#

Yeah or IsLocallyControlled()

quasi tide
#

There is a PR out there that adds support to filtering RPCs

#

So you could skip some connections for an RPC

#

Which would be another way to solve this problem in some scenarios.

thin stratus
#

For filtering local client that shouldn't be tooooo complex

quasi tide
#

Yeah @magic helm did the work

magic helm
#

I have been summoned?

quasi tide
#

Just talkin' about that RPC PR you did that is probably sittin' in limbo right meow

magic helm
#

Ehhhh semi limbo... basically somebody at Epic is aware but its one of those "Anybody thats tasked with looking at it doesn't wanna do it because of how significant it is" since it impacts perf for BP across the board

honest hinge
#

But if I execute an event on the server by checking that it has authority or is the server, that just happens for everybody, right? So how do you actually filter the client that triggered the event out?

quasi tide
#

There are only ever 2 situations you'll be in:

  1. Client plays animation and then does a server RPC to tell everyone else to do the animation - for this, you'd just do what cedric and I said
  2. Server tells everyone to play an animation - the animation hasn't played anyway, so the client needs to play the animation.
magic helm
honest hinge
#

I appreciate the help. I don't really get how the filtering would happen, but I'm working with blueprints so maybe that's where my confusion lies. Maybe less granular control of how replication happens? I'm not sure.

magic helm
# honest hinge I appreciate the help. I don't really get how the filtering would happen, but I...

So pretty much the thing(object) that handles UE's replication/RPC's is something called the Net Driver. Its like the brain of it all. And thats where we have all the connected clients(on the server). And each client is an object called a Net Connection(literally thats the name of the object without C++ syntax). Every actor has a variable for its Net Connection which is the owning client. That variable is only valid on the owning client and the server(because on the remote machine its a Net Connection to the server instead). The net driver just then is filtering the same way you would check through an array of actors by getting the actor's Net Connection variable, and then iterating through an array of Net Connections

#

Hopefully that makes sense?

muted ravine
#

i guys i want to create a loading screen to my host game button from the gamedevraw mp game tutorial and like this it doesn't host the game

#

and like this it doesn't show the loading screen

honest hinge
# magic helm Hopefully that makes sense?

Yeah it does, thanks. But in terms of actual control flow, let's say I have an actor that does something requiring a sound to play. That actor plays the sound locally, then triggers a custom event that is set to run on server. In blueprints, that's all I get for control over that process as far as I know. I'm not aware of a way to iterate through the list of connections and handle the event for each client while making sure to exclude the original owning client.

magic helm
maiden flame
# honest hinge If it's advised to handle animations and sounds on the client, notify the server...

If you are working with Blueprints, you can use a RepNotify with Replication Condition SkipOwner/SimulatedOnly. Trigger the animation and/or sound inside or via the notify function on the client (locally), and also call the RepNotify function on the server using a Run on server RPC.
Then the notify will be called predicively on the owning client, and the server will run the function on all clients except the owner/autonomous proxy.

magic helm
maiden flame
#

Ah, that's a fair concern. I don't know any better ways to do it with Blueprints only though. Doesn't it depend on what you're doing with the notifies, or does it just cost a lot to compare the properties anyway?

magic helm
#

It costs a lot just comparing the properties, the literal "Does this equal this" check

#

For smaller games, its not a problem. But depending on the game, it can hit you hard

maiden flame
#

Yeah, makes sense. I did some profiling, and the CPU for the replicated properties didn't really stand out to me.

magic helm
honest hinge
#

It sounds like best practices for multiplayer replication are most easily doable via C++. I guess I should get around to figure out why VS doesn't recognize UE namespaces

quasi tide
#

Because you need Resharper

#

C++ in UE is unfortunately, very much, a pay-to-play type deal

magic helm
#

Naw its just more tools in the toolbox, you can build a game with 90% BP for multiplayer and with all the game code being in BP. Its dependent on the game

#

Rider all the way

honest hinge
#

I feel like for a coop/sandboxy game, going the repnotify route might be fine. Latency/server performance won't be as critical as a pvp shooter like Valorant

quasi tide
#

If you're doing a dedicated server, it can. If nothing else, for cost alone.

magic helm
quasi tide
#

Not saying it is a must - but it isn't as cut n' dry as "is this pvp or not".

magic helm
#

This same paradigm was used by WatchDogs 2, its not a "This is a closed env FPS game" this is a "Its a online multiplayer game" paradigm

#

Cod Warzone is fighting the same issues, thats why their servers crash so much on launch

quasi tide
#

Hopefully Iris can help in this regard as well (not something you should be worrying about right now miles!)

maiden flame
#

What's a better way to replicate game critical animations if a RepNotify isn't optimized for CPU? Is the way GAS does it more optimized?

honest hinge
#

Oof. Okay

honest hinge
magic helm
#

BTW the biggest CPU impact after you build it that way has always been animation lol

#

Sea of Thieves talked about that where they were bottlenecked by animation CPU time as well... haven't found a project that hasn't fought that bottleneck... physics objects ontop of that is a double layer cake of pain

quasi tide
#

Animation is just pain

#

Wonder if there has been any more movement for AnimNext 🤔

honest hinge
#

So like, mapping small primitive data values to specific animations/sounds?

maiden flame
#

I guess I'll change my suggestion to just use GAS xP

honest hinge
#

What's GAS?

quasi tide
#

Something you put in your vehicle so it can go from A to B

magic helm
#

BOOOOoooo

quasi tide
magic helm
quasi tide
#

The TLDR is - think like RPGs/MOBAs abilities

#

Allows you to easily create that kind of stuff

#

And you can get quite general in what is an "ability"

#

Like, in Fortnite - shooting is an "ability"

#

Jumping is an "ability"

#

Stats and modifers as well

magic helm
#

It was made for Paragon and then used in Fortnite. Its a great base framework don't need to use everything and it does not solve all your problems

#

But it has good paradigms

#

The best part of GAS really is the Gameplay Tag system. LOVE IT

quasi tide
#

And you don't even need GAS to use that

magic helm
#

use gameplay tags everywhere

maiden flame
fossil veldt
#

Is anyone using Mover successfully with Iris? I noticed that as a client the state machine seems to be fucked and I get many warnings about network prediction proxy having descriptors generated

#

weirdly it works if you're the server or standalone

grizzled rune
#

You can override that function and

orchid eagle
#

Hey there so im having a issue im trying to call a function that i have to apply damage in my AI
so i run it from an anim notify which does run the function but it would only run on client i tried making a event and make it on server but it would just ignore it i even tried to run the event and the function after the multicast event that has the play montage but still the event gets ignored and the function would run on the client and would return damage as 0

neon summit
#

does repnotify fire on beginplay or when that pawn is possessed automatically?

sinful tree
neon summit
#

Okay. I was just wondering if it would get fired twice since I'm repnotifying before I possess and new pawn and when I reenter the pawn. I knew it fired when actor spawns but wasnt sure if I would be firing twice

sinful tree
#

If you're doing it in blueprint, then setting the value could cause the server itself to fire that repnotify.

neon summit
#

Yeah, I'm trying to figure out why attaching character to vehicle works the first time but not after exiting vehicle and trying to get back in still

#

even though the rep functions firing with correct values

orchid eagle
stoic lake
#

Does a RepNotify also automatically update the value for the clients or do you need to set the value in the OnRep function

neon summit
blazing socket
#

Question: What's the best way to handle player indices in multiplayer (non-local)? Should I just add them into an array/map on postlogin in the gamemode? But then what about handling disconnection/reconnection? Basically I am asking if there's already a structure in place for handling/storing this information built in.

Edit: The reason I need this is because I'd like to spawn objects and assign them to player X at the beginning of the game, so I need some way of determining that you're player X.

neon summit
#

I think you answered your own question

ashen plume
#

server seems replicate adding components before destroying components regardless of call order, is there any way around this to guarantee the intended call order?

blazing socket
ruby lodge
#

i am calling this Run on server event which sets an OnRep variable inside a for each loop. The problem I am having is that the clients only call the onRep function after the for each loop is finished, so once. I would like the clients to call it each time after each set of the OnRep variable. How can I achieve this?

dark parcel
#

The client will call OnRep function whenever the variable in their machine changed in value.

#

There is no time you can measure , it depends on latency etc

ruby lodge
dark parcel
#

What are you trying to do?

ruby lodge
#

for each loop this setup updates a trait of the character component with the customization items stored in the save game

dark parcel
#

Who's save game?

ruby lodge
#

DT stands for data table

#

I have this handled, everything is working and replicated besides that the clients are not calling the OnRepNotify function directly after the server and instead after the for each loop ends

#

can't I force the server to wait with the next loop until the clients ran the OnRep too?

#

or call something to make them run it right after the server did

dark parcel
#

Loop happend in a single frame anyway

worthy oak
#

No and you probably wouldn’t want too 😂

#

imagine the server waiting for a client to do something CHAOS I SAY

dark parcel
#

Your appearance can be as simple as replicating the skeletal mesh comp.

Data loading is handled server side

#

In the server you will set the skeletal mesh comp (replicated) after loading from w.e data u want

#

Client will simply receive the updated skeletal mesh

#

For my case, I have my client sending info for it's custom. My game is listen server with no concern of cheating.

#

So client read its save file, send data to server.

Server load the data and set the skeletal mesh

worthy oak
#

I’m not sure if you own it, but universal character system does something very similar to what your trying and it’s replicated

dark parcel
#

Actually scrap that, that's not what I did

#

I replicate a struct

#

Loading is handled on client side

worthy oak
#

Now I’m changing some of this, but they have a map that lets you customize your character and store a string of info to a save game

worthy oak
#

At run tkme that string is pulled from save game and replicated

ruby lodge
#

but I don't own it, no

worthy oak
#

Sounds like ya don’t need too if you already doing that haha

#

Now they are using a component to handle this that is replicated

#

That might be the difference not sure

dark parcel
#

Maybe you can wrap appearance dt and ID in a struct.

On the struct OnRep. Load your appearance data

ruby lodge
#

the same setup inside the character blueprint does work. There it doesn't make weird things and actually calls the onrep for each client after the server runs it every time

#

but for this case i need it inside the player controller

#

and it does work for singular changes in the customization tab

#

but the for each loop is being weird

ruby lodge
#

does the OnRepNotify fire even if the setted value is the same as it already is?

proven pagoda
#

I believe repnotifies only call when the value changes

ruby lodge
dark parcel
#

I would sync customisation data via a struct.

Struct changed -> load customisation data. Call it a day

dark parcel
#

Client don't care about the for loop what so ever. It just do something when the replicated value arrived

worthy oak
#

A string like they are doing is honestly probably better

proven pagoda
#

Is this blueprints or cpp

worthy oak
#

Exspecially if they wanna back that up to a DB down the road

dark parcel
#

You should start testing your project with ping too

worthy oak
#

But I suppose different ways to do it

ruby lodge
#

that's why I went with string

#

and it is working like a charm in every way whatsoever so far

worthy oak
ruby lodge
#

Like I have said, the string is changing

dark parcel
#

Because u won't have race condition if you need both the DT and string

#

And u can handle the loading in one single function

proven pagoda
#

Are you doing all of this in a single frame?

ruby lodge
#

yea

proven pagoda
#

Ok when I have issues with stuff like this I make timer loops

#

You need a short delay like 0.1 seconds

#

You need to allow time for the replicated variable sometimes to exist for a few frames

ruby lodge
#

maybe i do that skip a tick node thingy I saw somewhere

dark parcel
#

Send them over a single love letter instead sending clients 2 letters with no order, each with the same instructions ( to load )

worthy oak
#

I’m glad I’m not the only one that throws a delay in to fix an issue 😂

proven pagoda
#

Not delay. Timer loops

worthy oak
#

Welp I’m exposed

ruby lodge
dark parcel
#

How does delay gonna fix anything?

dark parcel
worthy oak
#

by being lazy 🙈

dark parcel
#

Map is not replicated by default

ruby lodge
proven pagoda
#

Delay stops code

ruby lodge
proven pagoda
#

timers make async tasks

#

less issues

ruby lodge
#

oh okay

proven pagoda
#

You do BP or C++

dark parcel
ruby lodge
#

don't need the headache xD

proven pagoda
#

No stress I just wanna show either way

noble sentinel
#

How can I do this work on every player? I cant find a way to get owners player index

proven pagoda
#

If you ever do things with animations as well on replicated variables timers will save you

#

I do like 0.05 sec delay

dark parcel
dark parcel
proven pagoda
noble sentinel
noble sentinel
ruby lodge
#

player character? Player controller? Player state?

noble sentinel
ruby lodge
#

this I would say

#

do this once at the start and make the output of the cast as a parameter

#

then you can reuse it

noble sentinel
unique summit
#

are too big values for walk speed an issue for character in multiplayer ?

noble sentinel
#

thanks

unique summit
#

with 3000 and an emulated network at 30ms ping and 1% packet loss, it is quite janky

proven pagoda
# ruby lodge what is the difference?

This is my loop that scans and damages enemies if you just take the Time on the event in your loop and set the delay to like 0.1 or even 0.05 as it cycles through the loop it'll give it time to replicate

ruby lodge
dark parcel
#

Pretty sure you will need a Client RPC to execute the code in Client machine

dark parcel
#

though normally, I would handled Camera locally, I have no context in what you are doing.

noble sentinel
#

So that trick will help I guess

dark parcel
noble sentinel
#

multiplayer

ruby lodge
#

yea my bad, remembered the channel name xD

#

basically rule of thumb imo, don't use these " get " nodes with player index 0 if you want the code you are using it for to replicate or work for multiple players

noble sentinel
#

I am not even sure I should handle camera shaking like this, but it works fine rn

#

Like what was I supposed to do here?

#

Its working but Im sure this isnt how I supposed to do it

ruby lodge
#

@dark parcel now tried just this to have it loading only one variable and still same issue

#

so i don't think a struct would help here tbh

dark parcel
ruby lodge
#

this is how I call this event btw, maybe it helps

noble sentinel
dark parcel
#

Why are you using delay?

noble sentinel
#

I dont get how

dark parcel
#

OnRepNotify -> Loads

#

End of story

ruby lodge
dark parcel
noble sentinel
dark parcel
#

If you need both the ID and DT, wrap them in a struct. Then Set the struct on server when you want to update the Struct.
Client will Receive the struct value on RepNotify, you can then break the struct in the rep notify and plug the DT and ID to load your customes.

ruby lodge
dark parcel
#

Yes but it's not like you are doing it.

#

That's what I'm doing anyway and works for me.

ruby lodge
#

where are you doing it, in character blueprint?

dark parcel
#

That's on you to decide where to handle it. But you can put it in your character blueprint

#

Got my clients to send it's customization data to server, then server replicate the change back to client.

ruby lodge
#

inside the character blueprint it does work and I use that path in other places. For reasons that are too long to explain now, I need to handle it in the player controller too sometimes and here It's not working correctly and the clients only run the OnRepNotify at the end of the for each loop

dark parcel
#

scrap your delays and stop thingking about your loop.
Client will receive the data when ever the data arrived. Like mentioned, that will depend on latency

ruby lodge
#

nevermind, need to hop off now. Gonna dive deep into this later on

#

i am not using a delay though

dark parcel
ruby lodge
#

oh no that is always true

#

i just placed it because

dark parcel
#

you shoulnd't have anything like that

ruby lodge
#

for the reason that it's not valid, why not?

#

only the owning client calls it anyways

dark parcel
#

because when you want to sync something, it should be called on rep notify

#

you update something when the value is updated

ruby lodge
#

no you are misunderstanding this delay node. This is not having the reason what you think it does. It's not to test for when to call the on rep notify or whatever

#

like we talked a few mins ago with Uhr etc.

#

it's just also on the screenshot

#

i didn't yet try the timer method they mentioned

dark parcel
#

I won't do that either

devout sonnet
#

why doesn't Unreal Engine like this branch? It works properly (prints username)

worthy oak
#

you use a diff node when you print the username

#

and looks like thats what you would want in the branch as well

#

though that branch is likely not necessary

dark parcel
#

Widget doesn't replicate btw, your RPC call is redundant here. If you need to make RPC call, route it to your controller or actor.

Anyway the code seems to be confusing. It's not like you can get other player's controller.
Client only have access to their own controller.

devout sonnet
#

this shit is so confusing to me

#

multiplayer is a different world

neon summit
#

literally

dark parcel
unique summit
#

I use the default mannequin. I'm using an idle animation, instead of walk (the character is on a sort of vehicle). The lack of animation seems to add jankiness. How can I address that ?

devout sonnet
worthy oak
#

It is certainly not for the faint of heart

proven pagoda
unique summit
#

just remember that each client and server are like in separate dimension

proven pagoda
#

GAS makes so much replication for me I love it

unique summit
#

@proven pagoda nah, I just disabled the walk animation ABP_Manny this way:

dark parcel
proven pagoda
#

Have you tried motion matching yet? I made a whole setup with it

unique summit
#

the animation might simply hide the jankiness

devout sonnet
dark parcel
unique summit
#

Most tutorials on anything are shit tbh

dark parcel
#

1st video I checked, someone spawn an actor thru multicast. It got thousands view and people are thanking him.

neon summit
#

lol

devout sonnet
unique summit
#

as with everything

#

experiment

#

get it wrong

dark parcel
unique summit
#

^

twin juniper
unique summit
#

yeah

#

it most likely work coz the spawn on the client does not work, i guess ?

dark parcel
#

there are times you want to spawn something on client only.

unique summit
#

So

dark parcel
#

Eg projectiles

unique summit
#

Let's say I have a rogue client

#

can it spawn anything ?

worthy oak
twin juniper
#

peer to peer

unique summit
#

no, I mean. Let's say that a very motivated assholes decided to analyse the network traffic, and to make a custom client to connect to the server

#

Could it potentially spawn any actor anywhere ?

worthy oak
#

If your server lets it sure

unique summit
#

the spawn on the client is client only ?

dark parcel
#

The network model in Unreal Engine is server to client

worthy oak
#

yes

unique summit
#

oh ok

#

fine then

worthy oak
#

If your server had a function that was like "Spawn whatever you want just give me an actor!"

#

then yeah....that can be abused x

unique summit
#

yeah dont do that

worthy oak
#

xD

devout sonnet
#

Like usernames. 1 widget displays your username and score, the other widget displays the opponents username and score.

worthy oak
#

Widgets are client only, they dont and cant replicate. But they can get classes that do and display this information

neon summit
#

is there a way to debug why something doesnt attach?

unique summit
#

I just don't understand how clients and server interact and share info.
The server shares its info with the client

#

every time a value is changed on a replicated actor, the value is sent to all clients by the server

#

client blindly trust the server

worthy oak
#

It’s the server

unique summit
#

yes it should

#

and it does

worthy oak
#

Client doesnt get to debate XD

#

yeah some things the client has control over

unique summit
#

characterMovement nah ?

worthy oak
#

Well yeah but that is still checked server side too

unique summit
#

CharacterMovement is a very special case of replication anyway

#

No need to think about that for a beginner

worthy oak
#

some things the client does have control over since the server doesnt need to dictate it (or shouldnt)

unique summit
#

yes, you can have a local state

#

Or you mean stuff that is replicated with the client as authority ?

worthy oak
#

no i was talking about stuff like local effects being player

#

or something like turning your camera

unique summit
#

oh yeah

worthy oak
#

if the server controlled all that the game would feel not responsive

devout sonnet
#

almost there. for some reason, the clients name gets displayed for both players.

#

I thought that getting the Player Array from the GameState would be enough to get the variables saved in each playerState.

worthy oak
#

gamestate is for game related variables

#

off your player array that you have there, you can do a getPlayerState

devout sonnet
#

Get Player Name seems to get the different computer names.
but casting to a CustomPlayer State end up with both names being what that player typed.

worthy oak
#

if you used something like steam, instead of the computer name it would be your steam name

#

However, now that you are starting to grasp the concept like that. If you do not want to use a subsystem, you can create your own replicated variable on the player state

#

set it, and retrieve that in your function

worthy oak
#

think we past that, but yeah you could just use the nodes without the function

sinful tree
#

Whenever you're creating a widget that needs a reference to a playerstate, you feed it that reference. Within that widget you can cast, bind to and read from your custom playerstate to both know when the name changes and to read the current name set. The "GetPlayerName" function, as ShinyKey mentioned, isn't accessible to be changed in blueprint, so you must use a custom variable and handle it differently if you're stuck using blueprints which is what I was guiding you to do earlier.

devout sonnet
#

i feed the reference within that widget and casted to the custom playerstate and i get the same result.

neon summit
#

how are you setting the username?

chilly haven
#

Would you guys avoid having hundreds of instances of an actor, and instead use a single actor with an instanced mesh, and per-instance data? And handle replication within that?

#

Or, you could still use hundreds actors, but just use a separate object for the instanced mesh?

modest crater
#

Really depends I guess? With a single actor it has no "culling" in that everything will replicate always given its size will be massive and you get no benefit there, it really depends on how important they are. Fornite abuses dormancy alot and just calls ForceNetUpdate when something changes to replicate it but then stay dormant (note it has a slight cost every forcenetupdate due to it re sending any data that differs from its default values)

chilly haven
#

Ok. obviously the instanced mesh is a benefit. I was concerned about the overhead of hundreds of actors. Assuming there could be multiple types too, e.g. 6 types, hundreds of each type.

#

For fortnite, are you saying they do that as a workaround to allow actors to be not relevant, but still update critical attributes of those actors on the clients?

devout sonnet
neon summit
#

and it prints correctly for each?

devout sonnet
#

that test button just prints that player's name

neon summit
#

its printing from the controller tho

devout sonnet
#

Now it's working better

neon summit
#

hm.. if your getting the index 0

#

nvm

sinful tree
devout sonnet
#

Where do I put the RPC? in the PlayerState or the widget?

sinful tree
#

You always have to RPC on a replicated actor that is owned by the client.

#

So PlayerState would work, sure. You can have your widget call that RPC, that's fine too but it can't run on the widget.

neon summit
#

this is how I do mine but probably diff setup

devout sonnet
dark parcel
# neon summit

all of this delay and going all around with the pin seems to be derived from youtube practices.

#

saw 2 guys doing this already today.

sinful tree
#

Your widget has a reference to the "owning player controller"

#

Player Controllers have a reference to their PlayerState.

#

So you'd create that RPC in your PlayerState, and from your widget, get the owning player controller which you can then get your PlayerState from, which you can then use to call your RPC that exists on your PlayerState.

devout sonnet
sinful tree
#

Yes. You're trying to replicate the name. Replicating variables requires you to set them on the server.

#

You'll have to add an input to the RPC to pass the value through the RPC to the server.

#

This also won't work if you're trying to do it when you're also setting the name in the game instance assuming you're setting the name before the player is connected to the server.

devout sonnet
sinful tree
#

So then, you can't assume to send the RPC when you're setting the name.

#

You'll have to send it somepoint after they have joined.

#

An easy way to do so would be to use the Begin Play of the PlayerState.
Get the owner of the PlayerState and cast to PlayerController - this filters out other clients so they don't do the following.
Check if the PlayerController is locally controlled - this filters out the host if it isn't their PlayerState.
So now for sure, you're the client that owns this PlayerState. You can now retrieve your previously stored name in your GameInstance, send the RPC with the name, and then when running on the server, set the name in the replicated variable.

devout sonnet
sinful tree
#

GetOwner

devout sonnet
#

do i just call the RPC from the true branch?

sinful tree
#

Begin Play > Cast GetOwner to Player Controller > IsLocalController (TRUE) > Cast GetGameInstance to custom GameInstance > Send RPC pass in Name from Game Instance.
RPC > Set Name.

sinful tree
#

Looks promising. Try it.

devout sonnet
#

the second player didn't get his name saved

devout sonnet
dark parcel
devout sonnet
devout sonnet
dark parcel
#

no

devout sonnet
dark parcel
#

print string after the set text, make sure u see the print string for both of the window

#

also you might be doing some sort of race condition too

#

if the widget is created before the name value can be replicated to client

devout sonnet
dark parcel
devout sonnet
#

I gotta get to bed, but thank you @sinful tree and @dark parcel and @worthy oak for helping me understand this better.

grim prism
#

Hey, i have a bit of an issue and am wondering if anyone can help,
As you may be able to see, when the client fires a lava bullet, on the other client its shown as a regular bullet. I may be hard to see but of the client firing the bullet, a regular bullet is fired along with the lava one,
Any ideas on what i could do/how it could be fixed?

neon summit
#

how are you setting the bullet variable

#

probably wanna pass through the events

sinful tree
rustic sapphire
#

newbie question.

I have a board game i am making and I am trying to understand what can and cant be replicable from the client to the server.

my goal right now is to be able for the server to see the client click and dragging pieces around the board.
currently, only the client can see when the server does it. no surprise

most of my events are replicable or server ran. but the actual dragging of pieces is a left mouse button press and release event.
here is a snapshot of the blueprint currently.
can I restructure this somehow where the client's actions will update live on the server's side?

hopefully this is informative. if I were to attach a video, the server would move a piece and both screens would show live movement, but switching ot the client, only the client's movement would show, not on the server's window.

reef bison
#

if you want the client to change the server state you need to call a RPC

#

then it will be changed on the server and replicated to the clients

grim prism
storm grove
#

what creates the game state actor if game modes don't exist to do it for clients?

rustic sapphire
grim prism
twilit radish
urban moth
#

Hello folks.. Can I send MulticastRpc with an Actor right after it is being spawned?

like
MyNewActor = World->SpawnActor<AActor>(this)
NetMulticastNotifyActorSpawned(MyNewActor)?

I wonder whether its guarantee that actor will be replicated on clients before NetMulticastNotifyActorSpawned will be called

thin stratus
#

Like, you can tie a callback to BeginPlay fwiw

#

If the RPC is in a different actor, then the pointer might still be null locally

twin juniper
#

What are good methods to minimize the use of RPCs?

thin stratus
#

Mostly realizing that you are using them where you shouldn't.

#

In most cases ServerRPCs are only needed when the Client does something the Server doesn't know about. Like a KeyPress or UI Interaction.

twin juniper
#

Say i had a player, and i killed them, should the elimination event use rpcs?

thin stratus
#

ClientRPCs are only needed if you need a specific Player to do something.
Same with Multicast but for all Players. And most of the time you probably just work with Replicated Variables.

thin stratus
#

You don't use RPCs for States.

twin juniper
#

okay

urban moth
#

it is like.. you pickup a weapon from loot(TSubclass<AWeapon>), spawn it into hand and select that weapon as a selected into character..
Weapon = SpawnActor<AWeapon)()
Character->MulticastSetActiveWeapon(Weapon)

i know I should use replication.. I just wonder about guarntee about spawning Actor, estabilish GUID, and receive RPC

thin stratus
#

Active Weapon is a State

#

Peeps you gotta really try to understand what State means if possible

#

You can't use RPCs for that

twin juniper
#

I am using a player state in my game, using the comprendium for information as well

urban moth
#

yeah i know.. different example... you have a simulated proxies(other players). Player on server spawn weapon and instantly call Fire.. so SimulatedPlayer gets Fire(Weapon) but the given Weapon is what? is it guarantee that the weapon will be replicated atm?

thin stratus
#
UFUNCTION()
void OnRep_ActiveWeapon(AWeapon* PrevWeapon);

UPROPERTY(ReplicatedUsing = OnRep_ActiveWeapon)
AWeapon* ActorWeapon = nullptr;

void SetActiveWeapon(AWeapon* NewWeapon);

void ASomeClass::SetActiveWeapon(AWeapon* NewWeapon)
{
  if (!HasAuthority())
  {
    return;
  }

  if (ActiveWeapon == NewWeapon)
  {
    return;
  }

  Weapon* PrevWeapon = ActiveWeapon;
  ActiveWeapon = NewWeapon;

  /// Optionally if needed on Server
  OnRep_ActiveWeapon(PrevWeapon);
}

void ASomeClass::OnRep_ActiveWeapon(AWeapon* PrevWeapon)
{
  if (IsValid(PrevWeapon))
  {
    /// Do stuff with Previous Active Weapon
  }

  if (IsValid(ActiveWeapon))
  {
    /// Do stuff with New Active Weapon
  }
}
#

Player on server spawn weapon and instantly call Fire.. so SimulatedPlayer gets Fire(Weapon) but the given Weapon is what? is it guarantee that the weapon will be replicated atm?
Player can't call FireWeapon until the Weapon is replicated to them.

#

Or you just do:

UFUNCTION(Server, Reliable)
void Server_FireActiveWeapon();

void ASomeClass::Server_FireActiveWeapon()
{
  if (!IsValid(ActiveWeapon))
  {
    return;
  }

  ActiveWeapon->Fire();
}
urban moth
#

Cedric I got you 🙂 Take this as an example please.. It is about I have a code review where folk from my work use to call RPCs on just created actors and I dont like it so I am looking for a different opinions 🙂

thin stratus
#

Well I already said you should possibly tie your code to BeginPlay of that Actor or an OnRep of the Pointer of that Actor.

#

A reliable RPC on the Actor might make it, but then there is BeginPlay.
And an RPC in the spawning Actor/Class will possibly have a nullptr as param locally if the Actor hasn't replicated yet.

urban moth
#

yep.. I completely agree.. thanks man

thin stratus
#

Right, sorry for going overboard with the answer. I never know how much a person actually knows.

#

Somewhere lurking will probably have learned something anyway.

urban moth
#

nah, I am fine.. 🙂 thanks again for a clarification

rustic sable
#

In my player controller OnPossess I cast the pawn to my player and store it in a replicated variable. Then in beginplay if local player I call an Multicast RPC on to do additional setup. This seems unpredicatable, like for the 1st client it attempts to run begin play before possess so the player variable isn't set yet..

thin stratus
#

BeginPlay can totally call before possession replicated.

#

If you want to react to the Possess stuff, use OnControllerChangedEvent or whatever they called it

#

That calls for Server and Local Client.

#

Calling a Multicast on BeginPlay is kinda strange.

rustic sable
rustic sable
urban moth
#

@thin stratus just for clarification.. I ve just recheck it within the UE and we're right.. when you call a RPC with just spawned Actor, clients receives nullptr and after that within Bunch processing the new actor being created

rustic sable
urban moth
#

interesting thing that RPC and actor is received in same packet/same bunch.. but RPCs come first and then new actors are being spawned

thin stratus
#
UFUNCTION(BlueprintImplementableEvent)
ENGINE_API void ReceiveControllerChanged(AController* OldController, AController* NewController);
round bobcat
#

Why is my array not replicating when I use it? I think I set it up correctly in the player state, but when I update it using a widget, only the client or server that does the change sees it and no one else does. Here is my player state code, what is wrong with it?

cpp

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

    DOREPLIFETIME(AMainMenuPlayerState, AllPartyID);
}

void AMainMenuPlayerState::CreatePartyID() {
    AllPartyID.Add(UKismetMathLibrary::RandomIntegerInRange(1000000, 9999999));
}

void AMainMenuPlayerState::OnRep_AllPartyID() {
    GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Black, FString::FromInt(AllPartyID.Num()));
}

bool AMainMenuPlayerState::JoinParty(int AttemptedPartyID) {
    if (AllPartyID.Contains(AttemptedPartyID) && !AllPartyID.Contains(0)) {
        return true;
    }
    return false;

    
}

h

UCLASS()
class SPELLBOUNDSTUMBLE_API AMainMenuPlayerState : public APlayerState
{
    GENERATED_BODY()

public:
    virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

    void CreatePartyID();

    UFUNCTION()
    void OnRep_AllPartyID();

    bool JoinParty(int AttemptedPartyID);

private:

    UPROPERTY(ReplicatedUsing = OnRep_AllPartyID)
    TArray<int> AllPartyID;

public:
    FORCEINLINE TArray<int> GetAllPartyID() const { return AllPartyID; }
};
dark parcel
#

@round bobcat Who's calling the CreatePartyID?

round bobcat
dark parcel
#

For the array to replicate, let the server set the value. Since this kind of stuff doesn't need prediction, just Run server rpc to CreatePartyID if Client calling it

round bobcat
dark parcel
#

Test it

round bobcat
# dark parcel Test it

It doesn't replicate still and now, the client cannot create the PartyID. When I print out what PartyID the client creates, I get 0

dark parcel
#

On your rep notify function, print the value

round bobcat
# dark parcel On your rep notify function, print the value

You mean the component class right? Here.

void UPartyInfoComponent::PollMenu() {
    if (Menu == nullptr) {
        TArray<UUserWidget*> WidgetsFound;
        UWidgetBlueprintLibrary::GetAllWidgetsOfClass(GetWorld(), WidgetsFound, MenuClass);

        if (WidgetsFound.Num() > 0) {
            Menu = Cast<UMenu>(WidgetsFound[0]);
            if (Menu) {
                Menu->PartyCreated.AddDynamic(this, &UPartyInfoComponent::OnPartyCreated);
                Menu->PartyCommitted.AddDynamic(this, &UPartyInfoComponent::OnPartyCommitted);
            }
        }
    }
}

void UPartyInfoComponent::OnPartyCreated() {
    if (MainMenuPlayerState) {
        MainMenuPlayerState->ServerCreatePartyID();

        GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Blue, FString::FromInt(MainMenuPlayerState->GetPartyID()));
    }
}

void UPartyInfoComponent::OnPartyCommitted() {
    if (MainMenuPlayerState) {
        FString PartyIDString = Menu->PartyIDTextbox->GetText().ToString();

        AttemptedPartyID = UKismetStringLibrary::Conv_StringToInt(PartyIDString);

        if (MainMenuPlayerState->GetAllPartyID().Num() > 0) {
            GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Green, FString::FromInt(MainMenuPlayerState->GetPartyID()));
        }
        else {
            GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Green, "0");
        }

        GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Red, FString::FromInt(AttemptedPartyID));

        if (MainMenuPlayerState->JoinParty(AttemptedPartyID)) {
            GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Yellow, "Party Created");
        }
    }
}
#

Menu is the widget and I'm using delegates to tell the component class when a button is clicked on Menu

dark parcel
#
void UPartyInfoComponent::OnPartyCreated() {
    if (MainMenuPlayerState) {
        MainMenuPlayerState->ServerCreatePartyID();

        GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Blue, FString::FromInt(MainMenuPlayerState->GetPartyID()));
    }
}

I am beginner btw, so take it with a grain of salt but this is my 2 cent. I mean I can't visualize your project and how things flow
But assuming ServerCreatePartyID() is Server RPC, that piece of code will run on the server machine.
So Server will Create the Party ID, that Array will not replicate to client within the same frame anyway, there is latency it won't be physically possible.

You should test the value from OnRep, because that's when the client Array gets updated.

#

Also if it's a component, have you set it to replicate after creating the Sub-Object? that and ticking the component replicates in your BP version.

round bobcat
# dark parcel Also if it's a component, have you set it to replicate after creating the Sub-Ob...

I'm a beginner too, so I don't know if I replicated it after creating the Sub-Object, but I do know I set the component replicates to on. Here is the updated player state code that took all your suggestions.

cpp

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

    DOREPLIFETIME(AMainMenuPlayerState, AllPartyID);
}

void AMainMenuPlayerState::CreatePartyID() {
    ServerCreatePartyID();
}

void AMainMenuPlayerState::ServerCreatePartyID_Implementation() {
    AllPartyID.Add(UKismetMathLibrary::RandomIntegerInRange(1000000, 9999999));

    PartyID = AllPartyID.Last();
}

bool AMainMenuPlayerState::JoinParty(int AttemptedPartyID) {
    if (AllPartyID.Contains(AttemptedPartyID) && !AllPartyID.Contains(0)) {
        return true;
    }
    return false;

    
}

void AMainMenuPlayerState::OnRep_AllPartyID() {
    GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Blue, FString::FromInt(AllPartyID.Last()));
}

h

UCLASS()
class SPELLBOUNDSTUMBLE_API AMainMenuPlayerState : public APlayerState
{
    GENERATED_BODY()

public:
    virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

    void CreatePartyID();

    UFUNCTION(Server, Reliable)
    void ServerCreatePartyID();

    bool JoinParty(int AttemptedPartyID);

    UFUNCTION()
    void OnRep_AllPartyID();

private:

    UPROPERTY(ReplicatedUsing = OnRep_AllPartyID)
    TArray<int> AllPartyID;

    int PartyID;

public:
    FORCEINLINE TArray<int> GetAllPartyID() const { return AllPartyID; }

    FORCEINLINE int GetPartyID() const { return PartyID; }
};
dark parcel
#

@round bobcat ```cpp
RotatingComponent->SetIsReplicated(true);

#

make sure your component is set to replicate, otherwise I think RPC will get dropped

#

i tried unticking mine just now and the properties inside my component stop replicating

#

What is UPartyInfoComponent derived from?

#

Hmm nvm actually, the serverCreatePartyID lives in the player state

#

@round bobcat ```cpp
void AMainMenuPlayerState::OnRep_AllPartyID() {
GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Blue, FString::FromInt(AllPartyID.Last()));
}

This still giving you 0?
round bobcat
dark parcel
#

I will doodle something

round bobcat
dark parcel
#

So the Array in Client Player state get updated but with delay?

round bobcat
dark parcel
#

Chekc if you are emulating delay

round bobcat
dark parcel
#

OnRep is called when the variable gets updated from the server

#

so I'm not quiet sure what you mean by AllPartyID not replicating

#

Your PartyID is never set to replicate btw, Are we talking about PartyID or AllPartyID?

#
UPROPERTY(ReplicatedUsing = OnRep_PartyID)
int32 PartyID;
#

if you want to replicate the PartyID

#

might not even need OnRep and just make it replicate. Depending on the context ofc.

round bobcat
# dark parcel ```cpp UPROPERTY(ReplicatedUsing = OnRep_PartyID) int32 PartyID; ```

PartyID is just the last element of the AllPartyID array and I just use it for simpler print strings. In these screenshots, the server just created a code that goes into the AllPartyID array and printed it in blue, and the client tries joining with the same code, shown in red, but the code they have is 0, the one in green because the server doesn't replicate the code to the client.

dark parcel
#
void AMainMenuPlayerState::ServerCreatePartyID_Implementation() {
    AllPartyID.Add(UKismetMathLibrary::RandomIntegerInRange(1000000, 9999999));

    PartyID = AllPartyID.Last();
}
``` okay but this code is only setting the Party ID in the server machine
#

not client

#

You can leave the code as it is.

But for client you can do

void AMainMenuPlayerState::OnRep_AllPartyID() {
    PartyID = AllPartyID.Last();
}
#

this will set PartyID in the receiving client machine to the last element of the Updated Array (AllPartyID)

round bobcat
storm zealot
#

Yo

Anybody struggled with UE5 physic objects in multiplayer?
When client hits object during sprint, that object is knoking in outer space. With server that not happens and all physics work normaly

dark parcel
#

once you have the correct value, the rest is for you to work out how to use it in your System.

round bobcat
proven pagoda
#

Can you just replicate arrays like that?

#

You don't have to net serialize them?

dark parcel
round bobcat
dark parcel
#

RepNotify in C++ only gets called by the receiving client

#

it does not run for server

#

So if you have that function executed, that means you are receiving updates on your AllPartyID

#

Means the data arrived from server and the variable gets updated to the incoming data for the client

round bobcat
#

I feel like it has something to do with the widget input. I heard all widgets are local so I'm thinking you can't replicate variables.

dark parcel
dark parcel
#

this got nothing to do with your widget. Your widget job simply just to read data that is available in the game instance it's in.

round bobcat
dark parcel
#

If you don't get 0, then I rest my case.

#

Screen shoot the OnRep Notify code then screen shoot the result

round bobcat
#

The rep notify is printing correcttly.

dark parcel
#

play with multiple players and print screen again

round bobcat
#

The server prints the PartyID in blue and when I join and type the code on the client shown in red, the green value, what should be the same as the blue value, is 0

dark parcel
#

Lets not jump to the join button, I am not certified to look at other people code

#

So it seems the AllPartyID is replicated since you get the same number

#

now you can work out what you do with the data.

#

When you make system like this, you have to think about when will the data be ready, what runs on server, what runs on client.

round bobcat
dark parcel
#

I don't know how you print the other colors and where. You might print Party ID before the OnRep is called

#

anyway gonna sleep, maybe someone else can help.

round bobcat
dark parcel
#

@round bobcat Client PartyID updated here just fine

#

allright im gonna sleep fr

kindred widget
rustic sapphire
# reef bison if you want the client to change the server state you need to call a RPC

worked like a charm. thanks!
i made an event for relocating the grabbed piece ( replaced that last node)
i made the event run on server and reliable
I then learned about scope because having grabbedPiece and newLocation within the server event errors out. instead simply passing them in from the original left mouse event into the new server event fixed it and it runs nicely!
thanks again

ruby lodge
#
  1. When testing replication in a dedicated server setup, I only need to play as client in the editor?
  2. When not using RPCs run on owning client or so it's very likely that if replication is working for one client, it would work for other clients as well. Correct?
#

Of course, just regarding the replication in question 1. I know that the dedicated server itself would need testing

rustic sable
# thin stratus They renamed it apparently

Thanks, that worked great. Decided to use the delegate directly instead of the blueprint implementable event.
Snippet for anyone searching this in the future.

in PostInitializeComponents of the player class:
ReceiveControllerChangedDelegate.AddDynamic(this, &APlayerBase::OnControllerChanged);

then the function with the same signature as the delegate
void APlayerBase::OnControllerChanged(APawn* Pawn, AController* OldController, AController* NewController) {... // do cool stuff, set up widgets etc

lament flax
#

on begin overlap i would like to check some stuff on server then run a function on the instance where the event fired if the actor that triggered the begin overlap event is locally controlled.
but once im on server, i cannot go back to the specific client (only the owning client)
should i use a delegate or something ?

limber minnow
#

hey guys I have migrated my project from 5.3 to 5.4.1, and now I got a problem about replication I guess, the client gets kicked out after connecting, the error says Actor channel failed, in the server log "ReplicationDriverClass is null! Not using ReplicationDriver." "InitBase GameNetDriver (NetDriverDefinition GameNetDriver) using replication model Generic" then it registers network metrics listeners(I dont think before I had this registers)

thin stratus
brisk swift
#

I have a function that enables and disables collision. My problem is that on client the collision is able to be enabled but not disabled even though the set collision is being called

lament flax
#

Will work but i dont like splitting stuff like that

thin stratus
#

Is that other actor some random ass actor?

lament flax
thin stratus
#

Why can't you check the Conditions on the local Client too?

lament flax
thin stratus
#

But it's visual Feedback

#

Who the f cares?

lament flax
#

The condition are server side

#

Wait

thin stratus
#

Idk what kind of conditions we are talking about

#

But most of the time you probably can do the tests on both ends

#

And let the client do the visual feedback

lament flax
#

The condition check will change visuals stuff but also important stuff like collisions response to a specific channel

#

So i cant put all on client

thin stratus
#

Also only for that client?

lament flax
#

No

#

The collision change is on server to be replicated

thin stratus
#

The stuff that happens for all of them can be doen via OnRep

#

ServerOverlap -> CheckConditions -> Do State Changes
LocalClientOverlap -> CheckConditions -> Do Visual Feedback

lament flax
#

I sont see the use of one rep

thin stratus
#

State -> OnRep

lament flax
#

Its not really a state here.
If i change the size of a capsule comp for eg, since the capsule is replicated, it will have the correct size on join

thin stratus
#

The Capsule does not replicate the size or collision :D

lament flax
#

Oh wait i cant xD

thin stratus
#

Idk why you think that

lament flax
#

The PDA is server side

#

I will have to replicated down a variable

#

That is contained in the PDA

thin stratus
#

You will need to replicate the State of the Capsule Comp via OnRep variables

#

Just marking it as replicated doesn't magically do that for you

limber minnow
#

I dont know where is the replication problem on my server, the previous unreal version was working fine

#

gamemode settings

magic vessel
#

Working with fast arrays, need an outside opinion
Fast Array with items

  1. with a soft object ptr & TArray<int>
  2. Soft Object Ptr & int

basically, would it better to have each item in the array to hold a soft object ptr and array of ints which would reduce the size of the overall array but would be harder to use with the update code. Or flatten the array so each item holds the int, which would increase the size of the overall array but I can update the UI on a per item basis

#

Personally I'm leaning towards option 2, especially since I'm working with fast arrays

limber minnow
#

@magic vessel I dont think youre in the right topic mate, here is for multiplayer

magic vessel
#

It's with the fast array serialiser which is very important for multiplayer, I was wondering about the broadwidth considerations though reading my post I forgot to ask about that

dreamy gate
#

I'm spawning random buildings each playthrough, but players don't see the same buildings spawned. How do I go about replicating this?

magic vessel
#

Which class are you spawning them through?

#

And are the actor classes set to replicate?

#

Depending on the class, Begin Play will trigger on both server and client and if the actor classes are not set to replicate then the client won't see them

limber minnow
#

@dreamy gate try to create a custom event that runs in the server, in the game state class for example

#

if you want the player to call the event, then you have to create on the player controller

#

but with the option set to run on the server

lusty kelp
#

okay so I have a game where I am using Steam, the Steam master pops but when i join on another computer/laptop won't let me; any advice?

neon summit
dreamy gate
lusty kelp
#

@neon summit i am using custom and region are same on both computers

#

like i can open the connect way but doesn't find any 0/0 sessions

#

well anyways least i got its to pop on steam!

dreamy gate
proven pagoda
#

I set up motion matching and then just finished replicating it. It's interesting to see the final product across clients and stuff. 3 person Listen Server

#

That's just the Lyra animations and this other starter pack that's in the free section

#

I can't wait until next month the 500 anims comes out

sinful tree
# grim prism how would i go about doing that?

Spawn only on the server, not during a multicast. If the client changes what type of bullet they want to spawn, you also need to send that data to the server so that it can know what the player has selected and then the server can spawn the appropriate bullet based on the player's selection.

lusty kelp
#

so what the different turning both( bInitServerOnClient= to false? Because when not false then the name on both don't change to the steam username, only the main

#

i turn them to false while hoping it'll bring up an value of 1 to join but only 0/0

empty plover
#

I'm using this setup, it correctly plays the double jump animation on all clients. However, it plays it with a delay on the local client (which is expected, client->server->client to play animation). What is a recommended setup to play the animation immediately on the local client, and then have the server execute the event on all OTHER clients? so the local client doesn't double-play

dark parcel
#

Doing movement outside CharacterMovementComponent won't end well imo.

empty plover
#

I'm only trying to update the animation on the clients, no movement should be happening there

#

I suspect I'm going about this the wrong way but I don't know what the right way would be (playing jump animation on all clients at the correct time)

nova wasp
#

the simple thing is to play it locally when the client locally controls that character, I don't see why the local client would need to wait for the server saying they can double jump here as the CMC kind of predicts that built in

empty plover
#

if I hook up Event On Jumped directly to Jump to Node it'll play the animation correctly on the client that jumped and the server, but other clients won't see the animation. I'm not sure what the proper way to replicate that is, I figured Event On Jumped would be replicated

#

so I think I have to manually tell the clients to Jump to Node? But if I do that through the above method, it'll play the animation twice on the client that jumped

waxen apex
#

Question: Where, or how, would I begin implementing a multiplayer-account-system where the account stores the players data (IE: Weapons owned by the player, levels, stats, games played, etc)?

dark edge
#

There might be some UE / Playfab writeups around

waxen apex
#

would using something like steamworks or eos work as well?

dark edge
waxen apex
#

Do you mind expanding on the methodology her?

#

So like, if I were to create one, then I would just have data stored on the account or connected to the account, then have a blueprint function retrive that data and show it on the game.

#

Is that a good method of approach?

dark edge
#

It's way bigger than that. You'll need to do a lot of research. As long as the thing gets built it should all shake down to be some little blueprint function, but it's not just a little thing you add to a game.

open adder
#

In 'ListenServer' mode, I can move my clients. The client, which is the server, cannot move. I also tried removing "is local player.., result is the same.

neon summit
open adder
neon summit
#

override the spawn default pawn for in the gamemode

open adder
#

ingame, i'll have to change my character quickly

neon summit
#

and event handle starting new player

open adder
grim prism
sinful tree
# grim prism that is making the bullet spawn a little strangely, being a little further from ...

That's because it's never instant that you communicate with the server and there will always be some delay. You're now entering the realm of predicted projectiles which is a lot more difficult and beyond what I could help you with as I've not done it myself. The Unreal Tournament source code has the code required for doing it, albeit, it's in C++.

As far as seeing the explosions, I'm not sure why that would be happening, but that's likely because of your OnHit logic not being properly set up or not being detected on clients.

thin stratus
#

Pretty sure the Projectile spawns and explodes so fast it never makes it to the client

sinful tree
#

Ah yea XD

grim prism
#

Thanks 👍🏻

storm grove
neon summit
#

also using spawn player at player start would be better

open adder
neon summit
#

on possess rather on controller would be better

dark parcel
#

why would you ever want a multicast for handling input context?

#

input is local to each player

open adder
dark parcel
#

But that only runs on Server, make sure to run Client RPC to tell the client machine to set their Input Mapping Context.

neon summit
#

sorry im playing a game so distracted. it works for me as im doing other stuff. if you're just doing that just do a client rpc like he said

sinful tree
# open adder yes this makes more sense, thanks

On Pawn (For any controls that relate specifically to the pawn): Receive Controller Changed > Check if "New Controller" is Local Controller > Set Mapping Context
On Controller (For any controls agnostic to the controlled pawn): Begin Play > Check if Is Local Controller > Set Mapping Contenxt

formal solar
#

Can calling 'destroy session' when there is not a session in existence give me issues? Basically I have a single player level that opens before players search and join lobbies, when players first start the game they are not in a session. How I handle quitting the game (excepting alt+f4) is I teleport the quitting player to this original level and I call destroy session in begin play of the level blueprint. This all works fine but I get a yellow warning on the false destroy session I call when players first boot up the game. I'm just worried this could lead to problems in the packaged version. Or is it not an issue

bright summit
#

I am testing multiplayer without checked run under one process but when one process is active on second one there are 3fps which causes a big net latency, how can I prevent this?

neon summit
bright summit
frigid fox
#

I have an AI task but it does not work on the client properly. Can anyone help?

twilit radish
# storm grove But how does it go from an unresolved pointer on client side to a valid pointer ...

The same way it does for all other actors, the game state is just a specialized actor in the end. On a high level Unreal keeps track of what actors need to be replicated to what clients and what properties are relevant to send over, as not all properties are wanted to be replicated over the network. Once that data is on the client it will spawn said actor and give it the data that was send along the network. There are some great resources about diving deeper if you want like this: https://www.youtube.com/watch?v=JOJP0CvpB8w - the network compendium from Cedric is also invaluable: #multiplayer message

But in general it comes down to Unreal doing a lot of the heavy lifting and network protocols etc.

An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.

Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe

00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...

▶ Play video
dark parcel
#

Your BT should only run on server

worthy oak
#

Not sure on unreal engine but not necessarily

#

it should more than likely be validated on server

dark parcel
#

In your case, your client doesn't need to know anything as well.

timid galleon
#

Hi guys, I hope there is someone who can help with my problem. I'm creating an online game with Steam multiplayer (I've already added the multiplayer itself and everything works correctly), it just so happens that my project is actually an online concert, so I have a lot of lights on the level, and they all work through the sequence, so who can help me with how to make sure that when I created a server, started the sequence, after that the player joined, and that HE STARTED the SAME sequence in the HIS game,
but from the place where he is already playing in my game. Here is how I have it implemented now, but now it works only when I start the sequence when the second player is already on the level, help pls

dark parcel
#

Server run the task, the A.I move towards the player. Movement is replicated .

dark parcel
worthy oak
timid galleon
dark parcel
#

At what point do you want to play the sequence?

#

You said when the player join but how many player will join?

#

There is post login or something like that on game mode that detect when player joins.

worthy oak
#

As you are finding, multicast is used for just telling everyone connected to do something

#

So for play sure that works great

timid galleon
#

about 20 minimum, I want to understand how to make the connecting player (each of the players individually by itself) take the information (current time) at which the sequence is in my game and run it as a separate sequence from the moment it was received

dark parcel
#

Game mode has a function on server that fire when a player join. Post login or something.

Define the rule there, eg making sure all player join. Only then you can tell everyone to play the sequence

#

So u want to play the sequence anyway? And when client join, they just jump to w.e server is at?

timid galleon
dark parcel
#

You are giving me different cases tho. Gotta be clear when you want to play the sequence and when do the client play sequence.

timid galleon
dark parcel
#

By my game you mean the server?

#

You want client to play what ever server is at when they join? Is that accurate?

timid galleon
# dark parcel By my game you mean the server?

No, the server is my game, in which I run the sequence, you are the client, which after connecting should automatically play the sequence from the same place as I was at the time of your connection

dark parcel
#

But that's what I just said?

#

So server play the sequence and the elapsed time is 25 seconds when the first client join.

You want that client to play the sequence at 25 seconds. Are we on the same page soo far?

timid galleon
# dark parcel You want client to play what ever server is at when they join? Is that accurate?

my game has the ability to create its own servers, but there will be live events from me personally that will be marked as official, so when I, for example, start a server sequence at 20:00 and you as a client join at 20:15, then you as a client should automatically start the sequence from the moment at which my sequence is on the server (in our case, from the fifteenth minute)

dark parcel
#

You will need to have a replicated variable that define the current time on server.

#

When player joins, it plays the sequence using the CurrentTime variable (which replicate from server)

#

If you want to be extra accurate. You can offset by round trip time

#

But honestly for something like this, is not neccesary

formal solar
#

How can I prevent people from joining my game session if someone quits and number of players gets reduce? currently I just possess all the leavers pawns with an AI controller which seems to work ok but the session is still advertised :/ I dont really want to have to close the whole match if there is a leaver

#

they cant join if max players = num players but when someone leaves i would also like to decrement max players so session is not advertised

timid galleon
dark parcel
#

You can set current time to your sequence current time every tick

timid galleon
#

and it's all in the level blueprint? or in player controler?

dark parcel
#

If you are still using level blueprint, multiplayer is too early for you.

#

It has to live on an object that replicates.

#

Eg your character, controller, player state

timid galleon
#

I mean, I need to specify that it should start the sequencing only when it has already been started

#

@dark parcel please go to private messages

dark parcel
#

no ser, drop it here so other people may help you

limber minnow
#

Im having a issue with the version 5.4.1, the mapserver is not working how I was used, anyone had a problem like this before ? Actor channel failed ?

surreal fox
#

are character animations are replicated by defualt?
By my character animations are not replicating

limber minnow
#

you have to replicate the variables

#

those which are inside your statemachine

#

but I would reccomend to dont replicate directly those which are inside the state machine but those from player controller for example

#

because you start playing animation once the state machine changes the character state

surreal fox
#

yeah I've also tried replicated the variables I am using for state machines. Doesn't works Idk what I am missing

limber minnow
#

its because the animation blueprint doesnt exist on the server only in the client

#

that is why you have to update the variables from a class which exists on the server

surreal fox
#

I saw a yt video where he just setup his state machine and animation blend space and it automatically replicates his movement animations

timid galleon
#

or what?

surreal fox
timid galleon
# timid galleon or what?

so now what can I do to make it start the sequence from the moment of this variable when connected?

limber minnow
#

@surreal fox you have to use the node "update animation" and maybe cast to different class to receive the replicated variables, casted from diferent class

#

for example player controller

surreal fox
#

finally fixed that

torpid crest
#

Hey guys, I'm having issues with sub-levels.

What I'd like is for each client to be able to individually enter and exit sub-levels. Imagine one player going inside an interior level while another player stays outside...
Sadly what is happening is that it will load sub level for all clients regardless if they trigger the event or not
Is this even possible in Unreal?

frigid fox
#

when it is patrolling there isn't any problem but while playing montage it's jittering

#

that's the only problem for now

woven basin
torpid crest
woven basin
torpid crest
#

Ok 👌 thank you

timid galleon
#

hi plz help i need a sequence that starts when f1 is pressed on the server while it is running in parallel with the client game i am using steam multiplayer and i want everyone who has already joined the server to get the sequence at the same time but also those who joined already after starting the sequence, they could join and see the sequence from the same place where the server sees it when the client joins (ie if I started the sequence at 20 00 and the client joined at 20 15, then for the client to see please wait 15 minutes at this point) see what I did please tell me what's wrong and why the sequence doesn't start at all if you join from the main menu but if you start from the level it should work sequence, then it starts itself, and only on the server(first two photos from game mode third from character)

torpid crest
#

I am falling through collision in sub-level 😄 😄

neon summit
timid galleon
lost inlet
#

This might be the worse naming of anything I've seen yet, but the game mode doesn't replicate for a start

frigid fox
dark parcel
#

I'm not far in on AI yet. Currently in tutorial hell for mp that actually cover A.I.

Gonna give 2 cent when I actually have A.I on my own. Maybe someone else have idea, my only experience of montage jittering is from using listen server

frigid fox
#

ah I see

#

thanks anyway

#

multiplayer is really difficult

dark parcel
#

Gl maybe someone else knows

frigid fox
#

thanks

#

I hope

bright summit
#

spectator pawn DO NOT exist on the server, right?

dark parcel
#

So pass in the new player

#

Might want to consider a scenario where client load faster than server as well prob.

lost inlet
#

Still people glimpsing over the game mode part

dark parcel
lost inlet
#

It exists on the server, but RPCs are being used there. I doubt this works at all

#

this is always fun in a multiplayer context too

dark parcel
#

Ye he needs to plugin the actual joining player (new player)

lost inlet
#

needs to rework the entire thing tbh

dark parcel
#

Rpc would be redundant in game mode

#

Everything is basically already run on server

#

But i think it should be able to call client rpc in pawn

lost inlet
#

StartSequenceAtTime isn't an RPC

dark parcel
#

Yeah he needs to wrap that function in the character

lost inlet
#

though when I've done something similar in the past, we used a level sequence player actor that existed on the level rather than creating one at runtime

dark parcel
#

Didn't look carefully, I see now

rustic sable
#

kind of surprised the server doesn't complain about this Player->GetWInventory()->UpdateSlotAtIndex(_index, SlotReference); it's the widget part of my on equip which is in a replicated inventory component on the player.

#

It works without a local controller check so does the server just ignore anything having to do with widgets?

limber minnow
#

did anyone already packed a mapserver in unreal engine 5.4.1 and manage to make it work ?

#

my mapservers are not working

#

I have recorded a video for demonstration

limber minnow
#

Im about to downgrade to 5.3 because of that

#

I was compiling the whole engine from 0 again to be sure, and the problem is still there

#

seems people having the same issue

slim jay
#

I'm asking just to be sure, is the way I'm using these values ​​correct? When testing character movements on a dedicated server, I feel a slight stutter. Is there another solution to fix this?

fossil spoke
#

You are likely seeing stutter because you are doing something to the Character that is fighting the prediction system and getting constantly corrected.

slim jay
fossil spoke
#

How much packet loss are you simulating?

slim jay
#

20

fossil spoke
#

Jesus

#

5% max

#

1% is probably closer to real world

slim jay
fossil spoke
#

Correct

#

Packet loss is typically either constant or non existant.

#

Constant meaning the connection is basically shot due to environmental factors outside of your control

#

Packet loss simulation should only really be relied upon to ensure that your game can recover to an acceptable state after its gone.

slim jay
fossil spoke
#

Test against a brand new Character with no modifications.

#

If that doesnt stutter, then your issue is with what you are doing to your Character.

slim jay
#

perfect , thank you so much

idle coyote
#

So I'm having a problem where I get the error LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_Miner_C_0. Function RPC Receive Damage will not be processed. when I try to call an RPC from a BP_Miner class to another BP_Miner(hitting one another with melee weapons). I can detect the hit and replicate it just fine, but I can't actually send damage. Nothing I have tried has worked even after extensive googling. Here are the two BP's, BP_Miner(https://blueprintue.com/blueprint/ozvuoo4x/) and BP_ThirdPersonCharacter(https://blueprintue.com/blueprint/m7i08o07/) (BP_Miner's parent is BP_ThirdPersonCharacter). Any ideas?

fossil spoke
#

You are likely trying to send an RPC from an Actor that is not owned by a Player.

idle coyote
#

Hmmm what do you mean owned by a player? I have full control of the actor and have two windows pulled up and it set to client mode when I click play.

#

(In BP_Miner)

#

Not within the weapon itself or anything, directly in a function of BP_Miner's event graph. Everything else except sending damage is syncing properly, even some other RPCs that have to do with animation montage blending etc.

rustic sable
#

if you call a Server_Interact_Implementation from an input, that function then calls say a PickUpItem function, is the second one always going to run on the server only? 🤔

limber minnow
#

@fossil spoke do you know about this problem "LogNet: Actor channel failed: [UActorChannel] Actor: BP_TopDownCharacter_C " after client connects to the mapserver, the client gets disconnected

#

remote mapserver

idle coyote
#

Thing is, the server knows the damage is happen but won't replicate it to the rest of the clients

sinful tree
#

UI/Widgets don't replicate themselves, but so long as the server/host is spawning the actor and the actor is marked as replicated, then it should still replicate to everyone. If you need to replicate the reference to that actor, then you'd need to pass the reference through some other replicated actor that is available to everyone, such as the gamestate.

#

Making a variable set to RepNotify makes it so that when the variable replicates and a new value is received, it triggers the connected function to it. So if you needed to have something done when a value changes, a RepNotify is the way to do it otherwise it won't necessarily be synchronized if you changed a replicated value and then sent an RPC. It's also helpful in that the state is saved and those that end up receiving it later, say like joining players, they too will fire the OnRep functions if the value is different from the default when the actors they belong to begin play.

RPCs are when you need to send a one-off message or trigger that doesn't matter if the state is saved. RPCs are the only way to communicate anything from a client to the server and can only be done on a client owned actor. The server can communicate to specific clients using any actors they are owner of too, but it can also communicate using replicated variables (with repnotify or not) and multicasts.

slim jay
# fossil spoke Test against a brand new Character with no modifications.

I tried with the default third-person character as you suggested, and there were no stuttering at all; it works smoothly and properly. However, there are many things I've modified on my character that could potentially cause issues. Do you have any suggestions about where the issue might be?

fossil spoke
fossil spoke
#

Post logs

#

What have you tried?

#

What are you trying to do?

#

What have you changed?

#

Provide as much info/context as you can.

slim jay
#

Thank you again.

sinful tree
#

Client's can't send RPCs through the Gamestate as clients do not own the gamestate.

fierce egret
#

How can I stop level streaming from replicating? I want the level to be loaded only on the server and chosen client, but it is loaded on everyone when server loads

sinful tree
#

Send the RPC on a replicated actor that the client owns. Their PlayerController, PlayerState, Controlled Pawn or any replicated components of these will work, or any other actors that are replicated that you've assigned that client ownership of.

neon summit
#

do repnotifies work when that pawn isnt currently possessed?

sinful tree
neon summit
#

I mean it appears to but would it not correctly fire?

#

or any inconsistancy

sinful tree
#

When you mark a variable as rep notify, all you're signalling is that you want the generated function to be called when a new value is received from the server.

neon summit
#

alright

sinful tree
#

eg. You can have a rep notify on the gamestate, and whenever that value is changed on the gamestate by the server, teh repnotify would fire on clients.

#

Why it may not be working for you:

  1. The actor isn't replicated.
  2. The property isn't set to use Rep W/ Notify
  3. The property isn't being set by the server. (Replication only happens from Server -> Clients)
  4. The property has some additional replication conditions set on it (like Owner Only)
  5. The actor is marked as replicated but you're spawning separate actors on all clients (ie. multicasting a spawn) , thus, it's not actually being replicated.
  6. The actor isn't relevant to the client at the time the RepNotify fires for everyone else.
neon summit
#

it fires just doesnt attach actor to component the second time I try but I see it firing.

#

I've run out of ideas or why this doesnt work. I'm just lost

sinful tree
#

What are you setting to have the rep notify trigger?

neon summit
#

Only thing not working is the attachment. It will work the first time I get in the vehicle but when I get out and get back in it will keep the character at position he enters at

sinful tree
#

This is a bit of a problem as you can't guarantee the order or timing of receiving these properties if they are both required together.

#

That said, I'm not sure why you would need to replicate the driver seat.

#

This here, though it's cut off looks like it probably shouldn't be an RPC.

neon summit
#

that changes a variable that determines what hud is used

sinful tree
#

Why do you need to send an RPC to do that? You have a variable already that indicates they're entering a vehicle.

neon summit
#

i probbly dont need a rpc tho prob right

#

thats not what its for

#

we're getting off topic

sinful tree
#

Seems very similar to me.

#

And yeah, not a game breaker for what you're trying to do right now 😛

neon summit
#

that variable is for the animation

#

i call switch hud afterward to determine which hud is used

#

and that variable determines the animation

sinful tree
#

And....? Could it not also be used then to control whether or not the HUD displays what it needs to when the character is in a vehicle? You don't want a seperate variable for every possible thing that could happen as you want to try and replicate the least amount of data.

neon summit
#

true true

sinful tree
#

Ok so back to these guys...

neon summit
#

anyway i noticed if i take out the rep_attachtoseat in the exiting code he will attach the next time.

#

but not at the location of the driver seat

sinful tree
#

I don't think Detach From Component is the right thing to call here as that would have the component detach from whatever component it is attached to.

neon summit
#

probably

sinful tree
#

Or at least, you wouldn't want to call it on the seat.

#

And to make matters worse, if you've removed the reference, you don't have a proper way of detaching.

#

As you'd need to detach the driver's root component

neon summit
#

wouldnt that detach the character from all its components?

sinful tree
#

when you're attaching actor to component, you're attaching the root component to the other component.
So you need to detach the root component from whatever it is attached to (which would be the seat!)

neon summit
#

so target would be the character not the driver seat for detach from component?

sinful tree
#

Yea. So you'd need something like this in the client side logic of the character.

neon summit
#

I'd use the capsule compoent insteaf of default scene root in my situation?

sinful tree
#

Yea it's whatever is the root component.

#

You can literally do "get root component" to be sure.

#

I just happend to grab the default scene root in the actor I had opened XD

neon summit
#

didn't make a difference so far

#

it attached but not at the location of the driver seat but I gotta the is valid

#

it didnt seem to attach using self but attached using the rep driver property

#

should I just use a bool instead of a ref to character for the repnotify?

neon summit
#

hm, maybe I missed your point but its still not working

neon summit
#

I think I fixed it finally...

neon summit
#

thanks datura. I think I just read the description wrong or misunderstood it of the detach from component node

storm grove
#

If I have a struct with a custom net serialize function I know it will only send over whatever I serialize inside of that function but my question is what happens to variables marked as NOT replicated?

Does that flag stop shadow states and stop the rep system from comparing them to know if something has changed but thats it? Like I could still manually replicate it if I wanted to with the FArchive but it wont know that something has changed and replicate if I mark it as NotReplicated, is that correct?

frail barn
dark edge
dark parcel
#

Can't fix it in blueprint

frail barn
dark parcel
frail barn
dark parcel
#

It's written in the article. Anytime you want to print string the GPlayInEditorId. You have to cast it to int32

frail barn
dark parcel
frail barn
dark parcel
#

Kismet library :: print string something like that

small grail
#

UKismetSystemLibrary::PrintString

dark edge
dark parcel
#

Engine bug 5.2 5.3

dark edge
#

How does this affect your game code?

dark parcel
#

They changed GPlayInEditorId to become a struct

#

So the issue now all client print client 0

#

Despite the existence of multiple clients when doing print string

frail barn
dark parcel
#

It kinda defeat the purpose of debugging if we can't ID the caller

small grail
#

It won't break your game code, but will be a pain debugging the game.

frail barn
dark parcel
#

No

frail barn
dark parcel
#

I would say so, no other way if u want to use print string

#

It's broken in your end, if you want it to work you gotta fix it

#

Waiting for Epic to fix it and updating engine could be an option

frail barn
limber minnow
dark parcel
#

You should install VS anyway because you will need that to package your game.

dark parcel
#

Well you should get it if you want to make games using unreal.

#

You can't package without having visual studio.

#

Meaning you can't package your game for others to play.

frail barn
dark parcel
#

And if you have rider anyway, then why arnt you using it? Open your project using rider and go edit the print string

frail barn
dark parcel
#

I have no idea, but it's kinda pointless with the nit picking

#

If you want to seriously work on your game, you do what you have to do

#

Or just don't do it. The choice is yours

dark edge
#

probably all the indexing etc

kindred widget
# frail barn i use jet brains rider

You still need VisualStudio installed. Even if you use Rider as your IDE. It doesn't need to be open. But Rider still uses stuff from VS to compile.

kindred widget
dusty monolith
neon summit
#

anyone use smoothsync?

kindred widget
#

Lol. Professional Epic. Just wonderfully done.

"Here's a PUBLIC guide to use Iris"
https://dev.epicgames.com/community/learning/tutorials/z08b/unreal-engine-iris-faq

"And in that PUBLIC guide, here's a link to how you use Iris on our super expensive developer network that is NOT PUBLIC without your credit card number!"
More information on getting started with Iris can be found here, including how to configure Iris: https://udn.unrealengine.com/s/article/Experimental-Getting-Started-With-Iris

woven basin
#

can you even "buy" udn access?

kindred widget
#

AFAIK it's a licensee thing. So, not directly. But sure.

lost inlet
#

so you're not even paying for it with a credit card number

limber minnow
chrome bay
#

Unless you opted into Iris you won't be using it

dusty monolith
#

btw, if i open this server from thirdpersonmap with console command 'open <ipaddress>', all clients work fine. this ocurs when i open thirdperson server map from menu map

rustic sable
#

If you set an actor component to replicate what about it gets replicated? Any variable you put into it or what?

lost inlet
#

Any variable that is also replicated

misty sentinel
#

Is there a better way to store permanent player IDs than storing the ID of each client in their game instance?

woven basin
odd hamlet
#

Why I variable I have set as replicated is different on the server than the one I have on the client?

thin stratus
#

Client might have set it locally.

waxen socket
#

Hello, I'm looking for some general advice on replicated timelines from anyone who may know. 👋

I was working on an enemy that rotates on a repeating timeline. The timeline fires SetActorRotation() on update. This looks choppy on the client so I was about to start tackling that when I spied the Replicated button in the timeline settings. I've never used this feature before and I thought since the rotation of the actor is already replicated, replicating the timeline would only cause problems.

However, on enabling Replicated in the timeline, I see that the rotation on the client is now nice and smooth. 🙂

This seems too good to be true so I'm here to ask if there is a gotcha here I need to look out for. Are replicated timelines expensive? I'm wary.

Any advice would be appreciated.

Cheers.

slim jay
#

When I start the game for two players in the editor, I can see the other character moving without any stuttering. However, when I test the same on the server, I see the other player stuttering while moving, although my own controlled character does not have this issue. I changed the animation blueprint to make sure it wasn't the problem, but it didn't help. However, I noticed that when I use the default third-person character blueprint, everything works fine without any issues. I have changed many things in my own character blueprint. What would you recommend I check first to resolve this problem?

thin stratus
odd hamlet
#

a boolean repNotify will do something when the variable is set to true only? Or will it do something when marked as false also?

thin stratus
#

Whenever it changes, or every time if you set it to that in C++

#

If you flip it to true and then back to false before it gets considered for replication, nothing might happen

slim jay
thin stratus
#

Only if you modify them runtime

odd hamlet
slim jay
thin stratus
#

What exactly are you doing for that?

#

Cause Blueprints will always have corrections when changing values runtime

thin stratus
# slim jay

Are you setting the MaxSpeed anywhere else?

#

Cause just there would not be enough, even for BP standards

#

Sprinting is also a State, so you use an OnRep not a ClientRPC to send the data back

#

And without prediction you will always have a small lag before you start spriting and a small correction

#

But that's not solvable in BPs anyway

slim jay
slim jay
thin stratus
#

You are also not sprinting there, are you

#

Either way, modifying movement variables in BPs might always cause corrections. At least small ones when changing the value. If you do it wrong it might go async and keep jittering

slim jay
#

So i need to use prediction right ?

thin stratus
#

In theory, if you want proper multiplayer movement, you are required to use C++ and modify the CMC (or in the future hop onto Mover 2.0)

odd hamlet
thin stratus
#

It spawns 2 cause you are spawning one locally

#

Replicated Actors have to be spawned on the Server only

slim jay
#

thank you

odd hamlet
#

they are spawned via begin play

thin stratus
odd hamlet
#

isn`t begin play only for the server only?

thin stratus
#

100% not

#

It calls per Instance

#

Put a Print String into it and see for yourself

odd hamlet
thin stratus
#

Is the StaticMesh added runtime somehow?

odd hamlet
#

what does runtime mean?

thin stratus
#

While you are playing

odd hamlet
#

it`s still spawned like via Begin play