#multiplayer

1 messages ยท Page 412 of 1

swift topaz
#

It's the moment it gets un-possessed that it stops being able to be affected by SetActorLocation

#

Now, when I say that it stops being affected by SetActorLocation, let me clarify. I mean the new location does not get replicated to all clients. The new location is only available on the client that invoked the SetActorLocation.

#

Only after that client possessed and un-possessed that character.

manic pine
#

it might disable the movecomponent

#

and actor doesnt have replicate position

swift topaz
#

SetActorLocation does not invoke the character movement though.

manic pine
#

normally when possessed, movecomp takes care of replicating actor position

#

so a character does not have ReplicatePosition activated

#

have a look at what unposses actually does, i cant remember

swift topaz
#

the bReplicateMovement still is true, before possess and after, unless it's something else

celest sigil
#

Maybe you guys can set me on the right path of what I'm trying to implement next.

The maps that the players play on is fairly large. I want to be able to do a spell that'll set a waypoint to where the opponent is at.

manic pine
#

breplicatemovement is for charmovecomp

bleak lily
#

oh okay

swift topaz
#

Gotcha, so it has nothing to do with SetActorLocation, only the ability to do updates via the CharMoveComp

manic pine
#

yes

#

it could be that charmovecomp just wont do ServerMove when velocity is 0 etc

#

you ccan force it using client correction right after setting location on server

#

by calling ForceClientAdjustment on the movecomp

#

not sure how it works with no controller though hmm

swift topaz
#

That's the pickle ...

#

SetActorTransform is working just fine pre-possession

#

as soon as you un-possess it stops replicating the transform to other clients

bleak lily
#

when I hover over self it says it is not a idk class (idk is the player controller)

#

oh wait it says it is not an idk_c

#

or is the problem that as idk its not the owner it should be the target

#

oh wait I think I got it

#

thanks a lot btw I have been trying to fix this for a little while now lol @thin stratus

swift topaz
#

@manic pine thanks for the help, Character Movement definitively is the cause. As soon as I DisabledMovement, was able to once more properly replicate the position with SetActorTransform.

bleak lily
#

oh I have one more issue when I spawn in the second person's ui is still there and because of this cannot move

#

they spawn in but the ui just doesnt go away

winged badger
#

you spawned it from BeginPlay?

bleak lily
#

the ui?

#

yeah

winged badger
#

BeginPlay happens on every instance of that Character

#

on every machine

bleak lily
#

oh

winged badger
#

so you spawned a UI from the first player and UI from second player ontop of one another

bleak lily
#

so would I do a custom event to fix it

#

or

winged badger
#

AHUD derived class is generally best way to manage non-menu UMG widgets

#

it belongs to your PlayerController and is not shared

#

barring that, a Branch with IsLocallyControlled check will do the trick

#

it is worth noting that other stuff also executes on every instance of a Character, like Tick, and Overlap events

#

provided the whatever Actor is being Overlapped exists on the client

bleak lily
#

would islocallycontroller be a boolean

#

controlled*

winged badger
#

yes, its a BP Pure function

#

outputting a boolean

#

HUD is generally handy because it can access PlayerController, PlayerPawn and your PlayerState directly

#

and you are guaranteed that whatever widget it spawns, it will spawn only locally

bleak lily
#

so where would the boolean output go exactly

#

oh into the branch?

winged badger
#

BeginPlay -> Branch

#

yes

#

that way it will execute only on local machine

bleak lily
#

so this should work?

#

its a level blueprint if that means anything

winged badger
#

no

#

i mean, you should not be using GetPlayerController[0] or GetPlayerCharacter[0] when you have an alternative

#

people make mistakes with those

#

your GetPlayerCharacter[0] in this example is "self" so you don't even have to connect the target pin

#

(assuming this is CharacterBP here)

#

likewise GetPlayerController[0] is GetController

#

and if you want a convenient way to remove or show that widget again, you should save the reference into a variable

#

GetPlayerController/Character[0] is generally safe in local splitscreen, its safe on clients, since there is only one match

#

but when used on a dedicated server it never works

#

or when it does, its by accident, to make it worse

bleak lily
#

the problem is when I make some of the things without the target I get an error

winged badger
#

is that a PlayerCharacter BP?

bleak lily
#

no

#

its a level blueprint since it shows up when a certain level ops

#

opens

winged badger
#

oh

bleak lily
#

is it supposed to be

winged badger
#

i really do suggest making a custom HUD class

#

makes things so much simpler

manic pine
#

you can even have a level HUD override specified

bleak lily
#

where is the custom hud class

#

oh I see it

#

but how would I make it so when a certain map is open it shows the UI

#

or the widget

manic pine
#

the hud is created when player receives his controller

bleak lily
#

oh

manic pine
#

so hud beginplay will run

#

you can make any widgets there

bleak lily
#

is there a way so the hud shows up at a time

#

or I guess the main issue is

#

that I need to make it for each level I can pick a character

#

at the start of them opened

manic pine
#

if every map allows character selection then its a game feature, not a map feature, ye?

bleak lily
#

basically yeah

#

besides the main menu

#

level

manic pine
#

is there some problem with just putting the create widget in your main hud blueprint then?

bleak lily
#

well the main problem is that when I remove the widget for character select it doesnt for the other players

manic pine
#

widgets are client-only

#

theyre not networked at all

bleak lily
#

they arent?

#

oh

manic pine
#

not the HUD class, not the Widget classes

bleak lily
#

wait so the issue is from something else

manic pine
#

they're all local

#

all the server does is tell the client which HUD class to use

bleak lily
#

oh

#

yeah the issue is this

#

I picked the character but it doesnt go away for the other person still

manic pine
#

both players have clicked?

bleak lily
#

yeah

#

but the second one has the widget still there

#

you can keep clicking it too and they will spawn in again

manic pine
#

sounds like a problem with the Widget logic

bleak lily
#

yeah because it used to not stay there

#

but now all of a sudden

manic pine
#

follow the OnClick and see where it leads

#

since its working on one and not the other, there's probably some kind of authority check thing going on

#

assuming youre not on dedicated server

bleak lily
#

yeah I am not

#

It might be the called event

#

Ill look at that too

manic pine
#

you named a class idk?

bleak lily
#

yeah

#

because I didnt know it would work

manic pine
#

thats very original

bleak lily
#

yeah

#

some other projects to test packaging I would just name I hope this works

manic pine
#

ServerTPS/FPS runs as expected?

bleak lily
#

oh wait I got an error

#

after playing

#

Blueprint Runtime Error: Accessed None trying to read property CallFunc_GetParent_ReturnValue1 from function: 'ExecuteUbergraph_CharacterSelect' from node: Remove from Parent in graph: EventGraph in object: CharacterSelect with description: Accessed None trying to read property CallFunc_GetParent_ReturnValue1

#

ohh

manic pine
#

ah

bleak lily
#

is it the things after the server tps and fps?

#

probably

manic pine
#

possibly

#

do both buttons have parents?

bleak lily
#

like in the graph?

manic pine
#

how are the buttons created specifically

bleak lily
#

I put them inside a vertical box

#

and then I made it a variable

#

okay it still happened

#

even though I got rid of the error

#

wow

manic pine
#

yeah, you might have a couple of problems here

#

when you say "get parent" in that function, youre not referring to the button's parent

#

youre referring to the parent of the widget/blueprint youre in

bleak lily
#

oh

#

yeah this could be hard to follow

#

It is very disorganized

#

but this could help

manic pine
#

yes, that explains why its working on one and not the other

bleak lily
#

what you said before?

manic pine
#

ServerFPS/TPS only runs on authority, yes?

#

the so called listenserver

#

and in that function youre calling RemoveAllWidgets

#

thats whats removing the buttons on that one

