#multiplayer

1 messages ยท Page 585 of 1

graceful shard
#

but i've also replied to your post in general

#

I mean, it shouldn't be any more expensive to do than any other movement, since almost all movements in ue4 are already physics-based. Its not like you're somehow replicating the physics calculations, just the resulting velocity & locations

vocal cargo
#

I replied here because I thought my question was more multiplayer related, but I appreciate both answers. I have already put some work in a custom solution but found out about physics actor later on and seems more realistic

graceful shard
#

certainly not going to discourage you from trying out your own solution, but maybe at least give the built-in ones a try if you've hit a snag. And maybe ask in #legacy-physics because i dont know anything about physics constraints ๐Ÿ˜…

vocal cargo
#

Anyway I appreciate your help!

graceful shard
#

no problem!

#

Does anyone know a way to get replicated UProperties to retain their value if an actor suddenly becomes relevant? For example: An actor enters net relevancy range from outside it, the local client needs the values for all of that actor's replicated properties from the server, but they are not populating for me

#

I can't even find a good and concise way to phrase it to google. All my searches so far have not lead to anything relevant. So any suggestions there would be welcome too

vestal cobalt
#

hmmmm im sitting here thinking to myself loudly! i want a menu like "PUBG" where as when you open the game you are in "MainMenu" lobby? where you can just start inviting friends to your "Lobby" and then set som settings and then instead of searching for a game you would set the settings for the current "hosted game" that you are in from the start! how would that work exactly?

as stated i was thinking loudly to myself and i came up with that i would need

GM_MainMenu
PC_MainMenu
Level named MainMenu

that opens as default on startup, then in PC_MainMenu just set at Event BeginPlay -> Create Advanced Session -> On Success -> Open Level (Options = Listen)

so when the player opens the game he would've already hosted a game and is ready to just start inviting up to 3 mates (for a total of 4) to the already hosted game session and then change the sessions settings (map, mode and so on) and press play?

am i wrong about how todo this or would this be the way?

thin stratus
#

That's usually done with Beacons

#

They are a lightweight way of connecting players. You basically get the replication stuff from UE4 but you don't need to connect to and open a level

#

Not much documentation despite the Steam Party Plugin on the Marketplace though

vestal cobalt
#

duuude are you serious!!! that Steam Party thing is expensive ๐Ÿ˜

#

@thin stratus ooh wow, it's full of stuff!! i might actualy buy this!! it's EVERYTHING i need....

thin stratus
#

Of course it's "expensive"

#

It takes a lot of time to set this up yourself

bitter oriole
#

It costs about half a day of a programmer's work

#

If that ๐Ÿ˜›

thin stratus
#

What does it cost atm?

bitter oriole
#

$99

thin stratus
#

Hah, half a day. Good one

bitter oriole
#

Yeah it's more like 2 hours

#

But you know, interns !

thin stratus
#

Yeah I usually tell my clients to buy it instead of paying me to code it from scratch

#

It's not perfect but the time it takes to get there is a lot

#

I would say with all the problems and hoops to jump through, a week if unlucky. For someone not knowing how it all works, longer

#

Just to put the price into perspective @vestal cobalt

inner cove
#

I am guessing that the Client 1 isn't aware of something that Client 2 and server is.

#

Also, is there a reason that the shooting is a multicast? Just do it all on the server and then multicast to spawn the sound and the effects. @shut loom

inner cove
#

That's what I said, all the logic of the shooting must run on the server and then multicast only the particles and sounds.

twin vine
#

Where would be a good place to implement networking logic?

#

as in maintaining session functionality. A separate class and instantiate in a game mode, or maybe a game state object?

chrome bay
#

You typically would run the shooting on the client, then notify the server so it can verify and apply results

#

How you do that is up to you

balmy pike
#

Can you run multiple dedicated servers on one computer? I can see only one running server. The second server is running on a different port, but I see an error:

Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable

Solution: https://answers.unrealengine.com/questions/787258/view.html

tawdry wing
#

Hey, i'm still learning replication do some one can explain me, how to know where is the server and where is the client ?
i know we can use authority to do some logic but that is not that i want to know.

When we are on the player input we say that is client side right ?
but where i can know where is suppose to be the server side ? i'm a little confuse.

bitter oriole
#

@tawdry wing Basically, replicated Actors have their code running on the server (dedicated server hosted somewhere by you, or a player acting as server) and the clients (the other players)

#

Authority checks allow you to know where your code is being run

#

What is on server, what is not, is mostly up to you

#

Except creating, destroying or doing large changes to objects should be done on server

#

Usually, player input is handled locally, the client does stuff while telling the server about it, the server does the same stuff, and confirms with the client that the stuff was done

meager fable
#

I'm creating and joining a session like this using steam online services

#

when creating a session online there are no sessions found when either me or my friend create a session (both of us connected to steam using the same engine version)

#

when creating a session on line a session is found correctly but I don't travel to the map and get this in the logs

#
[2020.11.04-13.55.26:547][  8]LogNet: Warning: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.02, Real: 20.02, Good: 20.02, DriverTime: 20.05, Threshold: 20.00, [UNetConnection] RemoteAddr: 10.0.0.50:7777, Name: SteamNetConnection_0, Driver: PendingNetDriver SteamNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID
[2020.11.04-13.55.26:547][  8]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionTimeout, ErrorString = UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.02, Real: 20.02, Good: 20.02, DriverTime: 20.05, Threshold: 20.00, [UNetConnection] RemoteAddr: , Name: SteamNetConnection_0, Driver: PendingNetDriver SteamNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Driver = PendingNetDriver SteamNetDriver_0
[2020.11.04-13.55.26:548][  8]LogNet: Warning: Network Failure: PendingNetDriver[ConnectionTimeout]: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.02, Real: 20.02, Good: 20.02, DriverTime: 20.05, Threshold: 20.00, [UNetConnection] RemoteAddr: Name: SteamNetConnection_0, Driver: PendingNetDriver SteamNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID
[2020.11.04-13.55.26:548][  8]LogNet: NetworkFailure: ConnectionTimeout, Error: 'UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.02, Real: 20.02, Good: 20.02, DriverTime: 20.05, Threshold: 20.00, [UNetConnection] RemoteAddr:, Name: SteamNetConnection_0, Driver: PendingNetDriver SteamNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID'
[2020.11.04-13.55.26:548][  8]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr:Name: SteamNetConnection_0, Driver: PendingNetDriver SteamNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Channels: 2, Time: 2020.11.04-13.55.26
#

anyone encountered a simillar problem before?

tawdry wing
#

@bitter oriole thanks for your time. ๐Ÿ™‚

meager fable
#

incresing the no of found sessions results in:

[2020.11.04-14.50.49:066][923]LogBlueprintUserMessages: [BP_CVRT_PlayerCharacter_OCULUS_C_0] 1sessions found
[2020.11.04-14.50.49:066][923]LogOnlineSession: Warning: STEAM: Session (GameSession) already exists, can't join twice
[2020.11.04-14.50.49:066][923]LogBlueprintUserMessages: [BP_CVRT_PlayerCharacter_OCULUS_C_0] Failed to join session
[2020.11.04-14.50.49:066][923]LogBlueprintUserMessages: [BP_CVRT_PlayerCharacter_OCULUS_C_0] joining session
unique kelp
#

I am zero-ing a montage's blend time in the server before playing, and then playing that montage on clients too, somehow this blend value is getting back to the clients and they are not blending at all. I've checked the AnimMontage class, and there doesnt seem to be any replication, and as far as I'm aware if you send a packaged asset's pointer through an RPC it is not actually archiving anything, just sending the ID over. Any clue on what could be going on here?

chrome bay
#

@meager fable The player trying to join has already created or has a "Game" session, that's why it can't join

#

@unique kelp I would check to make sure the "zeroing" code isn't running on the client as well

#

It might be too early to determine roles etc.

twin juniper
#

Can I make an Actor stop replicating at runtime? I tried overriding IsNetRelevantFor but that doesn't seem to give me the results I want. I want two Clients close to eachother to replicate but not replicate to a client that's far. I also don't want to rely on Net Cull Distance.

white rock
#

I'm trying to make my first multiplayer. Where would you put server settings that should be replicated? Game State seems to get reset when I travel between levels

twin juniper
#

GameInstance if you want to preserve data.

white rock
#

GameInstance doesn't replicate though

twin juniper
#

right but you keep the data,

#

then replicate it later

unique kelp
#

@chrome bay It's done on BeginPlay, by which point roles should be fine. We already have a ton of authority checks and attaching the debugger to the client shows that it doesn't hit those parts. Thanks anyway

twin juniper
#

to the gamestate.

chrome bay
#

HasAuthority doesn't necessarily mean it's not running client-side still

unique kelp
#

for a replicated actor?

chrome bay
#

It depends but can also vary based on how early you're making that change

#

I would check GetWorld()->IsServer() to be sure

#

or IsNetMode(etc..)

unique kelp
#

Wouldn't hurt, fair enough, thanks

twin juniper
#

Jambax, do you know how I can stop an actor from replicating in the game mode? As in replicate to one client but not replicate to another client?

chrome bay
#

Well you can use IsNetRelevantFor so long as you aren't using replication graph

#

I assume you mean the pawn right?

#

not player states or something

twin juniper
#

Yes the character

#

But I'm not sure how IsNetRelevantFor works..

#

I tried it but can't seem to get the results I want.

chrome bay
#

If it's a distance-based thing, just use NetCullDistanceSquared

#

there's no reason not to

twin juniper
#

The issue with NetCullDistance is that I have other criteria as well.

unique kelp
#

