#multiplayer

1 messages · Page 212 of 1

twin vessel
#

If a player owns an actor, which has replicated variables with condition SkipOwner, and i locally modify the value of the variable, then call Rename on the actor to change the owner, will the player get the variables replicated to it instantly, or will it keep the local value till the server changes the variables again?

verbal ice
#

It will likely get the variable on the next change

chrome bay
#

Rename causes endless issues in Multiplayer. Should be avoided at all costs.

#

Rename changes the outer, not the owner

twin vessel
#

Oh.. what does the outer do?

chrome bay
#

They will receive the value if and only if the Server thinks the client has a different value.

#

Outer is for GC purposes. Unrelated to net Owner

twin vessel
#

What should i use for outer? Cause as of now i was using the player that has that actor attached to it, but if then i detach the actor to drop it, and the player leaves, then the outer is not there anymore right? And the actor would get deleted?

twin vessel
sonic obsidian
#

Im having jittering issues with physics replication what settings are you refering to?

chrome bay
#

Server keeps a history of what properties have been sent (and acked) by each connection. Presumably if you change the owner it will reset it, but I have no idea honestly. Would have to try it.

chrome bay
sonic obsidian
chrome bay
#

yerp

sonic obsidian
# chrome bay yerp

alright does unreal have interpolation for example when a client sim falls out of sync with the server or is it always a snap? ive tryed the new physics replication modes in 5.4 and they make 0 difference not sure if you need to do setup for that or not

chrome bay
#

It interpolates up to a point, but if they diverge too much it snaps. The idea is you need to tune the settings that fit your use case for interpolation. If you have really fast objects for instance, the thresholds probably need to be a lot looser

#

Also it assumes you are running the same sim with the same input on all ends

#

If you're not doing that you'll probably be more likely to snap

sonic obsidian
twin vessel
chrome bay
#

personally I spawn a new one

#

I don't use Lyra's garbage though

twin vessel
chrome bay
#

You can, I just hate their fragment system

#

"Yes please attach 100's of replicated UObjects to my character, thanks"

#

Enjoy scaling that up

twin vessel
#

😂 yeah i was trying to find an alternative to that too

#

Cause i like the modularity that concept offers, but yeah, feels wrong to use that many objects

torn zinc
#

Idk if this is multiplayer specific or not, it syncs up fine, but is this the wrong way of "shooting" something? Because the location of the object does not follow the location of the sphere i applied the impulse to.

distant mortar
#

Hi, isn't UCharacterMovement component from ACharacter, replicated by default? If so, what does this setting do if set to checked/true (picture)? By default, it's unchecked/false.

I tested it in two Clients and I can't seem to see a noticeable difference. I might be missing something or not know it's definite purpose/use cases.

Can anyone clarify the purpose of the setting? Thank you!

chrome bay
#

Pretty sure it's not replicated

torn zinc
digital marten
#

I'm currently looking at fast array serialisation/replication for replicating inventories.

It's mentioned that items can loose their order, but no conditions are mentioned in FastArraySerializer.h.

Will I need an index number so my arrays can be reordered to ensure they maintain their order, or is this only specific to something like adding/removing items?

I'd imagine if I have an inventory of 10 structs, and those structs change values, they shouldn't change order.

chrome bay
#

Order won't change randomly, but it isn't preserved when elements are added/removed etc.

digital marten
chrome bay
#

correct

#

It will locally, but not neccesarily at the receivers end

#

The point is you can't rely on order at all, so anything based on that would be fragile

digital marten
#

Also thinking, if arrays can have mismatching element order, are they still reliable?

Say I dirtied an add or removal and unreal skipped it, will it eventually get synced on the client?

I understand replicating movement because the value is always changing, if you skip, the newest state is still valid, and it's likely being changed every frame.

Whereas a fast array you have to dirty things manually, and it's not necessarily changing every frame.

digital marten
chrome bay
#

they're still reliable because the items are identified with an ID, which you inherit per item as part of FFastArraySerializerItem

#

Just make sure you don't invoke the copy/assign constructors, or you'll clear the replication ID of the item

#

You'll get a new one by marking it dirty, but it'll be considered a new item as far as rep is concerned

#

UE won't skip adds or removes the same way it doesn't skip changes to any other type of property

digital marten
#

I remember reading the part about IDs, didn't realise they're reliable. Useful to know 👍

chrome bay
#

all replication is reliable - you're just not garaunteed to receive every change

digital marten
#

@chrome bay Since I'm using list order for indexing into the inventory, would reorganising items based on an index in the individual elements client side be the correct way to synchronise the order when adding/removing elements?

Or is there another approach I should consider?

Personally I like the idea of sending index with the item inside the inventory because I can do .Sort() on void PreReplicatedRemove(const TArrayView<int32> RemovedIndices, int32 FinalSize); and void PostReplicatedAdd(const TArrayView<int32> AddedIndices, int32 FinalSize); clientside, allowing me to preserve the order, and with little overhead to bandwidth and computing.

My inventories should be a prefixed size 90% of the time, so it's unlikely someone will need to sort their inventory to fix the ordering. Since like you mentioned if it's a change to a prexisting element/index, then the order isn't altered.

shrewd ginkgo
#

I try to make spectate system. I found a video in yt but it doesnt work. what is problem can anybody help me?

lament flax
distant mortar
# chrome bay Pretty sure it's not replicated

Interesting, what does it do? I did compare with 2 clients both checked and unchecked, and their movement seems fine to one another. Any example scenarios where I must use checked/unchecked?

digital marten
# shrewd ginkgo I try to make spectate system. I found a video in yt but it doesnt work. what i...

Not sure what your issues are, but I noticed you're called spectate next on both left and right keypresses. Shouldn't one of them be spectate previous?

Also watch this video https://www.youtube.com/watch?v=HXCkOzkgamU it'll help make your code more readable because you'll be able to use the modulo (%) operator. The modulo operator is really nice for doing something like this ^. No need to check if you're out of bounds.

What are the Modulus/Modulo/% Nodes in Unreal Engine 4

Source Files: https://github.com/MWadstein/UnrealEngineProjects/tree/WTF-Examples
Note: You will need to be logged into your Epic approved GitHub account to access these examples files.

▶ Play video
shrewd ginkgo
lament flax
digital marten
distant mortar
chrome bay
#

you don't need to worry about them, they do nothing (in this case). Leave them off

lament flax
lament flax
shrewd ginkgo
#

when trying to watch the client, he starts to see through his own belly and cannot go back or watch someone else. if the server tries to watch, it sees from its own belly, sees upside down from someone else's point of view and finally returns to its own normal view

distant mortar
digital marten
lament flax
#

so each entry knows its index in the array

digital marten
# lament flax idk for sure, personally i store index in the entry

I wasn't doing that because I want O(1) access time instead of O(N). So I'm considering doing similar to that.

What I was suggesting is each entry has an index like you've done, but the index is not used for lookup, but is used to reorder the inventory client side if there is an addition/removal. This way I keep the O(1) lookup time. Only sorting on the list growing/shrinking client side should be possible since there are functions that I can use to detect this PreReplicatedRemove and PostReplicatedAdd.

My inventory system stores structs not pointers, and lets say some system requires checking an item in the inventory every tick/frame. I need O(1) access time, because O(N) would be too expensive every tick for 1 or more items in multiple player inventories.

lament flax
digital marten
# lament flax > some system requires checking an item in the inventory every tick/frame if yo...

I can't talk much about it because we'd be getting into NDA on what I'm working on. But it's not a design flaw. Inventories are a generic container systems used by other systems outside of just the players inventory.

This allows us to have a very simple gameplay item API that's the same for everything. Meaning you don't need to worry about item glitches like item duplication, and everything is automatically synced with the database in real-time.

lament flax
digital marten
lament flax
#

you welcome

#

i use delegates a lot so external systems can subscribe to inventory changes like item amounts

lament flax
#

so i can update what stuff is craftable and uncraftable base on what ingredietns you need

#

even if the server will check at the end

rain slate
#

Hey guys i started 2 days ago my first multiplayer project i'm still working on my fundamentals, I'm doing a mix of both cpp and blueprint, and i'm actually trying to do a lobby system, in my game instance i have a map to get all my player and the boolean if they are ready or not. In my game instance i also have a function who require a player controller and a boolean to change the readyStatus. Then in my player controller i have a simple logic when you press F you switch between ready and not ready, the problem is that from the client persepective they always are the player controller 0, so i don't know where i have to put that kind of "press f to get ready" stuff

Thank you !

pearl saddle
#

Got an issue when playing in standalone game, client joins host and there will be ridiculous latency. When removing client side functions like turning on flashlight (as an example) and only sending it to the server to send back to the clients to check the latency, it takes about 3 seconds if not more just for the flashlight to turn on.

The worst part is the entire game works around an ai monster that can chase players etc and on the client the monster is constantly rubberbanding and updates to positions take forever causing the game for the client to be almost unplayable.

I would like to blame it on my internet speed but I'm not so sure. Even trying a simple moveto node and testing it, the ai is constantly rubberbanding. I tried recording issues with network profiler but i'm not even sure how to read it properly tbh since there doesn't seem anything wrong

#

Server:

#

Client:

#

ai is unplayable in standalone for clients the latency is just so high

shrewd ginkgo
#

I tried to make a spectate system but there are a lot of problems. the first problem is that when I change the camera, I see upside down and I don't see it from the camera that the other player is looking at. the second problem is on the client side, when the client tries to change the person they spectate, it affects the server, not the client.

pearl saddle
#

Ur running that information on the server only

shrewd ginkgo
#

thats ok I dont know replication much but why I see upside down and I don't see it from the camera that the other player is looking at

pearl saddle
#

You only need to do that information on the client anyway spectating should only affect that client

#

Does your character have a camera that is facing the correct way and are you setting the view blend to that character

#

And where are you getting the player alive value from is that from the game mode?

pearl saddle
#

Your camera is upside down

shrewd ginkgo
#

the character I use myself sees it properly but ?

pearl saddle
#

Yeah but view blend will take that cameras current rotation values so the player will see it upside down