bleak lily
#

oh so how would I be able to fix it?

manic pine
#

first remove the 'remove all widgets' entries

bleak lily
#

okay

manic pine
#

you cant control UI from a server rpc

bleak lily
#

oh thats why it doesnt work I am guessing

manic pine
#

yes, those ui calls youre making there(remove widgets, set input mode game only), only work for the listenserver player

bleak lily
#

oh so where would I add those instead?

manic pine
#

but, to actually remove the buttons you'll need to change your widget bp

#

you can just call removefromparent on self(instead of getowner->removefromparent), that should work

#

but it might not be quite what you want

bleak lily
#

OMG IT WORKS

#

You are a literal genius for figuring it out

#

thank you so much

manic pine
#

great!

bleak lily
#

oh wait one more thing its not that bad though the mouse just shows up

#

I forgot to set mouse cursor

manic pine
#

yah, set that before or after remove from parent

marble depot
#

um hello i've followed the one and only dedicated server tutorial on the ue documentation (https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)) and after all the steps, the dedicated server is not listening for connections. it's starting up as normal, but it is not listening, even though it says it is. what can i do? this seems like a common problem, yet i can't find anything on the internet about it

snow violet
#

Did you open port 7777?

#

Do you get any errors in the server log?

#

How are you trying to connect to the server?

marble depot
#

yeah, port 7777 is open

#

checking it with canyouseeme

#

used listener.exe to test if the problem is my port forward and when i listen with that, it says it's open

snow violet
#

Okay, so it's not a port issue

#

What about server errors?

marble depot
#

unfortunately yes

#

lemme see

snow violet
#

Do you have any custom code in AGameSession::RegisterServer?

marble depot
#

only says something about failing to find a file which i don't really know anything about

#

nope

snow violet
#

What file is it?

marble depot
#

a mesh

snow violet
#

A dedicated server shouldn't be loading art assets, but that probably isn't what's causing the error anyways.

#

How are you trying to connect to the server?

marble depot
#

it isn't an art asset, it's used in c++

snow violet
#

Alright, are you trying to direct connect via IP or are you using sessions?

marble depot
#

umm i tested the port with a port checker to see wether the server is listening or not and tried with the exe to open 127.0.0.1 and that didn't work either

#

that would be via IP

snow violet
#

Have you tried creating a blank level with a OpenLevel node in the level BP? I haven't read that doc you posted, so I don't know if it talks about this

marble depot
#

yeah, i did that

snow violet
#

Huh

marble depot
#

and yes, it says you should do it

#

it's rather curious as another team member tried to make a dedicated server a few months back using a tutorial on youtube and he had the same problem. it wasn't listening

snow violet
#

Does it say anything about a player trying to connect?

marble depot
#

nope

#

i even put mapName?listen in the start command

snow violet
#

Could you post a pastebin of the server log?

#

oh, you don't want to do that

marble depot
#

oh really

snow violet
#

yeah, it's a dedicated server

marble depot
#

on that article it says i should....ok hold on a sec, i'm going to try to start it without that argument

#

nope...still no luck

snow violet
#

Will you post the startup log?

marble depot
#

yeah that's what i was doing, one sec

#

unfortunately some things aren't in English as they're made by a guy in our team who for some reason likes to put non-english names

snow violet
#

Alright, start your client, then open the console and type: open 127.0.0.1

#

You could also just try hosting the dedicated server on something like EC2. You might have weird network settings that are blocking the connection.

#

Could also be a firewall thing

#

Your firewall might be blocking all outgoing connections from the server.exe

marble depot
#

client's not doing anything when executing that command

#

alright, lucky I already have an EC2 set up

proper olive
#

can someone clarify for me "is locally controlled" determines if a pawn is local "not network" controller..... does that mean, if it's a client's owned pawn, it will return true, but if it's a server's pawn on the client side it'll return false?

#

or does it just mean if it's the server's pawn in general?

snow violet
#

Where are you calling it?

proper olive
#

on the pawn

#

if it means what I think it means, I'm using it on a multicast so that it doesn't over-write or re-write what happened on the client's side before the multicast

snow violet
proper olive
#

and pawn's controller is local means?

snow violet
#

Sec, gonna break out my badass MS Paint skills

proper olive
#

like if I'm a client, my controller is local?

#

just need words ๐Ÿ˜ƒ

snow violet
#

I'm bad with words lol

proper olive
#

but you can use yes or no

#

if I'm a client, my controller is local?

#

or does it mean, only the server's controller is local?

snow violet
#

Well, it's not as simple as that

#

lol

#

It doesn't mean only the server's controller is local

proper olive
#

if I'm running this on the client

#

and I'm referencing the client's controller

#

is it local?

snow violet
#

It returns whether or not your controller is local

#

So like

#

If you are playing a MP game

marble depot
#

alright i'm back...it doesn't want to start at all on my EC2. it's giving out an error

snow violet
#

what's the error @marble depot

marble depot
snow violet
#

If you are running IsLocallyControlled() on the client, it will return true assuming you are not going SomePC->IsLocallyControlled()

#

@proper olive

#

I don't have any experience running dedicated servers on windows, I only run mine on Amazon's Linux distro, so I have no idea what that error means

proper olive
#

so the answer is yes?

snow violet
#

Could try googling the error code @marble depot

#

Could I see the code where you call it @proper olive

#

IsLocallyControlled() will return true if the controller it's called on is local

proper olive
#

and I'm asking what "local" means lol

snow violet
#

local means you

proper olive
#

"Indefatiguable means when something is not defatiguable"

#

๐Ÿ˜‚

#

so it means what I think it means, I gather

#

thanks mate!

snow violet
#

Like, that's literally what it means. Assuming you are not running local multiplayer. If it's an online session, local is context dependent upon who called it. But in general, it means the controller that is currently controlling your pawn.

marble depot
#

yeah it doesn't want to start no matter what i do

snow violet
#

Did you google the error code it was giving?

marble depot
#

yeah, nothing useful

snow violet
#

What did you put on the server? Did you just transfer the server.exe or did you also move over the bins?

marble depot
#

the whole folder

#

i turned off the firewall on my computer and it's still not working

proper olive
#

hey @manic pine yesterday you were talking about some server-side tick to use because the game mode only sends the tick .2 times a second or whatever, right? Causing the jittery boats? Is that accessible from BP?

manic pine
#

you have to use client tick

proper olive
#

so just if I'm using tick to modify the location, get the variable from a client RPC before operating on server or just operate the whole thing on client?

#

the tick variable*

manic pine
#

not the tick variable, you need a time variable, ye?

proper olive
#

I'm interping the Z axis to move towards the wave height on tick

#

this is on a component

#

on the boat itself

manic pine
#

do you know what deltatime is?

proper olive
#

I'm running it on client and server both, which is probably just the last bullshit halfass attempt of mine to fix it ๐Ÿ˜„

#

yea

#

the time it takes to render each frame so a multiplier of frames per second essentially

manic pine
#

right, so its not gonna increase or decrease(unless your fps goes up or down), it'll just be the same number over and over

#

if youre doing 100fps, DeltaTime will always be ~0.01

proper olive
#

o wow actually that Delta variable wasn't even being set properly in the first place

#

here it is on the player, which is also jittering:

#

gonna check out those boats w world delta seconds tho

proper olive
#

is the Gameplay Framework Startup Order the same for Servers and Clients?

#

'cause it says in Editor, the Controller would get loaded first, but my Begin Play event isn't firing on Clients until either A) the entire Game Mode data is transferred or B) I use a multicast event from Server side to trigger the Controller to fire up, which then allows me to load in to the game before the Game Mode data is finished loading

#

so..... is there any way I can control that Game Mode data load to clients? And any other wisdoms?

snow violet
#