Last I checked, net relevancy was checked on like 5 second intervals, so if it is time sensitive you will probably want to handle it on top of that

twin juniper
#

Like if Cleint A spawns an Actor but Client B is close to that actor but far from Client A.

#

Then it should still replicate.

unique kelp
#

not cull distance, but like the "IsNetRelevantFor" override

twin juniper
#

Yes but I'm just not sure how IsNetRelevantFor works.. I tried it and igves me weird results.

chrome bay
#

Well the Pawn is always going to be relevant to whoever controls it

twin juniper
#

What are the two arguments to isNetRElevantFor the two actors. What exactly do they mean?

#

Is it should Actor B replicate to Actor A?

chrome bay
#

No

#

RealViewer = the clients' player controller usually

#

ViewTarget = the view target of that players' controller

twin juniper
#

So RealViewer is themselves.. and ViewTarget is whatever they're viewing?

chrome bay
#

no

#

RealViewer = the client

#

So the client being considered for relevancy

#

ViewTarget is right though, is whatever that client is currently "viewing"

#

Just reading the comments btw

twin juniper
#

Yes I was looking at the doc it was just kind of confusing.

chrome bay
#

Meh ignores docs

twin juniper
#

Because when I override IsNetRelevantFor then check if distance between A and B is greater than 50, return false.

chrome bay
#

look at code

twin juniper
#

I also lose control of my actor.

chrome bay
#

Yeah that's not what it is

twin juniper
#

Yah

chrome bay
#

Just have a look at the default implementation

twin juniper
#

This is still a bit confusing because does that mean ViewTarget can also be themselves?

#

And okay.

chrome bay
#

it could be yeah

#

Actor relevancy is considered Per-Client, so RealViewer is always going to be that clients' player controller

#

ViewTarget could be anything

twin juniper
#

But what if the say the client isn't viewing another client..Does that mean IsNetRelevantFor wouldn't even get called on it?

chrome bay
#

no

#

The Server will iterate over all replicated actors for every connection

#

IsNetRelevantFor is only eval'd server-side

unique kelp
#

I think the viewtarget is meant to be the pawn

chrome bay
#

yeah usually it is

twin juniper
#

The pawn that's being viewed correct?

#

As in any connected pawn

unique kelp
#

the pawn that the real viewer is using

chrome bay
#

no

#

The pawn that the player is using as their "View Target"

#

View Target is often what the camera is attached to, or something like that. When you possess a pawn the server/client set the view target as that pawn.

#

And the player camera manager might choose to do something with that ViewTarget variable, or not

#

If you haven't set it to anything else, you can assume it's that connections' pawn

twin juniper
#

Okay so ViewTarget is that specific client for which the function is being called on.

chrome bay
#

no ๐Ÿ˜„

twin juniper
#

oh my gosh..

chrome bay
#

RealViewer is the player controller

twin juniper
#

I must be so dumb

chrome bay
#

ViewTarget is the pawn of that controller

#

usually

twin juniper
#

But that doesn't make sense though..Why would IsNetRelevantFor get two arguments one for the player controller and one for the pawn.

chrome bay
#

It's for convenience, the controller doesn't usually have a transform or any physical presence in the world

#

And to evaluate distances it uses the view target

#

E.g, the player controller could be at world origin, whereas the pawn it controls could be 2km away

twin juniper
#

So what exactly is the purpose of the function IsNetRelevantFor.. maybe I'm misunderstanding it.

chrome bay
#

To determine whether this is Net-Relevant for RealViewer

twin juniper
#

So to determine if it should replicate Client A to client B assuming A is overriding IsNetRElevantFor, I would need to grab this->GetLocation and RealViewer->GetLocation.. ?

chrome bay
#

Yeah

#

which is what the default does

#

return IsWithinNetRelevancyDistance(SrcLocation);

#

aka return FVector::DistSquared(SrcLocation, GetActorLocation()) < NetCullDistanceSquared;

twin juniper
#

Okay so if there is an instance of This->PlayerController == RealViewTarget , then I would always return the Super::IsNetRelevantFor?

#

Because I imagine it does get called on itself too..?

chrome bay
#

I don't understand what you mean

#

IsNetRelevantFor is called once on every actor. Not on every actor for every other actor

twin juniper
#

So it's either they are relevant or they aren't relevant.. There's no deciding if they are relevant to Client A or Client B?

#

Like let's say I want Client A to be relevant to Client B but not relevant to Client C

chrome bay
#

Psuedo code:

for (UNetConnection* Connection : AllClientConnections)
{
    for (AActor* Actor : EveryActorInTheLevel)
    {
        if (Actor->IsNetRelevantFor(Connection->Controller, Connection->Controller->ViewTarget, SomeLocation)
        {
            Connection->Replicate(Actor);    
        }
    }
}
#

That's what the Server does

#

ViewTarget and SrcLocation are just convenience parameters

#

I would just look at the default implementation

#

It's very self-explanatory

twin juniper
#

@chrome bay What doesn't make sense though is why does returning false on IsNetRElevantFor make my client uncontrollable

#

It essentially makes my character's pawn immobile

unique kelp
#

are you just returning false for the pawn?

twin juniper
#

I'm not sure what you maen by returning false for that pawn.

unique kelp
#

I'm not sure what you mean by returning false on IsNetRelevantFor

twin juniper
#

 return false;
}
#

Would make the client unplayable

#

and freeze up

unique kelp
#

of course

#

well, I would expect your own pawn to disappear, in any case

twin juniper
#

Yes

#

So should a check be done if this != A ?

#

I think I get it now. So what i need to do is everytime IsnetRelevantFor is called.

#

I need to iterate between my own connected actors.

#

And decide from there if it should return true or fallse..

#

@chrome bay is that correct?

unique kelp
#

iterate?

twin juniper
#

yes.

unique kelp
#

every time it is called, the server is just asking, "should this controller be able to see you?"

#

you just need to run whichever logic decides that for your case

twin juniper
#

Well what I want is a case like this, Client A can see client B but not client C.

#

likewise Client C can see client B but not client A

#

So client B and C and see eachother

#

But not C and A

#

Is that possible with IsnetRelevantFor override?

unique kelp
#

then you need to identify somehow if the pawn that is overriding this function belongs to client A/B/C, and likewise if the controller that is passed in as a parameter belongs to client A/B/C

twin juniper
#

Can youg ive me the pseudo code of how it might look?

unique kelp
#
{
    return (IsPawnA() && RealViewer->IsControllerB() ||  ....... );
}```
#

the logic inside there depends on what you want to do though

#

probably put it in a separate function

#

obviously RealViewer wont have a "IsControllerB" function

twin juniper
#

What is IsPawnA is that the pawn for ClientA?

unique kelp
#

but if you cast it to your controller type, or get the pawn for that controller and do that

#

It just means that this object is already the pawn you are interested in, so it would have a variable or a member function that you can use to check if we are A, B or C

twin juniper
#

So IsPawnA is this but checking if it's A B or C like this->IsClientA for example.

unique kelp
#

I personally hate using "this", but yes, essentially

#

probably better to check it with flags, but this gets the point accross

twin juniper
#

IsPawnA() && RealViewer->IsControllerB() If this->IsPawnA && RealViewer->IsControllerB meaning ClientA && ClientB?

unique kelp
#

yup

twin juniper
#

Okay so let me write out what it would look like if it was based on distance and you can tell me if it's correct?

unique kelp
#

assuming your view targets are the pawns directly, you can also cast the viewtarget to your pawn type and do the same as you do with this, but with that other pointer

twin juniper
#

Yes they are Pawns.

#

@unique kelp In this example does this mean Client A is replicating to B but not C

{

    return (IsPawnA() && RealViewer->IsControllerB() || 
            IsPawnA() && !RealViewer->IsControllerC()
    );
}```
#

Or let's say I flat out wanted it to replicate to every client except Client C.

