#multiplayer

1 messages ยท Page 55 of 1

shy aspen
#

Np, are you familiar with the animation blueprint?

still cypress
#

For the most part, at least the fundamentals in a singleplayer context

shy aspen
#

What about aim offsets? The basic idea is have your animation blueprint read from the base aim rotation since it's already replicated to all relevant clients.

#

Your base aim rotation would drive your aim offset that updates your players animation to look up/down

still cypress
#

Ah okay, that's much more fancy than what's happening here.
I'm just trying to get a camera component and it's children to replicate their rotation.
That Add Controller Yaw/Pitch Input is just rotating the Camera Component of the character, and there's a few components attached to it

#

The actor's rotation seems to be replicating, but not the camera component transform and it's children
I do have Component Replicates checked for all player character components

#

That player character is very simple, but the actual use case with another player character is a VR player. And for that, I have to be able to replicate the transforms of many relative components, like the motion controllers, in addition to the camera for head tracking, and all attachments.

shy aspen
#

The server (if it's a host) looking up / down will be replicated to other clients, but the client control rotation is not sent to the server, it's local to the client. Notice how you're "Adding Controller Yaw / Pitch", that's coming from the Client so it's only happening on the client.

#

Play as 2 clients and you'll notice that both pitches will be broken.

#

The aim offset isn't fancy, it's just how this thing is easily done. I'd recommend watching a few videos on how to set it up, it's not hard and might save you a lot of headaches down the road.

#

Just remember if the video shows them using Get Control Rotation, replace it with Get Base Aim Rotation if you want it to work in a multiplayer environment.

still cypress
latent heart
#

Do any VR fps games actually make you place the weapon to your eye to use sights?

latent heart
#

Nice

still cypress
shy aspen
latent heart
#

Not watching random videos.

#

I wonder if they replicate how hard it is to get a good focus.

#

You gotta be pretty accurate or it's blurry as hell.

#

(with scopes)

still cypress
still cypress
#

Ill look into other traditional FPS control methods and their replication

shy aspen
#

There's a good reason control rotation isn't replicated. Your mouse movements would be an enormous amount of useless data being sent to other clients in a multiplayer game.

#

That was an indirect hint to make sure you don't call an RPC on mouse turn / look ๐Ÿ˜‰

latent heart
#

Heh

still cypress
#

I would of just assumed every tick the server just requests the transforms of any relevant actors and propagates those to the clients.
What exactly and how those rotations changed not being particularly relevant. But I'm obviously a noob with multiplayer. Each attempt has been pretty much a non-starter so far.

latent heart
#

There's no "requesting"

#

It wouldn't be a problem to send mouse aim data multiple times per second, just not every tick. You can just blend it together to create smooth motion on other clients.

#

If you wanted that level of replication.

#

And, of course, the update should be unreliable.

still cypress
#

clients reporting their transform, and the server propagating that to each client, and resolving potential conflicts, that conceptually makes sense to me, but of course that doesn't mean that's how it works. I know that would be terrible in a cheating context, if that matters.

shy aspen
#

It's actually backwards, the server has the authority and tells you where you're position is. That's why you get "server corrections" that snap the client back to the proper position if the client's game instance falls out of sync with the servers.

hollow eagle
#

Even if clients reported their aim rotation every tick (which they shouldn't, but let's assume they do) it wouldn't overwhelm other clients unless you also RPC'd that from the server to other clients instead of using property replication.
Hell, an unreliable client->server RPC every network tick wouldn't even be that bad.

plucky prawn
#

Ye I have a feeling that unless you are still using dial up, you would need a quite a few bad networking practices to ddos your clients

latent heart
#

Depends on the number of clients, though.

#

Some UE games attempt 100+ simultaneous clients. That adds up.

hollow eagle
#

That's the point at which you're throwing out most "easy" networking tech and looking at lots of custom workarounds for optimizations.

latent heart
#

True, but I'm just saying you have to consider your circumstances as well.

#

If you have 4 players max, you're got a lot more leeway than, say, a 32 player game.

plucky prawn
#

Are you guys suggesting that I can't make the next big mmo with out of the box networking in unreal?

plucky prawn
#

Blasphemy

latent heart
#

You totally can.

#

Depends on what you want from your MMO, though, and how much external tech you want to use.

quasi tide
#

I'm totally unreliable RPCing the direction my client's camera is facing. Because it helps me rotate things easier ๐Ÿ˜…

#

๐Ÿ˜ˆ

prisma snow
#

I unreliable RPC 200 structs each 100ms, who tops that?

latent heart
#

That sounds silly.

shy aspen
quasi tide
#

I slightly modified how the CMC orientate rotate works - uses the player camera. So when a client is supposed to turn around and walk (because movement is based on camera direction when not ADS), it also does it properly on other clients.

verbal tendon
plucky prawn
verbal tendon
#

Now dont forget your veggies and go to recruit your fellow future superstars on a forum advertising that you are going to make your first Unreal game, the mega MMO of your dreams!

junior mauve
#

Hi just curious if anyone can point me in the right direction here. So the idea is that I want to save my character data to a persistent save in the game files. I however want it be a 4 person co op so ideally on login it would load the playerstate that I had saved. My problem lies here, Iโ€™ve gotten all these systems working in a multiplayer setting but am unsure of where my character information should be. Should I rebuild these systems in the playerstate and have the gamemode access the playerstate and save the variables I want? What is industry best practice for this kinda of situation? Iโ€™m new to a lot of this so any input os appreciate.

fiery quartz
#

Hey guys I have a problem with replication on my multiplayer game where I pick up my weapon and it goes to my pickup animation on the server but not the client. I already made the code but I don't have any errors so i have no idea. Thanks

pure vigil
#

If an actor is network culled will it still render?

fossil spoke
pure vigil
fossil spoke
pure vigil
#

Felt like at least 30 seconds..

fossil spoke
#

Cant remember what the time is, 5 seconds maybe

pure vigil
#

Hmm ok, might not be functioning then. But good to know it shouldn't render, makes it easy to test

fossil spoke
#

Well make sure it isnt AlwaysRelevant.

pure vigil
#

I didn't set it to true, could set it to false manually but seems redundant

fossil spoke
#

Also if you are using ReplicationGraph, the NetRelevancy stuff is basically unused.

pure vigil
#

No idea what the ReplicationGraph is ๐Ÿ™‚

fossil spoke
upper depot
#

Does anyone know why my PlayerController class is never set on the server? Is there a special way to set the PlayerController or GameMode for dedicated servers?

fossil spoke
#

Typically its applied directly to the World Settings inside the level.

upper depot
#

Hm yes that's what I've been doing, and it works on the client but not on the server

fossil spoke
#

The Maps & Modes in the Project Settings will also allow you to set a default Gamemode

upper depot
hollow bridge
#

Is it possible to control 2 characters from a single client? AddMovmentInput for a different character doesn't work no matter what I do (I tried to set net owner). Unless I use RPC and do it from the server or possess the second char

fossil spoke
junior mauve
hollow bridge
#

My goal is to control a mount without possess him

upper depot
#

Does a dedicated server even have a PlayerController? Like can I do what's in the pic and have it come back with a real object?

pure vigil
#

ugh. I'm missing something with this network culling. My spawned actors have NetCullDistanceSquared = 10; now, just to really try to force it to work. But the actors stay relevant no matter how far I walk away or how long it's been.

fossil spoke
upper depot
#

So with no players connected that would be empty?

fossil spoke
#

Try something thats equivalent to like 10 meters

fossil spoke
#

on a Dedicated Server

#

On a Listen Server it should always return the Host.

edgy patio
pure vigil
fossil spoke
hollow bridge
fossil spoke
pure vigil
fossil spoke
#

And you are certain its not AlwaysRelevant?

pure vigil
#

Ya, I even did bAlwaysRelevant = false; just to be 100% sure

#

Possibly a PIE issue? Thinkawingur

#

that was not the thinking face i wanted

fossil spoke
#

And bNetUseOwnerRelevancy is false as well?

pure vigil
#

Oh, no! I didn't know that was a thing!

#

Ugh, but no change..

gray holly
fossil spoke
clear island
clear island
#

you need to uncheck net load on client if they are pre placed

pure vigil
#

I'm watching them spawn in the level outliner

clear island
#

other things to check

#

check if tearOff is not set to true

#

and check if you dont have a reference to that actor somewhere in your code that is always relevant

#

Like PlayerState, I think that one is always relevant

pure vigil
#

I save no references to the actors and am not currently using always relevant for anything

#

Not sure what tearOff is, looking into it

clear island
#

should return false

pure vigil
#

tearOff is false

clear island
#

also I'm not sure what happens if you set a really low net cull distance value, I never tried it, does it ever spawn at all? maybe try higher values

pure vigil
#

Ultimately I don't need these actors to be relevant unless the player is nearly on top of them. I can try a larger value

clear island
#

also inside that actor are you spawning other actors? maybe check if those are AlwaysRelevant

pure vigil
#

It is a component attached to my character spawning one actor per second. Spawned actor just has an arrow component and does nothing

clear island
#

and that spawned actor is not spawning other actors?

pure vigil
#

correct

clear island
#

just in case if I would try unchecking "Net load on client"

#

also when you spawn those actors you are setting Replicates to true right?

pure vigil
#

Put net cull squared at 1000 .. still low I guess. Also turned off net load on client. No changes. Yes

#

this is incredibly frustrating, it's such a simple setup, I must be missing something.

clear island
#

and you spawning these actors on the server right? not the client

pure vigil
#

Correct

clear island
#

what UE version?

pure vigil
#

One thing I'm trying now is not setting the owner on the spawned actors. 5.1

clear island
#

hmm

pure vigil
#

if I don't set the owner.. I don't see the actors at all....

clear island
#

maybe thats net cull distance already destroying it

#

because you have a low value

pure vigil
#

ya I think you're right. This is in unreal units, right?

clear island
#

yea

pure vigil
#

also.. ooh

#

So.. this is a top down game. My camera is far above my player. Is it net culling based on distance to the camera?

clear island
#

hmm I actually dont know that

#

I'm on 5.0.2 and these past 3 days I've been fighting alot with net cull distance issues, was finally able to fix them all just a few moments ago but I did modify the IsRelevantFor() function

#

I made the change he suggested there on that last return line

pure vigil
#

Ok so I have no idea why these actors are being flagged as always relevant for the owner, guess it doesn't matter they don't really need an owner anyway. But removing the owner seems to have done it

pure vigil
#

Ya, that was false

abstract pike
#

So, using a reliable multicast function, which on the server calls Destroy(), the client gets destroyed before running the code in the multicast. In an effort to fix that I tried calling TearOff before the Destroy call but it doesn't TearOff in time and the client is still destroyed.

Is there any way to guarantee that an RPC will run on a client before it's destroyed on the client?

clear island
abstract pike
# clear island cant you run this code on the client on the Destoyed event?

Does destroyed run when replication stops too or only when explicitly Destroy is called?

I'm trying to use an RPC because while adding replication graph i'm finding client actors are getting destroyed a lot when replication stops due to replication graph rules. I was using EndPlay but it was called all the time on the client even when it wasn't actually destroyed on the server so that's why the RPC.

clear island
#

hmm I haven't used the replication graph myself but I believe the destroyed event will always get called every time an actor is destroyed regardless of it being on the client or server

#

it will also run the actor goes out of net cull distance since its being destoyed when that happens

#

not sure how the replication graph does it but I guess its the same

abstract pike
#

Yea then I think that won't work either as I still need certain logic to run only when it's properly killed

clear island
#

well I guess you could send a client rpc before destroying that sets some boolean that will signal the client that next time the destroyed event is called <certain logic must be called>

abstract pike
clear island
#

is this actor that you're destroying just for 1 client or all clients? because if its just 1, the client could reply to that client rpc he received with a server rpc, letting the server know it can now be destroyed

abstract pike
#

All clients

#

I have thought about the reply and track connections possibility but it seems like there should be an easier way

clear island
#

hmm yea seems tricky

verbal tendon
#

So I havent followed the entire conversation

#

But it stands to reason that you are doing the wrong thing at the wrong point

#

simply send an RPC for the real destruction all relevant clients

#

those clients will execute the logic you currently have OnDestroy

#

remove the OnDestroy binding

#

@abstract pike

tranquil yoke
#

But does TearOff removes it from NetDriver? because when NetDriver gets destroyed right now, it removes the actor from the client, i have to stop it from doing that.

latent heart
#

Good question.

#

I thought when the netdriver was destroyed, it basically changed level. It was all interlinked.

#

@fossil veldt looked into this a while ago.

#

Or, rather, the netdriver was destroyed because you disconnected from the server by navigating to a different map.

#

(which could be the same map)

tranquil yoke
#

I am doing this for beaconNetDriver, so i want to destroy the beaconNetDriver, when Beacon connection is lost, but i want to keep that class available for GameNetDriver of the server Where we started the client Beacon.

when we connect Host beacon and Client beacon, we basically making HostBeacon NetDriver auth of the class, but when we close HostBeacon, the class auth should go back to GameNetDriver.

#

HostBeacon and ClientBeacon are on Servers, we are trying to connect 2 servers with each other.

latent heart
#

2 servers? Hmm! Good luck.

tranquil yoke
#

yeah, most of the logic working, i can actually replicate Pawns from HostBeacon to clientBeacon, so people can see pawn from one server in another server, and it behaves like normal Pawn.
Issue is removing these pawns and actors from BeaconNetDriver, so it does not get destroyed.
Let me know if you found out how NetDriver is doing cleanup and destroying the actor.

abstract pike
#

How to get either a successful TearOff or Destroy on the Server but also have the calling RPC happen on the clients

chrome bay
#

RPC's will arrive before destroy calls if they are reliable

#

You can't guarantee they'll arrive before TearOff because TearOff is driven by replicated property

#

Oh and it goes without saying, but the object has to be relevant to those clients at the time of the call too

abstract pike
chrome bay
#

yeah correct, but only if reliable

#

It's one good use-case for Reliable Multicasts, if you want to send some parameters to control death etc.

abstract pike
chrome bay
#

The main thing is the actor has to be relevant at the time it's called

abstract pike
#

I see, I can probably force that but will have to think about how that will look with Replication Graph

#

Thank you

hushed rain
#

Is it possible to have a (blueprint) game with game modes that use listen and/or dedicated servers depending on the mode?

#

Like Co op uses listen and competitive used dedicated

chrome bay
#

Need to use the source version of the engine to ship a dedicated server so technically not

#

But what type of server you join to is up to how you set it up

hushed rain
#

Yeah I get i would have to convert it to c++ but yeah so then it would be possible? I didn't know if there was any subsystem stuff or whatever

twin juniper
#

I am implementing Teleportation in a multiplayer context. When using teleportDestination = GetOwner()->GetActorLocation() + GetOwner()->GetActorForwardVector() * 200; everything is working correctly on single player but not working on multiplayer. I am quite sure that I have setup CMC rightly. I am following this video.

#

youtuber uses some other method to set teleport destination but it is rather cumbersome. Could this be because simple method causes desync?

fossil veldt
#

even on an unsuccessful open command, your netdriver is temporarily destroyed

latent heart
#

Is there any other way to end up with it destroyed?

#

(normally)

twin juniper
#

https://www.youtube.com/watch?v=SNNH7uJo40A&ab_channel=HarryPearce
YouTube
HarryPearce
Teleportation using Custom Movement Component in Unreal Engine
Image
At 18:10 he says to call Cast TeleportRay but there is nothing about this in the whole video. Am I missing something?

pseudo schooner
#

Anyone know why this AnimationBP automatic rule works client to client, server to client, but NOT client to server? I have several of them and everything works fine except these automatic rules. Works fine for everyone except the host

near granite
#

disconnected and connected repeatedly in server with this log when loading streaming sublevel..

Originally creating instance to load the level doesn't work in multiplayer?

near granite
#

Is there any way to set sublevel trasform after automatically sublevel loaded?

pulsar delta
#

Does anyone know how to replicate Media Players? I'm trying to make it play a video on URL but it only shows on the server and to none of the clients, is there something I could try?

twilit radish
#

You can probably just send down an event to the clients to play the same thing. Usually you just send over the state you need, so if all you need is a URL to play something just send over that URL to the clients and make them play it as well. A lot of things aren't replicated within Unreal ๐Ÿ™‚

pulsar delta
twilit radish
#

You still need to go to the server first, a multicast can only be called from the server. But you could use a multicast for example yes.

fathom aspen
#

Not that you can use it in Widgets though

#

RPCs are meaningless in objects that don't support them

twilit radish
#

Well that too ๐Ÿ˜›

pulsar delta
#

oh these wont work on widgets? I've been doing them on widget this entire time!

fathom aspen
#

A look at the beginner friendly resources in pinned messages won't hurt @pulsar delta

twilit radish
#

Widgets don't have any networking code. You do it through actors such as the playercontroller, pawns, regular actors etc. etc.

pulsar delta
pulsar delta
twilit radish
#

I mean it makes a lot of sense once you realise how it all works. Makes a lot of things so much easier in the end, but yeah it can definitely be a bit of "Ok? But why?" moment in the beginning ๐Ÿ˜›

worn steppe
#

when a variable is set to repnotify, only the server or listenserver can modify the value, right? I mean, a client could modify their local value of that variable, but that is probably a bad idea because it won't be replicated to the other clients or the server, correct?

pure vigil
worn steppe
#

ok, thanks. just wanted to confirm I understand this ๐Ÿ˜„

#

it's a little overwhelming to learn all of this at once

tropic falcon
#

Out of the box networked chaos vehicles aren't great, what are the most obvious things I can do to make the performance better across a network?

pure vigil
#

If I generate a random number in the constructor of a replicated actor .. the server and all clients will generate their own random numbers right? I can't see why this wouldn't be the case but I need a sanity check

#

no reason why that number should propagate

worn steppe
#

yeah there is no way that would be synchronized, even with the same seed the client could invoke the rng any number of times between server invocations unless there was a special rng for this purpose alone

#

but i can't imagine thats the case

#

especially because, any call that tells clients to invoke their rng for whatever reason, could just as easily pass a randomly generated number along with it

#

well, unless you are doing large strings of random numbers

#

yeah, I just double checked, even if you used the same seed, at least the standard C rand() function can produce different outputs on different machines

#

but, if you really wanted this, you could generate your own entropy data and just package it as part of the game, and then write your own rand(seed) function that works from that block of entropy

pallid mesa
clear island
#

them having no client prediction is whats bad ๐Ÿ˜›

pure vigil
#

Any way to force an OnRep to trigger even if the value hasn't changed? Setting an OnRep bool on the server and I need the client to update the actor based on true/false. But obviously if I set it to 'false'.. it's false by default and the OnRep function never executes. I tried

thinking this might "force" it to update but no luck. I guess the smart thing to do would be to use an enum instead with 3 values but I was hoping to make this work

#

Reading into the comments on CoreNetTypes.h I don't think the above will work. Gonna use an enum instead

fossil spoke
twin juniper
#

do you know why when 2 client are replicated, when the other clients are going too far They disappear, if I go in the range again they reappear. It must something simple /// culling distance or ...

clear island
#

net cull distance

fierce grove
#

it's better when I put it to max net cull but still persists

clear island
#

setting bAlwaysRelevant=true will disable net cull distance but the solution is not to disable or increase the distance, you should take this into account and create your game to handle such cases

#

alot of relevant actors is going to be heavy

sinful tree
#

Is there a certain reason why you need to have them always relevant? The idea being with net culling is to reduce network traffic by restricting replication of actors if they're too far away from the client.

fossil spoke
#

The PlayerState is an Actor that exists in the World, you dont see it, but they are there. They NEED to be AlwaysRelevant, otherwise they would be subject to the same culling effects and thus be destroyed when out of relevancy range.

#

The GameState is also in the same boat.

#

Just a few examples of where bAlwaysRelevant is necessary.

fierce grove
#

could be usefull to have bigger net cull distance let's say for "space" games

fossil spoke
#

We have a large netcull distance for our space ships, however we have other aggressive rules around relevancy for them.

clear island
#

high net cull distance is applicable for sure in some cases, always relevant though not so much imo, apart from playerstate

#

most of the issues with net cull distance for me has just been distinguishing when an actor was actually destroyed by game logic or by net cull distance, unfortunate that theres no separate client side event for that

fierce grove
fossil spoke
#

You dont need to compile the engine source.

#

Using C++ gives you access to a lot more flexible methods for managing Network utilization.

worn steppe
#

Can I pass a simple struct to an RPC?

fossil spoke
worn steppe
#

Just a struct { ... }; with POD members

fossil spoke
#

It must be marked up with USTRUCT

worn steppe
#

kk, ty

fossil spoke
#

Each member must be a UPROP as well

worn steppe
#

oh

#

ok, also good to know ๐Ÿ˜„

#

hmm, thinking on this more, I suppose I don't actually need to pass anything to the server and can just calculate everything there once the RPC is invoked. networking is hard

quasi tide
#

When a client joins the game or gets back into relevancy range, do they get the current server variable values?

gritty warren
#

I am having hella rubberbanding issues with some movement stuff of mine. Anybody have any suggestions/resources on how to tackle this problem? I'm trying to do a slide that dynamically changes speed depending on a slope angle

crystal crag
#

Has anyone here developed any melee games that support multiplayer? I have a couple of questions.

clear island
#

although sometimes, when you have references (replicated uproperties) to other actors/properties inside an existing actor, when that "parent" actor replicates, the references to its child actors may not have replicated yet

rain wave
#

Does Motion Warping not replicate properly? It runs smooth in Standalone but when I try to replicate it the motion is all choppy

quasi tide
#

So - I'm thinkin' about using a save game to store what clothes a character has elected to wear. Then when going from map to map, just load that save game. I figure I can hit two birds in one shot, persisting through game sessions and handling data from map to map. Anyone done something similar? Any flaws someone can see?

low helm
#

not flaws

#

that's fine

#

savegame system can be a bit heavy but that's not a big deal

#

if something changes frequently, you don't want to have to be repeatedly running savegame

#

but otherwise it's good

quasi tide
#

Oh - it won't be changing frequently. Can only change in the lobby.

rancid monolith
#

I need to make a class to store team data in my multiplayer game mode, stuff like team score, members, objective info, etc. Probably just going to inherit from UObject but I was wondering if maybe there's a more suitable parent class for it

pallid mesa
#

yes, the gamestate

fleet viper
#

I want to profile a single function for it's network stats, since I think it is slow over the network and I want to know which part of the function makes it slow. I heard about unreal network profiler but I from what I understood it's not made for in editor use. Is there any other way to check this?

kindred widget
thin stratus
#

I mean the other case would be that it sends a lot of data very often

#

Which would qualify for network profiling

#

The code inside of it could still be cheap

fleet viper
fleet viper
thin stratus
#

Depends on what we are talking about

#

A "Fire Weapon" function, at least in the projects I worked on, is mostly empty in terms of properties

#

By default I never pass anything over. Only when adding some prediction for the Projectile I would pass over some data.

fleet viper
# thin stratus A "Fire Weapon" function, at least in the projects I worked on, is mostly empty ...

This is the code for my shooting function: ```void AFirearm::Shoot_Implementation()
{
if (RoundsInMag > 0 && bChamber == true)
{
GetWorldTimerManager().SetTimer(RPMHandle, this, &AFirearm::ChamberBullet, FireRate, false);
bChamber = false;
SpawnEffectsGlobally();

    ABasePlayer* Player = Cast<ABasePlayer>(GetOwner());

    if (Player)
    {
        FActorSpawnParameters SpawnParams;
        SpawnParams.Instigator = Player;
        SpawnParams.Owner = this;

        FVector Location = Weapon->GetSocketLocation("Muzzle");

        FRotator BaseRotation = UKismetMathLibrary::FindLookAtRotation(Location, Player->LookAtLocation);
        FRotator ImprecisionRotation = FRotator(FMath::FRandRange(GetImprecision() * -1.f, GetImprecision()), FMath::FRandRange(GetImprecision() * -1.f, GetImprecision()), FMath::FRandRange(GetImprecision() * -1.f, GetImprecision()));
        FRotator Rotation = BaseRotation + ImprecisionRotation;

        GetWorld()->SpawnActor<AActor>(ProjectileClass, Location, Rotation, SpawnParams);
        if (IsUsingBarrel())
        {
            UAISense_Hearing::ReportNoiseEvent(this, GetActorLocation(), 1.f, GetInstigator(), Barrel->BarrelProps.GetDefaultObject()->NoiseReportDistSuppressed, "Gunshot");
        }
        else {
            UAISense_Hearing::ReportNoiseEvent(this, GetActorLocation(), 1.f, GetInstigator(), NoiseReportDist, "Gunshot");
        }
        UE_LOG(LogTemp, Warning, TEXT("Bullet Spawned"));

        ABasePlayerController* Controller = Cast<ABasePlayerController>(Player->GetController());
        if (CameraShake && Controller)
        {
            Controller->PlayCameraShake(CameraShake);
        }
    }
}

}

#

Don't really see why it should behave a bit unresponsive with bad ping especially the logic works all fine and timed but the trigger to shoot time is just a bit slow

fleet viper
thin stratus
#

Not sure what you mean with unresponsive

fleet viper
thin stratus
#

But that's kinda normal?

#

You are telling the Server to spawn a Projectile

#

So you have the half the Round Trip Time to tell teh Server

#

And then the other half of the RTT for the Projectile to be replicated back to you

#

Delay is absolutely expected and will be bigger the higher the ping

fleet viper
#

hm thats true

#

tho other games circumvent this, i guess they make firing etc. client only and then simulate a bullet on client and server seperately?

twilit radish
#

Most shooters don't actually use bullets, what they do is they do a simple line trace / raycast and do some quickly fired particle trails or similar to make it look like it's a bullet and has some kind of trajectory to it. But yes they do predict it on the client side with the exception of actually damaging the enemy.

fleet viper
#

tho the game im thinking of also has bullet drop

#

which isnt really good to simulate with a linetrace correct?

twilit radish
#

It's a million times easier than physically simulating a bullet, just let your line casts curve down over time ๐Ÿคทโ€โ™€๏ธ

neon mango
#

You can do bullet drops with line trace I think there is a spline trace too

kindred widget
#

All a bullet drop is is a swept component moving each frame with simulation applied for velocity reduction and gravity. You can do the same thing with traces.

twilit radish
#

Also physical bullets sound a pain in general if it's one actor per bullet, all it takes is an automatic weapon that shoots a million times per second to destroy your network with constantly creating, replicating and destroying actors ๐Ÿ˜…

fleet viper
#

true

neon mango
fleet viper
twilit radish
#

I'm not going to tell you how to live your life but I would just not do it with actors, the moment your actor has *maybe* had the chance to replicate to a client it's likely to be already destroyed. Besides it's just a performance overhead for no reason over just using some traces that can just as much simulate bullet drop. But that's just my advice ๐Ÿ™‚

#

Assuming you would replicate them. If not the case the last part is still valid.

fleet viper
#

ill definitely keep it in mind thanks!๐Ÿ™‚

near granite
#

I will change the level 7times, I turned on the seamless travel on game mode and set transition map then I don't need to server travel to transition map?

fleet viper
#

ok very different question but I cannot understand this for the love of my life. You might know whats going on here @twilit radish. I play as client. As you can see the AI is standing on the right side and its status is idle. But, you can clearly see from my debug options on the left side (that text is always at the location of the ai) that the ai is standing at a complete different location and its status is overt not idle. How can a location of a character component be out of sync??

#

maybe something interesting for @thin stratustoo. My understanding of AI in multiplayer is that the character exists on server and client and the controller only on server. So if the controller tells the character where to go it should be visible to all clients.

#

what

#

when i use simulate in pie and then reposses and play the ai works, if i play directly without simulating first then it doesnt

grizzled stirrup
#

Is it possible to view the output log from the clients perspective when simulating the client in PIE?

fleet viper
#

like literally the ai location isnt replicated at all. I have changed nothing except simulating pktlag what is this epic

keen sigil
#

hi guys i try to add hit reaction my pvp game anyone knows how can i add

twilit radish
twilit radish
distant vault
#

Hello, Iโ€™m having problems with multiplayer connection. I built my game to test the multiplayer experience in 2 separate computers but for some reason, it isnโ€™t working. When I host a game I canโ€™t find it. If anyone knows why this is happening please help and here is the build for the game so you can test it out as well. Itโ€™s a Google dive link

Build link: https://drive.google.com/file/d/1h6VKexIawOlhYfjJZlYSLuTxFZvHXO-a/view?usp=drivesdk

twilit radish
#

@distant vault I don't think anyone is going to download that for obvious reasons. I would recommend figuring out where the problems occur exactly and if you have any specific questions ask about that. Check for example your log files, debug your code to see where it stops etc.

fierce grove
#

I have a join session success but the client does not "travel" to the map

twilit radish
#

Check your logs, there's a good chance the map path/name just isn't valid.

fierce grove
#

[2023.01.24-13.52.34:573][473]LogOnlineSession: OSS: Join session: traveling to steam.76561198062121577:7777 [2023.01.24-13.52.34:573][473]LogBlueprintUserMessages: [WBP_ServerItem_C_0] SUCESS [2023.01.24-13.52.34:573][473]LogNet: Browse: steam.76561198062121577/Game/Features/Lobby/L_Lobby [2023.01.24-13.52.34:574][473]LogNet: Display: SteamNetDriver_0 bound to port 7777 [2023.01.24-13.52.34:574][473]LogNet: SteamNetConnection_0 setting maximum channels to: 32767 [2023.01.24-13.52.34:574][473]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent) [2023.01.24-13.52.34:576][473]LogHandshake: Stateless Handshake: NetDriverDefinition 'GameNetDriver' CachedClientID: 1 [2023.01.24-13.52.34:576][473]LogOnline: STEAM: Adding user 76561198062121577:7777 from RegisterConnection [2023.01.24-13.52.34:576][473]LogNet: Game client on port 7777, rate 100000

#

so it doesnt load the Map it reloads the lobby

twilit radish
#

Is the client already connected to the server when you're changing the map?

distant vault
twilit radish
#

If this is on LAN make sure your firewall isn't blocking it, if you're doing this from 2 PCs across different networks make sure the port for the server is open. But again something is likely already telling you in the logs what's wrong. If not the case look at where your code doesn't work any more.

fierce grove
twilit radish
#

How does the client join?

fierce grove
#

find session the join session

twilit radish
#

So the client hosting the server does actually see the correct map? If so make sure you're looking at the server logs too as I think what you're looking at right now is just the client joining.

fierce grove
#

yes the host is on the right map

fleet viper
fierce grove
#

When my friend joins :

[2023.01.24-14.08.51:541][325]LogOnline: STEAM: Adding P2P connection information with user 76561198062121577 (Name: Helmut [0x110000106123269])

twilit radish
#

And there's nothing else? If you're doing this from the editor make sure you don't have warnings/errors disabled.

fleet viper
#

which one of us do you mean?

twilit radish
#

Max.

#

But for you, is it a pawn or a character that the AI is controlling?

#

Pawns by default don't replicate movement.

fleet viper
twilit radish
#

Then that's a really good question why it's out of sync ๐Ÿค”

#

It's not accidentally set to dormant or anything in the settings?

visual otter
#

I don't know if this belongs in this channel or #online-subsystems but I'm having the usual problem destroying local sessions on the client when the host quits - should I just stick a DestroySession on begin play inside my menu player controller?

twilit radish
#

It's an option the actor class has for network optimization but it cancels out most networking stuff. Look on your character settings for something with that name. (I would open Unreal for you if I wasn't compiling a source build lol).

fleet viper
#

aight imma look into it

twilit radish
#

That's basically all I can think of on why it wouldn't specifically update the location but still be there.

fleet viper
#

i feel like its a bug because i used network emulation

twilit radish
#

Is it pre-placed in the map?

fleet viper
#

yes

fleet viper
#

tho im not sure if simulating actually also simulates server and client

#

@twilit radishdormancy is set to awake eg. the default, should i put it to never?

twilit radish
#

Could always try it I guess.

fleet viper
twilit radish
#

Simulate network doesn't work in every mode yeah.

#

Can you try standalone and see if that does work?

fleet viper
fierce grove
# twilit radish Max.

tried in different settings... it's pawn that spawns on player start (no collisions...)

Funny thing, if the server disconnect the client travels to the map

thin stratus
fleet viper
thin stratus
#

are they setup to spawn an AI Controller when placed?

fleet viper
#

yes

thin stratus
#

Hm okay, cause that Enum has caused a lot of headache in the past hehe

fleet viper
#

they do so i know that cuz on the server side the ai is moving and behaving correctly

thin stratus
#

Do you have the same problem in a new project, for sanity?

#

Characters controlled by AI should just work^tm

fleet viper
#

im currently downloading an old version of my project(github lifesaver) and ill try there. But ill also try to do it in another project

near granite
#

when loading sublevel, what's the different between function "create instance" and "load stream level"?

thin stratus
#

I think the top one allows having multiple instances and the bottom one is to load a preplaced sub level

#

There should also be a create node that has a transform Input

sonic python
#

Heyyyy

#

Guysss

#

Match Making Is Not Working In Mobile Phones

fierce grove
#

I can't read that console command to join a "session" by steam id

sonic python
#

Like A player mobile A can't play with player in mobile B

thin stratus
#

Not sure about the dot

thin stratus
sonic python
#

Multiplayer

#

Subsystem?

near granite
fleet viper
#

@thin stratusso it doesnt work in an older version of my project too

thin stratus
thin stratus
sonic python
#

Yes Can't find , Join session

#

They Create sessions

fleet viper
sonic python
#

It's Only like this in the mobile

thin stratus
thin stratus
sonic python
thin stratus
#

No reason to go back that far for now

fleet viper
#

ok

thin stratus
sonic python
#

LAN

#

I didn't use LAN

thin stratus
#

Then my original question comes back:

#

What Subsystem are you using?

#

Cause by default, SubsystemNULL doesn't support anything but LAN or direct IP connection

sonic python
thin stratus
#

You aren't answering my question

#

What Subsystem are you using?

sonic python
#

Subsystem?

thin stratus
#

Yeah, OnlineSubsystem

#

The thing that handles Sessions

sonic python
#

Ohh

#

Where to find what I'm using?

#

I guess Google?

thin stratus
#

If you never set anything up then you use NULL

#

Which doesn't support online sessions

sonic python
#

Ohh

#

How To Set That?

thin stratus
#

More or less depends on the platform you are on. If you are doing android stuff then probably Google and I have no idea how to set that up tbh

#

I also don't know if that Subsystem supports Sessions

#

Not all Subsystems support everything

fleet viper
#

@thin stratusso in the new project it works

#

but i didnt change anything in my original project and it did work before

sonic python
#

Oh

thin stratus
#
IOnlineSessionPtr FOnlineSubsystemGoogleCommon::GetSessionInterface() const
{
    return nullptr;
}
#

From what I can see in 5.1 (and thus also prior to that), The Google Subsystem has no Session stuff implemented

#

So with Google alone you won't get this to work

#

Your only other option is to use EOS ( #epic-online-services ) and authenticate with Google there.
But I can't help with that, you'll have to ask for help in that channel.

sonic python
#

Ohk Epic Online Services

#

And @thin stratus

#

Does Online Subsystem also affect the In App purchases?

fierce grove
#

I have players in the same lobby then the lobby host a game server by open a map with listen argument...everyone knows that a game is created with a specific steam id

Then each clients tries to connect with :

open steam.76561198062121577

76561198062121577.. being the host steam id

client log :

[2023.01.24-15.53.41:011][914]LogNet: UPendingNetGame::SendInitialJoin: Sending hello. [UNetConnection] RemoteAddr: 76561198036395131:7777, Name: SteamSocketsNetConnection_0, Driver: PendingNetDriver SteamSocketsNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID

server log:

[2023.01.24-15.53.40:870][668]LogNetVersion: SilentWars 1.0.0.0, NetCL: 23058290, EngineNetVer: 30, GameNetVer: 0 (Checksum: 277290289)
[2023.01.24-15.53.40:870][668]LogHandshake: SendConnectChallenge. Timestamp: 6.264920, Cookie: 043100059122178164208061087156241117109219191073174119246127
[2023.01.24-15.53.40:870][668]LogHandshake: Incoming: Rejecting handshake packet with invalid session id (0 vs 0) or connection id (1 vs 0).
[2023.01.24-15.53.40:887][670]LogHandshake: SendChallengeAck. InCookie: 043100059122178164208061087156241117109219191073174119246127
[2023.01.24-15.53.40:887][670]LogNet: SteamSockets: Connectionless handshake complete
[2023.01.24-15.53.40:901][672]LogHandshake: Incoming: Rejecting game packet with invalid session id (0 vs 0) or connection id (1 vs 0).
[2023.01.24-15.53.41:097][695]LogHandshake: Incoming: Rejecting game packet with invalid session id (0 vs 0) or connection id (1 vs 0).

Basically the client never travel to the host/server map that is set in listen. When the host disconnect the client reload the lobby

limber gyro
#

how are sessions handled when they are empty, are they cleaned automaticly or do u have to clean them somehow? i know u cant make 2 sessions in a row without closing the client

limber gyro
#

are specifing the correct port 2015 when u ping the steam server?

fierce grove
#

the ID is not this one

#

76561198062121577 < this is the ID

#

I also tried with open steam.76561198062121577:7777

rancid monolith
#

thought compartmentalizing the data could be convenient

limber gyro
#

u shouldnt need to use the port when opening a steam server

#

i have my players connecting through steam so i probably have done what u need

fierce grove
#

I'm making a lobby then broadcasting to everyone that the game has started and people connect using open steam.

#

I tried with creating sessions / joining and basically the same thing happens

rancid monolith
limber gyro
#

so ur server is not a separated.exe? is not compiled?

fierce grove
#

nope

limber gyro
#

if u make a session i think u have to connect through the sessions node, but im not sure on this

fierce grove
#

I tried both standalone and packaged

#

join session node had the same problem

#

connecting but not travelling to the map

limber gyro
#

are u messing with the source code or just BP's

#

ok so the players can connect but they cant travel?

fierce grove
#

yes

limber gyro
#

oh, that i havent done

#

what are u using for travel?

#

whats the node

fierce grove
#

On the host

#

`[OnlineSubsystemSteam]
SteamDevAppId=480
SteamAppId=480
bVACEnabled=True
bEnabled=True
bUseSteamNetworking=True

[OnlineSubsystem]
DefaultPlatformService=Steam

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000000
MaxInternetClientRate=1000000000
InitialConnectTimeout=120.0

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="SteamSockets.SteamSocketsNetConnection"`

robust oriole
#

I have an actor with a (relatively) large amount of subobjects that require replicating. Each subobject just holds 1 variable that updates very infrequently and only one or two at a time. When my client loads into the game theres a noticable delay between PostLogin and when all the Server-Client communication has finished (which i see because my players sprite needs to get initialized on server side). Do you have any advice for how i could improve the performance of my game?

#

actually i think i might have just found one myself. I have a "grid" actor that holds a number of "tile" subobjects, and those "tiles" keep a record of which actor occupies them. But instead i could just have the grid remember which actor occupies which tiles, which is way less data to save

limber gyro
twilit radish
#

@fierce grove you can try the following console command in the editor when running as the host, it seems like something is invalid but I'm not sure what. Can at least try to see if that's the issue:

net.VerifyNetClientID 0

limber gyro
#

also that function, setLobbyGameServer, i have absolutely no idea what it does

near granite
#

How do I get Sequencer to play simultaneously on all clients? Since the clients will be in the same space, the music must be in sync with each other.

twilit radish
#

That's not the issue. The server is actively rejecting the connection, sonicphi. As per their logs they just shared:

[2023.01.24-15.53.41:097][695]LogHandshake: Incoming: Rejecting game packet with invalid session id (0 vs 0) or connection id (1 vs 0).

limber gyro
#

so im assuming hes traveling incorrectly

#

i dont know about the internals when u open a new map, maybe ids are being reset

#

also hes doing it on sessions

twilit radish
near granite
robust oriole
#

if a USTRUCT member is replicated does it replicate all member values of that struct?

limber gyro
#

@eternal pagoda try to print ur session ID everytime you call a function

#

you will see where it is changing

#

then u can pinpoint what function is messing ur stuff up

#

after that check the source if u can

#

if u cant, try a new function lol

twilit radish
limber gyro
#

maybe that "lobbyData" ur using is being reset somewhere

quasi tide
#

Goes a bit more in-depth as well

near granite
#

Is there a way to create game state variables at runtime? I want to keep creating a variable with the same name in the gamestate even after server travel

eternal pagoda
#

pinging the wrong max lmao

near granite
#

When the game mode is initialized by server travel, do all the variable lists saved in the game mode disappear?
Or do only the variable values โ€‹โ€‹become default and the variable names remain the same?

twilit radish
#

The gamemode doesnโ€™t just delete defined variables. It however doesnโ€™t necessarily persist the data those variables hold after restarting.

twilit radish
#

In general the game state is different from the game mode, but this in specific is the same yes.

#

Both do not persist data beyond a restart.

crystal crag
#

If you want to build a multiplayer sword melee game, are you pretty much resigned to switching off the orient rotation to movement?

#

I was thinking that I wanted to somehow allow the player to aim their sword swing as they were swinging, correcting the feet and spine chain as they turn with the swing

quasi tide
#

You can create a child of the CMC and override the function that handles the logic for that. That's what I did.

crystal crag
#

Was that a reply to me?

#

I'm guessing so

quasi tide
#

Yeah

#

Then, all you do is just keep that box checked and bam - you're done.

crystal crag
#

So your CMC and anim BP graph handles letting the player turn around midswing and it looks natural? I'm wondering if the UE 5.1 new motion warping or pose warping (or both) could help me achieve what I am trying to do

#

Since documentation on custom CMC is scarce. At least I have only seen custom movement modes in C++ for custom CMC, nothing beyond that thus far.

quasi tide
#

anim bp graph shouldn't be involved imo. Also, my game isn't a fighting game, but the concept still applies

crystal crag
#

Right it doesn't have to be a sword swing

#

anything with the general motions and aiming

quasi tide
#

Animation should just be playing forward, then the CMC rotates for you

crystal crag
#

ah

fierce grove
#

I've tried with 2 plugins / advanced steam session and steam core and I have the same problem... is there something new in ue 5.1?

crystal crag
#

I was thinking about that. Only having a forward and then use something to correct the bones

#

But how is your custom CMC twisting the bones? Doesn't it just generally manipulate the capsule?

quasi tide
#

I haven't tried any of the new animation stuff networked yet though. So don't know how well that'll work

quasi tide
#

The CMC simply rotates for you

crystal crag
#

I don't get why you need a custom CMC for that then. I must be missing something. The CMC already handles rotating and the player's aim is already replicated

quasi tide
#

You specifically asked about the orientate rotation towards movement option

crystal crag
#

True

#

Ok, so you leave yours on, which is what I have now. My problem is I want the legs and spine to twist to match the character's aim.

#

So that's more of the anim bp. Are you using control rig or anything?

#

Or are you just blending based upon yaw?

near granite
fierce fiber
#

Hello! I have a quick question for any multiplayer experts! Im making a local coop game (spitscreen) and was wondering, if I have a boolean in the thirdperson character called "giveweapon?" But I only wanted to activate the boolean for a specific player, how would I go about doing this, the weapon thing is just an example of what Im trying to do with booleans for different existing thirdperson pawns in the world

fierce grove
#

if someone has a working example of advance session or steamcore working with 5.1 that would be awesome

#

lost a full day on it

shy yarrow
#

I want to create such a feature for my game that shows the friend's location on the screen with an arrow that shows the players where are the friend's locations, like call of duty zombie black ops,
but I don't know what I must search to find a tutorial. what is this feature name? any one can help?

near granite
#

Server Travel not working (UE5.1)
should i put the whole path of the map to the command console?

sinful tree
twilit radish
#

Also your logs usually tell you if this stuff is wrong ๐Ÿ˜‰

#

At least in the editor I guess lol.

near granite
twilit radish
#

The logs are pretty useful with a lot of things ๐Ÿ™‚

near granite
#

That's right, I'm glad I come to know that!

#

I wasn't familiar with Rogue because it looked so difficult๐Ÿซ  Thank you!

near granite
#

I only let the level load, and when the game state variable changes, I turn on the visible of all clients' levels through tick. but Level visible doesn't turn on...

#

Is there a problem with just loading the level and setting it on visible later in another line of code?

pure vigil
#

My brain is having a little.. divide by zero moment. If I want to run an RPC function on a single client, is the only way to do that if the client is the owner? Scenario is a player triggering an overlap event on an actor, I want to use SetVisible just for that player

#

I imagine instead of using SetVisible I could spawn an actor just for that client, making it the owner and have it so it's only replicated to the owner.. just feels a little messy

twilit radish
#

Just send it from within the PlayerController to the client with a reference to the actor.

pure vigil
#

Hmm. So from the Overlap event on the actor get the player controller and tell it to run a function, then from the PC run a multicast function so only the PC's owner will run it. Ya that would work but I hate the idea of having a function on the PC that is specific to this actor

twilit radish
#

You would not run a multicast. You would just run a regular RPC to the client as the client already owns that PC.

#

Ideally it wouldn't even be a RPC considering it's a state I guess.

pure vigil
#

Sure, sure.

"Ideally it wouldn't even be a RPC considering it's a state I guess." not sure what you mean by this part though

#

I want my server to be the authority on whether the client overlapped the actor so I don't see how an RPC is unavoidable. Or are you just saying to use a replicated variable instead

#

Still, my biggest problem with it is having a

UpdateSomethingSpecificForThisActor()

function on my PC..

twilit radish
#

You're changing the state of how that actor is perceived in the world. If your client disconnects and joins again that state isn't the same (or loses relevancy for example) because it was a RPC.

#

Depends on the use case I suppose though ๐Ÿ˜›

pure vigil
#

Hmm, that's ..true.. I may have to revisit this problem later when I have more brainpower to focus on a proper solution.

sonic python
#

Hey My Touch Interface Joystick Isn't working

#

It worked at first but not now

#

How to fix this?

tall raft
#

Debug

#

Add some breakpoints and prints

#

If it worked and itโ€™s not now then you can make it again

#

Guysssssss, I have a more complicated issue and a bug to report.

#

In short, in multiplayer if the player is not an owner of any rigibody actor, then this actor physics will never go to sleep locally, for remote players. They will have object jitter around and non trivial performance cost for each physics object on scene.

#

Iโ€™ve confirmed this on 3 different versions of Unreal 4.26,4.27

gloomy tiger
tall raft
#

Yes, this also happens if someone else becomes the owner.

#

Soo this is intended behaviour?

#

Like what

#

I can manually handle this, but is it really how it works? Everyone just has to manually put objects to sleep for non owners?

#

Whatโ€™s the best solution to fix it?

#

Why itโ€™s not taking โ€œsleepโ€ thresholds from the object?

gloomy tiger
#

Once you set an Actor's dormancy to sleep on the server, that Actor will no longer replicate stuff about.

#

If physics are enabled once you put it to sleep, clients will manage it themselves.

tall raft
#

Change dormancy at runtime? I tried all of its settings with no changes.

gloomy tiger
#

What are you trying to accomplish?

#

Ragdolls?

tall raft
#

Lower the performance cost of apples lying around to grab by vr player and throw around

#

Simple stuff

#

Just 200 objects I placed on a big scene

#

Jitter is unnoticeable in vr but itโ€™s cost for my mobile vr game is too big, it they sleep as they should (on host in p2p) itโ€™s all fine.

#

I use Smoothsync to replicate movement but this issue is not relevant to the plugin , we tried without it.

gloomy tiger
#

I'm implementing something quite similar; not at that scale, though, and my take on it is broadcasting an event that "apples are lying" and enabling physics/disabling physics on both client and server instances.

gloomy tiger
#

It's working pretty well; it's consistent; and I see no performance hits. But again: my scale is not 200.

#

You're running that on a replicated actor, right?

tall raft
#

This is what I used to mitigate the problem

#

Yes on all grabbable physics objects

#

This is nasty workaround and now when I know the cause I can make something better

gloomy tiger
#

Hm.

tall raft
#

You can see this behaviour clearly if you tick physical actor printing if itโ€™s awake

#

It always is on remote until they became the owners

gloomy tiger
#

When it comes to performant solutions, they usually look "weird" and "non-practical". It sounds counter-intuitive, but if that's solving your problem, go for it with no mistake.

tall raft
#

All object which should be sleeping are not, cost for updating physics and overlaps and everything is obvious.

gloomy tiger
#

One thing you may try

#

Disable that and let each instance to handle physics themselves.

tall raft
#

I think I tried but sounds good, god bless your memory ;P

#

Maybe this

gloomy tiger
#

I bet your jitter problem is the server trying to adjust location.

#

Once that's disabled, the server will no longer intervene.

tall raft
#

Smoothsync also has an option to replicate sleep and ignore small changes, I can set it to any value. And I did with no success

gloomy tiger
#

Although I know SmoothSync, never really used it.

#

So I can't contribute there.

tall raft
#

Iโ€™ve seen itโ€™s code, itโ€™s just basic stuff everyone would do, proper replication done in a proper way.

#

Iโ€™ve asked an author and he also pointed itโ€™s not an issue with Smoothsync directly

#

And he didnโ€™t know about this problem and personally tried on two versions of unreal

#

And I canโ€™t really find anything related on the web which is suspicious with this kind of thing

#

Thx for help, sending love and peace, come up to my place so we can drink a tea if you ever nearby ๐Ÿ˜‰

gloomy tiger
#

Love Poland. โค๏ธ

#

And I really appreciate your kindness, although I wasn't much of help. Ha!

#

Cheers from Brazil. ๐Ÿ‡ง๐Ÿ‡ท

obtuse field
#

I have a component that holds the web socket connection on the client and need to stay the same when moving between levels. It can't loose connection, nor it should reconnect. What container for it should I use? GameInstance?

twilit radish
#

GameInstance(Subsystem) for example yeah. Also I would highly recommend testing that in a full packaged build. I was just using this my self for something I was making and it crashes my build because of a bug in how it initializes.

obtuse field
dawn fog
#

Hey guys! Basically i was trying to make a shooting system using the player camera manager but i can't seem to make it work cause of it using the 1 players camera and not being able to kill anyone.So how can i get the ID of The Get Player Camera Manager?

verbal tendon
#

thats what the Collection is for

#

also dont make too many dependencies between subsystems

#

๐Ÿ˜

twilit radish
#

A pull request for it got merged into Unreal 3 weeks ago, not sure if itโ€™s my fault tbh.

#

But yeah, I was going to do that tomorrow ๐Ÿ˜‚

verbal tendon
#

๐Ÿ˜‚

verbal tendon
twilit radish
#

Itโ€™s midnight alright ๐Ÿฅฒ

#

Although to be fair the whole way that websocket module worked is pretty weird lol.

#

I think Iโ€™m just going to merge it into my own source build. Might as well I guess.

verbal tendon
#

Uhm .. what lol

#

That

#

is awkward AF

dawn fog
twilit radish
verbal tendon
#

That code needs to be burned with ๐Ÿ”ฅ

twilit radish
dawn fog
#

this is all i had to do

#

BRUH I WASTED LIKE 2 HOURS

#

hate making multiplayer in ue4 bruh

twilit radish
#

Welcome to game development.

#

๐Ÿ‘€

dawn fog
#

i have already been welcomed a year ago but today i wanted to learn multiplayer

#

and i its painful

#

dam

twilit radish
#

This is by far not the worst stuff yet though.

dawn fog
#

what's the worst?

#

in ue4 to do

#

Making Maps?

twilit radish
#

The character system is up there I would say. Probably prediction for a lot of people too.

dawn fog
#

yeah tbh its hard i tried to make my own took me like 3 days it kinda reminds me of gta v

twilit radish
#

Also I guess bugs that only happen at random with a certain amount of latency lol.

dawn fog
#

yeah bp are very slow

#

compared to c++

#

that's why you have to make everything so organised and not too long

#

or else chaos will appear on your screen

#

like this

#

not my code

#

btw

gloomy tiger
dawn fog
gloomy tiger
#

This is blueprints from the streets you know

dawn fog
#

i organise mine like this

gloomy tiger
dawn fog
#

this is my old organised code

#

from a year ago

#

pink one is a fuckin mess

gloomy tiger
#

Gash. I remember the times I was full Blueprints lol.

#

Using Blueprints at that scale now gives me anxiety

#

You using BlueprintAssist?

dawn fog
#

nope

#

is like a plugin?

#

that organises stuff?

gloomy tiger
#

Yes

dawn fog
#

oh

#

nice

gloomy tiger
#

You press a button and it automatically organises your nodes for you

dawn fog
#

is it free?

gloomy tiger
dawn fog
#

i just press q

#

and it will make everything in a straight line

#

but in some cases it doesn't

#

or just makes it look weird

gloomy tiger
#

Say you have this spaghetti

#

You press 1 button and...

dawn fog
#

oh

#

that looks a lot better

gloomy tiger
#

Wait

#

The straight lines is another plugin

#

Electronic Nodes

#

Now, without Electronic nodes ๐Ÿ‘†

#

You press one button aaaaaand:

#

But both are paid :/

dawn fog
#

yeah i saw it

gloomy tiger
#

Although I'd say BlueprintAssist is a must, specially if you're 100% Blueprints. ๐Ÿ˜ข

dawn fog
#

19$

gloomy tiger
#

Electronic Nodes is meh

gloomy tiger
#

Yeah :/ - PS: I'm not affiliated with the developer of BlueprintAssist, it was me #justsaying

dawn fog
#

k

#

alright thx for the reccomendation

#

i might get it

#

if i have enought money left in my card

#

lol

prisma snow
# dawn fog

this is why I hate nodes. Even in materials I recently tried writing HLSL and the difference is huge

twilit radish
#

Normally I agree. But burn HLSL ๐Ÿ˜‚

fossil spoke
#

Guys back ontopic please.

twilit radish
#

Sorry ๐Ÿ˜…

dark edge
# dawn fog

It's a lot cleaner if you don't ever let anything but execution go from block to block

#

Stuff like this is gross

clear island
#

anyone know how I could make the t. MaxFPS cmd work only for the client?

#

testing in the pie, I wanted to test my game when the client has low fps

#

but when I execute that command on the client, it affects the server too

latent heart
#

Make sure you don't have "run under 1 process" in the PIE settings ticked.

clear island
near granite
#

This event binding not working..If i replace it to delay, code works well What am i doing wrong? I need to use the time when loading is finished

near granite
twin juniper
#

I've got a casual setup and networking is going relatively smoothly but I was just curious what packet loss level I should be simulating? I've been running at 20% but I've heard that even 5% is considered excessive?

graceful flame
#

Depends on your game and how noticeable packet loss is. I test with both the Average and Bad profiles. 5% is pretty bad for a network but you could probably have spikes of up to 100% at times. In the real world the duration of a "lag spike" is variable and could last anywhere from a few seconds to an all out failure of the network. So how you handle that situation depends on your game. Maybe you have a widget that pops up when packet loss reaches a certain threshold and informs the player of what's going on.

glass vector
#

how do you check if the client or host has the same game version as you when searching or joining a session?

#

ie, if two players have different game update versions (on android or pc), they can't join each other's games

warped token
#

Hi,

I have a widget blueprint set up to spawn on each player's screen. I'm trying to make it so one player can reserve a certain role and be only client in that role unless they relinquish it. In each playerstate I have an enum that corresponds to the five roles possible. I'm struggling with figuring out how best to store and replicate that enum from the server versions of the PC/PS and GS and get it to the clients. This was as far as I got visually.

#

I imagine I need to put a "run a server" custom event that calls a multicast somewhere, but I'm just not sure if it goes in the player state, player controller or elsewhere entirely, and how to validate the playerstate's enum against the other player's playerstates is a bit lost on me.

sinful tree
# warped token Hi, I have a widget blueprint set up to spawn on each player's screen. I'm tryi...

Replication only happens one way, from the server -> client. Any variables that you want replicated must be set on the server.
So your OnClicked needs to call a "Run On Server" event, likely best on the player state as that is where you'd want to store your selected ENUM value.

Once you've verified on the server the selection, you can set the enum variable on the playerstate. You can make it a "RepNotify" variable which can then trigger an OnRep function when it replicates to others so you can update any UI, including if other players should be able to select the option or not.

You also do not need a "Replicated Player States" array. There is already an array on the GameState called "Player Array" that is generated automatically client side (and on ther server) whenever a player joins the game.

glass vector
#

are game mode and game state, player state, destroyed when travelling to a new map?

sinful tree
vernal osprey
#

Hi, could anybody help figure out what is wrong with this BP? Client-A is the server and updates its Nameplate and Client-B but Client-B only updates its own and not Client-A.

sinful tree
# vernal osprey Hi, could anybody help figure out what is wrong with this BP? Client-A is the se...

Don't use RPCs for something stateful.

You can send a client -> server RPC to transfer the name, as you're doing, but then set that name in the playerstate in an OnRep variable.
The OnRep function should then call an "Update Name" function in your character which takes the name as an input and sets the text like you're doing. To access the player's character from player state, use the Pawn Private variable and cast to your character.

In the character's begin play, you can then also run the function that updates the name - this is mostly for when characters are out of relevancy range and when they come into relevancy the name will be updated with the value from the playerstate.

vernal osprey
#

Perfect, works flawlessly. Very good solution, thanks man

warped token
sinful tree
# warped token Thank you! This has gotten me most of the way there, there seems to be a few hit...

In here, don't set the enum until you know for certain that no other players have the role. I'd also put this within a function just so you can use some local variables, namely a boolean that you set to true in the loop if you have someone that already has that role. On the completion of the loop, you then check if that boolean is true - if it is then that is not a valid selection as it's already in use. If it's false, then you set the enum on that playerstate. Edit again: No it stands. Set only after you've checked all players. You can still break if you detect just to loop less ๐Ÿ™‚

warped token
sinful tree
fierce grove
#

Are Steam sessions really broken in 5.1?

fierce fiber
#

Hey guys! I'm trying to create a teleport system for my local multiplayer game. All works well here, other than the fact that it only teleports the second player? Not too sure what I've done wrong as Im still very new to programming multiplayer mechanics into UE5. Many thanks if someone can help!

kindred widget
fierce fiber
kindred widget
#

What is the full intended effect here? Do all players need to be in this area before teleport?

#

Can each teleport individually?, or are you just trying to teleport everyone when any character overlaps this?

fierce fiber
#

So essentially (because Im still studying the ways of implementing multiplayer mechanics), I have added a huge collision box contained in an actor called "teleport players". On the begin play event, the collision is turned off so that once the players have chosen their roles and pressed the ready up bind, the collision can be enabled again, triggering the overlap event, teleporting both players to a location, which in this case, are 2 spheres contained within the same actor blueprint

fierce fiber
#

Ok I made it work in the end, just had to copy and paste the bp and remove the connection between the teleports to target the designated class

real ridge
#

[/Script/OnlineSubsystemEOS.NetDriverEOS]
bIsUsingP2PSockets=true
P2PConnectionTimeout=80
MaxInternetClientRate=15000
MaxClientRate=20000
NetServerMaxTickRate=60
ConnectionTimeout=20
InitialConnectTimeout=60

[/Script/OnlineSubsystemUtils.IpNetDriver]
ConnectionTimeout=60.0

Guys can I ask? How I can set best values for these things in multiplayer? Also is there any solution how to set how many packets can be lost? during gameplay because my friend tested game with me and he lost 2 packets and his window freeezed during it. Thank you.

twilit radish
#

Packet lost is not something you can control that much, the engine can drop unreliable messages when there's too much network load (I think at least?) but your message can also get lost when send across the internet. You're simply going to have to deal with this scenario, every game has to.

verbal tendon
#

There is network noise, and packet loss is a thing

#

reliable packets are sent through a special mechanism that emulates TCP (reliable protocol, arrival and order of arrival guaranteed ) properties on top of a UDP connection

twilit radish
#

๐Ÿ™‚

real ridge
old sequoia
#

Hi!

I'm making a multiplayer game where the client seamlessly travels to a server world.
The client can disconnect and reconnect to the server.

When the client connects issues may arise from internal systems accessing objects / object's variables before they have been replicated from the server and initialized (as you may very well know)

In order to ensure functionality I'm creating a system that serves to monitor certain objects and values and to make sure they have been replicated across the network and initialized before they are accessed by the client.

If I make this system into a GameInstanceSubsystem I know that the subsystem itself exists before objects are replicated, and everything works smoothly. Whenever objects are "ready" they notify the subsystem and the subsystem dispatches the relevant information.
However, when developing the game in editor I usually play with multiple simulated clients in a single process, which causes multiple clients to communicate with the same subsystem.
This causes the concept of "Is the local Player State ready" to become overwritten, for example.

Thus making it a LocalPlayerSubsystem sounds more reasonable.
The issue with a LocalPlayerSubsystem, however, is that I don't know if the LocalPlayerSubsystem is guaranteed to exist before anything else in a multiplayer game?
Is there a guarantee that I can access it as soon as objects start being created / replicated when connected to the server?

If so, what is the correct way to fetch the LocalPlayer?

Thanks!

sonic python
#

Hey Is Google Play Services a Online Subsystem?

#

If yes then Can it be used for multiplayer matchmaking?

#

How to add it?

kindred widget
old sequoia
kindred widget
#

Pretty sure that removes a player subsystem then. Bit odd that you're getting the same subsystem from multiple editor windows though. As far as I was aware, PIE created a separate GameInstance for every PIE instance.

old sequoia
#

There's a slight possibility that I've misinterpreted my results and made the incorrect assumption.
I'll run a proper test and report back

#

@kindred widget
You are absolutely right. Embarrassingly enough I think I invoked the synchronization event on the dedicated server in my initial test, causing me to misinterpret it as being a shared game instance on the clients. They all seem to have a unique GameInstance.
Thanks again! ๐Ÿ˜…

jolly delta
#

is anyone with that gif may have an idea why my ai has a laggy behaviour ?

old sequoia
old sequoia
# jolly delta this one ?

Try resetting all settings to defaults under Character Movement (Networking) settings.
Are you playing as Listen Server configuration or Client?
It could be the case that your AI is moving on both the Client machine and Server, causing corrections.
Try playing with the console command p.NetShowCorrections 1 and see if you see any green / red capsules show up. This tells you that the Server is correcting the positions of your AI on the Client machine. You should only move the AI on the Server

jolly delta
#

Are you playing as Listen Server configuration or Client?
we play with a dedicated server, so all clients are only clients, so server only has authority on the controller. Controller is only created on server right ? controller is not supposed to be replicated (?)

Try resetting all settings to defaults under Character Movement (Networking) settings.
where ?

p.NetShowCorrections 1 > on client console ?

#

p.NetShowCorrections 1
nothing is showed so there is something wrong i guess

old sequoia
# jolly delta > Are you playing as Listen Server configuration or Client? we play with a dedic...

All controllers are created on the Server, but each Client has its own local Controller.
They're not replicated but are created in a way that they gain elevated network authority (the Client can send RPCs to the Server directly through it, etc)
The Controller is separate from the pawn the controller moves.
You should make sure that only the Server moves the AI pawns.

You reset the settings in the component settings when you click your Character Movement Component in the Blueprint editor

Yes, enter the command on the Client console.

jolly delta
jolly delta
#

everything is setup by default

graceful flame
#

Event possess > Ai move to

sonic python
#

Guys

#

Is A Online Subsystems Definitely Needed for a multiplayer game?

#

Create,Join , Find Session?

winged badger
#

in theory no, in practice very much so

sonic python
#

In practice?

#

Does It Mean like for players , to start a match

winged badger
#

you could get by playing on LAN with your friends without a session system

#

but not much else

sonic python
#

A Online Subsystem has to be used?

jolly delta
winged badger
sonic python
winged badger
#

its just simpler that way

sonic python
#

Like

winged badger
#

you do get to pay the entry cost first time around though

sonic python
#

For Games Like Fortnite , Pubg ?

graceful flame
sonic python
#

Start a match, a online subsytem helps to create sessions?

jolly delta
#

but when i remove it it just do nothing

winged badger
#

subsystems as such are relatively new, but the implementation isn't much different

sonic python
sonic python
graceful flame
#

The delay is causing the laggy AI movement, so you need to know when the player pawn is already right? You could dispatch an event and when itโ€™s called you can spawn your AI.

winged badger
sonic python
#

Ok but it's more easy to use Lan right?

jolly delta
graceful flame
sonic python
#

just ticking these should be enough to use lan right?

#

Zlo?

vestal bobcat
#

Does OnNetCleanup gets called if we experience a crash so to do some cleanup in a pawn ?

gloomy tiger
#

If the crash breaks up the connection, then yes.

vestal bobcat
#

ok cool thanks

hybrid crown
#

Hello,

I would like (c++) push the player in XYZ direction when he receive a bullet,
I perfectly see how to avoid server correction with the CMC for jumping, but i don't get the process when the player is not aware of the velocity change in first.

Any help, video, or ressource on this ?

chrome bay
#

To some extent you have no choice but to live with corrections. Client is forward-predicting, but bullets will be behind. Best bet is to apply on both server and owning client, and hope the correction goes largely unnoticed.

hybrid crown
#

correction*

#

or it would be better to juste increase net distance correction ?

chrome bay
#

Won't work. Bullets are behind by clients ping, by the time they know the bullet has hit them it's already too late, server will have corrected (or at least, move will have been sent to the server)

#

The two things are happening in different frames of reference.

twilit radish
#

There's also no point in having a grace period because then the client will just override the action.

hybrid crown
#

I see.

chrome bay
#

Exactly. Queue a "no bullet stopping power" hack

hybrid crown
#

(and increase distance correction for the whole character and hope will not do the trick ?)

chrome bay
#

Correction distance won't help, it'll just result in larger errors and clients will be in the wrong place

twilit radish
#

As in that the client cheats by saying it never received the update and just abuses the 'grace period' it has.

#

Is what I assumed Jambax meant.

hybrid crown
#

So, there is 0 way to do it at least less noticeable for the client ?

twilit radish
chrome bay
#

The client could "forward predict" bullets that are near it by their ping factor, to try and predict stopping power, but it's still gonna be flaky

quasi tide
#

Just don't make PvP games and let players do w/e they want. Networking on easy mode ๐Ÿง 

chrome bay
#

Might result in more misspredictions tbh

twilit radish
chrome bay
#

Gears of War had stopping power and there's nothing explicit for it in the codebase, so guessing this is what Epic did tbh

#

They also used hitscan though, made life a tad easier

#

Less time for things to go wrong or diverge

twilit radish
#

I don't see how on earth you want to predict a bullet though. At least if we're talking with other clients shooting them. You can't possibly predict a different client shooting ๐Ÿ˜›

quasi tide
#

In my co-op game, I do hitscan with the client and the client tells the server, "Hey I hit this", server does an ultra simple linetrace itself, and if it was possible, just agrees.

jolly delta
#

is anyone can tell me the right procedure to spawn an AI ?
like i do :
spawn on gamemode
ai controller : on possess -> do action

ACharacter is replicated and mouvement too

quasi tide
#

Doesn't have to be in the game mode

#

But all you do is, while on the server, spawn an actor like normal

#

Set your AI pawn class to auto possess when spawned or placed in the map and that's about it

#

Make sure it is also using the correct AI controller though

hybrid crown
#

but same idea.

#

Ooooh, i've maybe have idea, a bit cluncky but

#

Player receive the bullet -> Client apply the force, then send to the server who apply also the force.

#

not cheat proof, but should be seamless

twilit radish
#

It will look delayed on the server as well though, but that's kind of your only option if you really want this I guess.

chrome bay
#

Predicting your own.. not so bad. Predicting other player projectiles? Noooo chance

twilit radish
#

That's why I still don't understand how Rocket League works lol. How do they predict the ball when other clients are touching it? xD

hybrid crown
#

and will not look so clunckly hopefully.

#

until someone have 200ms.

#

"go play on your own server f************"

quasi tide
#

And also spent like 2 or 3 years on this specific thing.

#

I recall them talking about how they were working on it for so dang long.

twilit radish
#

But still, conceptually I don't see how you want to predict a ball on the client while a moving other player can change the trajectory to anything at any time. I see how that works when you're the one playing but I don't see how that works with others lol. Although I know RL is far from perfect, but as far as I can tell it does not constantly set back the ball when someone else is doing things with it.

#

The one mystery that I'm really curious about haha.

graceful flame
fleet viper
#

@thin stratus and @twilit radishIm the guy with the weird ai replication bug from yesterday, I finally found the culprit. I replicated a bool on my character cpp class and that made the ai's replication glitch out. I still dont understand why, since members should be able to replicate on an AI's character class. Now to my question since this is prob an engine bug(I did everything like in my normal player char class to replicate props) is it worth opening a bug ticket? Never reported an engine bug, thats why.

twilit radish
#

How did you define that stuff?

#

It seems really unlikely to me that it's an engine bug honestly. Trust me, been there many times ๐Ÿ˜‚

verbal tendon
#

Given the amount of uncertainty in your messages it is highly likely to be user error, rather than an engine problem. Of course, nothing is ever guaranteed in life, that is just an educated guess

#

If you post the exact context, code etc... comparison of what worked vs what didnt. Someone can help you make that determination better

fleet viper
#

made a normal declaration of bool Dead = false; with upropertys(replicated). In cpp i then added it to the replicate function void AMetaAI::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const { DOREPLIFETIME(AMetaAI, Dead); } I also added the Unrealnet include in the cpp file. Replication is enabled as default if im correct.

#

thats my setup

#

@twilit radish

twilit radish
#

And there's your issue.

#

You're not calling the super so it won't do any of the replication properly for the rest ๐Ÿ˜›

fleet viper
#

oh

#

right

#

that explains everything

twilit radish
#
void AMetaAI::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(AMetaAI, Dead);
}
```:D
fleet viper
#

i swear this happens too often to count

twilit radish
#

I do it all the time too with random stuff ๐Ÿคฃ

fleet viper
#

thanks a lot for the help!

verbal tendon
#

And there we go, that is why it is easiest to give as much context as possible, including code snippets

#

I had to take a phone call and by the time I got back to reading someone spotted the issue ๐Ÿ™‚

#

Always call super. This includes making nodes to call parent function in BP

#

I have lost count of how often I have needed to drill this into people...

#

๐Ÿ˜‚

fleet viper
#

yeah, weirdly it always happens to me when i declare the lifetime replciated props function

naive wyvern
#

Hey there, I hope it's okay for me to double post from a different channel, didn't realize there was a multiplayer one. I've been trying to work with the CharacterMovementComponent to create a Teleport, but it seems like the teleport works when I run the project in the "Standalone" play mode, but if I play as the client, the player gets rubberbanded back to their original position due to server reconciliation

#

would be happy to post code, but I'm not 100% on where this issue might be coming from

twilit radish
#

Would definitely be a good idea to show how you did it yeah. Generally I would assume the issue being that the client teleports but then the server doesn't and then the server corrects the client, at least is what it sounds like so far ๐Ÿ˜›

naive wyvern
#

I'm almost certain that that's what's happening, because I can see the client teleport to the expected position for like, a frame.

I'm honestly also still learning how the CharacterMovementComponent works, so I was having trouble finding what functions handle the corrections from the server

#

this is the function that physically teleports the player as a start:

void UShooterCharacterMovement::ProcessTeleport()
{
    FHitResult res;

    UE_LOG(LogTemp, Warning, TEXT("processing teleport %s"), *(teleportDestination).ToString());

    SafeMoveUpdatedComponent(teleportDestination - GetOwner()->GetActorLocation(), GetOwner()->GetActorRotation(), false, res, ETeleportType::TeleportPhysics);

    execSetTeleport(false, FVector::ZeroVector);
}
rose egret
#

@fleet viper AI actors exist only on server they are not replicated

fleet viper
rose egret
#

by AI character you mean ACharacter derived classes ?

honest rain
#

hello !
I am trying some things on multiplayer these days, and I am in the context of a dedicated server that would be supposed to run for days.
Players can alter the world ( ie actors that are part of the map ), and to be able to replicate those changes each time a player connects, I am basicly destroying all the actors and re spawning them client side from what the server has been saving on its side.
It works great, but I am afraid that the more the server 'lives' and register changes, the bigger the loading client side will be since it basicly adds up more and more...
Would you have any suggestions on how to optimise this ? I was thinking maybe saving the map with all actors 'as it is' as a new map server side, and just send the map to all players connecting afterwards, but not sure on this one...

twilit radish
#

If we're talking just a couple tens of actors every so often just set the distance on when they become relevant to something appropriate so that not all actors constantly replicate towards the clients but only when they are near them.

honest rain
#

ooh I see, it would be kind of making a chunk replication system right ?
Although here I am more talking about hundreds, if not thousands of actors... making this 'chunk' process even more needed

oak oracle
#

Hi devs , got a quick noob question, if i spawn a replicated actor the server , since its is replicated it will be automatically spawned on the clients as well right?or i am messing up something?

quasi tide
#

Allegedly, yes.

edgy patio
#

Same if you destroy it from the server

real ridge
#

guys is this good way of setting players name in multiplayer game or not?

twilit radish
#

Why would you call a RPC if it's already a replicated variable? Just use an OnRep. (Which is also better than a RPC IMO in this case).

twilit radish
#

Yeah.

real ridge
#

but I can try repnotify

#

but I remember it did not work too

#

yea RPC does not work

#

he should has name test

#

so i used this

honest rain
#

I think instead of setting the name from the server to the player

#

you should try asking for the name from the server, using your character controller

#

the widget you are using probably ( ? ) only lives on your owning player, and the server can't access it

#

just a guess though

real ridge
#

i am using player pawn widget

#

uh

real ridge
real ridge
#

idk why I see my own name but name of enemy is not replicated even it's in repnotify

#

should I rpc rep notify?

edgy patio
#

Looks like you are setting the nickname on the client without a Server RPC

#

The replication works from Server to Client.

You change the value in the Server (if from Client than you should make a Server RPC)
The Server will change the value and replicate to clients

deep coral
#

Does point damage also trigger 'Event Any Damage' ?

silk nexus
#

Good evening all. I have this intuition that I'm missing something very fundamental on my collision-based RPC. The listen server does not activate the On Component Hit event when a client hits the actor's collision mesh (sphere). I am using the default pawns in the map.

When the listen server pawn hits it, it properly triggers the multicast. When a client hits it, the client instance triggers the event as well.

Perhaps I'm fundamentally misunderstanding how this is supposed to work. Do you see what I'm doing wrong?

woven basin
#

So even the client pawn, that pawn still lives on the server. The server handles it and letโ€™s the client know.

silk nexus
#

That's what I'm trying to do

#

Hence why I say my intuition is that I'm doing something fundamentally wrong here

#

I'm monitoring the instance of the server object

#

Is there some document I can read? I've pored over the guides in the official documentation and read a search here for "client collision" but something is not clicking

real ridge
edgy patio
# real ridge should not rep notify automatically be replicated on clients and server too?

rep notify = a notification that a replication happened.
The replication system happens from Server to Client.

So in your example the Client has the Name. He first need to make a Server RPC so this data can be send from Client to Server.
The Server receives the RPC and update the Name. Since this is marked to replicate, the Server will replicate this data to all relevant clients. Since this replication has a notify the OnRep_NickName triggers.

real ridge
#

sure hmm

#

also look this is how I had it before and it didn't work too

#

this is rpc

edgy patio
#

The Client Set the NickName then make a Server RPC that directly make a Multicast RPC

#

The Server need that NickName data.

#

UE use Server Authoritative model. The replication is just one way, from Server to Client.
If your Client Set the NickName there is no replication.

#

The Client has the NickName value.
He sends this data to the Server using Server RPC.

The Server set this data value and since this variable it will be replicated to all clients

near granite
#

If I get player 0 pawn from the level blueprint, is it player 0 on the server or player 0 locally?

thin stratus
#

Both

sweet ore
#

do i need to set has auth to begin play on repnotify?
because when i set has auth it is not setting the name

sweet ore
upbeat basin
#

Are you setting something to itself?

thin stratus
#

Not sure why doing that either

sweet ore
#

this is what i did so far

upbeat basin
#

Do you call SetName from somewhere?

thin stratus
#

Why a Multicast when you have an OnRep....

sweet ore
#

yes an actor just set random name

upbeat basin
sweet ore
#

so i dont need the has auth in begin play? in secure cases

upbeat basin
#

Using HasAuth in BeginPlay would help you to split your logic between clients and server

#

Which doesn't seem like required here

thin stratus
#

Why do you need BeginPlay anyway

#

The Actors isn't despawning on the server

sweet ore
#

to set the name again in relevant

thin stratus
#

The value is still the same on the server

#

When they get back into relevance it should just call the OnRep

#

There is also no reason to multicast

sweet ore
#

but it is not calling it in my case

thin stratus
#

Then just do the thing you do in the OnRep additionally on BeginPlay

#

For Clients at least

#

They probably get respawned with the correct value

upbeat basin
#

Is the issue happening only when you get out of relevancy?

sweet ore
#

yes

sweet ore
hexed pewter
#

When creating AI for a multiplayer, it should be controlled exclusively by the server logic and only replicated on clients right?

real ridge
#

idk what I did wrong but it was like this and names were not replicated

kindred widget
sweet ore
sweet ore
#

and this is the last step the variable string in widget text (replicated)

real ridge
#

when it's not binded it's not replicated

real ridge
sweet ore
#

setting the name (widget) and get the name repnotify to set the name in widget ๐Ÿ‘๐Ÿป

real ridge
#

this is how my repnotify looks and then my widget bind to name and name but its showing nothing above enemy plane... ๐Ÿ˜„

#

weird

winged badger
#

player state already replicates the name, and it will by default pull it from whatever service you use to play (steam name if you play over steam)

chrome bay
#

also replicated FText = bad

winged badger
#

put your widget component on the PlayerState

#

and attach it on its PlayerPawn

#

that way your replication goes through only one, not two actor channels

#

makes it way simpler

real ridge
#

I have name stored in my game instance as player state is not persistent when you join the session