#multiplayer

1 messages Β· Page 258 of 1

nova wasp
#

so the server has no idea where you are going

#

which is why it just RPCs occasionally where the viewpoint is to the server

drifting crag
#

Neat!
My problem remains solved, given i just want everything relevant all the time, but this will probably be relevant on a future project where net culling is something i want to happen. Some of this might actually be good info for my previous game where i wanted to net distance cull from a character, not the camera. Gonna jot that down.

nova wasp
#

Yeah I think your usecase is one where you don't have any good reason to cull things given it appears to be like a limited area of a board

#

rather than a giant open world survival game or something

formal solar
#

So I just realised I had a lot of server -> server RPCs I was calling on server (before I realised event possessed was server only, too stupid to read the node comment), these server RPCs were sometimes unreliable but I'm guessing that even called from server, unreliable server RPCs can fail? And they were all very important. If that's true I suppose server -> server RPC is not totally useless if you have something on server side that's only of small importance

sinful tree
# formal solar So I just realised I had a lot of server -> server RPCs I was calling on server ...

The purpose of Server RPCs is to allow clients to call the event. If you have Server RPCs calling Server RPCs, that means that a client could theoretically bypass the first RPC which may break the logic, cause bugs, or even allow them to cheat. It all depends on where these RPCs are and whether or not the client has ownership of the actors they are being called on of course.... It's pretty rare to not want server RPCs to be reliable too unless you're frequently sending the RPCs like on tick or something where a new update will be sent soon enough.

formal solar
#

Well that was informative, the question was, if I do happen to have a server rpc (say event X) called on server, and X is unreliable, can X fail? Reason I am asking is that although I am fixing the incorrect server -> server RPC calls, it would be useful to know if this has been the cause of some of the bugs that seem to occur in my game especially as the load on the server increases.

#

Since unreliable calls will more likely be dropped as bandwidth becomes smaller

tardy fossil
#

nah if a server calls a server RPC, it'll just act like a normal function

#

nothing being sent network wise so nothing to drop

exotic wasp
#

unreliable RPCs getting dropped shouldn't cause bugs anyway

#

if something getting dropped can cause a bug, either rethink design or make it reliable

prisma snow
#

that's why they are called unreliable, they are cheaper at the price of potentially failing (although I don't think failure rate is very high in general)

trail olive
#

Hey guys, what would be the best way to replicate an TArray of UObjects in a UObject ?

prisma snow
rare zinc
#

I'm really struggling with widgets.

I had widget components on each actor as their health bar. This worked perfectly for singleplayer.

Now I've added local split screen multiplayer, the widgets don't work as obviously they are screen space and only show for Player 1.

I've tried a few different approaches, but I can't work out the best way of getting every player to be able to see the health bars on their own screens

Has anybody got any advice?

My current attempt has been to spawn a new actor everytime a player joins that just contains the widget, and setting the new player controller as that actors owner, but this doesn't work. Widget "Set Owner Player" requires a local player reference, which you can't get either...

tardy fossil
#

use a custom HUD class to create the health bar widgets. one will be spawned for each local player and you can access the owning player controller through the hud class PlayerOwner variable

rare zinc
#

So currently they work as a widget component, so that they hover over each NPC. If I use CreateWidget to use the HUD class, I'll have to constantly project them to the screen in the correct location?

tardy fossil
#

oh i totally missed the part where it was a widget component.. i think you need to create multiple widget components on the actor, 1 for each local player and assign the owner to the related local player

#

there might be a better way but it seems you gotta loop through each local player and dynamically create the widget components

fallen fossil
#
    ownerPC = Cast<APlayerController>(GetOwner());

Can someone help me understand why is invalid for Proxy Player?

Im trying to get owner in Player Pawn which is spawned by default

dark edge
fallen fossil
# dark edge

OnPossesed shows correctly controller 0 and 1

but in Begin play its a bit weird

dark edge
#

What do you mean by proxy player?

#

are you trying to get Client 2's PC on Client 1's machine?

fallen fossil
#

Local Client that owns

#

no, just on client side, connected to server

#
void APlayerCameraPawn::BeginPlay()
{
    Super::BeginPlay();
    //YASIULOG_SERVER_FUNC(YasiuPlayerLog, Log, "Builder pawn Begin Play is called. Authority: {0}", HasAuthority());
    APlayerController* ownerPC;
    ownerPC = Cast<APlayerController>(GetOwner());
    FString text = ownerPC->IsValidLowLevel() ? ownerPC->GetName() : "Invalid PC";
    YASIULOG_AUTHORITY_FNAME(YasiuPlayerLog, Log, "Player pawn has started playing. Controller {0}", text);

my print in BeginPlay

dark edge
#

I don't see any gating here

#

If you have 2 clients and a server that begin play will run 3 times

fallen fossil
#

1 server 1 client

dark edge
#

Listen server or dedicated?

fallen fossil
dark edge
#

Yeah so the listen servers pawn will have no PC on the clients instance

fallen fossil
#

but client has no PC :<

dark edge
#

It does eventually

#

Maybe begin play is too early for what you're doing.

fallen fossil
#

I wanted to spawn another actor for my Pawn with ownership πŸ€” , maybe I should just use Pawn as owner ?

dark edge
# fallen fossil

This is 2 pawns beginning play on client, one has a PC, one doesnt

#

Which is as expected

fallen fossil
#

for some reason, this pawn does not have owner even on server, so maybe it is too early πŸ€” , im gonna make funciton to print it later

#

I log if function was called server/client on left side

#

ok, I call it solved with "Too early" πŸ˜„

#

I wanted lazy solution to grab PC and reuse it later

rare zinc
sinful tree
# rare zinc I'm really struggling with widgets. I had widget components on each actor as th...

I was talking to someone about this earlier this week. What I dscovered was that widget components 1:1 relationship to the instance of the widget that gets added to the viewport. The widget component itself has a "Local Player" owner (not the player controller, a literal ULocalPlayer owner) and this is what determines what player screen it appears on. It appears that in order to facilitate this correctly, you'd have to dynamically create the widget components for each player and assign them the appropriate Local Player owner in order for them to appear on the correct screen.

#

Ooh oops, saw you just figured that out too XD

#

It's easy enough to expose the local player to blueprints if that's what you're having trouble with:

ULocalPlayer* UYourBlueprintFunctionLibrary::GetLocalPlayerFromController(APlayerController* PlayerController)
{
  if (!PlayerController)
    return nullptr;

  return PlayerController->GetLocalPlayer();
}
fallen fossil
#

does rpc _Validate are executed locally, on server? or both?

languid vale
#

So when testing this over steam using advanced sessions and advanced steam sessions, the client seems to get connected to the hosts lobby, but they never leave the menu and get transferred to the lobby map where the host is waiting.

I've setup my app id in config, i open level with "listen" option, use LAN is not checked etc.. It seems as if its just not properly loading into the correct map after joining the session, has anyone had this issue? I'm using UE 5.6

sinful tree
neat edge
#

is there any good tutorial on async loading in multiplayer?
I have no idea when to async load, if it should be done on both server and the client and what should be async loaded in general

rare zinc
# sinful tree I was talking to someone about this earlier this week. What I dscovered was tha...

Thanks for the C++ blueprint exposure, that was what I was looking for, but unfortunately didn't fix it as easily as I'd hoped.

I can set the owning player, but it doesn't actually make the bars visible to my split screen local players.

I'll keep playing with it, perhaps I will need to make a HUD for each player and constantly scan for Pawns to project their location to the screen and add the health bar

prisma snow
nova wasp
#

If you send a path to an asset, should it be loaded when received? Sometimes yes

#

It is universal to not want to spam main thread loads though. You should avoid hard loads on the main thread for things that are expensive to load

#

So the ideal is to avoid creating hard references to things that don't need them in the first place

#

and then async loading in art and animation things when you can get away with it

#

Sometimes you must load sync as the game must know about something immediately or it is just very annoying to work around

nova wasp
#

depends on the game

#

It's a very big subject but generally speaking the ideal is that you can avoid keeping things loaded that don't need to be and you can avoid expensive main thread loads if they affect your bottom line perf

#

If you have to spend a second loading the core game stuff that stays around in each level whatever, but if users get a 1 second frame hitch from a new enemy loading in they will probably be sad

#

It's also possible to create things that try to gather certain kinds of assets ahead of time and go "okay, you guys load now just in case because I assume you will appear later"

#

but that's not really mp related

tardy fossil
# rare zinc Thanks for the C++ blueprint exposure, that was what I was looking for, but unfo...

did you create multiple widget components on the actor you're trying to display the health bars for? you need 1 for each local player.. so basically in that actors begin play you need to get an array of the local players and loop through them, creating a widget component and setting its owner for each local player.. in c++ you can get an array of ULocalPlay objects from the GameInstance's GetLocalPlayers(); function... but thats not exposed to blueprints and i dont really see any other good way to get it in blueprints so you might need a blueprint function library function to expose it

#

doesn't really seem like a fun thing to do in blueprints

glad robin
#

I've been going through the GASShooter sample project to look at handling weapon spread/recoil over networked game but I was wondering about this. In their TargetActor GSGATA_Trace's AImWithPlayerController(...) at the end of the functionwhen they are handling weapon spread they use:

    const float CurrentSpread = GetCurrentSpread();

    const float ConeHalfAngle = FMath::DegreesToRadians(CurrentSpread * 0.5f);
    const int32 RandomSeed = FMath::Rand();
    FRandomStream WeaponRandomStream(RandomSeed);
    const FVector ShootDir = WeaponRandomStream.VRandCone(AdjustedAimDir, ConeHalfAngle, ConeHalfAngle);

    OutTraceEnd = TraceStart + (ShootDir * MaxRange);

But with the FRandomStream, wouldn't passing in FMath::Rand() negate the whole deterministic part of using FRandomStream for the bullet spread/recoil?

nova wasp
#

If it's called AImWithPlayerController that seems like it runs on authority only

#

a bit pointless to seed on random though... yeah

meager aurora
#

Hi,

My replicated projectile actor seems to start movement at wrong location, just as if it was falling before being launched, after being detached (from hand socket). How can I ensure the movement is originating from the place actor was detached?

void AArrow::Fire(FVector Direction)
{
float Speed = 5000.0f;
FVector Velocity = Speed * Direction;
FVector CurrentLocation = GetActorLocation();

EnableProjectileSimulation();

DetachFromActor(FDetachmentTransformRules::KeepWorldTransform);

GetProjectileMovement()->OnProjectileStop.AddUniqueDynamic(this, &AArrow::OnArrowStopped);
SetActorLocation(CurrentLocation, false, nullptr, ETeleportType::ResetPhysics);
GetProjectileMovement()->Velocity = Velocity;

}

edit: it's just positons not replicated properly

fallen fossil
#

I can't start the editro

/// Header
    UPROPERTY(Transient, BlueprintReadOnly)
    //UPROPERTY()
    TObjectPtr<class AGhostBuildingActor> GhostActor;
/// CPP
void APlayerCameraPawn::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME(APlayerCameraPawn, GhostActor);
    //DOREPLIFETIME_CONDITION(APlayerCameraPawn, GhostActor, COND_OwnerOnly);
}

it compiles but does not start

#

lol answer in output? hat was not tagged to replicate! Please use 'Replicated' or 'ReplicatedUsing' keyword in the UPROPERTY() declaration.

velvet current
#

hey are you still using this paragon sample code? every github i find is empty

celest pawn
#

I want to test if sound is replicated on multiplayer. I want to run listen server and client, but i want to mute one of them to see if the sound is picked up by the other. Is there a command i could write that mutes client or listenserver?

fallen fossil
celest pawn
#