Your controller BeginPlay won't fire until after AGameMode::Login() gets called.

proper olive
#

oooh ok

snow violet
#

and it's not safe to do any RPCs until AGameMode::PostLogin() is called

proper olive
#

hmm I had some stray code on the map being triggered by my gamemode login so I cleaned that up will give it a go

#

and the RPC is being fired server side, like, say he's just hanging out and hits the Wave emote, that's what I'm using to kick start pending clients to load their controller begin play

#

if that makes any sense???

#

not a workaround just a thing I observed

#

so what prevents the gamemode postlogin from being called? it only seems to take forever (and longer) when I have more items dynamically spawned and saved in arrays on the game mode

#

so I'm assuming it's the downloading of that data that takes so long?

#

yea so it wasn't that random code unfortunately ๐Ÿ˜‚

#

btw I'm pretty sure it's items replicating, 'cause I don't get the lag to load if I never spawn any gear

#

just lowered items* net priority to .5, didn't help.... also tried various dormant and only-owner-replicate things and none of it helped

snow violet
#

That's not how net priority works

proper olive
#

right

#

just ruling out possibilities

#

so it's the arrays of data on my game mode yea?

snow violet
#

I don't know, what is it you are doing in your gamemode?

proper olive
#

loading arrays of item data from save game, but only on begin play so I'm really just guessing here

#

or maybe it has nothing to do with the game mode

#

just all the actors in the world when logging in?

#

turning off the item actor replication completely doesn't help either, altho the server loads into the world instantly

#

so it's still a network thing

#

the server always* loads in instantly

twin juniper
#

this is a fuse cc character, ive done the bone retargetting manually, and maniquine is humanoid and both are, when i retarget this character to"Run" Animation , this is what i get.. LOL xD any advice??

#

both also share the same poses

snow violet
proper olive
#

so when I bypass that network load or whatever, by using the wave emote on server, and load in as the client before all that data is passed through, I already see the item actors and everything so it's already run through the whole loop of loading all of them

#

there's just.... some blockage of communication between server/client when there are dynamically spawned actors in the level

#

no ideas ey? :/

#

I could make a video if that helps?

snow violet
#

Yeah a visual would be nice.

#

I'm also currently working, so I can't really pay too much attention as I have my own code to work through.

proper olive
#

cool beans

proper olive
#

@snow violet and anyone else that wants to help with my client login/load lag problem:

#

I didn't show what I'm doing in my graphs but that can be pics, just lmk where you think the prob might be.... I can show you my inventory load/save system if you want?

zinc zealot
#

hey guys

#

can someone help me ?

#

Like

#

im trying to make a simple online game...

#

and the first thing i wanna do

#

is just

#

create a room

#

where ppl can come in

#

i think the problem is

#

it isn't finding sessions

#

cause

#

when i do this

#

nothing happens

#

Like

#

in the menus for example

#

just no session appears

#

and relatively to the Blue print

#

i like

#

added a print string

#

in each between

#

to see where it stops working

#

and it stops working at for each loop

#

so i connected the Completed

#

and it says Success

#

so i suppose

#

since it isnt feeding Sessions to for each loop it just doesnt trigger the server widget

#

and even if it did (with completed) it wouldnt do anything cause it needs session information

#

So

#

why isn't it finding sessions

#

I tried one from editor and one from launch game

#

and then i tried Both from launch gabe

#

game*

#

doesnt work either way

#

if anyone could message me in private cause im going sleepy now and i rly rly wanted to solve this

#

cause its like a dream to make an online game xD

#

and i've watched like 2 tutorials

#

no idea what im doing wrong here...

#

thx ๐Ÿ˜ƒ

#

this is the tutorial i watched btw

#

i did everything basically the same

bleak lily
#

pyrodev kinda fucked me over in some parts

#

it helped in some parts but I got a lot of problems

#

I had an issue where I couldnt find a session but all of a sudden it worked

rose egret
#

what would be the owner of an AIController that is automatically spawned and possessed when spawning a pawn?

thin stratus
#

Hm, I assume if they have an Owner, then it's the Server?

#

AIControllers only exist on the Server afaik

next falcon
#

Guys i have a big problem..
if i craete a new Project (3 person example), i create a empty actor(replicated), than i do BeginPlay->HasAuthority->delay(2 sec)->add testComponent(replicated)..
i start the game with 2 PIE. after 2 seconds the game when the component gets added, all players disconnects from the server with error (Stably named sub-object not found.)

I tried to reinstall UE4, create new profects (BP only and c++)
How do i fix it ? Or what did i wrong ??

thin stratus
#

Does that happen if the component is not replicated?

#

Does it happen if you use a different component? (replicated and not)

#

Is the Delay needed?

next falcon
#
  1. It doesn't happen when the component is not replicated
  2. i don't know i only add that 1 component
  3. not really just to see that multiplayer works before and after that not
zinc zealot
#

But @luke did u do anything different?

#

@bleak lily

#

Or can anyone help

next falcon
#

@thin stratus if i add the component in c++ it works fine..

rose egret
#

@thin stratus I spawn the pawn with owner. instead of PlayerController I use PlayerState as owner so that clients will have valid reference too.

thin stratus
#

That's fine I guess, but what does that have to do with the AIController?

#

@rose egret

rose egret
#

nothing ๐Ÿ˜ƒ

thin stratus
#

:x But you asked about it

rose egret
#

ah sorry I thought u said APlayerController.
because my pawn is spawned on server . AutoPossessAI is set to PlacedInWorldOrSpawned. so I waned to know who is the owner of Pawn's Controller ? Pawn ? Null or Owner Of the Pawn ?

#

my English is still weak and I can't ask well so lets talk with C++ :|
AActor* Question = pNewlySpawnedPawnWithPlacedInWorldOrSpawnedEnabled->GetController()->GetOwner();

thin stratus
#

What keeps you from testing that?

#

Simply print the Owner DisplayName

#

I actually never tested that, but I assume the AIController is owned by the Server (so no direct owner)

#

It only exists on the server so

meager spade
#

there is no owner on placed or spawned actors

#

well ai actors anyway

vapid mortar
#

why i can't see character mesh on client side

thin stratus
#

BEcause you are only changing them on server?

bleak lily
#

Okay I am having an issue with something kinda weird

#

when one player explodes the other player goes back to the main menu

#

like they see the explosion happen but then it just kicks them out

thin stratus
#

Need code :P

bleak lily
#

alright

#

I will send you it I am just installing something rn so I closed ue4

loud umbra
loud mountain
#

ahm theres probably a lot more needed as I never dived into creating a MMO, its just a massive task

#

But you could do build a dedicated server and maybe use MYSQL as database for saving user data, etc...

loud umbra
#

Thanks for the answer.
I already tried this but I want to save that MYSQL databse in a server so not on my computer its difficult to explain

loud mountain
#

then you could go with a cheap VPS and host your mysql there, I dunno about mysql hosting but I am certain there is too

twin juniper
#

What does this do, and how can I use it?

icy nacelle
#

When I print something out it says 'Client -2: hello'
What does it mean by -2?

thin stratus
#

Just to identify which client window that comes from

icy nacelle
#

Yeah but whats with the minus symbol?

thin stratus
#

Just a dash

#

At least I'm not aware of it having any meaning

icy nacelle
#

Strange that its appearing in one instance and not another though

hard veldt
#

I would like to ask a question, when I create a game state blueprint and play doubles in my game my widgets do not appear anymore. Why does it happen?

next falcon
#

Does someone know a workaround for something similar to a replicated TMap ?

twin juniper
#

I'm sorry to reiterate my question, is anyone aware of what the "Netcode Unit Test" plugin does?

next falcon
#

nvm found a solution

thin stratus
#

@twin juniper Do you know what Unit Tests are?

