#multiplayer

1 messages · Page 174 of 1

hollow eagle
#

and sprint has been done hundreds of times over, vault is a bit harder but really just comes down to root motion

sour dragon
hollow eagle
#

I'm just giving an example of one way of doing it.

#

Everything you've said is doable with CMC.

sour dragon
#

I guess my approach is even easier, or do you think it can be done with root motion easier?

#

i mean the vault precisely

modest crater
#

Could someone explain why my pointer varies in size when replicated? void Server_SendShootEvent(float x, AActor* y);

I am just trying to figure out some performance metrics before I move forward

sour dragon
hollow eagle
#

what do you mean sync them

sour dragon
#

I give you a example, because i can't explain whats causing this, one sec

hollow eagle
#

unless you're doing movement driven by animation, there is no "sync". You make an animation graph that responds to movement.

modest crater
hollow eagle
#

because the actor may not have been assigned a netguid yet, so it needs to send the path (assuming it has a stable path and isn't a runtime created actor) to assign the guid.

modest crater
#

Its average is 53bits and max was 248, sorry if that wasnt clear from the image

modest crater
hollow eagle
#

it will send the path once and from then on it should have a guid it can use instead.

#

though it may need to re-send the path a few times, depends on when the guid gets ACK'd

modest crater
#

Wow okay, thats really great to know, really appreciate that

sour dragon
kindred widget
#

Who's view is this?

sour dragon
#

Client 1, Client 2 is being watched and Server auths the sprint, settings : 200/5

kindred widget
#

Looks like out of sync movement speed.

hollow eagle
#

That looks like you are either playing with some very bad network simulation settings or you have implemented sprint incorrectly.

#

Or both.

kindred widget
#

IE you didn't set it on one of the machines.

sour dragon
#

I set the emulation* to 200 latency and 5 packet loss

kindred widget
#

200 is a bit brutal

hollow eagle
#

Which is pretty bad. But honestly you probably just did what Authaer said - you didn't implement sprint correctly.

#

All clients must know other clients' movement speed to simulate them correctly between net updates.

kindred widget
#

If you are setting it on every machine, you need to up the uh.. I don't remember the name, the correction radius.

sour dragon
solar stirrup
#

Yeah you cant use RPCs for movement

hollow eagle
#

I mean you can

#

that isn't the issue here

solar stirrup
#

With the CMC?

hollow eagle
#

the issue here is that only the owning client and server learn that the walk speed is changing

#

so every other client is mispredicting the client's movement between net updates.

hollow eagle
solar stirrup
#

Fair but the client will also predict sprint speed wrong as well when performing movement

#

Ay fair, but that's gonna cause rubberbanding

hollow eagle
#

Eh, with the right network settings it'll be minimal.

#

And again, not really any choice from blueprint.

solar stirrup
#

just use the GMC

sour dragon
#

Pardon, forgot this one to screenshot :

hollow eagle
#

that's a bad way to do things

#

that should not be an RPC

#

it should be a replicated property

kindred widget
#

Oof. State in an RPC

hollow eagle
#

You've probably dropped that RPC entirely on other clients so they never see the movement speed updated.

#

seeing as you're running with pretty bad packet loss

sour dragon
#

Holy this would explain it.

#

Oh actually i think the problem is somewhere else, i did not rpc the stamina change in my stamina drain function.

hollow eagle
#

...also sounds like an incorrect use of an rpc

sour dragon
#

Any pointer where i can look up how to do it properly?

shell pendant
# sour dragon Any pointer where i can look up how to do it properly?

In this tutorial I'll show you how to make your own multiplayer third-person shooter, complete with replicated procedural aim offset, particle effects, sounds, blood spatter, health, death, respawning, and more. I'll also walk you through a few key aspects of replication in an attempt to help you start thinking about how a multiplayer game is se...

▶ Play video
#

Somewhat like this, might be newer ones but this works (as far as I know)

kindred widget
#

@sour dragon The basic idea is this.

#

You RPC the player's intention. Server sets state, everyone gets it and locally changes their CMC values to match.

#

If you set this up and you're still getting rubberbanding while a client holds shift and runs, then you need to increase the SmoothUpdateDistance properties here a bit.

sour dragon
#

Thank you both, will try to recreate it 🙂 !!! regards

shell pendant
nocturne quail
#

What's the difference between
starting a dedicated server with in the editor with 2 clients
and
starting the dedicated server from command line and joining two clients from command line ?

#

i have a problem that i spawn items on game mode when the game starts, so starting the dedicated server with in the editor works perfectly and all clients can see all items on correct locations
but starting from command line and joining later from command line every client sees items at the center 0.0.0 location in the level

#

maybe this is happening because
When we start a dedicated server with 2 clients from within the editor, we are essentially running the server and clients within the same process ?

#

and running from command line the server and clients are on different process and the world location for the spawned items are incorrect for clients?

lethal blade
#

I mean from menu level to server map. In between I want loading screen. More or less with seamless way Is it possible? Any tutorial or article from community?

nocturne quail
kindred widget
sinful tree
nocturne quail
# sinful tree There technically shouldn't really be a big difference. Are you able to share h...
for (auto& Element : SpawnLocationTable->GetRowMap())
{
    if (const FST_ItemGroupLocation* OutRow = reinterpret_cast<const FST_ItemGroupLocation*>(Element.Value))
    {
        SpawnTransform.SetLocation(OutRow->Location);
        // Set other transformation properties as needed

        // Spawn each item using the specific spawn location
        for (auto& IDElement : ItemsIDs)
        {
            // Use the spawn location from the data table
            SpawnLocation = SpawnTransform; // Use the specific location from the data table

            // Spawn the item with the specified location
            switch (SpawnType)
            {
                case EItemType::E_Weapon:
                    {
                        APickupWeapon* Weaponitem = GetWorld()->SpawnActorDeferred<APickupWeapon>(PickupWeaponClass, SpawnLocation, nullptr, nullptr, ESpawnActorCollisionHandlingMethod::Undefined);
                        if (IsValid(Weaponitem))
                        {
                        Weaponitem->SN = GetRandomSN();
                        Weaponitem->ID = SpawnID;
                        Weaponitem->Ammo = 0;
                        Weaponitem->Amount = 1;
                        Weaponitem->SetReplicates(true);
                        Weaponitem->FinishSpawning(SpawnLocation);
                        ItemObjects.Add(Weaponitem);
                        }
                    }
                    break;
                // Handle other item types similarly
            }

            // Add the spawned item to ItemObjects
        }
    }
}
return ItemObjects;
#

error log in client console:

[405]LogActor: Warning: SetReplicates called on non-initialized actor BP_PickupWeapon_C_9. Directly setting bReplicates is the correct procedure for pre-init actors.
[405]LogDataTable: Warning: UDataTable::FindRow : '' requested invalid row 'None' from DataTable '/Game/Items/Weapon_Table.Weapon_Table'.
#

i fixed these two issues now about those warnings, but still the items are spawned at the center of the level

// For the SetReplicates warning
if (IsValid(Weaponitem))
{
    Weaponitem->SN = GetRandomSN();
    Weaponitem->ID = SpawnID;
    Weaponitem->Ammo = 0;
    Weaponitem->Amount = 1;
    Weaponitem->bReplicates = true; // Set bReplicates directly
    Weaponitem->FinishSpawning(SpawnLocation);
    ItemObjects.Add(Weaponitem);
}

// For the UDataTable::FindRow warning
if (WeaponData)
{
    if (const FItemWeapon* OutRow = WeaponData->FindRow<FItemWeapon>(FName(IDElement.ID), ""))
    {
        // Handle the found row appropriately
    }
}
reef bison
#

I am trying to replicate the removal of instances in a PCG spawner blueprint but I am receiving this error:

=== Handled ensure: ===
Ensure condition failed: TestObject->IsSupportedForNetworking() || TestObject->IsNameStableForNetworking()  [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\NetDriver.cpp] [Line: 6752] 
Attempted to call ProcessRemoteFunction with object that is not supported for networking. Object: /Game/ThirdPerson/Maps/UEDPIE_0_ThirdPersonMap.ThirdPersonMap:PersistentLevel.BP_TreeSpawner_C_UAID_D85ED3541EC43DED01_1401064167.PCG_Tree_01_1 Function: MC_RemoveInstance
Stack: 
[Callstack] 0x00007ffa5c5ca447 UnrealEditor-Engine.dll!UNetDriver::ProcessRemoteFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\NetDriver.cpp:6752]
[Callstack] 0x00007ffa5b8fc5df UnrealEditor-Engine.dll!UActorComponent::CallRemoteFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp:769]
[Callstack] 0x00007ffa9688730b UnrealEditor-CoreUObject.dll!UObject::ProcessEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2010]

this doesn't always happen so I am very confused on why this is happening. this is my setup:

  • a blueprint actor with Replicates set to true, that contains a BoxComponent and a PCGComponent
  • the PCGComponent has a graph that spawns some static meshes of trees, with my custom component: UTerraResourceInstancedStaticMeshComponent (inherits from UHierarchicalInstancedStaticMeshComponent
  • when I hit one of the trees, I call a method in this custom component class that runs on the hitting client and on the server. I check for authority then call a multicast that is defined on this same component

then the game crashes on the multicast call, but not always ablobdizzy

hollow eagle
#

seems like you're trying to call an RPC on a component that isn't setup to replicate

pallid mesa
#

The error indicates that your tree spawner (BP_TreeSpawner) tried to call a rpc and wasnt allowed to

reef bison
#

when I first got this error I enabled the Replicates on the BP_TreeSpawner and it worked. but then it randomly crashes so I am not sure how to debug this

on the error message there's this: BP_TreeSpawner_C_UAID_D85ED3541EC43DED01_1401064167.PCG_Tree_01_1 so I think it is not referring to the actor itself, but a component of the actor (PCG_Tree_01_1)?

fossil seal
#

Heyo! I've got a question about replicating spawning an actor and attaching it to a socket, i followed a tutorial online about implementing a bow and arrow in my game. But it was for single player. Now after some fiddling, I have the bow replicating on the server side and the Client see's the server's bow when spawned and destroyed, however the client side is only seeing the actor spawn and destroy locally, also when the server has the bow out, the client can no longer destroy the bow. Any thoughts on this ?

I'm using two functions setup in the AC_BowMechanics BP and calling them via the BP_ThirdPersonCharacter

#

I think i'm doing the logic wrong, and not calling the functions on the server from the client at all, and just doing it locally, but i'm unsure as to how to get the client to call the functions from the server as well.

#

Disregard! I figured it out haha

#

i had to make new server events have them call the functions. 🥴

gray blade
#

Hey peeps, wondering if shooting projectiles with RPC is enough and wont cause desynch or should I be using something like GAS?

sinful tree
# gray blade Hey peeps, wondering if shooting projectiles with RPC is enough and wont cause d...

If you shoot projectiles with an RPC to the server, the the actor will spawn on and be moved only by the server and should be an accurate representation of how the server sees the object. However, this can appear "laggy" to the client that is performing the shot as they would have to wait the roundtrip ping time to actually see something happen after they've requested to shoot. GAS doesn't really fix this issue for you. GAS does have client prediction of activation of their abilities, but it doesn't predict projectiles that would need to exist on the server while being spawned on the client first. Unreal Tournament source code apparently has what you'd need to properly predict projectiles so that the projectile can immediately spawn on the client, then spawn on the server, then have the client's projectile catch up to the server's projectile.

gray blade
#

im also using smooth synch plugin and its amazing and has saved me from having to fiddle with CMC in c++

gray blade
#

regarding smooth synch, should I check the replication box and should I check the auto activation box?

lean burrow
#

I uploaded Dedicated server on AWS & use EOS for Matchmaking system. Now iam struggling with in-game server regions change. Can someone give me the process or code of it?

wise wing
#

Any idea why this doesnt work

#

ive never once had this issue, but the session always fails to create

pallid mesa
reef bison
#

yeah I think the issue was that the NetMulticast was being defined in the component itself so I had to mark it as replicated too, that makes sense blobthumbsup

pallid mesa
#

nice! :)

