#multiplayer

1 messages · Page 291 of 1

queen escarp
#

i just dont understand why im getting a null from it then

dark edge
#

Why are you doing this

#

what actor is this code in?

queen escarp
#

player pawn

#

or wait

#

its on the controller

#

but its after "is local player controller" so that returns fine

#

thats not the issue

dark edge
#

and it could be a race condition, could be that the controller exists before the pawn does

queen escarp
#

thers always something your missing.. yeah that was it >.>

#

Also

Spawning actor(projectile) from player pawn

#

but its cast failing

dark edge
queen escarp
#

yupp

dark edge
#

set to what

queen escarp
#

(on fails on client)

dark edge
#

construction script might be early

#

instigator is replicated anyway, why does the client need to do this

queen escarp
dark edge
queen escarp
#

wait it was a misstake from me

#

a node was missing connection...

#

thanks

#

one last thing

#

im getting these annoying errors from my "log" code

Whenever a unit takes damage i create this widget and gives to all player via RPC, all works but getting this annoying error and im guessing its since the npc takes damage it wanna create a widget on the server which cannot be done.. but if i switch to remote only then it only works for clients not the host(listen server), Advice ??

gusty valve
#

Hello!

I wanted to make sure I had my "pause game" functionality in the best possible spot to make sure connected clients wouldn't have any weird issues or edge cases.

I currently have my "pause game" functionality setup in my player controller, which queries my game mode to see if they are alone (if yes it will pause run time). Then I simply add a widget overlay onto my screen for the pause menu.

is there a better place to put this functionality that's more universal?

dark edge
unique forge
dark edge
#

afaik

shrewd ginkgo
#

I set up the default character collision and even moved it away from the collision as shown in the image. I also tried moving it from the mesh to the capsule, but the jitter persists. I increased the net update frequency. I also changed the network smoothing from exponential to linear.

shrewd ginkgo
dark edge
shrewd ginkgo
#

No, I just made the character's collision preset the same as the new character's, like you said.

shrewd ginkgo
dark edge
#

not just collision

sinful tree
# queen escarp im getting these annoying errors from my "log" code Whenever a unit takes dam...

You can avoid doing something like this by making your UI listen for messages, allowing your "Log Box" widget manage when a message is received. This can be done by having the server multicast on something like the gamestate, and that multicast can call an event dispatcher that passes along the message. Your UI on construct can then bind to that event dispatcher and run whatever code is needed.

This will also fix the problem of worrying about having a dedicated server or listen server creating the widget or not as your game code doesn't have to tell a widget to do something, and your widget is instead listening for messages.

lusty palm
#

Hey guys, I am using FFastArraySerializer, it works, but in the PostReplicatedChange function, changedIndices is always empty for some reason:

void FInventory::PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize)
{
    UE_LOG(LogTemp, Warning, TEXT("REPLICATION WORKING"));
    if (!Owner) return;
    
    TSet<int32> ChangedIndicesSet;
    for (int32 Index : ChangedIndices)
    {
        ChangedIndicesSet.Add(Index);
        UE_LOG(LogTemp, Warning, TEXT("Changed Slot Index: %d"), Index);
    }
    Owner->OnSlotUpdated.Broadcast(ChangedIndicesSet);
}

bool FInventory::NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms)
{
    return FFastArraySerializer::FastArrayDeltaSerialize<FInventorySlot, FInventory>(Slots, DeltaParms, *this);
}```
shrewd ginkgo
#

jitter has not been fixed

sinful tree
shrewd ginkgo
#

only asset saved, save window destroyed logs etc.

dark edge
dark parcel
# shrewd ginkgo jitter has not been fixed

Ofc not, A.I is lying to you. The issue isnt with the network setting but from getting correction.

You can check by running the console commans. P.shownetcorrection or something along that line.

twin vessel
#

Can someone remind me the difference in use case between SetMoveFor and SetInitialPosition?

Cause the first calls the second, but SetInitialPosition is also called after a move got combined.
So i cannot think of an example of something we would want to store in SetMoveFor and not in the other.

I would think about inputs, but those should probably not be include in CombineWith regardless, so it would not have negative effects to have them be stored in SetInitialPosition (as cmc does for bPressedJump)

thin stratus
# twin vessel Can someone remind me the difference in use case between `SetMoveFor` and `SetIn...

Eh maybe something like Stamina for sprinting? The problem with move combining is that it will perform the first move, store it as pending and then combine it with the second move during the next frame before performing the combined one. Which means it performs the first one twice. That's why the initial position is used to reset the CMC back to the start of the first move, to avoid that problem.
Stamina in this example would be otherwise drained twice for the first move.

#

And then whatever stuff you can think of that wouldn't suffer from being performed twice would also not be needed for the move combining reset.

twin vessel
#

Yes stamina is the first example i could think of to be stored in SetInitialPosition, since it would be affected by CombineWith.
So basically SetMoveFor is mainly for stuff that is not "rolled back" in CombineWith?

#

But basically there would not be any issue with slapping everything in SetInitialPosition other then variable assignments being called twice for no reason (?)

lusty palm
chrome bay
#

Are you actually changing the items and marking them dirty?

bright summit
#

Any idea how can I get rid of this? It is triggering because my OnRep function is called before static mesh component gets mesh applied and static mesh is being applied/checked in my own OnRep function.

Everything works fine but this triggering ensure is annyoning 😄 I don't wanna turn them off globally so I am asking about turning off this specific ensure, or some sort of idea to solve the actual "issue" which I guess is not a real issue at all

thin stratus
#

Could you share the actual code, so the OnReps you are talking about and where the component comes from?

bright summit
#

this is child of staticmeshactor

#

disabling static mesh component replication gives same result

#

also, this ensure is propably only editor thing

thin stratus
#

btw, I'm half sure ItemClass.Get() will load already.

bright summit
#

it loads

#

but it should be checked in packaged build I guess

#

and yeah I know I have redundant ItemDefinition checks

thin stratus
#

I mean that you don't need IsValid ? Get : Load iirc

#

Any reason the ItemQuantity uses a different DOREPLIFETIME macro?

bright summit
#

em nope, it should be _FAST also

thin stratus
#

Hm, it's a bit strange though.

#

SetStaticMesh calls SetStaticMeshInternal, which should be setting the KnownStaticMesh via NotifyIfStaticMeshChanged.
The ensure comes from calling GetStaticMesh, which happens at the start of SetStaticMesh. So before you even set the mesh from the Definition, it's already in a bad state.

#

What's the callstack when the ensure hits?

bright summit
#

let me fast check it

#

what do you mean by bad state? Nullptr?

thin stratus
#

I mean that at that point KnownStaticMesh is already != StaticMesh.

bright summit
#

because knownstaticmesh is nullptr

#

and OnRep is setting correct static mesh

thin stratus
#

But that can't really happen

#

Like, let's assume there is no mesh assigned by default.

#

So StaticMesh and KnownStaticMesh are nullptr.

#

When you call SetStaticMesh(..), it won't ensure, cause they are both nullptr when it calls GetStaticMesh.

bright summit
#

ah, yeah thats right

thin stratus
#

SetStaticMesh is then setting StaticMesh and KnownStaticMesh, so next time you assign, they are equal.

#

The thing is, however, KnownStaticMesh is an Editor thing for tracking if the Mesh changed.

#

Which means this isn't a gameplay problem, but rather that you are doing something during Editor time with it.

#

Is that Actor placed into the level or spawned runtime? Specifically the one that triggers the Ensure.

bright summit
#

depends, but it has bNetLoadOnClient = false so it should be fully replicated to the client

And yes in code I have PostEditChangeProperty which applies staticmesh when ItemDefinition changes.

I am attaching ss of callstack

thin stratus
#

Hm but that should still cause the flow where it applies the Mesh and then KnownMesh.

#

This can only really fail if one of the two is set outside of the intended flow.

#

And yes in code I have PostEditChangeProperty which applies staticmesh when ItemDefinition changes.
You didn't include that in your pastebin

#

It's difficult to help if you paste partial code :D

#

Or wait it is

#

Why can't my browser find it.

bright summit
#

it is 😛

#

don't blame me so early hahahah

thin stratus
#

Double clicking it selects the damn space behind it. Discord please.

bright summit
#

haha 😄

thin stratus
#

Hm, but all of that should still go through the same flow, unless one of the two variables is of a different type.

#

Which doesn't seem like it, despite one being a naked pointer. So it's not like one resolved and the other didn't.

bright summit
#

hmm let me check something, I think you pointed me onto good direction

thin stratus
#

I would suggest you start breakpointing the different functions in that component

#

The natives ones, such as NotifyIfStaticMeshChanged SetStaticMeshInternal OnRep_StaticMesh SetStaticMesh, and see if anything calls in a weird way.

bright summit
#

ok I think I know the reason

#

I placed the item on fresh level

#

so I assume some instance on test level had manually applied different mesh when I was coding it

#

yep

#

I forced OnConstruction (moved every actor)

thin stratus
#

Did you maybe forget the Super call to PostEditChangeProperty at some point?

bright summit
#

let me restart the engine once again to sanity check

thin stratus
#

Cause I could imagine if that is missing, you could assign the StaticMesh by hand and it wouldn't trigger the NotifyIfStaticMeshChanged stuff.