sharp pagoda
#

@twin juniper logically I would assume it's a network stress unit testing bundle to ensure the netcode behaves as it should in theoretical situations.

next falcon
#

Guys i have a serious problem...
My Networking doesn't work like it should i think..
like i said before
I can't add a simple component(empty but replicated) to a replicated actor
it Disconnects all clients from server with
Error:
https://pastebin.com/trf4LTUV

Also i can't replicate a array (27000 size, INT array)with OnRep (in cpp) With
Error:
LogNetTraffic: Error: UChannel::ReceivedRawBunch: Bunch.IsError() after ReceivedNextBunch 1
LogNetPartialBunch: Error: Final partial bunch too large

#

Pls help me , I can't use the engine anymore if i can't fix it.. ๐Ÿ˜ฆ

next falcon
#

Also i tested it in 4.19.4 and in 4.20
I can't create a simple Int Array with on_rep or add a replicated Component
How can i fix something like that ?

brittle sinew
#

I'm not quite sure I would consider a 27k-long array to be "simple" :p

#

It looks like the max partial size is 64kB, and you're exceeding that.

next falcon
#

jeah i thing a 27k array is okay for replication but the engine can't handle any replication "things"
How could i fix it ? is it even a problem with the engine ?

winged badger
#

how is that okay? you need a 10Mbit connection to replicate that array to 8 players inside 1 second

#

which is generally unacceptable

next falcon
#

okay but even if i split that array to 9k arrays or 3k arrays it still doesn't work
also i can't add a replicated component to a replicated Actor

winged badger
#

how are you doing that?

next falcon
#

Beginplay->HasAuthority()->addTestComponent

#

testcomponent bReplicates = true;

#

TestActor breplicates = true;

winged badger
#

try BeginPlay->HasAuthority->AddTestComponent->SetIsReplicated(true)

#
void UActorComponent::SetIsReplicated(bool ShouldReplicate)
{
    if (bReplicates != ShouldReplicate)
    {
        if (GetComponentClassCanReplicate())
        {
            bReplicates = ShouldReplicate;

            if (AActor* MyOwner = GetOwner())
            {
                MyOwner->UpdateReplicatedComponent( this );
            }
        }
        else
        {
            UE_LOG(LogActorComponent, Error, TEXT("Calling SetIsReplicated on component of Class '%s' which cannot replicate."), *GetClass()->GetName());
        }
    }
}
#
void AActor::UpdateReplicatedComponent(UActorComponent* Component)
{
    checkf(Component->GetOwner() == this, TEXT("UE-9568: Component %s being updated for Actor %s"), *Component->GetPathName(), *GetPathName() );
    if (Component->GetIsReplicated())
    {
        ReplicatedComponents.Add(Component);
    }
    else
    {
        ReplicatedComponents.Remove(Component);
    }
}
#

there is a little bit of a difference there, then just toggling the boolean

#

ofc, if your bReplicates is true by the time you call this, it will fail

next falcon
#

Still same error

vapid mortar
#

i'm still having problem skinned mesh didn't show in client side

next falcon
#

@winged badger Ill just reset my Pc maybe that fixes it

knotty frost
#

@vapid mortar same problem as before, you must replicate those changes

twin juniper
#
void AActor::UpdateReplicatedComponent(UActorComponent* Component)
{
    checkf(Component->GetOwner() == this, TEXT("UE-9568: Component %s being updated for Actor %s"), *Component->GetPathName(), *GetPathName() );
    if (Component->GetIsReplicated()) {
        ReplicatedComponents.Add(Component);
        return;
    }
    ReplicatedComponents.Remove(Component);
}

:3

twin juniper
#

@thin stratus Yepperz! Just trying to figure out how the plugin works.

gray scroll
#

Has anyone setup vivox plugin in UE here?

rose egret
#

how a custom structure change state is calculated? I mean how UE4 realize I have changed value of my replicated structure property? is it comparing just the memory or == opertor?

timber nest
#

Having an issue with replication, and my Character Blueprint not executing commands such as sprint, jetpack, shoot, on the client side 1 instance of the game when played with 2 players. Will post videos

#

So, Server side can jetpack, sprint, etc. But Client side 1 player cannot. Anyone ever come across this before?

sharp pagoda
#

You'd have to show us how you've set it up, but you probably aren't using RPCs

timber nest
#

I think that is also the issue. To be honest I have never set an RPC up, anyone know a good online tutorial?

#

I just used the Multiplayer Shootout2, to get basic multiplayer functionality, and am trying to expand on it from there to port my game in

rose egret
#

how do I correctly use custom net serializer?
https://paste2.org/z4UwXLan
TestRep0 is not replicated at all. NetSerialize don't get called ever ๐Ÿ˜ฆ

late sundial
#

so 2 custom events, other run on server and other multicast, and choose what path it takes if server

timber nest
#

Ok, so for a sprint command. SERVERDostuff would be the Client Sprint, what would I call the second event?

#

Sorry really new to this

#

Teacher says Im getting in over my head, but Im hungry! lol

sharp pagoda
#

Look at exi's network compendium, it's pinned in this channel. You won't understand unless you do so

timber nest
#

Will do. Thanks!

late sundial
#

@timber nest, about those nodes you can just copy them. just make another custom event SprintMulti, like in the upper picture is MULTIdostuff. after the multicast you set your character speed, possible character movement changes (animations) etc..

slate veldt
#

Hi All! Random question about optimization:

If I replicate an FVector and FQuat is it more efficient to send an FTransform with the FVector and FQuat in, or to send them individually?
Wondering if the individual overheads for the Vector and Quat total more than that of the FTransform with the Scale Vector in?

#

I'm assuming individual is the most efficient but I was interested whether it would be cheaper with an FTransform, despite the 2nd FVector due to any overheads I might not be aware of

rose egret
#

@slate veldt Vector + Quat is better . though u have to use compressed alternatives like FVector_NetQuantize etc

sharp pagoda
#

A transform includes scale, so it should be cheaper to send them individually

slate veldt
#

Sure thing, I thought that would be the answer but sometimes there are some interesting surprises!

#

I've seen somethings before (not necessarily ue4) but the larger struct sometimes has a cheaper cost than the individual components

rose egret
#

what do u mean by cost. all structures and basic data types like float int are serialized . the more you compress them the less bandwidth u use

slate veldt
#

dw, it was probably something I've read ages ago that I've mis-remembered! Thanks for the answer

rose egret
#

for instance u can see FHitResult::NetSerialize to find out how ue4 do the net serialization ๐Ÿ˜

timber nest
#

TY @late sundial and @sharp pagoda Will let you know how it goes!

brave moon
#

How to properly replicate widget button being disabled from client to server? i tried creating replicated variable in game state and casting it to widget but it disables button on both client and server only if server clicks it, if client clicks it, its only disabled for client.

thin stratus
#

That's because the Client is not allowed to set the Replicated Variable

#

That's the whole idea of Server-Authority

#

Please read my Compendium which is pinned to this channel

#

@brave moon

fierce haven
#

Does building a dedicated server require the engine be built by source? Most tutorials I see on dedicated servers all build engine from source, wasnโ€™t sure if this was a requirement or not

wary willow
#

@fierce haven Yup

fierce haven
#

Thanks!

#

Also if anyone knows how the experience on hosting a Linux dedicated server as opposed to a windows server? Is it more difficult to manage or have any breaking bugs or is it totally workable for production?

#

Clients will be windows ofc

balmy kindle
#

hey, is anyone experiencing also issues with advanced sessions plugin currently? we dont see any sessions. But it worked earlier^^

next falcon
#

i know that sounds like a stupid question but can someone quick show me how to add replicated components to a replicated actor at runtime?
I have hard problems with it the last days and my way i did it the last yearrs seems to crash everytime ๐Ÿ˜ฆ