#

i didnt follow up tonight because i went to sleep! but glad u got it sorted

crude kelp
#

Hello

#

I have an issue I have a dynnamic IP and I was wondering how could I make a " global server" so you can always enter into it

#

can unreal do DNS? and introduce name rather than IP ?

flat night
#

hey guys, I saw a post above a bit about rubber-banding, is this the same that's happening in my game? You can see the client window and the Host(red) has smooth movements, but the Client's(blue) is jittery and ugly. The host sees the same ugly movements as well. I played the other day with my coworkers and that was one of the biggest issues that needs to be addressed. Any ideas what to look into?

shy thistle
flat night
#

Yes

shy thistle
#

I know there's a bunch of network smoothing properties in the movement component that might help

flat night
shy thistle
#

Under character movement is Orient Rotation to Movement ticked off?

flat night
#

lemme check

lusty sky
#

Orient to movement can cause that jitter too

flat night
#

I see I've set these I guess a long time ago

GetCharacterMovement()->bOrientRotationToMovement = true;
    GetCharacterMovement()->bConstrainToPlane = true;
    GetCharacterMovement()->bSnapToPlaneAtStart = true;
lusty sky
#

bOrientRotationToMovement try to disable that and test it

flat night
#

damn, that fixed it 🫠

#

idk why I had set it up in the first place

#

thanks!

shy thistle
#

🎉

old knot
#

hey guys, I defined a custom pawn as a drone and will spawn it during gameplay, but I have an issue accessing it when testing with clients. drone spawns but clients access to null! what shoud i do?

thin stratus
wise wing
#

Could anyone VC who has extensive knowledge on multiplayer networking, I have a significant networking issue where when anyone joins a lobby, it doesn't connect them to the same world level as the host, this is causing some issues (note: It just keeps them in the main menu like nothing ever happened)

thin stratus
wise wing
thin stratus
#

It doesn't need to be part of future ServerTravel calls though.

harsh ice
#

Voice chat is not working on server travel 😔

#

Does anyone know how I can fix this

#

@thin stratus do you know any way I can use voice chat after server travel

sour dragon
#