shrewd ginkgo
#

ok that fixed

#

ty

#

so how can I stop the camera from shaking, the camera I use is stable while the other one shakes wildly

crisp shard
rain slate
#

Am i using the run on server correctly ? i'm new to multiplayer and i'm using this blueprint in my player controller. Set player ready Status is a c++ functional that add to my array( Player controller , boolean ) which player controller and if he's ready or no

dark edge
#

just have the client say if they're ready or not (pass a bool over)

rain slate
#

But when i'm testing the server doesn't receive anything

dark edge
#

game instance is local only

#

player ready status should be a property of PlayerState if it's meant to be public (it's a part of the State of a Player)

rain slate
#

Well my first thought was that i wanted to keep the array of player during the whole game, i mean even after they get back to lobby

dark edge
#

the playercontrollers will get nuked and remade anyway

#

so the references will be invalid

rain slate
#

So only the host has access to game instance ?

dark edge
#

Everyone has access to THEIR OWN

#

and that's it

rain slate
#

Oooh

dark edge
#

GameInstance is private to each machine, it's not on here because it doesn't have anything to do with networking

rain slate
#

So how i'm suppose to collect all their ready status ?

dark edge
rain slate
#

I mean can i check this in the game mode by getting the info in their player state ?

dark edge
#

yes

#

Don't worry about travelling back to lobby now, learn to walk before you try running

rain slate
#

but in practice how can gamemode retrieve this information for the moment I just used the onpostlogin, I am still stuck on creating the lobby ^^

dark edge
#

repnotify is your friend

#

Gamemode should check if the game is ready to start every time a playerstates ready bool changes

rain slate
#

oh perfect I had started to read something about this, so I will dig into it thank you very much

thin stratus
#

That doesn't need RepNotify though

#

That just needs a proper Setter that is Auth Only and tells the GameMode.

#

Or even better, have a Delegate/EventDispatcher the GameMode can bind to

kindred widget
#

Easier to show in UI with a repnotify though.

strong junco
#

Can anyone spot what I am doing wrong with this fast array? I have been mulling over this for two days and I can't figure it out
Adding to it works as expected, but I can only remove items if there is one item in the array. If there are more then they correctly get removed on the server but only the first remove is successful on the client.
I have figured out that on the client in FastArraySerializer.h the ItemMap which contains the ReplicationId -> array index mapping can not be built because none of the array Items have a ReplicationId set. So the ItemMap is valid as long as you add things, but becomes invalid as soon as you remove one thing. This is happening in the function void FFastArraySerializer::TFastArraySerializeHelper<Type, SerializerType>::ConditionalRebuildItemMap()

strong junco
# strong junco Can anyone spot what I am doing wrong with this fast array? I have been mulling ...

USTRUCT()
struct FFastArrayItem : public FFastArraySerializerItem
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY()
    int32 Id = -1;
    UPROPERTY()
    UMyDataAsset* DataAsset = nullptr;

    FFastArrayItem() {}
    FFastArrayItem(const int32 InId, UMyDataAsset* InDataAsset)
        : Id(InId), DataAsset(InDataAsset) {}
    
    bool NetSerialize(FArchive& Ar, UPackageMap* Map, bool& bOutSuccess)
    {
        Ar << Id;
        Ar << DataAsset;

        return bOutSuccess;
    }
};

template<>
struct TStructOpsTypeTraits<FFastArrayItem> : public TStructOpsTypeTraitsBase2<FFastArrayItem>
{
    enum
    {
        WithNetSerializer = true,
    };
};

USTRUCT()
struct FFastArray : public FFastArraySerializer
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY()
    TArray<FFastArrayItem> FastArrayItems;

    void AddAndMarkDirty(FFastArrayItem& FastArrayItem)
    {
        FastArrayItems.Add(FastArrayItem);
        MarkItemDirty(FastArrayItem);
    }

    void RemoveAndMarkDirty(int32 Id)
    {
        for (int32 i = 0; i < FastArrayItems.Num(); i++)
        {
            if (FastArrayItems[i].Id == Id)
            {
                FastArrayItems.RemoveAt(i);
                MarkArrayDirty();
                break;
            }
        }
    }

    bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms)
    {
        return FastArrayDeltaSerialize<FFastArray, FFastArrayItem>(FastArrayItems, DeltaParms, *this);
    }
}

