#multiplayer

1 messages ยท Page 133 of 1

long bone
#

Can't figure out what Unreal wants from me. an dhow to remove that red messages

echo snow
#

Is there a good way to test steam sessions without having to package the project and run on a second computer each time?

dark edge
#

each computer has engine installed and project (just like you had 2 dev machines)

#

just launch the uproject

lost inlet
#

You can declare a constructor or specify a default inline

#

Won't everyone need the detach call too? I would also recommend that your weapon just has a Drop function instead of if being the character's responsibility to set that up

brisk swift
solid river
#

It is normal to have two actors on the client when the actor that has bReplicates=true is spawned on the fly (dynammically with code) on the client without if(HasAuthority()) check.

However, for us as developers, calling if(HasAuthority()) check is not possible for the actor placed on the level at design time. I assume the engine does this check. Please clarify whether my assumption is correct or wrong. Thanks!

lost inlet
#

Yes?

quasi tide
#

If a client spawns the actor, then it'll only be on their version of the game

lost inlet
#

Because you get the server actor that's replicated and the client actor just exists on the client

quasi tide
#

Replication is only server -> client. Never client -> server

solid river
#

In other words, how the engine spawns actors that come with bReplicates=true and are placed on the level at design time? Are the running game instances filtered with if(HasAuthority()) such that there is exactly one actor on the client instead of two?

#

Or maybe actors placed on the level at design time and with bReplicates=true are spawned from GameMode class so if(HasAuthority()) is no longer needed as GameMode only exists on the server?

long bone
#

I know how to send start dedicated server with map via console comand. But ho wth send parameters and read them inside started map and dedicated server?

solid river
serene kestrel
# solid river In other words, how the engine spawns actors that come with `bReplicates=true` a...

When actors are part of a map package and have bReplicates=true they are considered NetStartupActors. When the Client and Server load the map file, those actors get created based on the data in the package. There should be no need to handle explicit checks for them, the spawning of them happens as part of the load of the level, the Server and Client will each end up with one instance of that actor

solid river
#

@serene kestrel Thank you.
I have a related question several days ago.

Assume that we have a non-replicated actor (with bReplicates=false).