#

E.g. if you ever did:

  1. Forget Super call there.
  2. Assign Mesh to Actor in Level
  3. Save Level
  4. Notice it's missing and add it.
  5. Restart Editor.

Result: KnownStaticMesh isn't set.

#

Just an idea.

#

Or maybe within the OnConstruction you forget it for a short while.

#

Any kind of missing Super call in an override that would otherwise lead to the notification and KnownStaticMesh being set could cause this.

#

But glad you figured it out (: I have to focus on crash fixes now.

bright summit
#

nope still triggers, I was wrong

#

but yeah if you don't have time its not a problem, thank you anyways

thin stratus
#

Here is what you can do next:

  • Check if every override calls Super:: properly.
  • Breakpoint the functions I mentioned and check what calls them and what the values for StaticMesh and KnownStaticMesh are each time.
  • Check if it's always the same Actor, if so, remove it and place it again, maybe it's corrupted in some way.
  • Try manually calling NotifyIfStaticMeshChanged (only inside WITH_EDITOR I think) when you apply the ItemDefinition.
bright summit
#

yeah sure, thank you 😄

lusty palm
#

I specifically use only one function for changing anything so that I make sure the marking gets called.

bool UAC_InventorXBase::SetItem(FInventoryItem Item, int32 Index)
{
    if (!Inventory.IsValidIndex(Index)) return false;
    
    Inventory.Slots[Index].Item = Item;
    Inventory.MarkItemDirty(Inventory.Slots[Index]);
    return true;
}```
halcyon ore
#

Quite useful thing that I just found out, and never realized it worked like this.
Since, given the wording, and my understanding of it, it working like this didn't make sense.

But, turns out that when on rep / replicatedusing is used on a replicated reference (actor, component, maybe object?)
When the replicated thing becomes relevant from network distance, and the such.
It will call the on rep function.

Since from my understanding such thing is only called on actual value change.
Not the thing its pointing to changes.

summer tide
#

Any idea why anim notify from an animation not working on client side after i upgraded to ue5.7? It should be running on server by default.

dark parcel
#

@summer tide perhaps theres misunderstanding? Anim notify gets called locally.

#

It will fire when ever the machine playing the anim hit the trigger.

chrome bay
#

Without this race conditions would be almost impossible to workaround too

halcyon ore
shrewd ginkgo
#

I'm having a camera jitter issue.
Originally, the camera was attached to the character's head socket on the mesh. To try to fix the jitter, I detached the camera from the mesh and attached it directly to the capsule component instead.
I also made sure that the character's movement speed is not being modified during gameplay, and the Character Movement Component settings are the same as the default Unreal character.
Despite these changes, the jitter on the client still persists. The server view is smooth, but the client camera becomes jittery while the character is moving.

sinful tree
# shrewd ginkgo I'm having a camera jitter issue. Originally, the camera was attached to the cha...

It still boils down to the same problems....
If it only happens to clients, then it's something to do with how things are networked as jittery movement on clients only is usually something to do with how the character movement component is being used.

You'd need to review all code relating to any movement you may be doing, including anything you may be doing on tick for movement, or anything that may even interact with the movement component.

It can also be related to what the players are walking on - if what they are walking on is not part of the level by default, and you're spawning the level on the client (maybe some PCG system?) that can cause issues as well.

shrewd ginkgo
#

Since there was no problem when I stood still and spin around, I didn’t think that was the cause, but could this be the reason?

sinful tree
thin stratus
sinful tree
thin stratus
#

Jitter when moving sounds like corrections. And since the capsule isn't smoothed iirc but only the mesh, it would probably get worse parenting it to the capsule

#

Without a video and corrections being drawn, hard to tell

sinful tree
#

Actually upon closer inspection, even the first half is pretty bad XD

nova wasp
#

p.NetVisualizeSimulatedCorrections etc

queen escarp
#

ok so im stil struggeling with this one..

So unit takes damage then casto the the "damagin actor">get controller spawn widget on that player. it works for the listen server client but on Clients i get error that i need local player only... i guess its just node thats needed ...?

nova wasp
#

the server has all player controllers

#

clients ONLY see their own unless one is locally spawned (you don't do this almost ever though)

#

and they receive their local playercontroller from the server as a replicated actor that can arrive a bit later in some race conditions

#

read the multiplayer compendium things in pinned, it is really really important you understand the playercontrollers are not on every client

#

in this case you probably just want the local player controller here for both cases as they are who will see the widget

queen escarp
thin stratus
#

If Splitscreen doesn't matter, in theory with get GetPlayerController(0)

#

I'm, as usual, confused how this base level stuff is still not clear to you after all this time :D

queen escarp
#

ha yeah, i have that affect x)

#

its not splitscreen*

#

its weird some things im really good and and knowlagable about but other stuff just dont stick...

#

since its on a NPC(Server controlled actor) this code is running from then that will call the listen server´s playercontroller

#

right

nova wasp
#

running from "that?"

#

how do I know what that is?

queen escarp
#

or nevermind thats wrong

nova wasp
#

basically on a dedicated server you would not want to spawn the widget anyways

#

so getting the first local player controller is fine on the listen server and clients for the purposes of spawning a widget

queen escarp
#

hm okey,

#

but even if i get (get playercontroller)0 on my clients it only displays on my listen server client...

nova wasp
#

is that code running on the clients or not?

queen escarp
#

ok nevermind that, its running on the server*

#

my mistake

nova wasp
#

absolutely crucial to be able to answer that question every single time

#

even if it's just using a simple print log

#

it can be confusing but logging will show the name of the current world's debug string from bp (client 0, listen server etc)

queen escarp
#

yeah, thats what i did when u asked* that was a silly misstake

#

yeah it stuff like that i mostly stumble on 90% of the time and my head gets all twisted

#

now everything works as intended by just doing this small change...

#

but yeah anyways thanks for the help !

#

@thin stratus thanks also, and i might never get better but i still love doing game´s so admire the commitment* atleast 😉

dark parcel
reef bison
#

is RMS (Root motion sources) supposed to support prediction on simulated proxies? i read this quote (from this article):

Any movement effect that should be responsive, should be (1) executed predictively on the controlling client, (2) executed authoritatively on the server and (3) executed again when resimulating moves. As a bonus, predefined behaviors may also (4) be executed predictively (extrapolated) on other clients on sim proxies of the character.

Root motion sources are CMC's way of providing (1), (2), (3) and (4) out of the box for some common types of temporary movement.

i might be misunderstanding it but i was hoping it was possible to apply RMS to a sim proxy and if the params match on both the client and server, i wouldnt see the movement i already predicted being rolled back on the client. i am trying to use this for npcs knockback. i am open to other suggestions to predict this

queen escarp
#

Question

What would be resonable values to simulated a "normal P2P" session ?

#

or what values are recommended +

dark parcel
#

depends on the game and your tolerance

#

some game requires more responsiveness than others.

#

e.g shooting games.

queen escarp
#

hm 4 player co-op "small-midd size" maps with 100 npc at a time, 3rd person medival (not shooter)

dark parcel
#

co-op or not makes no different tbh.

queen escarp
#

hard to give away more then that

#

aye just giving a "size" ref

dark parcel
#

only difference when it comes to co-op or competitive is you can chose to trust the client more, so it's easier to design the network code.

dark parcel
#

and just hop on different server with different ping.

#

see what feels acceptable or not.

#

Generally 70 ms is noticeable.

#

more than 120ms already feel frustating.

queen escarp
#

yeah agree

#

but incoming/outgoing what would be the comparing values

#

same same or sshould it vary ?

dark parcel
#

normally I just use the console command and enter the ping I desire.

#

p.NetPktLag X something like that.

queen escarp
#

oh and u dont enable the emulation ?

#

or that itself enables it i suppose +

dark parcel
#

it will emulate

queen escarp
#

aye ill try that

#

im thinking all 100+ is almost unplayable

#

even if everything "works" it s still not fun to play

dark parcel
#

my cut off point is 125ms.

#

beyond that is unsupported, play at your own choice.

queen escarp
#

yeah

#

do u have any failsafe above 125 liek the game stop or displays a networking warning or something ?

#

i guess that would be nice to indicate that

dark parcel
#

displaying network warning is soo trivial.

#

just check the ping, you can get it from player state.

#

I haven't implement my system yet, but eventually I will give window for the client to send data to the server.

#

e.g when handling damage, the server will give window to the client to send data to the server.
Like their input or their state (e.g blocking, parrying, etc.).

#

but if the data didn't come soon enough beyond the treshold, then I will just ignore the late data.

queen escarp
#

aye

bright summit
sinful tree
#

I'm not sure if trying to make sure 400ms being "playable" for a player isn't as important as the game not blowing up because someone is playing at 400ms. XD

mystic estuary
#

Hello, does anyone know why I get timed out in 2 seconds when connecting?

It wasn't a problem up until I added some stack trace dumping in the initialization code which makes the server stall a little making it take longer to get through that code, which is over this wildly short period of time.

I checked out all the parameters that contain ConnectionTimeout in them, and the only parameter that has 2 in it is this

/** 
 * Amount of time to wait for a graceful close/bPendingDestroy to complete before considering the connection timed out.  
 * This is the time used to allow any existing, pending reliable data to be acknowledged.
 */
UPROPERTY(Config)
float GracefulCloseConnectionTimeout = 2.0f;

Changing it to 10 didn't change anything. The comment makes me think that it shouldn't be the right parameter in the first place, looking at other parameters, there's

/** Amount of time to wait for a new net connection to be established before destroying the connection */
UPROPERTY(Config)
float InitialConnectTimeout;

but it's already set to 30

royal vault
#

Does anyone know why I suddenly can't play multiplayer in PIE anymore?


LogNet: Error: LoadMap: failed to Listen(/Game/Maps/TerrariaWorldGen/Deliria?listen)
LogOutputDevice: Error: Ensure condition failed: EnableListenServer(true, ListenPort) [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\GameInstance.cpp] [Line: 561] 
Starting Listen Server for Play in Editor failed!

exotic wasp
#

Idk use a debugger

queen escarp
#

Anyone have a good tutorial on how to create "Friendly target frames for the Ui" ? (dispolaying all palyers own frame

dark parcel
#

what frame? frame per second?

queen escarp
#

haveing each party meember s healthbar in the Ui *

queen escarp
dark parcel
#

You get the health component from the players you want to display then just read from it.

#

having it float or not is irrelevant, the method to get the data is the same.

queen escarp
#

i did just overthink it abit..

normal fulcrum
#

Hey
Returning dev question: for Chaos Vehicles do we need something special to make it networked? e.g. if I have Vehicle Movement Component, what should be done to make it work over network?

lusty palm
#

Hey guys, does FFastArraySerializer only replicate to owner? I set a chest actor to be always relevant but clients have no idea about its contents even tho it uses the same class of an inventory component that all clients have on them which works

undone needle
# lusty palm Hey guys, does `FFastArraySerializer` only replicate to owner? I set a chest act...

Does FFastArraySerializer only replicate to owner? No, it's only a tool to minimize the data that is passed on the bandwidth that moves between server/client more easily, to whom it replicates is dictated by the replication variable configs, just like any other variables, if your inventory variable is configured to replicate to owner only, then yes, it would only replicate to the owner, not because its a fast array but because thats how the variable was set.

For your chest, always relevant and how it replicates to players are 2 very different things. Having it set to alwaysrelevant doesn't mean the data will reach your players. Confirm that your chest, the component, and the inventory variables are all set to replicate

lusty palm
#

I do all the DOREPLIFETIME and other stuff for it

dark parcel
#

@lusty palm show your code

lusty palm
# dark parcel <@524294998309601281> show your code

The inventory actor component is quite long with a lot of unrelated stuff but basically I have:

// In .h file:
UPROPERTY(Replicated)
    FInventory Inventory;

// In .cpp file:
void UAC_InventorXBase::GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    
    DOREPLIFETIME(ThisClass, Inventory);
}

UAC_InventorXBase::UAC_InventorXBase()
{
    PrimaryComponentTick.bCanEverTick = false;
    Inventory.Owner = this;
    
    SetIsReplicatedByDefault(true);
}
#

It works for characters when the inventory component is on them, clients and server can read it

#

but when it is on a chest nearby clients cannot read it

dark parcel
#

Post everything related. Show if the chest is replicated.

#

Then show how you add the data to the fast array.

lusty palm
#

it may be the way I access the chest, this is just for testing the replication after all

#

BP Inventory Test is the chest

dark parcel
#

Begin play runs on everyone, this is a wrong way to add items to your chest.

#

Well its fine but make sure to only server adds or remove item.

lusty palm
#

I know, I am just using this for now to test, it had a switch authority node but I probably deleted it by accident

dark parcel
#

Because replication work from server to client.

#

Also for fast array you have to mark the array dirty after adding an entry.

#

Have you done that?

lusty palm
#

My problem is clients don't get slots from the chest at all

lusty palm
#
bool UAC_InventorXBase::SetItem(FInventoryItem Item, int32 Index, bool bBroadcastUpdate)
{
    if (!Inventory.IsValidIndex(Index)) return false;
    
    
    Inventory.Slots[Index].Item = Item;
    Inventory.MarkItemDirty(Inventory.Slots[Index]);
    
    if (bBroadcastUpdate) OnSlotUpdated.Broadcast({Index});
    return true;
}```
dark parcel
#

Ensure the chest actor is replicated

lusty palm
#

Also I am marking only the item dirty because I am changing the FInventorySlot struct not adding another element to array

dark parcel
#

Not just the inventory comp but the actor it self

lusty palm
#

Set it to be always relevant just for debugging

dark parcel
#

Whos calling set item? It should be server only.

#

In which case your broadcast shouldnt work on client.

#

You can do the broadcast on PostReplicatedChange on the fast array for client.

lusty palm
#

For the listen server, the broadcast from the setitem fires, for the client, there is a broadcast in PostReplicatedChange

#

Because the PostReplicatedChange doesn't fire for listen server

dark parcel
#

Yup well i am doing the same thing ( chest and dropped loots ) it work for me.

lusty palm
#

That doesn't matter tho as the initial array replication doesn't work at all

#

Like I try getting the quantity of Item at index 0 in chest, server says 5, because I used setitem on server, but client still says 0

lusty palm
lusty palm
kindred widget
lusty palm
#

Well for some reason it doesn't 😭

dark parcel
sinful tree
dark parcel
#

@lusty palm I went home and try to look at my project again.

#

I suffer from the same issue XD.

#

if the component is in player character, all is well (I'm guessing other actor that the player own should be fine too).

#

but when placed on the chest or non owned actor, it doesn't replicate.

lusty palm
lusty palm
#

I must be missing something...

tardy fossil
#

id start with adding an OnRep to your replicated Inventory variable that just prints a string and confirm if its getting replicated or not

pallid mesa
#

I'm curious, anyone here used the multiserver setup epic got ongoing :)

dark parcel
#

I just print the value with keyboard and its null on client

#

Btw this only happend with fast array 0o.

lusty palm
#

Although it's structs for me

#

and the item quantity returns 0 when it should be 5

dark parcel
#

Earlier i thought i had everything working but reviewing my project my chest didnt store any items. It just generate replicated items for my player to pick up.

#

The moment i attach inven comp, making sure the actor replicate as well as the component. It still not working.

#

Server add the item and able to see it. but the item doesnt replicate to clients.

lusty palm
#

I hope I am missing something since if this is a bug I think we have no alternative

dark parcel
#

Tried attaching it to character and thats finr as well.

lusty palm
#

I think we should file a bug report just in case?

dark parcel
#

Waiting for an elder to give their opinion.

lusty palm
#

yeah

ruby parrot
#

Hello,
is this the way to "open a dialogue window" via Interface? (Set_InputMode basically shows the UI element)

This would mean the Actor I interact with causes the UserInterface-Widget to show...or is there another/better way?

sinful tree
# ruby parrot Hello, is this the way to "open a dialogue window" via Interface? (Set_InputMode...

The code shown doesn't appear to be doing anything with showing any UI elements - you are calling a custom function in WB Player UI called "Set Input Mode".

Ideally you wouldn't have game code specifically telling UI to do things. The UI should listen for messages and update itself and display as necessary. An example of how to do that here would be that your "Interact" interface could signal to some component on the player which then calls an event dispatcher (Possibly an inventory component in this case since you appear to be dealing with a "Loot Container" widget?). Your UI would bind and listen for that dispatcher on the player's component to then display what you want rather than having your game code have to get the HUD, and reference to your UI and Loot Container and tell it to display it.

#

So the flow ends up being more like:
Player presses "Interact" button > Finds interactable target > Calls "Interact" interface on target.

Target is meant to open the loot interface, so it uses your Player reference (assuming Pawn) and "Gets Component of Class" <InventoryComponent> and calls some kind of function like "Display Container" passing along a reference to the appropriate inventory you want to view when you call "OnOpenedLootContainer"

UI on Construct gets owning player pawn > "Gets Component of Class" <InventoryComponent> and binds to the OnOpenedLootContainer event dispatcher and runs whatever code is needed to display the UI and reads the appropriate inventory you want to view and displays it.

ruby parrot
ruby parrot
#

AC_Base I just made up for example purposes

sinful tree
#

Yea, that makes this actor bound to the component rather than the UI directly.

lusty palm
ruby parrot
hexed swallow
#

Hi, i am trying to make my dash work on multiplayer, i already created the FSavedMove_Character and the FNetworkPredictionData_Client_Character for my sprint and for a basic dash and it works good with network emulation , but i still have some questions, i wanted to change the ground friction while in dash so it can go and break easily, should i also include my ground friction inside FSavedMove_Character ? Also on multiplayer how should i detect the end of the dash ? Should i set the dash direction on server as a reliable rpc ?

nova wasp
#

you might need something for sim proxies to be aware of it I guess though

hexed swallow
nova wasp
#

you can put any information you want in there?

lusty palm
#

Does anyone know why a chest with an inventory of FFastArraySerializer won't replicate inventory contents to nearby players but if the inventory is on a player character it works normally?

sinful tree
#

Like... Where does your clients get the values from? Are you relying on the PostReplicateChange or something else to get the values on the clients?

nova wasp
lusty palm
#

And they work for inventories on the characters clients own

nova wasp
#

how are the chests created and how is the fast array actually on them

sinful tree
#

What does your PostReplicatedChange function look like?

kindred widget
#

I'm waiting for the moment something is being ran through the PlayerController.

lusty palm
lusty palm
nova wasp
lusty palm
kindred widget
#

FastArray or not. Any replicated property requires you to fulfill a few basic steps.

Is the property replicated?
Is the property in a component? If yes is that component replicated? And is it's owning actor replicated?
Is the actor related to this property's replication relevant?
Are there any Rep conditions?

#

Something here is wrong.

lusty palm
# sinful tree What does your PostReplicatedChange function look like?
void FInventory::PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize)
{
    if (!Owner) return;
    TSet<int32> ChangedIndicesSet;
    for (auto& Element : ChangedIndices)
    {
        ChangedIndicesSet.Add(Element);
    }
    Owner->OnSlotUpdated.Broadcast(ChangedIndicesSet);
}

bool FInventory::NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms)
{
    return FFastArraySerializer::FastArrayDeltaSerialize<FInventorySlot, FInventory>(Slots, DeltaParms, *this);
}```
nova wasp
#

the silent return on Owner is very sus

lusty palm
#

The Owner variable is of type UAC_Inventory_Base

nova wasp
#

is owner being null here expected?

lusty palm
#

will check

nova wasp
#

instead of guessing

#

make it ensure

#

there is no need to guess here ever

#

or even just error log if that is too annoying

lusty palm
#

ensure(Owner);

#

like this?

kindred widget
#

It's supposed to be annoying. 😂 Shit went wrong that was never supposed to. Fix it.

nova wasp
#
if (!ensure(Owner))
{
 return;
}

ensure can be done inside of an if statement as it just wraps the call

#

you can even give it a formatted message if needed

hexed swallow
nova wasp
#

you might be able to get away with a separate rpc but generally separate rpc = random timing in relation to the main saved move sending
it's possible though if you disable corrections from that rpc separately I guess (there are situations where this can make sense if it can't be missed)

lusty palm
hexed swallow
nova wasp
nova wasp
#

just as a sanity check

lusty palm
#

And in the component I do this:

UAC_InventorXBase::UAC_InventorXBase()
{
    PrimaryComponentTick.bCanEverTick = false;
    Inventory.Owner = this;
    
    SetIsReplicatedByDefault(true);
}

void UAC_InventorXBase::InitializeEmptyInventory()
{
    Inventory.Slots.Init(FInventorySlot(), StartingInventorySize);
    Inventory.Owner = this;
    
    Inventory.MarkArrayDirty();
}

void UAC_InventorXBase::GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    
    DOREPLIFETIME(ThisClass, Inventory);
}
lusty palm
nova wasp
#

I would recommend using push model replication for fast arrays but I don't think that is the problem (generally speaking you save a ton of server perf by not polling everything)

hexed swallow
nova wasp
lusty palm
#

Because it doesn't, I change it on server and it doesn't change on clients at all

#

And this is the actor:

#

So nothing replicates correctly then

kindred widget
lusty palm
kindred widget
#

But what are the actor's replication settings for that instance? Both the actor and the component on it. Not defaults.

lusty palm
#

Component is set to replicate, cannot be changed on the instance anyways

#

But the component doesn't matter if the actor doesn't replicate any of its variables

kindred widget
#

Why is AutoActivate off for an inventory?

#

Isn't that true by default?

lusty palm
#

And this is where I update the value on server

lusty palm
nova wasp
#

I was going to ask if a force net update helped but you already have that

nova wasp
kindred widget
#

Yeah, just looked through it.

nova wasp
#

it's a bit confusing but it's kind of mostly a thing for like particle system components iirc

nova wasp
lusty palm
nova wasp
#

just print string after getting the local role?

lusty palm
#

that's what I was asking

nova wasp
#

look at what the local authority macro does (the switch)

lusty palm
#

Sim Proxy

#

Which I suppose is right since the client does not control the actor?

nova wasp
#

that makes sense here, yeah

lusty palm
#

I must be missing something here, I checked the checkboxes needed and set variable to replicate and it doesn't work

#

I hope it's not a bug

nova wasp
#

I am curious if a temp randomly set replicated property on the component replicates

lusty palm
#

On the component, but a temp does not replicate on the actor even?

nova wasp
#

I can't tell if this is just not using fast arrays correctly or if the component isn't replicating at all due to the nature of it being placed in the level

lusty palm
#

I don't think the component is to blame

nova wasp
#

It might be interesting to spawn one of these chest actor bps at runtime on the server

#

that way it will be a regular dynamic replicated object

sinful tree
#

From my testing...

#

The issue is possibly with the ChangedIndices

lusty palm
#

this is in level bp btw

sinful tree
#
void FExampleArray::PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize)
{
    OwnerComponent->OnRep_ArrayItemChanged(-1, 255); // This gets called always.
    if (OwnerComponent)
    {
        for (int32 Index : ChangedIndices)
        {
            OwnerComponent->OnRep_ArrayItemChanged(Index, Items[Index].ExampleIntProperty); // This does not.
        }
    }
}
lusty palm
sinful tree
#

It's not just for UI updates.... Is for anything that you want to happen when a change is received from the FFastArraySerializer.

sinful tree
#

In my case, it's triggering the function on clients, but the ChangedIndices appears to be empty.

nova wasp
#

it is crucual you can actually verify what happens on both client and server... you should NEVER need to guess

sinful tree
#

So you'd not have any values in there, meaning your functions aren't getting called.

lusty palm
nova wasp
#

instead of branching on local authority here branch on the local netmode not being the client

lusty palm
sinful tree
#

<_< No.

lusty palm
nova wasp
#

don't let clients locally create this actor (it can actually be useful to do that in some cases but not here)

lusty palm
#

or just use auto& Element : ChangedIndices

lusty palm
sinful tree
lusty palm
#

For some reason int32s are references, don't know why

#

It bothered me so much the other day

#

Until I figured it out

#

nvm, they are references because they use TArrayView lol

#

forgot

nova wasp
#

I suspect the fast array is being handled differently for this chest than the ones on the players

#

do the players dirty elements differently?

#

does a normal replicated property on the actor replicate down if you spawn it only on the server at runtime?

sinful tree
#

Nope... Length is being reported as 0

lusty palm
nova wasp
#

I'm also not a fan of not using pushmodel replication but I don't know if it matters here or not

lusty palm
# sinful tree Nope... Length is being reported as 0

For me this works ```cpp
void FInventory::PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize)
{
//if (!Owner) return;
if (!ensure(Owner))
{
return;
}
TSet<int32> ChangedIndicesSet;
for (auto& Element : ChangedIndices)
{
ChangedIndicesSet.Add(Element);
}
Owner->OnSlotUpdated.Broadcast(ChangedIndicesSet);
}

