#multiplayer

1 messages Β· Page 730 of 1

dark edge
#

If you say "on tick, add to rotation based on replicated rotation rate" then that's your problem.

summer tide
#

Does that make sense?

dark edge
#

That makes absolutely zero sense

#

Show how you're doing rotation. Show the actual nodes

summer tide
#

I got it working. I had to set the rotation rate properly.

desert oar
#

guys any idea why this wont replicate on clients? class is set to replicate

#

client does change the material as intended but only server can see the change

#

the arrays are actualy connected i just disconected it for a moment when i took the capture haha

split siren
glossy kettle
#

any eBPF/XDP specialists in chat

desert oar
split siren
#

The ideas it to broadcast only the material index, and each client looks up the material and sets it on their end.

#

Once you get comfortable with multicast, you can take a look at on_rep_notifies, which would utilize the variable rep instead of Multicasts

#

Also, keep in mind that you need to execute the multicast on server, otherwise it does nothing

desert oar
#

i tried with the multicast but it still wont change the material on client side

split siren
desert oar
#

i mean i did just like you, i made a function to run on server conected to the multicast

#

nevermind

#

i run wrong compiled version

#

my bad it actually works with the multicast xD

split siren
desert oar
#

i really thought i had already tried that but still glad it works now thank you very much^^

fathom aspen
#

That's why an OnRep is needed in such case

#

Read first pinned message - OnRep vs RPCs

split siren
#

@robust scroll My apologies for pinging you directly, but I am trying to replicate your work from https://forums.unrealengine.com/t/replication-graph-fast-shared-path-starting-guide/518575 and I have so far found noone else who knew fast shared path from Rep Graph and could help me.

As the character movement replication is not trivial, I am not sure about the details on how to replicate it via the fast path. I assume I should wrap FCharacterNetworkMoveData (or FCharacterServerMovePackedBits) in a custom struct and send it via the fast-path.

But do I need to prevent the ServerMovePacked_ClientSend from executing as it would be redundant?
Once on the client I assume I would pass it to ClientMoveResponsePacked(const FCharacterMoveResponsePackedBits& PackedBits)?
Did you handle everything from the RepGraph or did you have to make changes to the CharacterMovementComp as well?

robust scroll
split siren
north stone
#

buddy, dont just at us, might wanna read the #rules

nimble parcelBOT
#

:triangular_flag_on_post: iam_Raavanan#3756 received strike 1. As a result, they were muted for 10 minutes.

chrome bay
#

And you don't modify the movement component at all, the shared stuff is for replicated properties only.

split siren
chrome bay
#

FastPath aka "SharedSerialization"

#

The difference is instead of replicating the actors' FRepMovement via normaly property replication, you define an unreliable NetMulticast like "ReplicateMovement" or something, and that sets the replicated movement data. You also need to disable the replicated movement property

#

But unless you have hundreds of actors or connections, the complexity almost certainly isn't worth it

split siren
#

My apologies for the confusion, but isn't character movement rep done mainly via function rep calls? void ClientMoveResponsePacked(const FCharacterMoveResponsePackedBits& PackedBits); and void ServerMovePacked(const FCharacterServerMovePackedBits& PackedBits) instead of property replication?

chrome bay
#

No

split siren
chrome bay
#

Movement replication for non-controlling pawns is done through property replication. Those client functions are for the controlling player only

#

The reason being prediction/rollback etc.

#

The Character Class ignores replicated movement data on the owning connection

#

Also shared replication only works in very limited case, e.g. you're sending plain-old-data only. You can't send object references or other per-connection data on the fast/shared path

#

Just getting 250 characters moving in an offline game will be expensive enough, I doubt serialization will be the bottleneck

split siren
split siren
chrome bay
#

Something like this yeah:

void ReplicateMovementShared(const FRepMovement& MovementData);
{
    ReplicatedMovement = MovementData;
    OnRep_ReplicatedMovement();
}
#

You may need to avoid actually using FRepMovement though, as it has some internal edit-only properties required for serialization

quasi tide
#

Doesn't UE collect a group of replicated properties and send them at once instead of one at a time?

chrome bay
#

So might be best to make your own struct, then update the FRepMovement params directly

quasi tide
#

(More of an inquisitive question and not trying to solve a problem per-say)

chrome bay
#

It does but it serializes them individually per-connection by default

quasi tide
#

So, if you change 5 props in a frame, all of 'em get sent as 1 replicated call, right?

chrome bay
#

Yeah they get sent in the same bunch

quasi tide
#

(or however it gets divided up to be networking friendly)

#

Alright, yeah - that's what I thought.

#

Just wanted to make sure.

#

Was just talking with some people last night in my server about networking behavior.

#

Thanks Jambax πŸ‘

chrome bay
#

But fast path sort of means instead of doing this:

{
    for (EachActor)
    {
        Connection->SendProperties(EachActor);
    }
}```

It does something like this:

```for (EachActor)
{
    EachActor->MulticastSharedProperties()
}```
split siren
#

Jambax is the real MVP

chrome bay
#

Disclaimer though I've not used the fast path stuff, but this seems to be the idea

quasi tide
#

I've learned a ton from Jambax. Like, don't ship a BF-esque game with lag compensation or client prediction πŸ˜›

chrome bay
#

It makes sense I guess, they're abusing how Multicasts are sent in a similar fashion to property bunches

quasi tide
#

(I kid I kid)

chrome bay
#

That's a good lesson thf πŸ˜„

split siren
#

It makes sense now. I was stuck on the replication via RPC for clients as well and completely missed that Char Movement is replicated via property (facepalm)

chrome bay
#

Yeah all the CMC stuff is purely for the controlling client

twilit radish
chrome bay
#

the character just ignores the replicated movement updates when you are the controlling player, as you should get corrections through the Client_Ack / Client_SendCorrection functions etc.

quasi tide
split siren
#

Gonna give it a go with 100 players s and I will post results for anyone interested in FastPath RepGraph

chrome bay
#

You need 100 connections to see any benefit really I think

twilit radish
#

There's a client authority setting?

chrome bay
#

If it's only one connection, it'll be the same (possibly worse even)

split siren
#

*Players (typo)

quasi tide
chrome bay
#

Also I wonder how this handles different ack states between clients and what happens when the property is not changing.. that would be interesting to know

quasi tide
#

I think it's really just for location authority though.

chrome bay
#

Presumably it doesn't just spam the RPC regardless

quasi tide
#

Try searching for "client"

twilit radish
#

Do you mean on the CMC?

quasi tide
#

Maybe that's where I saw it

#

I thought more things had it though - am I mistaken @chrome bay?

twilit radish
#

All I see is this on a non-character.

quasi tide
#

'Cause I'm pretty sure that's how it is generally recommended to do vehicles. Because otherwise, it's a massive PITA

chrome bay
#

Yeah that particular settings is just on the CMC

#

But there's also a special option for physics-simulating skeletal meshes

#

wierdly

#

bReplicatePhysicsToAutonomousProxy

#

Requires you to send the physics state to the server from the owning client though ofc

#

Why this is in USkeletalMeshComponent and not UPrimitiveComponent is anyones guess though

quasi tide
#

Wonder how well it actually works πŸ€”

split siren
#

Can I have one more question about the FastPath? According to the docs, it either executes default path or fast path, but not both in an update. (Makes sense)
But how does it decide whether to do fastpath or default? When I setup fastpath for random boolean (just for testing), clients get replicated values from fast-path and normally replicated variables.

chrome bay
#

Hmm not sure. UReplicationGraph::ServerReplicateActors calls both functions one after the either (non-shared first)

#

Ahh, I see

#

If you replicate any "default" properties in that frame, the fastpath skips

#
            if (UNLIKELY(ConnectionData.LastRepFrameNum == FrameNum))
            {
                continue;
            }```
split siren
#

Oh, gotcha. So the "Default" has priority over fastpath. That complicates things a bit

#

Thanks again!

chrome bay
#

Another issue is it seems to "round robin" through shared actors, so there's a chance you might not get a shared update for quite some time

split siren
#

I really hope the performance boost is worth it

chrome bay
#

Can't imagine it will be πŸ˜„

#

Never know though. I just feel like you'd have to be throwing out loads of data for it to make a huge difference

split siren
#

Just looking at the profiling graph, Replication for each client just takes forever.

#

The actual movement/physics is tiny compared to the networking calls

chrome bay
#

ooof

#

17ms

#

Are the clients on another machine though?

#

Because that would be the server + all of your clients gathered in there no?

#

Oh nvm actually, insights is probably smarter than that

#

How many clients is that?

split siren
#

Yeah, using ec2 to spawn couple of xlarge instances to run headless clients on and its connecting to another ec2 instance which runs the server, which reports to Insights running on my local machine. Any tips for improving?

chrome bay
#

Also have you nuked the update rate of the actors?

#

The default of 100 is obscene

split siren
#

+-80 running in "fallguys" scenario, each player character replicates 10 times/sec

chrome bay
#

yeah ok, that's pretty trimmed already then

split siren
#

Where fallguys scenario is everyone bumping into each other

