#multiplayer

1 messages · Page 184 of 1

twin juniper
#

I don't think that's the correct way of doing it, going through all the player and spawn it on each client

nocturne quail
twin juniper
visual mountain
#

Multiplayer steam online works for my game locally but not online. Any common reasons for this? Is there anything particular my friend should do?

nocturne quail
pallid mesa
#

then to interpolate the projectile movement you might want to override postnetreceivelocationandrotation and hook the pmc interpolation method over there

tranquil eagle
#

Is it bad idea to try coding deterministic lockstep on top of built-in UE networking? Here's what I thought I could do:

  • Every client reliably RPCs from player controller to server (host) with current input.
  • Server reliably RPCs the input to all other players. This way every player can maintain a growing list of input structs from every player

I'd then make a ticking object that executes a "lockstep" at fixed intervals, unless not all inputs have arrived for the current "turn", in which case it just waits. Actors would observe the game state and e.g. interpolate their position in tick method so that game looks smooth. What do you think?

#

And I suppose I can't use built-in pathfinding and physics then, right? If I wanted that, I could maybe use recast and detour with every float across its codebase replaced with software float implementation, like cpp_bin_float from boost maybe?

pallid mesa
#

if your lockstep is based on a discrete turn and not in the current frame count, might be easier

tranquil eagle
#

I thought I could make it track time and execute a step, for example once every 100ms? Or some other duration?

pallid mesa
#

mh i would honestly try to integrate something like ggpo

#

specially if you need something quite sensitive

tranquil eagle
#

Oh, neat! Never heard of it, ty!

#

I'm just tinkering for learning purpose, nothing major though

#

Really want to get to know how this stuff works

pallid mesa
pallid mesa
#

the other approach has been commented here before, look around this #profiling message
its an interesting approach where i believe you send request to such central system, and since formulas like verlet are semi deterministic, you can get quite decent results by simulating the projectile locally and then replace it from the server spawned one once u instantiate the "real niagara" one... prolly matt could give more insight on this

wet briar
#

Wassup everyone i have a issue that i cant figure out so i have a shooter game and i have aim logic i made a cross air widget (little white dot) and i want it to hide itself when aiming and then be visible when not it works on the client but i don't know how to make it work on the listen server screen can anyone
help would be appreciated it

round bobcat
#

Why is my widget not updating to my value on the client. In my code,

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

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

void AMainMenuPlayerState::OnPartyCreated() {
    ServerCreatePartyID();

    if (Menu) {
        FText PartyIDText = FText::FromString("PartyID: " + FString::FromInt(PartyID));

        Menu->PartyIDText->SetText(PartyIDText);
    }
}

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

    AttemptedPartyID = UKismetStringLibrary::Conv_StringToInt(PartyIDString);

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

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

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

    PartyID = AllPartyID.Last();

    GEngine->AddOnScreenDebugMessage(-1, 15.0F, FColor::Yellow, FString::FromInt(PartyID));
}

the value of PartyID updates and shows on the widget for the server when I call the OnPartyCreated function, but when I do the same for the client, the value of PartyID does update, but the value shown on the widget is 0. What do I do?

sinful tree
#

Is PartyID a replicated variable?

round bobcat
sinful tree
#

OnRep?

round bobcat
sinful tree
#

How does the client know when to update the widget?

round bobcat
sinful tree
#

What I mean is, your OnPartyCreated looks like it updates your widget. When does the client know to actually trigger OnPartyCreated?

round bobcat
dark parcel
#

You are only rotation the player in the server machine

#

Actor rotation isn't replicated by default afaik

sinful tree
round bobcat
crystal crag
#

Is there a way to control which IP address UE uses when testing joining a session locally (server & client are running off 127.0.0.1)? I have a hyper-V network, which my game project doesn't use, and I can see in the logs UE trying to connect to that adapter instead of just using 127.0.0.1.

round bobcat
normal viper
#

I'm not sure what I'm doing wrong. Basically I'm not sure how to properly get reference to the Player State I think? In the Game Mode I have logic that after player posseses Pawn, I get Player State from it and by interface send event there to set variables (inside PlayerState). Then in Player Controller I'm spawning building, and I need to send PlayerState of that PlayerController reference to the building, so then the building can read Team Settings from PlayerState. Does it make sense?

crystal crag
#

[2024.05.26-19.50.36:454][248]LogLoad: LoadMap: 106.437.95.404,192.168.1.10,192.168.1.78,123.45.808.1,127.0.0.1/ShooterMaps/Maps/L_Convolution_Blockout

round bobcat
sinful tree
#

Two options:

  1. Have your widget create a bind for the field that you want to display the value. This isn't great though as it's basically refreshing on tick for something that probably isn't changing all that often, but it is easy to get working quickly.
  2. Make your variable OnRep and have the OnRep update the UI or call another event dispatcher your UI can bind to so it can update itself with the new value.
round bobcat
crystal crag
#

[2024.05.26-19.52.20:721][758]LogNet: NetworkFailure: ConnectionTimeout, Error: 'UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 0.38, Real: 3.00, Good: 3.00, DriverTime: 20.46, Threshold: 2.00, [UNetConnection] RemoteAddr: 192.168.1.10:7777, Name: EOSIpNetConnection_0, Driver: Name:PendingNetDriver Def:GameNetDriver EOSNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID'
[2024.05.26-19.52.20:721][758]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 192.168.1.10:7777, Name: EOSIpNetConnection_0, Driver: Name:PendingNetDriver Def:GameNetDriver EOSNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Channels: 2, Time: 2024.05.26-19.52.20
[2024.05.26-19.52.20:722][759]LogNet: UNetConnection::SendCloseReason:
[2024.05.26-19.52.20:722][759]LogNet: - Result=ConnectionTimeout, ErrorContext="ConnectionTimeout"

#

So of course it times out and doesn't work, because 192.168.1.10 belongs to the hyper-v network

normal viper
#

Is this Get Player State variable already reference itself if I'm getting it in the player controller?

dark edge
fierce egret
normal viper
#

I'm calling event on Starting New Player in the GameMode, I get Player State from Player Controller, and call event in the Player State by interace. I have set the event to be run on server inside Player State, yet, the variables are not updated after debuging them they are all set to 0. Should I call the server event from player controller, and the interface event should be inside player controller? Like the Run On server should be inside playercontroller called to Player State? What I'm missing? I even tried to set the numbers to be default to others and still everything is basically like 0000.

normal viper
#

Okay, so setup was good actually if anyone is curious. I forgot to Set struct inside Player State... xD

#

this was missing

#

Also if I understand it right, I don't actually need to Run On Server event here, because it's called already from Game Mode which is server, so interface is enough?

dark edge
normal viper
#

Automatically wanted to avoid casting, but I know that the player state is already in the game. I don't have good reason 😄

normal viper
glad robin
#

Doing a little project to checkout ability system and was curious about best way to handle character selection. So fighting game, Players in lobby character select screen. Currently I just have it so when they click on a character it deletes their currently controlled pawn, spawns new one, possesses, and everything ready. Then travels, but this feels strange. Should I handle this is some other sort of way? I thought I saw ~~PlayerState ~~ GameInstance mentioned for a similar situation before but couldn't find again.

Edit: Ok working on paper so have not testing but I think my plan is to have the selection stored in PlayerState. Then on the GameMode I override the default pawn spawning and get the selection choice, then use that to handle creating and possessing proper character.

oak pond
#

what the hell, why have I got an enemy that works differently if theres another player in the server omg

#

testing as client, but just one, my enemy works fine as its supposed to, but when I test with 2 players, I can slow it down in its tracks by shooting it. I know no ones gonna know how to help with this specific problem because its my scripts but why the hell would something work differently depending on how many players what

#

oh right of course, THE FPS DIFFERENCE

#

was using a launch character node, but set to 0,0,0 since I was testing without it, turns out it still makes a difference based on fps even when all 0s

#

I hate launch character man cmc is so bad that it has to make actors "jump" just to push them I hate it

twin juniper
#

why does no one talk about the fact that we must call the function that isn't _Implement for a RPC, but the one that's written in the .h

WHY???

#

It took me 3 hours

#

--
Is it good to do a server RPC, when a bullet is shot? Could it be hacked or is it better to do some kind of validation?

quaint rain
#

So I've got a player's unique net ID, how would I go about kicking them from my session?

candid tinsel
#

how can i make the ai percept multiple players instead of index 0 which is the server

fossil spoke
#

You can do that by comparing its class

#

Instead of comparing it to a reference of an object (like the 0 Index Character as you have it now)

candid tinsel
#

what is the blueprint of the pawn is it get player pawn?

#

i tried assigning players on postlogin as an array in the gamemode but wasnt sure how to implement it

brazen anvil
#

How does replicating a class work? Like if I have a reference to a actor component and it is replicated.

nova wasp
#

It Depends ™️

woven basin
#

Also if you use Rider - it handles this for you automatically. Just another +1 for Rider for me 🙂

woven basin
# twin juniper -- Is it good to do a server RPC, when a bullet is shot? Could it be hacked or i...

You RPC from the client they fired the gun, and the "direction" (since they could have moved their mouse slightly before firing, so the server will be lagging).

You can validate on the server if they are allowed to fire (gun cooldown, not stuneed, and enough ammo etc). You can also validate if the location they are shooting at is probably valid. i.e. not on the other side of the map too far from the room they were in 2 second ago.

The client tells the server what it wants to do. The server decides if it is allowed.

sinful tree
#

Ownership needs to be set on the server for replicated actors. If the owner of the actor is defiend as an actor that is owned already by a player (ie. Player Controller, PlayerState, or their controlled pawn) then the client is allowed to send RPCs to the server through their newly owned actor, and the server can send Run On Client RPCs to the client that owns it as well. There are additional replication conditions you can utilize on variables that are based around the owner, There are lots of other things tied to ownership as well, like Owner Only See or Owner No See, and some bits with network relevancy.

#

Replication only happens one way, from server to client.

#

Any values you change on a client will only be changed on that client.

#

Yes it does, I just mentioned a bunch of things that ownership can change in regards to replication.

#

The only networking thing a client can do, is send an RPC to the server.

#

Replication conditions... Relevancy...

#

That changes how things replicate.

maiden flame
#

Maybe give a thanks when someone answers your original question, instead of debating what else they said 🤦‍♂️

peak mirage
#

I was messing around with Iris and suddenly got this message
Disallowed to write first packet in batch, with Iris this is not good!
Is this imply that I should replicate variables manually? Or do I messed thing up too much?

nova wasp
#