summer nova
#

Pubg company told me to add a halo sticky grenade to shooter game. Ive already implemented it

#

but i wanted to comment on the design on something like that

#

do you prefer favoring the shooter?

#

at the moment im doing collision detection on both the client who launched the nade and the server. The first one to get a hit attaches the nade to the body of the enemy

#

this clearly favors the client. but i wanted to know what you think of something of that sort

#

do you know what exactly is overwatch doing with the tracer sticky grenade?

wary willow
#

@summer nova what?

#

Why did PUBG tell you to do that?

summer nova
#

material for an interview

wary willow
#

Oh

summer nova
#

the typical thing

#

do X, and then in the interview we talk about it

#

at the moment i have it as very "favor the shooter"

#

i was also thinking of making it mask latency through animation

wary willow
#

Well, if you get on PUBG

#

you'll be the boss in no time

#

So, go with whatever you want

summer nova
#

they kind of need people with my skills XD

#

so its a good fit

wary willow
#

They kinda need people with skills

summer nova
#

i think ill continue with favor the shooter, but add anticheat code

#

at the moment the launch grenade function is a very trivial Server call

#

wich im also thinking if i should actually do the grenade in the client and the server just replicates a proxy of it

#

to have "0 latency"

#

i was doing that with Arrows for my VR game

#

becouse any latency on a VR game feels like ass

wary willow
#

It definitely does

summer nova
#

my bow was 100% clientiside

#

all hitreg on client

#

it felt great

wary willow
#

Damage?

summer nova
#

that too

#

keep in mind my game is PvE

wary willow
#

So you didn't use any stock

summer nova
#

i give zero fucks about server checking or anticheat

wary willow
#

You basically did your own damage system

summer nova
#

well, it was fairly simple

#

i have a Bow class

#

when the bow is drawn, a couple replicated variables get hit (so the server also spawns an arrow and attaches it to the hand of the player)

#

when the arrow is thrown, it calls a Server function with the launch info (direction and point)

#

the server then launches its arrow (wich is the replicated one)

#

when the client arrow hits something, it sends another Server call

#

basically a Server_RegisterHit(FHitResult hit)

wary willow
#

Hmm

#

that's not what I would consider client-auth

summer nova
#

the server then replicates that to make the arrow dissapear/explode at that location and replicate the damage

#

damage is also done clientside here

#

but its like fake damage

wary willow
#

You're still using the server for the majority of things

summer nova
#

i trigger dmg number and anim

#

uhmm

#

the server is just there to replicate the arrow to other clients tho

wary willow
#

But yeah, I see what you did

summer nova
#

what its 100% clientside is the sword of the player

#

all the sword combat is clientside

#

parries, damage stagger, etc are all triggered clientside

#

in fact, for a player to receive damage, he has to receive damage clientside

#

the server is not checking collision of anything

#

the server just controls the AI and "triggers" an attack animation

#

the rest of the combat is done clientside

wary willow
#

How do you tell other players how much hp the other guy has?

#

Or you don't?

summer nova
#

replicated health variable

#

i will make it work with GameplayAbilities later

wary willow
#

Which needs to be set by the server right?

summer nova
#

yes, damage is set by server

wary willow
#

Aye, so not 100% ;0

summer nova
#

i also calculate damage clientside (predicted)

#

but server overrides

wary willow
#

But yeah, I see what you did

summer nova
#

so when a player hits an enemy in the face, all the damage code is triggered, and the server triggers it too

#

obviously, the server does not trigger stagger to the same player that already staggered the enemy

#

that would cause doublestaggers

#

and double damage numbers

wary willow
#

I have my weapons running client-side mostly logic, only thing that gets verified is the hit location

#

But still a bit tricky, especially when the latency is real

summer nova
#

to test latency, i play with my character artist

#

and if i want to really test it, i play with my character artist, while both of us use wifi

#

as wifi packetlosses quite a bit

#

tfw my grenade is already better than pubg grenade ๐Ÿค”

#

HOLY FUCKING SHIT VAX NOW GENERATES BOTH _IMPLEMENTATION AND _VALIDATE

#

10/10

#

best plugin

gleaming vector
#

it does?

#

holy balls

summer nova
#

it does

#

it used to be quite fucked with it

#

now it only needs to do "return true" on the validate function

#

and it would be 11 out of 10

next falcon
#

Can i replicate a array of size 27000 ?

winged badger
#

if its an array of bytes, barely

next falcon
#

its int

winged badger
#

then no

next falcon
#

why not

#

if its too many bytes why doesn't unreal do it "longer" instead of instant transfer and split it up into little arrys for sending ?

#

-,- now i have to split my array into 10 arrays of size 2700.. ?

gusty spire
#

i cant believe its 2018 and unreal doesn't have a good documentation/tutorial on dedicated server. Me and my other friend have been trying to get a dedicated server to work for 1 month. trash

winged badger
#

UWorks has a decent example and some docs, iirc

#

its not free tho

#

(double check that info before/if you buy it, as i just breezed through the dedicated server bits)

unique thunder
#

is there a repnotify type event we're supposed to use to convey permanent changes to new joining players? For example on beginplay, I have a little function that removes a component from the player / actor and it works, it replicates, except new players that join in can still see it.

winged badger
#

removes it how? replicated component?

unique thunder
#

its a component inside the player (a replicated character actor) and I execute a custom event (run on server) to destroy component

#

component is local inside the character actor

winged badger
#

if the component is not replicated

#

the destruction will not propagate to clients

unique thunder
#

ah gotcha

#

thank you

winged badger
#

you can still reference it over network tho

#

as long as it has a Name

#

and if you exec DestroyComponent on BeginPlay

#

with no networking whatsoever

#

then the component will be destroyed on every instance of the Actor, on every machine

fierce haven
#

working on my first networked game, does anyone know what could cause player join to get stuck at login screen here? if i connect through open 127.0.01 it works fine. but using join session it gets stuck at loading screen indefinitely

#

this is my game instance blueprint which has an event LaunchGame (aka host) and Join Game, which get called accordingly via button click events in the widgets

fierce haven
#

disregard, fixed. was forgetting to set the local Session before calling join server. /derp

winged badger
#

please stick to the channel topic, or #lounge

soft relic
#

why would that only change the speed for clients and not the server?

#

It does move the server pc forward too but doesnt change his walk speed like it does on the clients

next falcon
#

What does that mean?
Stably named sub-object not found.

hardy dome
#

Hey guyz

#

Quick question: why does one character launches another character in the air when spawned?

#

Is it capsule collision or what?

#

They spawn 150 cm away from each other

#

With default capsule components

worthy wasp
#

@hardy dome - yes you are correct... collision responses. Make sure to set the skeletal mesh to NO COLLISION - and leave the capsule component to its defaults. Any components you add to the system need to ensure that they are not blocking PAWN or any other custom object channels you may have created... as it will also launch characters.

A bit of a PITA - but teaches you how to troubleshoot & properly apply collisions to your project โค

#

the capsule component is a default BLOCKER for the ability to NOT OVERLAP on top of other pawns...... unless of course you want that. so wha ti'm saying here is that you need to keep its collision setup because you need that NON-overlappability of your AI

steady briar
#

so the server should spawn projectiles, but does that mean clients should see the servers projectile or should they see their own?

sharp pagoda
#

It depends on the situation. You can spawn non-replicating projectiles on both the client and the server if you're sure that the projectile won't impact other networked actors which could lead to a misrepresentation. If you're spawning something like grenades which are definitely going to become desynced, then you could spawn a replicated projectile on the server, which would propagate down to the client. @steady briar

steady briar
#

im still figuring things out but im making an arrow that sticks into what it hits. works 99.9% of the time and thats considering im firing them like a machine gun instead of slowly like a bow