I did the following:

  • Place one actor on the level
  • Spawn another actor dynamically with code (for example from level script's BeginPlay())

Result on client for the actor placed on the level:

Network Mode: Client
Local Role : ROLE_None
Remote Role : ROLE_Authority
Replicates: False

Result on client for the dynamically spawned actor:

Network Mode: Client
Local Role : ROLE_Authority
Remote Role : ROLE_None
Replicates: False

The roles are just swapped.

I am interested in the result for the actor placed on the level.
Because it has not been explained yet by others before, how the engine does this? why does engine need to differentiate the results by swapping the roles?

serene kestrel
#

It seems that in ULevel::InitializeNetworkActors() if the Actor is bNetLoadOnClient=true, it sets bIsNetStartup=true and then if it is the Client, it calls Actor->ExchangeNetRoles(true). The reason for this is that it's possible that the actor gets set to be Replicated=true later in the game. If that happens, then the roles will be correct and the Server owns this Actor with authority.

sinful tree
#

If you're spawning on Begin Play then you're spawning it on the client in which case the client would have authority of the actor.
A placed actor is a bit different. There is a "Net Load on Client" option which if you uncheck means the actor would only exist on the server. If it is checked, then the actor is spawned by the server but it doesn't replicate, therefore the server has Authority.

serene kestrel
#

So if you plan on making this Actor replicate later, then you likely don't want to mess with the roles. If you are not going to replicate it, there's probably nothing wrong with swapping the roles locally if you want the HasAuthority to work in all cases.

silk thunder
#

Hello! I have a small question about multiplayer that I don't understand, I created a projectile object, which prints the name of the object that it overlaps with. But I don't understand why the projectile is printing the correct name of the character it collided with on the server, but in the client it prints the opposite character

solid river
rotund onyx
#

hopefully quick question. In a listen server setup how can I check if a function is being run on the server?
I have recently learned this is not what HasAuthority is actually doing

silk thunder
serene kestrel
sinful tree
# silk thunder Shouldn't it be the same name on both of them?

Not necessarily. The display name of the object isn't the best way to reference actors as actors are normally named automatically locally which may not necessarily be synchronized on client and server. There is a net ID that is shared between client and server when referencing actors across the network that ensures you're actually referencing the correct actors.

echo snow
#

can multiplayer sessions be tested using steam with app id 480? Because I got game invites to work but can't get players to join other sessions

solid river
quasi tide
#

Yes

sinful tree
#

Yes because the actor is replicated, the server would replicate it to the client, but it's not loaded by the map.

quasi tide
#

Because it is still replicating

#

I typically turn it off for triggers.

#

So the triggers only exist on the server

#

Saves me having to do HasAuth checks ๐Ÿ˜ˆ

plucky prawn
# quasi tide Saves me having to do HasAuth checks ๐Ÿ˜ˆ

That's actually a pretty good idea. I'm using my mesh component for overlap events and the mesh needs to be replicated so I have to use auth checks :'( I'm too lazy to add in another component just for overlaps because then I have to resize it for each item and that's a pain

gloomy flare
#

Anyone have any experience using PaperZD with multiplayer

#

when playing as listen server and client it appears to be playing the correct flipbooks on both

#

I was handling it using this bit of code but it seems that it is replicating fine even without it so im slightly confused.

echo snow
#

A variable set to replicate needs to be changed by/from the server for it to automatically replicate to other clients, is this correct?

#

(and that variable won't replicate to other clients if it's set from the client) ?

dark parcel
#

Client changing the variable will only change the value for it self

#

Replication goes from Server to Client

echo snow
#

got it thank you

dark parcel
#

If client needs to change a variable, run a server RPC

#

the server will then set the variable

#

and will update the other clients of the new value when

#

well it goes back to the client that calling RPC too if you set the replication condition to None

echo snow
#

thank you for the graph ๐Ÿ˜„

stone hawk
#

hi all, after closing the .exe while in server map resulting in this warning msg .. what could be reason for this ?

plucky prawn
#

so i have a first person project and added a world model for my character however when i pick up the weapon, its not parented correctly. is there a good way to fix this? like do i parent it to a different bone for the owner vs other clients?

winged badger
#

Generally, youd have FP and TP mesh, with OwnerOnlySee/OwnerNoSee

plucky prawn
#

ye thats how it is but im not sure how to handle the gun to it appears correctly in both

#

ive ended up opting for a true first person camera for now

#

this probably isnt a "fix" but.... it will do

dark parcel
#

FP gun for FP mesh, TP gun for TP mesh

twilit radish
#

Fake it till you make it ๐Ÿ’ฏ

twilit anvil
#

there is even a checkbox for it in primitive mesh iirc so you don't have to handle that yourself

woven bramble
#

Guys, How can I disable AI's chase when the character dies?
The Unregistered Perception or Unregistered from sense did not work.

true hill
#

hello, i have a dedicated server hosted at some ip somewhere. Is there a way i can get this ip from inside the server's gamemode using a built in function etc? I cant hardcode the ip as a variable for reasons.

woven bramble
#

the game is multiplayer?

twilit anvil
#

the question is AI

woven bramble
#

I need to disable it for both server and client.
Run On Server or OwningClient, even these are a separate problem. Unregistered may not be working for this reason.

red sun
#

guys what happened to spatial os? they created this amazing server meshing system for us and then just disappeared

stone hawk
surreal plaza
#

I have been using the generic 3rd person template for my mp game and as I understand it, this works for good feeling client side representation and accurate server side control. Without considering netcode quality control, does that suffice for most projects? Is there a place where it fails?

dark parcel
surreal plaza
dark parcel
# surreal plaza I just build off of the third person character example. I am writing custom pro...

You will need to go deep into CMC to make it multiplayer ready. Even for simple thing as sprinting, you will need to toggle flags in FSavedMove
For jumping, if you are using CMC jumping, that should be fine out of the box.
More Info : https://www.youtube.com/watch?v=urkLwpnAjO0&list=PLXJlkahwiwPmeABEhjwIALvxRSZkzoQpk&ab_channel=delgoodie

https://discord.gg/uQjhcJSsRG
In this video I am introducing a series I will be making which explores the character movement component and how you can extend it in depth.

0:00 Intro
1:00 What is the CMC?
2:00 Do you need a custom CMC?
5:35 What does the CMC provide?
7:10 Outro

โ–ถ Play video
surreal plaza
young spoke
#

Is there a reason TopDown project out of the box doesn't work in Play-As-Client mode on ue5.1?

young spoke
#

"Allow Client Side Navigation" is off by default in TopDown 5.1. needs to be turned on to use Play-As-Client

young spoke
#

oh and enhanced input doesn't work with it, had to use legacy

hallow sand
# young spoke Is there a reason TopDown project out of the box doesn't work in Play-As-Client ...

Discord: https://discord.gg/CHm7RZJ
Project Files: https://www.patreon.com/forsakenreality

UE5 How To Set Up Top Down Template Multiplayer Replication

In this video we will learn how to Replicate the top down template for multiplayer in unreal engine 5. We will go over multiplayer replication for Click to Move and in future videos we will se...

โ–ถ Play video
#

Just hasn't really been updated to do so I'd imagine

weak linden
#

Does anyone know if the client side events for FFastArraySerializer are guaranteed to be received in the order they were executed in on the server?

I.E: If I remove something and then added something new, will the client always receive them in said order, the remove before the addition? I need to process the adds/removed in the order that they occurred in and since PreReplicatedRemove happen before replication, I cannot update the timestamp I added.

I also just tried changing the values, marking as dirty then removing but it seems FFastArraySerializer is smart enough to not bother running PostReplicatedChanged if something is removed.

short arrow
#

You should setup some sort of ID system to compare the entrys

weak linden
#

Well balls, I am using an id system for the entries already, just incrementing an integer every time an item has been added to the list, however, the issue I have is a little complex.

I'm using a plugin to generate a mesh (RealtimeMeshComponent) and I'm using the FFastArraySerializer to add/remove collision bodies to the mesh when "parts" are added/removed, the problem is, this mesh is generated each time a client leaves and then re-enters net cull distance and the FFastArraySerializer updates client side before the mesh has finished generating.

I've added a form of queueing client side but of course, if the bodies are removed or added out of order, then the client may or may not have a collision body where there is supposed to or not supposed to be, hence the need for a timestamp.

So far everything has been in order, both in the editor and on a real dedicated server but I'm certainly not wanting to rely on it since it's gameplay critical

short arrow
#

but I'm not sure why you can't just loop through the entire array each time to get the information you need?

weak linden
#

The list order itself does not matter in my scenario, it's the order the add/remove events are received.

short arrow
#

They will come in, in the order they were sent out if that's what you mean

#

the only thing that won't be reliable is how it's listed

hollow eagle
#

the order you add/remove items on the server will not match the order the callbacks are called on the client.

#

Full stop.

#

First, all remove callbacks are fired before add callbacks are, which are fired before change callbacks are.

#

Second, even within a single type of operation the order is not going to necessarily be the order the items were added/removed/changed in.

short arrow
#

what I'm referring to is if you added ID: 1, and then added ID 2, and then replicated it, the order isn't gauranteed. If you replicated it one at a time then you could potentially order it yourself

hollow eagle
#

There's no mechanism in the engine to do that with fast arrays.

short arrow
#

you're SOL friend :p

#

gotta figure something else out

weak linden
#

I was using reliable multicasts which poses its own problems (they were getting dropped as unreliable), but I guess I'm going to have to do some hard thinking

#

I guess I'm gonna have to maybe look at misusing PostReplicatedChanged for removes and then ack back to the server when I have received the message to actually remove it from the fast array, or rather than an ack RPC, a server side timer to clean them up.

#

Then again, I think I might just be overthinking this ๐Ÿ™„

short arrow
weak linden
#

I wrote a whole bunch to explain what I'm doing and whilst I was reading it, I have confirmed that yes, I am definitely overthinking this, add/remove happens as it should, each time, every time, the ids never get out of sync and collision is always updated correctly, the only time there is a problem is during actor re-creation after re-entering net cull distance, which is where all local client state is lost anyway.

#

Sort of a "premature optimization being the root of all evil" moment, except this is a premature "trying to accounting for things to go badly even though they likely never will" moment.

hushed rain
#

Anyone know why from the server viewpoint(listen server host), the client animations look fine in the editor, but when played on Steam the animations are like half-speed and not responsive looking?

dark parcel
#

there's a fix for that but I can't get it to work and the page is lost

#

kinda the reason why I download source code and trying dedicated server

#

The Server see things Raw, so Client will see other client fine. Client will also see server fine. But server will see other client jittering,~~ I think it updates the animation as fast as the netUpdate but I could be wrong~~

hushed rain
#

It's just weird because I've simulated 500 ping and the characters animation looked fine

#

Maybe it's related to maxclientinternet speed or whatever in the .ini

dark parcel
#

Found my convo with the legend

#

you can read his response

#

scroll down from there

hushed rain
dark parcel
hushed rain
#

Haha yeah ๐Ÿ˜ญ

weak linden
#

Is this not of any use? Pretty sure this was something I needed to set when I was working on a freelance project, just add this to the constructor of your character class.
GetMesh()->VisibilityBasedAnimTickOption = EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones;

#

This had to be set for my project/s since servers don't tick the bones/poses meaning socket locations were not correct for stuff like weapons, etc, I'm not sure if it fixes the same problem you're describing but I have never seen weird issues with anims playing at half speed on both listen servers and dedicated servers.

dark parcel
#

in my case that wasn't it but the CMC tick causing the jitter on server side

#

This problem only apparent when you play in network environment outside Editor

weak linden
#

I don't believe so, at least it wasn't when I originally started using it, however, I can be sure that I've never seen jittery animations except when I don't have X specific window/client/host selected/in the foreground.

dark parcel
#

have you tested in Steam for example? because you can't see it in Editor

weak linden
dark parcel
#

just to clarify, client to client see each other fine

weak linden
#

And before that I've always tested in a real networked environment

dark parcel
#

it's only the server seeing other client actor jittering

weak linden
#

Once again, I have not seen that problem with my listen servers

dark parcel
#

k

thin stratus
#

I have, in several projects. And Epic even confirms it.

hushed rain
#

I was thinking it might be related to my client net speed settings in the ini since it's only happening on steam

thin stratus
#

Character Pose on ListenServer, for Clients, is ticked via the Move RPC

#

At least it was for quite some time.

#

5.4 brings a movement refactor, so maybe you are lucky and it gets fixed/changed with that

dark parcel
#

๐Ÿ™

hushed rain
#

That would be glorious

thin stratus
#

The tick option that was just posted simply means that by default poses aren't ticked at all if the mesh isn't rendered

hushed rain
#

Are you aware if General Movement Component has this fixed?

thin stratus
#

Which can be problematic if you have ADS and a Dedi Server, since that never updates the bones then

thin stratus
hushed rain
#

Ok

weak linden
thin stratus
#

The original "fix" was to subclass the CMC, override the function with the TickPose call, commenting that out, then subclassing ACharater, overriding Possessed iirc and skipping the ACharater Super Call by calling APawn directly

#

But the CMC changed since then

#

And I never had to implement it again

#

Basically the issue is if your client has low fps or generally a lower update rate, the anims of that client will look jittery

#

Ping doesn't even matter

hushed rain
#

Is there a way to increase the update rate

dark parcel
#

Changing the update rate will scale the anim rate too I think =(, last time I did it run twice as fast (not in velocity but visually)

weak linden
dark parcel
#

Still happend in 5, I can confirm that

hushed rain
#

Damn well this problem is annoying I hope it gets fixed in 5.4 but I doubt it lol ๐Ÿ˜‚

dark parcel
#

did some test and decide to go with dedicated server route because it's still exhibit the same issue

weak linden
#

Okay, then I have no idea since it's not something I've been able to observe :/

hushed rain
#

Hmmm I think I started my project in 4.27... would the CMC be old even though I'm in 5.3 now?

weak linden
#

What way round is it? The client cannot see the listen server host at the correct rate or the host doesn't see the client at the correct rate?

#

I kinda wanna check it just for the funsies

hushed rain
#

The host doesn't see client animations correctly

dark parcel
weak linden
hushed rain
#

Steam

weak linden
#

Yeah, Steam works in the same network though, is this with two separate people in different houses testing or on two PCs that are on the same network

hushed rain
#

Yeah 2 different houses

quasi tide
hushed rain
#

I really hope if there's no good solution ๐Ÿ˜”

thin stratus
#

Otherwise, no

weak linden
thin stratus
#

Dedi Servers don't have that issue and you would need to have a low rate client to see it

quasi tide
#

I know I've heard rumors of it comin' in 5.4, as well as the UnrealFest possibly hinting at it as well. But still

weak linden
#

Either way, I'm super excited for Mover 2.0

quasi tide
#

I have a feeling it will be coming because of the new FN season as well. They did advertise a whole new movement thing to the playerbase

weak linden
#

If it intends on supporting physics based actors I am SUPER stoked, we've been using SmoothSync for a while and it works great for our use case right now, but doesn't support prediction or rollback, just client interpolation, plus it'd just be nice to not rely on 3rd party stuff ๐Ÿคฃ

sweet marten
#

how would I set the team of one player in my PlayerState when starting from my BaseCharacter? for context, the Character has interacted with something and now he should be set a specific team, that later also needs to stay for a seamless travel, so im guessing it needs to be in playerstate

elder sable
#

Hi, if a single property of a structure in a fast array change, does it replicate all the structure ? And can we know which property changed ?

kindred gazelle
#

hey gang, any way I can mitigate packet loss when it comes to replicated variables?
I understand that reliable RPCs are always pushed through, but I'm noticing that replicated variables aren't. Thats a problem cause I'm trying to do a buffer prediction system (where I track the histories of client/server value changes and checking if they match, so if a value change isn't replicated then there's a mismatch)
I'd prefer if I didn't have to do an RPC every time my variable is set, but is that the only sure-fire way?

weak linden
# elder sable Hi, if a single property of a structure in a fast array change, does it replicat...

No, they only replicate the single add/remove/change (it's part of the reason fast arrays exist) and secondly, yes, there's client side events you can implement, PreReplicatedRemove, PostReplicatedAdd and PostReplicatedChange, these exist both on the FFastArraySerializer itself and the FFastArraySerializerItem, check FastArraySerializer.h for a full description (the Lyra game sample also has several examples of this being used)

weak linden
# sweet marten how would I set the team of one player in my PlayerState when starting from my B...

I believe the PlayerState has a CopyProperties function that you can probably override for this, alternatively, there's also the GameInstance which you can use to store temporary data that can be used in spawn character requests to the server (you will have to implement that yourself.

My game has a flow something like this.
DefaultPawnClass set to none in GameMode class.
GameMode::PostLogin: Get player controller, call ClientPostLogin RPC.
PlayerController::ClientPostLogin: Get stored client side data from game instance then call server RPC ServerRequestPlayerSpawn with the previously gathered data as a parameter.
PlayerController::ServerRequestPlayerSpawn: Get game mode, call SpawnPlayer with any data that is needed to determine what to spawn.

elder sable
weak linden
elder sable
#

Ok so for big structs it could be better to split data into multiple arrays

twin juniper
#

hello, can anyone help me? i faced with the problems of animation blueprint is being slower on server, but on clients it works fine. i tried to play with input values of animations but that not helped and they were still half time slower. so as I think the problem is that animgraph is playing slower by some reason on server and i haven't found how to fix it yet.

weak linden
# elder sable Ok so for big structs it could be better to split data into multiple arrays

Multiple fast arrays or multiple regular TArrays? Regular will re-send the whole array, a fast array will only send the single property that has changed AFAIK, so it will still be faster to use the fast array, but you will want to split the data back out into separate properties within the fast array then marking as dirty and recreate the struct client side, @chrome bay (sorry for the ping) knows this far better than me so I'm sure he can point you in the right direction.

chrome bay
#

TArray will only send delta changes

#

TArray identifies elements by index, so if you shuffle elements around, that might create large deltas. Fast Array identifies elements with a unique ID, so deltas will be the same size - but base delta size might be larger.

#

TArray replication still has a lot of good use cases over Fast Array

#

Fast Array is poorly named IMO

#

Which one you should use really depends on the use-case

elder sable
#

Can we get the changes of a TArray ?

chrome bay
#

If you pass the old value into the ONRep function then you can iterate and compare yourself

#

How efficient that is depends on the data

latent heart
#

How do you pass teh old value as a parameter?

chrome bay
#

UFUNCTION() void OnRep_Whatever(const TArray<FWhat>& PreviousValue)

elder sable
#

In the OnRep function

latent heart
#

Oh and it supplies it for you?

chrome bay
#

Yeah

latent heart
#

Ah. Neat.

chrome bay
#

Just note that PreviousValue is the shadow data, NOT the member data - so if you changed the member locally, that wouldn't be passed in

#

Not an issue unless you're doing client prediction or smethigo

#

FastArray + TArray can both do delta replication of the internal struct btw

chrome bay
#

You can turn it on/off on fast array

#

By default it's on

elder sable
#

But that's annoying to iterate on the TArray to get those changes

chrome bay
#

To be fair, you don't get the discrete change in Fast Array either - you just get told WHICH element changed, but not what about it changed. There's also no previous value to compare to unless you cache it yourself.

#

Depends whether you care about bandwidth, efficiency or convenience I guess

#

As with all things, it's a trade off ๐Ÿ™‚

elder sable
#

Yeh i see, thanks !

chrome bay
#

It's a shame you can't get per item callbacks for TArray tbh, would be quite convenient

severe quiver
#

Can anyone tell me what these debugger messages mean

#

My component is set to be replicated, the method in which this is called is a Server RPC called by a player controlled inventory component

silver pendant
#

hey, what is the best way to replicate an event to all the players, to me I use that, but sometimes it doesn't work in all the events needed?

tardy fossil
#

so the client calls ROS_Shoot, which calls MC_Shoot on ALL clients, which all clients will call ROS_shoot again.. i think you may have some sort of RPC loop going on which is causing wayyy too many RPC's to get fired off and some get dropped

silver pendant
#

the first shooting in's the final one called

hushed rain
elder sable
#

Is there a way to have RPCs on an actor when using beacon connections ? I can only use them on the beacon client actor, even when i set the beacon client as net owner of the actor

hushed rain
twin juniper
hushed rain
#

Ah okay, good, then its not just me lol

#

Also this only seems to happen over the net for me, and also only if the clients PC is trash

twin juniper
#

as i already said only problem is in animation speed on server, cause it's half time slower than on clients

hushed rain
#

Yeah im getting the same thing, but if the client's PC is good then it looks fine on server for me

twin juniper
hushed rain
#

hmmm interesting

twin juniper
#

server somehow plays animation twice slower

#

but framerate everywhere is the same

hushed rain
#

yeah it makes no sense to me D:

hushed rain
#

I'll take it as it makes sense I guess. Don't have a bad PC or your animations look bad ๐Ÿ˜›

twin juniper
#

well i haven't even tested it yet

#

where can i find the .ini file to high up the maxclientnetrate?

hushed rain
#

in the config folder of ur game

#

default engine and defaultgame i think

twin juniper
#

i've set all up and nothing fixed

twin juniper
#

and also i fixed it by putting a float in all animations states, that speeds them up if it is a server and model isn't local

thin stratus
#

@twin juniper @hushed rain This is basically by design

#

The Server ticks the Pose of the Mesh via the Server Move RPC

#

The only "fix" there was, which I don't know how to do anymore cause the CMC changed, was to override the method where it calls TickPose, more or less copy pasting the parent method, commenting out the TickPose call.
And then also overriding PossessedBy or whatever it is called in the Character, calling APawn::PossessedBy directly instead of Super, cause ACharacter::PossessedBy sets that boolean that the TickPose isn't called on tick

twin juniper
thin stratus
#

Sure, if you think that works for you

#

I doubt your fix is the proper way, given the TickPose calls vary based on ClientPCs, so speeding them up is probably not the best call, but I leave that up to you

twin juniper
#

well it's going to speed up only on server's view not on the clients

thin stratus
#

Yeah, but I don't quite get how speeding them up is a solution.
TickPose doesn't rely on speed. It will move based on the time since the last call.
If you set it to 2x the speed for the Server, it will still not tick more often

hushed rain
#

Hmm yeah seems mine doesnt work in shipping but it worked in development O_o

twin juniper
#

i just need to speed up the animation twice

hushed rain
#

Welp guess i gotta wait until epic does something >? lol

thin stratus
#

If whatever you are doing works for you, I won't argue. ยฏ_(ใƒ„)_/ยฏ

hushed rain
#

Yeah hes just saying its a hacky fix

twin juniper
#

ye but i think speeding up animation is also cheaper for cpu

dark parcel
#

Not even a fix, it applies to all animation

#

I tried increasing the rate, it's either too fast or too slow or just not sync enough

#

i want server sees everyone all the same

#

Anyway gave up on it, just gonna use dedicated server

thin stratus
#

I don't even mean "hacky fix". I simply don't geth ow it's a solution

#

It's two different things

dark parcel
#

my brain not big enough to dive into cmc

thin stratus
#

But it doesn't matter talking about it if it fixes it for them

hushed rain
#

Yeah i guess my only hope is epic fixes it (oh god) or maybe GMC fixed it

#

or dedicated servers which are out of the question

young spoke
#

should a rts/moba with top-down pathfinding manage units as autonomous proxies with saved move buffering/replaying?
or is that overkill and they should just be treated as simulated proxies with reliable channel target setting

thin stratus
#

Even if you manually change the role, there are, iirc, a bunch of checks for if the Char is properly possessed

young spoke
thin stratus
#

Ah

#

Yeah if you do that manually the world is open to you :D

#

But I would not I think. If it's "slow" movement, and the Player wouldn't notice it that much due to not directly controlling them, I wouldn't bother

young spoke
#

i'm just wondering if its worth it. honestly my simulated proxies look better than my ap units when i do a "Bad" network emulation

#

even in out of the box top-down project, with "bad" network emulation the saved move replaying doesn't work well

thin stratus
#

Depends

#

The CMC works fine with high latency

#

Properly implemented additional movement should work fine up to 200ms+

#

"Bad" Network Emulation probably has Package Loss active, if you just use the preset, which is irrelevant for that kind of test

#

Package Loss will always f*ck things up. Package Loss testing is mainly to ensure that if things get lost, the Player doesn't get soft locked

#

Otherwise, Package Loss can be ignored

#

If you test the CMC with 1% package loss, it will already start having corrections

#

Which is normal

#

The point is that it only gets corrected, not locked

young spoke
#

eg. the character teleporting around everytime it replays the buffer

#

ill have to check my settings

thin stratus
#

The camera has 0 affect on that

#

It doesn't matter if Top Down or not

#

Idk what the default tempate from epic does

#

But I have worked on and shipped Top Down titles

#

I know that the CMC works fine with high latency

young spoke
young spoke
#

and sending the user target in reliable transport

#

then the next question is, should clients bother having a navmesh, or should it just exist on server.... currently i have it on both

thin stratus
#

If your Clients don't need the NavMesh, then it doesn't matter

#

But you might find other usecases for the NavMesh that Clients could in fact use

#

We used the NavMesh in the past for e.g. a "Route Ping", to guide the Player

#

Stuff like that

#

Depends on your Game though

young spoke
#

true

#

i haven't checked the size of a FSavedMove, i know it has around a dozen vectors/rotators though

#

did you ever have memory concerns, i.e. 100 units, each with ~32 SavedMoves at any given point? @thin stratus

#

(assuming you could possess more than one)

thin stratus
#

Hm, never had that many with saved moves. That's battle royal Level of possessed characters

#

But that's more a bandwidth issue than memory

#

Memory is usually plenty available

#

Unless you plan on supporting old gen Xbox :D

young spoke
#

yeah nvm its only 1088 bytes. thats tiny, even if you had 100x32 of them

mystic estuary
#

Hello, what's the correct way of checking whether a player state is controlled by a local user? Is it possible to do without using the associated player controller?

clever hound
#

On animation blueprint if I want to use root motion on a blendspace I need to turn on this setting but it says
Not suitable for network multiplayer setupsDoes it say that just because the values can't change in the blendspace every frame in multiplayer which would make the root motion inaccurate?
I want to use it for directional hit reaction animations so I just have 1D blendspace and I set the direction of it only when the hit happens and it is not a looping blendspace

grand kestrel
#

Maybe there will be a hacky way to do it but why

#

You should be able to get to the player controller from the player state

mystic estuary
#

Alright, thank you

grand kestrel
#

Also, feeding it an exact direction vector over multiplayer is asking for desync, because a tiny difference in a direction results in a huge difference in position

#

That's 99% of the reason prediction is so hard with vehicles, because they collide and deflect

clever hound
#

The direction set up only happens 1 time

#

Not every frame

clever hound
grand kestrel
#

That won't mitigate the issue unless the normal is 100% exact

grand kestrel
clever hound
grand kestrel
#

Yep

clever hound
#

Cant do that

grand kestrel
#

You can blend the animations together just like a blendspace does to generate them. Heck you can even do it using a blendspace and the record animation feature

#

Create a new anim graph, make it play the blendspace without loop, and record it playing

clever hound
#

Ok that is something I could do

grand kestrel
#

I've used this technique to generate anims many times, especially turn in place, blend a 90 turn with a 180 turn to get a 135 turn

clever hound
grand kestrel
echo snow
#

why does a network correction happen when player character bumps into corners?

#

I have no custom logic running, all default unreal engine movement code

grand kestrel
#

Simulate some latency and walk around (into objects), there should be a few corrections that you can't feel and don't repeat or cause anything the player will notice, that's normal
If it's intrusive, then its not normal and something is wrong

#

Make sure your latency simulation doesn't have packet loss for this test

echo snow
#

Thank you I see, I think these corrections are normal and not intrusive

rough kernel
#

i have a 4x4km world partitioned map with a bunch of generated partitioned foliage, when packaged the client build loads the level fine, but when running the dedicated server the process hangs after the first frame, no explainations just FUBAR, anyone else have similar issue with a "large" partitioned map on their dedi builds? (windows and linux are borked)

#

it loads all other non partitioned maps fine, can connect and alls well

mystic estuary
#

Hello, did anyone get any issues with making a blueprint array RepNotified? Anytime I add a new element to it it doesn't call the OnRep server-side, but it does client-side. Is there anything I can do about it?

mystic estuary
#

BPs

fossil spoke
#

Your BP Array is not calling OnRep for the Server when adding an element?

mystic estuary
#

Yeah, pretty much

fossil spoke
#

How are you adding the element?

mystic estuary
#

Through the add node

fossil spoke
#

In BP, OnReps should be called automatically for both Server and Client.

mystic estuary
#

Yeah, that's why I'm confused

fossil spoke
#

C++ is different

#

You need to manually call OnRep for the Server in C++

mystic estuary
#

Yeah, but I'm working in BPs now. I'll show you the example I'm running to get that result

#

This is my code to add the elements, and that's what I do OnRep

#

It's the player controller, and it's being created

sinful tree
mystic estuary
sinful tree
grand kestrel
sinful tree
grand kestrel
#

Yes

#

It should be calling it on the server for you too

weak linden
sinful tree
#

After a quick search on google, it appears that this has been happening since at least UE 4.7 (~2015) if not earlier, so I'm sure it's been reported several times.
I'm with you - it would make sense for it to do so, but I can only suppose that it's due to a technical limitation of how they need to be able to expose the "Add" functionality of arrays to blueprints (it's a template C++ function) and that doesn't necessarily translate into being able to call the OnRep on the server when the change occurs, much like how you don't get OnReps called on the server in C++ to begin with.
https://issues.unrealengine.com/issue/UE-39186

fathom aspen
#

It's marked as won't fix, because it's not a bug really, but by design. A desginer won't really know that adding an element array will call the RepNotify function locally, and hence you can never know what would be the side effects of such an action. Only SET w/ Notify will guarantee that. Not even Set by ref will do.

rough kernel
#

5.3

#

5 has been nothing but issues, was a big mistake upgrading ๐Ÿ˜’

weak linden
# rough kernel narrowed it down to probably something with pcg...

Ahh, I have yet to mess with PCG so I can't comment there, but handy to know there might be something crop up ๐Ÿ˜… gahh, UE5 has been a blessing and a curse, async physics, LWC, delicious exectaly what I needed and it came at the right time, by contrast, World Partition and the confusing information surrounding landscape HLODs, ehhh, not so much, they should have kept that in the oven a bit longer ๐Ÿคฃ

mystic estuary
fathom aspen
#

They should

solid river
#

To know whether replicated actor's code is running on a server (either dedicated or listen server), I often see most people use if(HasAuthority()) check. Assuming the replicated actors are always spawned on the servers.

Why don't we use if(GetNetMode()==NM_DedicatedServer || GetNetMode() == NM_ListenServer) check?

magic vessel
#

I'm trying to figure out some moderation tools for my players, I've been looking online for something to give me a template or something but I cannot find anything at all. I would of thought this is something that would be a prime example for a plugin or something, but apparently not. How would I get started with this very necessary part of a multiplayer project?

magic vessel
#

It's also more clear in what you mean and that is very important when you have other programmers coming to work with you on it, or when you come back to it months later

solid river
#

I see. However, if(GetNetMode()<NM_Client) still works as expected when we accidentally spawn replicated actors on the clients. But it is out of topic as I already mentioned that the replicated actors are always spawned on the servers.

thin stratus
#

HasAuthority is indeed context depending and should be avoided if the code should not run on clients even if the actor is locally spawned. However in reality this basically never really happens and HasAuthority does the job just fine then

magic vessel
#

You mentioned if it should not run on clients, but is there a limitation to HasAuthority running on clients other than it should be a redundant check?

thin stratus
#

So the check returns true for them

#

In that scenario only of course

#

NetMode would be better then

#

Or role rather I guess

regal moat
#

having some trouble with getting a projectile to home towards other players. so backstory my projectile is more or less a carbon copy of unreal docs and at first it was replicating correctly, both players can see the projectile and can get hit by it, now I gave it some code to home towards the other player and this is where the replication stops tracking where the projectile is on the player who joined side. that is problem 1.
the other problem is the projectile only homes toward the player who hosted the lan this happens when either of the players shoot it will only aim for the host. the way homing works is it targets playercontroller. I want to user tags from project settings and I tried assigning the tags whenever the players choose to either host or join but the tags dont seem to stick.

brisk swift
#

I'm using anim montages to enable and disable melee weapon collision to deal damage. It works perfectly with listen server and client but when I set it to only client it seems to get a lot more misses

umbral gale
#

Hello ๐Ÿ‘‹

I need to get a unique Network ID on an actor, and this ID need to be the same for client and server, I tried using GetWorld()->GetNetDriver()->GuidCache->GetOrCreateNetGUID(actor); but it gives me different ID on each clients/server, do you have any hidea how to achieve this ?

thin stratus
#

Does it need to be the actual NetGUID?

#

Otherwise maybe just since your own GUID as a member property?

umbral gale
#

I just need it to be the same on clients and server

#

Maybe I missunderstood what NetGUID is used too

#

Yes I can replicate a GUID property but I feel like it's dirtier than getting it through the Unreal network system

thin stratus
#

You are supposed to use the job board for this. Please remove this post and properly use the bot (explained in #instructions ).

echo snow
#

So the server can see all clients control rotations but I need to replicate the listen server's control rotation to clients?

thin stratus
#

The Roll theoretically if you care about it

#

Yaw comes from the Character itself.
Pitch is replicated already and can be accessed via "GetBaseAimRotation" iirc.

echo snow
#

Oh thank you, I was using GetControlRotation, so the value was 0,0,0 for clients because I assumed it was already replicated

#

GetBaseAimRotation works

modest coral
#

helllo i looking for a developer that can help me with making a injection for coins like GM to gift player coins via chat maybe parse,, or ,,,,can be also if know cmds line for ,, AdminCommand" that takes in a command string as a parameter.- -

dark parcel
#

read what the admin tell you

modest coral
#

and bro that was not a job post it just says a payment but for store my gosh

dark parcel
#

What store? I don't know the context but if you want someone to do work for you, you can do it via #instructions
If you are not willing to pay there is #volunteer-projects

#

anyway just saying

#

not here to attack you

thin stratus
#

That is correct. The channel here is not to ask for someone to do something for you. Payment or not.

#

That's what the Job Board is for, which does have a "no payment" category.

#

If that's not your goal, then that's fine, but your message reads very much like just that

modest coral
echo snow
#

I'm learning replication, is this a good way to correct movement? I'm assuming the projectile and rotation movement would be correct on all instances of the game unless it bounces off something so each time I send an rpc from server to clients

dark parcel
#

what you have looks like a guarantee de-sync but I don't know enough

thin stratus
#

Right now you aren't speaking with anyone, cause your request is as vague as it can get

#

Which is why probably everyone here will ignore that anyway, so good luck.

thin stratus
#

In theory you only need to ensure that you have a Root Component that is your collision, and a Mesh Component as a Child that is your Visuals.

#

Then you can set the "Interpolated Component" on BeginPlay or via ConstructionScript on the Movement Comp to the Mesh

#

The Bounce will in theory happen on everyone

#

So you don't really have to do any RPCs here

echo snow
#

I did this because I realized movement is slightly different on client and server sometimes when the object bounces. This is how I have it set up

dark parcel
#

Would enabling sub-step imrpove the experience?

thin stratus
#

but rather have a collision sphere for example be that

#

And the Mesh be a child of that

#

Despite that, you should also ensure that the Component and the Actor are replicated and set Replicate Movement to true.
There was sadly some stuff in C++ that I previously had to do to get this nicely working, but in theory you don't need to RPC

echo snow
#

I don't understand why that's causing a problem, it's using a simple collision

thin stratus
#

Last time I used this was to simulate a Ball

thin stratus
dark parcel
#

@thin stratus Question please, would it be viable to do Vaulting in Multiplayer using CMC without working with bits flag?

#

tutorial I followed in CMC does flags for everything, even for checking if montage is being played

thin stratus
#

So you have the flag already

dark parcel
#

I see I see

#

Right, I can probably use that

thin stratus
#

Last time I did vaulting I think I simply checked in the function that handles jumping (not the jump itself, but start and stop jumping), if I can vault via traces

dark parcel
#

Just want to know if I can make it a skill instead using GAS

thin stratus
#

And if so I vaulted, otherwise I jumped

dark parcel
#

w/o touching the CMC

thin stratus
#

Since that is already synced, it works quite well

modest coral
#

anything that i can be fine finally someone that knows anything that can work o r i can work with thanks

thin stratus
#

What a wild chat

#

I'm probably not high enough to see the link between Admin Commands to grant coins and a QR Code Generator Plugin.

thin stratus
#

Had to scroll a bit past the random shite

#

Please check the Mesh Component of your Character

#

There is a drop down for when to tick Bones and Pose iirc

#

That is usually set to only tick when rendered

#

Your "only Client" means a DedicatedServer is used and that doesn't actively render

#

So the Server basically doesn't properly tick the bones from your Montage

#

At least that's my best guess

dark parcel
#

So for dedi server, better use that setting for every component with collisions?

thin stratus
#

Not with Collision, mainly if it's animated

#

Like if you have a ADS for a your Weapon Holding

dark parcel
#

Got it ty

#

and I guess for every anim instance, better tick pose and refresh bones?

thin stratus
#

The missing hits from Dylan are probably cause the bones aren't at the same location on the server

thin stratus
#

Can't really say "Yeah always use it." As always "it depends"

dark parcel
#

Hmm I probably won't go that route. Client and server don't necessarily gonna be in the same place especially with ping

thin stratus
#

They only exist on the owning Client and the Server

#

You might also be using "GetPlayerController0" or jokes like that

#

Since that would explain that it always goes to the same

dark parcel
#

In our screen shooting another player head and running the trace on server gonan give different hit result

thin stratus
#

I don't think the Homing Target is actively replicated

#

So if you have some sort of replication here, you'd need to have a RepNotify variable with the Homing Target, and in teh OnRep function set that on Movement Component

thin stratus
#

You can decide to either punish the shooter or the victim

#

Or an inbetween fwiw

dark parcel
#

yup

thin stratus
#

But if you stand still, and you have an ADS Montage/Anim that lifts the arms

#

And you trace from the muzzle

#

You need that drop down changed

#

Even on ListenServer

echo snow
thin stratus
#

Cause if that ListenServer isn't there or doesn't look at you, you still have that issue

thin stratus
#

Or only on the Server?

#

I set the replicated component to be the visual mesh
The "Interpolated Component"

#

Also I'm not 100% sure if that alone is enough. I remember someone once saying there is a TickInterpolatedComponent or so, that is needed. But not sure that is exposed to BPs

#

I would need to open the engine

echo snow
#

Sorry I meant interpolated

thin stratus
#

Are you setting the Velocity on Server and Client?

#

The main thign you need to keep in mind with the ProjectileMovementComponent is that it doesn't replicate anything internally

echo snow
#

I'm calling this event from server to multicast, passing the actor that is calling it, then I'm casting that actor to a pawn and calculating the velocity from that pawns velocity

thin stratus
#

So you are sure this is called on both?

echo snow
#

This is how I call it

thin stratus
#

I think one of the main issues is that this is not properly exposed to BPs... Epic please

#
    /**
     * Moves the UpdatedComponent, which is also the interpolation target for the interpolated component. If there is not interpolated component, this simply moves UpdatedComponent.
     * Use this typically from PostNetReceiveLocationAndRotation() or similar from an Actor.
     */
    UFUNCTION(BlueprintCallable, Category="Game|Components|ProjectileMovement|Interpolation")
    ENGINE_API virtual void MoveInterpolationTarget(const FVector& NewLocation, const FRotator& NewRotation);

#

You are usually supposed to implement a bunch of functions on the Actor itself

#

And feed the MoveComp with stuff

#
    /**
     * Assigns the component that will be used for network interpolation/smoothing. It is expected that this is a component attached somewhere below the UpdatedComponent.
     * When network updates use MoveInterpolationTarget() to move the UpdatedComponent, the interpolated component's relative offset will be maintained and smoothed over
     * the course of future component ticks. The current relative location and rotation of the component is saved as the target offset for future interpolation.
     * @see MoveInterpolationTarget(), bInterpMovement, bInterpRotation
     */
    UFUNCTION(BlueprintCallable, Category="Game|Components|ProjectileMovement|Interpolation")
    ENGINE_API virtual void SetInterpolatedComponent(USceneComponent* Component);
#

Posting mainly for comments

#

E.g. I usually override

    /** Update velocity - typically from ReplicatedMovement, not called for simulated physics! */
    ENGINE_API virtual void PostNetReceiveVelocity(const FVector& NewVelocity);
#

And push that into the ProjectileMoveComp

#

For BP only, all you can really do is ensure that the Velocity is the same and that's mostly all. The "ReplicateMovement" bool might cause some teleporting since the Mesh isn't interpolated apparently in BP only...

#

Sorry, I don't think I can actually help much with BP only. BP only is and forever will be a limitation in Multiplayer.

#

Also, the function you posted, does that result in the same velocity for both?

#

I would suggest you rather have a Replicated Velocity that you set from the Server

#

And apply in the OnRep to the ProjMoveComp

#

To ensure they both have the same

#

If the Velocity of the Pawn is different on Server and Client due to Ping, you'll get different results

#

And the Control Rotation you are using is also not a good idea, rather use GetBaseAimRotation

#

ControlRotation doesn't exist on Simulated Clients

echo snow
#

If that doesn't work I will move this class to cpp

#

Thank you for all the help I really appreciate it

thin stratus
#

No worries, hope you can solve it

#

And hopefully that Mover stuff that epic makes will also replace this Move Comp

elder sable
#

Hi, i have a beacon client that takes 3/4 seconds to connect (locally) it seems long, is it normal ?

thin stratus
#

Is there anything special about that Client or is it just empty?

#

I would say it's not normal

#

Maybe it's normal

#

You could use Unreal Insights and check I guess what it's doing

elder sable
#

Will try Insights to see what happen

#

I would say it's not normal
Maybe it's normal
โค๏ธ :p

final bluff
#

Heyo

#

is it normal for the display name of the same Pawn to be different on Server in comaprision to Client?

#

When Actor overlaps it will print it's display name.
This print happens on both server and client , but they have 2 different names even though its the same actor.

sinful tree
final bluff
unborn nimbus
#

Are steam lobbies natively supported or do I have to have an intermediate level for the lobby?

final bluff
#

Im assigning a variable called "PlayerNumber" within the playerstate BP called "BP_PS_BaseSetup" .
When I simply cast to that PS and print the PlayerNumber variable it prints correctly. (Key Input 7)
But when I attempt to loop through the Player Array from the game state, It just prints the PlayerNumber variable assigned to the owner twice. (Key Input 6)

Any ideas on what im missing here and why its not printing all the player numbers from the player array?

#

Below is a video example

sinful tree
#

(I mean, can you show your code for it?)

final bluff
#

yes ! 1 sec

final bluff
sinful tree
#

Begin Play fires on both client and the server.

#

So client ends up overriding the value.
And because the server is always authority, it would set the same value for both (1) and the client would end up setting the same value for both as well (2)

solid river
#

A table based on my experiments. ๐Ÿ™‚ This is for actors that are not possessed by controller.

final bluff
#

ohhhhhhh i think i get it.

The host has authority , its going to run that begin play on all player states . Therefore all player states Player Number's assigned a value of 1

#

vice versa for client

sinful tree
#

Correct.

final bluff
#

If a game has 3 players , in reality is there not 3 player States. there is 9 unique player states total?
is this somewhat correct? or am i trailing off lol

#

because each client has there version of the 3 player states

sinful tree
final bluff
#

this was def my issue , just fixed my stuff

#

lets go!!!

mortal tusk
#

hey guys is something wrong with unreal networking like... just now?
i got this message when i try to join my own server

twin juniper
#

can someone help me? I can't seem to replicate the
"Get Hit Result Under Cursor by Channel"
The damn thing just wouldn't send to the server for some reason ; - ;

twin juniper
#

sec

#

tried changing the code in various ways but still nada

#

server event works just fine when I tested it out for sending a custom set variable, but using the cursor hit just wouldn't sent over

sinful tree
#

The problem is because event tick runs on the server and you're setting the cursor variable on tick but the cursor location is not something the server knows about clients.

#

Don't set the value on tick unless you want it set on the remote client, this way your RPC will send it to the server so the server then has the value and it can set its own copy of the value.

twin juniper
#

; - ;
thank you kind sir, you relieved me of my 2 days' worth of suffering

summer tide
#

I updated the my project with advanced session plugin and added the config and added the 480 appid. My steam invite is not working. So host creates the session and starts the game. Client goes to join session screen. Host invites client via Steam, and client accepts te invitation. Nothing happens. What else do I need to add or config?

turbid escarp
#

any idea to why my character not spawning with custom skeletal meshes ? when a client connects my server, player controller creates a widget that uses game instance to save custom skeletal meshes to their own game ฤฑnstances. then get this values from their own game instances to apply values with ''updategrromassets'' to my character bp.

#

for now my clients now whats their face,body meshes i can print that out but server can see clients character but not in right skeletal meshes. clients cant see server or their character. in my character bp everyting(grooms and skeleteal meshes) has ticked with replicated to.

#

any tips ?

fathom aspen
umbral gale
#

Hello ๐Ÿ‘‹

Does anyone knows how FNetworkGUID is working ?

I got this simple script

void UMyActorComponent::BeginPlay()
{
    Super::BeginPlay();

    AActor* actor = GetOwner();
    if (actor->GetIsReplicated())
    {
        FNetworkGUID net_id = GetWorld()->GetNetDriver()->GuidCache->GetOrAssignNetGUID(actor);
        
        FString actorName = actor->GetName();
        if (net_id.IsValid())
            UE_LOG(LogFlecs, Error, TEXT("[%s] - New net ID = {%d}, is Server  {%d}"), *actorName, net_id, IsServer());       
    }
}

But this output me the screen below, I don't understand why all my actors got different id on server and client, they should be the same right ?

echo bough
#

they are initialized based on FCFS basis, on clients, they will initialize the local player first before recieving replicated players from the server

umbral gale
echo bough
#

im guessing the call is too early

modest coral
#

hey guys anyone know any other way to make a api or payment communicate with unreal , either SQl , or by calling player name over parse , ofc the infidel that said the QR code wont work or relate sounds like a troll that not know anything of what the topic is , don't know anything of this topic don't opinion silly man keep smokeing crack ,A QR can call website and that can be the payout but that's not what i was looking for i looking for something more efficient and automatized

magic vessel
#

Would it be better to put a score manager on the game mode or state? If I wanted it to replicate, then the game state would be best but for server authorative validation it'd be best on the game mode. I've currently got the validation component on the game mode and the game state has a component that listens for this component and replicates it

#

I know my logic might be a bit flawed here, so that's why I'm asking for a second opinion ๐Ÿ™‚

pale nimbus
#

guys a friend of mine would like to create a portal that leads to another world. Both players if walk through the portal get teleported individually. How would you go about this in blueprints?

dark parcel
#

Another level?

pale nimbus
#

yap

dark parcel
#

Only one map can be opened in multiplayer

#

Unreal don't support multi world out of the box

#

Think of the engine like counter strike or any round based video game

#

Clients just follow the server

pale nimbus
#

So something like a mmo is not possible in blueprints?

dark parcel
#

Yup

#

Those MMO don't even use unreal replication system

#

They write their own

#

Unreal replication system is not made for MMO

pale nimbus
#

Thanks man

modest coral
#

you might want check open level by steam also wink wink ๐Ÿ˜‰ , but will talk and i will show my skills since its been question

true spade
#

Hi, I have a question, I implemented a weapon switching with UChildActorComponent, where I create it in the constructor and attach it to "GripPoint" socket, in begin play I set it's class etc.
GunComponent->SetChildActorClass(WeaponClass);
if (AWeaponBase* Weapon = Cast<AWeaponBase>(GunComponent->GetChildActor()))
{ // do things }

but the issue is when I run as a server everything works fine, weapon is at his socket, but if started as a client, the weapon has a large offset, as on the image. Is there any solution for this or what Im doing wrong? I also tried to GunComponent->SetupAttachment(Mesh1P, "GripPoint"); in the BeginPlay but getting same thing :/

zinc pelican
#

Hello. What are steps to create AutonomousProxy Actor on Client?

#

(Custom Autonomous Proxy Actor)

severe quiver
#

Did anyone else here run into the issue of a Server RPC being called later than when signaled in the code? I assume this has to do with some kind of lag or other stuff

#

In the picture above, OnItemDropped is a Server RPC

#

Instead of executing the function, the 2nd breakpoint is hit before the first function even starts executing

#

Then only at the end of this function does the server function get executed

#

Anyone know why this is?

viscid tapir
#

I'm currently working on a FFastArraySerializer. Do I need to MarkItemDirty() if I'm modifying a non-replicated variable ?

modest coral
#

nice way i also try this , but it lacks on something have u tired this method yet? this is not the method i was suggesting but a nice beginner a way to try obtain a simulation of a mmo BP only ๐Ÿ˜‚

quasi tide
#

That's why you redefine the common perception of what an "MMO" is. IE - these games that have like 20-30 players in a session and call themselves an MMO ๐Ÿง 

latent heart
#

What about the million unit RTS?

#

The solo-MMO. Comes out in 2050.

#

(was started in 1986)

grizzled stirrup
#

Looking over some example code

    Session->ClearOnDestroySessionCompleteDelegate_Handle(DestroySessionDelegateHandle);
    DestroySessionDelegateHandle.Reset();

In previous session examples, I've never seen this .Reset(); step once after clearing the handle, anyone know if there is a benefit to doing it?

unborn nimbus
#

I'm trying to setup lobbies in steam using OnlineBeacons. Do you typically close out the beacon after traveling to the game or leave it running? Having a hard time finding any useful information. I have the clients connecting to the host and I'm ready to move them to the actual play world.

grizzled stirrup
grizzled stirrup
unborn nimbus
#

Kinda hard to take a look without buying ๐Ÿ˜…

grizzled stirrup
#

I think from past experience (in response to your original question) that yes you can close out the beacon after traveling

#

But then there is the question of returning back to the beacon after a match is finished, you'd ideally want to stay in your party but not necessarily in a world together

#

So maybe in that case the beacon should persist

unborn nimbus
#

Well my situation is not a party but just a lobby, imagine Fortnite pre-game lobby but just in the main menu rather than in another level

#

The problem I'm running into is when I travel on the server, the beacons are destroyed since they're actors in the current level

#

so they lose connection, which makes sense

#

so there has to be some sort of transition that I'm missing. I'll see what I can find on their discord

twin juniper
#

I cannot damage my client :/ they wont take damage.

#

so far the damage test is this:

eternal canyon
dark parcel
#

Apply Damage is only called on Server

#

you can hover over the computer icon it will tell you

#

if you are On Client you need to call Server RPC in this case

#

did you say you cannot damage the client tho?
Server should be able to damage client, try to check your on Take damage event

echo snow
steel vault
#

Quick question for anyone who knows: I'm having an issue with spawning a replicated actor on the server and attaching it to a hand socket. It obviously works fine on the listen server, but clients don't seem to respect the attachment location, so it ends up off screen in random positions. Is there anything specific I should be watching out for to ensure it attaches properly? Or should I possibly be doing attachment on the client side as well after it replicates?

fossil spoke
steel vault
fossil spoke
#

You need to make sure that whatever your attaching to will exist on both the Server and Client as well.

stable seal
#

i need to assign different roles to both players. I wrote something like this but it doesn't work. What am i doing wrong ?

fossil spoke
#

If they both roll a 1 then they will likely end up the same

#

Depending on the value of whatever that bool is

stable seal
#

if there is a tagger, i need to assign a runner too

stable seal
dark edge
#

what you're doing right now is going to run that rng for every player

#

so you might end up with 2 taggers, or 0

stable seal
dark edge
#

You have to do this from somewhere else besides the character unless you want to use a race condition lol

stable seal
#

controller sounds better

dark edge
#

That wouldn't be much better as it'd still roll different random numbers. I'd do it in GameMode probably

stable seal
#

multiplayer is so complicated for me

dark edge
#

Tagging is different from choosing the first tagger

#

honestly just let the first character be the first tagger

#

beginplay -> has authority? -> if player pawn 0 = self -> true -> I'm the tagger

stable seal
fierce grove
#

How do you treat save from a dedicated server ? Really different from classic host-client save ?

#

Maybe Iโ€™m missing something

sinful tree
fierce grove
#

Thatโ€™s what I guessed so code can be the same if it can be hosted by anybody or on a server

#

Thatโ€™s was my assumption, asked to know if there was something tricky.

#

Loading through game Mode ?

grand kestrel
#

How you do it will depend on your game
Is it basically a singleplayer game where players have little consequence towards each other, but you want them to be able to play in the same world? You can probably let them save/load locally and then send the loaded data to the server
Is it a competitive game? Obviously you'll need a different solution, such as a database with account support etc.

dark edge
#

It can be as simple as a save file per player

#

like Minecraft

#

Minecraft makes a save file per world and one per player on the server

unborn nimbus
#

Where is the code that tells all connected clients to travel when you call ServerTravel?

fossil spoke
#

Which is called by UWorld::ServerTravel

#

That ultimately calls AGameModeBase::ProcessClientTravel

#

That calls the Client RPC APlayerController::ClientTravelInternal

#

Which does a Seamless Travel for that Client.

unborn nimbus
#

But doesn't ServerTravel travel ALL connected clients?

fossil spoke
#

If you read the code that I linked you would see that it calls it for all Clients yes.

unborn nimbus
#

ah ok. the way it was worded made me think just the client calling ServerTravel

#

Thanks

fossil spoke
#

Clients dont call ServerTravel, only the Server would

#

Which would make it not a Client

unborn nimbus
#

Right

#

ListenServer

#

fake client

fossil spoke
#

Still not a Client

#

Its a Server

unborn nimbus
#

ok

fossil spoke
#
APlayerController* AGameModeBase::ProcessClientTravel(FString& FURL, FGuid NextMapGuid, bool bSeamless, bool bAbsolute)
{
    // We call PreClientTravel directly on any local PlayerPawns (ie listen server)
    APlayerController* LocalPlayerController = nullptr;
    for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
    {
        if (APlayerController* PlayerController = Iterator->Get())
        {
            if (Cast<UNetConnection>(PlayerController->Player) != nullptr)
            {
                // Remote player
                PRAGMA_DISABLE_DEPRECATION_WARNINGS
                PlayerController->ClientTravel(FURL, TRAVEL_Relative, bSeamless, NextMapGuid);
                PRAGMA_ENABLE_DEPRECATION_WARNINGS
            }
            else
            {
                // Local player
                LocalPlayerController = PlayerController;
                PlayerController->PreClientTravel(FURL, bAbsolute ? TRAVEL_Absolute : TRAVEL_Relative, bSeamless);
            }
        }
    }

    return LocalPlayerController;
}
#

Loops through all Players and calls that RPC

unborn nimbus
#

So how would this work if you have a lobby in the main menu using OnlineBeacons since they don't create player controllers for the clients connecting

fossil spoke
#

In that case they arent Clients either, because they arent connected to a Server.

#

A Beacon is just a Window into another instance of Unreal essentially.

#

You can pass data through the Beacon.

#

Thats it.

#

Its a "soft" connection

#

Where as being literally connected to a server would be a "hard" connection

#

So the rules are different then

#

If you are using Beacons, you need to literally tell the users on the other end what they need to be doing.

#

If you have a Host and Party Members (that might use Beacons as part of a Lobby so they can chat etc).

#

The Host would find a Session to join.

#

Once its found one, it would communicate the Session info the the Party Members

#

So they can also find it and connect to it.

unborn nimbus
#

so in my situation, the lobby host is also the session host

fossil spoke
#

So then you would just tell the Party Members to search for the Hosts session?

unborn nimbus
#

well there is no host session yet

#

because it's still in the main menu

#

well the session exists, but the map hasn't been loaded yet

fossil spoke
#

So?

#

Load the map, tell them to join afterwards

unborn nimbus
#

so when you load the map, the beacons fall apart because the world where the beacon actors live is being destroyed

#

I tried putting the beacon actors into the SeamlessTravelList and that didn't work either

fossil spoke
#

Thats your problem, you need to manage your Beacons better.

unborn nimbus
#

Do you have any suggestions of how I might do that?

fossil spoke
#

The travel list is how you manage it

#

Thats what its for

unborn nimbus
#

Not sure what I did wrong then. I created an array in the game mode and had the related beacon actors add themselves to the array when they're created. Then in the GetSeamlessActorList or whatever the method name is in the game mode, I appended that array

fossil spoke
#

๐Ÿคท Maybe you need to debug it a bit further

unborn nimbus
#

The only thing I can think is that they're getting GC'd after the travel since it's a new gamemode type so I'll probably try storing them elsewhere

crisp shard
#

i just realized i can start the same quest twice while im already doing that quest and im trying to solve this. im thinking a boolean like "on quest" but the issue with this is that they can do multiple different quests at once and choose to track whichever they want so the "on quest" would stop them from starting a second quest until they completed tht quest (this is multiplayer, where each player has their own quests)

would anyone know a way to store this variable maybe in a different place? im just trying to figure out how i can make sure they can't do start a quest while they are already on that same quest, but they can start other quests etc

sinful tree
crisp shard
sinful tree
#

So in the quest system that I was building, each quest is a data asset, and that data asset is given a unique ID (just an int32).
If the quest is active, a "Quest State" is created which replicates only to the owning player of that quest. An array is managed locally on the client and the server of all active quest states for that particular player. The QuestState contains the quest ID and other details about the quest, like the objective progress etc.
Any logic I need to validate if a player is on a particular quest, I just have to get the local array of active quest states, loop through it and check for that particular ID. If there is a QuestState with the associated ID active, then the player can't request to start that quest again.

soft notch
#

Hi everyone. Is there character movement error correction in character movement component? Character movement replication looks fine at first, but when player slightly touches an object or corner, he can stay in that place on his client, and run further on the server or other clients. What can be the problem?

fierce grove
#

Hey there quick question:

I want a client to travel to a solo map for some time (open level or client_travel...), how to make that client come back to main server map?

#

well ok I can also do that but how the client can come back another travel ?

#

Client 1 is connected to main map .
Client 1 enter private quarters > open a local map...
Client 1 goes back to main map.

#

is it something that people do?

fierce grove
#

make a VM with another steam ๐Ÿ˜‰

soft notch
lost relic
#

I am creating a session with my UMG here!, which seems to be working as I get the correct print message, and then once in the level Im trying to find the session in the server browser here, But its not displaying but keeps giving me a server detected message,.

tacit nova
#

If Im making an online RTS
is it better to just simulate inputs each tick, send inputs each tick to each player and let each client calculate everything manually?

#

Eg this guy pressed LMB at 24:35, calculate all the movements on his client side instead of sending each units position

#

no fog of war btw

lost relic
#

Help Im trying to find sessions In VR but it never finds any?

#

even this finds nothing , What Am I doing wrong?

bright fern
#

Hi,
I'm trying to teleport my users to a point on the map but I didn't find how to do it in multiplayer
It seems that I'm wrong with the server part of the teleport
Do you have any clue?

#

I had the same problem with sprinting but I found the solution
I try to do the same with teleport but nothing work

bright fern
#

I'm sorry, I found my problem

true stream
#

I feel like I just learned something about multiplayer but not entirely sure, if someone can shed some light a bit if Im right:

  • inside PC (blueprints), I do a getActorsFromClass, set a variable with the actor placed on the level, then I call a RPC with some info regarding that actor (position), and it fails.

  • same thing as above, this time I spawn the actor inside the PC instead of fetching it from the level, it works just fine.

Is this somehow related to ownership?.

gleaming oracle
#

Hello does anyone have any idea why my character shrinked after i putted idle-walk-run anim to it?

vagrant grail
#

Hey quick question :
I'm watching a tutorial where the person is doing the counter of players for a battle royal at the top (so the counter before the match showing how many players are in the game) and created 2 variables in the gamestate being CurrentAmountOfPlayers and MinimumRequiredPlayers and what confuses me is that he made both variables replicated, and it confuses me because I though the GameState was both on server and client, isn't that the case ? Or it's the case but variables there have 1 version for the client and 1 version for the server which needs to be replicated to be synchronized ?

Please ping me if any answer ๐Ÿ™‚

quasi tide
#

The object is replicated. You still need to tell Unreal which variables need to be replicated

#

If there is never ever going to be a way to change the minimum required players, then it probably doesn't need to be replicated and could just be read locally. As you'd most likely set the default value.

vagrant grail
#

But what if instead of replicating CurrentAmountOfPlayers, you get the GameState each time and get its value, wouldn't it give the right value when that variable changes ?

quasi tide
#

No. Because the value is not replicated

vagrant grail
#

Oh interesting, thank you ๐Ÿ‘

#

Also he's checking if CurrentAmountOfPlayers is bigger than the MinimumRequiredPlayers to start the game in the GameState, aren't we supposed to do that in the gamemode rather ? ๐Ÿค”

quasi tide
#

Honestly it doesn't matter too much.

#

You typically put stuff like this in the gamemode, sure (because it only exists on the server itself, so safer)

tardy fossil
#

probably due to it being a video tutorial and trying not to make it too hard to follow

quasi tide
#

But you can certainly check the starting condition inside of the gamestate and then have the gamestate tell the gamemode to start the game as well.

tardy fossil
#

lots of youtube tutorials i find hard to watch cause it seems like they take shortcuts to make the video easier to follow

vagrant grail
echo snow
#

The documentation makes it sounds like an unreliable RPC will never be called if there's a problem with the network. Is this true or will the call eventually execute?

By default, RPCs are unreliable. To ensure that an RPC call is executed on the remote machine, you can specify the Reliable keyword

eternal canyon
unborn nimbus
#

@fossil spoke Ok, I got the beacon stuff persisting through world changes.

The issue now is that when the Host moves levels and tries to send an RPC through to the clients, the error is that the RPC can't be sent because the BeaconNetDriver doesn't have a valid world. Note, during this step, the BeaconNetDriverpoints to the current World but the World does not point at the BeaconNetDriver.

I added logic so that when the BeaconHost moves worlds, it updates the BeaconNetDriver's world. I no longer get the above error but now the error is that the RPC cannot be sent because the client isn't in the same world as the host.

To fix that, I added a delay after the client receives the Connect RPC. This seems to work correctly but then the client tries to connect after a few seconds and it's successful but then the server immediately crashes because the current World has no NetDriver.

To fix that, I would assume I call UGameInstance::EnableListenServer(true) like I was prior to setting up this lobby stuff. The problem there is the new NetDriver interferes with the BeaconNetDriver and sends this error.

LogSteamSocketsAPI: Error: SteamSockets API: Error Cannot create listen socket. Already have a listen socket on P2P vport 7777

Which makes sense because the BeaconNetDriver is listening...

#

Ah because they're listening on the same port...duh

modest coral
#

i want to thank @grim saddle for helping set up a my mmo Store and administer table and even a mini tool to track player connected Truly genius guy

dark edge
#

Aim Direction should be unreliable because by the time you notice that it got dropped, it's out of date anyway

echo snow
#

Opening a door in a level should be reliable then because it's not spammed and if it gets dropped the door will stay in its current state until another rpc successfully gets called?

dark edge
#

Yes, that should look like TryInteractWithObject(TheDoor)

#

You would be passing the door ref to the server in the rpc, or you could just pass the fact that you pressed the interact button and let the server do the interact targetting for you but that could feel goofy

regal moat
#

need some help with a homing projectile method talked about this a few days ago and was given good advice. it now homes towards player pawn but I dont know how to get the homing projectile to home toward other players. if a client joins they can shoot and it will home towards the host but when the host shoots it also aims towards itself. how do I differentiate between the 2 to make homing work properly?

dark edge
regal moat
#

it is based off of a low of experimentation with my original tyring to get player controller but here is what was created so far:

AActor* AAdrian_Projectile::FindTarget()
{
    UE_LOG(LogTemp, Warning, TEXT("Hosting"));
    APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);
    APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(this, 0);
    if (PlayerPawn)
    {
        ACharacter* PlayerCharacter = UGameplayStatics::GetPlayerCharacter(this, 0);
        if (PlayerCharacter)
        {
            return PlayerPawn;
        }
    }
    else
    {
        ACharacter* PlayerCharacter = UGameplayStatics::GetPlayerCharacter(this, 1);
        if (PlayerCharacter)
        {
            return PlayerPawn;
        }
    }

    return nullptr;
}
dark edge
#

What's the most simple and general rule for what the projectile should choose as target?

regal moat
#

other player. the game is a 1 v 1 type of shooter. it only needs to home towards whoever is the other player

dark edge
regal moat
#

yes

dark edge
#

Are you setting instigator?

regal moat
#

no

dark edge
#

remember the client doesn't have both playercontrollers on their machine, just the playerstates and pawns

regal moat
#

ok. so I just need to figure out how to set instigator. and use this to correctly home the projectile

dark edge
#

The point is you need to figure out which pawn is yours and home to the other one

#

yours can be the one set as instigator

#

or the local one

true stream
#

if I have an actor that spawns another actor, should both be replicated or its enough for only the initial actor (the spawned by action originated from the player) to be replicated?

#

whats the correct approach when thinking about this

sinful tree
# true stream if I have an actor that spawns another actor, should both be replicated or its e...

Replication only happens from server to client. If you spawn an actor on a client, it will not be spawned on the server and replicated to clients even if it is marked as replicated. If you spawn an actor on the server that is marked as not replicated, then it will not replicate to clients.
If you want an actor to exist on the server, and have clients be able to access that actor and read values from it, then it needs to be spawned by the server and marked as replicated.

true stream
#

what Im curious about is what happens if those actors want to spawn something on their own, example, a barracks that spawns units.

#

they dont need your user interaction, so that means they shouldnt be replicated?

sinful tree
#

If you want other clients to see the actor, it needs to be spawned by the server and marked as replicated.

true stream
sinful tree
#

I can guarantee you it doesn't. You are likely spawning the actors locally, and not a replicated copy.

true stream
#

right, in the event that the game is deterministic

#

it should in theory work

#

right?

sinful tree
#

Sure. This then means that the server would not have any authority of those actors.

true stream
#

right

sinful tree
#

This also means you can't reference that actor across the network at all.

true stream
#

so.. if one of these secondly spawned actors would cause damage to another actor on the enemy team, this logic would probably get more difficult or different

#

or the damage will be "invisible" to some client

#

so maybe I should also run the RPC whenever the actors spawn a second actor

#

to make sure I dont run into problems

elder sable
#

Hi, if i change a replicated value then destroy the object, will the value be replicated before the destroy event ?

hollow eagle
#

not necessarily

elder sable
#

mhh

#

So if i have to send/update a value before destroying i have to use a rpc i guess

dark edge
#

just don't destroy it right away

#

A reliable RPC might be guaranteed but I'm not sure

elder sable
#

it's destroyed server side

#

i don't manually destroy on client side then

dark edge
#

Yes but if the destroy message makes it to the client before the RPC message does then what

elder sable
#

Well the client send a rpc to the server

#

So it's destroyed after

shadow hatch
#

for a transmog / shapeshifting system where the original skeletal mesh of a character is changed would it be better to use a repnotify over lets say a replicated variable with a multicast to convey the visual change to all clients including those that arrive on the scene later?

fossil spoke
#

@elder sable @dark edge Just call TearOff() first. Then you can destroy it. The Client will have to destroy itself when it receives the last state.

grand kestrel
#

Lyra replicates float ServerFPS;
But from what I see, its only ever used by performance stats
Is there a reason why this wouldn't be incredibly wasteful other than dev purposes?
It also is the lone reason why they need their gamestate to tick from what I can see

#

Is your DM a red van that says free candy or something

#

Well that's a super weird thing to come here and say

dark edge
#

How to make advanced online?

worldly hollow
#

Hey guys!
I was hoping someone could help me. When I use either of these nodes, the result seems to be the same. What exactly is the difference between these two? If you are the server, you must have authority right? Therefore if you have authority, you must be the server?

grand kestrel
#

I see that the newly arrived alien is learning to blend in with the humans
A long road ahead

#

Nothing

#

The trolls get stranger each year

worldly hollow
grand kestrel
worldly hollow
grand kestrel
#

<@&213101288538374145> there is a low effort troll here

#

Go to #lounge , this isn't the place for it

true spade
#

Hi I have a question, I'm making weapon swap with this implementation ```cpp
PrimaryWeapon.Ammo = WeaponInHands->GetAmmo();
PrimaryWeapon.ClipSize = WeaponInHands->GetClipSize();
GunComponent->SetChildActorClass(SecondaryWeapon.WeaponClass);
if (AWeaponBase* weapon = Cast<AWeaponBase>(GunComponent->GetChildActor()))
{
WeaponInHands = weapon;
WeaponInHands->SetAmmo(SecondaryWeapon.Ammo);
WeaponInHands->SetClipSize(SecondaryWeapon.ClipSize);
WeaponInHands->OnAttachWeapon(this);
UE_LOG(LogAlphaCharacter, Warning, TEXT("Ammo: %d"), WeaponInHands->GetAmmo());
}

SecondaryWeapon = PrimaryWeapon;
PrimaryWeapon.WeaponClass = GunComponent->GetChildActorClass();
PrimaryWeapon.Ammo = WeaponInHands->GetAmmo();
PrimaryWeapon.ClipSize = WeaponInHands->GetClipSize();
WeaponInHands->Multi_CopyPropertiesToMesh(WeaponInHandsTps);```

Where those primary and secondary weapon are replicated structure with only class and 2 ints (also WeaponInHands is replicated as well) and it's a server rpc. The problem Im getting is when I switch weapons on client the ammo is always full till you fire one bullet and then it's correct, but that log there, is printing correct bullet number. Is there any way of force update a variable on the client? P.S gunComponentis a UChildActorComponent

urban palm
#

People be nice to each otherโ€™s. Thanks!

grand kestrel
#

HuhBlock
Its not a matter of being nice, that person is just trolling the chat

faint eagle
#

I have a replicated array implemented with FFastArraySerializer. The array itself gets filled up only at begin play and then only elements properties change so no adds and no removes. But after profiling with unreal insights it seems that for some reason sometimes the array replicates entirely (according to the size of the packet) and it happens kinda frequently in between individual items replication. What could cause it? ๐Ÿค”

chrome bay
#

Relevancy perhaps?

faint eagle
#

hmm, i don't think so. I tested with only listen server and client and there wasn't a situation where either client or server was close to the replicated actor and the server/client wasnt

#

at least from how I understand relevancy - it shouldn't be the case here

chrome bay
#

And the actor doesn't go dormant or anything?

faint eagle
#

unless it does it automatically for some reason - it shouldn't

#

besides, even if it went dormant, how could it cause the whole replicated array to be sent over again and again?

chrome bay
#

Dormancy closes the actor channel, it just doesn't destroy the actor on the client. When the channel is closed all replication state is lost so it'll be sent again when the channel opens.

faint eagle
#

and I must add, that sometimes i can see in insights that there are packets of adequate size, like I can tell "ok at this moment one element has changed it's ok"

faint eagle
chrome bay
#

Nah dormancy is opt-in so you should be fine. Relevancy would be my bet usually. Also just to check, the fast array is a member property? It's not embedded in another struct or anything?

#

Fast Arrays can only be members of UObjects to work correctly

faint eagle
#

yeah fast array is a UPROPERTY(ReplicatedUsing) in an actor

chrome bay
#

Yeah ok, should be fine then. And how large are the packets?

#

Fast Array does have some base overhead

faint eagle
#

~10k bits, and the array itself is 80 elements of 48 bytes per element

chrome bay
#

yeah kk. I would double check to make sure it's not just relevancy first. If not, check you aren't accidentally marking every item in the array dirty or something

#

Also, you definitely defined the TStructTypeTraits and NetDeltaSerialize functions?

faint eagle
#

yeah, I double checked with the NetSerialization.h and a manual I found on the internet

chrome bay
#

So long as it's showing up in insights as fast array serializer you should be fine

#

All I can think of really

faint eagle
#

hm, how do I check that?

#

I mean how do I verify in insights that the array is replicated as/with a fast array serializer?

chrome bay
#

I haven't got a screenshot to hand but you should see things like 'ChangedElement' etc.

faint eagle
#

hmm, i'll look for that

chrome bay
#

Just make sure you have this defined too:

struct TStructOpsTypeTraits< FExampleArray > : public TStructOpsTypeTraitsBase2< FExampleArray >
{
       enum 
       {
            WithNetDeltaSerializer = true,
       };
};
faint eagle
#

it's all here

chrome bay
#

To be absolutely sure, you can breakpoint NetDeltaSerialize to ensure it's being called

#

yeah kk, in that case the only reason I can think of would be relevancy

faint eagle
#

can you elaborate how exactly relevancy can be of issue here? The replicated actor is an AI character, AFAIR they have very far net clipping distance and high priority, and since the levels are not that big I don't really see how client and listen server being close to each other can end up in a situation where the replicated AI character will drop out of relevancy for the client ๐Ÿค”

chrome bay
#

Well ultimately if the character is not relevant for the client, it's actor channel will close destroying the replication data. When it opens again, everything will get resent

#

You'll likely see other properties replicating as well though, I think insights shows when the channel is being opened

faint eagle
#

yeah, I just thought that for an actor to become irrelevant, i'd have to be very far away from the client

chrome bay
#

There are other conditions too but yeah that's the main one

#

The default distance is only 150M, so not that far

faint eagle
#

hmm, is it possible to somehow preserve/update only changed replicated properties in case of losing/gaining relevancy and hence closing/opening actor channel?

#

there won't be more that 1 instance of this actor so maybe I could get away with that

#

but then again, can in be the relevancy issue, if, judging by the packets size, there is a 10k bits packet at 11m 26s, then 3 small packets in the following 3 seconds (~200-400 bits), and then 3s later at 11m 29s boom - another 10k bits packet ๐Ÿค”

#

also another question. before profiling I noticed that my OnRep_ReplicatedArray triggers very often, I didn't pay much attention to that, but is it ok for a FFastArraySerializer to trigger OnRep of the array itself if I don't add/remove any elements?

chrome bay
#

Hmm well it should only trigger if data is actually changing

#

And also requires that you mark either an item or the array dirty server-side.

faint eagle
#

well properties in individual elements do change frequently, but should it trigger the OnRep function?

chrome bay
#

Well that sort of explains it then, if each element is changing often, that could potentially trigger large updates

#

For Arrays which have fixed sizes and do not shuffle their elements, normal TArray replication usually works better tbh.

#

And yeah any change to the array or it's elements will trigger the OnRep

faint eagle
#

well, the problem is that I need to react to individual elements changes, so I use the PostReplicatedChange of the FFastArraySerializerItem

chrome bay
#

The main benefit of fast array is that you get per-item callbacks about changes, and it's more optimal for large arrays where elements are removed from the middle of the array, since it doesn't preserve order.

#

But those benefits come with some overhead

#

You can still react to individual changes to a TArray, you just have to do the comparisons yourself.

#

I still wouldn't expect to see a 10K update though either way

#

Unless the element is enormous and has lots of changed data

faint eagle
chrome bay
#

No, I don't know where that myth started but TArray doesn't replicate entirely everytime an element changes, it also does delta replication.

faint eagle
#

huh

chrome bay
#

TArray also only replicates changes. The difference is that TArray identifies items by Index, so if you remove something from the middle of the array, it's hihgly likely all elements after that one will trigger a 'change'

faint eagle
#

so I could just have OnRep_MyArray(const TArray<FMyElement>& OldArray) and manually (since there are only 80 elements) find the changed ones?

chrome bay
#

You can yeah

faint eagle
#

huh, ok, I'll check a couple of things with the fast array, and if that doesn't help, I'll try to switch to regular array, thanks for the help

chrome bay
#

You'll probably find the updates will be much smaller anyway. TArray deltas are generally smaller so long as you aren't changing the order of elements.

#

The latter is what Fast Array is meant for typically

faint eagle
#

yeah yeah, in my case, array's amount and order of elements is changed only at begin play

chrome bay
#

yeah in which case I'd probably go with TArray myself

#

Or even make it a static array, to save a tiny bit extra

#

static arrays will be "unfolded" into individual members so no index is needed to identify the item. Don't think that works with OnRep though.

faint eagle
#

oh, i'm a dumbass, it seems I do mark all elements dirty on the server in one case where I forgot to add a check if element actually needs to change. well, thanks for sharing the knowledge anyway

queen escarp
#

is there a faster way to mark variables for replicated ?

elder sable
#

Make an editor module that create replicated variables :p

#

Or mark a selection of variables as replicated

#

Or improve your apm as Laura said :p

queen escarp
#

ha

#

when i played sc2 alot i had 270 apm

#

crazy

#

hey another issue

#

this is a common one im always having for some reson

#

this is a "freshly" made project

#

the right screen is "listen server"

#

the left client

#

se how "clitchy" or laggy or something it is when im running

#

stutters*

#

ideas ?

dark parcel
#

Client seems to get corrected 24.7 by the server.

You shouldn't replicate w.e causing the lag (eg. The rotation) for the local client.

Local client will rotate as it please , send the value to server via rpc. Have rpc replicate the values to everyone except the client that send it. To avoid snapping on other clients, make the rotation interpolate to the incoming value

queen escarp
#

hmm

elder sable
queen escarp
#

@dark parcel

#

so yeah this is how im chaning the rotationm

#

your saying not do it locally to

dark parcel
# queen escarp hmm

Think about this if you are just replicating a variable to rotate and have it replicate to all client.

Your client rotate over an axis over some time.

Time 0, player rotate by 5 degree. Send the value to server, server hasn't got anything yet in time 0.

Then time 0.1 server gets the value. 5 degree to one of the axis and going to replicate this to all client.
Still at time 0.1 the player that send the rpc already rotate by 10 segrees.

Now time 0.2 player rotated by 15 degrees at this point. Server now comeback with the replicated value which is 5. Now wat happend is tour client get rubber banded back to 5 degree rotation.

queen escarp
#

yeye that makes sense

#

thats what i figured was the problem

#

im not sure how to solve it

dark parcel
#

I would pay some money to get Stephen tutorial. It really helped me to understand the challenges in multiplayer game.

Not saying that I can do MP atm, infact haven't done a single MP yet. But when I'm stuck I will fall back to his explanation.

queen escarp
#

yeah but i mean is this what r talking about basicly ?

#

but this is wrong

#

instead of locally controlled i have to chek is self or something

dark parcel
#

Again im not in a stage to make multiplayer yet. But I would have 2 variables. One for the client, the other for proxies. The one for proxies, send server rpc and have clients interpolate to the incoming value

#

Mp is hard , I am happy to spend some money to get some insight which would take me very long time to understand

queen escarp
#

hm but what your saying makes sense your ready for mp :z)

#

yeah but this seems like such a basic thing to solve and should have a simpler way

dark parcel
# queen escarp <@1050954229902213150>

You probably don't want to set the actor rotation of the local machine. It will get rubber banded. Also don't think you need rpc at all for rotation. Perhaps a replicated rotation and interpolate on ticks for proxies

#

Just pure speculation tho, hopefully someone experienced have answer

queen escarp
#

hm

#

i mean this makes it better but not 100%, and yeah hopefully someone with experience could help out

#

but what ur saying makes 100% sense tho

#

its just the "how" thats interesteing

thin stratus
#

Why are you doing that anyway?

#

If you are using Characters and the CMC; you already have Rotation Replication via the ControlRotation

queen escarp
#

yeah but this is for a custom movement system basicly,

#

or u mean i dont need to rpc if i replicate the CMC

#

and if i just set/add actor rotation it would replicate

thin stratus
#

The Client sends its own ControlRotation to the Server already via the CMC

#

That's why doing AddControlYaw or whatever the node is called, locally from Input, simply works

#

Custom CMC movement cannot and will never work with just BPs (at least in its current form)

#

You can't just start RPCing around

#

You will always get corrections

#

Either use the stuff that exists already or use C++ to extend the CMC

queen escarp
#

hm

#

i get what your saying i think, but if i modify the CMC teh nit should replicate right ? then why is it not working for me what am i doing wrong ?

#

or do i have to use the Inputs function to make it replicate?

modest coral
#

ok so i guessing you did not try it or not understood also that beginner +giving wild advice don't go together either .

queen escarp
#

Laura, do u have any tips on my situation ?

#

your good withj this stuff

magic vessel
#

Have I misunderstood what BlueprintAuthority means? In my build, it seems to be be skipped over when in standalone net mode

elder sable
#

Does TearOff works for beacon connections ?

dark parcel
#

He's been trolling for the past few days

dark edge
#

Imagine not shipping a no code MMO lol

elder sable
half drum
viscid tapir
#

Hello, I'm working with the FFastArraySerializer and I have a question.
Any reasons that could explain why the PostReplicateChange is not called if the array is marked dirty twice pretty fast
I tried to call AddItem() twice in a row and I found that PostReplicatedAdd() was called for the first item and PostReplicatedChange() was not called for the second item (this function over the first one due to stacking rules changing the stack count). This scenario only happens if I add 2 same items

#

Otherwise, PostReplicatedAdd() is called for both items

viscid tapir
#

Maybe it just needs time for updates which explains why little delay (even 1 tick) works

ocean dust
#

Hello, all. I am struggling to get Seamless Travel to work again. I have created an empty Transition Map, set ALL of my GameModes to have Seamless Travel as TRUE, and call GetWorld()->ServerTravel(...), but a Standalone game instance still hard travels to all maps. Why? What am I missing here? Thanks

#

Ah. So because the game is running as a Listen Server, the seamless travel doesn't work as I am expecting (for the Listen Server/Host)?

#

Multicast what?

dark parcel
#

Are u guessing or that's what actually should be done?

#

I don't do multiplayer but reading from the document only server have to execute server travel

#

Client will follow automatically

ocean dust
#

Yes exactly

#

HOWEVER, my seamless travel is not working as the documentation describes

#

Is it because of a Listen Server issue? Because the docs don't really talk about that

dark parcel
#

U r guessing too much

#

Kay

ocean dust
#

Is this a ChatGPT bot?

#

because that makes no sense

#

EXACTLY WHAT A BOT WOULD SAY

#

Joking, of course

#

But yeah, I have some things set up for replication, but that shouldn't matter for a Standalone Listen Server.

dark parcel
#

Just gonna leave it here

#

I see nothing about replication or w.e

#

It says just make the server call the function

ocean dust
#

What I am expecting is that Standalone Listen Server will Seamless Travel to the Transition Map for a moment, then Seamless Travel to the new map and run the overridden methods on the Destniation GameMode

ocean dust
dark parcel
ocean dust
#

In fact, ALL of the Epic-written documentation I have seen completely ignores Listen Servers. They are written exclusively from the perspective of a Dedicated Server with many remote Clients

dark parcel
#

Docs r fine, just not the generated one for nodes

sinful tree
dark parcel
#

Better read the source code for that

#

But docs for travel etc is fine. I doubt the function changed