what does "replicate variables manually" mean? Iris is mostly a drop-in replacement

half iris
#

Is there a particular reason why we cannot replicate functions directly and instead have to make a custom RPC event, and then call the function off of that?

#

Is it because functions are holding up the frame until they complete, and so we can not do that for multiple ms whilst we wait for the Replication to finish?

kindred widget
#

Not really sure what replicate function means in this context?

half iris
#

Having these options on a function

kindred widget
#

Ah. This is a BP thing because in BP there is a clear distinction between events and functions in that an event can never return a value. RPCs cannot return values, so there's not much point to making it a function.

half iris
#

Ah I see! Would this be different in C++ then?

kindred widget
#

Yes/No. C++ doesn't really have a separation of the terms. An "event" is just a function returning void. You still cannot return values in an RPC.

half iris
peak mirage
nova wasp
#

FIrisFastArraySerializer instead of FFastArraySerializer

peak mirage
#

Same usage with normal fast array I guess?

#

Got that, trying it right now

nova wasp
#

Iris completely replaces the underlying serialization and iteration stuff for replication, but the surface level api is almost all identical

#

it has some very, very esotiric small differences

#

like how some replication tasks are ordered etc

#

honestly it's probably fine to use for most projects but it's under development still

peak mirage
#

Yeah, so far so good, I really don't have to change anything to work with Iris

nova wasp
#

big benefits for projects that need the speed but it's almost certainly going to cause some small thing to not work how you expect

peak mirage
#

Just too little (none) document on Filter and Priority

nova wasp
#

yeah... you get to read the code :/

#

I would suggest using an engine source build with new stuff like this, they will not care to make it extensible

#

in their defense it's a bit pointless to make nice docs for something that you aren't even supposed to use yet

peak mirage
#

Yeah, no big deal. I think Iris is for the new metaverse thing they are pushing

#

Create some Filter on my own, just not sure if that's best practice

#

And feel kinda weird when don't have to mark things dirty to rep anymore

#

Anyway, "disallow" thing just stop all my variables from replicating with initial bunch

#

Just one class affected, even when I commented all relate net code, everything else is fine

nova wasp
#

it's technically less bound to the idea of uobjects and aactors I guess

#

I'm sure it would be useful for simulating 20000 bored apes or something, I dunno

nova wasp
#

if you have any custom NetSerialize they may need to be replaced with Iris serializers (good luck)

#

there's an example serializer but it's a lot harder

peak mirage
peak mirage
kindred widget
#

Iris is supposed to be a real pushmodel. With the old pushmodel it still had to iterate all the actor channels to see if they were dirty. Iris was supposed to avoid that, so that only dirtied actor channels got checked. Much less iteration code overall.

peak mirage
#

Yeah, saw the profiler on Brickadia's blog

#

Fantastic

nova wasp
jovial inlet
kindred widget
nova wasp
#

I think when people say MMO they mean like, a few thousand players running on one box

#

but in reality a lot of "mmos" have highly instanced servers

#

the backend databases of course are another matter, I have no clue how to approach that

peak mirage
nova wasp
#

I imagine, yeah

peak mirage
#

Like... they promise to not crumble under few ten thousand players?

nova wasp
#

definitely a thing ripe for third party solutions

half iris
#

I am facing a weird issue I haven't run into before. It seems my Server RPC from the owning client isn't actually arriving at the server? This is all in BP.

I have verified it doesn't arive thanks to a print string after the server RPC event. I have also verified that the RPC is being sent from the owning client with a print string.

#

Anyone have any clue what I should be looking for?

twin juniper
#

Want to implement some security in my multiplayer game. It's Listen Server.

Obviously I can't implement 100% security for the player that will be the host, but at least for the other players I want it to be foolproof.
The clients are sending RPCs to the server. On the server, I want to check if the Client that sent the RPC, meets certain requirements, before executing it.
How much control do clients have over game code. Like can clients choose the parameters that pass in with the RPC. Specifically I want to send with the RPC a variable of the player controller, that sent that RPC. Can the client send a different fake player controller, like a player controller of another client?

half iris
tardy fossil
#

an easy way to do multiplayer security is just handle all client actions as inputs and handle all logic on the server

twin juniper
half iris
# twin juniper I don't know if that's a wise advice, but it's a convenient one, so I'll take it...

Its like @tardy fossil said. You can handle easy security by treating the clients only as input and run all the logic on the server, thus making sure that the clients get no chance to manipulate any data whatsoever. This does need to be balanced with how much traffic you are generating with this approach, as this at some point, will start to cause network lag.

I take great comfort in knowing that most people won't bother cheating. Those that do will find a way to do so (even games like Overwatch and CoD suffer from this).

half iris
worthy knot
#

is it a good idea to use forcenetupdate? especially in code that is heavy on framerate such as for loops which drop framerates for a few seconds and can possibly desync values of variables

dark parcel
#

As client your rpc will get dropped if you run it on actor that you don't own.

#

Oh I just scroll up lol, u did figured it out

worthy knot
kindred widget
# twin juniper Want to implement some security in my multiplayer game. It's Listen Server. Obv...

You don't need to worry about this kind of security usually. Clients can only RPC through actors you let them own. Default ownership is their PlayerController, PlayerState, and a Possessed Pawn. You don't need to pass a player controller for any reason because the RPC won't run unless the owner is set on both client and server. Your ownership chain will always route back through to a PlayerController or null, as PlayerControllers are the main net owning actor.

To avoid cheating, most times you just do some very basic checks on the server and this is enough for a lot of games.

RTS example. Player wants to tell his 12 units to attack something. Simple check on server is to see if that player can even see the attacked unit. If not then don't allow it, as this can lead to cheating via sending troops to attack through FOW which paths directly to a base they might not have scouted yet.

FPS example, player shoots another player. Usually this is a client telling server they shot something. Because server auth is laggy, and no one plays a laggy FPS. A lot of people do this via rewinding. Saving positions mostly and doing some simple basic math checks to see if the hit 'might' have been possible. This is tricky to get right but usually it's vague. Mostly just to avoid allowing a player to snipe someone from across the map through three solid walls.

For other cases you need to rely on client side solutions such as Easy Anti Cheat.

FPS example of this is auto aiming. You cannot accurately detect this on a server. Clients don't send every look update to the server and there isn't really much authority there. Reason being is that server auth is again, laggy. People buy expensive monitors to avoid laggy FPS games, they're not going to put up with networking lag. So your only choice is to detect this locally. Software like Easy Anticheat allows you to detect and ban players for certain things like this which cannot be correctly done with server authority.

dark parcel
#

Example: on button click in widget -> get character -> server rpc

worthy knot
dark parcel
#

Also you can give ownership (must be done by server) however, this is not recommended

#

And an actor may only have one owner

#

Done via set owner node (again has to be done by server)

worthy knot
#

one owner is fine, but can we not give ownership on client side?

#

just to that the client rpc can then call server rpc

dark parcel
#

That doesn't make sense

#

The server should be the one to decide who owns what

#

And even that is not recommended because it just become easier to cheat, afaik

worthy knot
#

this only runs when i possess my vehicle, otherwise if i hit the vehicle without possessing it, it wont fire

#

and im guessing this is coming down to ownership, because i checked on begin play, the owner of the vehicle is AI_controller_0

dark parcel
#

You can set owner, or you can route the function somewhere your player own. Those are the only choice imo

kindred widget
#

Why do you need to server RPC the client hitting the vehicle? It hits on both sides.

dark parcel
#

Yeah going back to the talk yesterday, you should really handle those collision and deformation locally

worthy knot
kindred widget
#

What is this for exactly?

worthy knot
kindred widget
#

Is it really off by that much though? Both should be roughly the same even if slightly different?

worthy knot
worthy knot
#

minor differences, but that aside, the major problem is rep notifying the late joiners, because when they join they see fresh new cars that are totally undamaged

kindred widget
#

I meant on the server. If it's close enough to the clients then it shouldn't matter that much.

worthy knot
dark parcel
#

Avoid multicast for anything that needs to be in sync. It will never work.

worthy knot
kindred widget
#

Dirty way is just OnRep an array of hits. 🤷‍♂️ Resimulate it with each onrep.

#

Hopefully the resim isn't too expensive.

worthy knot
dark parcel
#

If the result is simmiliar then just do everything locally. You will get responsive feedback.

For every collision on the server, store the hit data in an array.

When late joiners comes simulate deformation using the array and call it a day.

kindred widget
#

There really isn't a good way to do it otherwise. 🤷‍♂️ I mean even just the resim part is kinda 'eh'. A lot of games fake this heavily by premodelling destroyed areas. Much faster on CPU and GPU at runtime to do than a full damage resim.

twin sable
#

if you attach a replicated actor to another replicated actor, this attachment is also replicated right?

These variables are replicated so I'd assume this to be the case but their OnRep funtions don't immidiately update attachment so I'm not sure

    /** What we are currently attached to. If valid, RelativeLocation etc. are used relative to this object */
    UPROPERTY(ReplicatedUsing = OnRep_AttachParent)
    TObjectPtr<USceneComponent> AttachParent;

    /** Optional socket name on AttachParent that we are attached to. */
    UPROPERTY(ReplicatedUsing = OnRep_AttachSocketName)
    FName AttachSocketName;
kindred widget
#

It is

twin sable
#

ok ty

worthy knot
dark parcel
#

Authority for Server -> Code runs in server
Remote for Client -> Code runs in client machines

#

collision can be handled locally, meaning there is no networking here

#

the network you can do is to store the hit data if Server (using switch has Authority)

#

which is replicated

#

When a new joiner comes, you can re-simulate using that replicated array

#

Switch has Authority -> If Authority -> Simulate Deformation -> Add Hit result to Array

#

If client -> Simulate deformation

worthy oak
dark parcel
#

only time client have authority is when they spawn the actor locally

worthy oak
#

Right but you should be careful with context there and make sure you know what it’s doing

dark parcel
#

So doing a check here with switch has authority will filter what runs on client and what runs on server

worthy oak
#

In this case maybe yeah

dark parcel
#

not maybe

winter pollen
worthy oak
worthy knot
#

I just rep notified the array. and now i get this type of a message in the dedicated server log

#

LogOutputDevice: Error: Ensure condition failed: !IsBunchTooLarge(Connection, Bunch) [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\DataChannel.cpp] [Line: 1161]

LogOutputDevice: Error: Attempted to send bunch exceeding max allowed size.

kindred widget
#

O.o How big is the array for each vehicle? That takes a LOOOT of data to overflow.

twin juniper
worthy knot
worthy knot
#