Hello, i got it working so far that i got a replicated sprint, now i tried to make it that when the left shift is pressed down for longer than 5 seconds, it keeps the sprint speed. But now i want to implement that when the W Key is released it always defaults to the normal walk speed. So as long as left shift is pressed for longer than 5 secs > go into 1000 walk speed, if released go into 300 , if released and in sprint loop (hold down longer than 5 secs stay in 1000. How would i get around knowing when the W key is released?

#

So to break down the problem and dont talk too much : If W Key is released at any time, fire the "Player Wants to Sprint" value with Bool ticked off

#

So something like this :

kindred widget
#

Could just RPC the key up with sprint off I think.

sour dragon
#

Got it working this way, but im pretty sure its jank 😆

dark parcel
#

For movement you do need one, otherwise it's unplayable

#

Imagine pressing shift and start sprinting 1 sec later

#

You should test with lag to see if something works or not

sour dragon
#

Yeah im going to emulate lag now and see how it works out

#

Im just learning this stuff so i guess it will be jank and not perfect but thats why im learning

#

First thing i actually try to do networked

brisk swift
#

anyone know good tutorials on saving game for multiplayer, I've got a save and load game system but the clients load the hosts save file not their ownn

sour dragon
#

It actually works on Client 1 but on Client 2 the sprint does not trigger at all

kindred widget
sour dragon
#

Works now, was because of the default walk speed.

dark parcel
#

I wouldn't call that working 😔

#

That will be frustrating for players

#

I'm gonna hit the hay, but you probably should look at delgoodie cmc guides in youtube. It goes over sprinting in multiplayer.

sour dragon
dark parcel
#

Yes but then that's fake test because in real world there is always lag

sour dragon
#

Yeah i know, but what is the problem here

dark parcel
#

Somethings are not doable in blueprint

wise wing
wise wing
sour dragon
dark parcel
#

My only advice is to look at delgoodie cmc videos

#

He compacted a lot of stuff that you need to know when working with cmc in network environment

sour dragon
#

I looked into his vids already some days ago, but the problem is im still not a C++ programmer

dark parcel
#

Me too but I get by

#

It's the only way to do sprinting in multiplayer

sour dragon
#

Alright ...then im going to do it

dark parcel
#

Good luck, but don't look for blueprint alternative

#

They won't work for multiplayer cmc. The reason are stated in the video

wise wing
thin stratus
#

No, please post your issues here and allow others to help too. I don't have time for private support (:

modest crater
#

Why is unreals possession framework so messy 🙃, somethings are client only, some are authority only, some run twice for some reason and others are redundant race condition calls on the case one arrives before the other

thin stratus
brisk swift
#

what variable type is the same as 'Blueprint Session Results' in CPP

thin stratus
#

Guess for proper stickers I would need to give Discord money

latent heart
#

I'm not sure learning from an uppity panda is going to work too well.

little zealot
#

Hello guys, do someone know how i can get the output log of my failed visual studio build of unreal

thin stratus
latent heart
#

Salty ?

thin stratus
#

But uppity is not salty

latent heart
#

When I see salty, I think "panda has been embarrassed and is now getting angry"

#

Apologies if this is your company name 😂

thin stratus
#

Na, Panda Studios was my wife's company name. The "Salty" part comes from my end being "salty" during competitive games. I can't handle losing that well in those :D

Uppity means "self-important" or "arrogant" which is not really the same.

latent heart
#

Eh. They're related!

thin stratus
little zealot
#

Not the full log

thin stratus
latent heart
#

It's more related to the reason why you're salty.

thin stratus
#

I like my food well-seasoned of course.

thin stratus
little zealot
#

It just says error Error MSB3073 The command ""C:\Program Files\Epic Games\UE_5.2\Engine\Build\BatchFiles\Build.bat" MultiplayerBlueprintLobbyEditor Win64 Development -

latent heart
#

Close the error list. Open the output tab. Never look back.

#

(That's for VS)

odd iron
#

hi guys,
When Seamless travel set to true on Lobby Gamemode game crashing on servertravel in standalone launcher.
Before Calling any Seamless Functionality its crashing
and no error in the log except this How to fix it ?

thin stratus
#

They are a few gigs big, but they allow you to actually see what code in the Engine is causing this.

#

So far it seems to happen inside the Chaos Module.

odd iron
wise wing
#

I am trying to make a system where all connected players have their individual profile here, but the issue is that the information is sourced from the game instance and I am having troubles getting that data to everyone

#

so from the hosts point of view, it shows 2 players connected (me and my friend) however it justs shows the same info twice

#

(on my friends side it just shows herself twice as well)

#

Ive tried getting the data on the player state but its clearly not working

#

I thought player states were replicafed across all clients and the host

sinful tree
# wise wing I thought player states were replicafed across all clients and the host

Replication is only one way, from server to clients. If clients have data that they want to share with other clients, they must call an RPC to the server with the data on a replicated actor that the client owns (like player controller, playerstate, or their controlled character), and then the server can set the RPC'd values in replicated variables on replicated actors which will then share them with other clients.

wise wing
#

So should this in theory work (this is the player state)

sinful tree
#

Yep, assuming the GameInstance has the player info before begin play fires.

wise wing
#

it does

#

So how would I go about getting all the different players info into an array?

#

I was running this in the game state

#

im not sure if thats even the right place to do it

sinful tree
#

You wouldn't need to do this. Each playerstate can contain their own player information.

wise wing
#

but I want to make it an array beacuse I have a system that uses that array of info to make child widgets of the information

sinful tree
#

You have the PLayer Array which is the array of playerstates. If you have that then you can get the value from each playerstate.

wise wing
#

ahh I understand

wise wing
sinful tree
#

For reading the array for values, yep.

#

Though technically you woudln't need to cast the gamestate

wise wing
#

ahh okay I tink im starting to understand how it works

#

what are the alternatives?

sinful tree
#

Just get gamestate and get the player array.

#

You only need to cast if you have custom variables or functions you want to access or call.

wise wing
#

oh sweet, thank you !

#

I understand

#

Ill test it out shortly

oak prawn
#

"server travel" works smoothly in the game engine, but when rendered, it does not work on real computers, the client returns to the lobby again.
how can i solve it

wise wing
#

my side

#

her side

#

any ideas?

#

(im host, shes client in this image)

#

the game still knows that there are two player states, it just wont transfer the information

sinful tree
#

How are you updating the data in the widget?

wise wing
#

ill show you

#

I have an event that runs every second to update it

#

here is how it works

sinful tree
#

If you're only pulling the data on construct of the widget that might be before the data has replicated.

wise wing
#

but furthermore the event is run every second, so it cant be that

#

this is the event that sets the info on the server (playerstate)

wise wing
# wise wing

Even the host isnt getting the clients info, otherwise it would show here

sinful tree
#

Seems slightly wasteful to constantly construct and deconstruct the widgets, but anyway, check what the values are on the playerstate on the server.

wise wing
sinful tree
#

You can try putting a print string in the RPC

wise wing
#

ahh yes, Ill do that now

wise wing
sinful tree
# wise wing

Likely ties back to this - Begin Play fires on both the client and the server, and because this is playerstate, it'll fire for for each player on each client.

wise wing
#

can I find out which player the playerstate is local too and only run it for them?

sinful tree
#

Yep. You can "Get Player Controller" on the playerstate, check if it is valid, and if it is locally controlled.

wise wing
#

yeah, Ill do that

sour dragon
#

I have question regarding Mover 2.0, can someone explain to me on a low level how it will work for Blueprinters. So will blueprinters also be able to have Client Prediction and Lag Compensation, and if yes. How will the application of those things look like. Is it like a component that sits in the Character class that replaces CMC and has more or less the same functionality and uses similar nodes such as WalkSpeed,Deceleration etc? Will the integration be like a fire and forget solution where just the pure existence of the new Mover component will handle what i do inside the Character BP (so will it apply those network features) by itself or do i need to actively use nodes for stuff such as lag compensation etc... ? A example would be a vaulting system. Is that already properly replicated, compensated and client predicted as soon as i add my nodes or do i need to add new networking nodes that we did not use before?

sinful tree
#

No, you need to ensure the player controller is valid first before attempting to access if it is a local controller.

#

Just use the other Isvalid

wise wing
#

understood, yes as the other one already has the branch internalized

sinful tree
#

and you don't need the instigator, just the controller, you can check if it is local or not.

wise wing
#

got it

#

so something like this then?

#

once again, host has itself and an empty slot

#

and client has nothing

#

@sinful tree Could I have a system where the player blueprint gets the info from instance, sends it through the run on server thing and use that to get it on the player state?

#

do you think that could work?

sinful tree
wise wing
#

I am able to confirm that the values are correct, so im still stuck with this situation

#

Do i need to add any conditions to the variable perhaps? (playerstate)

sinful tree
#

Just replicated should be sufficient.

wise wing
#

understood

#

what about this? (this is the run on server event)

sinful tree
#

That doesn't matter.

wise wing
#

understood

#

arent controllers only stored host side?

sinful tree
#

Player Controller is created on the server and replicated only to the owning player (no other clients)

wise wing
#

understood

#

so the client would still know what its local controller is

sinful tree
#

Well, technically the "Get Player Controller" IsValid? is what blocks clients. A client would only ever have their own player controller available so for playerstates other than the owning playercontroller's, this value would return null. The local controller is for ensuring the server isn't executing it since they have all controllers.
That being said, if you know for certain that the value is on the server's copy of the playerstate correctly, then the issue isn't with setting the data to the server.

#

Like if you connect a print string directly up to this and print out some of the values, you should see 2 of them appear in the log, with the data from each game instance.

wise wing
#

im going to do another print string

oak prawn
#

"server travel" works smoothly in the game engine, but when rendered, it does not work on real computers, the client returns to the lobby again.
how can i solve it

wise wing
#

results from just me in the lobby, 36

#

when my friends join, if I get any number that is not 36 then Ill have my results

#

one sec

#

I can 100% confirm @sinful tree that the data is correct

#

it is correctly getting the data and sending to the server

#

this appears to work perfectly then.

#

this (in the widget) must be what isnt working

#

but also to note, the client doesnt see anyones stats

the host still sees their own

sinful tree
wise wing
#

ill show you

#

that was it

#

I took the info and printed it

#

its different for both players and it did show me the correct values

sinful tree
#

Ok, but then why is it not saying "Server: 88" rather than just 88?

wise wing
#

I didnt know it was meant to say that, but im not sure why

#

do you think thats where the issue lies?

kindred widget
#

Standalone print

wise wing
#

elaborate please

sinful tree
#

In a multiplayer game when you use the print string node, you'll see "Server: " or "Client0: " "Client1: " etc..

wise wing
sinful tree
#

So that likely means you aren't playing in a multiplayer environment.

wise wing
#

but how was it hosted and I was able to get my friend to join?

#

any ideas?

#

ill show you the game creation page

#

this always returns as "Session worked"

#

as in its successful

kindred widget
#

Ah. Then the print is normal. Only does this in PIE testing.

wise wing
#

oh, I wasnt in the editor, I was running it on steam so my friend could join

kindred widget
wise wing
#

I just kept uploading the build

#

I can run it in the editor too one sec

#

I cant get the second PIE to join the game

#

as its built for steam and I cant invite myself

kindred widget
#

Are you pulling any data from steam? If not, you can just open level as a listen argument on one PIE session and then do Open 127.0.0.1 on the second.

wise wing
#

there is steam data being pulled yes

kindred widget
#

Oof And not templated?

#

I tend to put things like that behind some sort of generic system. So that it'll work regardless of whether I'm in PIE, EOS, Steam PSN, etc.

wise wing
# kindred widget Oof And not templated?

im not sure what that means, but what I do know is that steam is physically built into the code, I had to convert the project into a hybrid and I would also have to phsically go in the config and turn off the steam subsystem

#

or remove it

kindred widget
#

The only thing you should be changing between builds largely is the ini settings. Which net drivers to use and whatnot. And Editor won't use the same ones, it'll use Null.

#

Helps with iteration. 😄 Less cooking and updating Steam to test minor things like a UI change.

wise wing
#

I have new information guys

#

ill send the picture

#

both numbers are returning as server

sinful tree
#

Which you'd expect from that print 🙂

#

So here's the thing.... If you know for certain the server is getting the values for both, (you're getting 2 prints with different values on the server instance) then the replication should be working just fine as this is the playerstate, and you're constantly polling the playerstates for the values. Your only other test you can do is see if the values are coming out here correctly.

wise wing
#

ill test that now

sinful tree
#

Which technically you already are in your widget.

kindred widget
#

The issue is the white widget not initializing with correct data, right?

wise wing
#

also PIE doesnt display ANY data at all

#

on those widgets

kindred widget
#

I don't see any error with what you've shown so far. What about the stuff in that widget?

wise wing
#

that image shows how im going about getting the information

kindred widget
#

Also for note, I'd recommend switching this to a listview and just passing the playerstate as the shown object. You'll end up with a ton less widget creation and avoid bugs like a right click menu dismissing itself when your timer runs.

#

Er, TileView, not listview.

#

But no, I mean inside of the widget itself.

#

I saw where you were passing arguments to the widget, but what about the widget's construct event?

wise wing
#

there is the widgets construct

kindred widget
#

The child one I mean that is displaying the data.

wise wing
#

ahh one moment

kindred widget
#

The WB_Level's construct event

wise wing
kindred widget
#

I would start with that.

sinful tree
#

pain

kindred widget
#

Not sure that should be ticked.

wise wing
#

I understand

#

I think I did that my accident actually haha

sinful tree
# wise wing

Either way, if you know for sure the values are good here on both instances, then it's no longer a replication issue. Now it's just a matter of ensuring your widgets are displaying the data correctly.

wise wing
#

we can rule out replication

#

I wonder why the widgets themselves were not working, think it was the tick thing I had?

#

Ill try it with construct

sinful tree
#

It's probably part of it. It may take longer than a single frame to retrieve that data and that node may stop executing if executed again.

wise wing
#

Ahhhh

#

that makes a lot of sense

#

hence why for the host, I saw myself but the client didnt see anything

kindred widget
#

I would even more strongly recommend a tileview here. Just make it update on object set.

sinful tree
#

And I agree with Authaer in terms of formatting this a bit better - you can pass a playerstate to a widget with a TileView.

wise wing
#

what does that mean and where would I start?

kindred widget
#

Not much. Your main widget just needs a tileview instead of the hbox.

#

Then your child widget nees an interface added and a function implemented.

#

Sec

#

Start in the child widget. Go to it's Class Settings. Add the UserObjectListEntry interface.

#

You'll get this function to override, you can cast the passed object to your playerstate.

wise wing
#

Oh I understand, So I should make an interface for it

kindred widget
#

There already is one.

wise wing
#

Ahh so I can use that

kindred widget
#

In the parent. You add a Tileview. Set it's EntryWidgetClass to your child type. It won't show up unless you have changed the child's interface and compiled it's BP.

#

Then in the parent, the timer you have is changed to this.

#

Much easier handling than managing manual widget creation.

wise wing
#

this still isnt displaying

#

but I know for CERTAIN that the correct informatino is entering the create widget thing

wise wing
kindred widget
#

I would start by sequencing some stuff in the child

#

Sequence, request the avatar and set the avatar after that comes back. Then do everything else immediately.

wise wing
#

okay Il try that

#

imagine its not working simply because this is failing

#

and it never got to do the rest of it

#

wouldnt that be funny

#

wait a sec

#

I do want to thank you guys for the help though, its been a good learning experience I could say

#

(one moment, ill upload this for my friend)

#

Good news, it works, thank you guys

#

(the avatar thing I can fix)

rose pollen
#

is there a good guide anywhere on profiling a linux dedicated server build (build on windows with cross compililation, then deployed onto a linux server). I'm not entirely certain exactly what is using the most CPU (I think updating the skeleton/bones) but I'm not certain.

rose pollen
#

thanks

woven basin
# sour dragon Somebody can help?

no one really knows. For now its mainly c++, still in beta, and some of the smarter people in this channel are playing around with it, releasing interesting pieces of info here and there. If your after a blueprint solution, from everything I've read, mover 2.0 is not for you yet. The future, who knows...

sour dragon
#

Damn so GMC or go home ?

#

Absolutely not understandable why Epic is abandoning Blueprint Networking, improving Networking and the Movement for C++ users, making it easier. Just to absolutely screw blueprinters over in the end when we need it the most. If i knew C++ i would not use Blueprints. I mean did nobody ever tell them that their customers are using third party plugins for the most basic thing because they can't implement their own system properly?

hollow eagle
#

they're not abandoning anything

#

proper movement prediction and replication has never been the realm of blueprint

#

and mover isn't even remotely production ready, not sure why you're so worried about using it when it isn't done.

#

CMC still works perfectly fine for what it's good at. Properly creating new movement modes requires C++ but blueprint has never been suited for the kind of complexity that movement prediction brings, let alone perf requirements. It's just never been a target for them.

sour dragon
#

Is GMC at least learnable in a reasonable amount of time if theres no alternative? Those 700$ hurt but if its the only way i guess i will need to go that route

#

What i want to add, its not like i need perfect replicated and Client Predicted movement in 2 weeks, but rather in 6-8 months, but currently when thinking about it i just need a plan for the future

hollow eagle
#

From what I've seen you posting you don't even really need what it offers. CMC already replicates and predicts fine unless you need a custom movement mode, which involves C++.

#

Why isn't CMC good enough? No one can tell you whether GMC is fine if you can't answer that question.

sour dragon
#

Because as soon as i replicate my own functions and make them Server Authoriative the delay is the problem. A concrete example is this :

#

This is with a Custom CMC i built with Boilerplate Code, the sprint itself is not the problem, but the functions i call before and after the Sprint Function. They always lead to insane Delay when i simulate Lag.

hollow eagle
#

Sounds like you aren't doing something predictively.

#

And what do you mean "functions i call before and after"

sour dragon
#

Here, is a example that is hard to explain

hollow eagle
#

this has nothing to do with CMC

#

and everything to do with you only performing actions on the server rather than predictively

#

Will GMC be easier? I have no idea, I've never used it. I've heard good things. But trying to build predictive movement without understanding how to do so is going to result in frustration one way or the other.

sour dragon
#

How does one perform actions predictively? Thats the problem i struggle with, because my code runs fine UNTIL i introduce lag

hollow eagle
#

Clients need to perform the same action immediately without waiting for the server.

#

The ideal is to predict as little as possible - the bare minimum necessary for the game to feel responsive. Basic movement falls under the "needs to be predicted" category.

sour dragon
hollow eagle
#

Your sprint ability is clearly not being predicted.

sour dragon
hollow eagle
#

But sprint is movement

#

A client - if it wants to sprint - needs to start doing so immediately and tell the server that it wants to do so.

sour dragon
hollow eagle
#

It clearly isn't though.

#

In your second video you don't start moving faster until you've received a server correction.

sour dragon
hollow eagle
#

Sure but what does that actually do, you haven't posted it.

sour dragon
#

One sec

hollow eagle
#

I'm aware of what network emulation is. And for what it's worth, packet loss will result in corrections some of the time, there is no way around that with server-authoritative movement. 5% packet loss is bad.

#

You test with those settings to make sure the entire game doesn't break down under packet loss, not because the game should necessarily still feel good in all circumstances.

sour dragon
#

Actually im going to use milder settings for my example now that you say.

#

So Wants to Sprint on Pressed True and Wants to Sprint Bool False on, no code behind it

hollow eagle
#

...so what is actually changing the movement speed

#

setting a boolean does not make your client start sprinting

sour dragon
hollow eagle
#

and what is calling that

#

Before you continue posting more blueprint graphs, the point I'm making is that you haven't shown how the client is setting its movement speed.

#

Furthermore in your latest video I'm not sure I see anything wrong.

sour dragon
hollow eagle
#

So... still not how the client is setting its movement speed when sprinting.

sour dragon
#

Like i said, those are exposed C++ classes its all done in C++ thus not visible, i only can show the exposed BP nodes

hollow eagle
#

Then no one can help you.

#

If you can't show what the code is doing no one can tell you what's wrong with it.

sour dragon
#

Thats the problem with Boilerplating hehe...

hollow eagle
#

And again, I'm not sure I see anything wrong with the video you posted. Though I also can't see when you're pressing your sprint key.

#

The movement correction from the previous video could easily have been attributed to packet loss. Not something you're going to fix, you can't beat packets that simply don't want to go anywhere.

sour dragon
#

The last video i posted works fine because its with the bp exposed C++ CMC class which was modified. It has compensation and client prediction, and i can access what runs after and before that. If run exclusively without any code in front or behind it its fine, but if i add something else that is just serversided it looks like in the examples high above.

hollow eagle
#

So once again, what is "any code in front or behind"

sour dragon
#

So i guess my own code is the problem, if i would keep it at just a replicated sprinting mechanic i could do it in BP as you can see above in the video. It will run fine, but if i want to modify the mechanic itself it breaks apart. I mean what i basically tried to do was just add a AutoWalk and Autosprint mechanic to the sprint mechanic

hollow eagle
#

Some form of auto walk/sprint is really just going to be setting your "wants to sprint" option (which I assume is being replicated somehow).

#

But yes, the problem would be with your own code. Not CMC.

sour dragon
sour dragon
#

I just cant do it client only because if a client finds a way to hook into autorun it means he also accesses the usually protected sprint function

#

So im serversiding whats happening before the sprint function triggers

hollow eagle
#

I'm lumping this apparently custom CMC into "your code". I have no idea what it's doing either.
It might be wrong, your blueprint code might be wrong, I don't know. There's not nearly enough detail here to help.

But it makes no sense for this to be server-only. The client only says that they want to run, if they're not allowed to then the server should simply not allow them to.

sour dragon
#

Yes they won't be allowed to sprint, but they can hook into the function and always trigger it resulting in instant autorun and autosprint functionality

hollow eagle
#

My point is that the client still needs to predict this.

#

It cannot run only on the server.

#

Someone can very easily modify their game to set their movement speed to literally anything they want. The reason that doesn't work is because the server simply rejects their movement updates for not being within a reasonable range.

#

Being able to say "I want to run" longer than they should be able is not an exploit

#

it is at worst a misprediction on the client which should be corrected by the server.

sour dragon
#

Honestly im just burnt out at this point ... tried to do too many things at once and now i dont even can't thing right. You got a point

#

think* ... completely forgot to client side it besides serversiding no wonder ...

final tartan
#

Hey.. I am trying to test replicationgraph with the Lyra project since that seems to have the most up to date example of it.. (I know Iris is suppose to be replacing it however there is next to 0 information about it). I just want to enable it and do some testing of some logic i want to add for my project BUT when I try to enable it in the project settings and add ReplicationDriverClassName="/Script/LyraStarterGame.LyraReplicationGraph" in the IpNetDriver section when starting the server I still receive this error:
[2024.04.22-01.46.21:953][123]LogLyraRepGraph: Display: Replication graph is disabled via LyraReplicationGraphSettings

#

anyone know how to enable it or have done recent testing of it?

#

I also got an error [2024.04.22-01.13.18:151][ 0]LogUObjectGlobals: Warning: Failed to find object 'Class /Script/LyraStarterGame.LyraReplicationGraph' which I cant figure out why it cant find it or if this is even necessary looking at the code in LyraReplicationGraph

sour dragon
#

One thing i want to ask before i go to bed. Is there any solution in BP for Vehicle Client prediction? I mean GMC etc. are not intended for this right? I heard SmoothSync can help if i take the cheating out of equation

nova wasp
#

the built in chaos vehicle plugin?

sour dragon
#

Has no Client Prediction according to forum posts, its unfinished for multiplayer

final tartan
cursive steeple
final tartan
nova wasp
#

lyra gets updated on ue5 main in case it is doing something different

gray blade
#

anyone got any advice on on to replicate camera pitch on client side when using controller rotation?

#

there are like no tutorials online for this that work

soft copper
quiet pulsar
#

Greetings everyone!

is there anyway that i can make clients cant see other clients
like when a client enters an area, that client is not visible for other clients until the client leave that area

soft copper
#

looks correct to me. maybe log on the client what the look rotation is, confirm at least that all clients are receiving data

soft copper
#

use print string to see if both clients are receiving the data

nova wasp
#

APawn::GetBaseAimRotation should use remove pitch already

#

so I would suggest trying calling that to see where the sim proxy is aiming

gray blade
thin stratus
#

That might be related to the Mesh Component UpdateBonesAndTickPose behavior

soft copper
#

I'm having trouble with replicated subobjects for an inventory system, and these results are very concerning. Hopefully someone can shed some light here:

  • Two actors (A and B) with "ItemContainer" actor components
  • ItemContainers are just replicated TArray of pointers to replicated UObjects.
  • Adding / removing items to these arrays renames (to change the outer) and appropriately assigns subobject list replication.
  • Renames are also sent to the client (to change the outer on the client)
  • Moving an item from A -> B works fine, the subobject is networked.
  • After some delay I destroy actor A.
  • Checking slightly later in B, the array still contains a pointer to the object, but the pointer to the subobject is now invalid. It becomes invalid instantly after A was destroyed by the server.

So I guess that means only the original networked pointer is meaningful on the client? Am I doing something wrong here? This seems to make working with replicated subobjects completely useless if we're expecting them to act independently of their original replicating owner. Seems like a pretty obvious way to implement an inventory system would be to use subobject replication in this way.

gray blade
nova wasp
#

in the skeletal mesh for the character/pawn

thin stratus
#

Skeletal Mesh Component*

gray blade
#

is this a c++ thing?

oak prawn
#

"server travel" works smoothly in the game engine, but when rendered, it does not work on real computers, the client returns to the lobby again.

#

how can i solve it

dark parcel
kindred widget
#

I'm a bit confused on UActorChannels. I have an actor that I've replicated. Replication is perfectly fine. But of course it's not owned. As it's not owned I can't get it's UNetConnection via AActor::GetNetConnection even on the server. How are you supposed to find an actor's channel if it has no owner? O.o

lusty sky
kindred widget
#

The issue is the actor channels. Rename doesn't remove the object from the CreateSubObjects array. So when the actor is destroyed, it destroys the object too.

soft copper
# lusty sky - Rename does not replicate by default, you will need duplicate the uobject with...

I've just made a significant breakthrough with this!

  • Renames were sent to the client manually via RPC (or set on the client locally via tick)
  • The key to all of this was a note in RemoveReplicatedSubObject(), suggesting that the 'original pointer on the authority' is somehow special in terms of GC. Anytime I called RemoveReplicatedSubObject the object in question would be marked invalid on the client -- regardless of other system that might hold a valid networked pointer to it.
  • The solution appears to be to use TearOffReplicatedSubObjectOnRemotePeers instead of RemoveReplicatedSubObject, however I've only just found this so I'm not sure what other issues may crop up with its use. It has however passed all of my tests and resolved the immediate issue!
lusty sky
kindred widget
kindred widget
soft copper
kindred widget
#

It's more the instance of it. Put a break in uhh..

#

In the item itself. Override PreDestroyFromReplication. And break there. You'll see the issue pretty quickly.

#

UActorChannel::DestroyActorAndComponents() gets called when the actor is destroyed on the client. The object is still in the channel's CreateSubObjects array and so it's destroyed too.

twin pendant
topaz storm
#

just getting back - thanks again for your help! Turned out I was just stupid after checking your examples in detail. I also wired certain functions the wrong way after the input context mapping + had switch has authority somewhere where it didn't belong . 🙂

nocturne iron
#

I am facing a problem where world partition does not load on clients, does anyone have experience with this?

#

This only happens out of editor.

modest crater
#

Question for the networking guru’s.

How would you handle firing an automatic weapon?

Single fire is simple, it’s just one off RPCs (could do OnRep but for shooting id rather it be more responsive).

Automatic is where I struggle to figure out the approach. You have enter and exit states for the loops but how about bullets in between? Lets say client A held down the trigger and shot for like 2 seconds straight and the fire rate was .17 so he would have shot ~12 times in that two seconds, how would I handle clients accurately getting that and playing the VFX and bullet impacts correctly? I could have the client logic for the loop just play the sound and animation for the loop and wait for server RPCs to play the VFX and damage but if I had a faster weapon or slower connection that would result in bullets sounding like they’re speeding up and slowing down..

I really appreciate some ideas and any advice

woven basin
#

just replicate 'gun firing' and 'gun stopped' and let the clients visually simulate the guns firing 'constantly' (with the sound effect etc). Meanwhile the servers spawn each bullet and sends that to the clients for the actual projectiles

queen escarp
#

hey im trying to pass on sound from the "server"(npc in world) to player character

#

but its null

#

nevermind

#

solvedf it

upbeat basin
#

Is it logical to pass the server start time with a multicast RPC to play montage on all clients, so that animation can adjust the start position on each client according to server time in case of some noticable latency?

modest crater
# woven basin just replicate 'gun firing' and 'gun stopped' and let the clients visually simul...

I’m doing hitscan anyway so any bullets are purely considered VFX. The client assumption way sounds the most appropriate but the cost of that assumption being wrong is big, i heard you shot again or I swear you shot him when really the RPC just hadn’t arrived, the other problem with assumption based is the view direction and accuracy I can represent, it’s just a replication packed thing already done by the pawn so that also will be delayed for updates and not accurately represent where I am shooting

woven basin
#

If you want to avoid guns differing due to lag, you need start/stop. If you garunteed accuracy and no prediction, then individual.

modest crater
modest crater
cursive steeple
# upbeat basin Is it logical to pass the server start time with a multicast RPC to play montage...

If your gameplay (and animations) allow for the cutoff at the start, then it could be a good solution. You can setup a threshold if you want over which you'd do the cut, so with low enough latency, you'd play the montage normally. All depends on the game you're making and how important timing is.

Just make sure to accurately sync a network time between server/clients, as unreal's built in version tends to be rather inaccurate.

upbeat basin
#

The thing an my second question if it's stupid is, I'm sending the montages as soft object pointers. So on top of network latency, client's PC performance can also effect the start time of the animation. That's why I wanted to add start time, so if there is any delay, other players won't be walking while doing other actions

mental star
#

So, with ball physics in a multiplayer scenario. I probably want to interpolate its position if I'm doing an online multiplayer tennis game, no?

#

Is there a good set of equations I can use for that?

lusty kelp
#

any advice on why none of my testers can join aka join button?

#

i can via my own laptop but only (I) have the ablity to make the server pop for the other via refresh button

#

Help will surely be greatful.

#

as you can see it working on the editor > vice versa on my laptop

#

Any advice?

upbeat basin
#

Are you using null subsystem?

lusty kelp
#

No normal

#

blueprints

#

just an startup for example

#

nothing at all

#

@upbeat basin u mean the defualtService NULL?

upbeat basin
#

DefaultPlatformService, yes

#

If you haven't set anything it still should be considered as null

#

Which would only allow player on the same network with you to find your session

#

Are they trying to connect you over internet?

lusty kelp
#

i am the only allow person to make the other via refresh button to shown

#

make the server pop on their end

#

Yes

#

and i can show u logs of my config?

#

because i am using other setting as well

upbeat basin
# lusty kelp Yes

If this is to them trying to connect you over internet, rather than being on the same network with you, then that's the limitation of null subsystem. You might need to try another subsystem

lusty kelp
#

@upbeat basin Ah okay

#

ty (:

#

but its me rather setting them up to connect on my ip ?

#

@upbeat basin

#

I need to start the switch up

#

per say

heady pewter
#

question on starting multiplayer in bp, do i start with trying to spawn in the correct amount of characters and then designating them to contollers or aicontrollers?

sinful tree
heady pewter
#

ok

#

First attempt on anything multi so im a bit lost

#

the plan is to have an 8 player smash style brawler

lusty kelp
#

just to clarify again; this will work regardless of weather let say france and me in the usa? @upbeat basin

twin juniper
#

(but with 200 pings)

lusty kelp
#

@twin juniper what u mean 200 pings?

#

are u answering mine or his?

twin juniper
lusty kelp
#

oh i see

#

200 ping will do it for an succesful connection?

twin juniper
#

ex:
I could join rn a server in fortnite in France but I'd lag a LOT (I'm in America...)

lusty kelp
#

but that fortnite not ue4

twin juniper
#

fortnite is made in ue

#

so it's the same

lusty kelp
#

lol ok my bad

#

where u hook the ping up?

#

like for example find session node?

#

because i am having problem if the ping need to be set 200 to be able to work @twin juniper

twin juniper
#

you can't set your ping

lusty kelp
#

with the ping in ms function u can right?

#

sorry if to confused you but i am talking about online functionality for my game

#

@twin juniper

twin juniper
lusty kelp
#

so u think hooking ping ms function to max result will work?

twin juniper
#

I have no idea what max result you are talking about, but print it if you wanna know

lusty kelp
#

oh okay

#

will do ty for the idea

#

so i have my join as a custom node but not replicated so ive set to muticast thinking it'll allow users to join

surreal plaza
#

I am running into the issue of running Sandboxie not being able to run my shipping build (and a separate Steam account) without a 'fatal error' popping up. It will run without steam started on the sandbox, but with steam running first I get this error. Steam is properly loaded in the sandbox, so I can't see any other error. And when I run that account on a separate laptop it works. I know it is a shot in the dark, but if anyone has any ideas or another place to ask I would appreciate it.

devout sonnet
#

damn why am i struggling so hard with understanding multiplayer shit

sinful tree
#

Because it's hard to wrap your head around something existing in two (or more!) places at once that can have the same value or different values depending on who is changing the value.

devout sonnet
#

This has been really bugging me. why doesn't the Clint get the third person controller in the second situation but not in the first.

sinful tree
devout sonnet
#

that's all i have in my gamemode

sinful tree
#

So no overriden functions in the game mode event graph?

#

Just the adjustments to the classes?

devout sonnet
#

correct

sinful tree
#

What happens if you move the first player out of the way first before having the second player join?

devout sonnet
#

same thing

eternal dune
#

I have an issue I don't understand. On my player Actor BP I have in the event graph an input handler that displays the player inventory. it works fine both on a listen server and for player in a remote client. It is the first image below.

The second image is a function on the same Actor BP. It gets called when I activate a container to access it's inventory. If I use a remote client player, at that point I get an error saying the player controller is not a local player controller, even though I am getting the player controller in the exact same way as the regular inventory display.

What is the difference here? How do I get the local player controller?

devout sonnet
#

I have my net mode set to Listen Server. idk if that matters here or not.

sinful tree
sinful tree
eternal dune
#

I know. But I don't know how to ensure that the input is handled locally. What I suspect is that the first input handler, being tied directly to an input event, is automatically running locally, but the second one, being called from another actor, is not

#

This is how it is being called. This is on the container BP

#

So it's getting the instigating pawn from the interact event

#

Which, as I now remember, only runs on the server. Ooof

#

So I am, in fact, calling this on the wrong object.

#

I guess I need to turn my function into a client RPC

#

Does that sound right?

sinful tree
#

Nope.

#

You probably want a replicated property (rep with notify!) to the container you're wanting to interact with in the player that is interacting with it.
The OnRep can check if the value is valid and that you're running on the owning client, and if so, display the widget. If it's not valid, then attempt to remove the widget.

#

Basically the property then becomes a toggle switch if its valid, show the inventory, if it's not, collapse it/remove it/whatever you wanna do with the widget.

eternal dune
#

I'm not quite following you. The inventory is already replicated

sinful tree
#

You want a property in the player inventory component that will contain a reference to the "Container Inventory"

eternal dune
#

That doesn't really make sense to me. Why would an inventory component need a property to point to another inventory?

devout sonnet
sinful tree
#

If it's null: No show / hide container inventory widget.
If it has a value: Show the container inventory widget, and you'll have a reference to the container.

#

This then also allows your server to control it easier too - when say, they walk away from the inventory, the server can know this and then remove that reference.
Also acts as an anti-cheat method - unless your player inventory has a reference to a specific container set there, they can't just move anything from any inventory into theirs unless the server is aware of the container they are currently interacting with.

devout sonnet
sinful tree
hollow eagle
# sinful tree This then also allows your server to control it easier too - when say, they walk...

Honestly this is a weird setup. This would mean only one person could look in an inventory at a time (which might be something a game wants, but it's weird to encode that limitation as a hard restriction via property like this).
A client managing itself would be more standard practice - the server shouldn't know nor care when the client closes the inventory unless it needs to fire off events as a result of it (which it might, but that often requires state on the player themselves rather than the container).
It's not really that useful as an anti-cheat unless you specifically need to avoid players being able to see into chests they're already nearby and already meet the criteria for interaction with. Unless there are super specific circumstances that require you can only ever see into this one specific chest it's an odd design.

gray blade
#

Does anyone have any insight to why my aim offset does not update on the client until they move?

hollow eagle
#

Closing the inventory when the client gets too far away doesn't need to be checked by the server either - it's a waste of an RPC or replication. If the client already has the data of what's in the inventory then there's no anti-cheat benefit to forcing the inventory closed from the server.

#

So unless you need the super specific requirement of being able to only see into very specific chests at any time, the server shouldn't really care about which chest a client is looking at. Once a client needs to actually interact with something inside the chest, sure, but simply reading inventory is safe for most and can be entirely client-driven once the client knows they want to look at the thing.

#

Basically: If the data already exists on the client for what's in the chest, there's no benefit to the action of looking at the chest being server-driven. There's no potential for anti-cheat to do anything unless further authoritative events need to be fired off from the simple act of opening it.

#

You probably need to tell the server "I want to look at this" for cosmetic reasons (animations for other players and all that), but if the client already has all the data it needs to look at the chest it's a bit weird to wait on a round-trip to find out.

eternal dune
hollow eagle
#

It depends on what the interaction is.

eternal dune
#

Well initially it's just showing the contents of the container

hollow eagle
#

Often the generic idea of an "interaction" has both a client and server component, or starts out as client-only but requires something on the server later.

#

Right. If you already know what the contents of the container are on the client and don't need to trigger further authoritative events (aside from purely cosmetic stuff) there's little reason to wait on the server.

eternal dune
#

OK. That makes sense. Should be a quick fix, too

eternal dune
#

Huh. Datura wrote a book, but didn't publish it. 😄

gray blade
#

this is with camera using control rotation btw

#

General question here to. Is it unreasonable that Your game preform good at 100+ ping and 5% pkt loss?

#

like at that point visible lag and desynch is unavoible, the goal should be just not having the game break?

sinful tree
#

100 ping is fine, but I'd think 5% continual packet loss is horrible.

fossil spoke
#

5% packet loss would be unplayable

sinful tree
#

For a while I was suffering with a fairly continual 4% packet loss on cable highspeed and some games would just straight up boot me out. (They couldn't figure out the problem so I had to switch to a different provider).

fossil spoke
#

You should test your systems/mechanics against a small amount of packet loss to ensure they can recover to an acceptable state after regaining a good connection.

#

But beyond that, if the Client has continual packet loss, its not really going to be your problem.

#

Ping is another one of those things that depends on the type of game to some degree as well

#

If you are creating a Coop PVE experience for example, its less of a concern with higher numbers than it would be if you were doing a PVP Arena Shooter.

gray blade
fossil spoke
#

Whatever you can manage without it degrading the experience to the point where a reasonable person would start to negatively feel those effects.

#

Thats not really a question anyone can definitively answer for you.

#

It depends on your game, your expertise, how well you can optimize and account for latency in your implementations...

#

Etc etc

gray blade
hollow eagle
#

5% packet loss is a great value to make sure the game doesn't break down entirely, but it's a bad value to expect a good experience from.
Large amounts of packet loss can be useful to use as a way to reveal unforseen problems with systems you've built. Not so much for making sure the game is fun.

fossil spoke
#

Defaulting to a reasonable value.

#

But also allowing for open ended searches.

#

Someone in your game might be ok with 300 ping if they get to play their favorite mode that no one in their region is playing, but others are.

fossil spoke
#

Someone in your game might only be playing at times where they are at the peak of traffic in a different region and not their own (night shift workers?) and so cant find matches in their own region.

#

There is always some factor to consider when taking away choice from the Player.

kindred widget
# hollow eagle 5% packet loss is a great value to make sure the game doesn't break down entirel...

Sorry to bug, but on a curious note about this. Is there anything else you can really do to help with this? EG we have a case where I'm pretty sure there's a problem with a specific actor sometimes not replicating due to connection issues and I can't repro it personally without using the editor and like 50% packet loss while spamming PIE over and over until it happens in a 1/30 chance. But there are some players that seem to end up in this state consistently. So I'm curious if there are any persistence settings to actor replication or anything that might help with this.

hollow eagle
#

I can't think of anything off the top of my head, no

#

a lot is just trial and error unfortunately

#

especially with packet loss, you don't know exactly what is getting dropped (since it's random) to trigger issues, you can only hope it's easy enough to repro :/

#

an actor outright not replicating sounds like something very wrong though - you shouldn't be able to drop packets to prevent that without disconnecting entirely.

#

like, you'd have to consistently drop the packets required for that actor's creation every time they get sent to you (which is going to be constant as long as you're connected, it is relevant, and you haven't ack'd it). Doing that is near impossible unless you've outright disconnected.

#

only way I can think of that happening is if somehow the initial bunch is just massive

kindred widget
#

Odd. Cause I can semi consistently repro it with enough persistence. :/ Like I said though it takes some insaaaaanely bad settings. Client just hangs there with the actor missing. I thought it was a debugging issue at first but even a constant print of the count of them in the world never shows more than zero. There's only one of them at a time normally in this case.

#

Initial bunch could maybe be the case. It is a data actor. Houses a bunch of stuff for level generation.

hollow eagle
#

I mean as you yourself said you need some insane packet loss - to the point that the game should pretty much just disconnect.

#

The only way something should be that consistent is if there's some reason that actor specifically keeps getting dropped. The only thing that'd make me think that is the initial bunch is so big that every send seems to drop something.

kindred widget
#

Oof. Why would that differ though? Shouldn't that be more consistent even on a good connection? Isn't that the same as the RPC limit kind of thing?

hollow eagle
#

even then, without some crazy packet loss that seems unlikely - you should eventually get whichever packets were dropped even if it takes a bit

#

I mean it could be a low level networking issue - you're sending packets that are too large and some connections are tending to drop those larger packets. I wouldn't expect that unless you've messed with relevant network settings in the engine though.
It'd explain why it affects specific people consistently even if they have a good connection.

#

Or it could be something higher level - incorrect relevancy settings, for example.

#

Can you prove that the actor is even trying to replicate to those people? Can you prove that nothing is being received by them?

kindred widget
#

Unfortunately this isn't my implementation so I'm not 100% on the specifics of what's been done to it. But it breaks UI, so garbageman UI programmer gets to fix the networking code. 🙂

hollow eagle
#

yeah can't help much there, then :/

kindred widget
#

Where can I check if it's even trying to replicate? Not aware of much other than it spawning.

fathom aspen
#

Out of curiosity, is it a net startup actor? i.e. is it netloadonclient=true ?

eternal dune
#

OK! My inventory transfer is now working properly with just one minor glitch: When I transfer an object from a remote player to a contain, or vice versa, the inventory replication is happening after I update the screen by redrawing the inventory contents. I think I can solve that by having the UI widget subscribe to the inventory to get update notifications so that's my next thing to do

kindred widget
#

I want to say no. But let me double check. Need to open the project. 😄

fathom aspen
#

If it is, then that would explain something

kindred widget
#

These are the only thing in C++. Waiting on editor to double check the BP class

bAlwaysRelevant = true;```
#

Huh. It is. I wonder why. 🤔

#

Fuck me, now I have to go double check instantiation code. But I'm 99% sure that's unncessary.

eternal dune
fathom aspen
# kindred widget Huh. It is. I wonder why. 🤔

I can tell you what happens generally with them. In situations where network conditions are bad, the level the said actor is associated with can sometimes normally gets unloaded on the server but takes time to unload on client, meanwhile a destruction packet gets sent to the client telling them this actor was destroyed instead of just removed from world (since the level is still visible on client)

#

If you want to double check if this is the issue watch a certain property in the engine called
DestroyedNetStartupActors

#

Or something similar, maybe it's in World or some other place. If your actor exists there then it's it

#

The easy fix is to make it netloadonclient = false
The hardcore fix is to ensure client doesn't destroy the actorchannel in such situations
The better fix is to use Iris if you can since they fixed it there

kindred widget
#

I'll probably see if I can make it not a netload on client. I don't think there's a reason for it. But I have a ton of code to double check on that.

deft spire
#

Hey, I need some help.
I'm planning to make a game where players have completely different roles, for example one player playing in an RTS style while the other one is playing in an FPS style.

I want to give the players different controllers based on the role they selected on the lobby screen but I can't find any tutorials on it, all I can find is people saying that I ought to use 1 controller for all but that seems really dirty in this case because the controllers would contain actions that have nothing to do with their selected role

nova wasp
#

the unrealy thing would be to have the differences expressed in components added after the fact to the controller

#

or the pawn I suppose

crude marlin
#

Hey, when the host leaves a session, what's the proper way to destroy the session on the clients as well?

I read that most people just call DestroySession in the BeginPlay of their default map,
but I was just wondering if there's a better/proper way to do this, like overriding a function somewhere that notifies clients that we got disconnected and travelling back to the default map.

tardy fossil
#

GEngine->OnNetworkFailure().AddUObject

queen escarp
#

hey i have a question

#

if i joina a game and send infromation to the server from the client

#

and another player joins the server

#

can he get my name from the server (is it stored for him aswell even tho he wasent there when i sent the info to the server ) ?

#

or will it need to be updated each time someone joins ?

tardy fossil
#

you would use the PlayerState class for that since they are replicated to all clients (thats also where replicated player names are handled)

faint moat
#

Hello there,

how could I manage this?:

  • have an PawnAiController on the client
  • replicate client movement to the server

I need this setup because I want to use predicted GAS abilities in my rts

queen escarp
#

@tardy fossil yeah thats what im doing but im only getting my local name

#

so in the player state at start

#

im setting the name and transfering to server

#

then when im killing something (this is for announcer)

#

im getting that name from the player state

#

hmmm

#

get player controller 0 !

#

😮

#

ok it could have been that

shadow hatch
#

can I spawn a level instance exclusively for the client only

hoary spear
#

Isnt that just spawning it as a client ?

shadow hatch
#

id guess so but for some reason im having trouble with it lol

shadow hatch
#

think i got it, probably had to do with the overall structure of my code being convoluted in regards to player controllers and pawns

mental star
#

So, I'm a bit new to making online multiplayer games. What's the benefit of using interpolation in physics when dealing with online two player games?

#

Assuming I have a physics object like a tennis ball bouncing back and forth

kindred widget
#

If you're connected at a common 30-40 ms to a decent server, that's an FPS of about 25-33. This is assuming that this object gets replicated every single frame without fails and that the server stays in perfect sync and stuff goes perfectly. Which we all know doesn't happen. Realistically you end up with a jittery object.

That said interpolation isn't quite as good as local simulation between updates. Interpolation means it's always behind. Local sim means it might be relatively close to real, if you can keep it's velocities, location and rotation somewhat in sync.

#

And even then. It's networking physics. It's gonna have issues.

maiden flame
#

@mental star

Authaer has a good point. Constantly interpolating the server position will jitter with packet loss. Showing the ball travelling locally is more stable visually.

It's a complex topic, and there's probably a few valid solutions.
Physics and cheating/security aside, I thought about something like showing the ball's position locally, allowing the player to react naturally when receiving the ball and timing their swing.
The server would also have a version of the real state of the game, and even if the ball arrived at a time of the swing that's visually invalid, the server would receive the position+time of the swing and position+time of the ball of the client and test it against its own simulation.
Since this might take some time, you don't have to send the ball back immediately. You could slow down the hit impact allowing the ball to be "absorbed" for a moment, and send the ball back at a consistent delay depending on the player's latencies. Validating the state of the ball at the "end points".
Instead of using physics you could use the particle movement component, which I believe is more deterministic, calculating angles and velocity manually.
As for security, there's a lot to address, but you can verify the client's positions+times against the server with an error margin, and verify each client-predicted swing.

mental star
#

So, the complicated thing about this is, its a tennis game; Meaning there's going to be some potential semblance of hardcoded gravity / a ball bounce factor.
As well as potentially some projectile motion stuff acting on the ball with forces being applied via the impact on the racket etc.
That said. I don't want this to become Too complicated since I know online multiplayer physics be hard AF

kindred widget
#

IMO I'm seriously inclined to tell you to just use the projectile movement component. Physics isn't good for this kind of thing. You need some certainty and the PMC will provide a lot more for you than messing with physics.

maiden flame
#

Agreed. And most of the stuff you mentioned is already in the projectile movement component.

mental star
#

Right on

thin stratus
#

Just so you have more people telling you this: DON'T use actual Physics, fake it with VectorMath in your own MovementComp or use ProjectMoveComp for example. That is already enough work and you at least have more control over everything.

glass plank
#

I have a marketplace asset which generates a maze using rand numbers w/o a seed function. It works by being placed in a level which it constructs a unique maze based on the parameters given in the BP. It wasn't written with multiplayer in mind, but my goal is it use it in an arcade style game with 2-8ish players. I have set the BP Replication options as: Always Relevant: On, Replicates: On. The rest are off. When I try to play this level directly in PIE as a listen server it works as intended. Two characters see the same maze and can run it just fine. But the problem is when I play it via another Menu asset (also in PIE) it behaves as if each Player is seeing their own instance of the maze, yet the 2nd player can run thru the 1st player's maze so I know it is aware of it, but it only sees the maze instance generated for itself. So I believe there is one true maze in the level. The Menu asset is doing GetOwningPlayer->Join Session so nothing very special, I think. Can anyone point me in the direction to keep looking?

dark edge
#

RTS guy has YourController and possesses RTS Pawn

#

FPS guys have YourController and possess FPS Pawn

mild urchin
quasi tide
hollow eagle
#

Iris is reasonably stable on 5.3 if you are willing to backport a few (safely mergeable) changes.

#

It's absolutely shit to debug if anything goes wrong though.

#

Wondering how that's been improved in 5.4

quasi tide
#

Notes say that iris did get debugging improvements

hollow eagle
#

but not what exactly, so changelist diving it is...

limber gyro
#

you are probably gonna need those maze random numbers to always be in sync if you want all the players to see the same thing

#

if its a plugin in which you dont have control you might just be out of luck, multiplayer is a complex beast and its gonna be hard for any 1 to have a proper game with just bought assets, at least from the code perspective

glass plank
#

What's undesired is that it appears to run uniquely for each player.

limber gyro
#

heres what i would do, i would generate whatever needs to be generated in the game mode class and then pass that on to that BP

#

u just need to make sure the random generated numbers are the same everywhere

glass plank
#

I could move the logic into the gamemode? or perhaps... its creating this asset in 3-4 phases. Perhaps I could split out the one(s) where it needs to generate the rand #s into the gamemode, as you say, and then point it to the original blueprint i nthe level to construct it?

limber gyro
#

game mode only exists in the server, so if u move things there, your clients probably wont see the map

#

generate the numbers in the game mode and then send those values with an RPC to your clients

glass plank
#

Gamestate? Or Session something?

limber gyro
glass plank
#

I'm wondering if there's an easier way still is all

limber gyro
#

i wouldnt know, i would have to take a look at your project

#

just mess a bit with it, its probably not that hard

#

generating a number and sending it through an RPC is hardly a dificult task

glass plank
#

well I was able to get them to line up 100% only when I opened the level directly.

#

So I believe I did something correctly in tweaking the blueprint there, but why that change isn't working for my menu system idk

limber gyro
#

i would guess that if u open 2 clients at the same time in the map, then the number generator is just gonna generate the same number on both instances because its based on time

#

so if u open through a menu, some time would have passed and the number generated wont be the same, but thats just a wild guess

glass plank
#

hmm, thats a pretty good guess though

#

we're taking a difference of seconds while I'm in PIE, but the rand is coming from somewhere

shadow hatch
#

how do i make sure i load a sublevel for the relevant player only as well as the server? if i load it on the server the sublevel seems to get loaded for all clients

#

welp google told me its default behavior to replicate loaded sublevels

quasi tide
karmic panther
#

Quick question, I have this lobby system where players are set up on a platform.

But after Open Level node, the set actors disappears, how would I resetup the platform?

( the joining session does work )

lost inlet
quasi tide
lost inlet
#

though I wonder if this could've been implemented as something like UFUNCTION(NetMulticast, SkipAutonomous) or something

#

lol Salesforce is the worst goddamn platform. I logged into my work Epic account and it's just constantly redirecting me

summer tide
#

Is there AdvancedSession plugin available for UE5.4 yet?

surreal arrow
#

I am about to start production on a 4 tablet local wifi game for work. I am unsure if I need a Host tablet or not. Main reason I blieve I need it is to handle disconnect/reconnection ie resuming where a player may have accidently crashed at, so they can rejoin the game from where they left off. Is there an alternative approach that would make sense?

sinful tree
surreal arrow
#

eh I guess if I rely on a players tablet and they crash thatll be it

#

Thanks. I was trying to abandon the additional tablet/host but I think ill stick with it for reliability

sinful tree
#

Your alternative would be to not use Unreal's networking system and develop your own P2P network communication system, or utilize some cloud BaaS system that can keep state for you.

surreal arrow
#

interesting idea. We are on a budget though so i'm not sure how thatd fly. We can justify the 50+ tablets but the server hosting might be hard to convince management

#

i will look into this though. Probably isnt too much for a basic cloud service

#

TY

#

While I have you here. If you're still around

#

Our original idea was to have the 4 players take simultanous turns (2 minute intervals) that would then sync with the server and push out the updates to all the other tablets.
Or have the gameplay real-time to avoid all of those placeholders and updating every 2 mins

Seems like the original idea my team has would be more work than the real-time alternative

soft cape
#

Adding in a respawn system into a multiplayer game that requires client-server replication. In the code for adding players back into the game, I opted on using SetViewTargetBlend on a temp actor as a basic animation for players spawning in. The blend works fine on server, but the client doesn't see it. I assume that my replication logic is wrong somewhere, but nothing sticks out to me.

In my player controller (Server-side)

void AMyPlayerController::ServerInitiateSpawningSequence_Implementation()
{
    // Check if we have a valid game mode and world
    AGameModeBase* GameMode = UGameplayStatics::GetGameMode(GetWorld());
    if (auto* MyGameMode = Cast<AMyGameModeBase>(GameMode))
    {
        MyGameMode->SpawnPlayerAtTransform(this, SpawnTransform);
    }
}

In my game mode (Server-side)

void AMyGameModeBase::SpawnPlayerAtTransform(AMyPlayerController* PlayerController, FTransform SpawnTransform)
{
    FActorSpawnParameters SpawnParams;
    SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
    SpawnParams.ObjectFlags |= RF_Transient;

    FTimerHandle SpawnPlayerTimerHandle;
    // Spawn a temp actor to take place until player is ready to fully spawn
    AActor* TempActor = GetWorld()->SpawnActor(PlayerController->SpawnActorClass, &SpawnTransform, SpawnParams);
    if (TempActor)
    {
        // Remove Spectator UI from player
        PlayerController->ClearClientWidgets();

        // Set view blend for spawning actor, attempting to call on client, but client doesn't see the blend.
        // Server is fine here
        PlayerController->SetViewTargetWithBlend(TempActor, GetPlayerRespawnDuration());
    }
}
fossil spoke
#

It should be Replicated.

#

Then on BeginPlay that Actor would manage the view transition on the Client, instead of the GameMode.

#

The Server shouldnt be handling cosmetic stuff like this for Clients.

soft cape
#

Yeah that might work better than what I am doing here

#

The tempactor will probably have more cosmetic changes later on, so better to put that logic elsewhere. Thanks!

gray blade
#

anyone got a good tutorial or advice on how to create projectiles in multiplayer with backwards tracing

fossil spoke
gray blade
fossil spoke
#

When asking for help. Its ideal to outline your problem in detail, so people who want to help have as much information as possible to understand what type of a solution you are looking to achieve.

#

"Tracing the hitscan backwards" is not much to go on.

#

There are plenty of resources on how to orient Vectors to achieve a particular direction of a line trace.

#

Try elaborating specifically on what you want to achieve.

#

As that question stands, there isnt much to go on.

gray blade
#

Im aware it may be best to abandon the idea of spawn a projectile altogether for a hitscan

fossil spoke
#

You cant avoid latency, the best you can do is mask it with Client side Prediction and Rollback.

#

Projectiles and Hitscans are entirely different things

fossil spoke
#

Typically there will be an "Acceptance Radius"

#

Which is a predefined distance where the AI would be "close enough" to consider it to have reached its MoveTo goal.

#

This is so that it can avoid instances where it can never fully reach the exact position the goal is located at.

#

That causes basically a buffer zone around the goal, where if the goal moves within that buffer zone, the AI would not consider it to have moved at all.

#

Then its highly likely that its contributing to the results you are seeing.

#

Continuous Goal Tracking just means that when the goal location is updated, the MoveTo will update, assuming its moved more than the Acceptance Radius away.

#

No, I just outlined what the problem is above.

#

Lower the Acceptance Radius.

#

If its to high, it will think its already reached its goal, when it probably hasnt in your mind.

#

AI only runs on the Server, Clients dont do any of the calculations locally.

#

I see now.

burnt sparrow
#

Need help with some multiplayer character issues. I have a host and client in a server, with a custom character which switches based off a string variable "State". Different movesets are enabled depending on the current State, like vaulting over or climbing on top of objects/walls. This works totally fine for the server host, but clients connected via Join Session aren't able to use some states without the variable resetting to its default value, "Base.Idle".
I've tested this with crouching by using print strings - When I press/hold crouch while idle, the event in image 1 on the right works fine and sets the state to Crouch. Once in crouch state, Event Tick runs execs everything in image 2. But the very next tick after in image 3, the state returns to Base.Idle. Weirdly enough, the client character still crouches ingame, but it seems to reset the state every tick.
It DOESN'T reset when I jump - Same thing as before, press jump and trigger the event in image 1 on the left, the character jumps and the state is set to Jump.Normal. When my Z movement goes negative, it switches to Air.Normal until I hit the ground again. This seems to work perfectly, despite it not recognizing any other buttons that should be changing the Jump type. For Idle/Moving, Jump and Air, the states work fine. Why would it reset for Crouch or any other state?

modest crater
#

Why are you using so many strings for states? Do you intend to mutate the string or are you just unfamiliar with something like gameplay tags or enums?

burnt sparrow
#

I tried using enums at first, but it's a state and substate, which I couldn't really bother creating something for

#

It was initially a Unity project where I had a list of enums in a single class, but I didn't know how to replicate that in Blueprints when I switched to Unreal, so I just went with a string

#

although i, could've made a static blueprint, with all the enums as variables

#

hm.

modest crater
#

Use gameplay tags. Anytime I see extensive string use like this, my first though is ex unity user. There are pleanty of great blogs on them.

#

They read like strings but are compared as simple ints behind the scenes, very fast and small.

burnt sparrow
#

lmao

#

Well at least I'm not the only one who's done this then

#

hierarchical labels WHERE WAS THIS WHEN I WAS SEARCHING FOR THIS EXACT THING FOR A WEEK

#

tysm

chrome bay
#

If you must use arbitrary strings for stuff like this, at least use FName

kindred widget
#

Yeah. There is one single case where you should ever consider using a string type property in Unreal. That case is if you need to actually do string operations. Like compressing arguments into a string or filtering characters etc.

queen escarp
#

hey question

#

this is withing a Widget" im trying to get the owner of Flag1 and get that players player state

#

is it possible to do in a wb ?

dark parcel
#

a client only have a reference to it's own controller.

modest crater
#

withing ?

queen escarp
#

within*

#

hm

modest crater
dark parcel
#

Yeah, I am only scartching the surface of multiplayer but isn't get owner return controller?

queen escarp
#

the get owner return player character*

#

and that works

#

im just trying to get the player character player state

dark parcel
#

I guess that will work then

queen escarp
#

but im not getting it to work 😛

dark parcel
#

can you get the player state thru the character?

modest crater
#

Pawns have a GetPlayerState function, no need for the controller.

queen escarp
#

casting fails from player character

modest crater
#
    /** If Pawn is possessed by a player, returns its Player State.  Needed for network play as controllers are not replicated to clients. */
    APlayerState* GetPlayerState() const { return PlayerState; }
dark parcel
#

casting is just a type check

queen escarp
#

yeah, im getting the correct player

dark parcel
#

Then the cast doesn't fail?

queen escarp
#

it dose somehow

#

im print of "get owner"

dark parcel
#

show the print string

queen escarp
#

printing be4 casting

dark parcel
#

then print string from the cast failed

queen escarp
#

k

#

oh wait it not failing

#

you know what...

#

im dumb again

#

yeah..

#

so everything is working... im trying to sprint the player name string from playerstate.. but the string is empty

#

print*

#

so yeah it works*

#

ok so next issue

#

the cast to player controller fail,

#

how would i check if the actor is the same owner as the widget owner *

dark parcel
#

Bruv

#

you just checked the value of Flag1Millitary camp owner

#

remind me what it is again.

dark parcel
#

I'm toxic 🫢

queen escarp
#

he

#

its an actor

dark parcel
queen escarp
#

this solved it * 😛

#

im overcomplicating things

tardy fossil
#

does ALL network data go through UIpNetDriver::LowLevelSend? like even session packets? as in finding sessions and joining

lost inlet
burnt sparrow
#

Well, I found a way to get around it by just remaking it into a literal, but the container doesn't have any of the tags present.

modest crater
#

I have no idea about the BP graph side of it, I mostly work in c++. Theyre incredibly cheap to copy though, the size of 2 ints

burnt sparrow
#

oh damn

#

that's definitely better than using a string lmao

#

Well remaking it into a literal decided to work now

modest crater
#

Yeah theyre really powerful, its just a container for FNames and FNames are hashed strings which hash with an int key so only one instance of that string exists in the whole project and when you compare or use it, its basically just using the int hashed value.

burnt sparrow
#

one last (probably) question, is there any way I can swap the parent of a gameplay tag? Like, for example, I have State1.Tag1, State1.Tag2, State2.Tag1, State2.Tag2, something like that. If the current state is State1.TagX, can I dynamically set it to State2.TagX without directly referencing it?

#

That's what I was doing with the string state before a couple times and I'd rather keep that system if it's feasible

modest crater
#

You would just assign the gameplay tag to the new one, it would change the int hashed ID behind the scenes, you arent really dynamically changing gameplay tags at runtime, they should all be created by editor time so you can replicate them correctly and client A has the same hashed ID as client B, unreal handles that behind the scenes.

When you set a gameplay tag to a new value it will just change which tag it maps to in the global container

#

The parents should be pre defined with their children

burnt sparrow
#

Uh, I'll take that as a no then

#

Ah well

chrome bay
#

Tags are meant to be static essentially. Think of them like hierarchical enums.

#

Also, tags work best when you use them compositionally. Deep hierarchies of tags or tags that exist in multiple hierarchies indicate a poor usage generally.

burnt sparrow
#

still, just outright setting them is probably more efficient

chrome bay
#

Well you could technically do that here too, but you wouldn't have any safety.

#

Not sure how that would work safely even in the original case though

burnt sparrow
#

It probably didn't lmao

#

my programming level is barebones basic

twin juniper
#

I'm working on integrating the PlayFabGSDK with my project. However, it gives me an error [Pic1] on the line [Pic2].
This is the official GSDK file [Pic3] btw so it seems there's an issue there. Does anyone know how to solve it?

modest crater
#

Your strings before were for movement stuff right

modest crater
burnt sparrow
modest crater
#

Yeah show me an example of your question before though of State1.Tag1 or State2.Tag1 where you wanted to change the parent

burnt sparrow
#

Jump.Normal to Air.Normal, or Jump.Arms to Air.Arms, etc. Initially a string where I replaced "Jump." with "Air.", I've just made it a switch on Gameplay Tag that sets it manually in the collapsed node Switch Jump To Air

modest crater
# burnt sparrow Jump.Normal to Air.Normal, or Jump.Arms to Air.Arms, etc. Initially a string whe...

The good news is that each sub tag is hashed independently so you don’t incur an extra cost but you could always try flip what you have, like Movement.Normal.Jump or Movement.Normal.Air etc, try find the common one and work that way, but there is no real issue the other way it just means more typing initially to set it up in the editor tags section but like I said, they’re hashed independently so no extra cost, in fact if you had Foo_1 and Foo_2 they also share Foo by itself and the int would be its own value so you pay one Foo

burnt sparrow
#

Huh, alright then

#

What I've got works and it sounds like I've made it much cheaper just by not trying to cast stuff, so I think I'll leave it as is

#

tysm blue_heart_anim

lost inlet
chrome bay
#

That said, any benefit you get is going to be trumped by the Blueprint VM anyway, so likely not worth it

modest crater
flat night
#

hey guys, I used to use a static mesh for the arrow mesh, but I made it a skeletal mesh, because I added some bend options to it. Problem is that it is flickering like that only when facing those two directions, everywhere is fine (it's not Z fighting). I have no clue at the moment what's causing it, I know it's not the material, since I tried a bunch. Anyone else had an issue with Skeletal meshes like this before?

tiny pier
#

when i open up my server with the -log paramater, the console opens, doesnt show anything, then closes after a few seconds

queen escarp
#

hey in my minimap i use a sprite as player indicator, how can i make it so only player sees his own indicator not other players

#

like this i dont want you to be able to so the enemies

twin juniper
#

I got it to work by changing the line to this:

#

now there seems to be a different issue. i don't think they're related to each other.

surreal plaza
twin juniper
#

when the compiler gets to line 518 here [Image1] it throws an exception [Image2]

#

if anyone could help it would be great

#

this plugin is not very well maintained i guess

lost inlet
#

yeah any context with that

twin juniper
#

well im working on integrating the PlayFabGSDK from their GitHub to my project.
it requires you to paste files into the Plugins folder and follow these steps in your GameInstance blueprint
As soon as i connect the last node (in the image) it gives this error

lost inlet
#

well you don't have to do it in BP, but you didn't show enough context with your screenshot

#

like, what's the callstack

twin juniper
#

and here's the callstack

lost inlet
#

yeah this is impossible without digging through the callstack

#

looking at the value of this, and other pointers

queen pecan
#

Why does adding a Blueprint Component to a replicated actor must go on the Construction Script instead of the Event Graph?

So I updated to 5.4. Previously 5.3.2 did not give an error.
The error is:

LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: Component->GetArchetype() == Component->GetClass()->GetDefaultObject()  [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\ActorReplication.cpp] [Line: 650] 
LogOutputDevice: Error: Replicated component BP_Barrel_C_0::NODE_AddBPC_Combat-3 was added dynamically outside the construction script. This is not well supported and the component on the client will be initialized using the wrong archetype.

Moving the Add BPC from the Event Graph to the Construction Script does not give the error anymore.
But why is this?

thin stratus
#

I'm also not sure if you actually would want to limit this to the Server. I can't recall UE having code to create the Component on the Client through replication.
Back when I added runtime replicated components I had to add them on both sides and ensure they are networkable

chrome bay
#

I only ever create runtime replicated components server-side :/

#

It's definitely supported, Ive no idea why that would throw an error

queen pecan
chrome bay
#

The error is triggered under these conditions:
if (Component->CreationMethod == EComponentCreationMethod::UserConstructionScript && !Component->IsNameStableForNetworking())

#

Willing to bet it's that crappy AddComponent node that Blueprint has doing that

queen pecan
chrome bay
#

Yeah it's always worked without any issue, no idea why they decided to throw it now

#

You can do it in CPP no problem anyway

#

but ye adding runtime replicated components server-side only is 100% supported, half my stuff would fall apart if it wasn't

queen pecan
#

Hmm.. would Add BPC be better off in Construction Script anyways? Does it make more sense?

chrome bay
#

no idea tbh

thin stratus
#

I know we had to create the ASC lazy loaded locally too on The Ascent

#

Did something change between 4.27 and now that made that redundant?

pure epoch
chrome bay
#

It just follows standard subobject replication procedure

brisk swift
#

can local variables not be pass through to a server, my 'SaveGame' is valid on client but when the function is called it isn't valid

dark edge
#

spawn it where?

#

on what machine

#

authority and ownership are separate things

#

If spawned on client then yes it should have authority locally

#

nobody else knows about it

steel vault
#

How would a client get the rotation of a simulated proxy's controller?

#

Trying to replicate an effect in the direction they are aimed, but the simulated proxy's controller is not properly rotated

#

Nvmd, Get Base Aim Rotation works nicely

thin stratus
queen pecan
queen pecan
#

This is weird but here's what I think is the proper way of adding BPC to actors with replication...
If you're going to Add BPC in Event Graph, you only add it to the Server, then let it replicate it over to the Client. If you don't, then Client will have its own copy (different from the Server's) and that will mess things up
If you're going to Add BPC in Construction Script, then you add it without a Server check (meaning adding it to both Server and Client). Then I guess UE will know this and properly create it on the Server and replicate it to the Client, as it should be.

#

And since there's an error message saying you should only add BPC for replicated actors in the Construction Script, then looks like the proper way is to Add BPC in the Construction Script, and remove the IsServer check

#

As a matter of fact, I noticed something...
When I print the name of the BPC, I see this:
Left one is using Construction Script, adding the BPC without IsServer (meaning adding it to both server and client)
Right one is in Event Graph, adding the BPC only on Server
Since they have the same name (when using the Construction Script method), it looks more like it is being replicated, I think.

urban crystal
#

what method should I use in c++ if I want to run code on an actor only when it spawns and is replicated onto a client from the server?