sinful tree
#

Oh, everything is working now? 😛

nova wasp
#

is the chest actor set to replicate?

#

I think they mean just the player inventories (which is a good sign as it means the fast array is sending sometimes)

lusty palm
lusty palm
sinful tree
#

And what I'm getting at, is on the clients, ChangedIndicies is reporting as 0 always, despite changes coming through.

#

on a component attached to a separate actor of course 😛

lusty palm
#

Maybe length works differently for ArrayView

nova wasp
#

curious if swapping to DORM_Awake dormancy helps

#

I'm not super clear on how dormancy works in the literal code but that is one non-default thing set here

lusty palm
#

So from bp it would be this one?

nova wasp
#

yes

lusty palm
#

But it says it can go dormany but is not currently if set to this

#

I think it was defualt in bp

nova wasp
#

yep, the arrow not being there means it is default

#

the little arrows on the right indicate you can click them to return it to default

#

(most of the time)

lusty palm
#

Yep still nothing

nova wasp
#

so if you add a new replicated propertry on to the actor bp

#

and change it randomly from the server

#

the clients don't see the change at all?

lusty palm
#

Nope

#

tested with another actor that doesn't have the component at all

#

still nothing

nova wasp
#

did you forget a super:: call somewhere?

lusty palm
#

It's in bp