#

Therefore no culling, which is why I was hoping sending everyone the same batch of data would cut down the 17ms if rep time

chrome bay
#

Be interesting to see what happens if you just dump them into the "Always Relevant" node and ignore spatial culling altogether

#

But not sure if that would be better or worse since it might affect prioritisation too

#

Really wish I had some perf stats from HLL to compare

split siren
#

Made no observable difference (had it as spatial and switched to the always relevant bucket to enable fast path)

#

Looking at HLL I am just wowed how you guys handled it. Massive Kudos

chrome bay
#

I know we've had to upgrade server hardware a couple of times

#

But sadly I don't have the specifics

split siren
#

I have been tinkering with the idea of parallelising the Rep Graph/ actor serialisation. I would have to learn a tone about the inner workings but would be amazing feature to have.

#

If I understand it correctly, right now it's only about single core performance, which on EC2 there are not that many choices. What do you think?

chrome bay
#

just throw a ParralelFor in and see what happens πŸ˜„

split siren
#

πŸ˜„

chrome bay
#

Yeah ours are single core, we explicitly set them to only use one core

#

but multiple running on one box, I think maybe 8?

split siren
#

yeah, that does makes sense with large playerbase and static num of people per game.

chrome bay
#

We're also pretty bound by physics performance

split siren
#

I am currently using AWS gamelift, but not too happy with it atm

chrome bay
#

Courtesy of insanely complex environments and vehicles

#

GPU networking 🧠

split siren
#

Just the Battle sim was on gpu πŸ˜„ πŸ˜„

#

Can I have one more question about HLL? What service provider are you using for the game servers? AWS or someone more focused on game servers?

chrome bay
#

Uhhhh good question. I was to say Zues for the official ones

crystal crag
#

So I am a little confused as to why you would use the online party system over the session system if none of the invite events or acceptance events ever make it to the dedicated server

#

Just from the perspective of tracking which friends are part of a team in a world that is shared with other players

#

It seems no matter which system you use, you still have to have the clients send their requested list of friends to the server and have it react to assigning the group to the same team internally

#

Am I missing something? Are the dedicated servers able to be notified via the session system that a player is being followed by a friend into the session via invite?

#

or is that all strictly always client-to-client, through P2P and nothing else?

lost inlet
quasi tide
#

Never even heard of them to be honest πŸ˜…

olive kraken
#

Quick question outside GAS. Is there a function, tip to be sure that a variable is the same both on server and client? I want to control the flow of a branch until a integer reaches 0, and I want the client to wait the server before more executions.

crystal crag
#

Wouldn't OnRep be enough?

#

Each time the variable is replicated to the client, the OnRep would fire and you could perform validation to ensure that the integer has reached 0 before allowing the client to do whatever it is that it does

olive kraken
#

OnRep fires once the variable is rep, not when the variable changes on server, correct?

crystal crag
#

right

olive kraken
#

for some reason Im getting some sync problems

#

in big numbers, when loading unloading level instances

#

only a delay sync them up, but indeed I don't want to do that

#

so there is a mismatch of 1 in the loaded levels array, even using onrep

#

just wondering if there was a way of a sanity check function between server and client

winged badger
#

bounce a RPC

crystal crag
#

Zlo!

#

I'm so glad you are here. I have avoided pinging you directly for a bit, but I've been dying to ask you a follow up question to something you helped me with a month or so ago

quasi tide
#

And just like that - it's time for Zlo to leave πŸ˜…

crystal crag
#

rofl

#

When you told me about the session on user invite accepted/received delegate, I was thinking that the dedicated server would fire off one or all of those events if the player doing the inviting was already in a session (with said dedicated server). Is that not the case? My initial testing is those events only fire off on the clients

#

if that's the case, how are you linking players together into a party on the dedicated server side once the friend (invitee) joins the other friend's (inviter) session?

winged badger
#

no

#

those come from the steam client

#

so dedicated server doesn't actually do any invites

#

as it doesn't run a steam client

crystal crag
#

So are you just having the game clients tell the server that they want to join up with their inviting friend's party and the server just does the validation and either says "ok, I'll let you party up with them in game" or "no, I won't let you do that"?

#

That's really the only way forward that I see

winged badger
#

there are at least 2-3 ways you can slap together a party without involving the server at all

#

just using steam

crystal crag
#

But in my case, the party is in-game and they are part of a squad

#

in a world with other squads

winged badger
#

off the top of my head, steam lobby might do the trick

crystal crag
#

But that wouldn't work for a world that is always up right?

#

I'm building an ARPG

winged badger
#

it doesn't matter

crystal crag
#

not a FPS

#

oh

winged badger
#

steam hosts the lobby

#

not your selrver

#

they would have their own data and text chat

#

and one player could connect them all to a world/server instance

crystal crag
#

I thought for lobbies you would have to have the server host a lobby and then call ServerTravel once all players in the lobby were ready

#

so even if one player is already playing in the dedicated server, and then their friend wants to join 5 minutes later, the lobby would support that?

winged badger
#

you can do almost everything a session can do with a lobby

#

only its not a session

fluid summit
#

Hi! one question for instance based games.
I'm doing a multiplayer like POE (single player / local multiplayer)
You have the main "world map" and some instanced areas that can be opened through various means and other players on the session can join.

I'm thinking on creating this instances on the same map and just move them far away, teleport the players to it and deal with closing it and stuff like that.
Do you think this is feasable or already a setup for failure and i should be going with changing to another level for things like this?

#

the scale of things would be similar to maps on path of exile

winged badger
#

we did have a problem connecting via lobbies in china though, probably due to poor steam instractructure

#

original connection code was using those, we dropped it for sessions and SteamSockets

olive kraken
#

actually, does the length of an array fire the repnotify of that array?

fluid summit
#

you need to do array = array to fire the repnotif

crystal crag
#

Ok, so you have cleared a lot up (thank you), but I am really honing in now on one leftover question - even if one player is already playing in the dedicated server, and then their friend wants to join 5 minutes later, the lobby would support that scenario?

olive kraken
#

I see

crystal crag
#

I don't mind researching the interfaces and figuring the system out. I just want to make sure that it can handle that though. Players will be able to play on their own, doing their own missions, and then friends can join in at any time and join in on the fun

fluid summit
crystal crag
#

oh ok

dark edge
crystal crag
#

well this is a dedicated server, but it would work the same I would imagine

desert oar
#

hi guys im still getting the hang of replicating things, what could be wrong with this? the first repnotify works just fine, but the second one fires but wont do anything, ill get a pic of whats inside that repnotify in a sec

crystal crag
#

@dark edgeBy creating a session at startup, do you mean an actual session, or a game lobby "session"

#

?

desert oar
dark edge
desert oar
#

they are opposite anyway yeah

dark edge
#

The less state the better, it's more robust.

#

Just set bIsHidden = !bIsHidden, and in the repnotify, do all the stuff based on bIsHidden

#

otherwise you might have race conditions or whatever else

#

but also collision and visibility might be already handled by replication, make sure you rule that out

desert oar
#

hmmm

nocturne sage
#

Hey guys, I have a question. I'm trying to replicate an actor's movement by sending a server rpc to update a variable and then have the server do the calculations. All the actors on the server are acting properly but in the client window the controlled actor isnt updating at all.

#

I set bReplicates and ReplicatesMovement to true so idk whats happening