template<>
struct TStructOpsTypeTraits<FFastArray> : public TStructOpsTypeTraitsBase2<FFastArray>
{
    enum
    {
        WithNetDeltaSerializer = true,
    };
};```
twin vessel
#

I've seen people saying that if you have a replicated array of fixed size it is better to use standard array instead of FastArray. Is this true? If so, why?

strong junco
lament flax
#

so truly know whats the best for you you should profile it

strong junco
#

I was under the assumption that standard arrays replicated the whole array each time. So if you only change the value at an already existing index then only that value gets replicated and not the whole array?

pearl saddle
#

can anyone think of any reasons why server latency is extremely high, i mean from 3-10 seconds long between sending to server and client recieving?

#

It cant just be my bad network

#

I heard something about differences in client and server framerate but idk

#

ai on the client is unplayable with the amount of rubberbanding

#

It's just painful because ai is run on server only with character movement obviously doing the replication and so theres nothing i can do code wise to fix this issue

thin stratus
#

Might be a Reliable RPC on Tick somewhere.

lament flax
pearl saddle
#

or rpcs that run on functions that tick

pearl saddle
#

so basically build in editor

lament flax
#

You should have 0 ping

pearl saddle
#

thought that was only PIE

lament flax
#

Isnt standalone without a server ?

pearl saddle
#

you can run three players

#

and two of them wont work with steam so i've just used those ones

lament flax
#

You can run with any player amount in any modes

lament flax
pearl saddle
#

yueah

#

so first standalone wont work

lament flax
#

Then you got steam latency

#

But it shouldnt be that long

pearl saddle
#

its extremely long i used network profile

#

lemme get it up

#

for the client

lament flax
#

Looks like you are sending a lot of move and camera rpcs

#

Do you now why you are for the camera ?

pearl saddle
#

Thought that was just unreals built in rpcs

#

dont have any rpcs ive made with those names

molten parcel
#

quick question, unreal can natively host only one world at a time right?
so if you want to have players be in 2 diferent worlds it's not possible without using some plugin?
so what if you made a super level that basically holds the 2 worlds together and now the 2 players can be in different places?
one player leaves one world and goes to another what will happen is, the previous world unloads and async load another level into the superlevel

quiet yarrow
#

Does anyone know why my characters limbs that are physically simulated (ragdolling) dont replicate?

fossil spoke
quiet yarrow
#

yes not 1:1, but they are frozen

dusky yarrow
#

hi! so i have a weapon actor that i want to set the owner of via a server rpc from the character. things work just fine except that the clients do receive the change? at least, the OnRep function doesnt get called. any ideas?

#

btw i didnt use netMulticast, i figured the server should update the owner variable eventually

#

yep

#

oh i know of that limition/design choice

#

but the thing is the OnRep isnt getting called on the clients

#

im so stupid i was copy-pasting my code and i found the issue. i forgot to mark one of the function as a server rpc lmao

#

thanks a lot dude!

keen adder
#

Is it possible to replicate uobject or aactor references?

#

Like I create a replicated actor and want to assign it to nearby players via repvar

#

same way you'd assign their name or whatever

verbal ice
#

Yes

#

As long as the UObject or Actor is replicated

#

Or has a stable name (loaded from the map, asset on the disk, etc)

keen adder
#

wow fak, that's so awesome

keen adder
#

Basically as long as it's relevant to clients? Like not trying to RPC some local object?

sullen sail
#

when playing a montage on an interrupted autonomous proxy, breaking free from the animation works locally, but on the server and simulated proxy side, the animation continues to play to the end. So its like the server is holding back the autonomous player movementHow can I ensure the animation also stops on the server and simulated proxy side?

sullen sail
#

Basically, the OnInterrupted event is not replicated. Where it allows the character to move again

verbal ice
#

A replicated actor spawned on the server will be sent to the client, so you can reference it

keen adder
verbal ice
#

You can reference it after spawning

#

If the client receives a replicated reference without having the object on their end, the reference will be null until that object is resolved

#

You can get race conditions that way, so you gotta handle it in your code (object replicates before the reference, or the reference replicates before the object)

keen adder
#

Ah shit, so there's no order of operations here? I hoped clients would receive data in the order it was sent

#

Otherwise if they try to handle the repvar on a null object -- there's really no other event for when the object is initialized.. just need to like, run an obscure timer or something.

verbal ice
#

No guarantee no

#

Iris might provide that potentially, not certain, does ring a bell, but otherwise nop

verbal ice
#

It's called on clients when they are spawned from replication

keen adder
#

😐

#

It's also called before they're net-ready

verbal ice
#

wdym?

keen adder
#

so IsAuthority, IsLocalPlayer, etc is all broken in BeginPlay lol

verbal ice
#

Not at all no

#

Authority definitely works

keen adder
#

Oh well maybe just on connecting players then

#

I had to implement some new events and wang jangy workarounds for that lol

#

Anyway cool, all very good info, thanks man

#

I'm working on online turn based combat, where different people can be in their own turn based battle. So it's super helpful to be able to set which players are part of which battle via actor references

lusty kelp
#

but to be honest my question is i changed my ip so does this mean ive open ports somehow?

#

i know it late but jeez

upbeat basin
#

https://pastebin.com/jM5yQTQX
I've started to get this network error for my clients after apparently successfully seamless travelling to the game map from main menu to lose connection with host immediately. Is there any information here that hints what's wrong from my side?

manic lichen
#

Hi, i have a question about spawning actors:

I have a server function that spawns an actor
AWeaponActor* NewActor = GetWorld()->SpawnActor<AWeaponActor>(ActorToSpawn, AttachTransform);

Now after spawning i would like to call a multicast with the actor reference, so that clients can do some additional setup.
Multicast_EquipWeapon(NewActor);

The reference is NULL on clients though, probably because the actor hasn't replicated yet.

That leads me to my question: What is the preferred way to handle this scenario?

upbeat basin
hoary sandal
#

Heya guys has anyone tried adding VOIP on the steam advanced session plugins

lost inlet
#

?

#

unreal connections aren't HTTP

latent heart
#

Just any random joe with the IP address of a server can join it?
Correct. It's the job of the game to reject their join attempt. And encrypt anything they wish to. Or the job of the network manager to prevent them having access in the first place.

#

If you want to produce some kind of secret key for joining that they need to supply by logging into a https service before that... that would work.

shrewd ginkgo
#

I try to make a spectator system but I cant replicate it correctly

#

what I need to do

queen escarp
#

hey this is run on the listen server

#

it dosent work the "set defiler server" is not run :;/ ?

#

its being called but its not runnint the "SetDefiler_Server" event

lament flax
# queen escarp

could you explain better ?
so you are calling Defiller event first, did you put a breakpoint on the branch to see if its called ?

#

also, what class is this ?

queen escarp
#

it is being called

#

its in a actor component

lament flax
#

okay

#

is it replicated ?

queen escarp
#

yeah

lament flax
#

and what is the owner actor ?

queen escarp
#

the player character

#

that checks out

#

prints correct

lament flax
#

then the RPC should work

queen escarp
#

yeah but its not running the "setDefiler_Server" event

lament flax
#

did you put a breakpoint on the output of the Set Defiler Server ?

queen escarp
#

its not even reaching the rpc party

lament flax
#

party ?

queen escarp
#

part*

lament flax
#

is the bool Defiler true ?

queen escarp
#

nope

lament flax
#

because you are only calling the RPC if its false here

queen escarp
#

yeah i know like whatch this

lament flax
#

so run 1 is called ?

#

but not run 2

queen escarp
#

exactly just tested again

#

run 1 being called

#

not run 2

#

and the "Defiler_Event" is called from a parent class

#

or no not even that

#

(client) attacks (listenserver) then the client runs the event on the (listenserver)

lament flax
#

well server RPC can only be called if you are on server OR if you are on client side you need a owning connection, the controller, player state and any pawn controlled by the player controller have a owning connection

queen escarp
#

yeah i know all that should check out

#

im really in a awe i dont know whats going on

lament flax
#

im sorry idk what could be the issue like that

queen escarp
#

hmm

#

ok so using the keybind works flawlessly

#

so it must be how the defiler_Event is being called

#

player character (client) casts to (listen server then calls the function on that owning client)

#

to narrow it down i guess

crisp shard
#

if set an actor to intial dormancy, how come all the logic on the bp still works ?

#

am i not understanding dormancy ?

subtle kernel
#

guys, I have multiplayer game. With dedicated server.

In production for every level I will have different servers, so my server won't ever travel from level to level.

But during the development, it could be kind of convenient to test client code performing travel on server.

But I'm not sure it's anywhere near with what I will be using in production.

Maybe the best idea would still be testing it with real server processes and client process?

chrome bay
#

It's a memory/CPU saving for actors which change very, very infrequently - or perhaps never

crisp shard
#

i was thinking to then wake them up anytime a player interacts but you're suggesting that it does that automatically?

chrome bay
#

would still be destroyed IIRC

#

In Blueprint it does yeah

#

In C++ you might have to explicitly wake it

#

They won't go back to dormant unless you set them back though

crisp shard
#

ok dope ty

shadow aurora
#

Hey guys need some input here... Out of nowhere some of our gameplay tags appear to have different net indices on the server and client. As a result behaviors are getting swapped/offset when tags are replicated down because they're getting mapped to the wrong tags. Anyone run into this before or have any suggestions about what I might be able to do to remedy the problem?

indigo brook
#

Quick question: GameState variables, do I need to set them to replicate or does the Game State auto replicate variables within?

quasi tide
#

You need to set them to replicate.

#

It's an actor like any other.

mental crow
#

Hey. What is the correct way to check if Character is a Player (either local or remote) and not an AI character?
My idea was to see if I would be able to cast its controller to player controller - but in multiplayer this will not always be correct I believe as there would be player controller only for my Character and not for other simulated characters.
What do you think? Maybe I should also add a HasAuthority() check to only check on characters on the server?

chrome bay
#

Check if they have a player state. If they do, check bIsBot is false

#

If you're doing this on the Server you can check player controllers no problem

mental crow
#

Thank you very much

rain slate
#

Hey guys i'm doing something wrong but i still don't know what, i'm working on a lobby with a ready status, when all my player controller are ready i want to start the game here are my "core function" The first one is in my playerstate, i call this function in my player controller in blueprint when i press F, the second one is mostly for understanding what's happening and the last one is to check if everyone is ready and can start the game. I'm still struggling and learning a lot in both c++ and multiplayer

cobalt notch
bitter robin
rain slate
#

@bitter robin I don't know if it's really replicated but at least that's what i'm trying, i readed some stuff about rep notify and that's what i'm currently trying

bitter robin
rain slate
#

@bitter robin Oh yeah my bad i forgot to screen that one aswell

#

Oh btw i'm using my player controller in blueprint can this cause issues ?

bitter robin
#

What about when you press F to ready up? when the client presses it it needs to go to the server before you do your SetReadyStatus. Do you have a server RPC there?

rain slate
#

That's what happens when i press F to ready up, i'm changing my ready up value in my player state, and then i suppose that my gamemode must be called to check if everyplayer are ready up aswell

bitter robin
#

Yes, it looks like it should work so far. What exactly is failing?

rain slate
#

@bitter robin Tbh i don't know my logs aren't even triggered, so it's kinda hard to know where's the problem

bitter robin
#

wait, this press F thing, in what actor are you calling that?

#

what is self?

rain slate
#

Player controller

#

I'm doing the press F in the Player controller itself

bitter robin
#

That should be fine then

#

ohh

#

the set

#

remove it lol

#

SetReadyStatus checks if the status changed, but you just set it to what it will be

rain slate
#

Oh ok !

#

Thank you for help, i was kinda affraid that my structure was complete shit, that i had to reconstruct all my system because that's a lot of new small thing to take in consideration in multiplayer but i must be able to investigate by myself for now ! Have a good day ! 🙂

grim rain
#

Hi im trying to allow players to carry each other using attachment system. It works perfectly on server but only works sometimes on client. How do i fix this?

keen adder
#

Heyas, I thought Actors and UObject references could be replicated

#

However the OnReps for a replicated actor are never called?

haughty ingot
#

You mean you have a replicated AActor variable that's marked as RepNotify?

keen adder
#

Yes

haughty ingot
#

Where is the variable?

keen adder
#

A replicated actor is spawned, and I try to multicast or repnotify it to other actors

#

Oh hmm, I wonder if it hasn't spawned/replicated on the clients end yet?

haughty ingot
#

Yup

keen adder
#

So im passing the reference when it doesn't even exist for clients

#

Oh boy

haughty ingot
#

Just have the clients set the variable themselves when they've gotten the spawned actor.

keen adder
#

How would they know what to set, or when? lo

haughty ingot
#

Wdym

shrewd ginkgo
#

I try to make a spectator system but I cant replicate it correctly

#

what I need to do

keen adder
#

I'm doing combat like Baulders gate, where multiple combats can be going at once

#

I create the combat actor, and try to apply it to the players involved in the combat

#

However it hasn't yet replicated to them

#

So, how would they magically know which combat actor to take, when to take it, etc.

haughty ingot
#

However you decide to set it up, not quite sure what you're asking

#

It's a design choice, really. You know the issue

#

Up to you how you want to solve it, it's too hard to give design/system advice from the outside

keen adder
#

It's like, I sent my friend an email, but he never received it

#

How does my friend magically know that I was trying to send him an email

#

and which email to look for

#

since.. he didn't receive it lol

#

I just wonder if unreal has something in place for this as it seems like a common issue

thin stratus
#

The OnRep for that actor should handle this though

keen adder
#

before I go reinventing the wheel

thin stratus
#

It should eventually call with a valid reference

#

Also UObject don't replicate by default, just fyi

keen adder
#

Nope.
Spawn actor -> Set nearby players to onRep that actor -> it never gets called for them

thin stratus
haughty ingot
#

There's another issue if the OnRep isn't being called ever

keen adder
#

I imagined unreal would queue up the onrep, and call it when the actor is ready

haughty ingot
#

The OnRep doesn't care what type it is, only the delta during the property comparison

thin stratus
keen adder
#

Right, so I wonder if the actor has some property like "IsNetReady()" or something, when it's spawned for everone

#

But anyone there's no helpful design advice here?

thin stratus
#

I mean, SpawnActor -> SetOnRep should be enough

#

This has nothing to do with a design advice

haughty ingot
#

Can you just post the relevant code?

thin stratus
#

A replicated Actor spawned by the Server will replicate to Clients.
Setting the RepNotify Pointer to said Actor, given the Pointer is inside something that is also replicated, should just work

#

If that doesn't work then there might be something wrong in your setup.
There was never a need to manually handle this

keen adder
#

Called on Server:

ACombatScene CombatScene = ACombatScene::Spawn();
CombatScene.InitCombat(triggeringPlayer);```
Then inside ACombatScene:
```c++
void InitCombat(AUnit triggeringPlayer){
        triggeringPlayer.CombatScene = this;

Then inside the AUnit (player pawn):

(Replicated, ReplicatedUsing = OnRep_CombatScene)
ACombatScene CombatScene;

UFUNCTION() void OnRep_CombatScene(){
    Print(f"OnRep_CombatScene {Unit}");
}
haughty ingot
#

Oh

#

Remove Replicated

#

You don't need both.

haughty ingot
#

It's taking over the ReplicatedUsing

thin stratus
#

That's pseudocode or?

keen adder
#

Oh sorry this is in Angelscript not C++, all actors are automatically pointers and stuff

haughty ingot
#

Oh

#

I know nothing about Angelscript, so I'm out

keen adder
#

It just takes care of some annoyances but runs the same as C++ (multiple big games have shipped with it)

haughty ingot
#

But I'd bet you don't need Replicated and ReplicatedUsing in angel script either lmao

lament flax
#

UPROPERTY(Replicated, ReplicatedUsing = OnRep_CombatScene) you only need one

thin stratus
#

Yeah only ReplicatedUsing is needed

#

And AngleScript can totally be at fault here btw

#

If you use a custom Engine with AngleScript you gotta be open to acknowledge that it's bugged.

haughty ingot
#

Does Angelscript actually help people that much?

keen adder
#

YES

thin stratus
#

Maybe. It adds a scripting langauge inbetween C++ and BP

haughty ingot
#

UE C++ is already basically a scripting language on it's own lmao

#

But hey, if it helps.

thin stratus
#

It's a nice thing to have. We also have C# support by now, which doesn't need a custom Engine.

keen adder
haughty ingot
#

I have a C# scripting engine in my engine, but honestly I've debated removing it anyway (offtopic)

#

That's why showing code when asking for help is super important

thin stratus
lament flax
haughty ingot
#

But BP doesn't?

lament flax
#

or some people

haughty ingot
#

Idk, not my cup of tea

lament flax
keen adder
lament flax
#

apparently very close to C++

keen adder
#

I tried just multicasting and get this

thin stratus
#

Multicasting is not OnRep

keen adder
#

No matter what, the client doesn't receive the actor 😐

#

So yeah i think it's just not ready yet. Gonna add in some arbitrary delay timer

haughty ingot
#

Huh

#

Are you using an OnRep or a multicast?

thin stratus
haughty ingot
thin stratus
thin stratus
#

Anyway, can't really help beyond stating that it should just work.

haughty ingot
#

I'm just confused, you have an OnRep, but then you said multicast?

thin stratus
#

They are trying both I guess

keen adder
#

I'm just testing different things

haughty ingot
#

Ah

keen adder
#

Even after a 1 second delay, multicast sends over nullptr

#

Now, are we 100% sure you can send actor references?

thin stratus
#

Then it's clearly a problem with your setup though :D

haughty ingot
#

Yes lol

#

Is the actor replicated?

keen adder
#

OH, yeah maybe it's an issue with how angelscript automatically handles the references

thin stratus
#

Are you sure the Actor is set to replicated?

#

Do you see the Actor on the Clients?

haughty ingot
#

UObject pointers build FNetGUID to be referencable between instances, if they're replicated properly it will work

keen adder
haughty ingot
#

Beyond that, probably some obscure AngelScript stuff I don't know anything about

keen adder
#

Right on, I'll go ask in there

keen adder
haughty ingot
#

No, you don't need to. It's handled internally

thin stratus
#

That's already what's happening

#

What else would be sent, the Memory Address? The whole data of the actor? :D

haughty ingot
#

You can't ACTUALLY replicate pointers.

#

Unreal just internally handles the pointer as a FNetGUID

#

Try sending a int32 pointer through an RPC and watch UHT yell at you

keen adder
#

lol

#

im trying some random shit and already getting yelled at 🥲

haughty ingot
#

Only time it won't be built I think is if the object is stably named, (I think it doesn't build the FNetGUID?) But I can't remember, it still might

#

But not important, and getting into bike-shedding anyway

keen adder
#

Aighty, well thank you so much for the info guys

#

I think you're right here and the problem lies within angelscript

#

To the angelscript discord I go!

lament flax
haughty ingot
#

Or learn C++ 😛

keen adder
keen adder
lament flax
#

i cant guess that xD

haughty ingot
#

Clearly not, because you're getting a UHT error

lament flax
#

whats the error ?

keen adder
#

Sorry, I know C++, just not Unreal C++ 😛

quasi tide
keen adder
#

@haughty ingot @thin stratus
Found the solution!

  • I was spawning the CombatActor class directly and the actor itself actually wasn't replicating.
  • So I simply turned it into a blueprint (without changing anything) and spawned that instead. Boom all problems solved.
#

Didn't realize turning a class into a blueprint made that much of a difference if nothing needed to be changed. But unreal gonna be unreallin'

haughty ingot
#

If you changed bReplicates to true in the constructor it wouldn't matter if it was a BP class or not, so probably AngelScript related

quasi tide
#

Still shouldn't be AS related. Just needs to flip that flag on the AS side as well

keen adder
#

Yes, all unreal issues must be angelscript related. All hail the engine with no bugs! 😛

lusty kelp
#

so nobody answer my question and took down the comment perhaps

#

anyways my question is simple does changing ip and if you are online, means u open ports?

#

wow just wow, nobody in this server can answer a question like this? i am saying if u are on your game while ur ip change, ddoes it means u open ports or ?

quasi tide
#

Dang - 3 minutes is too long for you?

#

Immediately rule out anyone because everyone who is in the server isn't paying attention to you right at this moment?

lusty kelp
#

what i am not, u the one wasting typing

quasi tide
#

You asked a question - waited 3 minutes and then said "nobody in this server can answer a question like this"

lusty kelp
#

i ask last night

quasi tide
#

IP address and ports are not the same thing.

#

So no, changing your IP address doesn't mean you open ports

lusty kelp
#

okay but in reality the other client can join like across the globe?

quasi tide
quasi tide
lusty kelp
#

ah okay thanks @quasi tide

meager spade
#

@lusty kelp people here volunteer to help. They are not obliged to help or respond. Everyone who helps here does so voluntarily. Please have some respect.

shadow aurora
#

Hey guys need some input here... Out of

thin stratus
meager spade
#

Yeah nor have I ever had that issue unless the child BP had changed that property itself

keen adder
#

Yeah very strange, the BP looked fine with the bool already set. 🤷‍♂️

#

It's also possible I spawned it incorrectly at first, but then correctly when using the subclass -- I would imagine the problem is most likely my fault in some way rather than AS lol (I trust the creators of AS way more than myself)

meager spade
#

Or angelscript has bugs?

keen adder
#

I really don't think so for obvious stuff like that. Most likely I was just using it wrong

amber vale
#

Hey, is there a way to start PIE as a spectator, to playtest and debug your spectator pawn?

amber vale
#

I think that just puts you back into editor controls, it doesn't actually make the player a spectator

lost inlet
#

make a cheat or something to make you a spectator?

amber vale
#

Yeah I was hoping I wouldn't have to do that lol

#

I'd just be surprised if Unreal went through the trouble of creating a built-in spectator system, but wouldn't include any tools for actually using it

fallen fossil
#

Destroying actor on server side will be repliaced right? or I have to do RPC?

amber vale
#

If it's a client-side actor, it won't be

fallen fossil
#

yes it is rep, thanks

twin juniper
#

This is currently an issue for me that has been going on for quite few days and I was wondering if you would know what to do:
I'm doing SetOwner(PC) on a newly created actor on the server. The Owner updates on the server but not on the client which is the goal of SetOwner...

The warning that I get each time I try calling a Server RPC after I've done SetOwner(PC):
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_WeaponActor_C_0. Function ServerAddComponent will not be processed.

verbal ice
#

Is the actor replicated

twin juniper
#

it is

verbal ice
#

Can you send code

twin juniper
#

of what exactly?

verbal ice
#

SetOwner/Where you call the RPC

twin juniper
#
FActorSpawnParameters ActorSpawnParams;
ActorType* WeaponActor = GetWorld()->SpawnActor<ActorType>(WeaponClass, ActorSpawnParams);

if (IsValid(WeaponActor))
{
    FAttachmentTransformRules TransformParams(EAttachmentRule::SnapToTarget, false);
    WeaponActor->AttachToComponent(..., TransformParams);
    
    WeaponActor->SetOwner(GetController());
}
verbal ice
#

Can you check GetOwner() after you call SetOwner

#

See if there was a controller at the time

twin juniper
#

it's good on the server, not the client so it prints a valid name

verbal ice
#

Are you 100% sure it's replicated?

twin juniper
twin juniper
verbal ice
#

Do you have multiple clients @twin juniper

verbal ice
#

Are you sure you're calling the RPC with the right owner?

#

Keep in mind player controllers only exist for their owning client and the server

#

Other clients will not have the player controller @twin juniper

#

This would lead to the owner being null on some clients

twin juniper
#

GetController in the PlayerCharacter works fine because the corresponding PlayerController owns that actor...

verbal ice
#

On the server yes

#

But you're calling the RPC on the client right?

twin juniper
twin juniper
verbal ice
#

Do you have bUseOwnerRelevancy enabled

midnight palm
#

Hi

verbal ice
#

Nvm actually

twin juniper
verbal ice
#

Wouldnt affect that

midnight palm
#

does somone already saw this error ?

verbal ice
midnight palm
#

Thanks

twin juniper
#

let me know if you get something out of my problem

keen adder
#

Question: If I call a Client RPC, does it automatically call on the owning actor?

#

Or do I need to specify which client gets it?

#

Ex: I need to run some code locally on a player, is it enough to just do player.clientRpc()?

#

or do I need to pass in it's player id

keen adder
#

Sweet

#

So easy to use, love it

twin juniper
#

Any multiplayer expert that I could talk with? I'm stuck on a problem

fossil spoke
twin juniper
#

This is currently an issue for me that has been going on for quite few days and I was wondering if you would know what to do:
I'm doing SetOwner(PC) on a newly created actor on the server. The Owner updates on the server but not on the client which is the goal of SetOwner... The Actor is also replicated.

The warning that I get each time I try calling a Server RPC after I've done SetOwner(PC):
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_WeaponActor_C_0. Function ServerAddComponent will not be processed.

sinful tree
twin juniper
#

reference is indeed valid and for the player controller, I'm doing GetController() on the server which should be ok, is that correct since this code happens inside of my player character? (which is why I'm confused)

twin juniper
#

2 of error that I just found:

  1. I forgot to call the Super function for GetLifetimeReplicatedProps 💀
  2. Error from not initializing a custom struct correctly (yes they must be sometimes)
#

THAT WAS IT, thx 🥳

lament flax
#

Is it possible to have a replicated TArray of instanced struct, but for each struct type i can decide if it can replicate ?

sharp hamlet
#

Hi, anyone has any tutorials/documentation of how to end a GameLift GameSession using an API from UE?

nova wasp
#

just having two different arrays is vastly easier

lament flax
#

I wanted to have a single array, with stuff server only and other replicated

nova wasp
#

you can do things like COND_SimulatedOnly to only send one to other players that see it as a sim proxy

#

Making it server only just means it's not replicated at all 😛

#

you could wrap them behind some other function that makes the elements generic, so that it doesn't need to know which of the two arrays it got the elements from etc

#

If you want to send things to ONLY one player I personally recommend just slapping it on their player controller (or a component owned by the player controller)

#

as the player controller is just between your local machine and the authority

#

you do not see other player's controllers

lament flax
#

Its not a per player thing

#

Its just that some data holded by the item is only used on server, so it seems like a waste to rep it

nova wasp
#

you can actually mark uproperties of a ustruct as not replicated with UPROPERTY(NotReplicated)

#

if it's inside of a ustruct and a uproperty (that is being replicated somehow)

lament flax
#

I guess i can do that

nova wasp
#

you probably don't need to do that here, just an FYI

lament flax
#

But i will have empty structs

#

I guess i can figure this out when profiling, its just an idea for now

nova wasp
#

Having an empty field on the client is fine... I'm not sure you can easily remove it from client machine builds unless it's a dedicated server thing

#

could just add an ensure if you mistakenly try to get it on not authority

#

check(HasAuthority())

haughty ingot
torpid crest
#

Hey guys,

is there anything special about welding two actors together in multiplayer?
I've done it on server but client doesn't follow socket position for welded item :/

So I have different Z transform between client and server

blazing bear
upbeat basin
torpid crest
#

ArrowRef is just reference to actor which is spawned and that actor is set to replicate

#

I can see it flying using projectile movement on both server and client, but end point is different on both because start point is different

keen adder
#

So.. is OnRep called when setting the var to null?

#

I'm onRepping an actor which works fine when setting the actor var

#

but setting it to null later does not call the rep

lost inlet
#

yes unless the client's value is also null

#

REPNOTIFY_Always will make it so that it'll get called even if the client's value matches

keen adder
#

That's what I expected

#

But not what's happening lol, im preparing a screenshot

lost inlet
#

does the actor get destroyed at the same time it gets nulled on the server?

keen adder
#

Nope! I actually disabled the actor destroy

#

OnRep calls normally when combat starts, but not when it ends

#

So only the server runs the Endcombat_Local code

#

I've got this print in Tick for the client, and Combatscene is always set

lost inlet
#

oh this is the angelscript fork

#

so who knows

keen adder
#

lol

#

There's nothing wrong with angelscript man, I am the problem here 😛

#

I just noticed the server var is also still set despite nulling it

#

So probably setting it back again somewhere

spark otter
#

Hi 🙂 I've made a very simple ball move around as a pawn, but when I play in PIE as a listen server the movement is not replicated, even though replicate movement is turned on in the class defaults. Any idea why this could be?

keen adder
#

Are you using ACharacterContoller?

#

or your own movement for the pawn?

spark otter
#

my own movement

keen adder
#

Well

#

Online movement requires all sorts of predictions/rollbacks/handeling packetloss/latency issues, authoritation, etc. It's a mess if you're not a pro at this stuff

#

CharacterController has some of it built in, but I hear it's still a mess in real world scenarios

#

SO

#

Just get this and skip all the headaches lol

spark otter
#

Gotcha :p thanks!

unkempt tiger
#

Does the '_C' suffix in 'A_MyActor_C' instances mean it's a client's simulated proxy instance?

lost inlet
#

no

unkempt tiger
#

Hm, any idea what the _C is for then?

#

Some default object or skeleton of sorts?

lost inlet
#

class

#

for a blueprint, in a package you have the UBlueprint and the UBlueprintGeneratedClass

#

the _C is the latter

unkempt tiger
#

ah, interesting

#

for some reason, a bunch of _C instances get deleted for the client when the client enters spectating mode

#

which is quite confusing to say the least

#

thanks for help 👍

midnight palm
#

Question: The clients, when they start the application, load the "client" map, which is actually an empty level. Once they connect to the server, does that mean that clients are streaming the map (serverDefaultMap) from the server or does that mean that they are loading the map from the actual device they are installed on ?

keen adder
#

@lost inlet I figured it out.. Like BauldersGate3, when another client goes near an active combat, they enter the combat fight.

So when my combat ended, the players were already in the fight zone and thus immediately re-entered combat lol

#

See, angelscript can be trusted, I cannot 😛

spark otter
#

Sorry for the ping @keen adder , installed the plugin and added the component, but doesn't seem to be replicating still sadly :/

keen adder
#

check their vid, it says to uncheck "replicate moves" on the pawn

#

and there's a bunch of stuff you can enable/disaable

#

im guessing physics has some diff checkboxes to use

#

I just dropped mine on the character and it worked 100% out of the box

spark otter
#

All good, cheers

verbal heart
#

In the PostLogin function (abbreviated), I am expecting the following code to make the spawned actor an AutonomousProxy however it is a SimulatedProxy. Is this the correct behavior? DedicatedServer/Client mode. Playing with 1 client in PIE.

FActorSpawnParameters SpawnParams;
SpawnParams.Owner = NewPlayer;
                
FTransform SpawnTransform;
SpawnTransform.SetLocation(NewVillageLocation);
GetWorld()->SpawnActor<ANordicVillageBase>(VillageClass, SpawnTransform, SpawnParams


// On client 
GEngine->AddOnScreenDebugMessage(-1, 50.f, FColor::Cyan, 
FString::Printf(TEXT("Owner: %s, Actor %s | NetMode: %d | Role: %s"), 
*VillageOwner->PlayerState.GetName(), *GetName(), NetMode, *ThisRole));
#

I guess what I'm asking is if an actor is spawned with an owner of a PC, should it be autonomous or simulated ?

#

Reliable just means TCP so it will resend if the packet gets dropped, and will wait for an ack confirming it was received.

#

Unreliable is UDP and is best effort, if the packet gets lost it will not resend

#

TCP has higher overhead so don't do it in a tick. Use it sparingly.

#

Depends how often it is changing and your replication settings on the actor, and server tick rate. I don't know but I would guess probably unreliable multicast.

#

stat net

wet nymph
#

When I set a struct to replicate and I change one property of the struct, does it send the entire struct over the network or just the changes?

errant charm
#

Hey everyone, I'm having some trouble and could use some help.

I have an Interactable Actor variable on my first-person character. However, when the client sets the variable and tries to interact with it, the variable comes back as invalid.

Does the server override or change the variable in this case?

grim rain
#

Hi im trying to allow players to carry each other using attachment system. It works perfectly on server but only works sometimes on client. How do i fix this?

fallen fossil
#

I have read, that relaible off means, event can sometimes drop? or it always be replicated but just later?

errant charm
grim rain
#

They’re all replicated it’s just player characters

marsh hazel
#

why is replication (even server->client) works only when event is called on the pawn
I have 2 exactly the same multicast events
one is called on PlayerPawn, second is called in GameModeBase
first is replicated to the client, second isn't (applied only to server)
why

quasi tide
#

Because GameMode does not exist on client. Only server.

#

You can also only call server events on things you have network ownership of

scenic horizon
#

Hi all. Wondering if anyone can offer advice on how to set this up properly. Using a listen server, I have my character customization screen happen before the join game, so the client can decide on their player colour for example. When they join the game, I need to send the colour they chose to the server, so then the server can replicate it back out to everyone else properly. I am trying to do this with an RPC from client->server, on the client's spawned actor OnBeginPlay after the join, but this RPC never reaches the server. If I add a delay of 0.5s before calling the RPC it works fine. Question is, is there a more correct way to do this? Or a callback I can listen to on the client, that says "yep everything is set up and net connected so RPCS are safe to send now"?

marsh hazel
#

but if I will do the exact same thing (find all cubes and paint) on pawn possessed by server - everything works correctly

verbal ice
#

Since your player controller determines ownership

#

So if your RPC is on your player pawn, the player controller needs to be present & needs to be possessing your pawn before you can call a server RPC

scenic horizon
#

@verbal ice thank you for the reply. Is there a callback or value on the client that can tell me that that the Player Controller is net connected and ready? I see there's an On Possess event I can override, but logging shows that is only fired on the server. It does look like the Player Controller is valid in OnBeginPlay, as I am grabbing a reference to it before the RPC. But it just must not be net-ready yet or something? (since it does work after a short delay)

verbal ice
#

Check to make sure GetOwner() isn't null before calling the RPC

#

Might not have replicated yet.

marsh hazel
verbal ice
#

The gamemode is server only, so you can do server-side logic there

#

However you can't replicate anything to clients inside it. If you need to replicate something, you can have your gamemode call code on actors that are available to the client, like the game state, player state, or player controller (owning client only)

#

This explains it

daring gorge
#

im adding an element to an array on a server RPC, shouldnt the elements replicate?

verbal ice
#

Is the array replicated?

daring gorge
#

my clients have no elements in their array, the array is replicated

verbal ice
#

What actor is the array on

daring gorge
#

a replicated actor thats placed as a component on another replicated actor and is componentreplicated aswell

verbal ice
#

What type of actor, who is calling the Server RPC

#

Does the server RPC even run, you should debug that

daring gorge
#

it does, i print string and check. it sets the element on server

verbal ice
#

What type of actor

daring gorge
#

pawn

#

the ultimate parent that calls the server RPC

verbal ice
#

Does the replicated actor that holds the array exist on other clients

daring gorge
#

it should right? if i declare a replicated array shouldnt it exist on clients?

verbal ice
#

Debug it, if it's not working, you shouldn't assume

#

In PIE with multiple clients you can select the world to display in the editor

daring gorge
#

how do i check if the array itself exist?

verbal ice
#

You'd wanna check if the actor exists first of all

#

The replicated actor, how is it spawned?

daring gorge
#

it does, its placed in world and other replicated variables and methods of it work fine

#

i declared the array in cpp and since then its been weird

verbal ice
#

Did you add it to GetLifetimeReplicatedProps

daring gorge
#

yes

verbal ice
#

Is it UPROPERTY(Replicated)

daring gorge
#

yes

verbal ice
#

What does the array hold

daring gorge
#

FName

verbal ice
daring gorge
#

so like when i made a variable to hold socket name in BPs, ran a function to get the socket name. itd replicate the name to the clients, however when the variables are declared in cpp they arent being set on clients

verbal ice
#

Can you send code, GetLifetimeReplicatedProps for now?

daring gorge
#

like send code here r/

#

or*?

verbal ice
#

yes

daring gorge
#

chair sockets is the array

#

server RPC adding elements to em

verbal ice
#

And you're sure that code is being called?

#

Have you added a Print String inside your function to check

daring gorge
#

i use a print string and yes it does get called

#

it returns the right socket name on server

verbal ice
#

When do you access those on the client?

daring gorge
#

basically after i attach a player to a boat, i add them to another array called as passengers. then to make sure the client is rotated right way and doesnt jitter, i call the same attachment on OnRep of that passengers array where its to get the element from the socket array for attaching

#

however since array is empty on clients the game crashes

verbal ice
#

The array might not have replicated yet

daring gorge
#

but this gets called as soon as the component is valid

verbal ice
#

No guarantee

daring gorge
#

i see

verbal ice
#

Use a rep notify for your chair sockets, see if it gets called on the client eventually

daring gorge
#

alright

scenic horizon
# verbal ice Might not have replicated yet.

Checking GetOwner() on the spawned player Actor is not null and is valid. The player actor shows the owner is the PlayerController correctly, and immediately OnBeginPlay where the RPC still fails to be received by the server, not sure what else I can check

verbal ice
#

Check the output logs, see if there's anything about your RPC

scenic horizon
#

Do you think it would be appropriate to just wait for OnPosess to be called on the server, and send an RPC from server->client at that time saying "hey we're ready, send me your data now"?

verbal ice
#

If the owner is valid on the client, it means it's also valid on the server

#

The owner of a pawn is set when the pawn is possessed (the server assigns the PlayerController as the owner)

#

I'd just check the logs

lament flax
#

since the pawns is spawned from the PC

daring gorge
verbal ice
#

Awesome, so it's just an ordering issue probably

#

Do the socket names have to be replicated or can they be infered by the client directly?

daring gorge
#

what is an ordering issue?

lament flax
#

@daring gorge can you show:

  • how you declared the array
  • how you rep it (replifetime, functions, ...)
  • the results you get on client showing thats its empty
verbal ice
#

Already solved

verbal ice
daring gorge
#

socket names have to be replicated right because i wanna make sure the client sits on the same seat they sat on the server

verbal ice
#

How does the server generate the socket names?

lament flax
#

are you trying to attach the player on client before the sockets exists on client ?

daring gorge
#

takes in a mesh through the params, this is also replicated. reads all the sockets on the mesh and filters and adds them to the array

daring gorge
#

which i do like after i walk all the way to the boat and all and the sockets are read when the component is valid

verbal ice
lament flax
daring gorge
#

i could just calculate these sockets on clients locally too but idk how reliable/viable that is

lament flax
#

IMO you should attach on server so it gets replicated

daring gorge
daring gorge
lament flax
#

then i wonder why you need the sockets on the client

daring gorge
#

and client doesnt get the right orientation until i attach on it too

sinful tree
# scenic horizon Do you think it would be appropriate to just wait for OnPosess to be called on t...

There is no real way to know when a client would be ready to receive any RPCs from the server unless you have the client tell the server that it is ready to receive the data through its own RPC which is also kind of problematic. There are OnReps and Events that trigger when the PlayerController receives a new pawn and that would likely be the best event to use to start sending data to the server.

scenic horizon
# verbal ice I'd just check the logs

Hmm. Okay. I'm confused here though, because the logs show nothing. I can see the RPC being fired from the client, but the server just never receives it if it's sent too early in OnBeginPlay (or with a delay < 0.5s after). But if I delay for 0.5s, (or manually resend the RPC at a later time) the server does receive the RPC just fine
@lament flax So if the pawn exists, it should be able to send a RPC from the client -> server OnBeginPlay without issues? Because that is not workin. Or what am I misunderstanding?

lament flax
daring gorge
#

i sent some vids here of what was happening if i only attached on server

  1. the clients that sit on the boat dont have the right rotation
  2. they keep glitching/ server corrections as it looks like
  3. they lag as if they arent exactly attached, theyre floating in the air aas the boat drives forward and follow with some delay
lament flax
#

only owning connections can send server RPCs from client

daring gorge
#

oh

#

but if i placed an actor in the world, wouldnt it be owned by server?

lament flax
#

by defaults those are the controller, the PS and whatever pawn the controller is owning

lament flax
daring gorge
#

i dont think thats my issue but ill debug more

lament flax
#

yeah i was talking to DMeville

#

i need to see your code to help you

scenic horizon
verbal ice
verbal ice
#

Can you send your code

lament flax
#

please just send code, its hard to guess with just your interpretations :(

daring gorge
scenic horizon
#

@lament flax @verbal ice Yes I can, let me clean up a bit quickly. Thank you in adavance. It's really just the spawned Player actor though, trying to send an RPC to the server's ...actor. And again, it works perfectly fine if I just wait 0.5 seconds which is weird

daring gorge
#

i already showed that everything else is replicated

daring gorge
# daring gorge

the first image is called on event tick which i plan to change later

#

and vehicle target becomes valid right after that set vehicle message

lament flax
daring gorge
#

ye

lament flax
#

then thats probably why its lost

#

because the actor isnt owned by a owning connection

daring gorge
#

even if its placed as a component on the actor thats owned by the server?

lament flax
#

you need to get a ref to either the pawn, PS or PC

lament flax
#

had same issue with my containers

daring gorge
#

the initial issue i had was that my containers wouldnt fire on Rep until i add to them in BPs, but it all worked perfect in BP exec

lament flax
daring gorge
#

im trying to see if array has elements when i attach using the onrep when client attaches and not when sockets are set

lament flax
#

can you show how you add elemnts on servers

daring gorge
#

yea

#

and client returns no elements

lament flax
#

if its on BP, you need to Setthe var array to itself, otherwise it doesnt call OnRep

daring gorge
sinful tree
lament flax
#

on pawn there is also OnRep_Controller

daring gorge
#

my bad, the loop goes ahead and filters through the names to add to the array

daring gorge
lament flax
# daring gorge

do
Set Empty Chair Sockets and as input give Empty Chair Sockets

daring gorge
lament flax
#

is it set to OnRep

daring gorge
#

ye

lament flax
#

if everything is replicted then it should work

daring gorge
#

im debugging more

#

it randomly started to work

scenic horizon
# verbal ice I'd just check the logs

Okay I guess I had warnings disabled, there is a warning being called:

LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_Character_C_1. Function S_RPCTest will not be processed.```
Code is simple. Happening on my BP_Character, which is really just the same as the Third Person demo character Pawn that is spawned automatically when connected. Manually calling the RPC works fine, I guess since things have had a second by that point to make sure everything is ready
daring gorge
#