{
    return (IsPawnA() && !RealViewer->IsControllerC());
}```
#

Is that correct?

unique kelp
#

sure

twin juniper
#

I think it's all making sense...slowly..

#

I think it would have made it simpler if this function could just be overridden in the game mode, with two arguments passed Controller A and Controller B , iterating every controller of connected clients.

unique kelp
#

It's not for controllers, though

twin juniper
#

But maybe I'm just dumb..

unique kelp
#

controllers are just replicated to their owner

twin juniper
#

Okay , i'll try some things with my new found knowledge and see how it goes!

unique kelp
#

feel free to redirect these checks to the gamemode and write your own function there though

twin juniper
#

So override the actor's IsNetRelevantFor in the gamemode?

unique kelp
#

no

#
bool IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const
{
    MyGameMode *gameMode = Cast<MyGameMode>(GetWorld()->GetAuthGameMode());
    return gameMode->AreActorsRelevant(this, ViewTarget);
}
twin juniper
#

Oh okay like that.

#

Yes that might help too!

#

Alright thank you so much and Jambax for all the help and description!!

#

I greatly appreciate it.

#

I'll try somethings with this now.

unique kelp
#

glhf

rich ridge
#

Hi

#

I m getting NPE PlayerState->GetUniqueId()

#

for unique net id

#

if i try to play in PIE

#

the reason is OSS and login not called.

#

so any work around?

#

Every time I want to test, i don't want to do auth via OSS (which consumes a lot of development time)

#

If i do using OSS and Login gets called, i don't get NPE.

twin juniper
#

@unique kelp @chrome bay Thank you both so much for that explanation I think I got it all figured out now!

twin juniper
#

How do I destroy a client's pawn from my game world ?

#

When it stops replicating the character just freezes.

#

I want to remove it.

#

Do I call destroy on the character or the character's player controller?

empty axle
#

Destroy on the character

twin juniper
#

Do I use true for bNetForce?

#

If it's the client destroying them off their view.

#

I'ms ending an RPC to the client to destroy the actor off their game.

empty axle
#

bNetForce guards the destroy call so it will succeed only if you have authority over that actor.
In a multiplayer game you should have bNetForce to true and for characters, as they are likely replicated, call a destroy on the server and it should auto destroy on every client.

twin juniper
#

Oh but I don't want it being destroyed for everyone. Just actors who are far distance from it.

#

To actors who are close to it, they should still be able to see it.

#

Why is why I'm destroying them on the client.

#

And not on the server.

#

Or maybe I shouldn't destroy it?

#

Just hide it.

#

And unhide it later?

#

Yes I think that would be better.

empty axle
#

It sounds like you are trying to achieve the same thing that relevancy distance for replication is for. Don't you want to use it?

twin juniper
#

Yes but that doesn't actuall yhide the actor off the screen

#

Once they are no longer replicated.

#

It just leaves them there..

#

Like if I use NetCullDistance and they go beyond that.

#

The character still appears ont he client even though it's not replicating.

#

I just want to get rid of them off the screen.

empty axle
#

I think that actor should be auto destroyed after few seconds automatically if he is outside of the relevancy

twin juniper
#

It doesn't though.

#

It stays on there until they become relevant again

#

Unless I'm doing something wrong..

#

But to me they just stay there lol.

#

I think I can just hide them though.

empty axle
#

let me test that, because that sounds weird

twin juniper
#

Yes thank you.

#

I'm testing with ThirdPersonExample

#

But with networking on.

#

Using OSS

quick flint
#

Anyone have any idea why my velocity would work when im moving forwards X = 1, but when X = -1 it wouldnt move backwards?

empty axle
#

@twin juniper confirming. For actor spawned at runtime the actor is spawned and destroyed automatically whenever I jump in and out of relevancy after few seconds.
The difference is if the actor is already placed in the level then it won't be autodestroyed whenever I walk out from relevancy, but it won't replicate anymore.

twin juniper
#

Yes..

#

So what do I do about that actor

#

that's already placed in the level

sand crescent
#

hey guys i want to work on eos and i want to get started how would i get started

twin juniper
#

I actually tried RPCing to the client to hide it and the client ended up hiding themselves..

#

lol

graceful shard
#

So anyone know why the engine devs decided not to call OnRep_PlayerState on the server when PlayerState is updated?

bitter oriole
#

OnRep events are never called on server

graceful shard
#

i know, they need to be called manually. Usually the convention is to call it after altering the variable but the engine doesnt do that

bitter oriole
#

No, it is not a convention

graceful shard
#

why wouldn't it be? They're mimicking repnotifies in blueprints, which are called on server and client automatically

#

what have I misunderstood?

bitter oriole
#

There is nothing to misunderstand, Blueprint designers simply decided to have repnotifies fire on server too, when Blueprint was implemented a decade after C++ repnotifies

#

The UE4 gameplay framework mostly predates Blueprint

#

In C++, these events are client only

#

As they should be, imho

graceful shard
#

why wouldn't a server want to (optionally) react to when a variable changes?

bitter oriole
#

Because the server is changing the variables, so you just call the stuff you'd like to if you also want it on server

#

It's usually not the case, though

#

Especially on a dedicated server

graceful shard
#

well I could call the stuff I'd like to if the change occurred in my game's code, but some variables with OnRep functions like playerstate are changed in enginecode. So there's no opportunity to call the stuff I'd like to on the server when i changes without altering the engine to match what seems like a reasonable consistency

#

if I was the one changing these variables, I could call OnRep, but since I'm not I have to rely on the convention of calling OnRep serverside, but for playerstate they dont

bitter oriole
#

Why would you want to override that specific event anyway ? PlayerState should be changed literally once

graceful shard
#

its changed during possession and unpossession, which can happen any number of times depending on the game

#

thonk good point though, maybe do it during possession

bitter oriole
#

Ah, that's in the Pawn class I guess

#

In this case you have possession events

#

And you can likely easily extend the code changing PlayerState

graceful shard
#

yeah, I think that will work for this case. Its still seems odd to me for engine code to not call OnReps on server for variables they're changing and let the gamecode decide whether to do anything there, but at least I have something to work with

#

thanks Stranger

#

ShooterGame's ShooterCharacter even has this in PossessedBy
// [server] as soon as PlayerState is assigned, set team colors of this pawn for local player
so yeah, guess that's where they expect reaction logic to be donelul

grizzled stirrup
#

Is it perfectly fine to call ForceNetUpdate() say 10 times a second?

#

I have a case where I normally need a very low net update frequency but in specific moments need data to be passed down ASAP which I use ForceNetUpdate for

#

Is it fine to be called 10 times a second (would it be the equivalent of just having a net update freq of 10?) or would it be better to just set the net update frequency to a higher value for those periods?

#

Speaking of, does anyone set their player state net update frequency higher than the default 1 time per second?

chrome bay
#

yeah it's fine to do that

#

If you're using rep graph you can't change the frequency at all anyway

grizzled stirrup
#

Great thanks

#

OnRep events are never called on server
@bitter oriole I do it a lot for my listen server when I need both the server and client to do the same thing after a variable changes and don't want to create another unique function for it

#

Is this bad?

#

I would have a lot of very simple extra functions if it's bad to call OnRep functions on listen servers

bitter oriole
#

No one said it was bad

grizzled stirrup
#

OnRep events are never called on server

bitter oriole
#

That's just a fact

grizzled stirrup
#

As in never automatically did you mean?

bitter oriole
#

As in they are never called by the engine

grizzled stirrup
#

Ah right yeah that makes sense

#

But fine to do manually yourself if needed

bitter oriole
#

You can decide to call OnRep_XXX yourself if you think that makes sense

grizzled stirrup
#

Great thanks

bitter oriole
#

Personally I don't, but hey

grizzled stirrup
#

I could make loads of simple functions to be fully correct

#

But would just bloat and make things harder to read

#
void OnRep_Impact()
{
  PlayFX():
}

where PlayFX(); contains one line

#

Yes I could call PlayFX() on server and PlayFX() from the OnRep but in some cases it's a little simpler to just call directly

#

Probably just preference

#

If the common function being called is only calling one line itself then it feels like I'm adding more clutter than necessary

bitter oriole
#

Personally I would rather repeat the line that have OnRep functions, which are ostensibly client-only by design, run on server

#

But yeah, opinions

grizzled stirrup
#

It makes more sense thinking about it

#

Especially if moving to dedicated in the future- less headache

#

Makes no sense to call Onrep there of course

#

Good to know and something I should probably improve

bitter oriole
#

I mean basically imagine you're diving back into your codebase one year after working on it and half OnRep methods are also called manually on the server

grizzled stirrup
#

Yep that's a nightmare

#

Good point

quick flint
#

do i have a complete misunderstanding of replicated variables?

#

i thought that if the server sets the value,t he value is automatically replicated to clients

#

is that not true?

sand crescent
#

is anyone here good with steam matchmaking

#

if so can you help me with something

quick flint
#

@sand crescent ive used it extensively

sand crescent
#

@quick flint can you help me with adding lobbies and having teams

#

im making a br and mp game

quick flint
#

don't really have the time right now sadly

#

maybe tomorrow

sand crescent
#

alright thats fine

#

@quick flint all my code is already networked all of my code its just the matchmaking right now

quick flint
#

if u want to message me tomorrow after work

#

i can take a look if u want

sand crescent
#

alright you can message me tommorow

steel vault
#

@quick flint you are correct. Replicated variables are changed on the server and then automatically replicated to clients

summer tide
#

So I updated the defaultengine.ini with the steam online subsytem snippet. but when I start my project in Standalone. I don't see the steam message. I also enabled the plugin.

ruby rock
#

Hey All - I've built my system and have multiple clients connecting to a listen server on my PC - "all good". What are the next steps to try this with a friend? Can we just share the code and run UE and he connects as a client to my server? Or do I need to package, etc?

quick flint
#

Is there a way to have input run on the server and the client

#

For functions like this

timid moss
#

Hey guys I realize this post is sort of lengthy but was hoping someone out there knows a solution to my current situation. I'm fooling around with the CMC right now and I realize most people do this in UpdateFromCompressedFlags.......```
void USSCharacterMovementComponent::UpdateFromCompressedFlags(uint8 Flags)
{
Super::UpdateFromCompressedFlags(Flags);

// Update this CMC with the info stored in the compressed flags
bWantsToRun = (Flags & FLAG_WantsToRun) != 0;

} So my question is is it okay to skip this step and manually manage bWantsToRun outside of this function? So UpdateFromCompressedFlags(uint8 Flags) would be empty like this......
void USSCharacterMovementComponent::UpdateFromCompressedFlags(uint8 Flags)
{
Super::UpdateFromCompressedFlags(Flags);

}```and I would instead manage setting bWantsToRun outside this function. The reason I want to avoid letting UpdateFromCompressedFlags(uint8 Flags) handle setting the bool is because UpdateFromCompressedFlags(uint8 Flags) essentially just listens to what the client wants and proceeds to copy its value without any gameplay checks (ie. the player is out of stamina on the server). So basically I'm trying to achieve having the client and the server run their own simulations based on if the player can run or not on their side because I don't want the client always being able to tell the server to run.

vivid prawn
#

Hi Guys, I have issue with replicating the Projectile

#

even though I run the projectile on client and server side

clever plinth
#

Wow itโ€™s just unsolved questions after unsolved question

#

@quick flint you can do some replication variable tricks where you set a variable after every time the input delegate is called

balmy pike
#

How can I track that a new player has joined the session? To update list of players in session. in OnlineSubSystemSteam

clever plinth
#

@timid moss I know the guys at Flopperam were testing that out so u might be able to get some help on their discord server

#

@balmy pike postlogin in the game mode

#

Hey All - I've built my system and have multiple clients connecting to a listen server on my PC - "all good". What are the next steps to try this with a friend? Can we just share the code and run UE and he connects as a client to my server? Or do I need to package, etc?
@ruby rock you can use some sort of online subsystem to create a lobby system

balmy pike
#

@balmy pike postlogin in the game mode
@clever plinth oh, thx

clever plinth
#

@balmy pike np ๐Ÿ˜‰

timid moss
#

@clever plinth Was it recent? Trying to find where they were talking about it

#

also thx a lot btw didn't think anyone would answer that ๐Ÿ˜†

clever plinth
#

np, Iโ€™ve been in situations where my questions are ignored and it really sucks

#

@timid moss if u join their server they should be able to guide u in the right direction?

#

I think that old stream was already deleted due to the 14 day limit

ruby rock
#

@clever plinth - yep have done that, I think I've found what I was chasing. I need to package the build, I can't test from 2 UE engines.

glad sedge
#

Dominate performance here by Aphix.

clever plinth
#

xD

glad sedge
#

Aphix i'm very rusty on multi, and reading through Exi's great compendium is good. But trying to remember something

#

So, if I run something on the server, the server knows about it. That's fine. If I want all clients to know what's up, that's a net multi

#

And onRep notify is just a function that plays on the client when the server replicates something?

heady python
#

Does the steam 'Advanced sessions plugin' work in a packaged game? I heard from a friend that its a plugin only for testing purposes and doesnt work in real games and before I make my matchmaking system I want to know if this plugin will work when my games on steam.

bitter oriole
#

Yes

#

It's largely used in production

heady python
#

Awesome, thank you @bitter oriole

royal rampart
#

Hi, i had a fully working function that was replicated (reliable), but now that I set it to unreliable, it doesnt work properly anymore, is that normal?

#

because I was told that reliable functions are harder for the server so I wanted to optimise it a bit

meager fable
#

reliable means that if the server has a lot of things to execute it will add your function to the queue, unreliable means it will skip it

chrome bay
#

Unreliable is as the name suggests unreliable - it will be dropped in times of high network use / when connection is saturated

#

If that RPC must go through, it should be reliable. You can use insights / network profiler to figure out why the connection is saturated in the first place

#

From there you can figure out what needs optimisation

royal rampart
#

insights / network profiler

royal rampart
#

oooeeh thanks man, you're a legend ๐Ÿ˜—

#

that makes so much more sense now

chrome bay
#

Without using those first you're pretty much blind otherwise

royal rampart
#

so i have to use both?

chrome bay
#

not neccesarily

#

profiler is probably the easiest one to find obvious issues in

royal rampart
#

okay okay thanks ๐Ÿ™‚

potent cradle
#

Does anyone know if net cull squared distance is not editable through blueprints? Can't seem to find the setter, probably locked off?

thin stratus
#

It's usually something you set up in the defaults

chrome bay
#

Can't set it at runtime in BP

potent cradle
#

Yeah, I have a usecase to set it at runtime Cedric :\

#

I see Jambax, hmmm

#

Maybe I could make a C++ function library that I can pass an actor into?

chrome bay
#

You could but tbh you don't usually change it at runtime

potent cradle
#

A lot of my actors have wildly varying render distances and tick ranges, that I handle through an actor component. I want to more closely align the replication range with those, so that I don't end up with actors stuck in the air, not replicating but still visible

#

That sort of thing

#

Don't really want to break out my calculator each time to manually swap that out

twin vine
twin juniper
#

@twin vine "UnrealNetwork.h" is now "Net/UnrealNetwork.h", not sure about "Online.h"

twin vine
#

Thanks @twin juniper I'll update here if I find the loc

#

After including the online modules in GameName.Build.cs, generating vs files from the .uproject file let's me to #include "Online.h"

#

But it doesn't find the file itself for me to review

#

So the project builds and runs but I can't see the file.

#

"Net/UnrealNetwork.h" is fine.

balmy pike
#

@twin vine use #include "OnlineSubsystemUtils.h"

twin juniper
#

Would be nice if UE had patch notes for issues like that.

twin vine
#

@balmy pike I have that in Public Dependency Modules as well

#

Interesting thing is that VS does not complain about the non-existence of the file, but it doesn't go to it.

#

^ while building*

twin juniper
#

Why is it when I try to hide another player's pawn on a client..the client ends up hiding themselves...

#

I call Actor->SetIsHidden and SetCollisionEnabled

#

@empty axle When you had checked the character being removed from view after they stepped out of net cull distance. Had you tried removing them from the view manually when they were already in game and not spawned?

thin stratus
#

IsHidden is replicate iirc

#

So if you set that on server side, you'd set it for all players (on that actor)

twin juniper
#

But I'm telling the client to execute it.

#

Through a Client RPC

#

BUt when I tell that client to hide a specific actor, they end up hdiing themselves..which is a bit strange.

#

As in I tell Client A to hide Client B.

#

But Client A ends up hiding Client A..

thin stratus
#

How are you referencing them?

#

Sounds like you use GetPlayerController/Character

quick flint
#

How can I limit the amount of times the server has to do position correction

#

When I jump the server corrects it

winged badger
#

that would probably be because your brute force jump is not predicted

quick flint
#

how do we set up 'prediction'

twin juniper
#

@thin stratus through overriding isnetrelevantfor the pawn that's passed into the function when I pass onto the client that I want it to hide

winged badger
#

you need to push the jump through the CMC

quick flint
#

how do i do that?

twin juniper
#

but prior to that I also check if (viewtarget==this) to make sure they aren't doing it to their own pawn

winged badger
#

thing is, when you move with CMC

quick flint
#

I'm just using ACharacter::Launch

winged badger
#

you create SavedMoves

#

when client receives a server update for position

#

it replays all the SavedMoves it has since the time the correction was sent

#

and if the locations match after that

#

its fine

#

your launch character doesn't account for that

thin stratus
#

@twin juniper Isn't IsNetRelevantFor already causing replication to end and the actor to be destroyed if you return false? Why the hiding?

quick flint
#

hmmm

twin juniper
#

@thin stratus that's the problem though, they aren't causing the actor to be destroyed.

quick flint
#

Sounds like a long process @winged badger

twin juniper
#

Apparently if the actor is already in the game world before the client connects.

quick flint
#

Is this the outline of it basically?

#

And how it works

twin juniper
#

Then they won't autuomatically be destroyed.

thin stratus
#

Ah, so it's not just a Character, it's a some random actor

#

Maybe set the "netLoadOnClient" to false? or whatever that is called

winged badger
#

that is not a detailed explanation ๐Ÿ˜„

#

CMC has ~13k lines of code

twin juniper
#

On al the characters?

quick flint
#

Yeah I know

#

But this webpage goes over how the system works essentially

thin stratus
#

@twin juniper Not sure, I honestly would expect them to be destroyed

#

But your issue is that you are hiding the wrong one. I would start logging some object names and see what's happening

winged badger
#

i haven't had to integrate the extra movement form through CMC to date

bronze arch
#

Does anyone get that error?
Assertion failed: NetGUID.IsDynamic() [File:D:/Build/ UE4/Sync/Engine/Source/Runtime/Engine/Private/PackageMapClient.cpp] [Line: 2630]

twin juniper
#

yes someone else had tested this yesterday too and they said when the client is already in the level before the other client joins.

winged badger
#

so can't tell you how off the top of my head

twin juniper
#

Then that client will not be destroyed.

#

For some reason.

bronze arch
#

I searched about isdynamic. didnt help, have no sources

#

all about steam

winged badger
#

how did you manage that?

#

@bronze arch

bronze arch
#

When spawned a component to everyone, and triggering component inside

winged badger
#

it means it expects a dynamic (Spawned at runtime NetGUID) and its getting static (Loaded from Package/Level)

#

the last bit in NetGUID signifies static/dynamic

bronze arch
#

so objects doesnt support netguids?

#

im making a item passive like lol game with components,

#

fires trigger when a health below %30 but then its crashed even reference is valid

winged badger
#

they support them just fine

#

but if you're spawning them on every client separately

#

they should not be replicated

bronze arch
#

i know they're not replicated. but i wanted just fire a node from server to checking

#

oh well wait maybe i found solution leme try it

winged badger
#

not talking about variable holding a reference being replicated

#

talking about the object itself

twin juniper
#

@thin stratus wait this is just a thought but I think I might know the issue. When tellling the client to hide an actor I shouldn't pass its pointer to that client..

#

Because that client could have another value at that pointer..

bronze arch
#

does enable component replication helps?

thin stratus
#

You are spawning a Component In BP that is marked as Replicated?

bronze arch
#

No i was trying spawn them on every client seperately. since only server check and when it pass, then spawn effect to everyone

#

now im trying with enable component replication and spawning from server

#

well yeah it worked anyway.
(why i did seperate Components without replication:: guess network performance? because that component counts may high due to every items have passive)
it seem has limitation for without replication

quick flint
#

does anyone know

#

how expensive it is to call an RPC on tick

#

the RPC only sets one float value and that's it

#

it doesn't do anything else lol

#

and my tick interval is set to 0.1

bronze arch
#

oh wait what.... components have no ticking like netfreq? i profiled(network profiler) it with 1000 components spawn, only shows that rpc fires. have no info about components yikes...
so we sure that will not impact network performance with 1000 players x 1000 components?

chrome bay
#

@quick flint If you must send it regularly, at least make it unreliable

#

Though to be honest, it's probably better to find a different solution that doesn't involve sending a value that way if possible

#

@bronze arch components are replicated via the owning actor, so they adopt all frequency/relevancy properties from the actor

twin vine
#

Replicating with a function would fit better as far as I get from your description @quick flint

#

replicating the float property*

quick flint
#

Though to be honest, it's probably better to find a different solution that doesn't involve sending a value that way if possible
@chrome bay we couldnt think of any tbh, because its dependent on the player input

bronze arch
#

@bronze arch components are replicated via the owning actor, so they adopt all frequency/relevancy properties from the actor
@chrome bay
But then why it doesnt show in netprofiler?

chrome bay
#

@bronze arch If it's not replicated as you said, then it won't show in the network profiler

bronze arch
#

Its replicated, since it doesnt support unreplicated netguid.isdynamic crash

#

I ticked replicated component, the outer reference is player character

chrome bay
#

Maybe it has nothing to replicate?

bronze arch
#

U mean variable replications?

chrome bay
#

@quick flint yeah that's fair enough if it's sending input. I would at least make it "unreliable" then in that case

#

Maybe try to avoid sending duplicates if you know the server already has the latest value, or send at a lower rate

quick flint
#

basically we are replicating a float "KeyTimeDown"

#

well I lowered the tick interval

#

to be 0.1

#

so it should only send 10 ticks a second

#

for this component

#

@chrome bay

chrome bay
#

Right, I guess you would only send it if the key was indeed down at all

#

Not sure though

#

@bronze arch Right - if the variables aren't changing, then it won't have any cost

#

Apart from the initial cost to create the component (if created at runtime), and any initial replicated variables

bronze arch
#

@bronze arch Right - if the variables aren't changing, then it won't have any cost
@chrome bay im only use one multicast rpc for effect if passes something from server
never use variable replicates in components since it replicated already in player character(like hp, mp, level)
so this will no cost except spawning and rpcs? does it saves net performance like non-replicated?

chrome bay
#

Well, there is some inherent overhead because it's an extra replicated object to keep track of for changes etc (components also have some default properties that are replicated)

#

component properties/rpc's are also slightly more costly then actor properties/rpc's because of the extra header required

#

But that's not something you should typically worry about

#

Unless you have lots of those components sending lots of RPC's constantly, like character movement does.

bronze arch
#

nah, not constantly, it have cooldown to fire. even CD is done, it need to check requires like if player get damage below %30 hp. then it activates CD and effect same time.

chrome bay
#

ultimately the network profiler just shows you what's being sent, that's it really

bronze arch
#

yeah as far as i see, it not much cost like a normal actor replication

chrome bay
#

it might show up within the actors' properties but i can't remember

bronze arch
#

(test project ofc)

#

(sorry for that bad naming rpcs xD

steep flame
#

So simulated proxies doesn't update regularly right? They don't update when there not in the players view right? Because I have an Cloth stretching bug in Multiplayer.
From the last seen position (when we turn around from that client and that other client moves away) to the newly seen position of the other client (when we turn around again and see the other client again).

How can I avoid that stretching bug?

bronze arch
#

Anyway thank you all who helped me. Have a nice day everyone! xNoiraHeya

twin vine
#

I'm learning Online Subsystem features and I wonder if there is a comprehensive example / tutorial for managing sessions. Do you know of any?

quick flint
#

how am i supposed to use this

#

how do i know if i have potential network issues

#

so i can fix t hem before they become an issue

chrome bay
#

it's not that useful really tbh

#

net profiler is more useful

quick flint
#

i want to do some sort of regular check

#

for potential network issues

#

in our code base

#

how would you suggest that?

#

what should i be looking for

#

I just want to try and catch any potential issues early on in development @chrome bay

#

i just dont know whats expensive and what isnt

chrome bay
#

same as anything really just package and test/profile often

#

test with packet loss and lag etc too

#

outside of editor in a "real" environment

grizzled stirrup
#

If you have an on rep property in the character but want part of the on rep function to run only on the owning player's machine, is IsLocallyControlled() the correct way to gate that?

#

Looks to be the case, just sanity checking

sand crescent
#

Hey I want to start making my game around eos because i started a little bit with oss matchmaking but it didnt have all i wanted i have seen the sdk and the docs can someone please help me with starting and how to get it setup all my code is already networked i wanna add matchmaking and lobbies

arctic willow
#

If you have an on rep property in the character but want part of the on rep function to run only on the owning player's machine, is IsLocallyControlled() the correct way to gate that?
@grizzled stirrup jop, correct

vivid prawn
#

@quick flint you can simulate lag or specify limited internet speed to see how your code runs

#

In your project [PROJECT]/Config/DefaultEngine.ini you can add ConfiguredInternetSpeed, ConfiguredLanSpeed, PktIncomingLagMin, PktLag, etc. to simulate specific settings, and watch your code.

twin juniper
#

Where does the client store a list of replicated actors/pawns in the level?

bitter oriole
#

Nowhere really, there's a list of actors and some of them happen to be replicated

quick flint
#

lol @vivid prawn when i set my packet loss to be 500, it looks like i dont even jump

#

PktLag i mean

#

@chrome bay

vivid prawn
#

well, 500 is pretty high! LOL... but, that's how you check your Server/Client performance ๐Ÿ˜„

quick flint
#

@vivid prawn yeah, 500 is if i tried to connect to a server in China or something

#

from north america

vivid prawn
#

Hehehe... yeah, then I guess that's why there are servers around the world.

rich ridge
#

Guys I m facing a wierd problem, if I spawn a collision box on server the overlap events are generated, but when i attach the same collision box as sword to pawns, the overlap events are not getting generated?

#

After choosing this option the events started to generate, so I m curious why it isn't enabled by default.

#

Does it have some bugs?

twin juniper
#

What is the bNetForce argument on DestroyActor?

kindred widget
#

@shut loom Print something on the false of that IsValid. If the print isn't firing with that small change, it's because that pointer isn't valid.

empty axle
#

@twin juniper if it is set to false it won't let you destroy the actor if you don't have Authority role on it. So it protects from destroying actors from a client if it is replicating. If you set it to true then you will be able to destroy actor on a client side even if it is replicating.

twin juniper
#

ah okay

#

Im having this strange issue now where I have a variable thats replicated and I destroy it on the server but it doesn't destroy on the server or the client. I'm calling UWorld->DestroyActor

#

I'm also checking if the pointer is valid.

#

The pointer gets overwritten eachtime an object is spawned. But before the spawning occurs.

#

I check if pointer is valid, if it is, I destroy it, then call spawn.

#

But it seems the destruction is not occurring,

empty axle
#

You could check the return value from DestroyActor

twin juniper
#

Alright I'll do that now.

dawn nova
#

Hey guys, I have a question about ReplicationGraph, I don't completely understand the method PreAllocateRepList(ListSize, AmountOfLists), based on what do I decide what the list size should be and the amount of lists?

twin juniper
#

Yes I found the issue. I was destroying it in the wrong location

bitter oriole
#

@tulip ferry By default, there is basically a full multiplayer stack for character-based games (first-person, third person shooter, etc)

quick flint
#

@meager spade i ended up getting it all working btw

quartz smelt
#

Is there a reason why the host widget UI only updates once? Client UI updates correctly

clever plinth
#

And onRep notify is just a function that plays on the client when the server replicates something?
@glad sedge yeah, whenever a value changes

#

Unless otherwise specified by you

#

I had no clue that eXi was the Cedric Neukirchen eXi

#

His guide is so good

meager spade
#

Compress the data

#

split it into small chunks

#

rebuild on the receiving on the end

round star
#

Is there a way to see how much information is being sent between client and server etc

meager spade
#

Network Insights or Network Profiler

#

if you are 4.25+ use Network Insights

round star
#

Great thank you

weak wind
inner sand
#

Hopefully quick question, I am trying to use advanced sessions w/ stem on the right is what should show up blueprints is identical so I figure its some problem on my end. Steam is running and I am signed in. At this point I really don't know what to do to fix it so even if its something stupid like mispelling smth any help is much appreciated

sleek elk
#

Hello, I have sub level not "always", but BP loaded. When I load them on server with "Load level instance" on server only, Clients sees nothing. When I multicast the "Load level instance", then all clients see the level, but the actors in the level are not replicated. When the actors in the loaded level per "Load level instance" begin to move, nothing happens on client side. I used the same actors in "always" loaded sublevel, so it must have related to load level in bp per "Load level instance".
I search web but found no answer... how properly load a sublevel with replicated actors with "Load level instance" so the actors are replicated in normal way, like movement and everything else?

tranquil yoke
#

Hey, guys, physics running via the server is very jumpy how to resolve this ?

quick flint
#

Network Insights or Network Profiler
@meager spade what's the diff?

#

i remember the old network profiler

#

is the new thing basically just an upgrade?

#

to that small c# project lol

winged badger
#

@tranquil yoke networked physics is best not attempted unless you have plenty of experience under your belt, and are very comfortable with c++

#

its a nightmare

#

@sleek elk there is an engine bug where always loaded method, iirc, doesn't set the level visible to clients

#

i think they fixed it in 4.26, its been around since 4.1

tranquil yoke
#

@winged badger what is involved, i need to attempt this, have lots of work related to physics.

but it is more like, Spawn a ball and then allow ball to be hit. and also allow other people to see the same thing, It does not need to be perfect for now, just a smooth experience for all ?

winged badger
#

@inner sand there is a steam API limitation where you won't see server instances running from the same machine you're searching for them

tranquil yoke
#

@winged badger Project is not actually a game, but there is some things which are physics related . it is like 10% of this.

winged badger
#

think is physix won't have the same result on same machine running the same identical scenario twice

#

so yeah, networking it is a bitch

tranquil yoke
#

so server have multiple instance and it is simulating the physics for all the instance multiple times ?

winged badger
#

most networked physics includes constant updates via custom structs

#

and very few objects affected by physics

#

and even then you won't get the exact same state, but it might converge close enough

tranquil yoke
#

is there a doc or example to read so i can learn about this more.

it seems like a hard job to do.

winged badger
#

maybe but everything network physics related is painfully specific to the problem

#

there are no generic solutions

tranquil yoke
#

but my current implementation is, Spawn ball on server , spawn a player on server with a bat.

if bat and ball has a collision, then do a hit and replicate the ball and bat position to everyone ?

winged badger
#

uh, nasty

#

doesn't sound like it, but it is

tranquil yoke
#

it is not correct way ?

winged badger
#

you'd have to do client auth collision

#

but the thing would still jitter on server even with low-moderate lag

sleek elk
winged badger
#

that is, at least by title a much simpler scenario

#

as you don't have a server spawned ball coming at you

#

thing is with say 0,2 sec ping for client

#

server's ball instance reaches the point where collision will actually happen

#

0,1 sec later, client hit the ball with the bat, ball on server is 0,1 sec of ballistic trajectory past that point here

#

0,1 sec later, server RPC arrives on server from the client, informing it of collision

#

at this point server ball is 0,2 sec past the collision point on server, and 0,1 sec on all other clients

#

see the problem here?

tranquil yoke
#

yes

#

a big problem

#

i am testing this locally and there is no ping involved

winged badger
#

and if you do server auth, the game will feel incredibly choppy

sleek elk
#

Perhaps cheating is not a big thing, so server evaluation is not needed. If it is... when client hit locally, make RPC to server inform about hit. Check on server if someboidy hit before, if not, take it as real hit reardless of any extra validation on server. Just do collision check on every client by itself

winged badger
#

this is where physix kicks in

#

if you try to predict the collision server side to react to the ball

tranquil yoke
#

yes cheating is possible , no validation yet

winged badger
#

i pretty much guarantee you that ball will start flying in unique direction on server and all clients before it gets corrected

#

physics projectiles are easy incomparison

#

you do client auth, server common sense validation

#

client fires a predicted projectile immediately

sleek elk
#

For position i would do physic simulation only on server, replicate position to clienst and interpolate to make it a bit smoother. But that's the same topic from the Reddit link I postet above.

winged badger
#

but it doesn't exist on server before the server RPC arrives

tranquil yoke
#

There is no server RPC, using HIT component and Engine physics to do everything

winged badger
#

if the idea is to be able to try to smack that ball in a particular direction

#

the controls will always feel terrible with that approach @sleek elk

tranquil yoke
#

How do you predict server collision ?

winged badger
#

where i'd try and cheat

tranquil yoke
#

Client can cheat

winged badger
#

not that cheat

tranquil yoke
#

only thing we need is ability to hit ball with a bat

winged badger
#

the smoke and mirrors approach

#

i'd make the batting client's ball fly faster

#

and arrive there half a ping before it does so on server

#

its ballistic trajectory

#

so the moment its launched, and client gets the info it knows exactly where the ball will be at any point on its path

#

if you increase the ball's velocity enough to consume the lag on the batting client

#

then scenario becomes, in order

#

batting clients ball arrives, collision happens, RPC is sent

#

0,1 sec later server receives the RPC and its ball just reached about the collision point

#

0,1 sec later all other clients get the collision information, just as their ball reaches the collision point

tranquil yoke
#

Should i use Engine Physics, to do the bat and ball ?

#

or RPC only and predict everything ?

sleek elk
#

Somebody used "Load level instance" already for a sublevel with replicated actors?

winged badger
#

i had a similar problem

#

but it was more then 3 years ago, and i don't remember it well anymore

#

all the NetGUIDs for static actors were good

#

but they just weren't replicating

#

(from the sublevel)

#

and it was working in only one of the load mode Blueprint/AlwaysLoaded, don't remember which

#

RPC referencing a static Actor would work just fine

sleek elk
#

Hmm, its curios I find so little information about it when I google for it. It seems when I read it that it should work like expected. Nobody write that sublevel and level load in multiplayer is not possible.
Yes, always load is working fine. But having a level loded with BP and then load it, make the AI actors on the sublevel not moveing for clients.

tranquil yoke
#

Can i see server collision and server ball position

sleek elk
#

@tranquil yoke there is command, moment, i search it

tranquil yoke
#

ok thanks

winged badger
#

it is a bug

tranquil yoke
#

@winged badger is there anything, that i can see how physics is behaving, for lower ping, without deploying to Server actual

winged badger
#

and i heard it being fixed in 4.26, but again, not 100% sure im remembering the right bug being fixed

#

net pktlag=200 into console

tranquil yoke
#

I cant see this command on console

winged badger
#

autocomplete is broken

#

for that command

#

and no spaces are allowed around =

sleek elk
#

"p.NetShowCorrections=1" was the one i meant @tranquil yoke

tranquil yoke
#

Is serverTickTime is related to all of this stuff ?

sleek elk
#

Error message I get when sublevel is loaded and actor do things on client but are not replicated: "Not currently registered. Aborting"

#

@tranquil yoke : Yes, I would at least try it. Also tick is a point spoken in the long reddit thread. I would try first without changes, then with changes

#

I don't get it. Switching it to "always load" it is working fine directly.
Switching back to "BP loaded" and load the map on server eper BP, client is not getting actor replicated anymore. The player gets hitte by ai, so it seems the client ist replicated into server word, but client gets not replicated the sublevel actors.

sleek elk
#

5 o'clock in the morning, enough work for today. I hope tomorrow for more luck with replicated level loading. Read a lot again, but everything I found says it works just when the server load the level ๐Ÿ˜ฆ

worldly raft
#

Hi all, Iโ€™m am trying to build a multiplayer scoreboard that displays all players on the current servers names, score, level, a custom string variable and ping. I can get the score, level, ping and other variable listed in a scroll box when players hold the backspace button, but am struggling with the players names displaying correctly. I have tried using the game state for each player in the game state player array, as well as functions in a game instance to get the players name at start of game but have hit a wall. Would appreciate some advice/help ๐Ÿ˜Š Feel free to DM if you would like to tackle this with me and need more info / pictures of current code. Thank you in advance ๐Ÿ˜Š

round star
#

I am having a dastardly time trying to replicate these clouds. I don't understand what the heck I am supposed to do. I've followed every damn tutorial I can find on YT and I can't figure out what I am doing wrong. Here is a basic rundown on what I am trying to replicate... The cloud runs on a bunch of float and integer variables that determine a number of things like where it spawns how big it is etc etc... How on freaking earth does one go about replicating this? All the variables end up changing for every client ..but I need a set of variables that are the same on every machine (obviously the clouds need to behave exactly the same on every machine as it is the foundation of the game).. Yet I can't even get the cloud to move anywhere but on the server...just moving the cloud from one point to another will just not replicate on a client. I've done all the custom events and run on server, switch has authority, multicast bla bla bla everything and anything between and I am I sooooooooooo confused what on bloody earth I am doing wrong

vale ermine
#

Are you using input velocity or projectile movement? Those should replicate. @round star

tranquil yoke
#

@sleek elk why not load the level and spawn each actor by yourself

grizzled stirrup
#

For an endlessly incrementing OnRep int that is just used as a trigger for cosmetic FX, is it best to use a uint8 to be more efficient?

#

As far as I know when the uint8 is > 255 it'll automatically wrap back to 0 when incremented, is that correct?

chrome bay
#

yep correcto

grizzled stirrup
#

Thanks!

twin juniper
#

Is there a simple API method to get the ping to the server in C++?

grizzled stirrup
#

@twin juniper (int32)PlayerState->GetPing() * 4;

twin juniper
#

@grizzled stirrup Thanks, trying it now.

#

out of interest, why multiply by 4? Is the value divided down so it can fit in a uint8?

chrome bay
#

ExactPing is more accurate

#

But is only available to the owning player and server

#

The other ping is rounded and replicated for other players

meager fable
#

When i set a replicated variable in a game mode it is always ran on the server and should also be set on all clients correct?

chrome bay
#

not in the game mode

#

game mode isn't available to clients

#

whatever it is should be in the game state

meager fable
#

so if in game mode i do

AActor->MyReplicatedValue = whatever;
```\
#