so looping 30k into the array

kindred widget
#

Oh. I meant that you should replicate the things that caused it. Each client can redo the simulation locally with that simple info.

twin juniper
twin juniper
#

How would it be possible to do a Client RPC (from the server to a client), how to know which client? (I suppose that we would have to send the player controler or smt like that)
Could you give me some examples of the following? !

odd hamlet
#

So if an Event is ment to run on server, and If I want to update the widget map for the client, it won`t because it comes from an event that is running only on server?

spark otter
#

Hiya, I've got an issue where i'm trying to test multiplayer with one client being the listen server and the other being a client, however the second game doesn't spawn correctly and the listen server client does, and when I close one client the other fixes itself, any clues what might be wrong?

spark otter
#

I'll take a screenshot of the ingame differences

#

Left is correct, right is wrong

#

and if I close the left window, right then fixes itself

quick musk
spark otter
#

Set View Target with Blend

torpid crest
#

How do you setup unreal to launch like this?
Having one server and two clients and each one has individual window

#

I have it like this - Launch seperate server set to true but it's not working

normal viper
#

New Editor Window PIE

plain idol
#

How do I make a component visible to the client and not others?

rustic sable
#

visible or only exist on the client? If the second just spawn it without authority

rustic sable
#

then I guess replicate the isVisible or whatever it's called on the component and do a RPC multicast to set it to false if not the owner? At least the way I would try it

tardy fossil
#

if the client owns the object you could use only owner see

spark otter
short arrow
spark otter
#

It's not spawning in the camera on the clientside

short arrow
#

The first thing I'd try is to make sure that is only running locally

#

Islocalcontroller -> branch

#

Also if you're running that code in the controller then there's no need to connect get player controller right?

spark otter
short arrow
#

I'd also setup an isvalid check for the camera you want to view

#

Clients are slow to connect and sometimes code runs faster then the object can be created

#

Lastly have you made any changes to the default camera manager?

spark otter
#

I haven't no 😅

#

I have a feeling it's probably better if I put the code in the player controller, will feedback if that fixes it

normal viper
#

I'm trying to debug one simple thing and it gives me mixed feeling.

  1. Player Controller - I call from Player Controller from local client to show it's own Player State name.

  2. First host/client matches.

  3. Second client matches.

  4. 3rd client shows 1st host/client name?

What kind of magic is that...

#

to be even more funny, from time to time, the last client debug works properly!

#

the red debug is from Player State itself when it get's created

spark otter
short arrow
#

And see if you get those same error logs

waxen socket
#

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

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

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

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

Any advice would be appreciated.

Cheers.

odd hamlet
#

On the begin play of the player controller it creates a widget without mentioning the owning player, does this one replicate the widget for the client ? Because I try to acces it as the client and get the reference to the widget of the first character 😦

kindred widget
odd hamlet
#

so I need to create onee for the server and one for the client separatly via begin play of the player controller?

rustic sable
odd hamlet
#

like to make it separate event?

kindred widget
#

Neither of those solutions are that great. Should use AHUD class's beginplay to initialize your UI. Whatever it needs to display for the character, it can bind to things or wait for the character to be read to bind to what it needs and work. Gameplay classes like character and controller should have zero references to your UI.

#

UI is really hard to maintain unless you treat it like a layer on top and make a decent, structured API to manage it.

odd hamlet
#

And also how do I get a refrence from the AHUD in game for each player?

kindred widget
#

Depends on what you need. I use CommonGame and CommonUI these days. So I simply push a widget to a layer when It's needed. User controls or it's own handing deactivates and removes it based on it's intended use. I don't really manually manage widgets like that anymore.

#

You can get any player's HUD via getting their PlayerController and calling GetHUD

#

There is one on each machine for each player.

odd hamlet
#

ah yeah

#

but basically the reason I want it to do it this way is because of the way I handled the minimap

#

Basically when a player passes a trigger, it calls tthe minimap in order to switch it`s focus

#

my map is like binding of isaac style

#

didn`t think of any other way 😦

kindred widget
#

Minimap can bind to whatever is running triggers. There's also the GameplayMessageRouter plugin for more generic game wide events like that.

reef bison
kindred widget
#

You can copy the entire plugin.

odd hamlet
kindred widget
#

Literally just grab the entire Plugins folder and drop it in your own project. Good set of tools.

reef bison
#

oh got it, I thought there was a way to install it directly within the engine like the other plugins so it would be easier to get updates

rustic sable
#

I have a que slot in my inventory so my OnRep knows what slot to update in the widget. But there's no guarantee that OnReps arrive in order right? there's always a chance you might get a later one if a player is spam picking up items? I mean it works and I even added a Queue but still seems things could go south

kindred widget
kindred widget
kindred widget
# rustic sable I have a que slot in my inventory so my OnRep knows what slot to update in the w...

There is no promises there, no. You'd need to also replicate with it the slot or something. But honestly managing something like that is a nightmare. Making server care about which order the client's widget displays things in is a recipe for disaster. I'd scream at my gameplay programmer colleagues if they made me manage that in a widget with all of the sorting and filtering you need to do in an inventory.

rustic sable
kindred widget
#

Depends on whether you're doing set slots. But for most systems, UObjects mostly. The order of the inventory in gameplay code should not matter. An array of UInventoryItems is infinitely easier to simply sort and filter than any sort of struct based system.

rustic sable
#

yeah my are set slots and a struct

odd hamlet
kindred widget
reef bison
normal viper
pallid gorge
#

Hi, I am using this blueprint to teleport players to another sub level, the thing is that every player will be teleported and not the only one who start the event. How can I fix it to teleport only the interested player?

thin stratus
#

You do need to be aware of the fact that the other actor pin isn't guaranteed to be valid or the original value anymore if you use latent nodes

#

You may want to save the actor that overlapped and block the overlap until everything is done

pallid gorge
bright summit
normal viper
bright summit
#

in editor settings

#

just type it into search box

#

if you have it ticked print messages are displaying on all game processes because it is one "engine"

#

so if you do
if(IsLocallyControlled()) or something and then AddOnScreenDebugMessage it will print out on all clients

#

although yoiu checked for local controller

odd hamlet
#

i try to get the reference for the second players hud but cant acces it 😦

odd hamlet
dark edge
#

You're approaching this all wrong. Link your initial post where you said what you're actually trying to do

bright summit
dark edge
#

@odd hamletWhat are you actually tryign to build

#

Nothing in the UI is relevent to anyone else. All UI is local only

odd hamlet
#

So I want a minimap just like in binding of isaac, in which each characters has it`s own widgeet minimap, but both have different possitions, and I would like to make the minimap update when the client passes through an trigger box, but it only does it for the server, not for the clients too

#

but the trigger on box collision was pinned from an event which wasn`t replicated

#

I made it multi cast i think it might solve it maybe

dark edge
#

no

#

OK from the point of view of a single player, what do they see in this minimap?

#

they see where they are, and where other players are as well I suppose?

#

Every client already has all the info they need, assuming all pawns are relevent all the time

#

on a clients computer, they already know where the other peoples pawns are, and where their own pawn is. That's enough info to draw the minimap

odd hamlet
dark edge
#

show a screenshot of this actual minimap

#

i'm failing to see how it's any different than the normal minimap in any other game

odd hamlet
#

I made it this way

#

, the red squares are where other rooms are located basically, and in the center it`s your position basically

dark edge
odd hamlet
#

well you said in the pov of a single player

#

but my game Is not to be played single player

odd hamlet
#

i cant reach to update thee clients map

dark edge
#

you don't

#

the client machine updates the minimap locally using the info they already have

#

the server doesn't know or care about anyones UI

odd hamlet
#

yeah bro but it`s not an event tick

#

each time a player crosses through an trigger box

#

basically i want to execute a function from my widget minimap that updates the map

#

i don`t really understand the way you want me to implement it

dark edge
#

Then update a repnotify variable on PlayerState or Pawn called CurrentRoomID or whatever

odd hamlet
#

hmm, you think this is the best solution?

dark edge
#

RepNotify_CurrentRoom -> ok now we know the room changed

#

The best solution for now would just be to check stuff on tick and get it working before worrying about efficiency or performance

odd hamlet
#

yeah tried on tick before and it didn`t work, and now I am trying this way

dark edge
#

Just make sure to think about things from the POV of any player

#

if all pawns are always relevent, then every machine knows where every pawn is

odd hamlet
dark edge
#

if it knows that, it knows what room they are in, assuming they know where the rooms are

bright summit
#

you can't update other players hud and send info from another player it ALWAYS must be: SERVER UPDATE -> CLIENT RPC / MULTICAST -> UPDATE HUD

dark edge
#

no don't

#

this is repnotify territory

bright summit
#

or OnReps as adriel said

dark edge
#

or just replicated variable territory

#

where you are is state, prefer repnotifys for state

odd hamlet
#

ah ok

#

🫡

dark edge
#

do all clients know about all rooms all the time? Or do they only know about the ones they've been in or are near?

odd hamlet
#

and basically I am going through it with a for loop

dark edge
#

why game instance

odd hamlet
#

didn`t know exactly where to store it

#

😦

#

i should save it in GameState?

dark edge
#

what are you storing?

#

show the struct

odd hamlet
#

this is it

#

the room location, the trigger array for the room, and the objects of the doors exactly

dark edge
#

what IS a room?

woven basin
dark edge
#

how would I do something like "Kill everything in that room"

twin juniper
odd hamlet
#

and in order to spawn the enemies i use the triggers

dark edge
#

No i mean what represents a room by ID in your system?

#

Are there Room actors, room indexes, room GUIDS, what

odd hamlet
#

thee room itself is an blueprint

dark edge
#

set it on server when they go in a new room

#

the repnotify can tell the LOCAL minimap to update

#

voila, any time someone goes in a new room the minimaps will update for everyone

odd hamlet
#

I understand, thank you for you knowledge sharing

#

❤️

brazen anvil
#

When I equip a weapon, I have left hand IK that goes where it needs to. This is calculated on the server so it can replicate to proxies. Is this a kind of thing I should just skip the owner and let the owner calculate it so that it is instant? Or should I still wait for the OnRep from the server?

fossil spoke
brazen anvil
torpid whale
#

Hello, a question, I have the Dynamic Sky, I want to change the value to variables from the client through a admin panel, but not working

What is wrong?

dark edge
#

does it make it all the way to setting the weather?

torpid whale
dark edge
#

does chaingint the weather asset usually work?

#

assuming Weather changes on server then it's a problem with the plugin if it's effects aren't replicated out

torpid whale
quick musk
#