#

its more of the thought behind it being done correctly or not

#

i think theres a slight difference between the server and client projectile, so if i hit the edge of a moving target, the client one stops because it thinks it hit something, but the server one keeps going and then it fixes the client one when the server one hits because i attach it on server hit

#

if that makes sense. i dont always explain things very well <_<

#

if i play as the server it works, but as a dedicated client it has a small space for error, which would probably only get worse during real usage

jolly siren
#

yeah that makes sense

#

simulate lag to test it more accurately

steady briar
#

ya but is it wrong right from the start though? like, am i seeing the projectile i should be seeing?

#

having an arrow suspend in the air because it thinks it hit something can look pretty bad

shut quarry
#

Hey, I am more the designer guy and not the developer. But I am looking for an tutorial for battle royal, anyone know an good one? I find one on YouTube but this is not complete and the owner stop with this.

bitter oriole
#

@shut quarry You don't need a tutorial for an entire game. If that exists, then you're not creating anything players will want to play. Think ahead on paper about what your game is like, and then implement the features individually

#

Learn, practice, try things, change until it's great

shut quarry
#

@bitter oriole this is only the basic ๐Ÿ˜‰ for sure I have my own features as well. But I am looking for the basics first!

bitter oriole
#

The basics is a shooter

#

Battle royale is a shooter with 100 players

#

That's about it

#

ShooterGame covers it all, though it's a bit complex

steady briar
#

i know a lot goes into anything but shooters probably have the most built-in stuff and examples to go on

shut quarry
#

@bitter oriole sorry but I ask about an tutorial and not for some politics and your vision of the life

bitter oriole
#

You found out yourself that tutorials for an entire game don't actually exist

#

I'm telling you why

steady briar
#

@shut quarry why not ask whoever made the tutorial?

bitter oriole
#

I also gave you an additional pointer - ShooterGame is like, 99% of a BR game

shut quarry
#

@steady briar I do and he stopped because of time and YT money haha

bitter oriole
#

Complete with matchmaking friends etc

steady briar
#

u can use the built in shooter stuff for most of it, the rest is visuals/modeling

shut quarry
#

@steady briar yes I think this is my plan now. Stuff like lobby, menus, connection all this is done. Only stuff like inventory, weapons etc is missing

steady briar
#

is it a persistent inventory or pre-defined in the round?

#

i think for a lot of shooters you dont need an inventory really, its more of a "press this button, take out this item" which is a lot lighter than a full blown inventory system

shut quarry
#

But here u need it in the round.

#

For items

steady briar
#

ya so you would need a menu that assigns a pre-defined weapon and tell it -that- is what "2" or whatever button does

shut quarry
#

And inside of the Battle Royal u can do small quests and work on your karma and for all this u need an inventory

steady briar
#

unless player 1 "Rifle5" is different than player 2 "Rifle5" it shouldnt be too much to do

shut quarry
#

Yes

steady briar
#

yes what, and what battle royal do u mean

shut quarry
#

I send u an pm

steady briar
#

its royale btw unless ur talking about like... princes and kings fighting i guess

bitter oriole
#

Shhh, politics ! ๐Ÿ˜‚

cloud ledge
#

Hmm. What's the most efficient way to send a mostly constant-length list of fixed-size structs?

next falcon
#

Error: Stably named sub-object not found.
Any ideas how to fix that ?

winged badger
#

did you try to replicate a reference to that component too?

#

something alongside the lines of AddComponent->SetIntoReplicatedVariable

cloud ledge
#

BTw

#

The answer to my question was... just serialize it manually

manic pine
#

yeah i was trying the component stuff too, but ive never done dynamic replicated comps in bp before

#

no go no matter how i tweaked it, with or without replicated reference

winged badger
#

replicated reference to a component that is not yet added to the ActorChannel would be a problem

#
In general, these are the guidelines to go by to determine if you can reference an object over the network:

Any replicated actor can be replicated as a reference
Any non-replicated actor must be stably named (loaded directly from a package)
Any replicated component can be replicated as a reference
Any non-replicated component must be stably named.
All other UObjects (non actors or components) must come directly from loaded packages
#
Components are stably named if they were:

Loaded directly from a package
Added via simple construction scripts
Manually marked (via UActorComponent::SetNetAddressable)
This should only be used when you know you are manually naming the component so that it has the same name on the server and client (a good example are components added in an AActor C++ constructor)
vocal echo
#

Quick question - if an actor is replicated and has a component that is replicated, can a pointer to the component be passed via RPC?

winged badger
#

@vocal echo what i pasted right above your question is the rules for when you can reference objects over network

unique thunder
#

I'm using a playerstate to store Team selection but it's not working on re-spawn for some reason.

#

Set-up: Choose team > cast to playerstate > set team variable (name) > play.
On death > spawn character > possess.
On possess > cast to playerstate > get team name > switch on name > execute logic based on team selection.

#

Looks like the team reference in my playerstate isn't getting passed around or the characters I'm spawning aren't technically controlled when the attempt is made and playerstate is null.

vocal echo
#

@winged badger Completely missed the line about actor components in that! Thanks mate

winged badger
#

is choosing a team replicated to server?

#

any input action you want the server to take note of has to be RPCed @unique thunder

#

also, if you are selecting a team on a different level, you might end up with a different PlayerState instance

#

SeamlessTravel being the only version where it persists

unique thunder
#

Ah yeah that was dumb of me, I re-worked the logic a while ago and forgot to run the team set on server

#

I have this other thing I tried to modify but it's not working in a multiplayer scenario so I'm not sure how to handle it

#

Set-up: Spawn projectile, delay 0.012 seconds > run server event > run multicast event > set projectile mesh visibility to true.

On hit > destroy actor (self)

#

as far as I know, visibility toggles have to be multicast but this now causes my projectile to remain visible after death somehow & clients don't see their own projectiles

winged badger
#

why would you introduce additional lag on server/other clients?

unique thunder
#

I just need to keep my projectile invisible for 0.012 seconds, is there a better way to do this?

winged badger
#

on every machine?

#

BeginPlay of the projectile Actor

#

SetTimerByEvent (0,12 sec delay)

#

then set Visibility from there

unique thunder
#

just use a set vis node there? will it replicate?

winged badger
#

it doesn't need to

#

every instance of that Actor on every machine will run its own BeginPlay

unique thunder
#

weird, I was told that visibility toggles had to be multicast to all clients to replicate the change everywhere

winged badger
#

the difference here is

unique thunder
#

but I guess since the projectile being spawned everywhere, each client runs their own instance

winged badger
#

that BeginPlay acts as a Multicast

#

but without an actual RPC involved

#

you can do it as the timing is specific, 0,12 seconds from when it spawns

#

so the SpawnActor ends up serving as your SetVisbility Multicast in this case

unique thunder
#

That makes sense, thank you

manic pine
#

@winged badger Those guidelines don't really seem relevant to the problem here though, seeing as it's failing the entire replication process and booting the player with something as simple as this in a random actor:

hardy dome
#

@worthy wasp tried setting all the character meshes to NO COLLISION, but they jump anyway on spawn. Also those meshes are a bit bigger than capsule components, maybe that's the problem?

ember needle
#

...any ideas?

jolly siren
#

Why replicate the camera? Why don't you just spawn a new camera on the spectating client and attach it to the simulated client's pawn?

ember needle
#

why a new camera though, it already exists

jolly siren
#

Well the simulated client's camera won't exist. But yeah you could re-use the players camera who died and attach that to the new pawn

ember needle
#

I don't understand, the first example here above (bottom screen, the dead player) attaches to the camera of the other player (top screen), so both cameras already exist... no?

jolly siren
#

Right, you can use the dead players camera and attach it to the player you want to spectate. You don't need to replicate the camera to do that tho