nova wasp
#

I mean if it has a native parent

#

I feel like I am missing something about the setup here... which netmode is this in?

nova wasp
#

I'm not seeing a good reason for this to actually break a normal replicating bp but I also can't see what you are actually doing

#

I assume beginplay is being issued normally by the gamestate etc

#

definitely open the output log and check for big errors

lusty palm
#

aside from "unfocusable widget being focused" which isn't related

nova wasp
#

I mean output log here to be clear, not messages

#

also warnings etc

lusty palm
#

this one

nova wasp
#

yep

#

so you are saying this doesn't even appear on clients at all? (the dynamically spawned replicating actor bp)

#

or that it just doesn't replicate properties (and by this I mean adding a new scuffed float or something just to test)

#

fast arrays REQUIRE you actually dirty them in the intended way every time

nova wasp
#

which of those things are you referring to

#

be specific or I have to guess

lusty palm
nova wasp
lusty palm
#

I added a testrep int and it does not replicate, spawned it on level bp, the actor is there but the var doesn't replicate

nova wasp
#

I can only perceive information you show me in discord

nova wasp
#

okay, so the property is not changing but the actor does arrive

lusty palm
#

the properties do not change no

#

yes

nova wasp
#

can you show it being different on client and server?

lusty palm
#

wdym