it will only be set on the server?

chrome bay
#

I thought you meant a variable of the game mode

#

But yeah, it doesn't matter where you set it from. If AActor is a replicated actor, and the value is set server-side, it will rep to clients

twin juniper
#

@chrome bay What is ExactPingV2?

chrome bay
#

Just a different way of calculating it

#

See RecalculateAvgPing()

royal rampart
#

is it possible to turn off server corrections for AActor classes for a given period?

chrome bay
#

Hmm well you can disable replicating their movment by turning it off server-side

royal rampart
#

I'm trying to detach a ball from the player and the balltrail (niagara ribbon) trips for a sec before detaching

#

and I think that is because the server is correcting the ball position when detaching

#

yeah but I need it to replicate the movement ๐Ÿ˜ฆ otherwise it won't detach in the correct place

#

if I disable replicate movement the ball position stays {0, 0, 0} even tho it's attached

#

(you do see it attached for the client tho)

chrome bay
#

The Server is the only thing that should handle the detaching, as that is replicated too as part of replicated movement

#

Or more accurately "AttachmentReplication"

#

If you detach client-side then I wouldn't be surprised if it's in the wrong place for a while

worldly raft
#

Hello, will the player state work correctly when testing multiplayer in editor?

void nest
#

Hello!
I have a problem. Calling "QuitGame" on a dedicated server does not work? Anyone know why?