ember needle
#

understood, my replication attempt was to fix the fact that it is rotated... which is my issue

jolly siren
#

ahhh

ember needle
#

I am not using the dead player camera

#

i am blending to the living player camera from the dead player camera

jolly siren
#

ah okay, I didn't think those would exist for simulated clients. Guess I was wrong

ember needle
#

๐Ÿ˜ƒ

#

well maybe you are not and that's why it is only partially working

manic pine
#

yeah, cameras are just part of the default character bp

#

are you manipulating the camera in any way on the local client

#

because, at least by default, the weapon mesh will be attached to the camera itself

ember needle
#

what

#

no

manic pine
#

so even if your camera was wrongly tilted, the mesh(hands + weapons) would still look right

ember needle
#

the weapon mesh is attached as component

manic pine
#

attached to what

ember needle
#

to the hand socket of the mesh when equipped

#

camera is part of the character BP

#

pretty standard stuff

manic pine
#

the default is:
Camera
-> Hand mesh
-> Weapon mesh

#

where hand/weapon mesh are both owner only see i believe

ember needle
#

yes, weapon is spawned dynamically so not part of character BP

manic pine
#

how are your use controller pitch/yaw/roll settings

celest sigil
#

Has anyone ever made a shared multiplayer quest between two players?

winged badger
#

quest is on the server, everything about the progress is tracked server side

#

only thing you replicate is the information Players need to keep track of their progress

celest sigil
#

10-4

next falcon
#

Helloo guys
I have a Array of max size 27000
I would like to replicate the array
How can i do it ?

manic pine
#

not sure you can

#

tarray replication is limited to something like 2048 items and 64kb total

#

supposedly you can manually remove this limit by editing engine source, at the cost of other potential problems

proper olive
#

hey guys, so I wanna put a name above items around you when you press an item, got it all working well for server, but in theory... my items are spawned server-side and I guess their variables and everything gets replicated to clients, so when I want a client to change something on only their instance of it, it doesn't want to work, right? Cause it really only exists server side? So I figured ok, I'll just spawn an array of widget components (blueprint only here) on client side, but that won't work cause you can't do that right? They have to be pre-existing components? any thoughts on working around this?

#

how it looks server-side. Client-side can get the item highlight working so I don't really get why it won't work, I have the component on each item actor, set to replicate

next falcon
#

what?
is that just a simple "No" to big array replication??

proper olive
#

no like... I'd have to limit the # of nearby items

#

to whatever amount of components I have on the character ready to assign to nearby items

#

I'd rather just spawn them dynamically but the node says "internal blueprint use only, do not call manually" for spawning widget components

#

oh sorry you were talking before

#

lol my fault

next falcon
#

xD its okay

winged badger
#

@next falcon what do you want to replicate?

proper olive
#

I'm using big arrays replicated too, haven't tried with massive #s of things yet

next falcon
#

an int array of max 27000

winged badger
#

because if its something along the lines of a procedurally generated information

#

you could be better off just replicating the random seed

#

having the clients re-create the array themselves

manic pine
#

ive gathered that the epic team wants to do big data replication, but never read that they actually implemented it

next falcon
#

jeah i do but if i change some number in it, i need to save that somewhere and if i changed everything i need a complete new array

manic pine
#

so i think youre stuck with either working around it(dividing it on multiple arrays or whatever) or using your own socket

#

do a delta array

#

i.e. members that have changed

winged badger
#

iirc array will replicate in its entirety

#

so changing one number in array of that size is costly

#

you can always RPC the change itself tho

manic pine
#

make it a pair, like <indexofmemberthathaschanged, newdata>

#

when client receives it, it knows to change the original array

#

of course, youd still be limited to 2,048 changes

next falcon
#

jeah but what if 2 players change the same pair ?

#

at the sane time

winged badger
#

change how?

#

any changes that players make that's affecting that array

#

would have to be RPCed to server

#

so it would be server authority, just like everything else

proper olive
#

so it's only a max of how large of an array if you're trying to transfer all of the data between server and client*? so if the transfer is simply an index #, then you can store a huge array on server?

next falcon
#

example:
Array from Seed: 1,2,3,4,5,6,7,8,9,0... MaxSize: 27000 CurrentSize: 27000 (not replicated, only the seed)
Saved Array: 1,6,3,8,5 MaxSize: 27000 CurrentSize: 5 (only on server)
Modified Array: 1,6,3,8,5,6,7,8,9,0 MaxSize: 27000 CurrentSize: 27000 (On Server and Clients)

#

the saved array is implemented into the generated array and Can be up to 27K and that i need to replicate or get the data from the server

proper olive
#

so um.... sorry to interject but here's what clients see when I press the button in my situation:

winged badger
#

i just skimmed your above text @proper olive

proper olive
#

the set highlight event has no problem firing on clients

winged badger
#

you can have WidgetComponents on your Actors

proper olive
#

yeah that's how it's set up now

#

one on each item

#

on itself

winged badger
#

that will show the widget locally on some condition, filtered by IsLocallyControlled

#

that works only if you have a simple use case, as in you press E and item is used, depending on its Interaction interface how

proper olive
#

this is what I'm doing

winged badger
#

if you need a more complex interaction however

proper olive
#

so this changes the name whenever it needs changing

manic pine
#

why do you call it on server

#

isnt this for clients?

proper olive
#

and above sets the visibility of nearby items on that component when pressing a button

#

the name is replicated to everybody, so it has the name saved on it

#

for other purposes

#

it was in use for other stuff already

#

I just tried adding a multicast btw, in case the name was blank for some reason, but that's not it - I can access the name by clicking on the actor and using my other code there

manic pine
#

widgets arent replicated

proper olive
#

the problem is the replication of the visibility of the component

#

even widget components?

manic pine
#

hmm good question

#

i never use them so im not quite sure

proper olive
#

yaaay a good question lol

#

I'm so rare w those

winged badger
#

you need a trigger that works locally

manic pine
#

anyway, you shouldnt need to interact with server here

#

you just need local stuff

proper olive
#

I wanna just spawn the widget locally

winged badger
#

for example, have the Actors track the LocalPlayerPawn

proper olive
#

but you can't do that at runtime in bp?

winged badger
#

or react to an overlap

manic pine
#

keep in mind, the client can do whatever he wants to an actor(short of destroying it)

proper olive
#

yeah I have it doing on overlap rn

#

when I run this code on client it doesn't set the visibility of the component tho

winged badger
#

OnBeginOverlap->Cast OtherActor to Pawn-> Branch (IsLocallyControlled) -> SetVisibility(True)

proper olive
#

maybe I need to spawn one of these on every actor on every client?

#

not just have it be a native component?

manic pine
#

native component should be fine too

proper olive
#

just run is locally controlled?

manic pine
#

you just need to set text content and make sure its visible when you want to

proper olive
#

yeah its the visibility at this point

#

so wait fire the overlap from the item?

manic pine
#

you can set the text content on beginplay, then do like Zlo says on overlap

#

to toggle visibility

proper olive
#

I can't toggle overlap from pawn tho?

#

I'm actually doing this on the controller

manic pine
#

when exactly do you want them to show

#

and hide

proper olive
#

when I hold the L button

#

which is in the above screenshot

#

like diablo "show interactable items names" kinda button

#

I just changed it to use IsLocallyControlled and no network RPC

#

I'll see how it goes

#

running on the controller tho

winged badger
#

you can do it from Pawn, but you will need to find nearby items

proper olive
#

yea ok I got that

#

see the ss

winged badger
#

having 4 chats atm, so i must admit i didn't read through the BPs

proper olive
#

lol

#

np

#

thank you for all your help as always fam

#

all of vous

winged badger
#