Ultra Dynamic Sky/Weather does replicate, and it seems you're pushing it to server and owning clients, but not multicasting so it replicates to all. is OW_SetRain for the clients that are in the game and SV_SetRain is for the server to set it?

#

I'd say try to start by setting SV_SetRain to Multicast and then OW_SetRain to Executes on server

#

@torpid whale

#

cause if you were just having it set specifically on the server controlling it all you would just need to multicast it, but since it seems like you're letting clients set it as well, you need to do both of those.

copper vale
#

Hey! How do you "lock" a session using steam subsystem? Basically, I don't want players to be able to join lobbies that have an active game going on

twin juniper
#

If Component Replicates doesn't replicate the properties of the component from the server to clients, what does it do then?

sinful tree
#

Just because a component is marked to replicate doesn't mean everything about it replicates, just that it can replicate if it has anything that's set up to support replication already.
If you want to replicate the light value, you'd want an OnRep float variable in your actor that you then use to drive the light's value.

smoky sable
#

Any reason why this wont enter "Server Custom Event"? I put a print after the auth switch under remote to make sure that Client 0 is going through but stopping at Server Custom Event :\ reliable is checked for all of the replicated events.

For more context this is a replicated container, when the owning player hits the close button in the widget it calls Close Animation. I was just reading somewhere, do I need to call an event to the PC first instead of directly to this container? So widget -> PC event close container event -> container close event that toggles animation?

neon summit
#

Can anyone give me insight on if getting the GMCv2 is any good?

#

I have a pawn class that I need to replicate movement smoothly (a spaceship floating kinda pawn)

sinful tree
# smoky sable Any reason why this wont enter "Server Custom Event"? I put a print after the au...

Likely because this object "BP Parent Loot Container" isn't owned by that client. You can only send Run On Server RPCs on actors owned by the client, like their PlayerController, PlayerState or Controlled Pawn, or any components of these actors, or any other actors that have their ownership set to one of these.

Normally an interaction "Run On Server" event would be sent on the Pawn or PlayerController passing along a reference to the actor the player wants to interact with, then when running on the server it communicates to the actors as it needs.

woven basin
woven basin
#

but I do find GMC discord to be very helpful

neon summit
#

ive tried using CMC and have better luck just using a pawn tbh.

#

I did get it sorta working with CMC but now when I get in the spaceship the ship just rotates around in place and I cant control it.

#

not sure what happened

#

and it just isnt smooth with cmc

neon summit
thin stratus
#

In 5.4 with c++ you can also try out Mover fwiw

neon summit
#

okay well I fixed the spinning collision issue

#

I just cant make him move though

#

I've been thinking about trying mover but I would have to learn c++ also

thin stratus
#

Well one of your problems is that you are attempting something that most likely needs c++ either way

neon summit
#

It seems there's noway around but having to learn c++

#

yeah

thin stratus
#

Yeah especially movement in multiplayer isn't a really a blueprint thing despite the very basics that CMC already provides

neon summit
#

why can I add movement input to my actual character but adding movement input to the spaceship in a character class doesnt work

thin stratus
#

GMC exposes stuff to BPs iirc, so that could help. But I don't know to what extend

thin stratus
neon summit
#

it is

#

of course

thin stratus
#

If it's possessed (server side) then addMovementInput should work just fine

neon summit
#

it is possessed server side but doesnt work

thin stratus
#

Given it's a character of course

neon summit
#

idk

#

I belive it is atleast

#

its same setup as the other pawn

thin stratus
#

Pawns for one have no movement component by default and the ones you could add all have no multiplayer support. At least not to the degree of the CMC

neon summit
#

yeah but i can move the pawn class version but the character class version i cant move

thin stratus
#

Tricky to suggest anything without knowing more.

neon summit
#

i possess off this interface

#

I may just be missing something that I updated in the regular pawn class

#

since I duplicated it awhile ago and made it a character class

#

and I've changed stuff in the regular pawn since then

thin stratus
#

You can try printing a bunch of stuff, like the current movement mode of the spaceship

#

To see if that is messing around

#

Or the input vector to see if it gets any input at all

neon summit
#

I can try that, its default is flying which I assume thats what I want?

thin stratus
#

Yeah

#

Other than break pointing the CMC in c++ and seeing where it gets stuck I would have no clue atm on what else to suggest

#

Might also be worth checking if possessing the spaceship as the default pawn works

neon summit
#

it seems to only print client values

thin stratus
#

On tick?

neon summit
#

yeah

#

ah autopossess ai is disabled

thin stratus
#

Is that spaceship placed into the level?

neon summit
#

yes

thin stratus
#

Then it should exist on the server just fine

neon summit
#

hm.

thin stratus
#

Gotta walk the dog now. Can check back later

neon summit
#

It seems to print server for a second then goes away

#

on beginplay

neon summit
#

there was a key on the print string messing it up

#

my bad

#

and I couldnt move from setting simulate physics. But id like to simulate physics for my thruster unless I think of a different way to do that

gloomy dune
#

Hi, how can I create an actor component only on the owning client? I want to create a component that will spawn particles locally for the player

modest crater
split siren
#

Has anyone come across some iris examples or documentation? I am reading the source, but with example it would be easier.

lament flax
#

when i try to call a server RPC from pawn on client side its getting droped (No owning connection for actor)
but since the pawn is owned by the player controller, the owning connection should be "owning client" right ?

edit : Im calling an interface event, this event implementation on the pawn calls the server RPC.

when i do : ListenServer on Client1 Pawn the RPC gets called
when i do : Client1 on ListenServer Pawn it gets droped (i guess its because Client1 doesnt own the ListenServer Pawn, in that case idk how i could make this work)

chrome bay
#

Pawns are owned by the player that possesses them yeah

#

But ownership is replicated, so if you call a server RPC too early, it may not go through since both server and client check independently

lament flax
#

for now i made that the interfaces get called on server

#

what i was doing was :

Locally press input & shoot a linetrace
if hit call the interface event
in the interface event call the server RPC to process the shoot for rewinding etc

balmy turret
#

Is it possible to get Dedicated Servers Mapname & Port in Blueprints? Or only in CPP? I'm guessing I need to get the arguments used to start the server?

unique summit
#

store them in the game instance of the server, and have a RPC to get them

twin juniper
#

Can't anim montages be played from a different actor/class?

Specifically I want to play an anim montage for one of my characters, but do it from the GameModeBase Blueprint. This is because instead of making tons of RPCs for different montages on different actors I need to play, I want to have one Multicast RPC in the gamemode, and by calling it, replicate the montage I need from any actor I need.

I correctly pass the skeletal mesh and montage references with the RPC, and the RPC does execute (checked with print string), but the montage doesn't play.

chrome bay
#

GameModes don't exist on clients so you can't call RPC's on it

twin juniper
#

So I call a server RPC

#

on an actor

#

and that calls the multicast on the gamemode

chrome bay
#

Doesn't matter, it's a multicast which won't route to any actor on the client

#

GameMode doesn't exist on clients, so the multicast has nowhere to go

twin juniper
#

But I have Server RPCs inside the Gamemode Blueprint that definitely work without issues. Is it only multicast and owning client that won't work in the gamemode?

lost inlet
#

this is linking the compendium time

chrome bay
#

If you call a Server RPC on a GameMode from a client, it will not work

twin juniper
#

assign owners and such

chrome bay
#

If you try to access the gamemode on a net client, you'll just get null

twin juniper
lost inlet
#

??

#

there's no networking

chrome bay
#

Then it's not an RPC

lost inlet
#

so yeah, they'll work

twin juniper
#

So I call a server RPC
on an actor
and that calls the multicast on the gamemode

#

Same logic

#

I call server RPC on an actor

#

and that calls the server RPC on the gamemode

#

and that works

chrome bay
#

Because you own the actor

lost inlet
#

you know RPCs are meaningless server->server

chrome bay
#

The actor RPC goes to the Server, the gamemode RPC goes nowhere it's just processed locally

lost inlet
#

you're already on the server

twin juniper
#

Jesus Christ

#

does one RPC work

#

and another doesn't

chrome bay
#

Just told you

twin juniper
#

Fuck it let me simplify it for you

chrome bay
#

A multicast on the game mode will not work because the game mode does not exist on a client. It not existing on a client ALSO means you can't call a Server RPC from a network client.

lost inlet
#

define "everything I do"

#

and yeah, the multicast on a game mode will do nothing for the reasons Jambax has already explained

kindred widget
#

I think the more appropriate question is why would a game mode, which has no physical representation and is a server only thing care about a montage?

#

Montage should be on the character, or an ability, or some other thing relating to the character that it's being played on.

chrome bay
#

There is that too yeah

unique summit
#

and I couldnt move from setting simulate physics. But id like to simulate physics for my thruster unless I think of a different way to do that

careful, by default physics is not replicated

#

you can replicate it in project settings, but if you want an absolute lack of jankiness, da best would be to use a deterministic physic engine such as bullet

#

This would be less of an issue as long as no collision / bounce are involved

lament flax
#

@summer rivet from what i experienced so far, if you dont mark a component as replicating, like an actor not set to replicate, the component will only exist locally where it got created (so on server if the component is attached in class), so no replicating vars or RPC possible

summer rivet
#

ok so these should be easy questions.. I hope lol. simple networking action. Actor with a Render Component on it using a sprite. Single player I spawn the actor, set the sprite on the render component, and profit. Multiplayer, I do the same and it only spawns on the local machine (which makes sense). I create an RPC for a server call and do the code, the blueprint is created on the client and server as expected. the code I run to set the mobility on the component is changed on client and server. the code to set the Sprite on the component does not seem to take hold on the client. Actor and Component are both set to replicate, and I can verify its working as without component replicates on the render component the mobility change doesnt take hold.

#

so should I assume the render component - Sprite property doesnt replicate and if so, how would I change it correctly on the client

quasi tide
#

Have to have an OnRep on the class itself

#

Same issue happens with skele meshes

lament flax
#

you would spawn the actor on server (and mark the actor as replicate so all clients gets the actor in the world)
you would make the sprite to OnRep

#

and set it on server

summer rivet
#

make the sprite to on rep?

quasi tide
#

Yeah

lament flax
#

ReplicatedUsing

#

are you in c++ or BP ?

summer rivet
#

all bp

lament flax
#

then its easier

summer rivet
#

thats the issue here

quasi tide
#

So class has sprite variable, and that is an onrep. In the onrep just get the sprite comp and set the sprite

lament flax
#

the OnRep function will get called on server and clients

summer rivet
#

