#multiplayer

1 messages ยท Page 156 of 1

sturdy sand
#

it might be a wrong place to ask but since the character movement component is connected with multiplayer I asked here

dark parcel
#

Go over delgoodie cmc tutorial. It covers sprinting and jumping in multiplayer

#

Seen u attempt to do the sprinting outside the cmc, that ain't gonna work for multiplayer

sturdy sand
#

atleast not in the playlist so I'm gonna check out his channel

dark parcel
#

Jumping already implemented anyway

#

Press jump -> get cmc -> jump

sturdy sand
#

ok

shut vigil
#

Hi so Im new to making multiplayer and I found tutorials that told me to make this as a basic multiplayer in the beggining of my game yet after packaging my game and a friend downloading it and trying to join it does not work

olive mason
#

hi, im having a bit of trouble with ue5.2 im trying to create a local multiplayer join screen but whatever i do it doesn't seem to respawn to the second controller and some times it just duplicates the first player giving it control over the new player that just spawned

native tapir
#

I'm planning to make multiplayer game for android. I want to authenticate with gpg(GooglePlayGames) or any other easy to login.
My Game will be dedicated server. (Or Listen server. It doesn't really matter...)
I've searched some options but I really can't choose..

  1. PlayFab / Playfab is looks good to implement dedicated server but I think there's no support gpg (GooglePlayGames) to authenticate and use their system (Like purchase system)
    2.EpicOnlineServices / There's no support dedicated server but there's some support for google authenticate with redpoint eos
  2. gamelift (I don't really know what is this)

Does anyone recommend me for choose multiplayer backend services?

thin stratus
thin stratus
lucid badger
#

Thinkge So the only way to play a sound from server on all clients is to set up a multicast for playing sounds? Hmmge

#

Been using Play at Location/Attached but those don't work in mp dohimissed

#

I could just set up a multicast that calls it on every client at once... but is that really the best way?

twin juniper
#

Hey, is there a way to Spawn a replicated Actor on the server but tell it to skip owner? I need this for predict spawning weapon and equip to player's hand.

#

A Reddit post said Replication Graph can be used for this purpose, im checking it out

#

Look quite overkill for just equipping a weapon

chrome bay
#

You don't need replication graph for that. Just override IsNetRelevantFor

#

Extremely wierd to have an actor which is NOT relevant to it's own though :/

#

Prediction usually means the client is modifying an authoritive actor which it will get corrections for later

twin juniper
#

So there is no such thing as predict actor spawning?

chrome bay
#

No. You can spawn an actor client-side sure, but you are going to have to swap that out with the servers real actor if you actually want to do anything with it

twin juniper
#

But it could be depending on what i want to do with it. If i just spawn and equip a sword for example, i can just tell the PlayerCharacter to use the current machine's sword to hit

#

The replication is just for displaying in other player's machine, not owner

#

Is that make sense?

chrome bay
#

My first question is - does the 30-50ms delay actually make all that complexity worth it in the first place (chances are, probably not). The problem you've got is if the client spawns an actor locally, you have to be sure they will reliably clean it up when it's no longer needed. You also can't perform ANY network functionality on that actor.

So fine you might be able to equip your weapon, but until the servers' one arrives, you can't use it anyway. Just live with the miniscule delay would be my advice.

#

The only way you can do full prediction in this case is if the client already has the replicated actor, and they are just predictively modifying it's equipped state locally. Of course you need a decent prediction/rollback implementation to eventually sync it with the server

twin juniper
#

I can use it right after equip. I use GAS to perform an attack. The requirement is just a tag. When i equip the weapon in the client, it will grant the tag to the character, and GAS prediction will just play the attack for me. So there could be some frame that the player would be attacking with an empty hand, but i guess that's still better than the delay. Also, i guess players dont equip then attack immediately that much.

nova wasp
#

Mispredicts would also be extremely jarring here, you would just see the item dissappear in front of you

twin juniper
#

But there is no mispredicts

#

I don't think i know what i am doing

#

๐Ÿ˜‚

nova wasp
#

one cheesy way to get around the delay

#

is to basically have the server's version be sped up a bit by ping, to make it do the same thing at roughly the same time

#

a pretty common setup (to modulate the server side piece by the time the packet took) , but has some drawbacks where higher ping clients can do things faster form the perspective of others

#

not a good idea in most situations but it could help reduce a lot of headache if it's something difficult to sync up otherwise, I've thought of doing this for some of my personal stuff but never got around to that point

#

in a PVE game it could be totally fine

twin juniper
#

no i don't mean the server, i want to remove the delay in the client when they click 1-2-3 to equip

#

seem like big games like Fornite have that

nova wasp
#

is there anything that happens in the instant before the item is equipped?

#

perhaps a short animation like the hands moving down

#

you could immediately send the request then

#

and get the results back, then wait to actually apply them

twin juniper
#

yeah i get that, but why the hard way why i can just spawn it locally?

#

like there is no cancel on item equipping

#

Or prespawn all actor in the quick bar and make them invisible

nova wasp
#

I would argue it would be easier if the visual weapon was only on the client

#

and representative of GAS stuff

#

why does it need to be replicated? it's just following along the hands and what you have equipped

#

the state of it aside I guess

twin juniper
#

It need to be replicated so the other players can see

#

Or should i just call RPCs to other players

chrome bay
#

hell naw

twin juniper
#

why

chrome bay
#

because RPC's are not stateful

twin juniper
#

it's for the visual only (wait, i actually do collision on them)

chrome bay
#

What happens when a character walks out of relevancy range, then back in again?

#

Or if a client joins late

#

If you have collision then your prediction method doesn't work full stop

twin juniper
#

Ok i am just gonna spawn a fake actor then wait server real rep

#

The equip have a delay anyway

#

Game design baby!

#

Funny thing is, i just boot up Rust and Mordhau, and they have the exact same delay type

chrome bay
#

Most games do. It's not worth the overcomplication of prediction

twin juniper
#

Is melee weapon is actually harder to do things than guns? Because with guns, you kinda just spawn projectile, don't really need the weapon actor, they are just for the cosmetic
(NVM, i thought Rust let you pre-shot but after testing, it was 500ms minimum) (alright let's checkout our boi fornite)

tranquil fractal
#

hi guys, i wonder how the localized text variables proccess over rpc. For example if I send an rpc server to client for displaying an ingame notification text. Will client see that text in own language or server's language?

chrome bay
#

servers language

tranquil fractal
#

what if i use string tables?

chrome bay
#

Any FText sent over the network will be converted to a non-localised FString

tranquil fractal
#

does string tables solve the problem?

chrome bay
#

nope

#

You can't send the FText directly, you'd need to send specific keys so clients can lookup the localised message on their end

#

That key could be a lookup into a string table of course.

tranquil fractal
#

I got it thank you

lost inlet
#

FTexts are serialised over the network as FTextHistory, which will be localised if you're using something like FText::Format

#

CC: @tranquil fractal

tranquil fractal
#

Actually I'm using Blueprints. Does Bp using it this way?

lost inlet
#

Unfortunately I can't vouch for that. I was very surprised to see it worked as expected when the source string was from a string table, and formatted with FText::Format, no "lossy" conversions to FString

#

I think in the early days of UE4 it was sent as a string and received as an invariant FText

#

It's pretty heavyweight since it's essentially sending all the information to essentially reconstruct the formatted text on the client. If you have a more minimal way to get the message across then I would say go for that.

tranquil fractal
#

I will try thank you

#

My current setup is based on sending name variables over RPCs as string table key. Then Searching that id in string table on client.

#

Is sending name better than strings over RPC or should i always use strings?

lost inlet
#

(referring to names)

tranquil fractal
#

allright thanks

chrome bay
lost inlet
#
    // FTexts have creation history data, removed Key, Namespaces, and SourceString
    VER_UE4_FTEXT_HISTORY,
#

whenever this was added

chrome bay
#

Huh that was like 4.3

#

maybe I'm misremembering something

lost inlet
#

We did have a bug where our French publisher reported that bot names would use the server's localisation, but that was very much a .ToString() happening on an FText

#

But Sandstorm had a mutator system and they would only run on server and we had various utility functions to display an FText message to a client, these were always correctly showing in the client's language

chrome bay
#

Yeah maybe we were sending them as strings or something.. I can't remember now. I always had them down as sending as FString

#

Ah well, good to know ๐Ÿ˜„

lost inlet
#

you can look at FText::SerializeText, as long as you don't do anything to destroy the history in some way, it should work

honest bloom
#

I've been trying to understand how the Gameplay Framework works ..
and I'm noticing .. no one is overriding ReadyToStartMatch in example projects for some reason ..
I'd like to know if we HAVE to call StartMatch before returning a True within ReadyToStartMatch ?
I'm asking, because when my clients join the session .. their input works correctly while the server's input is ignored .. unless I call for StartMatch .. and I'm not if I'm doing things correctly

lost inlet
lost inlet
#

Yeah, still not sure how one has something to do with the other

#

Did you debug it?

honest bloom
# lost inlet Did you debug it?

well I'm not sure how to debug it exactly ..
When the server create the games, the pawn can move correctly
But the moment the client joins, movement works on client side but not in server side anymore.
This problem disappears if I don't override ReadyToStartMatch or call StartMatch

nocturne iron
#

It it possible to enable sending rpcs on non-owned actors. We don't need cheat prevention and it's kinda getting in the way of things.

fathom aspen
#

It's not related to cheat prevention really, it's just how the engine works

#

No you can't

#

You will probably need to modify the engine to make it work

#

So better to either route through one of the owned actors, or own them

nocturne iron
#

Ah, dang. It super annoying for simple stuff like buttons and dials where we want it to be responsive on the client and try to keep it relativly contained in a component while at it.

quasi tide
#

Server RPC your interaction and do the interaction locally

#

Or w/e is that you're doing

#

You can still call methods on things locally

#

Whether or not that is a good idea is an entirely different matter

nocturne iron
#

The problem is that some of our interactions drag sliders and dials with mouse cursor and stuff like that. So it's not just a simple RPC.

quasi tide
#

I still find it as a simple rpc personally, but alrighty.

nocturne iron
#

How?

#

Maybe it is just my interaction system being a bit limited atm.

warm lintel
#

"TurnDial" method
Send RPC "TurnDialRequest" From client to server
Send RPC "TurnDialBroadcast" from server to all clients

nocturne iron
#

So TurnDialRequest would be on controller or something like that?

warm lintel
#

no, it would be a client RPC that goes to the server

#

it can be on any object

nocturne iron
#

The dial need to be owned by the client then? no?

warm lintel
#

I think you're confusing the concept of ownership, it doesn't mean that clients can't send RPCs to the server for those objects IIRC

quasi tide
#

Yes it does

warm lintel
#

If I remember, you can't broadcast if you don't own the object, but you can definitely send an RPC to the server to request something be done on said object

nocturne iron
#

Are you sure?

quasi tide
#

You can only send RPCs from objects you own

warm lintel
#

Do correct me

nocturne iron
#

I guess the elegant way would be to abstract the action of the interaction to some sort of class owned by the controller

#

kinda like gas

quasi tide
nocturne iron
#

Yeah, I see.

quasi tide
#

I find it fine to have a specific interaction type method every here and there.

#

One generic interaction style that handles most cases, then you can sprinkle in specific types as needed. As long as you don't let that explode to a bunch of specific ways.

nocturne iron
#

Yeah

#

It's probably best like that.

warm lintel
#

I do stand corrected, my apologies.

#

It's routed through the server by being called on a client owned object

#

I.e. send the object you're interacting with to the server as a "request to interact" and run the rest of the logic there

nocturne iron
#

Yeah

warm lintel
#

Gotta make a fool of yourself at least once a month eh? ๐Ÿ˜„

nocturne iron
#

My OCD is burning from having specific interaction functions that are not abstracted- but this is a small project, most likely its fine xD

quasi tide
#

Speak for yourself ๐Ÿ˜Ž

nocturne iron
#

Yeah, but I think the abstraction would take more time than it saves.

warm lintel
#

Fair yeah

#

I tend to think of it as having a middleman in a transaction, same exact logic but "someone" else has to approve of it first

#

For better or worse anyway ๐Ÿ˜„

nocturne iron
#

Anyway, thanks all <3

elfin lintel
#

I am hitting a breakpoint (but I don't have a breakpoint set?) periodically in UChannel::SendBunch, and I'm not sure why. It breaks in the else statement at OutgoingBunches.Add(Bunch);, but if I just resume execution I don't get any output log message, crash, or seemingly anything bugging in my game (could certainly just not see it though). Also not sure if "breaks" and "breakpoint" are the correct terminology there, but the code execution is stopping at that line until I resume. Here's the specific area of code, and here's the full function on pastebin: https://pastebin.com/1iEb6AuR

    {
        uint8 *data = Bunch->GetData();
        int64 bitsLeft = Bunch->GetNumBits();
        Merge = false;

        while(bitsLeft > 0)
        {
            FOutBunch * PartialBunch = new FOutBunch(this, false);
            int64 bitsThisBunch = FMath::Min<int64>(bitsLeft, MAX_PARTIAL_BUNCH_SIZE_BITS);
            PartialBunch->SerializeBits(data, bitsThisBunch);

#if UE_NET_TRACE_ENABLED
            // Attach tracecollector of split bunch to first partial bunch
            SetTraceCollector(*PartialBunch, GetTraceCollector(*Bunch));
            SetTraceCollector(*Bunch, nullptr);
#endif

            OutgoingBunches.Add(PartialBunch);

#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
            PartialBunch->DebugString = FString::Printf(TEXT("Partial[%d]: %s"), OutgoingBunches.Num(), *Bunch->DebugString);
#endif
        
            bitsLeft -= bitsThisBunch;
            data += (bitsThisBunch >> 3);

            UE_LOG(LogNetPartialBunch, Log, TEXT("    Making partial bunch from content bunch. bitsThisBunch: %d bitsLeft: %d"), bitsThisBunch, bitsLeft );
            
            ensure(bitsLeft == 0 || bitsThisBunch % 8 == 0); // Byte aligned or it was the last bunch
        }
    }
    else
    {
        OutgoingBunches.Add(Bunch);
    }```
elder sable
#

Hi, i would like to have a replicated subobject with the player controller as a net owner but i need bReplicateUsingRegisteredSubObjectList in the PC, is there a non intrusive solution to use the PC as owner to replicate subobjects ?

chrome bay
#

Yeah use an Actor Component instead

#

ez mode

elder sable
#

I found FGameModeEvents::GameModePostLoginEvent and can add subobjects here

#

But the user has to set the subobject replication in the PC manually :p

#

I will just make a warning if not i guess

cosmic yoke
#

hello, apparently PossessedBy is run on the server but the controller doesn't have the Pawn variable set yet, it's a few lines later, so i'm having the problem of trying to cache the pawn where it's not available. what's a better alternative function for that on the server?

quasi tide
#

Cache it after the function is ran. Also why are you caching it when the controller already has a reference to it?

cosmic yoke
#

caching it casted

#

but what function can i use so it run after PossessedBy?

graceful flame
#

How do you enable logging when testing a linux dedicated server? I run the .sh script and it starts up with some sort of log but its not the typical UE output that I see with a windows server.

unkempt tiger
#

I'm trying to dupe an actor component so that it replicates. While the dupe itself works locally, replication does not

UActorComponent* NewActorComponent = DuplicateObject(SourceComponent, DestinationActor, FName(SourceComponent->GetName()));
NewActorComponent->RegisterComponent();
DestinationActor->AddInstanceComponent(NewActorComponent);

Am I missing something some call to a function?

quasi tide
cosmic yoke
#

i have my player character and it can possess a puzzle pawn, but when he leaves the puzzle pawn back to the player character i need to add again the UI for the player, which uses the pawn from the player controller

#

when it reaches PossessedBy the Pawn of the new player controller is null

#

so i don't have exactly a place to override to when that variable is set so the ui can use it in the same frame

#

if i do a one frame delay it probably works

#

but i wanted to avoid that

quasi tide
#

Where is possedby? In the pawn?

cosmic yoke
#

yes

quasi tide
#

That should be passing the controller. Why do you need the pawn of that controller?

#

You're already in the pawn

cosmic yoke
#

its the UI logic that needs it

#

for the getowningplayerpawn

quasi tide
#

Set the UI up in the player controller

#

After the possession happens

#

OnPossession or something like that

#

In C++, there is a client RPC method you can override

cosmic yoke
#

but this menu is only relevant for the player character, the player controller shouldn't really know about it

#

in the sense that it has the tsubclass of to instantiate and do the createwidget

quasi tide
#

I disagree. Pawns shouldn't do jack all with UI except for some like, 3D stuff maybe

#

But anywho, if you want to have it on the pawn, have the controller call something like "setupUI" on the pawn when it does the possession

#

Or check if there is a delegate you can bind to on the controller

cosmic yoke
#

ok i'll look into that, thanks

#

another weird thing is the PreviousController variable in the pawn

#

when you unpossessed

quasi tide
#

You don't have to do it

#

I don't have your code

#

I don't have your architecture

#

I don't have anything about your project in front of me

#

All I can do is make suggestions based on the limited information you provide

cosmic yoke
#

of course, but the previouscontroller variable exists in unreal engine, it's not something specific to my project

quasi tide
#

ยฏ_(ใƒ„)_/ยฏ

#

Figure out a way to use it or just ignore it.

#

I've never used it personally

#

Didn't even know it existed

cosmic yoke
#

worst case i can make my own variable for that

quasi tide
#

Pretty much

cosmic yoke
#

i just wanted to know if the previous controller was local

pearl saddle
#

I thought multicast replicates to all clients so wouldnt that mean all clients make their flashlights visible (if the class executed in was replicated)?

#

And this is in a pawn class

#

Which doesnt replicate so how are clients even able to recieve information to see the client that turned on their flashlight

#

I understand that clients send requests to server and then server sends the information back to all connected clients in a replicated class, in which case all clients will recieve whatever the server is sending and executes it

#

but what makes multicast different and why is it able to be run on a non replicated class

#

This is what I understand from this:

#

Client presses f, sends request to server

#

server then executes the custom event that replicates to all clients

#

the client that turned on the flashlight is the only one that will recieve this as pawn class isn't replicated

#

so how are the other clients able to see the flashlight on?

#

nvm im dumb it does replicate

#

and im guessing replicating flashlight multicast executes for all clients but only changes stuff on the client that called it

#

which means only that client turns on their flashlight instead of all

cerulean lintel
#

So, I have this actor component tied to an AI Controller class, when I press 1 in player, I want to replicate color change of all AIs in map. I'm using a repnotify in the component and pressing 1 calls a run on server event to change the notify color, component and AI are set to replicate. Only server is changing color. Possibly because it's a dynamic material instance? Am I missing something here?

#

This is how the notify is being called

quick rapids
#

How do I repnotify a broadcast multicast dynamic delegate with multiple params?

dark edge
#

What are you actually trying to do

dark edge
#

Client doesn't own the ai controllers

quick rapids
dark edge
#

What is the actual game mechanic

#

You want x to happen when y happens

cerulean lintel
dark edge
#

@cerulean lintel put your rpc right after the input

quick rapids
#

On damage received, pass damage payload to listeners

cerulean lintel
#

like this?

#

still visible only on server

#

I'm not replicating Dynamic Material Instance, just creating them and replicating the color itself

dark edge
#

That should probably be multicast

dark edge
#

Input -> Run on server event
Run on server event -> do the stuff

quick rapids
#

Yeah, I thought about using a multicast RPC but have been reading about people suggesting repnotify and was wondering how to do that

dark edge
#

repnotify is for state, multicast for transients

#

pretty much

quick rapids
#

Aight, that makes it easier to choose between the two, thanks

cerulean lintel
#

will the updated color be visible for late joiners if not using reps?

dark edge
#

info gets from server to clients by replicated variables

#

if you want to do stuff when that variable changes, that's repnotify

cerulean lintel
#

yeah, I'm trying to modify the color with the notify

#

I noticed, if I change to jump, it's replicated, just the color is not working

dark edge
#

none of that code runs on the server in your example

#

local client only, the one that pressed the button

pearl saddle
#

I have a question with a simple code such as this

#

Why can other clients (not server) see the client sprinting

dark edge
pearl saddle
#

Just increases player max speed by 1.5x and reduces by 1.5x

#

It executes on server but the server doesn't replicate back to rest of the clients only selected one

cerulean lintel
pearl saddle
#

It has me confused because whats the point of multicast if I can just do this?

dark edge
#

that pretty much means pawn or playercontroller

dark edge
cerulean lintel
#

AI Controller

dark edge
#

Those don't exist on clients

cerulean lintel
#

it's an AI Controller with the actor component (that owns the RPC)

dark edge
#

which class has the input?

#

the keyboard 1 event

cerulean lintel
#

character class, but it's the local player

dark edge
cerulean lintel
#

local player is changing AI colors

pearl saddle
#

Wait is it because character movement is already replicated to clients?

pearl saddle
thin stratus
#

@pearl saddle First of all, Sprinting will always be shite without C++ with the CMC

cerulean lintel
#

this is the component with RPC

thin stratus
#

You can't make that lag free

#

Mover 2.0 in 5.4 might allow BP users to do that

#

And then, if you do it in BP, you gotta use an OnRep varaible to set teh max speed

pearl saddle
#

That's fine

#

Idm the net lag

dark edge
#

since that's what a client owns

#

Character:
keyboard 1 -> run on server event
run on server event -> get aicontrollers -> do whatever

#

why is the color a property of the ai controller though

cerulean lintel
#

yeah, it already is

dark edge
#

that should be a property of the pawn

cerulean lintel
#

this is the player, calling the RPC

dark edge
cerulean lintel
#

it's a property of the actor component, tied to the AI Controller

dark edge
#

and does AIController even replicate?

#

I'm pretty certain they're on the server only by default

pearl saddle
#

Can I set onRep on any owner server/client will it matter?

cerulean lintel
#

it is set to replicate, instead of using change color, I switched to jump, it worked

dark edge
#

the pawn is everywhere

cerulean lintel
#

got it

dark edge
#

pawn = body
Controller = brain

#

replicate the body, not the brain

thin stratus
#

It's the same as with any other replicated variable

dark edge
pearl saddle
#

But i'm confused because with multicast I set on client and it works

dark edge
#

replication is server -> client only

cerulean lintel
#

gotcha, I'll move the component to the pawn then

thin stratus
#

That's not the point. Speed is a State

pearl saddle
thin stratus
#

State is OnRep

#

Multicast is wrong

dark edge
pearl saddle
#

like this for example

thin stratus
#

Adriel literally wrote that a few minutes ago already

dark edge
#

Input -> run on server
run on server -> set replicated variable
Repnotify -> do the logic driven by that variable

#

in your case

#

F -> run on server
Run on server -> set bool = NOT(bool)
Repnotify -> set light based on bool (play sound too maybe if you want)

cerulean lintel
pearl saddle
#

set bool for rest of clients?

dark edge
dark edge
#

then the repnotify will run EVERYWHERE and that's where you do your business logic based on that bool (play sound, change light intensity)

pearl saddle
#

I understand that

dark edge
#

and you don't need to pass location, play the sound at WhereTheFlashlightIs

oak spear
cerulean lintel
quasi tide
#

In that locally ran function, you play the sound

#

(Just assuming adriel already went over having a bool for the state for the flashlight)

pearl saddle
quasi tide
#

Client sets bool to true locally and then does a server rpc
Server sets the bool's value and because it is replicated, it'll get sent to clients
When client's receive the updated value, it runs the OnRep - in here is where you do the logic

cerulean lintel
#

weird, moved the component to the pawn, still not able to replicate the color

#

jump works though

#

๐Ÿคฃ

pearl saddle
thin stratus
#

You are making this harder on yourself

#

Replication only works Server to Clients

#

No matter what you try to make up here

#

If a Client sets a value locally, it doesn't replicate to anyone

#

The only benefit of setting it locally on the Client that ALSO ServerRPCs, is that you don't need to wait the whole RoundTripTime

pearl saddle
#

im not making it up when a new client joins renotify goes off when it happens in client

thin stratus
#

The point of RepNotify is to call on a client when they are relevant (or become relevant) and the value changes

#

That's why you are supposed to use it for state

#

Cause an RPC won't trigger again

#

If you change a color with an RPC, you won't see the change on the new Clients

#

If you set it via an OnRep variable, the connecting Client will call the OnRep and thus change/use the color

pearl saddle
#

yeah

#

repnotify for only new clients rpc for already connected clients

thin stratus
#

RepNotify for State

pearl saddle
#

but when youre out of cull distance you still need repnotify

thin stratus
#

RepNotify for State

pearl saddle
#

so you can see changes when they come back into distance

thin stratus
#

Like, I can only repeat this

pearl saddle
#

i dont understand what you mean by state

cerulean lintel
#

I think the repnotify wasn't the issue for the color replication, even moving the component to the pawn, still doesn't work

thin stratus
#

"State" is something you change that stays that way until changed again

#

Speed is State

#

A Name is State

#

The color of a cube is a state

#

The size of a cube is a state

#

None of this is something you change via an RPC

#

And with RPC I mean Multicast/ClientRPC

pearl saddle
#

I was going to use repnotify for speed later

#

but i was on about the current repnotify (flashlight replication)

#

not the walkspeed

thin stratus
#

It doesn't matter what you use it for. Flashlight being on or off is also a state of course

pearl saddle
#

yeah

#

but what i was asking is whats the difference between setting repnotify on client and repnotify on server if both methods seem to work

thin stratus
oak spear
#

Exactly, if the flashlight is off by default and you did not use OnRep for turning it on late joiners will not see the flashlight on

pearl saddle
#

yeah

#

so i set repnotify on client

#

and now it works

thin stratus
#

That's the difference. RepNotify is just a replicated Variable that has a callback that calls when it changes. in BPs that a bit of a different callback than the one in C++, but it's the same idea

#

But since it's just a replicated variable

#

It still has to be set by the server to replicate

#

Client setting it won't make it replicate

#

The only thing that does is change the value locally

pearl saddle
#

with the multicast wouldnt it replicate to all clients and server tho

thin stratus
#

Multicast also has to be called by the Server

pearl saddle
#

I've made a comment on what i think happens

thin stratus
#

That's a redundant setup

#

Which you were already told

#

The Multicast is not needed

#

At least not for the boolean

pearl saddle
#

but i thought for other clients to recieve this info ud need to multicast

#

at least for the sound

thin stratus
#

If the sound is a one time sound that shouldn't trigger again for late joiners then the multicast for the sound is fine

pearl saddle
#

If I were to remove the multicast and just have server setting the repnotify it would do the same thing?

thin stratus
#

For the Boolean it's redundant

thin stratus
pearl saddle
#

wouldnt the server have to send this info back to other clients for them to see it

thin stratus
#

That's what the replicated part of the variable is for

pearl saddle
#

oh

thin stratus
#

Server sets it and it gets replicated to clients

pearl saddle
#

so i can just cheat out not sending any information to other clients by just using repnotify

#

as its replicated

thin stratus
#

If you don't need the OnRep function callback you can also just use a normal replicated variable

#

RepNotify is only needed if you need to react to the change

pearl saddle
#

yeah

#

i do need that for obvious reasons

thin stratus
#

Yeah but the multicast is indeed not needed.

pearl saddle
#

i do want other players to hear the sound though so im confused as to why i should get rid of it

thin stratus
#

The sound is a different topic

#

The Boolean is a state

#

The sound is just a one time playback

#

If you trigger the multicast and play the sound from it

#

And later someone joins

pearl saddle
#

they wont hear it

thin stratus
#

Correct

pearl saddle
#

but thats fine because you shouldnt be

thin stratus
#

Correct

#

That's when we are not talking about state

#

If you however were to enable a looping sound as long as the Boolean is true, then you would use the OnRep and the new Boolean value to start and stop the sound

#

Cause the sound being on or off is a state

pearl saddle
#

yeah

thin stratus
#

So if you want to keep the sound with the multicast, it should be enough to love the set Boolean call to the Server RPC before you call the multicast

#

Just be aware that the Boolean can not have replicated yet when the multicast arrives

pearl saddle
#

so this whole convo was about how setting repnotify in client is redundant when not taking into account the sound part

thin stratus
#

So if that's depended on each other you gotta sent at least the new value along the RPC, but still no need the set the Boolean locally

pearl saddle
#

...

thin stratus
#

There are times where you set the value locally on the client that triggers the server rpc

#

But only to predict the change

#

So the local client doesn't have to wait until the variable replicates back to them

#

The server still has to set it though

pearl saddle
#

i appreciate all the information you're giving me

#

thank you

thin stratus
#

No worries. It's half past 11 now. So I will head to bed. This info is theoretically all written down in my compendium that is pinned to this channel

#

But I assume you either know about it already or even read it

pearl saddle
#

One more question this is a quick one

#

when doing networking as a whole

#

do i really only need to understand repnotfy and rpc

#

not talking about backend

#

because i'd have 0 clue

thin stratus
#

No. Sadly not. You also have to understand what existing classes exist when and who has access to them. And also what data to put where

#

Which is also partially explained in the compendium

#

And ownership is a big topic

#

That's what allows a specific client to call Server RPCs to begin with

pearl saddle
#

Alright thank you

#

who has access to tthem shoul;d 99% be the server though

thin stratus
#

No

#

GameState is available to all

#

PlayerState is per Player and available to all

pearl saddle
#

oh yeah i havent used that yet

thin stratus
#

PlayerController is per player and only available per player and server

#

Etc

pearl saddle
#

but you wouldnt have important info stored in gamestate or playerstate

thin stratus
#

You really need to check the compendium. It exists so this stuff doesn't need to be repeated

pearl saddle
#

for security reasons?

#

k

thin stratus
#

It's more about who needs access to the data

#

The score of a player would live on its PlayerState so everyone can see it in the scoreboard for example

pearl saddle
#

ah

#

im currently requesting server to send all info to each client using for each loop

thin stratus
#

๐Ÿ’€

pearl saddle
#

to update everyones info

#

like for example showing mic display

thin stratus
#

Mic on off?

pearl saddle
#

when they speak ud usually have a mic icon showing for everyone to see

thin stratus
#

That's a state though

#

So you know the answer

pearl saddle
#

repnotify

thin stratus
#

Yes

#

On the PlayerState

#

Client A talks so PlayerState of Client A will have that Boolean set to true

#

RepNotify changes UI icons or so

#

If they keep talking and someone late joins it will properly display for the late joiner

#

Your RPC will not

#

Same story

pearl saddle
#

yeah

thin stratus
#

But now I shall head to bed. Good luck!

pearl saddle
#

thank you

warped oxide
#

Here's a screenshot I yoinked from one of the pinned videos that I found pretty helpful

unkempt tiger
#

thank you SO much for this, one year later

#

i've already wasted 5 hours trying to get a duplicated actor component to replicate, and removing RF_WasLoaded from the new component finally got it to work

hollow eagle
#

glad it helped even though I don't even remember why I had that problem lol

unkempt tiger
#

this is why i love this discord

dark parcel
#

I'm thingking about pushing other players or npc in a multiplayer project with cmc.

Let's say I use on tick and impulse to push npcs out of my character way. What I'm struggling with is, how can this be locally predicted since i don't have authority over other actors. And multiple people running the simulation won't even give the same result so the only reasonable way seems to be doing the push on the server which then update the result on clients.

This will probably result in delay, especially for high ping client. Are there any thoughts on how to tackle this?

twin juniper
#

Hey, i'm thinking about AI. In a multiplayer game, AI would be on the server and get replicated down, right? Is there any case AI run on clients? I guess there is no good reason to run AI on clients, so normally people not gonna do that

twin juniper
#

I have another question .
Is there a way to force OnRep on client even the value is not changed, for one time only, not setting the whole thing to COND_Always? I think i tried ForceNetUpdate but that didn't work

#

I was calling an RPC, but Client RPC will also sent to server player, and i want to send to only client

marble gazelle
#

You can send an RPC to the owning client. UFUNCTION(Client)

twin juniper
#

Yeah mb, i mean the Server player

#

ClientRPC will still send to server player (if it's on the server)

marble gazelle
#

then branch? if(IsLocallyControlled && IsServer) Don't

twin juniper
#

oh yeah. that probably work

marble gazelle
#

also client RPC is not sent to other peers if it's the locally owned actor, that would be counter the design

stoic vine
#

Hello Everyone, I followed tutorial Docs about setting up dedicated server in AWS but instead of AWS I'm currently Using microsoft Azure
Every Steps has been done and I turn on Lyra Server in my VM but when I play Lyra Game and using console command and type "Open my Ip" I cannot connect, pls help

heady copper
#

hello good morning good people

#

i have a question if i may

#

i recently uploaded a dedicated server to play fab to test a game ,when i launch the client build and click on the create match button the game crashes ...this is not the case with listen servers, so i was wondering if the server default map must be same with the lobby map before all playars are transported to the game map? please ill need help on this one thanks

heady copper
#

in a nutshell how do i make my lobby work when using a dedicated server

grave lynx
#

Hey, How can I play a niagara system for everyone except owner?
I tried to call a multicast RPC with UNiagaraFunctionLibrary::SpawnSystemAtLocation(...)->SetOwnerNoSee(true); but still play to owner

nocturne glacier
#

Hey, it possible to use live link in a multiplayer setup, so that clients can also see the live link poses and not just the local client?

pearl saddle
#

So i'm trying to setup repnotify for a number of items that might be picked up and dissapear before other clients join

#

im not sure why it's not working

#

the correct actor class is definitely being sent through

#

This is in the player controller and the actor class being sent through is from the player pawn

upbeat basin
pearl saddle
#

i realised what i did wrong but it still doesnt work

#

one sec

#

i just wanted other players who join or are in current game to see the actor destroyed when whichever player interacts with it

upbeat basin
#

Do you have multiple objects of the same class in the world?

pearl saddle
#

only the one but in the future i will

#

they will all be of the same class

upbeat basin
#

Then you will need to change your approach. You won't know which object GetActorOfClass will return to you. So you'll destroy a random object instead of the specific one your player interacts with

#

I would send the object itself instead of it's class to the inventory

#

Even create an inventory item component and send it to the inventory and hide the object instead of destroying it, so when you want it to be visible again, you can just make it visible instead of spawning an actor again, which is probably more expensive operation

pearl saddle
#

its just a one time use thing

upbeat basin
#

But if you only have one object in the world and it's replicated, you should see that it's being destroyed with your current setup, I'm not sure what causes your current problem

pearl saddle
#

like a key pickup

#

it doesnt seem to be replicated by the repnotify

upbeat basin
#

Yes but if you have multiple keys or even have different classes that inherits from a base class for pickable items, and use GetActorOfClass with the base class, then you won't have control over which actor is going to be destroyed

pearl saddle
#

ill send actor reference instead

#

thats true i didnt think about that

upbeat basin
#

Okay the current issue might be because you're setting array to itself

pearl saddle
#

i did an append with a new array on controller

upbeat basin
#

If you set a replicated variable to the same value, OnRep won't be called on server on blueprints

pearl saddle
#

but the class was added to before i set

#

so it changed

upbeat basin
#

Yes you change it before you set, but when you set, you're setting it to it's current value

#

Can you try creating a temp local variable, setting the array to the temp variable, adding to temp variable and then setting the temp variable back to the replicated variable?

pearl saddle
#

im doing that rn

upbeat basin
#

Is it still not triggering OnRep function?

pearl saddle
#

yeah its not

#

ah wait nvm

#

replicates just doesnt destroy on owning client

upbeat basin
#

Hmm, apparently blueprints also call OnRep on add and remove, so the whole temp thing is also unnecessary

upbeat basin
pearl saddle
#

should be

#

unless i forgot

#

yeah it wasnt..

upbeat basin
#

Also for the destroy logic, you're doing it in the OnRep, which should work for all clients and server, you either need to filter it with HasAuthority to let only server destroy it and let it be replicated to clients, or even better, just destroy it before you add it to the array since you're already on the server there

#

So the logic should be better by taking an object reference as the parameter, adding it's class to the replicated array of owned item classes and destroying the object reference

#

Otherwise you'll either add null or an actor that's pending kill to your array since you destroyed it, or it won't be null at first but will be nulled later when you destroy it

pearl saddle
#

thing is i need them destroyed in the onrep so clients joining wont be able to see the actors

upbeat basin
#

So you shouldn't be holding the reference in the array but the class, or just hide them instead of destroying

lethal blade
#

I am working on mobile game. Can someone tell me on how to possess widget BP with buttons (Obviously it's mobile platform) for character and pawn ? Like possessing character to car and vice versa

upbeat basin
lethal blade
upbeat basin
#

Oh if you mean different classes that are being possessed, then what I would do is listening for player controller's possessed pawn changed delegate. You can check your NewPawn class and decide which widget you want to show

worthy knot
#

Im trying to use the multi user plugin, im using a hamachi vpn server ip as the unicast end point, but its popping up this message when creating a multi user server

pearl saddle
#

yeah it just wasn't possible to destroy them so hiding them worked for both

upbeat basin
pearl saddle
#

just dont like it because it adds unecessary data

#

i guess thats why u do object pooling so u reuse the same one

upbeat basin
#

I wouldn't consider it as unnecessary data, spawning and destroying actors when you spam interact and remove from inventory is more expensive, performance wise, than just hiding and making them visible again

upbeat basin
pearl saddle
#

i feel like object pooling is only important with mass spam tho tbf

#

like bullets etc

upbeat basin
#

Also if in future you would like to hold states within your items (let's say you have a potion that can be consumed multiple times and destroy when maximum amount is consumed) destroying and spawning it again would cause it to spawn with it's default state, so you could do a hack by consuming it, dropping it and getting it back to use it infinite times

pearl saddle
#

true

upbeat basin
# pearl saddle i feel like object pooling is only important with mass spam tho tbf

For the bullets example, you would spawn an optimum amount of them and let them wait in the pool, use whenever needed and return it back to pool again. For items though, since they can have their own custom states, you can't return them back to a pool. So it's not actually object pooling, I guess? But the optimisation you gain problem you solve by pooling bullets and hiding/making visible items in your inventory vs items in the world is the same, getting rid of unnecessary spawn and destroy calls

karmic trellis
#

Hi, when I try to possess Server and Clients like this clients going good but possess function doesnt work for Server what should I do for it?

upbeat basin
#

What's.. going on on there

nova wasp
#

might be time to move some nodes around if you need to play snakes and ladders to follow it... I've been there I guess

worthy knot
tardy fossil
heady copper
#

looked at the logs ill remove it

buoyant furnace
#

hi, im trying to throw a projectile in the direction of the player's cursor. problem is that it is only thrown in the right direction on the server and not the client. here's what i have in the projectile event graph (also, this is my first ue5 project)

worthy knot
upbeat basin
buoyant furnace
late wind
#

what is a good setting for these:

#

i have a problem where remote player movement is jittery when in collision with moving npcs... can these values help?

#

(what i mean by remote player, is that my player is connected to a remote host)

late wind
#

Just to emphasize, this only happens whenping is high, loike higher then 50ms

chrome bay
#

That's to be expected

#

Your local character is ahead of the server, whereas NPC's will be behind the Server. They operate in two different timeframes so perfect prediction isn't possible.

#

You could do something highly advanced, like prevent your local character walking into another NPC by estimating their future position based on ping/velocity etc.

#

Very difficult to achieve in practice

late wind
#

So, the only option i have would be to turn off collision with npcs

#

@chrome bay ?

#

i mean is there a way to tell that if something like that happens don't jitter just run it smoothly, regardless of the outcome

#

i don't mind players and npcs occuping the same space, that's not game breaking

#

if it comes to that

#

something like, do you best to handle collision, but if you run into a problem like i described, don't jitter, just let them penetrate each other

chrome bay
#

You can turn off collision yeah and/or modify player and NPC velocity based on the above idea

#

Could look at something like ORCA or RVO for avoidance

late wind
#

when it comes to turning off the collision, where do i do it... i never know

#

is it on the sever/client or both?

#

*server

chrome bay
#

Modify the collision profile for the character capsule so that it doesn't block other characters/pawns

#

Collision must match on both, just make it the default

late wind
#

ah, so it must match...

#

so i do it on the server first, then what, rpc to client?

chrome bay
#

No, you make it the default

#

Change it in the actual blueprint. No point doing it at runtime

#

RPC would also break relevancy

late wind
#

if i wanted to detect jittery behavior somehow on the client

chrome bay
#

If you had to do it at runtime you'd need a property and a rep notify

late wind
#

and then turn off the collision

chrome bay
#

You can't do it that way

#

The jitter happens before collision

#

The server is correcting your clients predicted movement because it thinks you walked into an NPC

#

So it's too late to disable collision

late wind
#

yeah, but, the situation here is that my character is moving into a npc persistently

chrome bay
#

right, so just turn off the collision permanently

late wind
#

because he's a melee character and want to get close

#

*wants

#

and the npc is moving as well

chrome bay
#

The only way you can stop the jitter is if the client can predict they will intersect and NPC and stop themselves from doing it

late wind
#

so i have a persistent jitter

#

so i'm thinking if i can detect the first jitter somehow

#

and then turn off collision to prevent future jitters

#

hmmm

#

do you have any idea what these do exactly, i read on the internet some people were able to tweak it to remove jitter

#

but i have no idea what are the meaning of these (they're from movement compenent)

chrome bay
#

Doubt it tbh, that's for penetration adjustment which is after collision occurs

#

the "jitter" is not client-side, it's your client getting a correction from the server because it's not allowing to walk into another characters' collision

#

The only way you can properly stop the jitter, is if the client doesn't walk into their collision at all

#

But since both operate in different timeframes, that's borderline impossible to do 100% reliably.

#

But a start would be predicting the NPC's future position based on your ping, and not allowing the client to walk there locally

#

Or, modifying the input vector during movement to force them to move away from the NPC

modest lark
#

Hey guys I'm using the advanced sessions plugin and trying to update session but every time I do the current players returned is incorrect.

Ex. 1 player connected with 2 max players set updated to have 3 max players will return 2 current players even though no one additional players connected

anyone have any clue or idea why this might be?

late wind
#

@chrome bay thanks for your input... but how do other multiplayer games handle this ? and there is an abundance of multiplayer games in ue.It's not possible that they all do some custom made solution

chrome bay
#

Sure it is

#

Honestly I don't think most bother at all

late wind
#

wierd, i have my playerbase complaining about this jitter a lot

hoary spear
#

Treshold for complaints should be adjusted higher

#

I wonder if one could have some local collider with a bigger radius...

#

But i guess it would still jitter when server corrects, and doesnt know about the bigger collider

#

If used to stop / divert player input tho... hmm

sterile aspen
#

Hey everyone, I'm working on a prototype for a sandbox multiplayer game where about 8 players are in a warehouse and are able to pick up / interact with different objects, use environment-augmented voice comms, and also trigger events that will effect the whole server.

I haven't gone into the networking side of things, but I hear UE5 has some limitations. Any suggestions on what my biggest difficulties here might be, or how I should approach this?

quasi tide
#

Not for that time of game

#

Fortnite runs 100 people on a server, in an open world. With many interactables and destruction/building.

clear island
#

are these 2 settings of the CMC for simulated proxies or autonomous ?

#

getting conflicting answers

sterile aspen
quasi tide
#

What's to elaborate on? The information you provided will be fine in UE

#

You won't hit any mystical issue or anything like that.

#

UE will be more than suitable for that type of game.

sterile aspen
#

Oh gotcha, I thought you meant that it wasn't for that type of game.

#

Any thoughts on P2P for this? I can see there being quite a few physics objects being tracked at once.

#

I guess my question is more along the lines of using UE5's built in multiplayer tools vs building something specifically for this

quasi tide
#

My main thought is it wouldn't be worth it. UE doesn't support P2P out of the box. You'd have a custom networking model

#

UE is a client-server architecture

sterile aspen
#

Riiiiight. I'm learning as I go here.

quasi tide
#

๐Ÿซก

sterile aspen
#

Thanks for the input, i appreciate it!

quasi tide
#

Read the pinned posts

#

For clarity - P2P is often misidentified as just being able to connect with each other. But it's not that simple.

#

P2P means that you are connecting with each other and there really isn't a server involved. UE's model, there is always a server involved.

#

Even if a player acts as the server

sterile aspen
#

It's just that the server is running on the same machine as a client

quasi tide
#

Right. Listen Server

sterile aspen
#

but still maintaining that relationship

#

gotcha

#

Thanks again

late wind
#

Hi! Is there anyone who could provide a detailed description of these character movement variables, preferably with examples:

karmic trellis
karmic trellis
#

and?

dark edge
#

First off, is the character being spawned server or client side?

karmic trellis
#

in server side

#

spawning on server and possessing on server, in GameState

dark edge
#

right now it's like the timeline to Primer

karmic trellis
#

I didnt get what you mean really, in code just basically going spawnactor in a foreach and after complete going another foreach to possess from PlayerArray.. already a basic scheme

#

๐Ÿคจ

dark edge
thin stratus
#

Server RPC in the GameState is generally wrong

karmic trellis
#

because of I am new and can forgot sometimes GameState working just for Server so makes all the events marked with Run On Server ๐Ÿ˜„ . andd Delay is just for "Do Once"s reset pin to make there more secure to not duplicate them mistakenly

thin stratus
#

Also is that Set node with the "Make Array" node your attempt at clearing the array?

karmic trellis
thin stratus
#

Clients can't call ServerRPCs in the GameState, and Server doesn't need it of course

karmic trellis
#

I knoww Its just for me to can see when writing there somethings to dont forgot that area is just for servers ๐Ÿ˜…

thin stratus
#

Use comments...

karmic trellis
#

๐Ÿฅฒ really I just asked for possess

thin stratus
#

When is that code being called?

karmic trellis
#

SetPlayersPositions > SetMapDetails-just costmetics- > and this event

#

not any open world or eg

#

just default events

dark edge
karmic trellis
#

and checked with printstring in foreach after possess, InPawn-getobjectname- and target -getobject name- is printing valid

warped oxide
#

I have a similar possess question! As a client, when I possess a character while moving, the old character on the clients screen gets desync'd and continues in a straight line forever but is standing still where it should be on the servers screen. Anyone know why that might happen?

#

When standing still there's no desync issues, both characters are using the CMC

grand kestrel
#

Not at computer at the moment so can't check exact function name but maybe force a replication update after possession

#

I'd start by testing if you can reproduce in third person template tho because if you can't there might be an issue with your project that could cause other problems if you bandaid it

warped oxide
dark edge
warped oxide
warped oxide
#

I know the client interact is redundant I forgot to delete it was messing aroudn with it lol

grand kestrel
#

Oh you're adjusting the pawn's transform outside of the prediction system, that is always going to desync

warped oxide
#

ooo a new term for me lol guess that'll do it

#

I'll google how to use the prediction system, thank you!

grand kestrel
#

And so begins years of frustration

dark edge
#

might be getting stuck on your last movement input

warped oxide
grand kestrel
#

Calling ForceReplicationUpdate on CMC might help too, but dunno, I don't think this is something Epic would have overlooked since possession is a critical part of their framework

grand kestrel
warped oxide
grand kestrel
#
bool APawn::IsMoveInputIgnored() const
{
    return Controller != nullptr && Controller->IsMoveInputIgnored();
}
#

Wait no

#

That won't help here, but it might be good practice anyway

warped oxide
#

Appreciate all the help guys, really nice!

grand kestrel
#

These are the checks I do before I process any input, which includes looking for a controller

bool UMyHeroComponent::CanProcessInput() const
{
    const AMyPawn* Pawn = GetPawn<AMyPawn>();
    if (!Pawn)
    {
        return false;
    }

    const AController* Controller = Pawn ? Pawn->GetController() : nullptr;
    if (!Controller)
    {
        return false;
    }

    if (Pawn->IsMoveInputIgnored())
    {
        return false;
    }

    return true;
}
warped oxide
crisp shard
#

how to go about making enemy AI movement not be desynced? im getting mega desync from how i have the AI movement right now but it's chasing the player , i increase it's speed and this really throws off where the enemy AI is and it hits the player when it appears to be much further away than it is etc

grand kestrel
#

You can either disable collisions or use something like my plugin, which gives you net predicted soft collisions (I use these in my single player game too because they feel great, and I can make NPCs get annoyed at a player walking into them, or shove them)
https://github.com/Vaei/PushPawn

GitHub

Allows pawns to push each other, uses GAS to prevent desyncs that often occur when colliding with AI due to lack of net prediction between Characters. - Vaei/PushPawn

crisp shard
grand kestrel
#

If you start from the "Ability System" header that should show you how to integrate minimally

crisp shard
crisp shard
grand kestrel
crisp shard
worn flame
#

Hi all, I'm having trouble getting PlayerState::CopyProperties() working for the Listen Server's player state specifically. It works 100% as expected for the clients' Player State, but doesn't execute on the host's Player State at all.
Has anyone gone through this?

worn flame
thin stratus
#

Wasn't override with supposed to be the inverted logic? I can never remember what old and new was for that one. But that should also only matter for reconnecting I guess

worn flame
thin stratus
#

The rest looks fine. There is nothing speaking against this. Only requirement might be that they both share the same class or at least parent class

worn flame
thin stratus
#

I don't think I ever had an issue for the ListenServer with it

#

Are you able to use c++?

worn flame
thin stratus
#

If so I would suggest you breakpoint a bit

#

PIE can't use seamless travel without the experimental console variable

#

So I wouldn't trust that

worn flame
#

You mean all the way from PlayerState's DispatchCopyProperties and such?

thin stratus
#

Yeah I would hook into the standalone process of the server

#

And breakpoint the part where it's supposed to call it

worn flame
#

Awesome, I'll do that

thin stratus
#

And then work my way up in case it isn't being called

#

I can't recall this not calling for the ListenServer

#

I also highly doubt that was a thing

edgy venture
#

is there a way to test remote play together with friends without a published steam page?

thin stratus
#

That's probably easier asked on steam's end than here. Also the first time I see that specific question. Fair question though

edgy venture
#

I see. Yeah, I mean obviously it would work as long as the local version works. Just would be nice to test a build for "fun" factor without having to make a steam page

#

Is there a place that I can ask such a question to steam?

#

I guess steam community maybe

#

Interesting

#

It appears you can hack a solution by deleting all the files of another remote play game, replacing them with your game and renaming your exe to the old exe's name

#

Im testing it now to see if it works lol

dark edge
ember vine
#

if i wrap hitresult in another struct, and pass it through an rpc, what happens to the netserialize on the hitresult ? still gets called as normal ?

grand kestrel
ember vine
#

ah ok yea makes sense

ember vine
#

how are you supposed to netserialize a pointer to a replicated actor ?

#

map->SerializeObject ?

fossil spoke
#

@ember vine Look at the HitResults NetSerialize function

#

It serializes all sorts of data types

ember vine
#

ah jeez 4am, its what ive been looking at i just didnt see them, even tho i know hitresult has like 20 ptrs on it Facepalm

modest lark
#

Hey guys I'm using the advanced sessions plugin and trying to update session but every time I do the current players returned is incorrect.

Ex. 1 player connected with 2 max players set updated to have 3 max players will return 2 current players even though no one additional players connected

anyone have any clue or idea why this might be?

silver pendant
#

how can I create a custom replication condition?

solar stirrup
karmic trellis
#

Hello, I have a basic question, If I make 2 actor and all replicates to enabled and then if I put actorB to inside the ActorA components -child actor-. Child actor-actorB whichs inside ActorA- will replicate from server to clients properly like a normal Actor?

silver pendant
#

I have an Issue: spawned component isn't exist for new joining clients.

solar stirrup
solar stirrup
#

They are a bandaid fix from Epic that will break in random ways at the slightest inconvenience

silver pendant
solar stirrup
#

So did you figure it out or?

karmic trellis
silver pendant
solar stirrup
#

Well, the question I asked is important :p

silver pendant
#

I don't know the solution, as components by default I have to spawn it on multicast, not as actors which I only need to spawn on server

#

so spawned components doesn't show up for any new joining client

solar stirrup
#

You dont spawn them using RPCs

#

You spawn them on the server and make sure they are replicated

silver pendant
#

doesn't work

#

even if the server spawned them, still any new joining client can't see it

#

and it's set to replicates already

solar stirrup
#

You need to spawn it on the server, mark it replicated if it isn't, and register the component

solar stirrup
#

Show your code, sounds weird

silver pendant
#

the second one uses mulitcast, one before the client join the session, and the other after it joins

#

you can see the difference @solar stirrup

tulip oyster
#

HasAuthority() returns inconsistent errors when running on Dedicated

True, false alternately

It's like it's delayed. Who can answer?

thin stratus
tulip oyster
#

The listen server works fine. when Join Dedicated receives an uncertain value from hasauthority.

solar stirrup
tulip oyster
#

on listen server it working hasauthority() is alway true
on dedicated hasauthority() true false alternately It's like a delay from the network.

tulip oyster
thin stratus
#

@tulip oyster Well, I can only tell you that whatever HasAuthority returns is not random

tardy fossil
#

from you video it looks like notify is only getting called once at the end

thin stratus
#

If you get False or True, then either of them is correct

tardy fossil
#

else it would say HasAuthority(): false

thin stratus
#

Also if this is AnimNotify based, make sure to use Branching Points for the Notifies

#

And ensure that the Mesh SkeletalMeshComponent is set to always update bones and tick pose

#

If HasAuth returns false, then you called it on the Client on a Replicated Actor.

#

And if it returns true, then you either called it on the Server.
Or you called it on a local Actor on the Client, where the Actor doesn't exist replicated.

tulip oyster
thin stratus
#

I still don't see the actual problem. The problem is NOT that it returns a random value

#

You are calling this on different Instances

#

Please ensure the MeshComp stuff I wrote

tulip oyster
thin stratus
#

Yes

tulip oyster
#

It's already tick pose

thin stratus
#

Then ensure that your Notifies are branching points

tulip oyster
#

i will try

#

It's the same. can't fix

sturdy sand
#

Hi!
I'm trying to make a system where I would change the player speed on scroll wheel and I want it to be with the CharacterMovementComponent's prediction architecture. I'm still struggling to understand cmc. I've got most of the delgoodie setup. The problem is that I won't have a sprint key and so the player speed is going to be changed on scroll wheel (up to speed up, down to slow down). Do I use serverrpc for this? How do I make the prediction?

#

Plus I won't be able to use the safe_bWantsToSprint to do the prediction since I'm not using a sprint key. Unless there's another way.

thin stratus
#

If you can't wait for 5.4 and the new mover2.0 stuff or you simply don't want to, then you will need to integrate it directly into the CMC.

#

You can specify a container for move data to send additional data to the server. I would suggest you send the multiplier from the scroll wheel via that and also save it in the saved move. Also clamp the multiplier on the server side so one can't send a higher value than you want

#

You might want to check the pinned repo for the CMC

#

The one from Vaei

sturdy sand
thin stratus
#

It might be easier to use yeah. Time will tell

grave lynx
#

Hey, I'm trying to spawn a niagara system in a multicast and set ownerNoSee to true, But it's working, maybe the owner is lost?
UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), MuzzleFlash, Location, Rotation)->SetOwnerNoSee(true);

thin stratus
#

You are better of checking IsLocallyControlled if that's not an option

grave lynx
thin stratus
#

Where is that Multicast called on?

grave lynx
thin stratus
#

Or add a helper ufnction to your BP_Gun that does that for you

grave lynx
#

I can also getplayepawn at index 0 and compare it with the owner

thin stratus
heady nacelle
#

Hi! I'm trying to replicate player movement through listen server and I have a problem with the movement looking jittery on the client. On the server everything looks good, on the client the client's player movement looks good but the server-player movement is jittery. I am using RPC events (Run on server and the Multicast) to replicate the movement. Does anyone know what I'm doing wrong? Concidering that the clients own player works fine it must only be the server's own player I'm replicating wrong? Would really appreciate the help! ๐Ÿ™

thin stratus
#

There is a lot more to replicated movement than 2 RPCs

#

Clients, if you want it to be predicted, yet authoritative, need to keep track of their moves.
Server needs to be able to send corrections. Clients need to be able to apply those an replay newer moves.
SimulatedProxies need to smooth locations.

And potentially much more.

#

That's why, up to 5.3, you are supposed to use the Character class with the CharacterMovementComponent (CMC), and you are required to extend the CMC in most cases via C++ if you need additional movement (such as Sprinting).

#

With 5.4, there is something coming called "Mover 2.0", which might make this all a bit easier

heady nacelle
thin stratus
#

If you need a controlled movable actor, that is smooth locally and somewhat smooth across the net, you are currently more or less forced to use the Character class

heady nacelle
viscid monolith
#

Hi! Im making a game, where each player has some points, that they can spend on purchasing items. These points should only be known to Owning Player and Server, nobody else. Currently these points are in PlayerState. Do I need this UPROPERTY to be Replicated? If it's not replicated, then is it known to Server or Owning Player?
If i just mark this UPROPERTY as Replicated, does it allow cheaters to see such values?

thin stratus
# viscid monolith Hi! Im making a game, where each player has some points, that they can spend on ...

To ensure the value is Authoritative, you would need to make sure the Server sets it, and that it's replicated. Even if only known to the local player.

Now, if you replicate the variable in the PlayerState, it will be known to others by default too.

You have two options:

  1. Move it to the PlayerController, as that doesn't exist on SimulatedProxies (other Clients).
  2. Mark the Replication Condition as Owner Only.
viscid monolith
#

Oh, i see. Thank you very much!

#

Is it set in GetLifetimeReplicatedProps? DOREPLIFETIME_CONDITION or something iirc

thin stratus
#

Yes

viscid monolith
#

Thanks!

viscid monolith
#

Who actually owns APlayerState? Is it owned by Server, associated Client, both?

#

I created RPC to add points, but not sure if it will actually change on Server and then replicate to only one Client

#

I guess maybe it's just easier to move it to APlayerController after all

thin stratus
#

@viscid monolith PlayerState is owned by the Client

#

So you can perform RPCs in it

#

But do you really think that RPC there makes sense to exist?

#

Your original post sounded like you don't want cheating to happen

#

What stops the owning client from call that function with a huge number

viscid monolith
#

Yeah, i just noticed, that only side that changes these points is a server

#

So yeah, it's stupid to make it an RPC

thin stratus
#

I do want to add though, that if that is your goal, then the Server needs to be a DedicatedServer.

#

And if it's a DedicatedServer, it has to be hosted away from the Clients, which means by you, using some backend.

viscid monolith
#

Yeah, or else host can cheat

thin stratus
#

That is very, very expensive. Just so you are aware

viscid monolith
#

Yep, i know it, but im just playing around with it to learn, not making any game right now

thin stratus
#

Alrighty!

viscid monolith
#

Thank you for the help, once again!

loud pike
#

Hey is this known that if the Server has less FPS than the Clients then the Line Traces done might not register ? I'm having an issue where when I play on my big computer and play as listen server then all my friends hit register but if she plays with a shitty pc as Listen server then none of my hits register ? or very rarely ?

#

any solutions or known issue ?

lucid badger
#

How are you performing the traces and communicating the results?

loud pike
lost inlet
#

well that's still missing a bunch of context

#

and I'm not sure how you're testing this. there's also a reason lag compensation exists in a bunch of games

warm shoal
#

guys idk why but i think i want to make a multiplayer game its hard??

lost inlet
#

of course it's hard

warm shoal
#

so single player is the best

loud pike
#

Starting to investigate

#

Wanted to know if it is something known

lost inlet
lost inlet
tender gale
#

I have a quick question about how IsLocallyControlled() works. Right now I'm trying to have some logic only run on the local/owning clients of an actor component. I have a function on the actor component to get the locally controlled player:

bool UTestComponent::IsLocallyControlled() const
{
    if (const ACharacter* character = Cast<ACharacter>(GetOwner());)
    {
        return character->IsLocallyControlled();
    }

    return false;
}

And then in the component's on begin play:

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

    if (IsLocallyControlled())
    {
        // Initialize client only logic (Client or Listen Server)
    }
}

If I debug it in PIE with 2 players and as a listen server, BP_Player_C_0 (ListenServer) triggers the initialize code for both components and BP_Player_C_1 (Client) doesn't trigger it at all

I'd expect the ListenServer to trigger its component initialization code once, and the Client to trigger its code once. Why would the ListenServer be returning true on IsLocallyControlled() for the other character's component, and not at all on the client?

lost inlet
#

this is where I would share debug.jpg

warm shoal
#

hey guys whats your opoinion about EOS Integration Kit

loud pike
tender gale
tender gale
torpid lantern
#

Can somebody help me understand the difference between "is dedicated server" and "has authority"? If I want server-side logic, which one should I be using?

thin stratus
# torpid lantern Can somebody help me understand the difference between "is dedicated server" and...

IsDedicatedServer would only ever return true if called on the DedicastedServer. So it's false for Clients and ListenServer.

HasAuthority is a bit more context dependent. On a Replicated Actor, HasAuthority would return True for the Server (Listen and Dedi), and False for the Clients.
However(!), if a Client spawns an Actor locally (for whatever reason), HasAuthority would return True for them, cause they have Authority over their locally spawned Actor.

torpid lantern
#

Wow, you explained that very well. Thank you!

thin stratus
#

--

Looking at Mover 2.0 atm, I gotta say that it looks a lot like one huge hell of structs in structs that have some structs for your structs.

quasi tide
thin stratus
#

Will take a bit getting used to. The actual MoverComp is simple enough, but that's just the tip of the iceberg atm

quasi tide
#

Does the movecomp inherit from one of the other move comps?

thin stratus
#

No, it's just an Actorcomp

quasi tide
#

lol

thin stratus
#

But that's the thing that is a bit tricky to understand at the start

#

Cause the MoverComp is just one of many things

#

It's not as centralized as the CMC

#

You have those Liaison Components

ruby lodge
#

Am I right in thinking that if you are going the dedicated server route you will probably need one for each continent if your game will be available there?

thin stratus
#

That kinda work as an inbetween

thin stratus
ruby lodge
quasi tide
#

So I guess they want to get rid of the entire current family of movement components

ruby lodge
#

Now, is it possible to mix listen server and dedicated server in one game? Like do dedicated server for some modes and for some listen servers? For example it could be competitive team deathmatch would be dedicated server but private matches with friends only listen servers

#

that would allow for more capacity probably

thin stratus
inner hearth
#

hi, does UChildActorComponent required some specific preferences for replication? I'm faced with problem when child actors not attaching to parent if I launch game in Client mode

quasi tide
thin stratus
#

They still heavily lean into Characters atm

#

At least in the examples

thin stratus
#

I would suggest just spawning regular Actors and attaching them

quasi tide
ruby lodge
thin stratus
#

Despite needing Source Engine to build them, there isn't much to them

#

They are just processes that you can show the log of with -log when starting

ruby lodge
#

Also about the code maybe. How to set it up correctly

thin stratus
#

When coding you just have to keep in mind that some stuff will run on a Dedicated server etc.

#

@quasi tide It seems to be an InputCollection though. My current thought ,without diving too deep into it, is that I want my own struct wit hthe sprint input added to that somehow

#

But that's where it starts getting hard to follow the code

ruby lodge
#

So anything you can recommend? I became very careful with learning new things from any youtuber because many teach bad coding behaviors which can be very harmful for a beginner in the longrun ๐Ÿ˜…

thin stratus
#

That's not really something I can write down here. It's a lot of stuff that more or less naturally makes sense

quasi tide
ruby lodge
thin stratus
#

E.g. if you spawn a VFX/SFX via a Multicast, you should filter the DediServer, stuff like that

#

Or if you support both, you gotta make sure you only filter the DediServer and not Auth/Server in generaly

quasi tide
ruby lodge
#

oh so it's not that much of a step from listen server to dedicated?

quasi tide
#

No, not really

ruby lodge
#

I am still in early development in my game so I only have a lobby one can connect to

#

no replicated game modes yet

quasi tide
#

Dedicated is pretty much just a listen server without visuals

ruby lodge
#

Yea, alright. Going to look sneakykittendev up regarding how to set up dedicated servers and stuff

#

thank you two for answering my questions!

glad robin
#

So I am having a networking issue with my golf game.

  • In UGACharacter class I have Server function to create an instance of UGABall.
  • I have a delegate in UGACharacter OnUGABallSpawned that is broadcast after I create it.
  • Now in the UGAPlayerController I subscribe to UGACharacter's OnUGABallSpawned to save that instance in the player controller (I need it to pass possession between the golfer and ball while it has been hit).

So after the server creates it the player controller gets a reference on the server player. But the client does not UNLESS I add a short delay (I just use timer to call broadcast function in 0.1s). Is there a better way to handle this? Like calling a BroadcastOnSpawnedDelegate() function after the SpawnActor() has finished or am I just stuck with the short delay on a timer?

thin stratus
#

I hope I will make sense of all of this. Maybe it's just a matter of "this is not the final product" sort of thing.

UWalkingMode::OnGenerateMove fills FGroundMoveParams (notably no option to override the filling part, and MaxSpeed is just pulled from a legacy config).

That calls ComputeControlledGroundMove with the GroundMoveParams, which is static...

In there we fill FComputeVelocityParams, seemingly duplicated data (+-), and call ComputeVelocity, again static... Code in there looks similar to CalcVelocity of the CMC.

Result velocity gets pushed into a FProposedMove back in the GroundMove function.

That, alongside other data, gets then returned back to OnGenerateMove and set as the OUT value.

Back in the MovementModeStateMachine (yes, that is a thing now), the new Move (let's ignore combining), gets added to FSimulationTickParams alongside other data.

And that ultimately gets pushed back into the Walking MovementMode, that originally executed OnGenerateMove, via UWalkingMode::OnSimulationTick, where it is then extracted from the TickParams to actually move the Owner.

#

While that is somewhat clear, I do wonder where I would be supposed to add a Sprint Logic, namely modifying MaxSpeed sigh

thin stratus
glad robin
#

Ah ok. I did that at one point last night but thought there might be a better way haha. I will go that way then Thanks!

quasi tide
pallid mesa
thin stratus
thin stratus
pallid mesa
#

how are you finding it eXi?

#

is it fun?

thin stratus
#

I want my CMC back

pallid mesa
#

hahahaha

thin stratus
#

static functions, and tons of Structs

pallid mesa
#

its based on Npp yeah... kinda expected ๐Ÿคฃ

thin stratus
#

Yeah but that part isn't even NPP related

pallid mesa
#

i think we will get new docus on how to do stuff with it

thin stratus
#

Why is the calc velocity function a static helper

pallid mesa
#

ah, i havent reached that yet XD

#

i was only exploring Snaps' movement system on raw Npp for starters

thin stratus
#

Yeah I will look into it more tomorrow. But the current assumption is that for sprinting I will need to override the whole GenerateMove function cause there is no speed getter that one can override.

#

I hope the base modes improve a lot. Otherwise I see myself just copying it all into a custom one and make it all more virtual, less static

pallid mesa
#

ah i see!

#

do they have crouch?

thin stratus
#

Don't think so

#

Only saw jump

pallid mesa
#

i c!

thin stratus
#

Also some bJustJumped Boolean, which looks redundant. But the input action is set to hold, so maybe the person was just battling that the triggered event called every frame while holding

#

Idk

#

So basically bPressedJump, and bJustPressedJump

hot estuary
#

Hey guys, just a quick general one, can you give me a quick overview of what mover 2.0 is?
I'm familiar with the original, but we have a new MMORPG in development, this would potentially make our lives 100x easier, if I'm reading right about mover 2.0? I remember in UE2 the mover in that is very bad, and there's actually a hard engine limit on the speed of updating each character's position on the screen

quasi tide
#

It's on the 5.4 branch.

hot estuary
#

Thanks, that's why I was asking, I'm currently doing other tasks so I don't really have the time to look into the code extensively

#

That's why I wanted a quick overview

quasi tide
#

The quickest overview you'll find is what is on UE's roadmap

hot estuary
#

I looked at that, it looked promising

#

just people have made multiplayer games in here before

quasi tide
#

Congrats - you know as much as 99.9% of people

hot estuary
#

got it then

#

I wouldn't be using most of the mover stuff anyway, would be impossible, we just say to the UE client, move to this location

#

then braodcast it to all clients in the area

#

custom backend, not using UE networking

#

just curious how "improved" it is when it comes to actually moving the characters smoothly and such

quasi tide
#

If you're doing an MMORPG, I'd imagine you'd already have that part figured out and solved.

hot estuary
#

original mover in UE4 requires some techniques to prevent jittering

hot estuary
#

but there's limits

#

mover 2.0 jumped out as something pretty cool and that could remove a lot unneeded code

#

that's really why I'm asking

pallid mesa
#

i dont get in depth, just a first impressions, i also provide some content on how to run it

hot estuary
#

now that's amazing, thank you vori

#

that's literally all I need

tiny pier
#

Trying to add a slide system but it doenst work on client. Crouching works fine despite being called in same function. Input called in Server & input calls this function which is NetMulticast

// net multicast, called from server function
void APlayerCharacter::HandleCrouch_Implementation()
{
    // Crouch
    if (bIsCrouching)
    {
        // Crouch
        Crouch();
    }
    else
    {
        // Uncrouch
        UnCrouch();

        // Reset slide
        CurrentSlideForce = SlideForce;
    }

    // Slide
    if (bIsSliding && bIsCrouched)
    {
        // Add Forward Force
        LaunchCharacter(SlideDirection, true, false); // Works on server, not on client

        // Add Counterforce
        CurrentSlideForce -= CounterSlideForce;

        // Disable movement when turning camera
        bUseControllerRotationYaw = false;

        // Disable jump force
        bIsAwaitingSlideJump = false;
    }
    else
    {
        // Unslide
        bCanMove = true;
        bUseControllerRotationYaw = true;
    }
}```
hot estuary
#

I do appreciate it

pallid mesa
#

:) glad it helps, there might be a follow up with a hands on likely soon, im still doing exploration

tiny pier
#

can show more code if needed

hot estuary
#

I'll follow your progress then ๐Ÿ™‚ we'll be in a position in about 3-5 months to decide on using the current mover or 2.0

pallid mesa
#

fortnite doesnt ship with mover 2.0 yet i blv

#

so cmc will be here to stay mid term

hot estuary
#

Ah, not a problem then ๐Ÿ™‚ looking at the end of your video too, the LERP looks great and is perfect too

#

Yeah, your video was a perfect overview thanks again