basically you'd need to find nearby items, filter them by class (interface better) and then call the interface function that sets the visibility of widget component to true

#

no networking, just local exec

proper olive
#

^ that's the trick hopefully

manic pine
#

hiding them is more tricky, since you need to hide it both when user releases button, and when the item is outside the range

proper olive
#

the IsLocallyControlled....

#

I could change it to fire on a timer

#

and save them all to an array, clear the array

#

check distance etc

#

easy peazy

winged badger
#

do not check distance, check distance squared

proper olive
#

it's often just "getting it to work on client" that's the hard part ๐Ÿ˜„

winged badger
#

but if you're tracking you'll have to retrace anyways

proper olive
#

and then the dreaded "seeing it on other clients" ๐Ÿ˜„

#

yeah so just clear them each time

winged badger
#

because what you described wouldn't catch the new items that you walked into the range of

proper olive
#

doesn't work

#

I'm guessing it's cause widgets don't replicate?

winged badger
#

they are not supposed to replicate

#

otherwise whenever someone presses L all widgets would pop up for everyone

proper olive
#

so I'm thinking I need a RepNotify to spawn widgets clientside?

manic pine
#

repnotify is for replication

proper olive
#

well I could easily filter it by IsLocal is they replicated ๐Ÿ˜‰

manic pine
#

youre not doing anything network-wise

proper olive
#

yes I am

#

I spawn the items ๐Ÿ˜„

manic pine
#

^___^

proper olive
#

the items are dynamically spawned, saved/loaded

manic pine
#

doesnt matter

proper olive
#

so if a player logs in after theyr'e spawned

#

I have to spawn a widget for them

manic pine
#

the data has already arrived on the client

#

yes, the client can do that

proper olive
#

if I just do it on beginplay?

#

๐Ÿ˜‡

#

for the item

manic pine
#

like i said, clients can do whatever they want with replicated actors

#

except destroy them

proper olive
#

ok ok here's the problem I forgot

#

you can't spawn widget components at runtime?

manic pine
#

not sure what you can do from blueprint

proper olive
#

yeah :/

manic pine
#

doesnt matter though, you can just make it part of the bp class

proper olive
#

maybe I can ask in bp chat since this seems to not be a replication issue

manic pine
#

that seems wise, the only part of this that requires replication is the actor itself(obviously), and, in some form, the name you want to display... and maybe not even that, depending on how much the client knows about the object already

proper olive
#

yeah I'm gonna try just spawning a .... :deep breath: normal widget :sigh: instead

#

๐Ÿ˜‚

#

oh that won't work for 3d space anyway nvm

next falcon
#

okay guys other ideas i can try?
Split my array into 30 arrays(900 Size) and that doesn't work.. :/

manic pine
#

you manually wrote 30 array declarations?

next falcon
#

yes -,-

#

2 times

#

first in a struct to test it but failed

#

than in in the actor itself

manic pine
#

any more specifics than 'failed'?

#

how big are the items youre trying to rep

next falcon
#

what do you mean with "big" ?

manic pine
#

how many bytes does a single array element occupy

next falcon
#

its a int array

manic pine
#

ah, so 4

next falcon
#

jea

manic pine
#

well, its not reaching the limit then(900 * 4 < 64*1024)

#

and not the element limit

#

so technically it should work

next falcon
#

well i do a 3d loop for adding it
does that effect it maybe ?

manic pine
#

what do you mean by adding it

next falcon
#

for (int X = 0; X < 30; X++)
{
for (int Y = 0; Y < 30; Y++)
{
for (int Z = 0; Z < 30; Z++)
{
//Select array from Z Index and add it to array
}
}
}

manic pine
#

what are you adding it to?

next falcon
#

to my arrays

#

my 30 arrays

#

but it still doesn't work with the 30 arrays

manic pine
#

just so we're clear, your arrays are declared like this ye:

UPROPERTY(Replicated)
TArray<int> Array1;
next falcon
#

jeah but in bp

#

should i try in cpp too ?

manic pine
#

first explain how you know its not working... are the client-side arrays empty?

next falcon
#

yes

#

but without error

manic pine
#

but the server side arrays are full yes

next falcon
#

yes

manic pine
#

and youve confirmed server-side theyve no more than 900 items

next falcon
#

yes

manic pine
#

hmm youre always running into the weirdest of problems

#

are you getting any log errors

next falcon
#

no log errors

#

i know its hard for me too :(
i need to work with that

manic pine
#

its a silly approach, having 30 replicated containers just like that, but i dont see any immediate reason why it wouldnt be replicating

#

if the actor itself was reaching some kind of limit, i'd expect it to throw some error

#

or at least a log entry

winged badger
#

at this point it would be worth checking the Actor is indeed replicated

#

especially if its the same one with the troublesome component

manic pine
#

i ran into that one too zlo, 100% reproducible

#

could you try that on a random actor?

#

i'd expect it to work, but it doesnt

winged badger
#

no problem in c++ tho?

manic pine
#

ive done dynamic replicated components in cpp many times

winged badger
#

i really dislike some aspects of BP replication

manic pine
#

i think this might be somethign to do with the "AddComponent" function... or just bps, i dont know

#

rarely use them

winged badger
#

force the local value of a replicated variable (with RepNotify) to change on the client

next falcon
#

okay guys ill get some food now and think about it and than test everything in cpp

winged badger
#

and watch it call OnRep on itself

#

for example

manic pine
#

huh, does it do that on authority too?

winged badger
#

it does

manic pine
#

thats very inconsistent with cpp

winged badger
#

and very inconventient if you want to bind functions to delegates

#

since you can easily end up doing it twice

manic pine
#

yes, could get very hard to track

#

actually works with 5k elements too, though its taking 5-10 seconds on the client before he can begin play since its part of the initial replication data

winged badger
#

imo, there has to be a better way to design it, then to replicate an array of that size

manic pine
#

agreed, but i dont know what kind of data this is

winged badger
#

i don't either, but the entire idea of "hey, lets replicate a 100kB array" would be a non-starter for me

#

if you had a listen server with shitty ADSL connection and 8 players, it would take upwards of 10 seconds just to replicate that array... once

manic pine
#

haha ye could get very nasty

next falcon
#

@manic pine do that 30 times for 30 arrays and tell me if it works xD

manic pine
#

hahaha

#

no

next falcon
#

xD

manic pine
#

with that amount of data, even in different arrays, you might be running into a partial packet limit

#

i think the engine only allows something like 512 partials or whatever

next falcon
#

just to let u know what i try to do:
I try to make a chunk-based world system like minecraft
The chunks are 303030 = 27000
if something changes everyone needs to know

#

30 * 30 *30

manic pine
#

does everyone need to know everything immediately

next falcon
#

only the guys who replicate the actor so who is near the chunk

manic pine
#

distribute some actors around in a 3d grid

#

each responsible for his volume

#

set network relevancy distance to something sensible

next falcon
#

distribute some actors around in a 3d grid what does that mean ?

manic pine
#

well lets say you have one actor at 0,0,0 another at e.g. 10000, 0, 0 (100 meters away), etc., etc.

next falcon
#

yes

manic pine
#

each is responsible for the part of the world between him and halfway to the next actor

next falcon
#

yes

manic pine
#

when player gets into relevancy range of one of these actors, it's replicated to him

#

along with any part of the world that actor is responsible for

next falcon
#

okay yes

manic pine
#

thus, the most data any single actor has to replicate to clients, is the chunk he's responsible for

#

and only part of the world that is relevant will be replicated

next falcon
#

yea but i still need to replicate the volume of at least 1 Chunk which is a 27K array

manic pine
#

27k blocks in one chunk?

next falcon
#

yes 30 Block * 30 Blocks * 30 Blocks

manic pine
#

well, you can take that further down at your own discretion, right