quick flint
#

Call it on tick with a multicast rpc that passes 3 FText's on tick @void nest

void nest
#

And does that work even when there are no players on the server?

#

Because the dedicated server is supposed to shut down on it's own after a while when no players are on it

chrome bay
#

@worldly raft yeah

round star
#

So I made my own game state and havent changed anything in it..but when I replace the default game state with the one I created I am unable to move the client characters

dark niche
#

Make sure your game mode derives from AGameMode I think should fix it @round star

limber gyro
#

Has any 1 implemented stuff like paid skins or cosmetics? i am wondering what would be the best way to implement this in a safe way?

round star
#

Make sure your game mode derives from AGameMode I think should fix it @round star
@dark niche Yep that fixed it lol

limber gyro
#

i assume i would have to query the inventory server(like steam) when the player joins a dedicated server so that it would get the equiped skins?

glad wharf
#

Hello everyone, is there something specific so that an actor placed in world will replicate its properties and fire OnRep_() stuff for a client joining, like in the initial bunch? I already checked NetLoadOnClient, AlwaysRelevant and Replicates
(well, actually it's the onrep of a component of the actor). If i trigger an event later after the join, the OnRep will fire, but I don't have the initial value replication even if server value is different from default value that the client has on load

sleek elk
#

Hello, I have sub level not "always load", but "BP loaded". When I load them on server with "Load level instance" on server only, Clients sees nothing. When I multicast the "Load level instance", then all clients see the level, but the actors in the level are not replicated.
I read several answerhub topic simlar, but their people complain more about how to change that actors are not replicated. Most sound that doing "Load level instance" on server also replicate actors in it. Is there anything I need to do when using "Load level instance" to load a level with replicated actors so clients have them replicated?

red musk
#

I'm looking to make a multiplayer game with physics based movement - all of the reference I can find on that is pretty out of date (~2014) - is there a modern good way to do that someone could point me towards? MovementComponent seems to be all kinematic

solar stirrup
#

Hey! I've recently worked on some custom movement, where the server stops replicating the character's movement and teleports the player to the end location while the player predicts the movement smoothly on its client

#

The server resumes replicating the movement once it's over

#

Once the client performs the movement, it's completely out of sync and for some reason keeps getting corrected by the server

#

one correction would be acceptable, but it keeps doing it, and I've never had that happen before

#

any idea of places I should look at to fix this issue?

#

Corrections continue even when the player is standing still, which is quite odd

#

LogNetPlayerMovement: Warning: *** Client: Error for BP_Survivor_C_0 at Time=87.699 is 0.000 okay might actually not be that thonk

#

why does it consider 0 as an error, there's no diff between server and client
EDIT: Aight so it desyncs when the origin is shifted thonk

rose egret
#

is there any easy sample for NetDeltaSerialize ?

quick flint
#

@solar stirrup I have this same issue

#

@solar stirrup cute profile picture btw, let meknow if you figure it out

solar stirrup
#

What version of the engine @quick flint ?

quick flint
#

@solar stirrup 4.25

#

how do we handle client prediction is the question

rustic spruce
#

Hey do you know how can i add a loading screen while the players are loading my gameplay map ? and the loading screen remove when every players have loaded the map?

red musk
#

How do I do client-authoritative movement (since it is physics based) without using a CMC, since those are kinematic?

sleek elk
#

I'm looking to make a multiplayer game with physics based movement - all of the reference I can find on that is pretty out of date (~2014) - is there a modern good way to do that someone could point me towards? MovementComponent seems to be all kinematic
@red musk Had a discussion on reddit last days, physic sim in mutliplayer was one part. Perhaps just rad and and perhap jump in and add your questions. https://www.reddit.com/r/unrealengine/comments/jn3qsh/replicating_2540_ai_character_physics_projectiles/

round star
#

Question. What would be a good spot to store a ton of variables essential to the game? I have a large tiled landscape for multiplayer..and I have dozens of variables I need replicated to drive certain actions of actors..would the game instance be okay to have them in? Then use the server instance to drive all the clients

rustic spruce
#

the game instance is for the client and the game instance is not destroyed when you join a new world so i think you should not put variables here

#

if you want the variables to be server-based then put your variables in GameMode

#

but i'm probably wrong

#

what type of varibles you wanna store?

#

player name? or something else?

round star
#

its to run an atmosphere that drives an entire weather system. The variables themselves are computed with a multitude of equations...easy for single player..but this is a multiplayer game..and it's just a mess. So I am just trying to work on basic replication right now. I am trying to get a cloud to move on server and client. Always runs on server never on client...works prefectly for a staticmeshactor but not for an Actor itself..I dont know why

#

I figure even if it's in the game instance the server will always have authority..any unused data I can just clear it if I have to when server disconnects from a game

#

I can have all my functions in the game instance and call them in the game mode..that was my thinking anyway

rustic spruce
#

wait i know

#

i said something wrong

#

do you want to display the Km/h of the player

round star
#

no that was just showing the speed of the cloud

#

lmao

#

the fact it says 0 means its nothing sending the velocity to the cloud actor of the client

#

idk why..it's replicated..and the actor is replicated..and the game mode sends it to the actor

#

so I dont get it

rustic spruce
#

do you know Multicast in the gamemode will always fail?

round star
#

even if its calling the multicast from the instance?

rustic spruce
#

wait you send the multicast to the game instance?

round star
#

game instance has a multicast that updates a variable to the cloud actor

#

I call that function from the game mode

#

event

#

w.e

rustic spruce
#

you should use GameState

#

put the multicast in the gameState

round star
#

finally got it...yea game state works XD had to set the variable itself to replicate even though it was passed through the event that was multicast..is that normal?

#

I guess it is.

#

you should use GameState
@rustic spruce Thank you

rustic spruce
#

np

#

yes it is

lucid vault
#

I want to disable location from replicating when replicate movement is enabled, but keep rotation in tact. Can someone point me in the right direction?

vivid seal
#

is there a way to do conditional replication for ReplicateSubobject or ReplicateSubobjectList? like if i have an array of UObjects I am replicating but I want them to be owner-only?

robust ivy
#

hey, I've written a super basic blueprint that get's all of my stair objects and changes the visibility of them. I'm trying to sync it up to work with replication and MP but I'm struggling. I've been trying to use the logic from underscore's multiplayer replication (part 1) video & Reuben Ward's 30min networking video but I'm going in circles unfortunately. Is anyone willing to give me any pointers / potentially have a look at the blueprints?

#

fun fact. I changed my play setting to "play as listen server" and it worked! Spent way too long on this

vivid seal
#

the reason something works on listen server but not dedicated is that as listen server you have authority, so there's probably some weirdness with authority or RPCs that you should check out

#

also, try whatever you were doing from one of the other client windows (not the listen server window) and see if it still works

robust ivy
#

That makes sense. I actually tried that and it didn't work. I'm trying to call the client to call the server to run the task but it's still not working properly from there

#

I've got the client calling a custom event which is set to "Run on Server". And than that event calling the servers event

#

idk if that makes sense or not

austere needle
#

I think I'm having a similar problem in another context lol

#

so

#

I'm trying to replicate projectile spawn. My logic is currently:

  1. Spawn the projectile locally on the auto-proxy
  2. We are the auto-proxy, so call an RPC ServerSpawnProjectile and send it the projectile information
  3. Now we are the server and successfully run the RPC function with the given parameters
  4. But when we are the server and call GetWorld()->SpawnActor<...>(...), an actor does NOT spawn????

Anyone have any idea on why the server RPC wouldn't successfully create an actor?

#

I am the very confused

vivid seal
#

@robust ivy post some screenshots of your functions

robust ivy
#

"the jimmy is home" string never runs

vivid seal
#

@austere needle is your projectile replicated? if not, what might be happening is that the server IS spawning a projectile, but it's totally separate from the client's and the client isn't seeing it

austere needle
#

the server doesn't see it at all

#

the client sees it cause the client spawns it locally and then notifies the server

#

but the server doesn't spawn it

vivid seal
#

@robust ivy the top function is what you're triggering on the client with a key press or something right?

robust ivy
#

yep. If they press q it calls the top event

vivid seal
#

and your auth strings are running?

robust ivy
#

yes

#

so if the server player presses q than it works correctly on both clients

vivid seal
#

what is this inside? player character/player controller?

austere needle
#

did you set the _Server event to be run on the server in the details?

robust ivy
#

it's inside of the basic stair geometry blueprint

austere needle
#

see my problem is living in a custom actor c++ file. I've seen people mention on a couple threads that RPCs won't work if the local client doesn't have ownership of the actor you are running the RPC on

#

could it be some hinky ownership issue?

vivid seal
#

okay, there's your problem, you can't call a run on server RPC from that because it's not something the client owns. If the client is the server (your Auth is true string) you can do whatever, but if the client isn't the server, it doesn't own the stairs so it can't call an RPC to the server

austere needle
#

yeeeeeeee

#

I think I have the same problem but I don't know how to properly set ownership to the 'client'

vivid seal
#

the client by default only really owns the player controller and the pawn that your player controller is controlling

#

i think maybe some other stuff, but definitely nothing that is just placed in the world

#

you just need your RPC earlier basically

robust ivy
#

ok. So I should do the auth check in say the level blueprint first?

vivid seal
#

instead of "Press Q > tell stairs to do stuff" it should be "Press Q > RPC to the server to do stuff > server tells stairs to do stuff"

#

no, you should do it in your player pawn or player controller

#

so inside your player controller:
Event Key Q does your authority check, if authority then call Multicast Q, if not then call Server Q
Server Q will just call Multicast Q
Multicast Q will THEN call whatever function inside your stairs to change visibility

#

the difference between that and what you have is that only AFTER the multicast do you go into the stairs blueprint, everything before that is inside the player or controller

robust ivy
#

that makes sense. I'll give it a shot and see how I go. Thankyou! I appreciate it!

vivid seal
#

no problem, networking is a huge learning curve for a while

#

it starts to make a lot more sense once you've got the Ownership/Authority concepts down

#

but i still haven't stopped running into weird stuff i don't know how to do lol

robust ivy
#

yeah i feel that once I get the workflow of it all it'll be something which clicks

vivid seal
#

then you get to have fun trying to work on prediction to make the game not feel laggy as hell waiting for the server to do everything ๐Ÿ™‚

robust ivy
#

yay

#

can't wait

vivid seal
#

@austere needle can u post some screenshots

austere needle
#

top piece of code fires when you left-click

#

I'm pretty sure it's also an ownership problem for me

#

but that would mean that ideally any RPC replication functions need to live in my character class

#

which would be annoying

vivid seal
#

you can also do RPCs inside actor components

austere needle
#

so I'm trying to figure out if I can set the ownership of this actor class to the client so RPCs work

vivid seal
#

what is this class?

austere needle
#

so this is a weapon class that is spawned in and attached to the character skeleton

#

aactor

vivid seal
#

i know there is a way to set owner, let me look real quick

austere needle
#

I have access to a SetOwner(AActor) function

thin stratus
#

You can set owner

austere needle
#

but I'm not sure what the correct actor to set is to get RPCs working

thin stratus
#

But that needs to happen on the server

#

So you wont get around at least one rpc

vivid seal
#

i mean you can just call it after you spawn it right

thin stratus
#

Unless you detect the actor with an overlap or so

vivid seal
#

oh its like a pickup

thin stratus
#

If you spawn it you can pass it as the owner pin

#

But this is probably placed into the level

austere needle
#

yea right now, the Character is spawned in and 2 WeaponActors are attached to it

#

and I want to run RPCs from within the WeaponActor custom classes

#

to keep my code not-all-over-the-place

vivid seal
#

yeah you just need to call SetOwner on the server at some point when attaching them

thin stratus
#

And the weapons are spawned too?

austere needle
#

yea

thin stratus
#

Then pass the character or its owner as the owner when spawning the weapons

#

Spawn actor node has a pin for it

austere needle
#

makes sense

vivid seal
#

he's in cpp

thin stratus
#

Has to happen on the server of course

austere needle
#

ye its one of the spawnactor params

vivid seal
#

yeah, if you just pass the player character it should work fine

thin stratus
#

Ah sorry too many bp users

vivid seal
#

hey while you're here do you know if i can conditionally replicate subobjects?

austere needle
#

so then the idea is to have the server spawn in a weapon and assign the owner, then replicate down to the clients

vivid seal
#

im replicating a few arrays of UObjects, and i want some of them to be replicated only to the owning client

thin stratus
#

So the array replicates?

vivid seal
#

I've only ever replicated UObjects using the generic ReplicateSubobjectList function

thin stratus
#

You can do it per array i assume

#

But not sure if you can do it per object in one array

vivid seal
#

i have a component that has three arrays of UObjects, one of which doesn't need to replicate (easy), one of which should only replicate to the component's owning client, and one of which should replicate to all

#

i can split them by array so it shouldn't be per object

glad wharf
#

Hello, is there something specific to do so that a replicated property being a UObject subclass pointer is properly replicated on client connection?

vivid seal
#

i just didn't know if there's a way to do "owning client only" in ReplicateSubobjectList

thin stratus
#

Yeah then just give the array a different rep condition

vivid seal
#

oh, no i mean i'm not trying to rep the array as a property

thin stratus
#

@glad wharf look up subobject replication iirc

vivid seal
#

well

#

i am

#

but i also need to rep the objects in the array

#

since they are UObjects they need something to replicate them

thin stratus
#

So like the playercontroller

glad wharf
#

I checked the doc but not sure to see what I missed. The property is inside a actorcomponent replicated, itself inside an actor replicated

#

Thanks eXi, i'll continue to dig in

thin stratus
#

I'm not doing it often enough to give you an example of subobject replication

#

Sorry!

glad wharf
#

No problem! Thanks for the pointers, now I know where to look more

vivid seal
thin stratus
#

Hm not sure atm without looking it up

vivid seal
#

okay nbd

robust ivy
#

@vivid seal late reply because I had to grab dinner, but I got it working very easily with your instructions and now it all makes so much more sense. Thanks heaps!

vivid seal
#

No problem dude, gl with learning everything

summer tide
#

When I create a session for either steam or lan, do I have to load a level after create session succeeded.

austere needle
#

For the life of me I can't seem to get this right.
This is my code in my Character BeginPlay() function. If I'm not crazy, it runs on the server only: https://i.imgur.com/0ffdkh1.png

Then I use DisplayAll InfantryWeaponMaster Owner in the console of both the client and the server to check the ownerships of the weapons that the server is spawning.

No matter how I try to set ownership, I can only set the ownership of the server's own weapons. I can't seem to set ownership of a weapon to a client. Most of the commented code are my various attempts.

Anyone have any tips on what I'm missing? I feel like it's something stupidly simple.

#

@summer tide pretty much. I'm pretty sure the flow is... get the session to join -> try to join the session -> if you joined, get the connection string of the session -> then clienttravel to the connection string which would load the destination level

#

now if you're talking about hosting, then its the same idea

#

create the session -> if you successfully created the session, travel to the level

#

so yea, loading the level comes after the session stuff

summer tide
#

@austere needle Do I have to use OpenLevel after host has created the session? I'm trying to stay on the same level and only show the host and joined players info.

austere needle
#

No you don't

#

do you use c++ or blueprints?

summer tide
#

BP

austere needle
#

im not totally familiar with bps unfortunately

#

but the thing that loads the level is gunna be your server/client traveling I'm pretty sure

#

so you could host the session, then wait for something else to happen

#

like a button click or whatever

#

so it's totally possible to host a game, sit in a lobby level, have players join the session and load into the lobby level, then servertravel everyone to the next game-level once the host clicks a button

empty axle
#

@austere needle Is the spawning happening on the server? If you know your owner already when spawning you could use this code that you already have which is Params.Owner = GetOwner();

austere needle
#

HasAuthority() makes sure it's running on the server right?

#

And on the client instance all 4 say "none"

#

so it's only setting the owner of the items the server itself would own

empty axle
#

You shouldn't set player controller as a owner

austere needle
#

so then what should the owner be set to?

#

cause that's what GetOwner() sets it as

#

from a Character

empty axle
#

If it is a weapon of a character then I woul set it to character then

#

Player controller is not replicated

austere needle
#

so then I would want to SetOwner(this)?

#

or i mean

#

params.owner = this

empty axle
#

Yes

austere needle
#

holy shit I think that worked

#

maybe

#

we'll see

#

ownership seems to correctly set to the character and proliferate down to the client. just gotta figure out why the weapon wont fire now lol

thin stratus
#

It should be perfectly fine to use the Controller as the Owner too, in case you swap characters and what not.
The PC is after all what defines the ownership, even if you use the Character.

#

The most important thing is to do this on the Server (setting Owner).

austere needle
#

so params.owner = GetController() would work as well then?

#

cause yea I would prefer to use the controller

thin stratus
#

Theoretically yes

austere needle
#

switching pawns will be a thing

thin stratus
#

It would make sure your Weapons stay owned if you swap characters, at least in my mind

austere needle
#

tho techincally the weapons probably wouldn't need to follow the transition

#

right

#

so maybe I dont need that

thin stratus
#

Shouldn't make a difference for your problem

#

Even with that you can't execute RPCs?

austere needle
#

I can't test those atm

#

the weapon pointers aren't carrying down to the client

#

so even tho the actor is spawned, the client references are nullptrs

thin stratus
#

Never?

#

Or are you testing this right on BeginPlay or stuff like that?

austere needle
#

so the variables in question are PrimaryWeapon, SecondaryWeapon, and CurrentWeapon

#

I check them on left-click

#

on the client they are nullptr

#

so I thought I just had to replicate them

#

but that doesnt seem to work atm

thin stratus
#

Okay so 3 things then:

  1. Character set to Replicate?
  2. Variables in Character set to Replicate?
  3. Weapon set to Replicate?
austere needle
#

yep

#

all 3

#

ill confirm real quick

thin stratus
#

Then your weapons should replicate just fine

austere needle
thin stratus
#

And character cpp?

austere needle
#

the first picture

thin stratus
#

You are missing one image though

#

GetLifetimeReplicatedProps?

austere needle
#

touche

#

i swear imma write down a fkin replication checklist after this lol

thin stratus
#

If you never had a variable replicated in a class and add that specifier, it will annoy you about the missing function

#

But if you have the function, yeah you can forget that step

austere needle
#

phew and that did it

#

holy schnikes

#

thanks man

summer tide
#

@austere needle Could I use LoadStreamableLevel instead of OpenLevel?

austere needle
#

I'm not sure. I'm not familiar with LoadStreamableLevel unfortunately

thin stratus
#

You will need the OpenLevel call because of the ?listen argument

#

Otherwise Clients won't be able to connect

#

What is the goal of this?

austere needle
#

is open level equivalent to a servertravel?

thin stratus
#

Something like a Party in the MainMenu?