i am sure i didnt change anything but the client suddenly returns the value

lament flax
#
  • as I said, and the warning tells you : to call a server RPC on client you need a owning connection
  • you are calling the RPC on beginplay, which is called on server and client (so the RPC will be called once)
  • on client beginplay (and maybe on server if you arent possessing it) the player controller is probably not replicated yet, so the character has no owner
sinful tree
#

I think it's because they have more than 2 BP_Characters spawned, and because they're calling it on Begin Play, the Begin Play is firing for both copies of teh BP_Character, one of which wouldn't be owned by the client

lament flax
#

the best way to do stuff once the PC is valid is to use one of the methods that gets called on server and client when a pawn receives a controller

scenic horizon
lament flax
#

i know that you showed a RPC test, but for such events, you could just execute all on server, no need to do client->server if you can be on server straight

scenic horizon
lament flax
scenic horizon
#

The player colour is decided before the join (it's actually coming from savedata in this case, as I'm trying to load the players settings from last time they played), and want those changes to show up as soon as their player joins/appears, and not have to have them re-setup their player manually after every join

#

They can already change those settings mid-game perfectly, and those get saved to savedata fine, it's just re-applying those changes right on the next time they join, rpc was not getting through as I showed, so they couldn't tell the server "this is what I look like" immediately as they join