dark edge
pallid mesa
nocturne sage
#
void ASpaceship::Boost()
{
    
    if (GetLocalRole() < ROLE_Authority)
    {
        FString message = FString::Printf(TEXT("called by client"));
        GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, message);
        Server_SetCurrSpeed(MaxSpeed);
    }
    else
    {
        CurrSpeed = MaxSpeed;
    }
}
``` is the rpc call to update the speed variable
#

and ```void ASpaceship::MoveForward(float AllowedSpeed)
{

//if you are an actor on the server
if ((GetLocalRole() == ROLE_Authority))
{
// find out which way is forward
    const FRotator Rotation = GetActorRotation();
    const FRotator PitchRotation(Rotation.Pitch, 0, 0);

    // get forward vector
    const FVector Direction = FRotationMatrix(PitchRotation).GetUnitAxis(EAxis::X);

    FVector Pos = GetActorLocation();
    FMath::Abs(GetActorQuat().Y) < .707f ? Pos.X += Direction.X * AllowedSpeed: Pos.X -= Direction.X * AllowedSpeed;
    Pos.Z += Direction.Z * AllowedSpeed;
    SetActorLocation(Pos, true);
    FString message = FString::Printf(TEXT(" loc is currently %f, %f, %f"), GetActorLocation().X, GetActorLocation().Y, GetActorLocation().Z);
    //GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, FString(TEXT("SERVER:"))+GetName() + message);
    
}```is the function to handle the movement
#

i call MoveForward in Tick

dark edge
#

@nocturne sageAre you sure that nothing else anywhere is setting the actor location?

nocturne sage
#

Yea

#

when i print the location values for the actors the server says both are moving, but the client says that the one it controls stays in place

hybrid crown
#

Just to be sure :
PlayerController -> Present for local controlled player + present for every player on the authority
PlayerState -> Same as PC

Correct ?

hybrid crown
#

Oh thanks.

hybrid crown
#

Yeah i know compendium

#

just forgot to check this time

#

shame on me =/

quasi tide
desert oar
# desert oar here

i checked if it replicates without the repnotify and it will work only when run from server and i also tried making a run on server event but still not working

nocturne sage
#

@dark edge This is what the position values look like for the actors

#

my biggest question is how to set the clients values to be the servers besides a client rpc

#

shouldnt it be handled by Replicates Movement

quasi tide
#

That is quite difficult to read πŸ˜…

dark edge
#

Do you have a movement component or anything?

nocturne sage
#

and the client can see the other players positions just fine, it just cant see

dark edge
#

Should be, check your replication settings

nocturne sage
#

even though the server says its moving

dark edge
#

I mean it'll be janky but it should work

nocturne sage
#

So apparently when i set the Sprite Component to replicate it works

#

But the other actors start looking super jittery

#

@dark edge

winged badger
#

replicating movement is jittery

#

you're just sending new location

#

client gets an update, teleports the component

#

not sure what you were expecting without a network enabled movement component

split siren
nocturne sage
#

@winged badger do you know why the sprite needs to be set to replicate as well

winged badger
#

i would never replicate a sprite

nocturne sage
#

is it just something you have to do for 2d

#

O

winged badger
#

as in sprite component

#

i would move an actor using a movement component that can do networking

#

and sprite would be attached to it

olive kraken
#

Hey! is there any command, hotkey to add a network player in PIE at runtime, but just at anytime?

#

Need to debug new connections

winged badger
#

there is

#

but you need to enable join in progress in editor preferences

olive kraken
#

ah cool

winged badger
#

then it will replace the play button while PIE session is active

olive kraken
#

thanks! useful!

winged badger
#

its "experimental" but works just fine

olive kraken
#

yeah, needed to check if all rep variables go through for joiners, etc

quasi tide
#

There are so many things in UE that are "experimental" but actually work.

olive kraken
#

true dat

#

just risky when scaling

winged badger
#

and so many that are not experimental and they don't work

#

πŸ˜„

olive kraken
#

haha, yup

quasi tide
#

How many people are relying on the experimental feature that is EQS? πŸ˜…

winged badger
#

hey, that one works, unless epic does a live stream about it

#

then they run out of time πŸ˜„

south stirrup
# dark edge

I'd add "even though actors that are replicated and exists in both server and client, they can't call their server counterparts from the client" to that, because most of my mistakes were about that.

quartz smelt
#

Can anyone point me in the direction of setting up dedicated server(s).

quasi tide
#

(UE isn't P2P btw)

quartz smelt
#

Wait really the host/client doesnt count? That's cool

shell forum
#

Can you replicate DestroyActor without turning it into a blueprint (ie. static mesh actors in world)? Or would I need to use multicast?

split siren
shell forum
#

I don't see an option to turn replication on in the details panel.

#

Nvm, found it. It's called "Static Mesh Replicates Movement"

split siren
shell forum
#

The issue with that is relevancy

#

Since the object will be far away from the client

#

And I’m not sure how to set it on a staricmeshactor

split siren
#

Looked into the source for StaticMeshActor and you can't just wrap it in custom BP as I initially thought.
The replication in that class is a bit wonky (as per this comment
// This is a short term fix until we find a better play for SetReplicates to be called in AActor.

#

I would recommend making a new BP class with static mesh component and setting bReplicates to true.

vagrant grail
#

I have an issue with my sprint / stamina system (that I'm trying to make working with multiplayer). Everything works perfectly on the server (so the sprint / stamina system + UI (progress bar)) but on the client the system works perfectly too but the UI doesn't somehow πŸ€” Here's my code :

#

Please ping me if any answer πŸ™‚

potent coral
fathom aspen
#

So the client has no idea what they are

potent coral
fathom aspen
#

Yes, right, which doesn't happen usually, so he should know what works best for his game

vagrant grail
#

@fathom aspen @potent coral What should I put in the OnRep_Stamina function ?

#

it works perfectly with "Replicated", thank you πŸ˜„

#

Is my code good or could it be improved ? πŸ™‚

fathom aspen
#

You don't, you just need to make it replicated so the client knows of the changes

harsh lintel
#

if I have a replicated array of actors, and I spawn that actor on the server, and add it to the array, how do I know when any actor added to the array this way is valid on the client? preferably through the array somehow

fathom aspen
potent coral
vagrant grail
fathom aspen
#

Ew

#

It's bad, just get rid of it

vagrant grail
#

What should I replace it with ?

fathom aspen
#

Updating the value on tick is even better

#

Well I would make it event driven

#

Wouldn't do it on tick

vagrant grail
#

Tell me more πŸ˜„

fathom aspen
#

You change the property on server->the client knows of the change(OnRep for example)-> You tell the UI to update

#

As simple as that

split siren
#

I am sending FRepMovement over an RPC (Multicast) and its Location is not deserializing properly. (floating point is messed up)

Client Received X=-32914.000 Y=51865.000 Z=6050.000```
I assume it's due to the Quantized vector, ` SerializeQuantizedVector( Ar, Location, LocationQuantizationLevel );` but I thought that would be auto-handled when deserializing from bits
fathom aspen
vagrant grail
#

but my progressBar is on another BP so how do you connect the WidgetBP to the BP_ThirdPerson through the OnRepNotify ? πŸ€”

fathom aspen
#

Event Dispatcher

#

Or interfaces

#

They are kinda the same

#

You make the UI widget listen to the changes on Character/PlayerState, so when they happen, the widget updates

quasi tide
#

Event dispatcher and interface are not the same.

fathom aspen
#

kindaℒ️

quasi tide
#

Nope. Not even "kinda".

south stirrup
#

Let me get this straight: Interfaces need to be called on a targed, dispatchers call all of instances, right?

fathom aspen
#

Ok I get how they are different, and I know why I call them kinda same

quasi tide
#

An interface is like a contract. It is saying that this object has a certain method. It is a 1:1 relationship. Events are more like radios. Many objects could be listening for an event. It is a 1:many relationship.

hearty arrow
south stirrup
split siren
split siren
hearty arrow
#

Hmm quick question, are u occur this on editor or standalone game

split siren
#

It seems the issue is in both

hearty arrow
#

try uncheck "run on one process" from advanced play settings, does that change anything?

vagrant grail
hearty arrow
split siren
#

The SENDING is what server sends and client prints received location

south stirrup
vagrant grail
south stirrup
vagrant grail
hearty arrow
vagrant grail
#

Works perfectly πŸ˜„ Except the progress bar isn't as smooth as I would like, what do I need to make it smoother ? Like right now it feels like it's running at 12 fps πŸ˜„

hearty arrow
south stirrup
split siren
hearty arrow
south stirrup
vagrant grail
hearty arrow
south stirrup
dark edge
#

That way it's nice and smooth even if the underlying value isn't

vagrant grail
dark edge
#

You can do all that inside the widget, I wouldn't bother interpolating a value for display inside the actual thing

dark edge
#

Just add an FInterpTo node to something that's ticking, have the target be Stamina, and have it drive Stamina_Smoothed

#

If you want it smooth, and the underlying data isn't smooth, that's how you do it.

split siren
# hearty arrow Cant u customize it?

Honestly, fast path rep feel like a bloody magic to me.
In a nutshell, as far as I understand it, I provide a function (that at some point should call a netmulticast). The function runs but the netmulticast is intercepted and instead of executing, it stores the bits to send in a buffer. We do that for all functions provided and collect everything in a buffer, which we send as a one big netmulticast.
Just the fact that the netmulticast is intercepted is beyond me at this point of my knowledge.

#

But I can try outside the Rep Graph easily tomorrow

hearty arrow
split siren
hearty arrow
#

I should thank to u

fathom aspen
dark edge
#

Why would an event be like a radio

#

isn't an event just a returnless function that can do latent actions?

#

I'd call a dispatcher more like a radio

#

and an interface is more like a protocol or language

fathom aspen
#

Yeah he meant the event dispatcher I guess

dark edge
#

"hey do you speak Damage?"

fathom aspen
#

Interfaces are 1 to all relationship

quasi tide
#

Obviously I'm talking about event dispatchers because that was literally the topic

dark edge
#

On that topic, what's the simplest way to make a global message bus

quasi tide
#

Event Dispatchers vs interfaces

dark edge
#

"Hey I died, anyone who cares, here's the info"

#

just dispatchers on some God object?

fathom aspen
quasi tide
#

Yeah. That's all an event bus is.

dark edge
#

I saw a plugin where theyre gettable anywhere, Subsystem I'd guess right?

quasi tide
#

Yup.

#

That's how I'd do it these days.

#

Pre-subsystem, enjoy a bloated GameInstance πŸ˜…

fathom aspen
#

Subsystems are ❀️

dark edge
#

Yeah I love them, everything I've done in C++ land has been around them

#

WTB Networked subsystem tho, paying 5gp

fathom aspen
#

They should make a way where network support is just there with 0 effort

quasi tide
#

Event Dispatcher is just UE's way of the Observer pattern

fathom aspen
#

Haha I'm feeling insane that I'm discussing something I know better than my name ^^

#

Think about it the way you see best

quasi tide
fathom aspen
#

With event dispatchers you need to bind it per object

fathom aspen
#

So event dispatchers is more of a 1 to 1 kind of thing

dark edge
#

you're saying you can call an interface function on nothing and have a bunch of things respond?

fathom aspen
#

Nope. The object should clearly implement that interface

dark edge
#

What do you mean by "without knowing about them"?

#

without knowing anything about them beyond the fact that they implement the interface?

quasi tide
#

That is still completely incorrect when it comes to expressing if it is a 1:1 or 1:many relationship.

#

Casually redefining something to be incorrect is not something you should want to be doing

fathom aspen
#

I meant you don't need to bind per object like you would with Event Dispatchers

dark edge
#

I mean you still need to get at them right? One of the participants needs to know about the other

#

Or rather, both need to know about the dispatcher in that case

fathom aspen
#

Yes correct

dark edge
#

That's the thing that tripped me up about dispatchers to begin with. It'd be cool if there was no dynamic binding or it was automagic.

#

just pub/sub

fathom aspen
#

Yes that's what makes them a bit funky

fathom aspen
#

Quoting my dear friend Makoto

quasi tide
#

The way people use them in BP is irrelevant to what the concept they embrace is

#

If you call an interface method on an object - it will affect only that object (unless it intentionally touches other objects). If you broadcast the dispatcher, it will affect all of the objects that are listening for that broadcast.

#

The interface makes the object of type interface (w/e you decided to name your interface)

#

And because it is an interface, and an interface is a contract, you know that if the object is of type interface - it will have that method.

fathom aspen
#

Agreed. So again, this is more of a what the relation really means. As long as we know how to use them then we're good. This whole conversation started on that they aren't not "kinda" same. I still believe the concept is kinda similar in one way or another, and that usually you can achieve your goal with using one of them

quasi tide
#

What relation means is already defined.

dark edge
fathom aspen
#

In event dispatchers you get a ref to bind, in interfaces you don't. You still need a ref to call the function on. The terms here are so misleading I agree bidensmile

tiny finch
#

i know this is a bit dumb but i cant get a button of a character select to work for multiplayer to disable whenever a client or server clicked it.. any idea

olive kraken
#

Hi!
Having a hard time with stream variables and seeds. I'm Setting up a replicated stream variable on the game state, later I call a custom actor that spawns foliage using that seed in every single random choice, only on client.
If I test this with i.e the listen server and three clients. All the three clients will see exactly the same sequence, hence, the same procedural foliage, however, the server sees a different sequence and a different procgen foliage. What is even more interesting, is that an small percentage of spawned foliage match server and client.
Is there a sort of precision mismatch should I consider in big numbers when using a seed? (millions)

#

or is there a chance that sequences from the same seed give diferent results server/client over time? any hard coded limit?

#

surprises me, that all 3 clients will get the same random results > millions, while the server sees a different one. So the clients are indeed using the rpc seed, the server apparently too, thou the chain looks like losing precision somehow

#

here is the example, both clients agree in the procgen using the replicated stream seed, server doesn't.

#

btw, the number 79 that prints on server and the two clients is a random integer from seed to see if they are indeed using the same seed

fossil spoke
#

You should never use Floats for a Seed

#

Always use an Integer

#

You should also probably have the Server store the Seed in a Replicated Property.

#

Dont RPC the Seed. Wait for the Replicated value to come down to Clients before the Client generates anything.

olive kraken
#

so far so good, Im using a rpc that fires the event and Im using a random int on server

#

repnotify

fossil spoke
#

That doesnt make sense?

#

You have an RPC but also a RepNotify?

olive kraken
#

no sorry, corrected, repnotify I meant

dark edge
#

So how do streams work, they give the same numbers IN ORDER given a seed?

olive kraken
#

they give you random numbers but always the same sequence if the seed is the same

#

and they do, in all clients

#

server almost, so is like losing precision

dark edge
#

So you would want a separate stream for everything that would be called out of order then right?

olive kraken
#

no, one seed for every procgen event

#

it shoudn't matter

dark edge
#

Like say you generate foliage around you, the server has to generate more foliage in a larger area

#

So you might get an ordering mismatch

olive kraken
#

yeah, being testing that a lot, to be sure that the order is correct

#

and while there is some dependencies, there is no parallel operations or delays, etc.

#

all waits until gets done

#

instanced levels, first generation, the second, etc

#

all using the same stream

#

the only thing that might scares me, is the linetrace results

#

that choses where to add an instance, thou it shoudn't affect the rest

#

but anyway, what clicks me is that infinite clients will have the same result, while server doesn't

#

if every client has different results, ok, order of events, maybe not replicated, etc. But clients see the same

#

and that little 79 on print (clients and server) is a random int from the stream, right before the procgen starts.

dark edge
#

@olive kraken What does it do with only 1 client

olive kraken
#

I will go through objects, and being block by those that are on server and not my client

#

2 clients, will both see the same, same effect, etc

#

that is the pattern, all clients same stream sequence

dark edge
#

Is the number of hits to that stream the same?

olive kraken
#

I noticed the lenght of the hits a little bit different in high numbers, indeed

#

by 1, or 2

#

however, when was equal, got also different results

#

but yeah, was thinking about it

dark edge
#

What's your algorithm, do you do the exact same thing on server and client or do they both vary in the location where they start or something

olive kraken
#

all happens on client, only the seed is set on server, in the game state

#

the actors, spawners, get that reference of the seed and run the same sequence, on client

#

I can clean the bp a post it tomorrow if I still stuck

#

been messing around a couple of days and I feel something odd, might be related with ownership of the spawner

#

but yeah, they all run the same simulation/algorithim, and they all have the same ref point, i.e the origin of the raycasting, etc.

#

that is the spawner first raycasting

fossil spoke
#

Why are you passing the Stream through an RPC?

#

I thought you said you have a RepNotify that sends the Seed Integer?

olive kraken
#

this is the gamestate

#

yes, but not in the actor

fossil spoke
#

🀦

#

Replicate the Seed Integer, not the Stream.

olive kraken
#

ah yeah

fossil spoke
#

Dont use an RPC

olive kraken
#

got that too

fossil spoke
#

Wait for the Seed Integer RepNotify to fire.

#

Then set the Seed

#

Of the local Stream

#

Then initiate Proc Gen

olive kraken
#

got that 2 literally 10 min ago, Im just debugging πŸ™‚

fossil spoke
#

Remove the RPC

#

Gate it with HasAuthority

#

You only want the Server to set the Seed variable

olive kraken
#

the rpc in the stream variable?

#

this is actually the repnotify of the variable

#

thou I dont fire the procgen actor yet, happens after loading all instanced levels, which gets that seed from the repnotify and fires this

fossil spoke
#

No RPCs

olive kraken
#

thanks that flow, yeah, the procgen happens instead in a different actor that most likely needs to wait for the seed

#

I will refactor, problem is that between the repnotify and the actuall procgen other things have to happen, like the level instances... etc

#

which they all work nicely, using the seed

#

so I believe something else is happening when getting the seed from this specific actor, that is not happening within the gamestate

fossil spoke
#

Do not use the same Stream for different Proc Gen operations.

olive kraken
#

oh

#

how so?

fossil spoke
#

Because if something increments the Stream unexpectedly you can desync it.

olive kraken
#

uh, nice tip

fossil spoke
#

You can use the same Seed for multiple Streams

olive kraken
#

so integer is what matters, I regen seeds per actor using the same int?

fossil spoke
#

Have the Server create just 1 Seed Integer.

olive kraken
#

ok

fossil spoke
#

Do not change the Seed Integer

olive kraken
#

game state is the correct class for this, or game instance?

fossil spoke
#

Increment the Stream instead

olive kraken
#

sorry, just want to have it right

#

oh

#

I see

fossil spoke
#

GameInstance wont work because it is not Replicated

olive kraken
#

correct

#

ok

#

cool tips

#

I will get my head around, you gave me great pointers

#

thanks!

fossil spoke
#

Please look at the documentation on Streams as well.

olive kraken
#

yeah, checked all and more 😦

#

even tickets, etc

#

sadly nothing quite related to network, at least in-depth

#

working nicely!

arctic hazel
#

ive got to ask... cant a single dedicated server create multiple game instances on different ports? i know its not recommended for preformanc but aint it possible?

thin stratus
#

No

#

UE DedicatedServers can only have one GameInstance each

#

You can start multiple ones though

weak geyser
#

my player is stuck in the air and giving **isfalling **always true.Although everthing is working in listen server or as standalone mode.Please help me.I use is falling to drive my jump animations.

whole iron
#

Alright guys im newbie to unreal engine still so sorry for the stupidish question,

I'm making my first player character (followed the tutorial from UE documentation) and im gonna add all the systems then finally animate the model and animations etc so for right now im using the free asset one from the character movement tutorial in the documentation.

My question is this: I want to implement it so you can only sprint when running forward, I made some boolean values within the event graph of the BP_PlayerCharacter to determine if the player is either running forward (solely forward not backwards or standing still) and if they are strafing left and right (or not) along with one for crouching since I intend to implement a stamina system and I don't want people to be able to drain stamina while crouching by accident.

I plan to make this be multiplayer as well and im wondering if i should redo what I have to avoid cheating [since ive watched a few tutorials on replication from my understanding having the server override certain variables that player characters have would be vital for integrity, like player health, stamina, etc.] So my question essentially is how do I set up those variables to be server side so they aren't easily editable and cheatable. Also while I'm here, how should I set up the stamina system [coding wise not gameplay design wise]?

Also I think I know how to fix the issue of people sprinting and then strafing (as in bypassing the booleans) wherein ill just reset it to walking if they do that when sprinting

Sorry for the lengthy question just wanted to give context as to what im trying to achieve etc. (If nobody responds to this its fine but asking for help is worth a shot yknow).

P.S
Attaching screenshots of the Event Graph for the basic player character made from following the UE Player Character tutorial:

Sorry for the word essay lmao

dark edge
whole iron
desert oar
#

why wont the last part of this onrep work? the only thing not replicating is the enable collision

#

im not able to change that collision from client no matter what

whole iron
desert oar
#

quick noob question, if i want to call a function to run on server as a client from a bp owned by the server do i have to change owner first or it will work just the same?

latent heart
#

You can't change the owner from the client.

#

You have to call a function on an actor already owned by the client.

desert oar
#

i was really confused but i started reading about ownership

#

and i think i really get multiplayer now

#

i was calling everything from the client and didnt realised

plucky prawn
# latent heart You have to call a function on an actor already owned by the client.

This was probably the most confusing thing for me about learning how to call from client to server. In other games/engines, you can normally arbitrarily send network messages from the client. I'm guessing in unreal you would normally go through the player controller right? Like you would have an RPC that maybe you would pass an actor to to call some function on and have it execute on the server

echo geode
#

I'm taking incorrect location of linetraceing when I'm executing linetrace on the Server. CameraComponent is replicated but the location seems wrong on Server side. Linetrace hitting up to the upwards instead of the character's camera location.

twilit radish
#

Why is your "CameraComponent" variable a replicated property in the first place? If the location of the camera is wrong on the server it sounds to me like the setup there went wrong. Does the trace move at all on the server if you move around or is it always the same position where it starts / ends?

#

Also do you manually assign something to the camera component variable or is it the one that's already there if you attach it to the actor?

fathom aspen
plucky prawn
fathom aspen
#

So it's interaction. I would have interactions in Character probably. So you can't interact when you're dead

echo geode
#

@twilit radish

twilit radish
#

The camera's position should be just fine. The rotation is not by default properly synced.

fathom aspen
#

But why is the camera component replicated?

twilit radish
#

^

echo geode
#

Yeah it's a mistake, i just replicated it because i though the movement or location will be replicated

fathom aspen
#

Nope. PlayerCameraManager actor isn't even replicated

#

It exists on both server and client though

twilit radish
#

That does however not mean that the position of the camera component it self is wrong.

#

The rotation is a different case though xD

#

Also btw. You could remove the entire networking part for this specific piece if all you want to do is trace on tick. There's no point in having a RPC being send to the server every tick if all it does is server side logic, then you can just place it on a tick method that's specific to the server representation πŸ™‚

echo geode
#

Yeah, it's right @twilit radish . I'll use that method on player pressed on the key and reliability is unreliable

twilit radish
#

Ah alright.

echo geode
#

Works alright for now

twilit radish
#

πŸ‘

fathom aspen
twilit radish
#

No idea if it's reliable or unreliable. But in a lot of cases you don't need a RPC in tick on the client. If it's an interaction as an example you want it to be event driven and even in a lot of other cases you would likely be able to get away with a timer for example and some smoothing.

tender gale
#

Is it possible to 'tick' the engine manually, instead of relying on the built in timing?

twilit radish
#

Why do you need to manually tick the entire engine?

#

Unless you limit the frame rate on purpose the engine already runs as quick as it possibly can.

tender gale
#

It's not to limit frame rate, it's to implement a fixed step system for multiplayer

#

To execute all game logic on a fixed step, including prediction, etc.

twilit radish
#

UE5 has an optional fixed physics loop. UE4 by default does not, but there are engine modification posts you can find out there. No idea how well they work though.

tender gale
#

I want more than just the physics to run at a fixed step, maybe I have to use UE5 and see if I can make it do what I want

twilit radish
#

Define "more" πŸ™‚

tender gale
#

General gamelogic, i.e. just not stepping the physics engine

plucky prawn
twilit radish
#

If you want the entire engine to run at a certain rate just limit the FPS.

#

That's all that really is in the end, forcing the entire engine loop to run at a certain rate.

tender gale
#

I tend to split game logic and rendering in two separate steps, instead of having them tied together as in unreal

#

So you can run your game logic at a reliable fixed step rate, but still render at whatever blistering speeds modern GPUs can do

fathom aspen
tender gale
#

Anyway, not here to argue about how to implement this or that, just wanted to ask about unreal specific stuff

#

I'll poke about UE5 a bit and see if i can make it do what I want

twilit radish
#

Search for "Async physics UE5" and you can see what it has to offer πŸ™‚

tender gale
#

Thanks thom!

plucky prawn
fathom aspen
#

Okay fair enough, it doesn't have to be an input. But why on earth would the PlayerController be able to open doors. That means dead players(spectators) would be able to open doors

#

You can do a check that the interacting player isn't dead, but that's just one system

plucky prawn
fathom aspen
#

The less the checks, the better. Otherwise your systems are error prone

plucky prawn
#

They don't call me "error prone system integrator" for nothing

twilit radish
#

lol

tender gale
#

@twilit radish So async physics moves the entire physics sim to a separate thread, the main loop still sticks to the frame-dependant Tick, etc.

twilit radish
#

From what I understood yes. The physics engine ticks at a fixed interval while the regular tick system is still frame dependent. Which gives you the option to either hook into the physics engine 'tick' or the regular frame rate 'tick'.

tender gale
#

But if I understand the docs/posts i found correctly, the code that hooks into that executes on a background thread, which makes it... well, most game logic doesn't mix well with multi-threading and interacting with the engine

#

but okey, thanks for the link, absolutely helped... i got some pondering to do

twilit radish
#

I haven't messed around too much with it yet so I'm unsure how exactly it does things. It's something I wanted to look into more deeply at some point because the fixed rate sounds in theory very great to work with.

#

I just know the functionality exists πŸ˜›

tender gale
#

fixed rate game logic makes client side prediction for basically any object/action in the world extremely simple

#

you just run exact same code on server and client for the entire world/parts of the world the client is in

#

and client can touch and poke anything he wants and have it be predicted

twilit radish
#

Also makes rollbacks much much easier.

tender gale
#

Yes, which is why i was poking around with this

#

It makes it trivial

split siren
#

I am trying to Mutlicast a FRepMovement, but I have a problem during deserialization step.
Pawns have FRepMovement.LocationQuantizationLevel set to RoundTwoDecimals which is not replicated information. When I use FRepMovement as a replicated variable, the RoundTwoDecimals information is already set in the FRepMovement struct and it deserializes properly. But when I use it as an RPC call, the deserialization step assumes FRepMovement.LocationQuantizationLevel is RoundWholeNumber (default) and the numbers are 1000x larger (with some rounding errors).
Any idea how to Multicast a FRepMovement properly?

#

@hearty arrow

trail rock
#
Blog

Gaming is now the world’s favorite form of entertainment, with Newzoo reporting that by 2023 there will be more than three billion gamers across the planet. With the growth of multiplayer games, however, the number of cheaters has also increased. A study by The New York Times found that almost 50% of computer gamers admit […]

harsh lintel
#

shouldn't APawn::IsLocallyControlled be true after APlayerController::AcknowledgePossession happens?

#

it isn't true with high latency

winged badger
#

It will be true after SetPawn runs

harsh lintel
#

ty

twilit radish
# trail rock https://www.imperva.com/blog/fundamental-security-concepts-and-best-practices-ev...

Not sure if you wrote the article or just found it interesting? I do find it really generic though, very few examples and just listing the basics of authoritative networking. Also things like this is not really a choice people often have, dedicated servers are expensive.

Use dedicated servers as the only valid authority. Other multiplayer architectures, like listen servers or P2P, may be good enough for development but not for production. Game decisions should only be made on trusted and protected servers.
The article doesn't really mention that for a ton of games cheating also just mostly doesn't matter. The PVP games that really need to care about this kind of stuff is not the majority of games πŸ™‚

quasi tide
twilit radish
#

Yeah. Don't get me wrong I love people sharing / making stuff though. There's plenty of concepts that are just difficult to figure out on your own ^^

stable moss
#

Anyone working with oculus quest 2 and shared spaces? Second full game (last was DragonRideVR on PCVR and PSVR) so used to working out problems. , but this is my first multiplayer and while I have the shared spaces (example) working in my project , any actor replication - like a basic physics based ball is not replicating correctly, and client is not in sync. The actor in client view will jump back when server interacts. Very slow dev because need to build and deploy to two HMDs to test. I have posted questions on meta forums but no is replying or is asking how I got the basic example to work. Has anyone else done any multiplayer on quest2 here? Thanks

#

Thanks will post there too!

harsh lintel
#

At the beginning of the game I'm calling a reliable server RPC, but with high ping it doesn't seem to execute reliably I call this function after PlayerController::PawnSet and APlayerController::AcknowledgePossession happens

harsh lintel
#

when do I know 100% that a client owns a pawn/character? like what function do I need to override so I can trigger a server RPC from the player's pawn/character

graceful flame
#

Which diagram with the added red circles is correct? First, second or neither?

split siren
#

@chrome bay As promised, here is a first run of the FastPath on Rep Graph with 160 clients. This is already heavily cut down system with quite a lot of client-server desync and teleporting issues... Wanted to share it just in case you might be interested

dark edge
#

GameInstance is local and has the lifetime of the process

#

Game instance is always there and is persistent from startup to shut down

graceful flame
#

Is there a difference between GameInstance and Game Instance? or did you and I both just randomly add a space in there by accident lol

#

Okay thanks, that makes more sense @dark edge

harsh lintel
split siren
#

This function is most likely what you are searching for

tropic snow
#

Anyone know how to cache vfx for multiplayer? Every time I see a particular blood effect for the first time it hitches

harsh lintel
# split siren

I already checked, and the moment I try to call a server RPC from the player character the role is autonomous proxy, the RPC still doesn't execute on the server

#

the node is reached client-side :/

pallid mesa
#

Maybe you could write an article about your findings

split siren
# pallid mesa good good

Thanks, but so far my findings are "Don't use FastPath, its slower than default path" πŸ˜„

#

But I am sure I made a lot of mistakes along the way

pallid mesa
#

sure anything is worth to document

#

mainly because these do work for people to get a better idea on when to use the tools and what not to do

#

ie: parallellising a small number of entities

split siren
#

True, I will most likely write something up once I understand it a bit better, not to provide flawed stats and misguided principals

split siren
quiet fjord
#

guys how could I improve the lag when the states of my animations in multiplayer

#

I want to optimize the animations

pallid mesa
pallid mesa
pallid mesa
quiet fjord
#

Currently my animations for example to attack with a sword I have it in the pawn with a multicast but when I do the lag simulation the states change abruptly

split siren
#

Mostly it's combination of the two, so if the character is falling and Enum is jumping, we want to have "Air attack" animation.

quiet fjord
#

then you recommend that we make use of all the animations in the animbp and pass it the state that is replicated on the server

split siren
quiet fjord
#

yes of course I mean that the anim bp must read the variable that its pawn has in order to decide

split siren
quiet fjord
#

Thank you very much for the clarification because I am optimizing and it is giving me problems when replicating when I have a lot of latency πŸ™‚

harsh lintel
#

is 20% packet loss percentage too much? I've been debugging all day and I must be doing something really wrong because this simple feature isn't working reliably

harsh lintel
#

but shouldn't reliable rpcs work regardless?

thin stratus
#

Yeah but if 20% of your packages are dropped then 20% of your game isn't working every update basically :D

#

1% is more realistic. More than that and it becomes a hell already

dark edge
#

But I'm sure even they have some sort of sanity check

harsh lintel
#

hmmm the default "Bad" profile has 5%, I just wanted to reliably reproduce the bug

fluid summit
#

How much better it's to have stats like "hp, mp, etc" on the actual pawn instead of the player state?
your regular rpg with pets and stuff

fathom aspen
fluid summit
#

yap, i moved everything to the pawn, made more sense like that

fathom aspen
#

I mean you can always get the pawn from PS(PawnPrivate it's called)

#

So it's not a matter of accessibility

summer tide
#

Hi - I'm trying to load a level using Execute Console Command, it loads in singleplayer but not in multiplayer. Any way to debug that

dark edge
#

also how are you loading, open LEVELNAME?

fathom aspen
#

Probably calling ServerTravel client side

#

Would never work

#

The logs would tell you why it's not working

summer tide
vague spruce
#

anyone run into the issue where when you try to run more than one client on a single machine through PIE the other screens go black and the newest client is the only one that's visible?

#

i finally got two clients to work... somehow

#

but there's still one that's completely black

#

oh weird i think it has something to do with my loading screen

#

yeah it'st he loading screen disregard

#

lol

chrome bay
grand kestrel
#

Was reading your article on network managers, do you think it would be sensible overriding GetLifetimeReplicatedProps in my character class and not calling super, then using a network manager to replicate everything including stuff like DOREPLIFETIME_WITH_PARAMS_FAST(AActor, Owner, SharedParams); to the point they replicate nothing? Of course replication would need to remain enabled for RPCs

ancient adder
#

How do i change a property rep condition at run time?

latent heart
#

There's a conditional rep macro, isn't there? Put something in that which you change

#

In the lifetime replication props

ancient adder
#

RESET_REPLIFETIME_CONDITION?

#

and this DOREPLIFETIME_CONDITION

latent heart
#

I guess?

#

I've never had to use them.

#

But that is what you'd use.

ancient adder
#

as far as i know they're used in GetLifetimeReplicatedProps() and GetLifetimeReplicatedProps() is executed once

latent heart
#

COND_Custom = 8 UMETA(DisplayName = "Custom"), // This property has no particular condition, but wants the ability to toggle on/off via SetCustomIsActiveOverride

pallid mesa
#

Spoiler: not so much...

chrome bay
#

And you can only change them at the class level, not per-instance

latent heart
#

The method I linked seems to indicate otherwise, though the comment might be misleading.

chrome bay
#

GetLifetimeReplicatedProps() is only called on the CDO to create the FRepLayout, it's not called for any runtime instance

#

The only per-instance control you get is to turn them on/off globally in PreReplication()

latent heart
#

So what does that method do then?

chrome bay
#

SetCustomIsActiveOverride() only works during PreReplication

#

So you can turn them on/off, but you can't change the condition or which connections they replicate to

latent heart
#

Well, turning them on/off is conditional, so might do what he wants.

twin juniper
#

soooo apparently

#

unreal engine doesnt support p2p .. ?

ancient adder
#

@chrome bay Your guide on replicating UObject was very helpful, thanks alot πŸ‘

twilit radish
# twin juniper unreal engine doesnt support p2p .. ?

If you’re referring to true β€œpeer 2 peer” where there is no real authority then no. Unreal is all based around a server / client model. You can have a client be the β€œhost” however (the β€œListen Server” model).

twin juniper
#

and thank you

#

my heart sank thinking i have to drop unreal and do unity

#

i think unreal is so cool xD

twilit radish
#

πŸ™‚

#

But yeah, sounds like what you want are β€˜Listen Servers’.

twin juniper
#

thx again

#

have a great day

glad river
#

So only variables set on the server will be replicated right? to confirm

twilit radish
#

Yes. Replication is only from Server to Clients. One of the use cases for RPCs is to go from Client -> Server if you want to communicate something towards the server.

pallid mesa
#

yΔ™s

glad river
#

I have a loop that runs on client that calls a run-on-server event 4 times. The event is called but the effect is not always happening. Is it a bad idea to call a server event in a loop?

#

@twilit radish @pallid mesa thanks

twilit radish
#

Are you calling it 4 times in the same moment or is there like a delay in the loop?

glad river
#

no delay

twilit radish
#

Why not just use 1 RPC after the loop finished?

#

You can do 4 RPCs if you want, it's not necessarily wrong but I believe there's also a limit by default on how many RPCs can be called on an actor per I believe frame.

glad river
#

That might be the way to go. The player actor is telling other things to run but I might do a single rpc to then have the server tell the actors there to run

#

Basically I am trying to have an animation variable be set on multiplayer. The player hits a button which should have the BP send the rpc to set the bool to trigger the animation

#

I am going to make a single rpc to have the server do the 4 calls

glad river
#

I can't figure out why the run animations are replicated across multiplayer but the variable I added doesn't

#

The default third person stuff

glad river
#

When I RPC an event to the server and there call an event on another bp that event is run 3 times. I have confirmed the the event is only called once and it fires 3 times. Behavior is the same when not on multiplayer. Anyone know whats up with this?

vague spruce
#

is there any way i can spawn an actor for everyone BUT the owner? i'm spawning a projectile from a gameplay ability and i want it to spawn for the local player immediately and replicate for all others. but if i replicate it for the local player too, two projectiles spawn

low helm
glad river
#

k

glad river
# low helm post some pics of that

Well I simplified the logic to take a simple pic but it fixed the behavior. sooo thanks? i guess haha I now have a new thing to look into

toxic lion
#

I have a bit of code here that sets a replicated variable, and then calls out the OnRep
the OnRep just fires a delegate

        if (CurrentAngle <= MinRotationAngle + Deadzone || CurrentAngle >= MaxRotationAngle - Deadzone) {
            if (bLimitReached == false) {
                bLimitReached = true;
                OnRep_LimitReached();
            }
        }
        else {
            if (bLimitReached == true) {
                bLimitReached = false;
                OnRep_LimitReached();
            }
        }

When playing as a client this works fine, but when playing on the server the delegate fires twice. I'm assuming because setting the variable fires it once, and specifically calling out the OnRep function fires it twice.
I haven't yet found a combination that fires correctly when playing as a client, and playing as the server

Commenting out the OnRep_LimitReached() works fine when playing as a client, but then isn't called when playing as the server

rocky stag
#

is there a way to listen on a single port for all dedicated server instances ?

twilit radish
twilit radish
rocky stag
#

its not physical

twilit radish
#

What I'm saying is that you could make your own program that forwards the data to specific processes, but I really don't see why you would want that.

#

You can only bind one process at the time to one port.

twilit radish
rocky stag
twilit radish
#

Docker containers have the exact same issue. The only thing different with docker containers if I remember correctly is that you can map an 'external' port to an 'internal' docker container port but it doesn't change the problem that you can only have one process per port. Why can't you just use multiple?

rocky stag
#

The server provider limits me for opening ports on their switches

rocky stag
twilit radish
#

Then I would really look at if you can solve that with them or switch to a different host that does not give you so little ports. Normally you should definitely have a few ports.

rocky stag
twilit radish
#

πŸ‘

toxic lion
twilit radish
#

I think it should be just fine to have it inside an OnRep but all I can really think of is it just being called twice. The OnRep_LimitReached(); also doesn't accidentally call the delegate twice?

toxic lion
#

yeah there's very little going on in there

void URotationInteractableComponent::OnRep_LimitReached_Implementation() {
    if (bLimitReached) {
        if (CurrentAngle <= MinRotationAngle + Deadzone) {
            OnLimitReached.Broadcast(false);
        }
        else if (CurrentAngle >= MaxRotationAngle - Deadzone) {
            OnLimitReached.Broadcast(true);
        }
    }
}
grand kestrel
twilit radish
#

Maybe that Unreal doesn't like the _Implementation? It's not needed for ReplicatedUsing stuff.

#

I'm confused why that even compiles πŸ€”

toxic lion
#

rooThink1 facepalm
I forgot that OnRep functions don't need to be marked as Server, Reliable

twilit radish
#

That makes it an RPC.

toxic lion
#

yeah. silly mistake

twilit radish
#

I would remove the Server & Reliable thing and the _Implementation and see how it then goes.

toxic lion
#

Thank you. let me play around with that for a bit, and see where I get

pallid mesa
#

in fact net mans are worther to use when you want to avoid replicating actors

#

and in your case the character is already replicated

twilit radish
#

Also if it's about just saving bandwidth with a ton of bools use bitpacking instead πŸ™‚

pallid mesa
#

well when speaking about netmans we are speaking about a cpu optimization

#

same goes for the push based net model

twilit radish
#

Ah alright then I misunderstood, woops.

pallid mesa
#

bandwidth optimizations are almost never needed πŸ’€

twilit radish
twilit radish
pallid mesa
#

just dont do dumb I'd say

twilit radish
#

If you're building the next Factorio as an example you should definitely care about your bandwidth πŸ˜„

#

But at that point you likely already know what you're doing I guess.

grand kestrel
#

In that case I'll reserve net managers for other actors. Thanks for the advice

pallid mesa
twilit radish
#

You'll be bound by everything honestly x)

pallid mesa
#

also cpu optimizations usually bring bandwidth optimizations alongside

#

for example more controlled update frequencies

pallid mesa
#

its pretty cool to see what people can build sometimes

#

and these create use cases almost impossible to find out in QA

twilit radish
#

Also I'm kind of surprised that in your blog post you are able to achieve better performance by quite a bit over Epic xD

#

Although I suppose this is more for when you have a massive amount of actors right?

pallid mesa
#

you can see speedup on the hundreds

#

just think that the sparse actor update now gets compiled in one single actor which favours linearity. Also it is scoped down to the minimal struct you'd like to replicate

#

so I wouldn't be surprised to see scalability already at a low count

#

But yeah if I were you I'd use push based by default

#

net mans will help for high counts

twilit radish
#

One thing I do wonder about on the topic of saving CPU is your FindByPredicate method.

#

You mention in the post you have 720 actors in the manager. What I'm wondering about is how much CPU power now actually goes towards the updating?

#

Because all the post mentions is the Net tick method.

#

With the FindByPredicate I'm referring to the internals of ANetMan::UpdateActor, sorry. Not entirely clear from my side πŸ˜…

pallid mesa
#

Mhm, its a linear search, so O(n), its not actually needed in every instance if you can figure out a smarter way to identify your elements... and such update is event driven so it wont eat much CPU.

#

the idle time is what we'll benefit from the most

#

property comparison and all the fuss

twilit radish
#

You do have a good point that regardless it's always better than constantly having it checking yeah. Even if lets say the Update method is slower, because it is event based it can never persistently be a bottleneck. At most for a single frame.

#

And you can indeed spend some time on optimising the FindByPredicate part if really needed ^^

pallid mesa
#

aye, its a point to consider aswell, I might want to add a line or two about that in the post

#

its a lot of information

#

but its all about tools for our toolbox

#

we gotta know when to use them and for which use cases

twilit radish
#

That for sure yeah. Didn't mean anything bad with it, don't worry. But I was just curious about this in specific πŸ˜„

pallid mesa
#

Thats good, that means you did your homework

#

these points also help me to understand what's lacking from the post

#

I could simply create an example without a linear search function

#

but i think its interesting to keep it and to comment on it

#

πŸ˜„

twilit radish
#

I wouldn't worry too much about providing a different example for it. It's also kind of on people them selves to test out what works and what doesn't. If they find that this in specific for them still eats a bit too much CPU they can optimise it. It's for sure a really good blog post though. But just like with anything else you should always make sure it actually benefits your project πŸ™‚

fathom aspen
#

btw what's the plural form of NetMan, is it NetMen? πŸ˜›

vague spruce
#

I don’t normally do this but I figured I’d cross post in #multiplayer for anyone who has experience with GAS. I’m executing an effect and there’s a noticeable delay in the UI (it has delegates bound to the attributeset). Is there any way I can locally predict this? I thought GAS was supposed to handle a lot of that for me. Here’s the link #gameplay-ability-system message

pallid mesa
pallid mesa
vague spruce
pallid mesa
#

you should be able to find examples of this on Lyra

crystal crag
#

I just saw a tutorial where someone is setting

#
[/Script/Engine.NetworkSettings]
n.VerifyPeer=False
#

for beacons. That seems like a very dangerous setting. Am I wrong here?

#

Or I meant to say, that seems very dangerous to flip off.

#

They couldn't explain why they had to turn it off, which means that they just did it "because it worked"

little needle
#

hello, how can i find multiplayer rts type fog of war plug in for 4.26 project?

graceful mango
#

How to pause replication of actor to specific player without destroying actor?

pallid mesa
fluid summit
#

Hi! does anyone remember the name of the sequence to get a random point in some area with a certain dispersion pattern?
Not just random, but with some space between them.
I'm redoing the algo to position the monster spawn points on my game and i remember seeing a sequence like that

fluid summit
potent coral
fluid summit
#

environment query system = eqs?

potent coral
#

yes

fluid summit
#

not the one i'm looking for but that one may work, gonna check it

#

Sobol sequence ! that is it

#

Sobol sequences (also called LPΟ„ sequences or (t, s) sequences in base 2) are an example of quasi-random low-discrepancy sequences. They were first introduced by the Russian mathematician Ilya M. Sobol (Илья ΠœΠ΅Π΅Ρ€ΠΎΠ²ΠΈΡ‡ Боболь) in 1967.These sequences use a base of two to form successively finer uniform partitions of the unit interval and then reor...

shell forum
#

EQS is a life saver

#

Would highly recommend learning it.

grizzled stirrup
#

If you have a replicated AActor* as part of a struct and it is null, will you still pay the full bandwidth cost for that pointer when the struct replicates initially?

#

Or will only non default values replicate even if it's the first time the struct ever is replicated?

dark edge
#

We have our own vision system

grizzled stirrup
#

It's quite easy assuming you can query things from your vision system like GetCanSeePlayer

#

EQS only cares about specific inputs (location to query from, location to query etc.) that can be filtered by conditions and then returns a nice location or actor as an output

#

It's minimal code / work. The only annoying thing is you need to create separate classes for contexts but I just do it all in a single contexts helper class and switch via an enum πŸ˜„

dark edge
#

We care about seeing pawns. The player's pawn is just a pawn, nothing special.

#

This is for a roguelike with teams/factions, so AI can and will engage with each other just like they do with the player's pawn.

grizzled stirrup
#

EQS is indeed a lifesaver so would def recommend it

#

A location behind the pawn that is in cover but visible from the waist up that is neither too near or far that is also cheap to pathfind to?

#

Easy!

#

There's fairly robust debugging tools too to make sure you are filtering correctly

#

Nice to see how it filters and scores

dark edge
#

I'm guessing it's not too hard to also build threat and distance into it?
"Find a location above 20m from TargetPawn but within 30m of my allies"

grizzled stirrup
#

Absolutely

#

Easy work for EQS

dark edge
#

Hmm that's interesting. I def. want to have functionality for AI to think about their capabilities and estimate others capabilities, so a dude with a shotgun might try to rush someone with a sniper, and a dude with a sniper might try to keep his distance.

#

I think I can bake it all down into a few dimensions like firepower, importance, range, etc

grizzled stirrup
#

Yeah! you can also quickly build complex behaviors by having enemies switch out their queries (I usually randomly alternate between 3 in battle)

dark edge
#

I need to figure out how to do heatmaps in the same way as our vision system.

#

sorta like influence maps. Something like
"find a position that maximizes (Firepower - Risk)"

#

Firepower being a 2d scalar field of my teams damage capabilities, with Risk being a 2d scalar field of my enemies capabilities

grizzled stirrup
#

Yeah this kind of stuff florishes with EQS but you'd of course have to run tests from candidate points like potential firepower from this location is very high but it's risky as it is far away or whatever

#

But EQS makes running these tests and filtering / scoring stuff very easy

#

And it's very fun to finetune the score factors

dark edge
#

Yeah so it'd be more like
"find a position that maximizes (Firepower - Risk - TimeToGetThere)"

#

We also want to do hidden information for AI too, so they don't know everything aobut the map until they've explored it.

#

same as what players see, an expanding field of visible and explored areas

grizzled stirrup
#

If you can query that at any given world position point per AI then it'll be simple to filter out any points that haven't been discovered yet

#

Or give them high risk scores!

#

A lot of fun to make rich queries full of surprising outcomes!

dark edge
#

So it seems that EQS would just give me the querying framework, since I'm doing all the senses and scoring on my own

grizzled stirrup
#

Well assuming your senses give things like can I see or hear this player, you'd still be scoring the points that EQS generates no?

#

EQS will determine the score for each of the points it generates based on your inputs (what can be seen / is it within a preferred radius? etc.)

#

The filtering / scoring tools in EQS are a big reason to use it as you can nicely stack filter rules based on each test

dark edge
#

This is effectively a 2d game so generating a point to score isn't that hard, it's just a point on the navmesh

summer tide
#

Which function or variable to use to check if the game is in muliplayer or single player?

quasi tide
#

Check the ENetMode

#

GetWorld()->GetNetMode()

summer tide
#

I found another one. IsStandalone?

short arrow
#

There's also is dedicated server

split siren
#

@chrome bay "Fast"Path with 365ms per tick... I needed to share this beauty (80 players)

twilit radish
#

Just set the network tick speed to 2 and call it a day 🀣

split siren
twilit radish
#

I'm sure no one will mind like at least ~500 milliseconds of delay by default.

split siren
twilit radish
#

Even better!

#

πŸ˜‚

split siren
#

Getting the fast path to work is a f**** nightmare

twilit radish
#

What does it even do?

split siren
#

You know Rep Graph?

twilit radish
#

Never used it no.

split siren
#

Basically checking if each actor should be replicated is expensive.. Lets say you have 250 players and 10_000 replicated actors, that's 2.5 m checks you need to do each tick. So Rep Graph groups actors into buckets (aka nodes) and makes the whole process faster.

#

But you still need to package each actor for each client. That is again redundant work, so Fast Path will serialize actor once, and reuses those packaged bits for other connections.

twilit radish
#

Ah alright. I can imagine that's not really efficient by default yeah.

vague spruce
#

@split siren hey that's cool. is it a plugin?

split siren
vague spruce
#

i'm guessing it's used in fortnite? lol

split siren
#

Fortnite was a clear motivation for that plugin, true.

#

Aka, it was made for Fortnite

polar wing
#

Hey! I have a mixed animation/tech question that I'm going to be exploring in the coming months, but was wondering if someone here has some advice before I get started. Basically, is Motion Warping replication-friendly? Considering dynamic environmental data is fed into a root motion animation montage (kind of like the many vaulting examples), would the setup with motion warping achieve the desired root motion effect in a replicated environment with the built-in CharacterMovementComp, or is there a lot more setup required? Is that even possible with the built-in tools, or would there need to be additional work done on supporting motion warping in a replicated environment (or would you recommend avoiding it entirely in that context)?

polar wing
#

Just for more context, this was kinda confirmed to work via an Inside Unreal, but the vid is a year old so I'm wondering if there are updates or if someone has had a proper run at it?
https://youtu.be/SM_AR-oZ-1k?t=3229

Full-Body IK (FBIK) provides you with the tools to create reactive, dynamic characters, and Motion Warping is a new Experimental feature which allows you to manipulate root motion animations to adapt them to the world with fewer custom assets. Join us as we explore Unreal Engine 5’s new animation features!

ANNOUNCEMENT POST
https://forums.unrea...

β–Ά Play video
grizzled stirrup
#

Maybe you already have all you need and EQS isn't required

#

But it's very handy at least for my cases

grizzled stirrup
#

As you give it loads of conditions and then tell it to spit out the best 5% of points or whatever

#

There's loads of nice weighting options to easily hone in on certain responses (which you'll see with the testing pawn)

cosmic epoch
#

Is there any way to authoritatively ignore movement input for a specific world axis? Without constraining the entire cmc ofc, since that would also kill all external force and impulse applications, which I want to keep for said axis

#

Or is the server completely unable to filter out movement input from the client requests?

urban mason
split siren
#

How do I switch from one threaded dedicated server to multithreaded dedic server?

cosmic epoch
#

@dark edge I'm manually adding height on tick during flight via add actor world offset, so that the player always has the same max distance from the floor. Basically a max height limit, so I don't want the player to add his own height input, potentially exceeding the height limit or fighting with it.

#

The only authoritative way to shut off Z axis input for good seems to disable flight movement mode as necessary...

#

But maybe there's a better way

#

I basically don't wanna leave a loophole for cheating that would go beyond max flight height

fleet viper
#

i have set the controller and the character classes to replicating, still the ai isnt simulated on the server. I remember that the ai is normally fully simulated on the listen server and the client just gets all the information. What did i do wrong?

#

TLDR: Ai does move on the server but is standing still on the client

#

Yes I did create the base classes in c++ maybe i have to set something there?

fathom aspen
fleet viper
#

ill try and replicate all the variables

fathom aspen
#

Replicate?

#

Replicate what variables?

fleet viper
#

the most basic behavior i have currently is patroling a spline path, still the ai does move along on the server but not on the client

fleet viper
#

thats why i dont understand why its not doing it

fathom aspen
#

AI stuff exist only on server. There is no replication here

#

Only AI Pawn replicates

fleet viper
#

so if the ai exists only on the server and the server simulates the ai to move to xyz then the ai should also do that on the client right?

fathom aspen
#

BehaviorTree automagically does that. It's the "engine" of AI Pawns, it's what makes the pawn decide on what to do and what not.

#

AI Controller just tells the BT to run

fleet viper
#

so then my setup must be fine

fathom aspen
#

I haven't seen it, and most likely it's not. There is nothing special about it really

fleet viper
fathom aspen
#

It's probably because you replicated the AI Controller

fleet viper
#

did disable and still same result

fathom aspen
#

Show the error

#

I'm not an error guesser

fleet viper
#

i did use the bool return value of the run behavior tree node. it just returns false

#

nvm it works fine

#

but still the location is completly different

#

behavior tree gets run but ai just stands still on client side

fathom aspen
fleet viper
#

it seems like the location isnt even replicated at all

azure cape
#

is there any better way than this to know if an actor is controlled by the current unreal instance AND this instance is not a server? this seems a bit cumbersome to me

#

basically trying to get true out of it only if the actor is controlled locally and if this isn't a server only instance

fathom aspen
#

IsLocallyControlled and not IsServer

#

Though what class is this?

azure cape
#

it's the player character

quasi tide
#

And you can wrap that in a macro or function library so it is usable anywhere.

fleet viper
#

@fathom aspenyou ever had that kind of a problem?

fathom aspen
azure cape
#

wouldn't is locally controlled also return true on like, an AI controlled character on the server as well?

fathom aspen
fleet viper
#

sure gimme a sec

fathom aspen
#

Then use IsPlayerControlled?

azure cape
#

that might do it, thanks

fleet viper
#

the defined patrol path variable is set in the editor and references a spline actor

#

and this is the real moving logic

#

@fathom aspeni guess you dont know either

uncut atlas
#

hi, does a property not replicate to anyone if it's set to COND_OwnerOnly but has no owner?

fleet viper
#

ok so now im literally only using the move to node and the ai is still standing still on the client side

uncut atlas
fleet viper
#

yes it is replicated

fathom aspen
fleet viper
#

it does not work in any way for the client

#

im pretty its because of something that i have to add to the base classes in cpp