nova wasp
#

I am asking to see how you determine the value of it

#

even just printing it out in the bp onrep +beginplay is fine

lusty palm
sinful tree
#

begin play may fire before that replicates to clients <_<

lusty palm
#

server: 32 client 1:25 client 2:25

sinful tree
#

Make it an OnRep

lusty palm
#

repnotify?

sinful tree
#

ya

nova wasp
#

yes

sinful tree
#

I was able to get thigns working right on my end, but I had to use

void FExampleArray::PostReplicatedAdd(const TArrayView<int32>& AddedIndices, int32 FinalSize)
#

Even tho I'm changing the same index o_o

nova wasp
#

yeah I think in general you want both added and changed... I recall this being confusing at one point

#

and removed of course

lusty palm
#

Not fired at all

#

Wait it does fire, it made a new func tho when I switched it to repnotify again

#

So I used that one and it does replicate

#

Since I open inventory on beginplay, I assume it may not have time to replicate?

#

Yep, that was it, damn, didn't know beginplay fires before replication happens

#

Thanks guys

sinful tree
lusty palm
#

One client can move contents, other client gets UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_InventoryTestActor_C_UAID_30560F1C9911D6C802_1416337361. Function Server_MoveItem_UI will not be processed.

sinful tree
#

If your UI is being created on begin play and you're not actively listening for changes to the component, then it could have the wrong values :/

lusty palm
#

How do I fix that

sinful tree
#

You can't call RPCs on unowned objects.

lusty palm
#

How does client 1 own the object when it was made by server

sinful tree
#

If you want to move something from one inventory to your player's inventory, you need to call that from your player's inventory.

lusty palm
sinful tree
#

Include the source inventory in your drag and drop operation.

Dropped on your player's inventory:
PlayerInventory->Server_Move_Item(Source = Source Inventory, Destination = Player Inventory)

Dropped on your target inventory:
PlayerInventory->Server_Move_Item(Source = PlayerInventory, Destination = Target Inventory)

dark parcel
dark parcel
#

Doesnt fire when its on some actor. But im gonna try again today.

lusty palm
dark parcel
#

Also for the failed test, i add item on begin play as server. Server have the iten.

#

But client null.

dark parcel
lusty palm
#

Theres a thing for replicating subobjects, look it up, it seems a bit complicated, you have to register them or smth to replicate

#

Mine used objects too before I transfered to structs

dark parcel
sinful tree
#

Again, seems like issue is related to using PostReplicatedChange only.... It still shows the length of ChangedIndices as 0 even with the component attached to an owned player character.

#

Using PostReplicatedAdd seems to works correctly regardless of where the component is.

lusty palm
sinful tree
#

Yep

lusty palm
#

For me, it sends the changes normally, I get all the changes indices

dark parcel
lusty palm
#

didn't check length tho

sinful tree
#

I am using an older version of unreal to be fair .... 5.2.1 XD

lusty palm
#

I don't use PostReplicatedAdd at all since the structs are slots themselves, only if adding more slots

dark parcel
#

I think your meant to override them all?

lusty palm
#

Probably but I don't implement the others at all

#

for me they are not overrides just normal functions, probably caught by the Unreal's reflection system?

sinful tree
#

Overriding one or the other wouldn't change how the others work tho. In my case it always has a length of 0 on the changed indicies so I can't iterate over the changes.

#

In PostAdd, it's fine

dark parcel
#

Yea got it, going to work now but i also done postAdd from memory and have OnItemAdded delegate.

#

Thing is sverything works fine when comp is owned by player.

#

Fod both server and client.

#

But moment comp is dumped on a non owned actor, it doesnt replicate. (I just check with key press the fast array value)

sinful tree
#

Problem is likely to do with subobject replication in your case if you're using objects for your inventory

dark parcel
#

I am, maybe need to do NewObject instead AddDefaultGetRef, no other idea at this point.

normal fulcrum
exotic wasp
hexed swallow
exotic wasp
#

Network move data is what's sent over the network while SavedMove is what gets replayed

#

And stored locally

hexed swallow
exotic wasp
#

Yeah but there's data only the client might need iirc

shrewd ginkgo
#

To fix the jitter issue on the client, I deleted everything, disabled collisions, and reset the character movement. It still hasn't been fixed.

serene silo
#

Hey, so I wanna play a sound for myself immediately and also play the sound for everyone else except myself. I tried this set up and multiple other solutions but audio just does not play or plays for everyone including the player who emits the sound. It's weird since the print shows in console that indeed every actor except the one I'm playing the sound from prints it out. Any ideas on how to approach this?

#

OMG I was just being dumb haha. unfocused window doesn't play a sound

#

just tested with a buddy and it works perfectly fine

full flower
#

Hi all,

I'm building a multiplayer UE 5.7 game with dedicated servers (headless Linux, deployed to AccelByte AMS). I'm running into issues where marketplace plugins with visual/UI dependencies prevent maps from cooking for the Server target. Looking for insight on how others handle separating client UI dependencies from server builds?.