#

But I'll give it a go with those other events. Thanks again for your help, and @sinful tree and @verbal ice

lament flax
#

to make a system like that, i would send a RPC to server with new color, and make the variable holding the color replicated to all, having the onRep displayign the color

scenic horizon
lament flax
#

yeah, just read your data, then whenever the pawn is posses on client send the RPC

fierce oriole
#

I’m trying to use Render Targets for player damage, but every character gets the same damage?! Is there a way to instance a Render Target so each player has its own unique Render Target?

shrewd ginkgo
#

how can I replicate this spectator system correctly

scenic horizon
# lament flax yeah, just read your data, then whenever the pawn is posses on client send the R...

Unfortunately, this is not working. I've made it so that the RPC is not sent to the server until both OnBeginPlay AND OnControllerChanged is called on the actor. And having some weird results with the logs. It's like the controllers are getting assigned not how I would expect on the client vs the server. This is what the logs are showing. ``` Server Starts
Server Char0 OnControllerChanged called
Server Char0 OnBeginPlay called
Server Char0 Set Initial Customization Data, since server is the owner of Char0 player (success visually we see this working)

Client Starts
Server Char1 OnBeginPlay called
Server Char1 OnControllerChanged called
Server Char1 Does NOT set data, because server is not the owner/controller of Character1, the client is
Visually, we see Char0 on client window with the correct data

Client Char0 OnControllerChanged called (irrelevant, since Character0 is the server's player, we don't care about that as the client?)
Client Char0 OnBeginPlay called

  • Client Char0 IS locally controlled??? But thats the servers player? (IsLocallyControlled and IsLocalPlayerController = true)
    Client Char0 Set Initial Customization Data (RPC never makes it to the server still, but it shouldn't have been sent anyways since this is not our player!)
    Client Char1 OnBeginPlay called
    ** Client Char1 OnControllerChanged NEVER gets called, and so never sends data to the server.

No more logs
Visually, the client sees both players with the correct data
The server sees themselves with the correct data, but NOT the clients character (missing customization data)

#

I'm very confused for a few reasons, from the logs marked with a *. 1) Char0 is the servers player, but the client is saying that Char0 is locally controlled by the client, which...shouldn't be true? And 2), the clients own Char1 never actually gets OnControllerChanged called

lament flax
#

try NotifyControllerChanged instead of OnControllerChanged

twin juniper
scenic horizon
# lament flax try NotifyControllerChanged instead of OnControllerChanged

I don't have that event available anywhere? Is that supposed to be on the pawn actor? Or maybe it's not exposed to BP? It's just weird, because when the client starts up it's almost like it thinks it's player should be Char0, but that's the servers player. Boggling my brain today, esp since the client is saying that Char0 (the server player) is locally controlled

shrewd ginkgo
#

I learn many things from kind people here

latent heart
#

Instead of asking "how do I make X system?" you should ask more specific things.

#

You'll get more and better answers.

shrewd ginkgo
#

I made spectator but when clients try to spectate the server's screen changes and it spectates so I asked how to replicate it

#

I learn that spectator system from a video but he doesnt replicate it

latent heart
#

Is your client making your server change? Or is it the server doing it?

twin juniper
#

no one will ever pay you to answer you

shrewd ginkgo
#

english not my mother lang I translate it

#

Im not dumb I know that

lucid badger
#

I'm setting up a target system. Actors can target other actors. I want that to replicate (so you can see what other actors are targeting). When the player targets something I RPC the target to the server, but I don't want the player to have to wait for the target to replicate back from the server. I can simply set the value of the target client-side when I send the RPC, right? Essentially predicting the change? Thinkge

shrewd ginkgo
#

I just missed it when I was translating.

lament flax
latent heart
#

(rpc the server's current value back to them)

#

If, for whatever reason, they targeted an invalid actor.

lucid badger
#

Sure, okay. Like if it's out of range or maybe ceases to exist or something mhm

latent heart
#

Yeah.

lucid badger
#

Makes sense thanks Okay

latent heart
#

Or they target the world settings actor 🥳

lucid badger
twin juniper
latent heart
#

Potential advice - create a blank ITargetable interface that you can add to targetable actors.

#

Or a gameplay tag or whatever you like.

#

The interface means it's compiler enforced. 😛

lucid badger
#

I almost did this but I'm like 99.99% sure that I won't need it. I said Actor but actually it's my specific Character subclass/baseclass ("Agent") and it can only target other Agents. I won't have something else that can be targeted besides other Agents mhm

wet sandal
#

I'm getting a weird issue where skeletal meshes (clothing pieces on a metahuman) warp and bend in weird ways when seen by another client in multiplayer. The standard clothing works fine. Any ideas?

nova wasp
#

It could be the movement of the actor is less smooth on the simulated proxy

#

You might want to consider making sure it's attached to the smoothed part of the cmc (the mesh) and not the actor root (the capsule)

#

just a guess on my part

wet sandal
#

it's the standard metahuman setup with part meshes that get set with a leader pose to the body

#

The skinning weights look almost identical to the corresponding metahuman part, which was the first thing I looked at.

shut hazel
#

Is it possible to debug why no server functions get executed?

verbal ice
dark parcel
wet sandal
#

Confirmed by setting Forced LOD in the LODSync component

dark parcel
#

Wrong channel?

wet sandal
#

The issue only occurs in multiplayer which is why I originally posted here.

spice wave
#

Hi guys, I've got problem with FindSessions in UE 5.4.4. It returns me empty SearchResults because of the length of the header packet. More info here: https://forums.unrealengine.com/t/findsessions-returns-searchresult-empty-in-ue-5-4-4-problem-with-header-packet/2029031
Does anybody have a clue how to solve the problem?

errant charm
#

Hey everyone, I'm having some trouble and could use some help.

I have an Interactable Actor variable on my first-person character. However, when the client sets the variable and tries to interact with it, the variable comes back as invalid.

Does the server override or change the variable in this case?

merry pebble
shrewd ginkgo
#

I made a spectator system like that but whenever the client tries to spectate someone it changes the screen of the person who set up this server. I know there is a problem in the replication part but I can't find what to do. can anybody help?

tardy fossil
#

that would be your Get Player Controller node getting the 0 index playercontroller

#

index 0 player controller will be the local controller if its not dedicated

#

if this is in the player controller blueprint, replace that node with a "get reference to self"

surreal fox
#

when I interpolate the player location from one point to another (using lerp or anyother node) on Client its no smooth as it is in server.

#

Why is that?

bitter robin
#

are you lerping on both the client and server?

twin juniper
#

I’ve worked on weapon prediction and other types of prediction in my project, and I’m now looking to understand custom movement character prediction for my game (such as wall running). As a beginner in this area, how and where should I start? I’m aware of network replication systems like GMCv2, but I’m specifically interested in learning how to create it myself to learn more about custom movement prediction. Any guidance or resources would be greatly appreciated!

errant charm
surreal fox
bitter robin
#

well it makes sense then why it's not as smooth on the client, its not like the client received the location every frame. I'm not sure why you are lerping, but just moving properly using velocity will give better results.

velvet jacinth
#

So how do you guys tests your code on listen server while developing?
Because running from editor with 2 players on a listen server seems to work perfect.
Once you package your game it's totally different behavior.
I discovered many bugs that wasn't exists when I tested from the editor but on a packaged game with 2 different accounts and PCs they suddenly appeared.
Curios how to test the game properly.

latent heart
#

Package it in development and attach to the game instances or run them direct from your ide?

velvet jacinth
#

Can you debug blueprints that way too ?

latent heart
#

Probably not.

kindred widget
#

Yeah, that can work, but it also doesn't allow debugging BPs on the client side.

#

It's just one of those things you learn to work around. 🤷‍♂️ You make it the best you can, and then you test it in a real build and fix what breaks. You learn from it and don't make the same assuptions the second time around.

crisp shard
#

is this ok to use to get the player controller from the player state ?

kindred widget
crisp shard
kindred widget
#

Nothing about that should require the controller though.

crisp shard
#

how so ? im using the controller to update the client widget ?

kindred widget
#

You should use delegates or something like the GameplayMessageRouter plugin from Lyra. The widget should be able to get the broadcasting system and bind to it. Then your system can just broadcast and the widget can just work.

crisp shard
#

lol that seems like quite a rework ..

kindred widget
#

Shouldn't be. You have a death system. Just make something like a GameStateComponent to broadcast gameplay events. Death on the server can get the killer and the one dying, populate a struct of data and it can be multicast. The multicast can broadcast a delegate or send a gameplay message through the gameplaymessagesubsystem, either way. The widget binds to the game state's component or implements the gameplay message listener and throws up a timed child when the message runs.

crisp shard
#

i mean it does sound good, but at the same time i dont know if a full reworking of how im updating widgets is a real efficeint play at this point. i see what you mean, but is there an issue doing it the way i have things already setup ?

kindred widget
#

🤷‍♂️ Maybe not. Just convoluted. Either way, to answer the original question, that is perfectly fine to use as long as it's in a ClientRPC or already on the client who owns the playerstate. As that call will fail on any machine except the server and the owning client, and to update the UI, you want the owning client.

#

Unless you're getting it on the server to run a function on the player controller to run a ClientRPC, also works.

crisp shard
#

i do like what you were saying, it defintiely makes a lot more sense to set widgets up like that. never have done something quite as complex (i know it prob isnt, but it's new so yea)

kindred widget
#

😄 Try it next time. It ends up being a lot less complex, which is why it's usually preferred. You get a widget that just handles it's own stuff and a gameplay message broadcaster that handles it's own stuff. Multiple things can use the message broadcaster too. Say you want to tie into some visuals somewhere on the level. Show the latest player as dead in a video feed on a virtual monitor or something. Everything can run from that one delegate/messagebroadcast and it can be generic like that instead of having to know everything that needs to update when something dies in some long function that runs functions on everything.

crisp shard
#

quick q on that, would it require any cpp ?

kindred widget
#

Nope. You can do it entirely in BP. Could make it more generic in C++, but it's not completely necessary.

#

Like if you want a simplified version it would basically be...

#

@crisp shard You make an ActorComponent. Set it to replicate. Add an EventDispatcher and a custom function that takes in what you need.

#

Drop it on your GameState

#

Bind the event in your widget on Construct, GameState should be valid by here.

#

Then on the server, when you decide someone has killed someone else, you simply do this. And everyone with a KillReel widget gets notified.

#

You can make that handle function in the widget throw up a second widget in a vertical box or something that runs a timer on itself and then removes itself, etc. But this code alone would get you most of the way there with a debuggable print.

crisp shard
#

yea this is sick, thank you

#

makes perfect sense and is way better than what im doing to display the kill feed lol

#

currently was doing a for each loop on each connected player

#

in the game mode*

charred wasp
#

Hey guys! Noob question here. What is the best strategy to replicate AnimMontage playing to simulated proxies? I have a FireWeapon AnimMontage which plays when player fires. How do I replicate it? I saw some people using Multicast RPCs, but it really seems a bad idea, as player can hold fire input and spam the AnimMontage play (the montage may blend into itself). At the same time, replicating a flag also does not seem a good option, as the fire logic shoots a line trace, and I'm worried that simulated proxies will play the AnimMontage without syunc to the "hit logic", as once the flag is replicated, the logic already happened.

crisp shard
# charred wasp Hey guys! Noob question here. What is the best strategy to replicate AnimMontage...

there's a few ways to handle this, im prob not the most knowledgable but w anims for attacks / firing, i usually do the animation on client locally, and then have the server event fire , do dmg and in that i either have a multicast that ignores the owning client becuase they already saw that local animation , and the multicast should fire during the server event so the player getting hit will see the animation when the dmg event takes place

magic karma
#

I'm learning how to make a dedicated server, and the tutorial said to do use this node to join a server. But it doesn't seem to work, since in the tutorial a new map is opened when this node is called. When I call it, nothing seems to happen. What am I doing wrong?

#

In the tutorial they started a server after packaging the project and using the command prompt. I'm just using "Play as client". Does that make a difference maybe?

jade scroll
#

i draw lines with on paint function, BUT on server works allvery well but on the client the line " is flashing" the line draw every time new... on the client.. what can i do?

charred wasp
crisp shard
# charred wasp But what about network performance? If player holds fire button won't it flood n...

i mean, if it's firing an event every tick then yes lol but i wouldn't see how that would be the case ? you can do many things to stop the spamming but even if it's a machine gun you'd fire a single server event and then yes for each loop of whatever timer/tick function that is firing the bullets, on impact those would be multicasts and i dont think it's that much of an issue assuming you aren't firing like 100 events at a time

charred wasp
#

Cool! Thanks!

kindred widget
magic karma
kindred widget
# magic karma No, I'm just trying to do it in Editor.

Ah. You should be able to do this still. Except the server needs to open it's own level. You open PIE with dedicated server on the main menu of your game. The server should open level on it's own. And then each client can use console commands to "open 127.0.0.1"

jade scroll
#

when i start the game in multiplayer... server works well... but client need 1min that i can controll hi... its like he loead 20sec or lagging

#

at the beginning

grand mica
#

Hello!
I want to enable some functionality only when the system has confirmed that all the clients have ticked at least once for autonomous and simulated proxies. Is there a way I can do this?

daring gorge
#

i add elements to an FName array, after i add i print string in BPs and get the right value on print string from the server side. then a server side RPC that is to read that element, since the array is declared in Cpp returns that the array is empty and crashes?
it also only proceeds forward w the code after literally checking that the array has more then 0 elements inside of it

latent heart
#

"a server side rpc"?

daring gorge
#

i meant an event that executes on server, sorry

latent heart
#

Then something is amiss with your rpcs!

#

Either you're filling the array on the client, or you're not sending a server rpc to the server, but executing ti locally on the client.

daring gorge
#

if a print string, prints a string with server: value, then the value is being set on server right?

latent heart
#

I think so.

daring gorge
#

weird part is, it goes ahead of that Num>0 but crashes at the print string

#

yesterday the clients didnt get the elements and all i did was change it to onrep and they did, now server doesnt get em

latent heart
#

Weird. I don't see anything immediately wrong there!

daring gorge
#

i think 4..26 is buggy, since ive started switching code to cpp the entire system is acting weirdly especially when set variables or smth

#

the on rep isnt being called on the server? is there a way to call it when i add elements in BP

latent heart
#

In BP, when you set a variable, OnRep is called on the server for you.

#

It is not called in c++.

daring gorge
#

i declared the array in cpp but adding elements in bp, its not being called on server, atleast i think . imma add vars in cpp and see if that works

haughty ingot
#

Only matters if it’s been declared in CPP or BP. Doesn’t matter the context of which it’s being modified.

latent heart
#

What you can find is, though, that you're creating a BP subclass... but then just using the c++ class instead.

#

So the BP class fills the array, but the c++ class obviously doesn't have that because it's not the BP.

#

But then .Num() should be zero.

daring gorge
#

exactly why i dont understand how it proceeds with the code to crash

latent heart
#

What is the actual crash?

daring gorge
#

im declaring everything in cpp and whenever i use cpp methods to set vals, it doesnt call onrep on clients. so im using bps to set vals anyway, however its just being weird in general

#

the trying to access index in array of length something

#

i can get it to crash and get the actual error, but im first trying to use a cpp method to set the var and see if it acts differently

#

Assertion failed: (Index >= 0) & (Index < ArrayNum)

#

also using cpp is now calling the onrep on server but again crashed

daring gorge
#

yeah thats what i did, but it still crashes

latent heart
#
void UMyClass::SetThing(NewThing)
{
  Thing = NewThing;
  OnRep_Thing();
}```
daring gorge
latent heart
#