Create a sprite variable, i dont use one that exists yes?

quasi tide
#

Correct

summer rivet
#

so a setter basically then call code that sets it in the setter

#

blah

quasi tide
#

Yeah. It's wack imo.

summer rivet
#

thats what I was assuming, but it feels weird

quasi tide
#

The components should onrep the sprite/meshes imo

#

But Epic do what Epic do 🤷

lament flax
#

(make a custom class )

summer rivet
#

but if its not an auto replicated property I guess you have no choice, and without checking source you cant really know what is set to replicate can you?

quasi tide
#

Not really, no.

summer rivet
#

yep I assumed that as well...

#

which led to 30 minutes of wtf debugging

#

so in theory then without a custom class, you cant just programatically spawn in a paper sprite actor and set its sprite over networking huh?

quasi tide
#

Inside of the onrep, the variable will have already been updated on the client, as an FYI

lament flax
#

Server :
MyVar = SomeAsset

Called on Server & Clients
OnRep_MyVar
Component->Sprite = MyVar

summer rivet
#

yep yep

#

I guess making a custom class in C++ and handling it that way would fix this as well, blah

lament flax
#

on rep is good also to handle latent joins

summer rivet
#

yeah this is all simple mathmaking and 1:1 stuff, no late joins so the code is "simple"

#

trying to just test random things at this point to figure out what I should replicate and what I should cheat

#

didnt expect checking a box to not actually work 😛

#

it would be nice if there was a tag in the tooltip that had this info in it

quasi tide
#

Well, to be fair, it works just like actor replication. Just more things are actually replicated for you under the hood with actor replication.

summer rivet
#

yep it works fine now. so, lets say then I only need 2 properties to be replicated on a component. Would it be smarter to just not do the component replicates and do onrep way?

quasi tide
#

Yeah, pretty much.

summer rivet
#

or is replicates component smart enough to be efficient?

quasi tide
#

It depends on the property honestly.

summer rivet
#

Mobility and Sprite in this case, only set once

lament flax
#

to rep properties in a component it needs to be replciating

quasi tide
#

OnRep them

summer rivet
#

since for whatever the f*ck reason you have to set mobility on a render component to change the sprite...

quasi tide
#

Just have two vars in the class itself, CurrentSprite and SpriteMobilityMode and then make them onrep and update the component when they get replicated. Then you don't need the component replicates checked at all

#

Networking is fun 🙃

summer rivet
#

hmm

#

ugh

#

but the render component not replicating means it doesnt move when the actor moves lol

#

thats weird but expected I guess

quasi tide
#

That's...odd. It should still follow its parent component.

#

w/e UE

summer rivet
#

its the parent technically I think is the issue

#

its a paper sprite actor, trying it another way for fun

#

yep, reparented it to actor and put a scene component that replicates as the root

#

works as expected both ways I guess, without the replicates the transform doesnt replicate if its the root as the paper sprite component

quasi tide
#

Yeah, that part makes sense.

summer rivet
#

im thinking that would be the cheapest? just replicating a scene component and everything else is on rep

quasi tide
#

Generally speaking - stateful things should be in OnReps

#

It isn't only for late joiners either. It also affects net relevancy.

#

Generally, you'll find yourself having a number of OnReps for common visual things

#

Equipping a weapon? That's an OnRep

#

Changing a material? That's an OnRep

summer rivet
#

yeah im trying not to premature optimized but I figure with networking its smarter to start when I can

#

I have a feeling Im not going to be able to get away with pure bp just due to some of the timing issues I am seeing

quasi tide
#

It's generally advised to use C++ with networking stuff honestly. I think more of networking is locked behind C++ than some other parts of the engine personally.

summer rivet
#

twoish more questions I think. right now im setting two onrep variables in a row, with the second needing the first to be done before the second works but randomly they dont finish in order (which makes sense). chances are I will just pass them both or something else to make sure both are valid before using but is there a better way to maybe handle making sure stuff is sent and received before moving on?

#

trying to just see whats built in before I hack together stuff because why reinvent

kindred widget
#

Bundling it into a Struct for a single replication. Or making each OnRep call a checking function before proceeding.

summer rivet
#

yep yep

#

ok so im not far off on my thoughts 🙂

#

and the other weird one which seems to have stopped, I was setting view target on begin play in a bp that is in the level at the start. it works fine on the listen server, but the client doesnt change cameras it just stays in the normal pawn view. if I delay a few frames, works fine. So is there a function I can hook into thats in BP thats called when its completely setup or am I missing something weird? I know how to work around this, use a proper pawn, but... initialization I have a feeling is going to be an issue down the road in networking

#

its random too lol

#

if i set it to dedicated server mode, randomly 1 of the clients will get the correct camera change lol

kindred widget
#

Beginplay issues. Technically the only thing really required for beginplay is that the game is ready and the GameState has replicated. Which means you can end up with a Beginplay of the level before the Controller or it's sub actors like the camera manager are ready.

quasi tide
#

There is an event in the pawn you can use, like, PawnChanged or something like that

#

Pretty much, you want to set the view target when the pawn is newly possessed

summer rivet
#

not using a pawn 😛

#

I know thats causing the issue

quasi tide
#

Welp

summer rivet
#

but.. why and yeah having begin play fire before stuff is actually loaded makes stupid sense

kindred widget
#

I do most of that with widgets. Widget sets the player using it's controller's view target when menu changes.

#

Widgets aren't created til AHUD's Beginplay, so client is all set up and ready by then.

summer rivet
#

yep alot of this is just due to poor coding in this sandbox project, but its making all the edge cases come to light

quasi tide
#

So you're trying to have the camera target the sprite actor?

summer rivet
#

nope theres a game manager that has the camera right now, its in the world when it comes up

#

i know the correct way is just to have a proper player pawn thats in the correct location and camera

#

but this is more finding out that begin play doesnt mean squat in networking lol

quasi tide
#

So, GameManager has the camera and it is trying to set the blend view to the player when the player finally spawns?

summer rivet
#

maybe? Its just got the set view target node on the being play in the game manager. Im guessing the player pawn is just not in the level when this code runs lol

#

because no easy way to force spawn order lol

#

yay for race conditions

quasi tide
#

Is the GameManger just a regular ol' actor?

summer rivet
#

yeppers

#

I do miss being able to force loading order like we can in unity

quasi tide
#

You can use the GameState to register the camera and player as being ready on the client. If they're both ready, set the view target.

#

GameState is what calls begin play on everything, so it'll be present

summer rivet
#

ok last probably stupid question but its only stupid if I dont ask it. Assume 2 player tetris, syncing piece movement over multiplayer. would it just be fine to sync the actor with replication or is there a smarter way?

quasi tide
#

Replication

summer rivet
#

I had the stupid idea to just sync input, but havent tried it yet because it seemed stupid but I wanted to try it anyways lol

quasi tide
#

That, you should be able to just check that replicates box on the actor and the transforms should be sync'd more or less.

#

I wouldn't sweat it personally.

summer rivet
#

yep movememnt is synced right now between the 2 clients and seems to work fine

quasi tide
#

I can't imagine you'll get into the hundreds of sprites range. Unless you're doing like, Tetris Royale I guess.

summer rivet
#

nah at the most movement for a few sprites, and the rest would be fixed positions once resting

#

lets say one of the players "scores a line", assuming the same code is running on both machines and movement is replicated, it should visually show the same thing on both machines no?

quasi tide
#

Yup

summer rivet
#

im sure I am overthinking it but also trying to figure out the easiest way to keep things in sync and prevent the basic cheating. probably just going to ignore the latter as much as I can

quasi tide
#

The easiest way to prevent the basic cheating is to only do the scoring on the server

summer rivet
#

listen server setup soo...

quasi tide
#

gg

summer rivet
#

yeah, it is what it is

quasi tide
#

The other simple way is to verify that a move was even allowed.

summer rivet
#

I guess the goal is to then make the items that are replicated as light weight as possible and handle as much as I can on each client with just the replicated stuff being the driving force of the result

quasi tide
#

Like, was it really possible for that L block to go from one side of the map to the other?

#

But that is more involved.

summer rivet
#

I do check for valid moves right now when moving, so setting up a threshold for checks every so often shouldnt be a big deal is my thought

#

okdoke. despite wanting this to be in BP as much as possible, im thinking breaking out the core stuff into C++ is smarter in the end. I already have to use C++ for Steam DLC because Epic

unique summit
#

you mostly care about obvious cheaters

#

those, ruin games

summer rivet
#

yep yep. Its a 1:1 game so that will make it a little easier, and I know I cant stop dedicated cheaters.

#

considering movement can only be in 1 space increments I think doing sanity checks on if a move was valid wont be much lift

#

I guess making the server also the one that gives out future pieces is required as well lol

unique summit
#

yeah, mostly dont expose too much data to the client

summer rivet
#

yep yep, already trying to split up data and visuals as much as I can to make that easier so no worries there

unique summit
#

dont make the client be able to call without check function that create stuff

#

some script kiddie could find a way to call these by himself

summer rivet
#

yep yep, nothing should be client side except for input and visuals as far as I am planning

unique summit
#

yeah

#

the hard stuff is player movement

#

cant do it server side only, or it will be slugish as hell in fast enough games

#

thank god, the CMC handle that part

#

well, other hard stuff is what requires 'dexterity' from the player

#

can be hard to tell if the mouse move comes from a hand, or from a cheat

#

even in lan people find way to cheat these

#

Like, aimbot in mouse firmware and stuff like that

rustic sable
#

when we have this typical branch as seen in video examples:

if HasAuthority run someFunction else run ServerSomefunction

can we just always call the server version even if server or does this cause some issues in the backend?
Like there's cases where I know I want things to just always be server so the branch seems kind of pointless

kindred widget
unborn glen
#

Hello, quick question. Is there ny best practice guidelines regarding line trace weapons in multiplayer, such as trace origin, etc.? Should I use actor eyes, or replicate the camera and use that?

kindred widget
#

So. How you choose to pick the trace start is up to you. Center of viewport is common to find intended target in first or third person views. Other stuff kinda fakes it so it looks mostly accurate. But either way if you don't allow a client to do this on their own then it feels bad. No one likes input lag.

unborn glen
#

Hmm, okay. When you say, 'some checks', what sort of checks does that imply? Could I simply do the same trace on the server to validate?

kindred widget
#

Really depends. Like I know Jambax did some stuff with rewinding. I don't know how involved it was but as far as I understood it you save old placements for a second or two and on hit, use the timestamp to get the placement and see if the hit is relatively close. Basically avoid obvious shooting through walls and such.