The problem:
Several plugins in my project (DungeonArchitect and NarrativeTales) have TargetAllowList set to exclude the Server target (e.g., UI/widget plugins that don't make sense on a headless server). This is fine in isolation, but my game maps reference these plugins transitively through Blueprint dependency chains:

Map → GameMode Blueprint → PlayerController Blueprint → UI Widget Classes → excluded plugin → cook fails

With -IgnoreCookErrors, the build succeeds but silently skips the maps — the server ends up with only Entry.umap.

Similarly, I have a procedural level generation plugin (DungeonArchitect) whose runtime module loads textures/materials in CDO constructors. On a headless server with no renderer, these assets aren't cooked, causing SIGSEGV crashes on startup before any map loads.

#

What I've tried:

  • Excluding problematic plugins from the Server target via TargetAllowList — but then maps referencing those plugin types can't cook
  • Patching plugin CDO constructors with !IsRunningDedicatedServer() guards around visual asset loading — works but not scalable, and plugin updates overwrite the changes
  • Using the C++ base class instead of a Blueprint for the server GameMode's PlayerController — avoids the Blueprint's hard asset references to UI widgets
  • Removing GlobalDefaultGameMode from DefaultEngine.ini so the cook doesn't pull in the client GameMode's dependency chain

Questions:

  1. What's the standard approach for separating client UI dependencies from server builds? Do most studios maintain separate server-specific Blueprints (GameMode, PlayerController) that avoid referencing UI assets?
  2. For plugins that load visual assets in CDO constructors (ConstructorHelpers, StaticLoadObject for textures/materials) — is there a way to prevent those CDOs from initializing on a dedicated server without modifying plugin source?
  3. Is there a recommended build configuration or cook setting that handles this more gracefully than -IgnoreCookErrors silently skipping maps?

Any insight from those running headless dedicated servers with marketplace plugins appreciated.

dark parcel
#

Unless the caller r the listen server.

#

If client execute that function it will wait for the mc call from the server.

serene silo
#

then I hit up the server and from there all the clients

#

using the fake network ping thingy in editor confirms that

dark parcel
#

Just aware that ppl will get different value on that random node.

#

If you qant everyone to play at the same value, you have to send the result to the rpc.

dark edge
serene silo
#

I want immediate feedback from walking/shooting your gun

dark edge
serene silo
#

I heard you should spawn a sound for it to replicate

dark edge
#

there's nothing to replicate

#

just play it

serene silo
#

are there any benefits from doing that?

dark edge
#

probably cheaper who knows. I'd just keep it consistent, whatever your sound approach is

serene silo
#

probably a good idea

dark edge
#

Then you can set up the sound playing bit once and just literally have both paths call it

serene silo
#

actually no I want to spawn the sound to attach it to the player so it moves with em

dark edge
#

then do that on both

#

so you don't have the problem of leaving sounds behind you like Vintage Story has

serene silo
#

wdym? I need to use spawn sound attached for it to work or just spawn a sound and attach it manually

fossil dagger
#

Hi
I am starting a blueprint game project on 5.7.4
I would like to do an online multiplayer P2P (without having players to connect with their epic account, so anonymous device ID if i remember well)
And probably will use EOS.

I've heard about the EIK plugin that has a free version on Github, HOWEVER it's not up to date and seems outdated.

Is there alternatives ? I've heard also about a Online Subsystem EOS plugin Or should I go to an older version for my project ?

serene silo
fossil dagger
#

but u need a steam account to play online those games, i don't want to force players to have to connect to their accounts

serene silo
#

you could also use epic online services

fossil dagger
#

yes that's what I want to do EOS, but I think I need a plugin to do that right ?

serene silo
#

yea I never used it though. just starting to dabble with multiplayer stuff

hexed swallow
#

On a coop game should i use ClientAuthoritativePosition ? Or this can turn out to be a bad idea ?

lost inlet
#

It just means that a nefarious player can freely teleport at will. How detrimental and how much they can grief with that sort of depends

hexed swallow
nova wasp
#

it's not a bad idea for co-op games

#

the consequences could be they can spoof their real position

shrewd ginkgo
#

To fix the jitter issue on the client, I deleted everything, disabled collisions, and reset the character movement. It still hasn't been fixed. can someone help

dark parcel
#

@sinful tree @lusty palm not sure was the hiccup last time on my side but Fast Array work just fine regardless of ownership.

#

I think I was watching the wrong inventory on my side, I had two inventory, one for the backpack and general inventory.

lusty palm
cinder quartz
#

I'm having some issues with replicating an Projectile actor...
For one, even if set to Replicates the actor simply won't appear on other Clients when spawned.
Additionally, and this is the weirder one, if the Server client spawns the projectile, it runs a Begin Play test print with both the correct Pawn as Instigator, and the other clients' Pawns.
But if a Client tries to spawn one, then the debug BeginPlay spawn only prints a single Instigator, which is also the Server client's pawn

dark parcel
#

server client?

#

post your code.

cinder quartz
#

Eh which part in specific?

dark parcel
#

anything related to the projectile

cinder quartz
#

The parent class that gets spawned, something on the blueprint?

dark parcel
#

everything related to the projectile, it's impossible to see what's wrong without seeing anything.

cinder quartz
#

Okay let's see how I can fit so many lines of test

#
AProjectileBase::AProjectileBase()
{
    // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = true;

    bReplicates = true;
    
    // After creating our Sphere collision, set it as the Root component for the actor.
    SphereCollision = CreateDefaultSubobject<USphereComponent>(FName("SphereCollision"));
    RootComponent = SphereCollision;

    // Sets our Collision to the correct profile.
    SphereCollision->SetCollisionProfileName(FName("Projectile"), false);

    SphereCollision->OnComponentBeginOverlap.AddDynamic(this, &AProjectileBase::OnOverlapBegin);
    SphereCollision->OnComponentEndOverlap.AddDynamic(this, &AProjectileBase::OnOverlapEnd);
    SphereCollision->OnComponentHit.AddDynamic(this, &AProjectileBase::OnHit);

    // Projectile Movement Component settings
    ProjectileMovementComponent = CreateDefaultSubobject<UProjectileMovementComponent>("ProjectileMovementComponent");
    ProjectileMovementComponent->UpdatedComponent = SphereCollision;
    ProjectileMovementComponent->Velocity = FVector(1, 0, 0);
    ProjectileMovementComponent->bRotationFollowsVelocity = true;

    InitialLifeSpan = 5.0f;
}

Constructor doesn't seem like anything's off...

#
void AProjectileBase::PostActorCreated()
{
    AActor* ProjectileInstigator = GetInstigator();
    InstigatorASC = UDulceAbilitySystemGlobals::GetAbilitySystemComponentFromActor(ProjectileInstigator, true);
    Super::PostActorCreated();
}

Then there's this one step that might be it, where it tries to fetch the ASC from its instigator.

#

On the blueprint class side it's all pretty much blank save for debug prints.

dark parcel
#

but you are saying the bullet doesn't spawn at all?

cinder quartz
dark parcel
#

why would it appear on other people machine?

#

Any function you call on your computer will only be run on your computer as client.

cinder quartz
#

Because I was sure I made the controller send the event to theserver

dark parcel
#

Networking tip. The only way for client to communicate with server is through server RPC.

cinder quartz
#

Then make the server run it everywhere

dark parcel
#

that's the wrong way of spawning replicated actor.

#

you will end up with extra copies.

cinder quartz
dark parcel
#

Simply marking an actor as replicated and spawning it as server will spawn the actor on clients.

#

ofc this doesn't address predicting the projectile but that's not the focusnow.

cinder quartz
#

Ah, I thought the method was supposed to stack the different events...

dark parcel
cinder quartz
#

Ohhhh...

#

It's actually replicating across clients now

dark parcel
#

Yeah, to spawn a replicated actor to every machine, you simply mark the actor as replicated.

#

Then spawn by the server.

#

that's it, all players will eventually get a copy.

cinder quartz
#

However I still have this issue...

#

Not sure why this happens when Client0 spawns its bullet

dark parcel
#

unsure what the issue is

cinder quartz
#

Okay new example using Instigator instead

#

If Client0/Server does the bullet spawn it seems to also spawn another one with the othe client as instigator

#

But in the actor list, only a single bullet is spawned correctly so, maybe it just runs twice? Doesn't explain the instigator part tho

#

@dark parcel I wanna take the chance to check on two things though
For one, what's a better scenario for Multicast? Because I get now that running on owning client is better for something like cosmetic client only effects
Second, projectile prediction will be something that I need to deal with later, so is there some rule of thumb I can follow to make prediction less of a headache down the line while I'm setting up systems?

dark parcel
#

Anything stateful or need to be in sync shouldn't be using Multicast.

#

multicast is for event based.

#

You probably can benefit from Stepehn FPS multiplayer tutorial.

#

goes a lot about prediction, lag compensation, network clock, etc.

dark parcel
#

simply try to understand RPC and OnRep first.

cinder quartz
#

Alright, thanks for the tips

#

I also feel I should probably use a different system for my projectiles though...

#

No bullet drop or physics, the Projectile move comp might be overkill net wise

cinder quartz
dark parcel
cinder quartz
#

Well I did try to use Multi instead with no result, gonna have to read more on it

dark parcel
cinder quartz
#

Ahhh that's the bit I missed, thanks

#

I also noticed that the player's control rotation is not replicating for clients

#

But only on one axis...

#

Pitch is unreplicated, huh

dark parcel
#

Use GetBaseAimRotation

cinder quartz
#

Would that help with the AimOffset animation not playing too?

dark parcel
#

You use baseAimRotation to drive your aim offset. As for your animation I wouldnt have a clue why its not playing other than you telling me its not playing.

cinder quartz
#

Hmmm

#

I think it has to do a bit with how it's set up, probably the same thing that makes the camera not rotate with input

#

Since the bullets on non server clients spawn without pitch rotation, and I know the camera is the issue since bullets spawn with a position relative to camera

twin vessel
#

Hi, i am lost in a replication issue, where i need to mix atomic and delta replication.
In an ideal world i would have:

A FInventory struct derived from FFastArraySerialize.

The FFastArraySerializerItem would be my FInventorySlot. These slots have: index, FItemStack, and FStackId.

My FItemStack, would contain an ItemType, Count, and another FFastArraySerialize derived structs which items contains Instanced Structs of type FItemFragments (for dynamic item data).

Inventory slots would need to replicate atomically when the FStackId changes cause it means the whole stack was changed and needs to be sent from scratch.

Now, i am pretty sure trying to implement a chain of custom NetDeltaSerializers would be hell. But is there any reference for doing something like this? Is this even possible?

If i have to use iris i will, but i would still need some reference or guide to get started, plus some advice on how to handle the serialization of this chain of structs

chrome bay
#

@twin vessel Is this even possible? no

#

NetDeltaSerialize works on base-level UObject members only, not nested structs

#

Iris wouldn't change this btw, FastArraySerializers can't be nested

#

iris fast arrays suck anyway tbh, they can only distinguish between 32 individual items for dirtying. If you had say 64 items, you'd always be sending at least two of them even if only one changes.

#

Worth mentioning that instanced structs are not delta serialized either - they are sent as full blobs all the time

#

Still, when they are embedded deep in arrays, not sure how well that holds

twin vessel
shrewd ginkgo
#

To fix the jitter issue on the client, I deleted everything, disabled collisions, and reset the character movement. It still hasn't been fixed. can someone help

lusty palm
#

Hey guys, is there a way to call a client RPC from a server RPC only on the client that called the server RPC

quasi tide
#

That's what a client RPC does. It calls the RPC on the client that has ownership of the actor

#

Considering you can only call server rpcs on things that you own (PlayerController, PlayerState, Pawn), just get a reference to that and call the client rpc

dark parcel
lusty palm
quasi tide
#

The client doesn't own their inventory?

#

If they don't own something - don't try to do prediction

#

The only way a server RPC happens is through something the client owns. So, how are they doing the server RPC with this action if they don't own it?

lusty palm
#

I need prediction, with 100 ping, it has noticable latency

lusty palm
quasi tide
#

This is why you can play games at certain pings and the items don't load in the chests contents

#

The visuals for the chest might play, sure.

quasi tide
lusty palm
#

Just tested it for arc raiders, literally pulled out my ethernet cable, they do client prediction

quasi tide
#

Dang - didn't know arc raiders was many many many games

#

Also - that doesn't say they do client prediction

lusty palm
quasi tide
#

That's why I said to do a client rpc back through the same way...

#

You did a server rpc throught the player inventory

#

Do a client rpc through it as well

dark parcel
#

Just yesterday i see people attempting to predict knock back and damage

#

Still unsucesfull because theres always a take away.

#

I kinda predict managing inventory like swapping items.

dark parcel
#

But that was ez because index r not replicated and managed locally.

#

Server only care if the item exist in their end when it come to usage.

quasi tide
# lusty palm wdym

They may just front load the items and then you just tell the server that you looted chest X. No prediction necessary.

lusty palm
#

wdym by front load

quasi tide
#

When you get close to a chest, they async load the items in the chest so when you get there, the items are there to be looted. Even if you never open it.

#

Then you disable your internet - the items are still there

#

You loot it

#

You get the items

#

Reconnect, you tell the server you looted chest X

#

Server says 👍

#

Absolutely zero prediction in that entire process

#

(Not saying this is what they do mind you)

lusty palm
#

Yeah, but there are slots in the chest, doesn't necessarily mean I looted the whole chest

quasi tide
#

So?

#

That part is irrelevant

lusty palm
#

Also if I were to replicate when I get close to the chest, it would make cheaters be able to see contents before opening

lusty palm
quasi tide
#

Then the server fixes the state?

#

Ignoring the prediction debate - here are your choices:

  1. Do a client rpc to rollback everything that you mispredicted
  2. Dig through the rpc system to see how you can circumvent its restrictions and send w/e you want to w/e connected client
lusty palm
quasi tide
#

....

#

That is not what prediction is

#

Just because something can get out of sync doesn't mean prediction was involved.

#

It could also literally just be client authoritative over some actions.

lusty palm
nova wasp
#

It could be a bunch of different things... it could be a sort of lockstep series of transactions that is read back or replayed for integrity later or just entirely trusting the client etc... it's pretty arbitrary

quasi tide
quasi tide
#

When did I say to not message the server

#

My assertion is that just because you unplugged your ethernet cable, doesn't 100% mean that arc raiders does client prediction when looting a chest

lusty palm
quasi tide
#

As I said before, you shouldn't really predict this and just leave it to the server, but if you still wanted to, then your choices are the ones I outlined before

nova wasp
#

they might just run some simple sanity checks to say that you were remotely nearby later

#

they might not

#

prediction to me implies it's also doing it on the other machine and that's hard to tell here I think

lusty palm
cinder quartz
#

What's the intended way to replicate the player controller's pitch rotation?

slate phoenix
#

Hi everyone, is there anyone who has implemented a trading system between two players?

lusty palm
slate phoenix
lusty palm
#

I would just replicate the "trade inventory" to both players so they see what is offered and then on accepting, they just get the items in their inventory or whatever

slate phoenix
#

I purchased the inventory system, but it feels a bit complex, so I wanted to ask.
Should I create a new slot system, or should I use the existing slots in the current inventory system?

sinful tree
lusty palm
cinder quartz
#

Whould this method for replicating pitch on the character work properly as I hope, or am I missing something?

halcyon ore
#

I thought Pitch is already replicated, through the camera rotation?

fossil spoke
#

@cinder quartz Use the Pawn function GetBaseAimRotation if you want replicated Pitch.

cinder quartz
fossil spoke
cinder quartz
#

Ahhh, got it. And it's not replicated by default, and Yaw already is replicated by virtue of the CMC handling it already

#

Which is odd tbh, why does specifically the camera not get its pitch updated? Some legacy thing under the hood?

fossil spoke
#

Pitch is replicated by default, it is replicated on the Pawn via the RemoteViewPitch variable as I just said.

#
    /** Replicated so we can see where remote clients are looking. */
    UPROPERTY(replicated)
    uint8 RemoteViewPitch;
#

GetBaseAimRotation passes this value out.

cinder quartz
#

So remove the pitch variable and sample from GetAimBase

fossil spoke
#

🤦‍♂️

cinder quartz
#

What did I say wrong now?

fossil spoke
#

Its literally this simple mate.

cinder quartz
fossil spoke
#

Then I misinterpretted what you meant.

#

You can delete all the other stuff in your blueprint you mentioned above.

#

And replace it with that

dark edge
#

GetBaseAim exposes a replicated pitch in Pawn that comes from ControlRotation serverside. Some old relic from the "It's an FPS engine guys" days.

#

Pretty low precision though so don't rely on it for "where the bullets go", just use it for cosmetics

cinder quartz
#

What am I supposed to use for the actual "where the bullets go" then?

cinder quartz
#

@dark edge What would be better? A replicated variable? Some different function?

modest crater
#

Either replicate each players pitch and yaw manually or just suck it up and use the slightly lower precision since a proxy firing on another machine isn't really that important anyway unless you are making some high level shooter, we're talking very minor imprecision here

#

you're already going to be offset on a proxy client anyway by the time it takes to go from Client -> Server -> Other Clients

cinder quartz
modest crater
#

Just use the existing replicated rotations precision, run some tests and debug lines to see their discrepancy and see if you even notice or mind it

There is a higher cost to sending full precision, hence the reason they are using a quantized value in the first place

cinder quartz
#

Hm it's pretty hard to gauge what's best for my use case. The C++ function works so I'm at least in a better spot, but based on how big the imprecision is I gotta do something

#

The last debug test I ran had some discrepancies mainly in that rotators were applied the other way around. Like instead of 10 degrees if was -350

#

Other than that no visible meaningful issues so I didn't think too hard on it

modest crater
#

I don't know the full math to give you a correct answer but it's "good nuff" for most cases, my suggestion is to just test yourself on high ping locally

cinder quartz
#

Okay, gonna run a test tomorrow at 100 ping increments

keen slate
#

Hi, is there a way to replicate FFloat16 s ?

USTRUCT()
struct FDS_NetworkedHealthPair
{
    GENERATED_BODY()

    UPROPERTY()
    FFloat16 Value = 0u;

    UPROPERTY()
    FFloat16 MaxValue = 0u;
};

It seems like UPROPERTY does not support FFloat16. Because I have an array of floating points I wish to network, I was thinking that I could half the amount of network traffic.

chrome bay
#

There's not, but you can create a NetSerialize for your struct and do it that way

#

would make sense for a struct that small anyway, the UPROPERTY header would be as large as the types

keen slate
chrome bay
#

UPROP only supports what is normally visible to reflection - minus TSet/TMap basically

#

So more often than not you need to wrap your types in USTRUCT instead of using templates etc.

keen slate
chrome bay
#

Well bit packing is certainly an option

keen slate
#

I will think about it. Thanks!

chrome bay
#

But for very small POD types, implementing NetSerialize can shave tiny bits off your packet sizes (we are talking tiny though)

#

Each UPROP has a uint16 (I think..?) index to address it per-level (and that index gets wider, depending on how deeply nested the UPROP is) - the minimum net size of FDS_NetworkedHealthPair would be 32 bits, so you may as well pack both values to 32 bits and get atomic serialization anyway

dark parcel
#

does non replicated property in a struct still increase the size of the data when being send over the network?

chrome bay
#

shouldn't

violet walrus
#

How can I create a direct connection between 2 players? socket or something?

#

Basically I wanna bypass server client model

quasi tide
#

Well, you just have to write your own networking stack entirely or reach for a 3rd party library

exotic wasp
exotic wasp
violet walrus
#

There will still be a listen server game tho, I just need to bypass server for latency sensitive data

violet walrus
#

btw I don't care about RPCs or UE replication. I just need raw data via UDP

#

FYI: I tried going with default listen server model. Too much latency on client -> client data

quasi tide
quasi tide
verbal ice
#
  • there's no guarantee that P2P will be any faster. Maybe in some scenarios but not all.
violet walrus
quasi tide
#

Oh, RTS? Yeah - client-server model sucks for that generally.

violet walrus
violet walrus
quasi tide
#

Well, yeah, those are your options though. Write it yourself or reach for a 3rd party library.

#

UE is client-server through and through

ruby parrot
#

@sinful tree Havent forgotten you, just takes more time to rewrite stuff, its 80-90% working now just the last stuff, but ill figure that out too thanks again for the help
(if you forgot who i am: #multiplayer message )

dark edge
cinder quartz
#

Since in the average fps the actor Yaw is already used for the camera and replicated very reliably, and most games use the camera as origin with offset for the most part anyhow

dark edge
cinder quartz
dark edge
#

But see what the built in replicated pitch gets you, might be good enough for your usage

cinder quartz
meager spade
#

i mean your control rotation should be roughly in sync, but your client should send the rotation

#

and basically, like fortnite does, cleint sends all the data

#

server just does anti-cheat verifications

#

(max yaw angle, simple line test to detect if the show would ever hit, fire rate of guns, that kinda stuff)

cinder quartz
#

That's kinda my original method huh

cinder quartz
dark edge
#

how same is same enough totally depends on the angular resolution you need

#

Have you tested it yet? This whole convo is redundant if you haven't tested.

cinder quartz
#

Well I did, and it worked. I mostly only tried to work it out because the method was pointed out as flawed

#

However the singular issue I noticed is that the replicated value gets potentually turned the other way around, ie instead of 40.0 pitch I get -320

dark edge
#

idk I just replicate directional vectors not angles

cinder quartz
#

Well I guess I can turn the player view into directional vector and make the server camera imitate that

#

Just seems like a waste since the only thing I really need to replicate is the pitch

dark edge
#

I'd use the already replicated pitch to drive the cosmetic animation stuff

#

and when projectiles are fired use either a calculated direction vector (your approach right now), or later pass direction vectors around if that's not precise enough

cinder quartz
#

Ohh yeah, that's right!

#

I was thinking too hard on that one I missed that

#

I mostly so focused on this since I was using a replicated WeaponActor parented to the camera

faint stratus
#

Hey all, what would be the best method of multiplayer connections via blueprint? Is PlayFab worth it or is there another more suggested version?

meager spade
#

thats pretty broad

#

if your just starting out, don't even think Dedicated Servers

#

use steam, and get the advanced sessions plugin

#

if your bp only.

#

or use Redpoint EOS free version for epic stuff

faint stratus
#

I think I've got it, cheers.

faint stratus
#

Some more info... it works via invite, just not through finding session

meager spade
#

if you dont have a proper appid, i dont think find sessions works

#

ie if your using the test one

quasi tide
#

It does work - its just pretty hit or miss in my experience.

halcyon ore
#

IIRC, I had to set my search size to like 2000 for the testing one.
While actual game AppID was instant of course.

faint stratus
#

I changed it to give me a list instead of instant. I think I was just being impatient, I think it was just searching for a game. Thanks everyone

tardy fossil
#

you can also check the search result array on tick before the find sessions complete delegate is fired

#

if you want servers to show up 1 by 1 as they are found instead of all at once when its done

dark parcel
#

If you are using the default app id 480, then you are sharing the sessions with other testers with the same app id.

#

You will need to create a session with some unique indentifier and filter search with that unique indentifier if you dont want to grab someone else game project session by accident.

crystal verge
#

hey! I am trying to get access to a variable in the player controller from the widget. so in the widget i used the "getOwningPlayer" node but i noticed only the server returns the correct result while the clients does not. please any idea ?

dark parcel
#

what is the variable you are trying to access? because a client will never know any one else controller but their own.

crystal verge
dark parcel
#

you can have replicated variable of type Array of Character that lives inside a replicated actor.

#

don't know how your game is structure but one way is to make a manager actor. basically a Replicated actor that is spawned by the server and gets replicated to client.
The manager can contain the replicated array. Everyone can just read from it.

#

E.g Widget -> Get Manager Actor -> Get Character Array -> Display w.e.

#

actually scrap that, just do it in Game State.

crystal verge
#

so what i am trying to achieve is, each time a new player join the lobby his player controller spawn a character which is not yet posses and will be posses later on. So I want to be able to customize the spawned character from a widget .

dark parcel
#

k, all you need to do to get the character ref is laid above.

#

widget should only just read though.

#

and call functions.

crystal verge
#

Okay, let me try

strong apex
#

Hello deva
if anyone has experience with multiplayer server deployment. I had a query

do I need a new instance of dedicated server for every new session ?

or is there a way to have host only one server and manage multiple game session in that.

chrome bay
#

you have one server instance per game session

meager spade
#

1 physical server can run many unreal server instances

#

ofc by its cpu and ram

strong apex
meager spade
#

only one exe ber game

#

you cant host multiple games per single exe

latent heart
#

Also depends if you mean concurrently or sequentially.

#

A single server can run 5 matches if they don't happen at the same time.

latent heart
#

UE is designed to really just run 1 server per instance.

strong apex
latent heart
#

No.

strong apex
#

thats costly

latent heart
#

Correct.

#

Multiplayer FPS game servers are expensive.

#

If you can't afford them, get your players to host them on their own machines.

#

Like cod did back in the day.

#

Basically if you want to host your own servers over a long time, you need a live service game. Constant income from a subscription or selling skins, etc.

meager spade
#

one physical server can host many exes though]

#

just change the port

#

we run 12 instances per phyiscal server

latent heart
#

Probably can't do 12 5v5 servers, though? Depends on server I guess.

meager spade
#

and the server ofc

#

dedi servers run single thread

#

and memory is quite low

#

for most games

oak flower
#

Since the plugin "Smooth Sync" replaces the default CMC movement handling and set the Character Transform directly, we lost the "Hit Events", because hits only happens if there's a sweep... Have you guys ever had this issue before? Using Smooth Sync plugin and tries to bind OnActorHit/OnComponentHit

cinder quartz
#

Hey, question for troubleshooting
If I have a APawn variable in a spawned weapon actor, and it will remain unchanged for as long as the actor exists, should it be replicated...?
I am having some issues with online tests as the Variable seems to not work correctly. For context, this is how I'm spawning it.

quasi tide
cinder quartz
dark edge
cinder quartz
#

It gets assigned to it by the actor spawning it

#

With ExposeOnSpawn

dark edge
#

Just setting owner to the pawn would be enough, from there you could get to the other classes you care about I'm pretty certain

cinder quartz
#

That's a funny story... I tried to use the depregated Instigator instead of GetInstigator()

#

So this was a leftover

dark edge
#

depregated?

#

oh deprecated

cinder quartz
#

Yep lol

#

Idk why they specifically demand you use a function now

dark edge
#

How big of a packet is "oh shit" territory?

#

That was me changing 5 floats on 10 entries every frame for 5 seconds just as a bit of a smoke test.

nova wasp
#

what startup args was this using?

dark edge
nova wasp
#

raise the net verbosity

#

I just do -NetTrace=4 because I am lazy

dark edge
nova wasp
#

it should show individual elements for most packets

#

which net backend is this?

dark edge
#

Just standard replication, with a fastarray serializer

nova wasp
#

okay I have no clue if the old fastarray actually traces anything

dark edge
#

2500 bits for 50 floats + overhead + bookkeeping seems not insane

nova wasp
#

also like this is kind of a case where delta'ing can't really even happen when there's like not a baseline afaik

#

my assumption being that if the ack for the packet isn't even there yet before you send new info there isn't a baseline yet

#

I'm not 100% clear on this though and it's mostly an educated guess based on looking at profiling and reading a lot of iris

#

so I am very much guessing

dark edge
#

how crazy is custom serialization, is it a pain in the ass?

nova wasp
#

honestly yes is it a pain in the ass for iris

#

less so for the old way

modest crater
#

old way is easy pzy

dark edge
#

I really oughtta diagram this thing out.

dark edge
#

The hot loop device data lives in contiguous arrays addressable by handle. There is no consumer facing API for domain data, it's all through devices.

The state that must be synced is the set of devices and their corresponding handles, and the set of connections, which are tuples of (devicehandle, port index)

The public facing API is only CRUD via handle for devices, and add/remove connections.

#

Right now my approach is to have each subsystem create a replicator actor which contains a fastarray of (handle, data) and deriving local state from that on clients.

#

I'm wondering if it'd be worth looking into just netserializing the handle-addressable container and doing away with the hassle of using a flat array as an intermediary.

charred island
#

is there a way to get average network latency for a client?

latent heart
#

There's a ping in the player state

#

It's kind of a recent average iirc

nova wasp
#

for local players they will track a small average ping

#

see APlayerState::RecalculateAvgPing

charred island
#

can you get that within an RPC? i'm doing some latency compensation

nova wasp
#

well

#

the rpc would need some extra context for that

#

the average ping could be entirely distinct from the time the rpc took to show up

charred island
#

for sure, but it's a component of it

nova wasp
#

it's not a component of it unless it's part of the same packet

#

it might be close on average which could be good enough

charred island
#

that's the idea

#

currently i just hard code a vaguely correct value

nova wasp
#

one thing that might help is using an accurate server timer setup

#

but just knowing what the average ping is for compensation will help too

charred island
#

i do currently use a delta of GetServerWorldTimeSeconds();

nova wasp
#

I don't know what the actual plan is here for compensation etc

nova wasp
#

you could maybe piggyback the value into other commonly sent rpcs

charred island
nova wasp
#

the exact math for the averaging can be tweaked to consider what works best for your project as well... you might want something that changes faster etc

nova wasp
#

it uses an rpc to update it

#

ClientUpdateWorldTime and ServerRequestWorldTime

charred island
#

by not synced with the call?

nova wasp
#

the idea is once you have some example deltas you average them and then can get the local delta anywher, much like what you are doing now

#

it just uses rpcs to get new data

#

not for every time you ask it to get a time

charred island
#

right

#

i wouldn't think the clock would drift much though

#

probably be fine updating it every minute

nova wasp
#

yeah ideally it stays consistent but if it must be perfect you might be better off putting a timestamp in the actual rpc itself

#

a timestamp right in the rpc is how the character movement component works for example

#

this does increase the size of the rpc a fair bit but it's not enough to be an issue generally (a couple dozen extra bits won't hurt much)