And the crash is?

daring gorge
#

eventho the way i access it is with that check i showed above, if num>0

latent heart
#

Which line does it say is crashing?

daring gorge
#

could this be the result of the fact that the actor thats acting as a component on the other actor running this is placed in the world therefore has no owning connection?

midnight palm
#

Alright, I have successfully connected 2 quests to a local dedicated server, but somehow, I cant get position of each players in the map. (I just want to see other players location in VR), any idea how should I proceed ? I tried to add a set replicated to the event begin play, but I dont think it would be the right approach

daring gorge
#

let me check w that rq

shrewd ginkgo
#

I made a spectator system like that but whenever the client tries to spectate someone it changes the screen of the person who set up this server. I know there is a problem in the replication part but I can't find what to do. can anybody help?

haughty ingot
#

It’s just going to return the servers controller.

nova wasp
#

Get the controller from the pawn you are in here

#

Rather than whatever the first one is every time

latent heart
#

Get player controller 0. Always a killer.

#

Also player arrays aren't going to be the same order on server and clients. Remember that.

nova wasp
#

The server is setting the view target here, that's fine

molten vine
#

@ashen plume I'm having a similar issue, but only the camera lags behind the mesh. The camera is attached to the mesh, but something about the simulated proxy causes the camera to lag behind the head bone despite being attached to it