i enabled these options in the project settings, which was what i was looking for.

fallen fossil
#

quick question, does this table shows all possible combination of roles? πŸ€”

#

which is 4

dark parcel
#

Check the enum of roles?

lost inlet
#

you can just look at ENetRole in the IDE

latent forum
#

Hi!

I'm working on a moving platform in multiplayer. The main goal is to prevent the character from getting corrected while moving on it (running, sliding, etc.). To achieve this, I decided to make everything deterministic. Both the server and the client move the platform based on the server time.

However, since the CharacterMovementComponent uses prediction, I figured the platform should also do some form of prediction. So on the client, I use this formula: ServerTime + Ping * 0.5.

It works fine with normal ping, but if the ping is high and the platform moves fast, its position on the client ends up too far ahead.

Has anyone dealt with this kind of situation before?

fallen fossil
#

welcome back πŸ˜„

#

but what does this combination mean?
Local role : ROLE_Authority, Remote role : ROLE_SimulatedProxy

#

is this client owner?

#

its not server πŸ€·β€β™‚οΈ

dark parcel
#

Depend on who's calling the code

#

Local role just mean the local role of the actor of the machine that is calling the code.

#

So if your computer is the one calling the function, if it says local role is authority then you are the server (99% of the time except when you spawn the actor locally(

fallen fossil
#

well that implies either server or owning client,
but from table it means server is only when remote is autonomus proxy

dark parcel
#

But for other machines (remote role) that actor is simulated proxy, since they dont own it.

#

@fallen fossil easiest way to visualise it is to display the role over the actor

#

And play with 1 server and 2 clients.

fallen fossil
#
FString ReadAuthority(AActor* actor)
{
    UE_LOGFMT(YasiuDebugLog, Log, "Reading roles: Local role : {1}, Remote role : {2}",
              StaticEnum<ENetRole>()->GetNameStringByValue(actor->GetLocalRole()),
              StaticEnum<ENetRole>()->GetNameStringByValue(actor->GetRemoteRole())
    );

    switch ( actor->GetLocalRole() ) {
        case ROLE_Authority: {
            if ( actor->GetRemoteRole() == ROLE_AutonomousProxy ) {
                return "Server";
            } else {
                if ( actor->GetRemoteRole() == ROLE_None ) {
                    return "NonRep";
                } else {
                    return "Owner";
                }
            }
            break;
        }
        case ROLE_AutonomousProxy: {
            return "L:Client";
            break;
        }
        case ROLE_SimulatedProxy: {
            return "L:Other";
            break;
        }

        default:
            ensureAlways(false);
            break;
    }
    return FString("Empty");
}
#

Well I did

#

but then as I posted here again. There is combination I don't understand.

Authority with Remote Simlated proxy πŸ˜„

dark parcel
#

If you are the server you have authority over every replicated actor

fallen fossil
#

But authorithy also has Client that owns actor

dark parcel
#

Client doesn't have authority over replicated actor (local role)

#

At best its autonomous proxy if they own the actor

#

While the one they dont possess is simulated proxy

fallen fossil
#

oh

#

hmm

#

wait... so authority is always server side?

lost inlet
#

yes?

#

the only exception is if a client spawns an actor

#

since they're obviously going to be authority over something spawned locally that doesn't exist on the server

dark parcel
#

Unless you spawn an actor locally as client. That client will have authority over it. But at the same time it cannot be replicated out of the box and other players will never know about it.

fallen fossil
#

ok I don't know when did I came up with this fake info

lost inlet
#

<@&213101288538374145>

#

dunno why it suggested some random ass user instead of the moderator tag

quasi tide
#

Woah woah woah swires - maybe it is legit

lost inlet
#

but oh well

quasi tide
#

They seem trustworthy

lost inlet
#

really, an anime avatar?

quasi tide
#

Only the most reliable of people use anime profiles

dark parcel
#

😭

quasi tide
#

Backed by science

dark parcel
#

That person is most likely a victim of the scam too.

Real bots dont normally have an avatar

lost inlet
#

yeah but who still falls for the steancommunlty thing

fallen fossil
#

for some reason I also though
that HasAuthority() can be executed on owned actor

fallen fossil
lost inlet
#

? HasAuthority() just checks the role value

#

simply clicking a link isn't going to make you spam on Discord

fallen fossil
#

True! now I clearly understand it

dark parcel
#

Sure did Kill

lost inlet
#

probably an infostealer malware or logging into a phishing page

dark parcel
#

Clicked a link and he start spaming steam gift cards

grizzled stirrup
#

how do they get into the account?

lost inlet
#

yeah that's not really how it works

#

I'd be very surprised if there was an active exploit in the wild that could spam Discord from simply clicking a link

dark parcel
#

Well yeah certainly shouldn't lose credential over clicking a link.

#

Unless the link tells you to enter username and password

lost inlet
#

well that's a phishing site then

#

which is more likely

fallen fossil
#

maybe he wanted hacks, or free gift card

lost inlet
#

this is why a lot of big companies will run phishing simulations now to see how many would blindly paste their credentials into something that looks like a login form

fallen fossil
#

okey, thanks for help im gonna go

dark parcel
#

Back in the day we dont have oAuth2.0 or the likes

grizzled stirrup
fallen fossil
exotic wasp
#

browser exploit that stole cookies iirc

thin stratus
grizzled stirrup
jovial charm
#

Hey guys, I'm using the new Instanced Actors PCG Interop to spawn actors representing trees in a multiplayer environment. The tree actors are replicated. The tree actor can take damage and after a threshold it will call Destroy on self. However when this happens, the tree actor gets destroyed, but instantly spawns back.

I have a feeling there might be a special way to remove an instanced actor instead of a Destroy call, but haven't figured out.

If anyone has had success with this please help me out.

karmic briar
#

@thin stratus https://www.youtube.com/watch?v=u-KXeeXE7kE new video on the multiserverreplication plugin if you're interested πŸ™‚ apparently GAS wont work with the current setup without a bit of modifications

In this video I show results of my testing of the new MMO server in Unreal Engine 5.6. What works, what doesn't and where do we go from here.

Open World Server 2 & Hub World MMO Discord: https://discord.gg/qZ76Cmxcgp

β–Ά Play video
#

😦

quaint roost
#

what does NetLoadOnClient = true mean in the context of a world partition spatially loaded actor? Does the actor not spawn in initially if the cell isn't loaded? And if the cell is loaded it will load?

What if it's false, and the cell is loaded - i guess it won't load?

sinful tree
quaint roost
sinful tree
#

If it's an actor with replication turned off, you would need NetLoadOnClient = true in order for the client to load it when the level is loaded.
If it's a replicated actor, then it should get replicated regardless if the server has spawned it and it becomes relevant to that client.

#

If both are true, then it won't matter, the client will still load it during the map loading process, and it will "connect" to the replicated version from the server, and then use the relevancy from the server to determine if that actor should still be there or not on the client's end.

thin stratus
karmic briar
#

For Sure!

#

🫑

wanton socket
#

in my game I have ive made a bool to prevent the player from using an autoclicker/spam clicking to exceed the fire rate of a gun. This has worked (mostly), however it prevents the client player from firing more than one shot, while working perfectly on the listen server player. The bool is set to rep notify and is instance editable. The blueprint this is inside of it also replicated. Any ideas on whats wrong? I can provide more of my blueprints if needed.

#

These are the only times the variable is set or referenced btw

nova wasp
#

replication does not send every time the boolean changes but the most recent value

#

also if you are setting the replicated value on the local client

#

it will fight the incoming server value from replication

wanton socket
#

pretty sure they are server side

nova wasp
#

It is kind of hard to read this

#

if this runs on the client

#

this is fighting over the server to change a replicated value

#

no bueno

wanton socket
#

the first custom event?

nova wasp
#

I think my screenshot is pretty clear here

#

I am talking about if the client sets this replicated boolean locally

#

or not

#

if the screenshot didn't load my b

wanton socket
#

yeah nah it hadnt

#

ok so I just need the server to store and set the variable?

nova wasp
#

if you have a replicated property it is not great to set it locally on the client because now you lose information

#

if you want the client to have local state that's good, but I think you don't want to fight over replication with who changes the value

wanton socket
nova wasp
#

you replicate an rpc to the server and then right after play a sound then set the bool on the client

#

the execution pins after are still executed on the client

wanton socket
#

ohhhh ok

harsh cloak
#

Hey just wondering if anyone has had weird behaviour with SetActorLocation? I can't seem to understand why its doing this for me. I'm attaching an actor to my character when I pick up the actor and then dropping it in front when I drop it on the client and server from their pov it looks completely normal however when the server does it and the client sees on the client side the actor sweeps from the location it was picked up from and then goes to the drop location instead of a straight forward teleport. PlayerInventory[SlotIndex]->SetActorLocation( DropLocation, false, nullptr, ETeleportType::ResetPhysics); this is what I'm doing so if anyone has any ideas please let me know. I'm very new to this so don't assume I've done the obvious as I could be missing something simple haha

wanton socket
#

better?

nova wasp
#

that should help because now it's actually doing what you want at least

I still kind of think this is going to feel bad for clients with bad ping if the timer is very low because ping will make them actually fire slower, if you need to prevent cheating then validate them sending too many fire inputs quickly over time

#

it might not matter if it's a fairly long timer

wanton socket
#

yeah cheating isnt an issue its coop so idc really

wanton socket
harsh cloak
nova wasp
#

you say you attach it but what happens after you attach it?

#

it appears that you also hide the object

harsh cloak
#

yes I do, I have a function that sets actor hidden in game and changes it to overlap all ``` int32 FreeSlotIndex = GetFreeSlotIndex();
if (FreeSlotIndex != INDEX_NONE)
{
PlayerInventory[FreeSlotIndex] = Item;

    constexpr bool bShouldHide = true;

    Item->StaticMesh->SetSimulatePhysics(false);
    
    Item->SetItemHidden(bShouldHide);

    // Attach to character for relevancy
    PlayerInventory[FreeSlotIndex]->AttachToActor(this, FAttachmentTransformRules::SnapToTargetNotIncludingScale);``` this is the Add to inventory function and then the drop is here ```    FVector DropLocation = Camera->GetComponentLocation() + (DropForwardVector * 200);

PlayerInventory[SlotIndex]->DetachFromActor(FDetachmentTransformRules::KeepRelativeTransform);

PlayerInventory[SlotIndex]->SetActorLocation(
    DropLocation, false, nullptr, ETeleportType::ResetPhysics);

PlayerInventory[SlotIndex]->SetActorRotation(FRotator::ZeroRotator);

PlayerInventory[SlotIndex]->SetItemHidden(false);

PlayerInventory[SlotIndex]->StaticMesh->SetSimulatePhysics(true);

PlayerInventory[SlotIndex] = nullptr;```
nova wasp
#

If you don't hide the object where does it actually move?

#

Also I don't know in which context this code runs

harsh cloak
#

Well that's the first clip I sent, I just wanted to check it was actually attaching correctly and it was for the server and from what I know attaching to actor is replicated but I could be mistaken

#

the first is in my ServerAddToInventory_Implementation and then for second its in the ServerDropItem_Implementation

nova wasp
#

I don't see how the second one describes which context it runs in

#

which is why I have to ask you to describe what actually happens here

harsh cloak
#

Essentially what I do when I pick up an item is hide the item actor that is picked up and then attach it to the character picking it up and when dropped I just drop it in front of the player. The drop item is just a Keybind to drop it, sorry I've only been doing this 2 weeks so I'm really clueless as to what context you need haha

nova wasp
#

also would be interesting to see where the position is with Net.RepMovement.DrawDebug

nova wasp
#

the first one you seem to call server which implies it is an rpc from clients to authority

#

the second one I assume is similar

harsh cloak
#

Yeah precisely, both are RPC's from clients, I do have a local one in order to make it less ugly for the player but the local just calls the server implementation then does a check GetNetMode() != ENetMode::NM_Client and then just does the server side stuff also on the client to a degree so it doesnt look all rubber bandy for the client

nova wasp
#

going to say it would be interesting to see what happens if you don't hide it

#

also are you using any fixed or async physics options?

#

there are not many things that try to interpolate positions in this manner

harsh cloak
nova wasp
#

If you don't simulate physics does it still interpolate the visual change?

harsh cloak
#

As you can see for the client it works but not for the server

nova wasp
#

Is the server not attaching it?

harsh cloak
#

it is locally but not like for the clients

#

I wonder why disabling simulate physics does do it correctly though

#

it's all good I've taken up enough of your time I'll keep trying some stuff, I appreciate it though

nocturne glacier
#

Hey, why is it that on listen servers the animation updates are dependent on the framerate of the clients?

So for example, let's say the server runs with 60 fps and the client with 5 fps, the animations on the server for that non locally controlled pawn become super janky (this is true for packaged games as well).

Does anyone know how to fix this?

lament flax
#

@nocturne glacier

nova wasp
#

is p.NetEnableListenServerSmoothing enabled?

#

also 5fps is crazy low here as its getting just so much less information imo

#

the rpcs are coming in very slowly

lament flax
#

allow server to smooth the animation ?

nova wasp
#

yes but it is on by default

#

it's for the mesh position smoothing

#

the animation is not something the cmc cares about

lament flax
#

is there an option for smoothing the anims ?

nova wasp
#

it just changes the velocity and transform, the cmc doesn't animate your skeletal mesh except I guess respond to root motion stuff

lament flax
#

feels weird its not played locally ?

nova wasp
#

what part of your anim graph is the cmc smoothing? (rhetorical questiom, the point is here that the cmc only changes velocity and trasnform etc so the anim graph is distinct afaik)

lament flax
#

anims should be at the local screen frame rate

nocturne glacier
twin vessel
#

Animations are ticked in sync with cmc if i remember correctly. Which means that on listen server animations are gonna be ticked in sync with received moves. If moves arrive at a lower frame rate, animations look choppy

nocturne glacier
twin vessel
#

No. You would have to dig into cmc and find where the animation ticking happens.
Tho i do not necessarily think it is a good idea to have it ticking separately, since then animations might miss-match movements

fallen fossil
#

Im facing issue where my actor is not replicated.
I found out that its treated as SimulatedProxy on server, which means there is no player connected πŸ€”
is this because I spawned actor with wrong owner?
as owner I pass PlayerPawn and not controller itself πŸ€”

nocturne glacier
tardy fossil
dark edge
fallen fossil
#

nvm

#

tick does not fire

#

YasiuPlayerLog: (Client:Other || f:GhostBuildingActor1) Showing ghost, material is valid: false

#

nah, still no replication

fallen fossil
#

I think

#

my main pawn is wrong ? πŸ€”

#

do I need to set owner on posses?

#
void APlayerCameraPawn::PossessedBy(AController* NewController)
{
    YASIULOG_AUTHORITY_FNAME(YasiuPlayerLog, Log, "Pawn is now possessed by: {0}", NewController->GetActorNameOrLabel());
    Super::PossessedBy(NewController);

}
#

altho I not sure, I see both movements

visual urchin
#

Before joining a session, I want clients to be able to choose from an Enumerator what type of character they want to use (think of them like archers, warriors, etc.). When clients join the session they should spawn with the pawn of the selected previously selected. I can't find any information about how to handle this. The closest to be is the player state but seems to me that the clients can't modify playerstate?

quasi tide
#

There are a few ways to handle it, with the most common (because it is the most straight forward) probably being to let them join and when they connect, then have them select the class/character. They can also join with additional URL params that could represent what they previously selected.

#

Then the GM would read from those params and just assign them.

visual urchin
#

You're probably right. Choosing the class character before joining, although it does make sense (game design), it creates extra steps. thonk2

blazing spruce
# visual urchin Before joining a session, I want clients to be able to choose from an Enumerator...

If you have them join the session first then I'd imagine you'll want the enum on the player state, you wont really want clients to modify the player state at this point anyways you want the server to update a clients character selection and then have your game mode spawn them.. but if you want them to select a character before they join a session like a 'preferred character' you can prob save it in the game instance but then you have to make sure its saved and loaded when closing/opening your game

quasi tide
#

No, let them join and THEN let them pick the character.

gray blade
#

as in sending a data struct to be added to an array

dark edge
#

Why does a client need to do anything here?

#

What is the actual thing you're trying to do?

gray blade
#

im storing a controller ref and steam id ref so every time you open the pause menu you see a list of other players in the game. The data struct needs the controller ref so the host can use the steam api's kick function

#

the list being the other players steam avatars and user name

gray blade
gray blade
#

removing the information

dark edge
#

Anyways no this won't work. The rpc has to be a property of something the client owns.

#

Make an rpc in the PlayerController, then the server side PlayerController can talk to the gamestate.

#

Run on server events in Gamestate don't really make sense since no client is gonna own Gamestate.

gray blade
quasi tide
#

That has nothing to do with what Adriel is saying

gray blade
exotic wasp
#

nothing to elaborate

quasi tide
# gray blade yes let me add a rebuttal and elabroate on nothing

Well, if you read and understood the network compendium, my response would make sense. But because you apparently have reading comprehension issues, let me break it down barney style for you - a variable being set to be replicated or not has nothing to do with RPCs. They are two different concepts. Adriel was trying to explain to you that your RPC wouldn't work because the client doesn't have network ownership of the gamestate. And server rpcs only get processed on things that clients have network ownership of.

Being a turd doesn't help anything. No reason to be one.

gray blade
#

idk dont be high an mighty with your perceived superiority in a help community when im trying to ask question and learn. maybe this isnt the place and you should use your supeior skills to be programing instead of throwing smug remarks to my questions that give me no clearer undestanding to what im trying to work through.

quasi tide
#

I wasn't acting all high and mighty. I answered your question. It was you who, instead of just replying, "how so?" decided to respond in a sarcastically negative way.

#

Based on that, I then responded in kind.

gray blade
#

i just wanted to know if i needed to multicast since the varible is already replicated

#

or if its fine that my function is just set to "Run on server" sinces i cannot quickly interate on Steams Api since i must packages and move my entire game on a flash drive between two computers to test anything

quasi tide
#

Multicasting was never brought up as a solution, 'nor a question from you. So I don't think anyone could deduce that is all that you wanted to know.

As for using it in this case, wouldn't be needed. I'd put it in an onrep before a multicast because it is stateful. And stateful things should be onrep'd and not RPC'd. RPC is for fire & forget or client -> server communication. Stateful things are things that affect the "state" of the game. No matter how big or small. Explosion - not stateful. Doesn't matter if a later joiner or someone misses it. The destruction of a building due to the explosion, that is stateful however, as it changes the level - potentially in game balance ways.

nocturne quail
#

having 30 play types example: flying, knocked, crouch, prone, weaponcrouch, weaponprone, and more.... likely 30 types.
so having an enum with 30 types is best way to go or 30 bools?

#

keep in mind i will be doing some bit compression with state variables

#

so even using enum will be fine i guess

#
enum class EPlayState : uint8 {
    None        = 0,
    Flying      = 1 << 0, //// 1.
    Knocked     = 1 << 1, //// 2.
    Crouch      = 1 << 2, //// 4.
    Prone       = 1 << 3, //// 8.
    WeaponCrouch = 1 << 4, //// 16.
    WeaponProne  = 1 << 5, //// 32.
};

/** used to set/update state*/
void SetPlayState(EPlayState NewState) {
    CurrentState |= static_cast<uint8>(NewState);
}

/** used to clear a state*/
void ClearPlayState(EPlayState StateToRemove) {
    CurrentState &= ~static_cast<uint8>(StateToRemove);
}

/** used to check state*/
bool HasPlayState(EPlayState CheckState) {
    return (CurrentState & static_cast<uint8>(CheckState)) != 0;
}

private:
    uint8 CurrentState = static_cast<uint8>(EPlayState::None);
}
woeful ferry
#

They’re extremely fast to replicate

nocturne quail
exotic wasp
#

i probably wouldn't use any tags or enums at all and use different movement modes instead

left marsh
#

Same.

#

Or use GAS and Effects.

nocturne quail
exotic wasp
#

lol ok

left marsh
nocturne quail
#

and these enums are also used in the animation blueprint to blend different sets of animations

#

i don't see any mistake in my setup

left marsh
#

Ah, so you're using two different enums and comparing them?

#

Combinational enum is like having one enum with the values chocolate, vanilla, chocolate with sprinkles, vanilla with sprinkles, chocolate and vanilla with sprinkles and so on.

nocturne quail
exotic wasp
#

hello C

left marsh
#

Awesome. Best bet is to make a struct that has one of each variable, and use that struct as the key of a TMap.

#

That way you can put in two enums and get out a float.

#

or whatver.

nocturne quail
nocturne quail
# left marsh That way you can put in two enums and get out a float.
float USurviveMovementComponent::GetUnarmedMovementSpeed() const
{
    if(ActiveMovementType ==  EMovementType::Knocked)
    {
        return MovementSpeed.GetSpeed(ActiveMovementType, EMovementState::Walk_Forward);
    }

    EMovementState CurrentState = EMovementState();

    if (!bRightLeft)
    {
        if (bWalkPressed)
        {
            CurrentState = (bMoveForward) ? EMovementState::Walk_Forward : EMovementState::Walk_Backward;
        }
        else if (bSprinting)
        {
            CurrentState = (bMoveForward) ? EMovementState::Run_Forward : EMovementState::Run_Backward;
        }
        else
        {
            CurrentState = (bMoveForward) ? EMovementState::Jog_Forward : EMovementState::Jog_Backward;
        }
    }
    else
    {
        if (bWalkPressed)
        {
            CurrentState = (bMoveForward) ? EMovementState::Walk_Other : EMovementState::Walk_BackOther;
        }
        else if (bSprinting)
        {
            CurrentState = (bMoveForward) ? EMovementState::Run_Other : EMovementState::Run_BackOther;
        }
        else
        {
            CurrentState = (bMoveForward) ? EMovementState::Jog_Other : EMovementState::Jog_BackOther;
        }
    }

    return MovementSpeed.GetSpeed(ActiveMovementType, CurrentState);
}```
latent heart
#

Bitflags, go!

fallen fossil
#

Can material instance dynamic be evem replicated? πŸ€”

nova wasp
#

Like... what exactly would you send about it?

#

Materials can be sent as they are stable named assets

#

a new object is a new object and if you need to change something about it you should send that instead of trying to make an entire new object replicated

latent heart
#

I'd treat MIDs like widgets.

nova wasp
#

yeah, that's a good description

latent heart
#

Have them based on some other state that is replicated.

fallen fossil
#

I just spawn c++ actor (not BP ) and it has no reference to material so I have to assign it from parent actor, and then somehow replicate it πŸ€”

latent heart
#

Right

nova wasp
#

What is the actual information here

#

Like why does this choose to be X material

fallen fossil
#

it just has nullptr on spawn

latent heart
#

Elon mandated!

nova wasp
#

is it different based on something else on the server?

fallen fossil
#

its null

nova wasp
#

which material should it be? I am asking what you WANT to do

fallen fossil
#

any really

#

same for all

#

I could make BP Actor Class and assign default asset ref, but thats not what I want :<

nova wasp
#

I think in that case you could replicate the material asset then when it is received create the MID

#

I don't recall saying anything about actors

fallen fossil
#

ok

nova wasp
#

a dynamic instance should be local only, but which material it uses can be sent any way you want I think'

fallen fossil
#

I could replicate SoftClass and onRepnotify load it per client

fallen fossil
#

I though I messed some replication properties

fallen fossil
nova wasp
#

I do not think you want to replicate an entirely new object for this

fallen fossil
#

ah, right, it replicates whole variable

nova wasp
#

Another thing to consider is how you send the information for what to change on the instance if you need to

#

Which is tough to say as it depends

#

there are a LOT of ways to use mids lol

fallen fossil
#

usually I set vector param

#

Thats for help anywya xd

cunning orbit
#

Looking for some guidance to get me out of a block...

I've got a replicated actor (A) which itself spawns a handful of replicated actors (B) on the server. Actor A keeps an array of all actor B's on the server. I need access to that array on the clients. I'm between the following implementations...

  1. Just replicate the array and move on with my life
  2. Have all of the actor B's "register" themselves with actor A on the client on beginplay

There's maybe 30 of these actor B's so not crazy but I feel implementation 2 is more efficient but comes with a few more implementation details.

fossil spoke
#

Doesnt add additional bandwidth, also ensures that the Actors are actually available when they exist on the Client.

cunning orbit
#

That's what I thought....appreciate the validation and getting me past that.

karmic briar
#

hey folks anyone here have played with GameplayCameras? i trying to make it work when simulted as client..on standalone and listenserver, it works fine but on client, it gave me this error which it cant find the controller

#

it just a simple setup which just activate the camera which right now, i just supplied the normal playercontroller

#

and in the director, i just activate the thirdpersonrig and normal attach the camera to the pawn,set the boomarm position and do some dampening offset

#

this is the eeror when playin as client

#

on standalone and listenserver, it works as intended, just not client

#

what could be the issues here

karmic briar
#

figure somethign out, so in playercontroller, when disabled Auto Manage Active Camera Target, the camera is at the correct spot but i lose the input for IA_Look input action

flat pendant
#

Is there a way to kick the host player of a listen server during the AGameMode::InitGame step?

Context: I have a login screen with a server browser which allows the player to create a server with restrictions (e.g. auth required, whitelist enabled, max players, etc.). There are a few instances where the 'host' (i.e. the player who created the listen server) should be rejected entry into their own server (and resultedly the server is shut down). I could validate before creating the server, however I'm still wondering if I can kick them after the server creation process has started.

AGameSession::KickPlayer can not be used yet because in AGameMode::InitGame, where I am performing server config validations, the PlayerController does not yet exist, so it can not be kicked. But surely there must be a way to reject their own connection and cause them to be kicked back to whatever the 'default' map is.. right?

fossil spoke
humble idol
flat pendant
#

Yeah I know it sounds silly. Thanks for the response though. I'll just validate and prevent the creation like a normal person.

karmic briar
gray blade
#

anyone know how to find good documentation for the advanced session steam plugin?

karmic briar
# karmic briar this is the eeror when playin as client
void AKhaiCharacter::PawnClientRestart()
{
    Super::PawnClientRestart();

    //Make sure to do it here as this is where Input Component is being registered
    //If we didnt do it here, the InputAction in InputBindingAxis2D will not being registered
    if (CameraComponent && InputComponent)
    {
        APlayerController* PC = Cast<APlayerController>(GetController());
        CameraComponent->ActivateCameraForPlayerController(PC);
    }
}
#

if anyone interested, try do it in APawn::PawnClientRestart, this way, we would have PlayerController that have its inputcomponent registered

#

tried in beginplay, possesses,onrep_controllerchanged and its either you early for PC to registered or InputComponent doesnt registered yet with PC when initialization

#

i should probably just RPC it ngl lol

#

looking at GameAnimationSample, they do an owning client event to setup that

gray blade
#

Does anyone know why the get steam persona and get steam friends avatar functions dont seem to work on clients?

woeful ferry
#

Why does FFastArraySerializer keep a raw ptr to a UObject? Doesn't seem so safe πŸ˜…

fallen fossil
#

is this standard workflow for networking?

write UFUCNTION(Server, BlueprintCallable ...)
write function _Implementation

write UFUNCITON(NetMulticast .. ) for clients
write function _Implementation

or there should be just plain UFUNCTION(BlueprintCallable)
which calls RPC to server?

lost inlet
#

well you'll need to spell "FUNCTION" correctly, but there's no reason why an RPC can't be BPC

#

though I don't quite know what you mean by "standard workflow"

fallen fossil
prisma snow
blazing spruce
#

Hi, when it comes to high ping and packet loss I would need to implement a system that forces the player to disconnect if they're consistently hitting high pings/packet loss, I can get the players pings through player state but is it possible to detect a players level of packet loss? I assume it won't be enough to just detect high ping since that doesn't account for low ping high packet loss situations and vice versa

olive kraken
#

Hey! Wondering what is your best alternative to Steam leaderboards. Firestore? PlayFab? EOS? SOmething I'm missing in the list.

I just need a place that can add more than an entry per 10 min (Steam limit if I'm not wrong) and can have metadata and other fields added to the entry, etc.

#

And/Or Sorting.

lament flax
lost inlet
#

<@&213101288538374145>

boreal wadi
#

Has anyone here done a network bandwidth test? I have a question about the size your gameplay tags were over the network.

I have fast replication on for gameplay tag which is supposed to reduce them down to uint16 however my wireshark readings are a bit higher than expected for that to be the case.. Maybe I'm doing it wrong.

Also its documented that Network Insights does not show the packed results meaning its not reliable for knowing the true bandwidth costs.

thin stratus
boreal wadi
thin stratus
#

Every single property was exactly reflected in the bit count in insights the way they were serialized

#

Also I seem to somehow have skipped you last paragraph, sorry about that. Reply remains the same though

boreal wadi
fallen fossil
thin stratus
boreal wadi
#

Right now I'm doing a pass that changes all FGuid (16bytes) in my system to uint16. Gotta crunch that data. Thats a ton of bits saved per update.

thin stratus
boreal wadi
thin stratus
#

In theory all ints are packable to the lowest byte that still can represent it. Iirc it uses the last bit to indicate if the int is bigger or not. The gain is not that high for 16 vs 8, but for 64 or 32 bit, it can be saving some bits if the numbers is a lot smaller

nova wasp
#

also almost all sent numbers are on the lower end

quaint roost
#

has anyone ever experienced CMC movement corrections when running an ARM64 linux server? Even using a basic spiral staircase, I get very consistent rollbacks (windows client vs arm server) when climbing it

#

my suspicion is floating point math differences on the platforms, but it's just a wild guess

prisma snow
sonic obsidian
#

Is there a way to get the platform that a client is on from the server like Win or Mac etc..

fallen fossil
#

ok, after playing a bit more with replication.

Can someone explain to me, why role for Actors (not pawns) is SimulatedProxy and AutonousProxy? Does Autoproxy is only for controlled pawns?
I though I can use it to distinguish locally owned actors, but apparently no.

My child actors are SimualtedProxy, but owned in chain by local controller so replication works fine πŸ€” .

waxen pecan
#

I had the same question a while ago with my pickups

sonic obsidian
#

<@&213101288538374145> can 1 of you guys please delete/deal with this

#

thx :)

rustic ore
#

Hey all, I have this issue where an actor's owner is **sometimes **null for client on begin play when the actor is spawned on the server.

Server:


Actor B:
void BeginPlay()
{
    GetOwner() // this returns Actor "A"
}```

Client:
```Actor B:
void BeginPlay()
{
    GetOwner() // this sometimes returns null
}```

Is this a known issue for UE?
rustic ore
mystic estuary
#

Hello, does anyone know what function might be called when an actor becomes relevant? I have a pre-existing door in the world, and I'm trying to correct its rotation once player gets close enough

mystic estuary
#

Pre-placed actors don't get destroyed when they become irrelevant, unlike those that are spawned on runtime

#

Since they don't get destroyed due to relevancy, they don't get created except when the level is loaded

crisp shard
#

Not sure what the issue is but couldn’t you just add it’s rotation as an onrep?

#

And when the player gets in relevancy* range that variable should be about to handle updating the doors rotation

mystic estuary
crisp shard
#

But my doors are quite simple. Just a bool and have two states (open / closed*)

mystic estuary
#

My door can be opened in and out, I have 2 bools -- bIsOpen and bShouldOpenIn. If the door becomes irrelevant while it's opened in, then someone closes it, and opens out, and the door becomes relevant again, it'll be still considered as open, but I needed to make sure that it's opened in the right direction. I ended up doing that from bShouldOpenIn's OnRep. It works, but I just don't like how it's structured

crisp shard
#

Yea that does seem like it could have some unique use cases

#

Maybe make it a Enum instead, but you’re essntially still doing the same logic but at least it can only be in 1 state at once

left marsh
#

I'm dealing with an issue where I am running a listen server. I have an NPC standing on a ramp. For the host the NPC looks fine, but for the client the NPC is vibrating up and down super fast. I'm also seeing the vibration if I eject while in PIE, but not when possessed. It's a long shot, but has anyone experienced something like this before?

thin stratus
#

However, that won#t tell you which direction the door is opened in.

#

So you kinda have to replicate the direction either way.

humble idol
exotic wasp
#

and the onrep drives animation

uneven hill
#

Anyone have any tips for common pitfalls with seamless travel? I have a lobby level that I am trying to travel from to the actual game itself but the client gets booted due to some error.
I have ensured that the lobby game mode and the actual gamemode both use the same player controller and pawn. Anything else that I am missing?

bronze glade
#

A bit of a multiplayer beginner here -- Is there really a difference other than developer preference with the following options?

A: game score is updated on GameState and replicated to all players, on each update GameMode checks the new score and determines if the game was won or not yet (All server variables are on GameMode and GameState must alert GameMode to check whenever events happen)

B: game score is updated on GameState and replicated to all players, and GameState is also in charge of checking the score requirements server side (GameState holds all server side variables like match info and requirements instead of communicating with GameMode)

#

It seems like the end result would be the same? They both have the ability to run code server side only so it just is a matter of dealing with back and forth, or with dealing with lots of variables in one single component. Like timers for example, those could be ticked in the GameMode server side and sent to GameState to replicate to clients, or it could just be done fully in the GameState server & client side.

exotic wasp
#

imo game state shouldn't hold much logic. it should be just that, the game state

bronze glade
#

So everything should be done in Game Mode and then sent to Game State to replicate?

#

I'm just having a hard time grasping where things should belong. It all seems like preference to me, but so many things online seem to be very much "it must be this way"

exotic wasp
#

that's always made the most sense to me. especially considering you can have multiple game modes that use the same game state

bronze glade
#

But you could also have a single mode choose from multiple different states when entering the level

exotic wasp
#

maybe you have a death match and a team death match game mode with a game state that tracks your score. they both touch the same score, and something like UI on the client only cares about what the score is, not where it came from

exotic wasp
#

I guess you could use inheritance at that point but it feels hamfisted

bronze glade
#

Why not? The Game Mode could be completely empty and the Game State could literally hold all of the server side logic without referencing the Game Mode at all

exotic wasp
#

then your game mode is having to select what type of state it wants to use

bronze glade
#

Maybe I have a fundamental misunderstanding lol. From my perspective it just seems like you can put it anywhere that can run on the server and you'd have the same exact outcome in gameplay, it's just a matter of how you want to set up the code and variable management

exotic wasp
#

you definitely could put all your logic in game state. you could also put all your logic in your level blueprint πŸ™ƒ

bronze glade
#

That's what I'm saying haha. I don't understand what should go in Game Mode vs Game State since you could get the same result either way πŸ˜„

#

Is it really just developer preference? I have asked multiple LLMs as well and some say timers should be in Game Mode while others say Game State. Some say the score should be updated in Game Mode and sent to Game State to replicate, while others say to just use Game Mode to get the base variables and then give them to Game State to handle all logic during gameplay, etc

exotic wasp
#

if you would have more than one game state type, you'll almost definitely still have more than one game mode type

#

gamemode handles spawning and most other setup

#

so regardless you'll still have some logic in there

bronze glade
#

So you would suggest running all code for the match logic in GameMode and just using GameState to send updates to clients?

exotic wasp
#

yes

#

but not even just to send data to clients. any general game state should be in... game state

bronze glade
#

So in a round based game it would be things like time remaining, current round, team score, current players per team, etc?
But are any calculations or functions relating to these handled in Game State or are the variables just stored in Game State and all logic is in Game Mode?

exotic wasp
#

calculations ideally in gamemode

mystic estuary
# mystic estuary My door can be opened in and out, I have 2 bools -- bIsOpen and bShouldOpenIn. I...

The problem with enum is that when I need to close it, I need to animate that. I do that deterministically: I have a function UpdateDoor(float AnimationProgress), which multiplies that by the angle limit and the direction of the door.

If I set the state to OpenedIn before the animation, I can animate the opening correctly. However, that also means the moment I close it, the state will immediately become Closed, and that function will have no idea what direction the door was opened.

If I change the enum after the animation, then I can't start animating the opening, as it's considered as "closed" while it's opening. Adding 4 more states for ClosingIn, ClosingOut, OpeningIn, OpeningOut sounds like an overkill.

I tried creating a PreviousState enum that would save know what enum it had before replication/change of state, but it gets over-complicated, and not that I like that solution either.

bronze glade
exotic wasp
#

game state is the state of your game πŸ˜ƒ
it can just conveniently replicate said state to clients

#

the rest of your game (game mode actors components) mutate the state

bronze glade
#

Okay. Thanks for discussing with me πŸ˜„

exotic wasp
#

in a very simple engine, game state would contain ALL current state and likely not contain any logic

fallen fossil
#

thanks, It kinda explains ;d

uneven hill
#

I'll take a look at cedric's guide now at least

left marsh
#

Is there a way to set a breakpoint but only when running on the client instance?

fluid prawn
#

Quick question if anyone happens to know. If I have a Parent->N Child Components nested replication layout can I have TFastArray<FParentStruct> then FParentStruct -> TFastArray<Child Data>. Are nested TFastArrays supported? or should I flatten it into a second TFastArray and hold an ID to its parent to mark it dirty?

#

So if a child data member gets changed marking it dirty will outer TFastArray container item to be replicated to outer container client.

#

One thing to note is these arrays are fixed. So the index will not change making easier to deal with and access

sinful tree
left marsh
#

What about in code

cobalt inlet
#

Anyone knows if motion matching is replicated in terms of just character walking and running?

fair halo
#

By any chance, has anyone had luck with getting the "Snapshot Pose" command to work when running as a client? I'm seeing the node snapshot properly for server and as astandalone, but when running as a client specifically it only captures the bind pose.

tame sapphire
#

Can any one help or point me in the direction of troubleshooting setting a var on an actor on the server via an input action.
Im casting to the actor in my player controller and using that reference to call an event on the actor.

#

Im pretty sure I want to keep the actor owned by the server but ideally id like to set a reference to the player controller that clicked on it in it so it can be used for something else

muted pewter
#

I have a hover bike actor placed in the level on the server, and I want to implement client-side movement for the owning client only to eliminate input lag. I’m using SetPhysicsLinearVelocity on the client when IsLocallyControlled is true, and have disabled Replicate Movement, while keeping Replicates enabled.

Despite this, the owning client cannot move the bike properly it twitches or gets stuck, as if the server is still overriding the movement. Physics is only simulated on the owning client, and I verified possession and IsLocallyControlled. The bike is meant to be synced later via RPC (client β†’ server β†’ multicast).

How can I prevent the server from interfering with movement and allow full client-side physics control for the owning client, even though the bike is placed on the server?

Thanks in advance!

#

Server is Dedicated and I want smooth movement for owning client later transform will be updated for other clients as Lag on other clients is acceptable

dim trail
#

Does fortnite multicast their bullet trails?

exotic wasp
#

usually you right click the breakpoint?

#

can compare netmode at that point

left marsh
#

Netmode? Got it. thanks.

sinful tree
tame sapphire
thin stratus
jade ibex
#

trying to wrap head around OnRep Notifies in C++. If a value is changed on the server, it will trigger OnRep Notify on the client. But when does that value change on the client?

Does the value on the client change before or after OnRep Notifies is called on the client?

#

Also OnRep Notify is not called on the server?

#

I've just found it so much simpler using Server and Multicast calls as I can see the flow of values happen, and have control when things change.

#

But on rep notifies are nice for mid joining clients and seems to remove the need for multicast

molten parcel
#

Hi, i'm looking to make a space co-op game where players can be on different (proc gen) star systems at once similar to Stellaris and they can jump to different systems at any time. What's the best way to do this? World Partitions?
My idea is to have n system slots, one for each player all far away from each other and programatically create systems whenever a player arrives there for the first time.

#

So in essence one big world with everything

cold cipher
#

is it normal for his pawn to not appear anywhere if the client didn't have focus on the window?

tame sapphire
tardy fossil
lost inlet
#

onreps would be pretty damn useless if it was before

#

they can optionally pass the previous value as a function parameter though

uneven hill
#

I've made an empty project now with two players and a seamless travel. And it still doesn't work. I have no idea what Im missing.

#

Gamemode is the same, controllers are the same, pawns are the same.

#

just a third person template with two players and the level bp triggering a seamless travel after 10 seconds

#

client is still kicked

#

and Im starting two standalone instances of the game to be clear

#

could it be a networking problem on my machine? Since I am at a loss here.

jade ibex
#

are you using server travel

uneven hill
#

Im just using open level. But the client has already connected before that.

uneven hill
#

is server travel only available in cpp?

#

seems like that is the case at least

#

from my understanding if the client is already connected and you run open level, it should bring clients with it

#

but Ive been searching like crazy so Im not sure where I even got that from

#

from what I recall "OpenLevel" should trigger the server travel logic

#

Im just gonna nuke this and start over at this point.

#

come back to it later

#

sucks to have wasted two days trying to get a lobby to work

#

I already have a main menu host/join button that works, but I wanted to implement a lobby between the main menu and the actual game level. But seamless travel just will not work on my machine for whatever reason.

#

Seeing some claim that OpenLevel does in fact not work with seamless travel. I wanted to avoid writing C++ for this project since I am just prototyping and I tend to get stuck in code when I start writing it. (Focusing too much on systems design etc) But seems like I may have to in this case?

crisp shard
#

wait until something takes months...

uneven hill
#

Ive worked as a programmer in gamedev, I am plenty familiar unfortunately

#

I suppose I'll try to travel via C++ and see if that helps

crisp shard
uneven hill
#

Thanks!

#

We'll see how it goes

torpid crest
#

has anyone tested advance steam session in 5.6?

bronze mauve
#

In GetLifetimeReplicatedProps - I've never seen anyone use the TArray<FLifetimeProperty>& OutLifetimeProps param. What is this, what does it do, and when any why would anyone ever need/want to use it?

lost inlet
#

I would suggest looking at the DOREPLIFETIME macro first

uneven hill
#

I set up a minimal test example to use c++ servertravel. It still kicks the client when traveling. 🫠

#
void AMyGameModeBase::ServerTravel()
{
    bUseSeamlessTravel = true;

    UWorld* World = GetWorld();
    if (World)
    {
        World->ServerTravel("Lvl_ThirdPerson1", false, true);
    }
}

Literally just this in a gamemode on the cpp side and then I call it in a blueprint

#

absolutely cursed

#

Ah well, this is just killing my productivity in terms of progressing with my prototype and it isnt essential so at this point I should just give this up

#

hopefully I can fix it in the future since well.. travel is kinda important

torpid crest
#

is iris getting better these days? πŸ˜„

#

or is still preferable to avoid it

bronze mauve
# lost inlet I would suggest looking at the DOREPLIFETIME macro first

So if I understand correctly: OutLifetimeProps is an array of FLifetimeProperty, and FLifetimeProperty simply tracks a UPROPERTY that is supposed to be replicated. DOREPLIFETIME simply designates a UPROPERTY variable to be replicated, meaning the macro results in the creation of an FLifetimeProperty for it, and adds that to the array. Is that right?

opal gyro
#

Hey folks, I'm working on an inventory system that has UObject item stacks which in turn have UObject item instances stored in a TArray. I'm currently setting up ReplicateSubobjects and am wondering: Can subobjects replicate their own subobjects in a cascading manner, or does the root component (in my case InventoryComponent) have to replicate all of them directly?

nocturne quail
#

if an actor is replicated and the same time it is checked to be loaded on clients, will it be loaded multiple times?

tame sapphire
uneven hill
#

I guess I wont be able to let this one go until I figure it out. Even if I shouldnt at this point. Is there a way to figure out the true cause for a client being disconnected?

LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = FailureReceived, ErrorString = Host closed the connection., Driver = Name:GameNetDriver Def:GameNetDriver IpNetDriver_8
LogNet: Warning: Network Failure: GameNetDriver[FailureReceived]: Host closed the connection.
LogNet: NetworkFailure: FailureReceived, Error: 'Host closed the connection.'
...
LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionLost, ErrorString = Your connection to the host has been lost., Driver = Name:GameNetDriver Def:GameNetDriver IpNetDriver_8

The logs dont exactly tell me much.

thin stratus
#

The initial one is enough. You wrote you ran another from within the first one.

#

through the PlayerController and using RunOnServer then calling another run on server within the desired actor to set the var

#

That "another run on server within the desired actor" is redundant. You already are on the Server.

uneven hill
#

holy shit I think I just fixed it

#

AT LAST

#

I CAN SERVER TRAVEL

#

I am the greatest programmer to have ever lived

quasi tide
uneven hill
#

despite my best efforts to avoid C++ I need a tiny bit of it for this

#

again for context I do prefer writing cpp in reality but I keep getting bogged down in things that dont help me figure out if my game idea is actually fun

tame sapphire
tame sapphire
#

Does running an RPC for On server whilst on the server effect performance?

thin stratus
#

That RPC can't even really be executed by clients either, as they won't own that actor in your scene.

tame sapphire
#

yeah the forums said for the image that the client couldnt own it anyway

#

same principle for the spawn tile its more commanding than owning

tame sapphire
#

Doe's any one have an idea on where or what I am looking for when using rep notify. I currently have a select based off a bool for bIsSelected? which changes between red/white depending if it is selected. However If I wanted the player controller that clicked the actor to have a 3rd color (Yellow) Im thinking along the lines that the player controller could just set the color locally for him?

cursive herald
#

this could also result in different behaviors if you've not overrode the RPC implementation correctly. I've seen that cause some fun bugs

cursive herald
tame sapphire
#

@cursive herald I am trying to make a spawn tile, however theres X people that can see the tile but only one who can click to spawn there

#

ive got the click interaction and i believe a working ref to the player controller that clicked

#

this also updates a rep notify which changes color depending on if it has a ref/claimed controller or not

#

however with 3 or more people all seeing red tiles it wasnt clear which tile you clicked

#

you can only click your one to unset

#

but as there all red i was hoping to use something to set the color on the local controller for the one they clicked

#

but now im thinking i just spawn an indicator above the tile for the client only

#

as it seems to go aghainst the point of the rep notify to begin with...

velvet current
#

I';m about to just give up on having host migration be a feature

#

thought itd be soooo nice to have but idk if its worth the trouble anymore

opal gyro
#

seems to be working cherry

left marsh
#

Is it normal for a character on a slope to have a different position on client than on server? They are just standing still.

latent heart
#

The position is quantized when replicated, so it can differ by a small amount.

left marsh
#

By a whole 5 centimeters?

#

When the character is on flat ground the values are identical

latent heart
#

Potentially.

#

Because of the slope and the X and Y being different, it might just be different by that much.

left marsh
#

Hmm. Okay. thanks.

#

I'm dealing with a bug where the character can get into a state where the difference keeps changing and they vibrate on the client.

nocturne quail
#

server spawning an flying actor which is using projectile movement component

actor configs on constructor

    FlightProjectileMovement->InitialSpeed = 15000.f;
    FlightProjectileMovement->MaxSpeed = 15000.f;
#

and it gives different velocities

#

on client it gives correct, on server wrong

thin stratus
nocturne quail
torpid crest
#

How is Mover in 5.6?
I'm planning to implement some custom movement like edge climbing at some point

nocturne quail
thin stratus
#

When using the ProjectileMovementComponent you are required to implement a few functions and call some stuff on the component (like setting the interpolated component) to make it work properly

nocturne quail
mystic estuary
#

Hello, does anyone know how to deal with net correction when walking into moving doors? I open/close it using a simple timeline that I play locally when the door state changes, so the client is only rotating the door once the server replicates the new door state making it be a little bit behind compared to server. It's annoying how much minor corrections there are, and I'd like to get rid of them, or at least smooth them out

nocturne quail
mystic estuary
#

I was thinking about it, but I feel like it's going to create other problems down the road

nocturne quail
dark parcel
thin stratus
#

I assume they want to disable it on both ends

nocturne quail
thin stratus
dark parcel
#

So like allowing the player to go through the door when its not fully opened yet?

#

Not suggesting anything btw, just curious on how im gonma deal with door my self later.

nocturne quail
mystic estuary
nocturne quail
mystic estuary
mystic estuary
nocturne quail
mystic estuary
mystic estuary
dark parcel
#

I assumed this kind of problem always exist. I mean does any of you actually resolve correction when a player bumps into another? There's always correction on my end and changing the tolerance doesnt really help.

Perhaps its unavoidable?

If anyone have ever played stirnova, the player actually always get corrected when bumping into another player. The effect is soo noticeable.

mystic estuary
#

Well, in case of something more dynamic like player walking into you it's one thing, but a door that you know that is about to start opening a certain direction is another thing. There might be a good way of working around it

dark parcel
#

True

mystic estuary
#

I even thought about disabling corrections for 0.5s when there's an opening door in 50cm away from the player, but, again, it sounds like it can go very wrong

dark parcel
#

I stopped disabling correction for my end because evrytime i toggle it back、the player snaps somewhere

#

If you just onrep the rotation do you get correction?

#

Let server be ahead

mystic estuary
mystic estuary
dark parcel
#

Never work with a door but maybe that's what I would try

mystic estuary
#

The opening is not predictive, it's completely authoritative

#

So the client gets teleport forward, into the door

#

I tried using exponential and linear smoothing, and it might be just me, but isn't linear smoothing better in this case? First is exponential, second is linear

thin stratus
#

Doors are really difficult in Singleplayer already

#

The problem is that the door isn't the same amount open on server and client in the same timestamp. The only way you can solve that for one specific client is by tying it to the CMC

mystic estuary
bright summit
fallen fossil
#

Can you measure client server delay? maybe don't play animation on client from start, but rather delay / x2 delay πŸ€” to end

fallen fossil
#

I guess, just ping time ;d

dark parcel
#

You can send a server rpc and calculate the time it takes to receive an answer.

#

And if you need to know approximately the time it takes from client to server, then just RTT / 2

#

There's a tutorial on how to do a network clock, that should give you insight

fallen fossil
#

well, I was thinking if there is dedicated function ;d

dark parcel
#

Also why do you want to delay playing anim?

dark parcel
fallen fossil
#

I don't, I was thinking of Tony's door problem

dark parcel
#

Knowing how to use network clock is probably useful for things like timer.

meager spade
#

Doors are not that bad really, i mean a lot of MP games have doors

#

including our game, no issues with them tbh

#

not sure if we did anything fancy either

#

ah yeah we disable collisions with the interactors capsule during movement

#

whilst the door is opening

#

but not whilst closing, closing pushes the pawn

mystic estuary
mystic estuary
thin stratus
#

The first one suggests you initially only did the ignoring on the server

mystic estuary
prisma snow
#

I have a couple of questions about how structs are synced over the network when sent via RPCs:

  • Let's say I have two arrays in my struct. One array is IDs, another is whatever other property. Can I rely on the array order, if sending through reliable RPC?
  • If send the struct with the arrays empty, I imagine there will be at least a bit of overhead, right?
exotic wasp
#

imo if you have two arrays that have tightly coupled data, just make an array of structs that hold both the ID and property

#

there can be weird cases where the whole struct doesnt replicate at once leading to those two arrays being out of sync on a client

formal solar
#

Hi guys, kind of banging my head against a wall, I'm working in 5.0.3 which is unfortunately bugged with advanced sessions. I'm using normal steam sessions but I want to hide sessions from the 'find session' function once they are full. Unfortunately this is not exposed to blueprint with regular steam sessions, but I know exactly where to put it in my blueprints so I want to create a blueprintable C++ function that hides sessions. Unfortunately the syntax of C++ is kind of a barrier to entry to me, does anyone have any pointers e.g. forum posts covering this issue or whatnot? I'm at a very late stage in my project, I could upgrade to 5.1 but don't really want to at this stage due to potential issues.

thin stratus
#

Doesn't necessarily need c++

#

Like, just don't add it to the UI

formal solar
#

yeah but I dont think client can get number of players in a session

#

Only max num players

thin stratus
#

Pretty sure it does

#

The session result should have that info

formal solar
#

supposedly but doesnt return

#

Also would kind of be hacky solution because sessions might change while still listed, of course I can refresh the list every so often, but I have no guarantee of a timeframe for how long the list takes to generate

#

But it was my original plan too

rugged turtle
#

you could check if the game is full before they attempt to join

#

and show some ui

#

i think regardless of sessions changing you'll have to poll them at a set interval to get updated information?

thin stratus
#

You can't guarantee that you won't have a session returned that will be full a second later

formal solar
#

its same issue basically i can only access the num players of a session i am in. so currently i just eject players after they join session, but its very jarring, and if im lucky enough to get large playerbase, would be extra bad

formal solar
#

also if they join while session is travelling to map, takes like 30 seconds to join and get booted lol

thin stratus
#

Sessions are just database entries after all. If you request sessions it will return a snapshot. If someone else joins the session before you or if you spend a minute looking through the session to decide and it's full until then, then that's how it is

formal solar
#

I know it has to do with the bShouldAdvertise bool

thin stratus
#

It makes no difference if you filter the session via the backend or when you add it to your UI in that case

#

And the session result returns both Max and current players

#

I use that in my Lobby kit after all

formal solar
#

Current players just never seemed to work for me

#

i even have it displayed on a UI and it always says 1 current player no matter how many in lobby

thin stratus
#

If you don't want players to join if a session is full even though it wasn't full when they got it returned from the backend then you are deep in c++ land

#

Cause then you gotta use beacons to first query the session and potentially reserve the slot

thin stratus
formal solar
#

not advanced sessions because doesn't seem to work with 5.0.3

thin stratus
#

That's not a subststem

#

That's just a plugin exposing some more stuff to Blueprints

formal solar
#

idk actually i just followed a tutorial and i think it uses null and steam both

thin stratus
#

Steam?

#

It can't use both

#

So I assume steam then

#

Is it using the old implementation or the SteamSockets one?

formal solar
#

yeah

thin stratus
#

That info should be visible via your ini changes

formal solar
thin stratus
#

That's the old one

#

You probably also have the 9999 ping problem

formal solar
#

yeah

thin stratus
#

I don't have instructions at hand. Please look for SteamSockets plugin/NetDriver on Google to see how to change to the newer one

#

And see if that provides you with the right numbers

#

That should for example fix the 9999 ping

formal solar
#

sure thing I'll try that, I think there maybe is a way to get advanced sessions working with another tutorial i found for 5.0.3 so I will try and follow this tutorial first (on a copy) since the ping display isn't that important to me

thin stratus
formal solar
#

its fine thanks for help

#

have 2 options now hopefully

#

I just understood it so poorly i was terrified to deviate from this tutorial lol

quaint roost
thin stratus
prisma snow
formal solar
#

On the documentation for steam sockets it says I need to configure the WindowsEngine.ini file which I have done, but does this mean it won't work outside of a build packaged for windows, i.e. not in standalone?

#

guess i need to test lol

thin stratus
#

DefaultEngine.ini should make it work for Standalone just fine.

formal solar
#

ah yeah i figured i had to copy paste the same into there

#

can't seem to join sessions though XD

crystal crag
#

If I wanted to replicate a ship using the parent of Actor landing on the ground, carrying players with it, then what would be the best approach at a high level? Isn't there a new movement component of some kind that I could use for that?

#

We're talking at most 4 real players in the session at once.

brazen anvil
#

Is it possible to have the yaw from GetBaseAimRotation replicate to simulated proxies?

thin stratus
brazen anvil
#

Yeah it is virtual

plain torrent
#

Heya all - do I need to be using a c++ project for Advanced sessions and steam integration to work? I've spent two days trying to figure out wtf is going on - The p2p lobby's are found, and I get a success when triggering the join function - but then nothing happens.

crystal crag
#

I've asked my question a couple of times over the course of a couple of weeks... does no one here really have any suggestions for movement replication outside of using Character / CMC?

#

I'm not even looking for code. Just some threads to pull on.

latent nest
#

Is Playfab a good source for starting multiplayer in ue?

fallen fossil
#

I got actor following mouse pointer.
If I send to server updated positon, will server send update also to my client (owner) ? πŸ€”

#

I saw Remote Specifier, but im on 5.3, would this solve my problem? :d
I want it only to replicate to server and other clients but does not to re send same position ( and avoids jitter if mouse moves), multicast sends to all

fallen fossil
#

Aaaaa dummy, i can just check owner and reject update cause im using server + multicasr

#

But still, it would be nice If knew how to reduce unnecessary traffic

muted pewter
#

I have a Physics Based Hover Bike. It works smooth on a PIE Dedicated Server. But on a standalone Dedicated Server as soon as I posses Hover Bike the Game FPS Seems to drop suddenly Bike moves with a low FPS seems it stutters, as soon as I unposses Bike bike rest of the game works smooth but bike Moves with low FPS/Stutters idk if its a good explanation. But please do help me if you get it or please let me know if need any further explanation

prisma snow
muted pewter
#

PS: Bike is Placed on Server map i.e server owned. I have Disabled Simulate Physics for Clients and Enabled it for Server. When I enable it for clients Bike Mesh Detaches from Root on clients and moves invisibly but stays at same position for server.

thin stratus
crystal crag
#

Just looking for things to research. I think there is a new movement component of some kind, and there might be better solutions

thin stratus
#

UE has a very limited set of "movement replication".

  • Character Movement Component
    • Client or Server Auth
    • Client Prediction
    • Reconciliation
    • Smoothing
    • Root Motion (Sources)
    • Some anti-cheat stuff
    • And some other minor features and QOL things
  • Projectile Movement Component
    • Server Auth
    • Smoothing
  • Clicking "Replicate Movement"
    • Server Auth
    • No Smoothing
  • Mover
    • Features kinda depend on the backend used
      • Standalone/Singleplayer
        • Has some multithreading stuff
      • Chaos
        • Pretty much WIP, no clue what the feature level is, but could at some point tie into the remaining Chaos physics sim
      • NPP
        • Multiplayer/Standalone/Singleplayer
        • As WIP as Mover, lots of bugs, missing feature, false promises
        • Does offer Client Prediction, Smoothing and Reconciliation fwiw
    • Root Motion (although I think it's not fully implemented, no matter what Epic says)
    • Lacks tons of features and QOL stuff that CMC offers
    • A bit more modular, but nothing that can't be achieved with the CMC
  • GMC
    • "Expensive" Marketplace Plugin
    • Basically the CMC but in "better", whatever that means. I never used it and probs never will.
#

@crystal crag That's kinda all there is. If you are able to use C++ and you are happy with altering the Engine, or at least pulling NPP and Mover to your project level and modifying it there, try it out. Otherwise, use the CMC. It's the best you can get and will get for a while.

#

Or the PMC if you need some simple fake projectile or ball physics.

thin stratus
thin stratus
#

That should exist since probably even 4.0.

thin stratus
muted pewter
#

yes by FPS drop i mean vehicle was stuttering

thin stratus
crystal crag
muted pewter
crystal crag
#

I am ok with C++.

#

I want to have the players load into the ship and then the ship will land, carrying them with it as it does

thin stratus
#

People have done ships that players can stand on before.

crystal crag
#

I could never get the players to be able to stand on the ship when it was a player. It's a fully closed off ship with a door

thin stratus
#

That's basically based movement, which the CMC should support.

crystal crag
#

The characters just keep skipping if I force them on it, bouncing around. That was with the ship just statically on the ground and not moving

thin stratus
#

If the ship was absolutely static, then that shouldn't happen.

#

Maybe you had collision around the whole ship and it was fighting with the capsule

#

Can't really say what it could be of course. Have no clue about your project.

crystal crag
#

I started off by just trying to make a rectangle - 6 boxes to make a "ship" and each had collision

#

But that was required to not let the players walk right out of the ship by walking through the walls

fallen fossil
fallen fossil
muted pewter
#

@dark edge here's the link of video of problem. Stutter is lot worse on a packaged shipping build. Bike is already placed on server map so its owned by server. I'm enabling Simulate Physics for Bike Mesh on Server and disabling it for clients

exotic wasp
#

hmm

#

file download

latent nest
karmic briar
#

anyone can explain to me what moverblackboard does

#

i see them everywhere being used in layeredmoves and movement effects

#
 MoverBlackboard: this is a simple generic map that can store any type, used as a way for decoupled systems to 
 *  store calculations or transient state data that isn't necessary to reconstitute the movement simulation. 
 *  It has support for invalidation, which could occur, for example, when a rollback is triggered.
 *  Values submitted are copy-in, copy-out. 
 *  Unlike a traditional blackboard pattern, there is no support for subscribing to changes. 
 * TODO: expand invalidation rules attached to BBObjs, for instance if we wanted some to invalidate upon rollback. Some might expire over time or after a number of simulation frames. Or an item could be tagged with a predicted sim frame #, and become cleared once that frame is finalized/confirmed.
 
#

from the class comment, it seems to only being used to store temporary data?

quasi tide
#

What you're asking isn't really engine specific

winter hill
#

In my multiplayer lobby, the correct loadout was set for each playerstate. But seamless travel into game level somehow resets the TArray values in playerstate. The game mode in both levels use the same player state. Any clue as to why it happens?

fossil spoke
#

If you have information in them you want to retain across level transitions, you need to set that up in the appropriate function as an override.

#

You can do this by overriding void APlayerState::CopyProperties(APlayerState* PlayerState)

winter hill
fossil spoke
#

CopyProperties is passed the old PlayerState as the input param.

#

Which is what enables you to retain the data you want to keep.

#

If you inspect the engines version of this functions implementation, you will see what I mean.

winter hill
thin stratus
thin stratus
# crude kelp Or google cloud any idea I want it 24/7

No idea why it would stop after an hour. You'd need to check the logs of the cloud server and the UE server.

I can tell you, however, that you'll need to restart that server eventually, preferably once a day. There are counters in the code that otherwise count too high and run out of precision.

#

Also, you aren't by any chance running the project or the client as a ListenServer in the cloud, or?

#

You are supposed to build a Dedicated Server for that.

#

Which then doesn't need the ?listen and nullrhi parts.

crude kelp
hollow lintel
#

I just discovered the network physics component, as I've been working on a project revolving around space flight. When do you use this component? Does it interact with the movement component? Is there more information on it? I've been looking through google and it seems pretty sparse. My next step is to ask an LLM about it :x

hollow lintel
#

@dark edge Just pinging you since we were talking about very relevant stuff the other day

dark edge
#

The LLMs won't know a thing about it right now

#

From what I can see, the network physics component is used for the 2 new physics replication techniques. Dunno much about them though

hollow lintel
dark edge
#

the sim runs the "same" on all machines, and the drift between client and server is fixed up by the old physics replication system

potent valve
#

Hello all...
I have downloaded the 5.6 version, opened the base project. But when wants to do a multiplayer test as I normally did in the earlier version, both screens looses the mouse look, or 1 screen have and 2 screen lose the mouse look - Or not show any players, or the players navigation totally freshes what is up with all this? I also converted a 5.5 project to 5.6, and same story?

muted pewter
dark edge
#

your server is probably defaulting to 30

#

and your math that cooks up the forces probably is not quite formulated right to not blow up

muted pewter
#

Framerate for other vehicles on server is smooth as if they are at 60

#

When I unposses the hover it hover's back to ground a mechanism I have implemented. And its visible I can see Bike's mesh only moves with low fps everything else on server has smooth movements. probably your right theres something I need to check in maths ig

dark edge
#

it should not be

#

maybe that's the difference

muted pewter
#

yes its replicated, and if I uncheck replicate mesh. I simply cannot move bike as for movement I'm Setting Physics Linear Velocity.

#

using Server->Multicast RPC for MoveForward/backward Logic

dark edge
#

you shouldn't use multicasts to add force though, use them to set values (or replicate) which are used on tick to add force

#

This is the general form which works great for my project.

Input -> RPC
RPC -> set replicated variable
Tick -> use replicated variable to calculate force

#

Actor replicates, actor movement is replicated, component is NOT replicated (since component replication clobbers the actor movement replication)

muted pewter
#

let me try this

muted pewter
#

Replicating Bike was the main issue

#

Bike Mesh*

dark edge
#

that's because component replication naively just directly sets position and rotation, it sucks

#

it bypasses all the physics replication stuff

#

or rather, fights it

muted pewter
#

got it, thanks!

dark edge
#

Protip I learned from eXi, put a draw debug box somewhere on tick and have it draw one color for authority and another for non-authority. Then you can see what the server is doing at the same time

#

it'll work in PIE, you'll see both boxes

muted pewter
#

got you thanks for this It will be a lot helpful

left marsh
#

When using a breakpoint on an actor in visual studio how can I find the current NetMode?

unkempt lodge
#

hey i was checking the doc about RPCs and i saw that there is a new type of RPC since 5.5 that is Remote and i was wondering what is it used for. I can't find the usecase of this:

Here's the description of the Remote RPC

    
The RPC is executed on the remote side of the connection.

The remote side of the connection can be either the server or the client, but the RPC must be called on an actor that is owned by a client. The RPC behaves like both a Client and a Server RPC, but is never executed on the local side of the connection, only the remote side.
dark parcel
#

It sounds like if the server call the rpc, the client will execute the function.

And vice versa.

#

Why dont you test it.

thin stratus
#

And on top of that it won't run on the local machine. E.g. if you run a Server RPC on a Server owned actor, it will run locally. But the Remote one won't. It only works if there is a logical option to call on the "other side", aka remote.

#

I don't have an example for a use case though

winter hill
#

Hi, i'm using copyproperties() override to transfer data from old playerstate to new playerstate during seamless travel in cpp. I get this weird result where one client gets all the correct values transferred but the other client gets the wrong values (value of old playerstate is wrong). Is there a thing where unreal matches the wrong oldplayerstate to the new one during seamless travel handoff?

fossil spoke
#

Its more going to be the case that you have done something wrong unintentionally.

winter hill
fossil spoke
#

The more information you provide, the easier it is for people to help you resolve your problem

winter hill
#

ok, i'll try to rephrase the problem

winter hill
#

Setup:
Multiplayer dedicated server 1v1 simulated with PIE standalone 2 players.

  • Transition map not set.
  • Launch separate server ON
  • Run on single process OFF

Goal:
Transfer TArray<FPieceLoadoutEntry> in APS_ChessPlayer (player state) from lobby level to game level through seamless travel.

Observations:

  • Both Lobby game mode and Game Level game mode uses the same playerstate
  • Starting Match and Taskforce Setup both have delays to avoid race conditions
  • CopyProperties() override is implemented for transferrring custom variable data
  • PlayerState Constructor and Beginplay() called before CopyProperties()

Problem:
One client gets the correct Loadout values, the other did not

fossil spoke
winter hill
fossil spoke
#

How are you filling it with data?

#

PlayerStatePieceLoadout i mean.

winter hill
#

maybe it eventually should, but for now i didn't bother replicating it because i'm trying to move server-sided playerstate data from one level to server-sided playerstate in another level through seamless travel.

#

this should be the part that moves data from old loadout to new loadout

#

this is the code on PC_Lobby(controller) that moves data from local game instance to multiplayer lobby player state. The debug prints are all correct values

#

i just added more logs and found that old playerstate and new playersate have same unique ID, so UE should be matching the player states correctly. I guess somewhere in my code the values got reset somehow, and for some reason only 1 of the 2 clients got reset

karmic briar
#

i want to ask, if i want to ask sprinting with mover, i first need to make a custom FCharacterDefaultInputs right to delcare variable like bWantTo Sprint similiar to cmc and then make either a sprinting layeredmove that while active change the current speed/max speed to 1000 for example and have a transition that checking is movingonground and out inputcmd wanttosprint right

#

if now how would you implement sprinting

#

im thinking my InputAction just calling the bool by setting it to true and then on tick, it will check the bool on simulationtick? (viewing this from moverexamples where they registered custom input n blueprint by binding to mover OnPreSimulationTick and on tick, have a handlesprinting function equivalent that call queuelayeredmoved?

unkempt lodge
unkempt lodge
winter hill
fossil veldt
karmic briar
#

ah bummer

fossil veldt
#

infact i’d say outright don’t use it as a guide for how mover works at all, the api changed very significantly

karmic briar
#

i see

fossil veldt
#

probably you’re better off looking at the MoverExamples plugin that comes in the engine

karmic briar
#

currently im thinking of implementing sprinting as an instantmovementeffect, trying rn to get the commonsharedsetting and setting the get maxspeed with the instanteffectmultiplier

karmic briar
#

and this is my instantmovementeffect:

#



#include "CustomLayeredMoves.h"
#include "MoverComponent.h"
#include "DefaultMovementSet/Settings/CommonLegacyMovementSettings.h"
#include "MoverDataModelTypes.h"

#include UE_INLINE_GENERATED_CPP_BY_NAME(CustomLayeredMoves)

FKhaiInstantMovementEffect_Sprint::FKhaiInstantMovementEffect_Sprint()
{
}
bool FKhaiInstantMovementEffect_Sprint::ApplyMovementEffect(FApplyMovementEffectParams& ApplyEffectParams, FMoverSyncState& OutputState)
{
        FMoverDefaultSyncState& OutputSyncState = OutputState.SyncStateCollection.FindOrAddMutableDataByType<FMoverDefaultSyncState>();

        if (const FMoverDefaultSyncState* StartingSyncState = ApplyEffectParams.StartState->SyncState.SyncStateCollection.FindDataByType<FMoverDefaultSyncState>())
        {
            if (UCommonLegacyMovementSettings* LegacySettings = ApplyEffectParams.MoverComp->FindSharedSettings_Mutable<UCommonLegacyMovementSettings>())
            {
                LegacySettings->MaxSpeed = LegacySettings->MaxSpeed * SpeedMultiplier;
            }
            return true;
        }

    return false;
}

FInstantMovementEffect* FKhaiInstantMovementEffect_Sprint::Clone() const
{
    FKhaiInstantMovementEffect_Sprint* CopyPtr = new FKhaiInstantMovementEffect_Sprint(*this);
    return CopyPtr;
}

void FKhaiInstantMovementEffect_Sprint::NetSerialize(FArchive& Ar)
{
    Super::NetSerialize(Ar);

    Ar << SpeedMultiplier;
}

UScriptStruct* FKhaiInstantMovementEffect_Sprint::GetScriptStruct() const
{
    return FKhaiInstantMovementEffect_Sprint::StaticStruct();
}

FString FKhaiInstantMovementEffect_Sprint::ToSimpleString() const
{
    return FString::Printf(TEXT("Sprint"));
}

void FKhaiInstantMovementEffect_Sprint::AddReferencedObjects(FReferenceCollector& Collector)
{
    Super::AddReferencedObjects(Collector);
}
#


#pragma once

#include "CoreMinimal.h"
#include "InstantMovementEffect.h"
#include "CustomLayeredMoves.generated.h"

USTRUCT(BlueprintType)
struct KAIGAME_API FKhaiInstantMovementEffect_Sprint : public FInstantMovementEffect
{
    GENERATED_BODY()

    FKhaiInstantMovementEffect_Sprint();

    UPROPERTY(BlueprintReadWrite)
    float SpeedMultiplier = 0.0f;

    virtual bool ApplyMovementEffect(FApplyMovementEffectParams& ApplyEffectParams, FMoverSyncState& OutputState) override;

    virtual FInstantMovementEffect* Clone() const override;

    virtual void NetSerialize(FArchive& Ar) override;

    virtual UScriptStruct* GetScriptStruct() const override;

    virtual FString ToSimpleString() const override;

    virtual void AddReferencedObjects(class FReferenceCollector& Collector) override;
};
#

and i just followed the example on how they registered it

#

in onproduceinput i just add it to collection to the input command like this

#

then on presimulationtick, registered it and call handle sprinting event

#

which currently does this

#

its activating but doesnt work yet

#

WIP

#

πŸ’ͺ

#

this works as sprinting but trying to consolidate it in one movementeffect

#

tested it on 400 pkt lag and got no corrections so far

#

i probably should do is as a movementmode lol

#

and just transition it

#

because at its core im just finding the maxspeed and set it to maxspeed * multiplier

bitter pine
#

How should I handle spawning a bullet on a client

#

and then spawning on on the server

#

and handle the hit detection on the client

#

because the bullet is spawned on the client

#

Its not the same actor as the one on the server

#

Is there any way to make the client actor "point" to the server one

#

or something like that

bitter pine
#

I could just add code on the player character to handle the server damage logic when the client bullet hits

#

its a coop game so cheating is not an issue

#

so server rollback hitboxes would'nt be worth it

grizzled garnet
#

Running a separate dedicated server in PIE doesn't set the UE_SERVER macro? Is the best way to actually debug dedicated servers to try to launch a debuggame server instance of the project in a separate vs instance?

#

using project launcher now, the steam audio plugin of all things causes an error for a missing package (a material darn it this isn't client side code why is a material missing causing an error)

#

(ok in fairness, the steam audio material isn't the same as a shader material, im guessing the steam audio plugin somehow didnt get packaged by the book)

frank tinsel
#

Hey guys I'm missing something from my script and I can't quite figure it out. I want these materials to be seen the same by everyone. Here is what is currently happening and my script.

#

Would it be something like Spawn --> Set material ---> THEN send to everyone?

magic vessel
#

Yeah, if I understand your nodes correctly then what is essentially happening is that every player is selecting a random colour regardless of what the server is saying

#

If you want them to be the same, then treat the server as the authority and randomise them there

#

Then send the result back to the client

#

You could just send the number that came up (make sure to store the random value and then use the local as each call of the random node will give a new random number not just each new random node)

#

What might be happening as well is that the server is replicating the results, and then the client is overriding it when it receives the multicast

frank tinsel
frank tinsel
#

Is that what you're talking about?

#

Or is that a separate issue?

magic vessel
#

Potentially, where else are you calling the randomise material?

frank tinsel
#

That's the only place

#

In the hex tiles event graph

magic vessel
#

How frequent does it blink and change? Does it only flip to one and then another?

frank tinsel
#

Master hex tile and all 6 hexes are children of the master

magic vessel
#

If you send a video, I'll be able to help a bit more

frank tinsel
#

This only happens to tiles that are placed in the level, not spawned after play

magic vessel
#

Stupid questions but need to be asked:

#
  • Are there overlapping tiles and this is z fighting?
#
  • Can tiles call the randomise function on it's neighbours?
#

I noticed that the tile by itself doesn't seem to have this problem

dark parcel
#

Don't use multicast for stateful behavior btw

magic vessel
#

Does it happen with the listen server by itself? Or does it only happen with clients involved

dark parcel
#

that certainly looked like another mesh overlapping another mesh

#

probably mistake on the spawning part, you may possibly spawn multiple of it.

#

e.g spawning in the client but also spawning in the server which replicate to client so you end up with 2.

#

You should practice outside your tiles.

Just make a box that takes a random color. Have server decide the random number and assign the material.
Client simply OnRep the material variable and apply it.

frank tinsel
#

When I spawn in game, it doesn't duplicate anything and is fine

frank tinsel
#

As in move the custom event logic to beginplay etc.

fallen fossil
#

Hey, my friend has issue with Animations on dedicated server.

It can't detect collision due animation not playing. Characters are always in TPose, is there solution to that? :d

dark edge
#

BeginPlay -> authority? -> set ReplicatedRandomInt
OnRep_ReplicatedRandomInt -> switch -> do whatever (I'd use select instead of switch)

tame sapphire
#

If I have a repnotify variable on an actor that I am using to set the color of a mesh on the server to act as an indicator for when it has been clicked (URL below).
As there is multiple of these in the level it can get easily confusing figuring out which one you selected amongst the rest. Is there a way or what way would you recommend for setting a different color for the player that clicked (e.g. yellow) The following URL is the blueprint on rep function. I cant currently seem to override the color as set by the server on an event in the player controller after its been selected

https://blueprintue.com/blueprint/xg8yss9p/

In Summary I want to show an actor as white for non selected and red for selected which everyone else will see. This i currently have working however ideally id like yellow to show for the player who did interact /click

dark edge
#

then you have 3 states, either its void (not selected), equal to the local player (make it yellow), or not equal to the local player (make it red)

tame sapphire
#

@dark edge I get the enum and having the 3 options however as the actor is on the server and even if i pass it a select using multiple options within an enum im still not getting a different color for the controller and this would be for all not the individual? So on the below they all appear as yellow.

tame sapphire
#

So only the interacting controller should see yellow for the cube they selected but all others should see it as red. So whilst the above is correct for others the controller that selected should have yellow. so if player 1 selects actor 1 then 2 and 3 should be red but if player 2 selects actor 2 then actors 1 and 3 should be red

latent nest
#

I have a line trace that gets the end locaiton. I then have a projectile fire at that location. It works on the firing client but not the other client. It fires but in a random direction I have it set to fire on a multicast. Is there something I should hcange?

tame sapphire
#

@latent nest are you setting its forward vector in addition to the location?

latent nest
#

do you want me to send the code?

#

All happening in the player character bp

tame sapphire
#

Sry Im still learning and misread your first post

latent nest
#

No your good, im still learning too lmao

thin stratus
#

Cause you can't change replicated variables locally after all

tame sapphire
#

@thin stratus unfortunatley atm as its the only way I understood of being able to do this

#

im not changing a replicated variable however i am using that variable to set the color

#

its almost as if i need another event within the function to run on that specific controller but i could be very wrong

dark edge
#

a player reference (playerstate, pawn, whatever)

#

something that denotes which player has it highlighted, either none, the local one, or a different one (from the perspective of each machine)

#

if a cube says Adriel is the selector then Smartay's computer would see it and see that Adriel (the ref) != Smartay (the local player) so make it red

#

My computer would see that Adriel (the ref) = Adriel (the local player) and make it yellow

tame sapphire
#

@dark edge I do have a selected player controller variable but I cant see how it can go from being on the server setting its color to changing it to yellow for the controller reference from your reply so far Unless its not even in the rep notify function?. Appologies

dark edge
#

use PlayerState or Pawn

#

and check if it's a local playerstate or locally controlled pawn

tame sapphire
#

@dark edge this doesnt run on a local machine it runs on the server

#

so there isnt a local anything

dark edge
#

you want to know if the local player is what's highlighting the thing vs another player, right?

tame sapphire
#

not entirely. I want the local tto have a different color so they can identify there selection

dark edge
#

yes

#

what I've been laying out here will do that

#

you care if the replicated repnotify variable in the actor is void, the local player, or some other player

tame sapphire
#

Then apologies as I dont understand as its currently written

dark edge
#

if void, not hightlighted. If local player, it's red. If other player, it's yellow

tame sapphire
#

I have a number a of times and from my understanding this still isnt lining up with what im trying to say so maybe im not explaining myself correctly

dark edge
#

instead of replicating a boolean bIsHighlighted, you replicate WHO is highlighting it

#

then on each machine, you can check if WhoeverIsHighlightingIt is the local player or not

tame sapphire
#

That I understand, thank you and apologies

dark edge
#

you can't use a PlayerController since that doesn't replicate to other machines, you need to use a pawn ref and check if locally controlled, or a playerstate ref and do whatever the equivelent is to check if it's the local players playerstate

tame sapphire
#

it will have to be a playerstate for me and my situation but thats great thank you

tame sapphire
#

@dark edge would you have 2 mins for a voice call as I have a question and it may just be for me and sanity to just make sure but am also hoping i can skip any confusion on my end this way to

#

if not then thank you for your help anyway (It just for me this method still is same color regardless of if the interacting or not after switching)

thin stratus
#

This is just guess work at this point

#

What you want to do is relatively simple, so you must be doing something wrong somewhere which we can't see without you sharing all involved code in this setup

tame sapphire
#

can happily share project if easier

#

I didnt get the chance to update the event names whilst testing

#

easiest explanation for something similar would be as a replicated spawn tile

dark edge
tame sapphire
#

@dark edge I have to go, but will try after thank you for the reply

sullen sail
#

Need Help: ActorChannelFailure 5 on Dedicated Server Spawn
Hi everyone, I’m testing a mobile game using a dedicated server setup. Here's how I’m running my testing:

  • The server is packaged and running on Windows.
  • The client runs in the Editor (Standalone mode, two Editor instances).
  • Players successfully connect and trigger OnPostLogin correctly.
  • The issue happens right after the GameMode tries to spawn the player character.

Does anyone know what causes ActorChannelFailure 5 during spawn on dedicated servers? Could this be due to replication issues or asset loading problems on the server side?

Thanks in advance!

nova wasp
#

Editor only data?

sullen sail
#

yes

#

editor client pack server