charred island
nova wasp
#

you are in a safe space lol... I am very much okay with client auth

#

it's a wise decision for many many games

charred island
#

it works pretty well, just trying to figure out if i can improve it by taking a bit of the randomness out of it

nova wasp
#

I guess my question here would be if you need to compensate for this or if this second thing could also be client auth (might be complicated)

#

for example projectiles in unreal tournament are locally predicted partially (sometimes only visually)

charred island
#

if two ships start accelerating in the same direction with the same thrust, the client would fall behind on the server if you take the position verbatim.

instead, i calculate the delta in server time from when the RPC was created by the client, and when it is processed by the server, and extrapolate its position + velocity * delta.

#

but then this makes the client always be ahead

#

so i add a compensation constant (for now) that brings some of that back

nova wasp
#

if the compensation works well here then just tie it to the ping I guess (rtt delta, whatever)

#

make sure to consider if ping includes frametime as well

charred island
#

it works pretty well right now but starts going a little haywire at ultrahigh velocities

#

which i plan to solve in a separate way

nova wasp
#

well, you might want to cap it a bit

#

I'm not sure what the math looks like here

#

but if it's really simple you could consider doing fixed ticking and rollback stuff but it will be painful to do that in unreal without going all-in

#

or just separate resim per ship

#

to catch up and lerp the visual result a bit

charred island
#

i'm doing some crazy stuff with the physics system so i kind of need to home bake all my networking

nova wasp
#

how do you replicate their position to sim proxies?

charred island
#

i basically use an impulse to nudge ships towards their correct position