midnight palm
#

Would this on a client, send its position to the server so it can replicated to other clients ?

ashen plume
molten vine
#

The only problem is that.

#

The issue only crops up when I'm playing a replay.

#

Otherwise it works completely fine.

ashen plume
#

I know factually replays struggle with the net position smoothing

ashen plume
molten vine
#

Hmmm, I'd love to know where you heard that. As that sounds about right.

ashen plume
molten vine
molten vine
ashen plume
#

But i dont think the forum post figured it out

#

Just like you did with me try and search some adjacent or similar problems to see if theres overlap

molten vine
oblique condor
#

I'm using the following to restart the match after a game is complete:
GetWorld()->ServerTravel("?Restart");
When this happens I get this crash:
AActor::CallPreReplication (this=0x7fd117c352a0, NetDriver=0x7fd11dbe75e0) at .\Runtime/Engine/Private/Actor.cpp:1578
Interestingly the issue only appears in cooked shipping builds on the dedicated server.
Even using standalone in editor it doesn't crash.

nova wasp
#

attach a debugger to the built dedicated server if you can

stable marsh
#

Was told to post here instead of blueprints:
Any idea why spawning an actor from server would show in both game views but not play in editor?

molten vine
#

Hey Nonlin, did you find a solution to this? I'm also having problems with replays