frail barn
#

i have a strange issue with a clients behavior
when i run a game for a one client, these events works perfectly
but, if i run a game for a multiple clients, these events works correctly for the last client only
any ideas, where to seek a problem?

odd hamlet
#

can i trust the AHUD to spawn on begin play for all players exactly what it needs or is it a bad habbit?

odd hamlet
#

and that you are a genius

cyan peak
#

What would be the best approach to replicating control pitch information for first person? Replicate the camera and just do a server RPC setting the camera pitch for non locals (This is my solution because I have the arms attached to the camera)? Forget about replicating the camera and just replicate the pitch of the arms (I would have to detach the arms from the camera)? Is it overkill to replicate the camera component?

dark edge
#

there is already a replicated pitch

#

its really dumb that it's only the pitch but it is there

cyan peak
dark edge
#

THAT's what needs to be replicated

#

but don't reinvent the wheel, there's already a function to get some replicated pitch value

sinful tree
idle coyote
#

So I'm having a problem where no matter what I do, I can't seem to get the player state from one client to another. Really, what I want to determine is what the team of the other client is(just a struct var that is indeed set to replicate). From all of my reading, player states should always be replicated and available. Here are a couple of the methods I've tried, but to no avail. Any ideas? https://blueprintue.com/blueprint/cth4ux9o/

graceful falcon
#

@idle coyote , So you would like to get get the player state from a client to only one specific client?

idle coyote
#

Yeah, basically I have a "King" spectator pawn that I want to be able to get the team of the player they're clicking on. Currently trying a method where I get the game state as we speak. Sort of working on a RTS/FPS weird fusion Idea I had

dark edge
#

the team should just be a replicated variable

idle coyote
#

It is, but just querying it from a break hit after a line trace returns None.

#

In fact, I can get the team of the "King" pawn but none of the other clients.

#

So I have to ask the server

#

Maybe I'm losing it in the cast?

dark edge
#

show your code without any rpc nonsense

graceful falcon
idle coyote
#

Just tried it 😦

dark edge
#

It should be as simple as setting a replicated variable called team on playerstates

#

then when whoevers driving the King pawn around clicks a player, whatever that means, presumably clicking their pawn, you can get from the pawn to the playerstate to the team

idle coyote
#

Actually, you just helped me realize something. The code for setting the team is all local and doesn't involve any RPC or anything like that. So I think that change isn't getting replicated to the other client.

idle coyote
dark edge
#

The general form is this:
Client wants to tell server something -> run on server event
Server wants to tell clients some STATE -> replicated variable
Server wants to tell clients some transient event -> multicast or run on client rpc

dark edge
idle coyote
idle coyote
#

Just implemented it and it worked. This is my first multiplayer project and the lesson that the server is god is starting to engrave itself in my brain.

summer rivet
#

god when it should be and needs to be is important as well

idle coyote
#

Basically I just made a simple event on the Player State event graph(run on server) that you call from the UI menu and it sets the team and then replicates it everywhere.

#