cobalt notch
#

Both game views are also Play In Editor so Question is ambigious.

vagrant grail
#

Hey, if I want to use GAS for multiplayer, should I still respect the stuff needed to do multiplayer (such as executing important stuff on the server, etc...) myself or is that handled for me automatically behind the scenes (as I heared that GAS handles stuff like Client Predicition and other complex stuff related to multiplayer so I'm wondering if it handles the rest of multiplayer too or do I still have to do that myself ?)

stable marsh
cobalt notch
#

It's hard to say without seeing the settings on those BPs and meshes.

stable marsh
#

Hmm, nevermind. It works if I set the mode to "selected viewport." That gives me the option to detach editor and select objects etc.

What I was hoping to do was run the two screens (i.e. New Editor Window (PIE) mode) and test things in the embedded/normal editor view. But I guess those scripts don't communicate with PIE the way I was hoping?

floral spade
#

Did you ever get this sorted out?

lament owl
#

Question about relevancy and visibility (NetCullDistanceSquared).

where is engine code that process "not relevant actor is destroyed" and "relevant actor is respawned" ?
when Distance between Character A and B is bigger than NetCullDistance, Destroy is delayed (about 2~3 sec) but Respawn appears immediately in my project.
so I want to see about engine code about that in UNetDriver::ServerReplicateActors(), but I couldn't find.
Anyone help? 😅

thin stratus
#

That shit delay

#

Don't get me started

#

At some point I had my GameState spawn in and out every frame 😂

thin stratus
#

Lemme see if I can find that part again

thin stratus
#

And I would highly suggest to alter it in a way so it's configurable per Actor

#

@lament owl It should be around line 4787 in NetDriver.cpp

#
AActor* Actor = ActorInfo->Actor;
bool bIsRelevant = false;

const bool bLevelInitializedForActor = IsLevelInitializedForActor( Actor, Connection );

// only check visibility on already visible actors every 1.0 + 0.5R seconds
// bTearOff actors should never be checked
if ( bLevelInitializedForActor )
{
    if ( !Actor->GetTearOff() && ( !Channel || ElapsedTime - Channel->RelevantTime > 1.0 ) )
    {
        if ( IsActorRelevantToConnection( Actor, ConnectionViewers ) )
        {
            bIsRelevant = true;
        }
    }
}
else
{
    // Actor is no longer relevant because the world it is/was in is not loaded by client
    // exception: player controllers should never show up here
    UE_LOG( LogNetTraffic, Log, TEXT( "- Level not initialized for actor %s" ), *Actor->GetName() );
}

// if the actor is now relevant or was recently relevant
const bool bIsRecentlyRelevant = bIsRelevant || ( Channel && ElapsedTime - Channel->RelevantTime < RelevantTimeout ) || (ActorInfo->ForceRelevantFrame >= Connection->LastProcessedFrame);
lament owl
#

Can I get engine version? I'm using 5.1.1

#

btw you're answer is so nice 😄

thin stratus
#

Ah sure, this should be 5.3

lament owl
#

ServerReplicateActors_ProcessPrioritizedActors, right?

thin stratus
#

I think there are 3 values that control this iirc.

First off there is the RelevancyTimeout in the line I mentioned. That's the 5 second global "cooldown", so Actors don't flip flop in and out of existance.

thin stratus
lament owl
#

I think it's added after 5.1, there is no it

#

but ok, i can find anyway

thin stratus
thin stratus
lament owl
#

Ok, I've found

thin stratus
#

I had to "fix" this all for a MOBA so Actors can walk into Brushes and instantly stop replicating.

#

Well "instantly".

#

I basically changed the RelevancyTimeout and the 1.0 value to Actor Variables (added them to AActor) and gave them the same defaults.

#

Can't fully recall what I did to the randomzed offset

#

Oh