Should probably have some additional authority checks somewhere(the game will probably have situations where you shouldn't be able to switch teams regardless of what requests the client is making)

soft dawn
#

I have an actor that I'm spawning via SpawnActorDeferred() on the server, setting a replicated variable, and then running FinishSpawning(). When the actor is initializing on the client, for example, in PostInitializeComponents(), the variable that I set is nullptr. I need this variable to complete initialization. Are there any standard ways I can delay the actor initialization on the client until after everything has been replicated?

frail barn
# sinful tree The problem is likely because you're multicasting, and that multicast could be g...

in the level i have an actor with a SceneCaptureComp2d and camera, to place a list-only components (2d sprites) to minimap
sprites of the static meshes (walls), which is persist in the level, always placed at the minimap correctly for every client, with an Event BeginPlay event at the level blueprint
but, sprites of the characters, and sprites of the pings (help, retreat, etc), is not placed to minimap at Event BeginPlay, its always Custom Event
and these events works (print-string tested), but dont actually add sprites to minimap with a Show-only Components list, for a clients except last, when there is more than one client (2 or 3)
these custom events fired, when a characters is spawned (1 sec delay change nothing), and when ping actor is spawned
so, static actors, which exist at the level from the beginning, is adding sprites at BeginPlay correctly, but characters, which spawned in the level after being chosed in the menu are not (and pings even later)
so, i dont think its because of some clients is not connected correctly yet
there's some replication problem, but i dont see where
actors, which exist at a clients and the server uses multicast event, i dont think its wrong, but i dont know much about this stuff, sorry
i hope i provide some details

sinful tree
#

It also shouldn't be necessary.

#

You have Begin Play of actors that you can use to trigger whether or not they get added to a minimap that is local.

#

There shouldn't really be a need to multicast that.

#

The ping? yea that can be multicast. If you wanted a ping to persist however, then you'd need to have some system in place that utilizes variables, so even someone later on joining could potentially see said pings.

frail barn
# sinful tree Multicasts fire only exactly when they are requested to. If you are triggering a...

Multicasts fire only exactly when they are requested to.
yes. i dont use multicast after begin play
and there is a paradox
sprites of the static meshes added to minimap correctly at begin play of the level (for every client)
but sprites of the characters (and pings) is not added even when client is pick an own character and join a game, where all events is called manually, not at the begin play
but for a one client all is fine

pallid jetty
#

Would anybody know why an animation montage would fire an anim notify twice on the server? It is reproducible with any animation and any animation notify. I trigger the montage using a server ability, and each anim notify triggers twice on the server

novel zinc
#

anyone know why ping in game is significantly higher than my network emulation settings suggest it would be? Here I am simulating 30ms incoming and outgoing latency on the server so I would expect the client would have somewhere near 60ms ping but PlayerState->GetPingInMilliseconds reports around 80ms ping. It scales rather strangely with simulated latency, for instance 5ms incoming and outgoing latency results in about 45 ms ping

idle coyote
barren patrol
#

Does anyone have tips for debugging weird loading issues with World Partition and dedicated servers?

#

I have a project tha works perfectly with a normal level but when I try to play my WorldPartition level I get things like: crashes when connecting a PIE client, not loading at all on packaged client, and even on a vanilla new Open World level, seeing errors and not working.

#

How do I force the packaged client + server to load all chunks all the time? Maybe that could help me.

nova wasp
#

also keep in mind that the network settings are about BOTH sides adding more time

#

so if the server outgoing and the client incoming are 30, that's 60ms for extra the packet to reach them just one way

#

(oh, you have server only on here)

novel zinc
#

i wonder if that would affect any of the client interp timing stuff that uses ping

nova wasp
little needle
#

Hello guys i have client only anim notify which is referenced by animation files which are included in server builds, i dont want to that notify included in server build can you guys help me? What is causing this situation? Thank you

odd hamlet
#

can i trust the AHUD to spawn on begin play for all players exactly what it needs or is it a bad habbit?

dark parcel
#

Hud is local anyway, one will be created in your machine when ever the code runs

odd hamlet
#

i have 2 players, but sometimes for the client it doesn`t spawns a widget perfectly as it should

dark parcel
#

That still sound vague, need more info

vital furnace
#

Hi everyone,

I'm having an issue with my Player Controller in the lobby. I'm trying to execute a "print" function, but nothing is displaying on the screen. I can't figure out why it's not working. Could someone please help me?

Thank you in advance!

dark parcel
vital furnace
dark parcel
vital furnace
woven basin
odd hamlet
#

my frienid

#

your educated guess might be exactly what I need right now

dark parcel
dark parcel
#

OnRep tells a client when a variable is updated.

#

You can create widget right away, just make sure to update the visual with OnRep. Don't use delay, there is no guarantee when the info comes from the server, it all depends on your latency

kindred widget
#

Oh, wait. My bad. Lyra is overengineered. Shouldn't use tools from there.

chrome bay
#

Not sure why that replied to you 😄

kindred widget
#

There are probably better ways. I dunno. But this isn't the worst. 🤷‍♂️

worthy knot
#

rep arrays need to be smaller than a certain number?

worthy knot
#

im just appending the same array from the server side then storing those to a replicated version of the same array variables

kindred widget
worthy knot
rustic sable
#

is there anything additional that needs to be set for SK mesh replication. I check for weapon meshes in both a Static Mesh Component and Skeletal Mesh Component. When it's a static mesh replication works fine but with an SK mesh OnRep seems to fail here EquippedWeapon->SK_MeshComp->GetSkeletalMeshAsset())

chrome bay
#

The mesh isn't a replicated property on skeletal/skinned mesh components

rustic sable
#

of course it wouldn't be 🙄 what would be a way to do this then? With statics you just set replication and doesn't even require a multicast

tardy fossil
#

usually the mesh is already set in the blueprint and the server just spawns it

rustic sable
#

well no because I don't spawn any meshes until I need to TSoftObjectPtr<USkeletalMesh>

#

I mean I guess I can try another replicated mesh slot and set it on spawn...

olive basin
#

Anyone got a clue on why the replay system does not work properly in a fresh Lyra project (5.3+) when running from the client (record gameplay from ShooterGym). When the player changes weapons animations stop working.

odd hamlet
#

How do i do in such way that from the first player minimap from the hud i could show where the second player is, in his widget in the uniform grid panel, in his images plates, around an image to arround an blue border ( likee in this first picture) , for also this also should be from client`s perspective, but with red for the client to see the server location(2nd image), and when they are both In the same location, to have it to be like in the third picture, both red and blue mini squares

half iris
#

Alright, I am slowly losing my mind trying to replicate a player name for a widget that each player has hanging above their heads in the game.

In the player state I save the player name in a variable.

In the player controller I send the variable that was saved in the (valid) player state to the pawn, so that the pawn can RPC to the server, with the player name value, save it to a replicated var in the pawn, and then set it to the widget component.

Issue is; The server player can see the clients player name. The client player cannot see the servers player name. What am I missing here?

olive basin
half iris
half iris
ancient adder
olive basin
half iris
#

🫠

#

Let me wrap my head around this for a minute

#

Okay, so if I understand this correctly now;

Because the player state is replicated on its own, any variables within are also replicated to all versions of itself on the other clients. And because that is the case, the pawn, can grab the player name from the player state, without ever running the risk of grabbing different player names, because it is the same throughout all versions of the player states.

Right @ancient adder @olive basin ?

ancient adder
olive basin
# half iris Okay, so if I understand this correctly now; Because the player state is replic...

Not quite, unless I am misunderstanding what you are asking.

The player state exists on the server, and all the clients. What this means Client 1 will know about Client's 2 player state and vice versa, unlike for say a player controller, where the server knows about every Client's player controller, but each client will only know about their own player controller.

In regards, to why you don't risk grabbing different player names, the player state to pawn owner hierarchy goes something like this.
PlayerState -> PlayerController -> Pawn.

Because of this, each pawn is associated with a specific PlayerState instance, and when you access the PlayerState from a pawn, you're always getting the PlayerState that owns that pawn, regardless of which pawn you're accessing it from. So by getting the player name from the player state at begin play, you are getting the player name that belongs to that specific pawn.

ancient adder
half iris
#

Ah right now it is clear for me! Thanks so much @olive basin @ancient adder , this makes a lot of sense now 🙂

worthy knot
#

anyone got an idea how to overcome this? when i OnRep my vehicles vert count array, it gives me this message in the log whenever another player joins the session

#

is there a decent way to replicate large arrays?

#

this is all im doing inside the component hit event

chrome bay
#

Almost certainly way too much data

worthy knot
worthy knot
chrome bay
#

I wouldn't, I'd probably replicate a small fixed-size array of hits and rebuild the vertices locally instead.

worthy knot
thin stratus
#

I think the point is that you should not replicate the verts to begin with

#

But simply the hit data so the client can do the same logic locally

plucky crane
#

Anyone Know why 'Owner No See' and 'Only Owner See' doesnt work on imported static meshes?
The Sphere and Cube have the same settings as the mushrooms of the same color yet the 'see' settings dont effect it

frigid fox
#

Hi everybody! How can I make this function replicated on network

#

when the player spawn a build everyone must see that

plucky crane
#

Is the event that calls Spawn Build Ghost set to 'Run on Server'

worthy knot
# thin stratus But simply the hit data so the client can do the same logic locally

I can do things locally not a problem - in a dedicated server session with 2 players when I hit the vehicles around they deform for both the clients , but for late joiners they don’t see any changes at all, they see brand new undamaged vehicles. For the late joiners the only way to display changes is to pass the verts info to the on rep, whether you OnRep the array itself, or a simple Boolean, the node “update mesh sections” is the one that confirms changes to the procedural mesh , for server or client. And that node needs an array of vertices to be added to it.

frigid fox
plucky crane
#

I’m not a wizard with any of this shit, but make sure the actor is set to replicate and have whatever event runs that spawn build ghost run on server

frigid fox
#

okay thanks

maiden flame
# worthy knot I can do things locally not a problem - in a dedicated server session with 2 pla...

What they're suggesting I think, is to pass the hit information as a state, and once late joiners arrive, repeat the hits locally for the joining client(s). The vertices won't be exactly the same I assume, but accurate enough.
Otherwise you could probably fragment the vertices data like you suggested, but you'd still be using a lot of bandwidth, so I'm not sure if it is worth it for 100% accuracy.
Sorry if all that was already clear and I am just repeating what they said, but I really don't think sending the vertices directly is the "only way" as you said.

brazen anvil
#

Do OnRep functions execute on the server?

thin stratus
#

In BPs yes, in C++ no

shadow aurora
#

Alright got a really annoying issue that I'm struggling to come up with a "catch-all" solution for... Basically when our movement abilities were setup, they were given different classes (i.e. Dash, Flight, etc) that all try to change player collision to match a specified list of parameters.

The issue here is that these objects rep down to the client through the CMC in an un-reliable order. So the client might change its collision to something that doesn't match the server's collision because it received dash first and then flight.

I have tried a few different things, including using RPCs to change the collision. But the problem with that is that the client in some cases is receiving the RPC and the OnRep for an object in the same frame and in that order. So the RPC has a nullptr. I tried delaying by a frame and then calling the RPC as a hail mary, but that honestly just ended up causing more problems lol.

Anyone have any suggestions I could try to explore? Feel like I'm banging my head against a wall that probably isn't going to give lol.

brazen anvil
#

When I press the 4 key, it calls a server RPC that sets a bool to true. After that I step through each character instance and it is only true on 3 of the 6. This is a dedicated server with 2 clients.

  1. Why is there 6 instances of the character? I have the 2 local controlled and then I have the proxy version of each. Then I assume the last 2 are on the server?

  2. After running the server RPC to update the bool, why isn't it updated on every instance of the character?

thin stratus
#

2 Clients, 1 Server
Each Client will produce 3 Characters in that setup.
1 Authority (on Server), 1 Autonomous (on the Client itself), 1 Simulated (on the other Client)

#

How much time goes by before you test for the boolean value after the RPC? @brazen anvil

brazen anvil
#

seconds

thin stratus
#

Where is the RPC and the boolean, on which Actor?

#

I assume on the Character, so the 3 out of 6 makes total sense

brazen anvil
#

Yes it is on character

thin stratus
#

Client 1 pressed the Key, the RPC goes to the Server, sets the boolean and it replicates to everyone.
Which means it will be true on the Authority Version, the Autonomous Version and the Simulation Version.

#

But the other Character of Client 2 obviously won't have the boolean changed.

#

So the othe 3 instances are still false

brazen anvil
#

Got it. Thank you

kindred widget
half iris
mystic estuary
#

Hello, how do you change the active net driver UE is using for networking?

kindred widget
#

Ini files mainly.

kindred widget
# mystic estuary Hello, how do you change the active net driver UE is using for networking?

EG

!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="BeaconNetDriver",DriverClassName="/Script/SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")```
#

This should let you pick per platform. EG this ini would be used with a game shipped with Steam. You'd have a different build with a different ini running on EOS, or whatever other platform.

mystic estuary
kindred widget
#

There is a specific Platforms folder you use for any plugin/config overrides that are for platforms other than your core one.

mystic estuary
kindred widget
#

I'm not sure how much I'm allowed to say here. I don't think folder structures for the engine break the rules on that since it's generic for any platform. But basically
ProjectDir\Platforms\PS5\Config\PS5Engine.ini

odd pivot
# worthy knot I can do things locally not a problem - in a dedicated server session with 2 pla...

Watch this video, https://www.youtube.com/watch?v=ssRRyztsNqM, I remember Dan talking about what you are describing

Dan walks through the core concepts of Networking / Multiplayer in the Unreal Engine editor for anyone who's interested! No coding experience required, video done live on my Twitch stream :D

Includes: Relevancy, Replicated Properties, Rep Notify's, RPCs, Client Prediction and more!

The first part covering the "theory" can be found https://yout...

▶ Play video
weary dune
#

Hello all, would one say that UEngine::OnNetworkFailure is enough to handle scenarios where a host force closes their game or crashes while clients are still in a session?

#

or is there more/better handling that can be done here

mystic estuary
#

UEngine::OnNetworkFailure is kind of deep relatively to BPs, so I guess that's the reason people usually use GI

weary dune
#

danke 👍

twin juniper
#

What should actually be used and put in the player controller?

formal solar
#

I am doing a hacky 3d pathfinding system by attaching flying pawns to 2d pawns that path on the ground. I just update the vertical velocity component of the flying pawns as appropriate and they follow the 2D path of the ground pawns. I am using 'attach actor to actor' (on server of course). I have however run into a problem, where the colliders of the flying pawns are swept twice: once because they are considered part of the 2D pawns and again in their internal logic. Since collision is the largest cost in my game so far, I'm wondering if anyone has any suggested workarounds for this?

quaint tendon
#

What's a standard way to save player unlocks for a Steam game? i.e. players have unlocked levels/abilities in a multiplayer game. Where should that be stored?

plush gust
#

Is there a way for an actor on the client to know when one of its subobjects successfully replicated for the first time?

cosmic yoke
#

Hello, how can i prevent the character of a low fps client from skipping animation frames on the listen server?

twin juniper
#

How does subsystems work in a multiplayer context?

mystic estuary
devout sonnet
#

What are some good exercises to practice RPC's? I can't seem to implement them. The subject is still foggy.

fossil spoke
#

You should learn RPCs and Replicated properties (including OnRep) to achieve this appropriately.

twin juniper
#

me about to do the door system

vapid fog
#

So for example, I have two clients and a server player close to each other. They are each standing on their own small landscape. I want to pevent them from seeing each other.

For actors I can set net relevency which will prevent items from spawning on the clients. For the server I'll need another option here.

For the landscapes... I'm not sure they have net relevancy? I could have them stream with World Partition and set the runtime grid to be very small? The server will load them anyway because the players are streaming sources. I'm not sure if that will cause them to load on the clients as well?

Anyone have any information on how to do this? Culling objects, custom camera far clip distances, etc?

twin juniper
#

How would a door networking system would be implemented btw? Just the architecture main idea..

amber vale
#

The best way would be to have a door actor with a replicated variable bIsOpen. In the OnRep for bIsOpen, play an animation for opening the door.

twin juniper
#

the trick part is the in between

latent heart
#

Personally I'd try to record the required open angle and lerp from the current angle to that one.

twin juniper
#

when the door is moving, I would like to be still able to revert it

amber vale
#

Then when the animation starts, set a bIsOpening flag to true, and set it to false when the door finishes opening. When you want to open the door, check if bIsOpening is true, and don't do anything if it is.

#

If you want to close the door while it's opening then do the same thing, but instead of doing nothing if bIsOpening is true, start reversing the animation.

twin juniper
latent heart
#

When you "use" the door flip between the 2 required angles, probalby like 0 and 90 or 135 or something.

twin juniper
#

using the relative rotation too

amber vale
#

Yeah, you can do that in an animation, which will also give you a lot more control of the visual effects of opening the door (sound, particles, etc.)

neon summit
#

Use a timeline that you play or reverse

latent heart
#

But it also limits you by locking into an animation and not being able to use custom door angles, which is common in a lot of games.

amber vale
#

Like if the player can walk into the door and push it open?

twin juniper
latent heart
#

Having control of exactly where the door rotates to. Controlling it directly, rather than "open" and "shut".

amber vale
#

I'm not sure why you'd need that kind of control during runtime. If you want a more responsive door, you'd be better off just using physics to push it around. But most doors I've seen in games just switch between being opened and closed

latent heart
#

Like I say, that's very limiting!

amber vale
#

I'd argue it's a lot more limiting to have to hard-code the possible states of a door, and then manually interpolate between them

latent heart
#

Isn't that what you're doing with an animation?

amber vale
#

Sure, but you're hard-coding the only two states that a door should ever really have, and you're doing it in a way that let's you control everything about the door, as well as trigger any external gameplay effects during runtime with anim notifies

latent heart
#

Absolutely, animations are great.

#

Depends what you want out of a door.

#

Seems it's not an "open and shut" case.

#

😂

twin juniper
woven basin
muted blaze
#

general movement component!! where is it? I couldn't find it in Epic market

neon summit
muted blaze
#

my god it is so expansive !

#

I have multiplayer open world car game, and the client car movement is lagging, do i need GMC ?

#

damn it is so expensive I'm getting more questions to my mind than when i started the game.

#

why in Epic market I see already made cars with multiplayer ready for use? i mean how it is ready without GMC?

modest crater
#

You don't need to pay for it, could always make your own? Networking vehicle movement (even simple) isnt easy and alot of work goes into how you interpolate the data between updates, watchdogs had a nice video on https://www.youtube.com/watch?v=_8A2gzRrWLk.

It can be alot of work to have nice networked vehicles

dark edge
zenith fulcrum
#

Question,

When using an interaction system and interacting with another player, how can I retrieve that other player's controller? Trying to setup a system where I could send request from one player to another.

modest crater
#

You wouldn't, at least not from your client like that because controllers only exist on server and owning client

zenith fulcrum
modest crater
#

Of course you can use a server rpc to run the function but I was just saying, you wouldn't locally

zenith fulcrum
#

Oh ok. Yes, I was tracking that part. I just do not know how to structure the RPC.

modest crater
#

I think it depends alot on the platform you plan to ship on with how the friends list API will work, I know OSS has some kind of global interface for common things related to online play but I havent deep dived into that yet

sinful tree
#

If you are choosing a player to interact with, VIA a line trace or overlap or through some kind of UI, then you're probably getting a reference to their pawn or playerstate. You'd RPC that reference to the server. From there, the server can do whatever you want with the pawn or playerstate reference, including getting the controller.

dark parcel
fossil veldt
vital furnace
#

Can someone explain to me why I don't have anything displayed on the screen on the server side or on the client side?

lost inlet
#

What is the context here? What is the end goal? Is this BP class even being used as your player controller class?

winter pollen
#

Can someone help me a replication issue? I have my weapon switch on run server and my holster weapon on both run on server and multicast

lost inlet
# vital furnace yes

did you check your game mode blueprint? and what about the two open-ended questions I asked

ancient adder
twin juniper
fossil veldt
#

well depends on the game tbf

twin juniper
#

I think there will be 2 replicate var, the angle and the number of player in front of it...

fossil veldt
#

but usually doors have much more to them than "lol animate le angle"

#

like loading and more

twin juniper
#

replicating the actor too

fossil veldt
# twin juniper much more????

yea, typically has a decent amount of complexity / additional work related to level streaming, and doors usually can't be latent other than an animation

#

because it's pretty much a portal

#

so you have the time between pressing F on a door and being able to see on the other side to load your level, plus multiplayer complexity if you have MP

#

so usually you need to do some clever preloading before you get close enough to the door for example, so that when the player presses F it's already ready to become visible

#

Doors is hard

twin juniper
#

everything should always be visible

fossil veldt
#

doors are typically used as soft loading screens

twin juniper
fossil veldt
thin stratus
#

I mean, even without loading anything, doors are annoying. Cause when Player 1 opens the Door, depending on how you wish to animate it (with the Character grabbing the handle etc.), Player 2 might also start doing the same from the other side and then things break and one of the players is "wrong".

twin juniper
# fossil veldt yes

ex: in fornite, the door for each house, doesn't load something the other side

thin stratus
#

Games like GTA5 for example mostly do these "swing open when I run into you" stuff and they are more visual fluff than actual doors

fossil veldt
#

“wtf my shot missed because the door was in the way for me but not for him”

twin juniper
thin stratus
#

Absolutely not "done"

fossil veldt
twin juniper
#

why?

thin stratus
#

Because of Ping

fossil veldt
#

needs prediction

thin stratus
#

If you make the State of the Door predicted, then only one of the two clients can have a valid door state.

#

cause one of them opens it, it sends it to the server and it replicates back to the other client.

#

That other client might be thinking the door is still closed

#

If you make it server auth, then the both players might have a bad day depending on the situation

#

This isn't as easy as you might think :P

fossil veldt
#

yeap

twin juniper
#

I don't see why prediction would really matter here, since it can be maximum delayed by 100ms

fossil veldt
#

as i said originally - dark souls xd

thin stratus
#

It's not only a door issue. Any kind of interaction between 2 players is like this.

fossil veldt
#

doors are deceptive and actually insanely hard

#

yea

thin stratus
#

If the door would only count for one player, then it wouldn't be that difficult

twin juniper
#

I'll probably do a GTA 5 door type then lol

thin stratus
#

Just imagine 2 players standing on each side of a sliding door.
The door is closed, both players look at each others head.

Now if we predict the opening for one of them, then what would happen is:
Client 1 causes the door to open. They will instantly see the door opening.
The Server will after receiving the call to open it start sliding the door open.
And then Client 2 will get the replicated data.

So Client 1 will see a free headshot first. If Client 1 now shoots, who do you favor?
Client 1 cause they should hit what they see as truth?
Client 2, cause this would be unfair to get a shot through a door that is still closed on their end?
Maybe the Server? Causes somewhat of a middle ground.

#

Maybe don't predict the door opening and let the Server decide?
Then both Clients would see the Door closed while the Server is starting to open it already.
Now if one of them shoots, you can either trust the Server, which means the other client will get a headshot through the door.
Or you check what the state of the door was when the client shot, resulting in it being a shot into the door (that sounds pretty good, right?).

But this scenario only works if both clients have the same ping.

#

What if the first Client has faster internet and receive the door opening stuff first? etc. etc.

#

And you can apply that to tons of stuff

#

Multiplayer is a shitshow

twin juniper
#

that's mostly for door stuff, and guns

thin stratus
#

It's one example of Player to Player interaction.

#
  • Two Players trying to pick up the same Item
  • Two Players trying to enter the same vehicle
  • Two Players bumbing into each other (e.g. see "Bang on Balls" game)
  • Two Players generally dealing damage to each other
  • One Player dragging the other
#

Can probably come up with a lot more

rugged sandal
#

Howdy folks.
Does anyone know, if net update rate of an actor affects how often the client-to-server RPCs for it are actually sent?
I'm fighting with an issue, where the actor has somewhat low network update rate (2 times per second), and sometimes, an important client-to-server RPC for it gets skipped, because client had lost the ownership over it already

ancient adder
#

I assume reliable RPCs are independent of net update rate

#

Try force updating net?

rugged sandal
#

Well the RPC in question is marked as reliable, but it still happens

#

Yeah that was my second idea, just wanted to make sure that I'm digging in a right direction

ancient adder
#

I'm not saying its the right thing to do honestly, I'd just use that for a quick fix if it works 😅

rugged sandal
#

ah, no, ForceNetUpdate() does check if the local role is authority, which means server, and my problem is on the client

ancient adder
#

Isn't the client the owner at the time you call the RPC?

#

Ah I see the problem now, ForceNetUpdate() is for the server to call not client, How did I miss that

rugged sandal
# ancient adder Isn't the client the owner at the time you call the RPC?

well, it is, but then it's not 🙂
it's a bit convoluted.
so basically, my issue happens when player fires a weapon with delayed projectile spawn, and if player leaves the weapon at very specific moment (which happens to be AFTER the RPC call), they do not own the weapon anymore, and the RPC to the server, that tells it to spawn the projectile, fails, because there is no net owner anymore

#

and that causes a desync in weapon state between client & server

#

it looks like the RPC call gets queued, and by the time it gets actually processed, client doesn't own the actor anymore and therefore the RPC gets dropped. It is really an edge case bug, but it is game-breaking.

#

that's why my first question was about the net update rate & it's interaction with RPCs

chrome bay
#

RPC's are independent of net update rate with the exception of unreliable multicasts, but there's no guarantee they are called before or after property updates are read in. If the net owner is read in before the RPC is executed, then the RPC will be "ignored" client side. If the Owner is set before the RPC is despatched server-side, it won't be sent.

#

ForceNetUpdate() simply resets the last frame time the actor was replicated but it won't actually send anything there and then, all updates will send during BroadcastTickFlush

rugged sandal
#

So, effectively, my only option here then is to make sure that weapon retains the client's ownership over it for some time even after the client has exited it. Sounds about right?

chrome bay
#

At least until the following frame for sure

rugged sandal
#

gotcha, thanks for the help

chrome bay
#

Just a note about how this works in IRIS for reference:

RPCs in Iris mostly work as they did before, with one key difference: these calls are now always deferred until the connection(s) targeted by the RPC are updated. This means that RPCs are by default always executed after the connection has applied any received replicated state data, whereas before, this order was not consistent and differed between reliable and unreliable RPCs.

#

So actually, my thinking is that if the RPC call is reliable, and you change owner after the RPC is made, you should really be alright

latent heart
#

But then you might be making rpc calls before data changes and then they are invalid calls after the data has changed?

chrome bay
#

maybe but I guess the RPC has to deal with that, IDK. At least there would be consistency

latent heart
#

It's a small difference, I suppose.

#

If the rpc is asynchronous like that, I would like a chance to confirm it's still valid before it's sent.

#

Or, if that's how it's going to work, then all onreps should be triggered after every piece of data is applied.

chrome bay
#

What the real difference is compared to how it works now I'm not really sure

latent heart
#

Apply incoming data -> run onreps -> async rpcs are sent. Or some such.

chrome bay
#

I think this is only talking about applying received RPCs, not sending them

#

So as a client receiving an RPC, you don't know if it'll be called before or after property updates

latent heart
#

Oh!

#

That makes much more sense!

chrome bay
#

Whereas now they will always be after property updates

#

Well, in Iris anyway

#

Not sure I'd feel entirely comfortable relying on that for anything anyway

latent heart
#

Hah

rugged sandal
rugged sandal
#

so that client will have some time window to send any pending RPCs

#

like, set the Owner back to the previous value in OnUnpossessed() or smth like that

#

and set a timer to nullify it

lost inlet
#

Is there a decent write-up on Iris or is it just a lot of going in blind?

graceful flame
chrome bay
#

I think total blindness tbh. I only bring this up BTW because I remember it being mentioned in the knowledge article they posted about it

latent heart
#

I'd really love to see just a complete howto, start to finish.

lament cloak
#

Hey does anyone know if the bounding box on StaticMeshComponent is available on dedicated servers?

I am assuming yes, but just figured I'd check since I know meshes themselves wont be loaded/packaged.

#

by bounding box i mean: StaticMeshComponent->Bounds.GetBox();

latent heart
#

It is

kindred widget
latent heart
#

@fossil veldt could probalby do it!

fossil veldt