#multiplayer

1 messages ยท Page 82 of 1

storm zinc
#

so as long as I edit a 'client side' thing, I don't have to redo the server in visual studio and can just let it run?

fossil spoke
#

Nope

storm zinc
#

the dll compiling won't affect it at all?

#

hmmm

#

so if I play in editor, would I have to do standalone and turn on the 'run in one process'?

fossil spoke
#

You can also just setup a test case that doesnt require the login process

#

Why not just feed it a prebuilt base64 value

#

Just to test that your code works

storm zinc
#

mmm

#

k

#

Should have stuck to World of Warcraft LOLOLOLOL

fossil spoke
#

Making games isnt easy.

storm zinc
#

haha ya

fossil spoke
#

People think it is, until they try it.

icy jetty
#

No, no your game idea of a CryptoBarbie with NFT clothes sounds interesting.

storm zinc
#

lolol

#

We are trying to get it to not lag

#

we did a test run last week with 3 of us

#

and I was getting 45fps on a 5700XT and they were around 50-60fps on 4080's.

#

standing next to a castle that is almost fully built but

#

there is a 3x3 grid of world partition right now

#

and it's like that, with nothing but that in it.

#

well... I say nothing, but there's probably 'stuff'

#

there were floating islands before so who knows what is there.

#

I think the replication is what is killing it

#

the castle floor 1 has around 50 light "sconces' around the walls that are replicated

#

I am assuming that even if I can't see it, the server still tells me that it's on * 50 lights

icy jetty
#

Do they need to be replicated? Are you turning them on and off ?

storm zinc
#

you could

#

it's a castle that is massive, and meant to house hundreds of people

#

so there are floors of dining halls

#

and each floor has wall lights. We will probably have them on all the time

#

but there are ones on tables that are toggleable by players

icy jetty
#

Are you working on Third Life? ๐Ÿ˜€

storm zinc
#

fourth

#

it's seriously crazy

icy jetty
#

Sounds neat

storm zinc
#

We want to make it so that you can use characters from other projects in it.

#

but that means we have to make APIs to communicate outbound to other projects.

#

So lets say, your doll is in space in some other one. Their servers have to request a 3D model of their character in our game in whatever format they use.

#

It's a nightmare

#

some use Unity, some use some javascript thing

icy jetty
#

Cross-engine stuff eh

fossil spoke
#

Good luck, sounds like a nightmare not worth bothering with.

storm zinc
#

lolol

#

ya, that's in the future though

#

we tried to make a consortium between a few of the larger projects, and no one seemed interested so we dropped the discord server

#

I actually wanted to figure out how to export a character's 3D assets to some generic format as a file on a server side, not a plugin in-editor.

#

But couldn't find one lol

#

I would assume it'd have to be custom made.

#

like, export something to GDL or whatever that binary format is that javascript uses. or three.js

#

GLB

#

Albion guys were kind of smart using Unity as a front-end in that regard I guess.

#

everything else is like Python servers and what not

#

have a backend that converts some server side objects to X target code.

#

I bet they could just port it fairly simply on a client to interpret in that way.

#

anyway. Off topic...

#

back to work

whole axle
#

I have this with server reliable, playing with 2 player as Clients but dosent move, should move right?

#

Im using a interface

#

Okay, im trying to turn on and off a light, i have a switch with a interactable interface

dark edge
#

protip

#

just don't use multicast

#

until you know you want it

#

OnRep is your friend here

#

Owning Client:
Input -> run on server RPC

Server:
Server RPC -> set replicated variable

Everywhere:
OnRep -> do something with new variable

whole axle
dark edge
#

Read what I linked, it's down towards the bottom

#

but basically

#

special function runs when replicated variable is updated (this is good)

#

so when bIsPowered is updated, you can toggle the light

whole axle
#

Mmm okay i'll try

#

But i never reach the Server Function because i dont have authority

whole axle
#

I dont know why, i never reach the Server Functions

fathom aspen
#

Yeah should be

magic vessel
#

I've got a problem with the fast array serialiser. I'm using it to be a more efficient method of updating my clients with the arrays but the post replicated add, etc are not being called on the listen server player

silent valley
magic vessel
#

These functions:

    void PreReplicatedRemove(const struct FReplicatedAreaClueArray& InArraySerializer);
    void PostReplicatedAdd(const struct FReplicatedAreaClueArray& InArraySerializer);
    void PostReplicatedChange(const struct FReplicatedAreaClueArray& InArraySerializer);
silent valley
#

I've never used them but looks to me like they only get called on Clients also

magic vessel
#

Yeah, but with on rep, you can call them on the server to allow the listen server to receive the client side updates

#

I'm trying to find the same for the fast array's functions

red vine
#

when it comes to the replication property Net Cull Distance Squared what geometric shape is representative of it?

#

I was thinking a sphere but I'm not sure

chrome bay
#

sphere

#

It's a simple "viewer distance from actor location" test

red vine
#

and this is applied in the z axis as well

chrome bay
#

yeah. Unless you're using rep graph, then no

#

Actually, ignore that

red vine
#

ah perfect thank you! oop-

chrome bay
#

yeah rep graph is 3D distance as well, just actors are sorted into 2D cells first

red vine
#

what made you- ah ok that's great

#

brilliant thank you so much

chrome bay
#

keep in mind though the connection takes a few seconds to actually decide to close the channel, so it's not an immediate hard-cut off

red vine
#

but it's an immediate replication once it crosses that threshold distance?

#

(at least it seems immediate?)

chrome bay
#

The channel should open again once it's within that distance if it was closed, but the actor has to be non-relevant for a few seconds before the engine stops replicating it

#

Assuming there's bandwidth to send it in the same frame it became relevant at least

red vine
twilit fable
#

Good day to you guys, is there any body here that have experience with unreal engine Steamcore multiplayer setup which is non region locked?, If anyone get the experience you can let me know so we can discuss and negotiate on my work

solar stirrup
#

No real way around it unfortunately

magic vessel
#

I was halfway through implementing my own dirty array implementation before reading this, it's now working pretty much how I expected ๐Ÿ™‚

dusky pecan
#
LogGameMode: Display: Match State Changed from InProgress to Aborted
LogGameState: Match State Changed from InProgress to Aborted
LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_0, Driver: GameNetDriver IpNetDriver_1, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Channels: 2, Time: 2023.05.05-14.34.06
LogNet: UNetConnection::SendCloseReason:
LogNet:  - Result=FailureReceived, ErrorContext="FailureReceived"
LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_0, Driver: GameNetDriver IpNetDriver_1, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID
LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionLost, ErrorString = Your connection to the host has been lost., Driver = GameNetDriver IpNetDriver_1```
dusky pecan
chrome bay
#

Literally the first line:
NetworkFailure: FailureReceived, Error: 'Could not find a starting spot'

#

Should be a big clue

glass orchid
#

How do i prevent the player controller from saving a startspot?

mild quail
#

Hello Slackers ! I'm having some trouble with multiplayer and movement replication. I want a diablo like movement, so I use the BP method SimpleMoveTo when user clicks on his screen. It works, but on the client it looks like it does not know it's moving. Like it's all laggy and feels very odd. here is a gif for sample :

#

Whereas on the server, it runs perfectly fine.

#

Anyone has an idea where is my mistake ? ๐Ÿ™‚

solar stirrup
#

You should predict the movement clientside as well

#

And you'll likely have to implement your own replicated movement component for this kind of movement

ruby lodge
#

Hey guys, i am having an issue with the packaged game where i can find multiple sessions when refreshing. When i try to join one of those it takes me back to main menu only. Here is my refresh button code. It is from widget BP

storm zinc
#

So I think I found out what's happening and why I can't test this editor. It's when it tries to load a world partition map in the editor. It starts to load, I get a flash of the map and then unreal crashes ;s

storm zinc
#

[2023.05.05-18.08.26:072][148]LogWindows: Error: appError called: Assertion failed: PIEInstanceID != INDEX_NONE [File:G:\UnrealEngine\Engine\Source\Runtime\Engine\Private\WorldPartition\WorldPartitionLevelStreamingDynamic.cpp] [Line: 451]

#

ahhh

vestal token
#

Hi there. It's not rly about UE, but maybe somebody knows any good Network library that built on top of UDP and allow reliable and unreliable UDP functionality and also is cross platform. I've heard about ENet library so far, but seems like it's a bit old one, maybe there is some newer\better? Main requirement is to be decent for MMO game that means it has to be able to handle a lot of data transfer.

hollow eagle
#

enet is the gold standard, it being old doesn't really matter.

#

it's also still under active development

slow wing
#

Is there a way for a client to tell the server it has deleted a UObject or to otherwise clear the shadow state of a UObject for a given connection (the server knows in advance which client will be deleting the UObject since it is the one calling the RPC to do so). It's for a UObject that is conditionally replicated to some clients, but once I no longer want to replicate to a given client I want that UObject deleted on the client, but the client could later on become interested in the UObject again

rose egret
ruby lodge
#

why is it not showing the correct avatar but it is showing the correct player name? I tried it with my dad and he saw his avatar as mine and i saw mine as his. The first image shows the same as the 2nd but in the first the important nodes for the player name are selected and in the 2nd the important ones for the avatar. I can't see a major difference there tbh. Anyone has an idea?

dark edge
#

What are you trying to do here?

ruby lodge
dark edge
#

Multicast = race condition if this is a thing that happens at begin play

#

What are you actually trying to do?

ruby lodge
#

i am trying to display the player name and avatar over his head

dark edge
#

avatar being some image?

ruby lodge
#

yes

#

steam pfp

dark edge
#

and does this apply to all characters on all machines?

ruby lodge
#

wdym?

dark edge
#

like any time a character is visible, they have a name and avatar over their head?

ruby lodge
#

yes

dark edge
#

ok so have name and avatar be replicated variables on the character / pawn

#

with repnotify turned on

#

and in the repnotify, do the actual "showing"

#

that simple

#

then the server just sets
Name = "Mingebag"
Avatar = Mingebag.jpg
or whatever.
And it'll Just Workโ„ข๏ธ

ruby lodge
#

but the playder name is working

#

just the avatar not

dark edge
#

well that's just a happy coincidence, that would probably not work for late joining or if there's any appreciable lag or whatever

#

do not multicast state, use repnotify on it

ruby lodge
#

well it is late joining

#

where it works

#

all joining

dark edge
#

Name and Avatar are not temporary. If for some reason they don't get the multicast, they will never know.

#

Name is probably already replicated depending on how you're doing it. But learn Repnotify and use it, it'll be 100x simpler and more robust.

#

Yeah PlayerState.PlayerName is replicated

ruby lodge
#

hm okay

ruby lodge
#

i'll test it out

dark edge
dark edge
#

later, you can make it more eventful to only run when name or avatar is changed.

#

or on whatever event guarantees an up-to-date name and avatar

#

make a function in the widget to update itself, call it on a timer. See if that works robustly. Then figure out when to call it (when name and avatar are in a good state)

#

but nowhere should you need a multicast for any of this.

dark edge
icy jetty
#

Lol thatโ€™s not at all what I expected

dark edge
#

It was the default name in GMod so if your name was Mingebag that means you're a nub who hasn't changed their name or model yet.

stoic matrix
#

When i searching sources many time i saw item instance has its own string id, i wonder why they need them? Instance object hasn't unique id itself?

nocturne quail
#

anything spawned by server will be existed to all clients?

#

or the server needs to spawn the same thing on all clients by calling multicast?

fossil spoke
nocturne quail
fossil spoke
#

The child classes would also then be set to replicate

#

Unless they themselves have overridden that.

#

You may need to do some reading on the concept of Inheritance in Object Oriented Programming

nocturne quail
#

I have an Item base class and it is set to replicate true, and that class has a child called WeaponItem, when I spawn weapon item on server it spawned in the level but the skeletal mesh comp in this actor is not replicated

#

if I set to replicate true on the skeletal mesh comp, it replicates

nocturne quail
fossil spoke
#

So set them to true?

#

Components can also choose to be Replicated or not

nocturne quail
#

actor should replicate them automatically

fossil spoke
#

That makes no sense

latent heart
#

It might be bad practice to circumvent component replication and do it yourself. But you still have to tell the actor that a components wants replication.

nocturne quail
latent heart
#

ForEachComponent(...) { ...SetIsReplicated(true); } ?

#

Or just tick the box.

nocturne quail
#

Ok, I will tick the boxes of all of them, but still I am strongly thinking that I need to replicate the actor properly using:

virtual bool ReplicateSubobjects(class UActorChannel* Channel, class FOutBunch* Bunch, FReplicationFlags* RepFlags) override;
fossil spoke
#

Dude, no.

#

Just tick the boxes and move on lol

nocturne quail
# fossil spoke Just tick the boxes and move on lol

Ok, thank you already ticked them and now it is working.

and this function is assigning unique keys for every newly replicated object?

bool bRepCond = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);

    if (Item && Channel->KeyNeedsToReplicate(Item->GetUniqueID(), Item->RepKey))
    {
        bRepCond |= Channel->ReplicateSubobject(Item, *Bunch, *RepFlags);
    }

    return bRepCond;
fathom aspen
#

Supposing that GetUniqueID does that reliably, then yes

nocturne quail
#

any idea how to test the audio component between two clients on the same pc?

latent heart
#

Have one client use the left channel and one use teh right? ๐Ÿ™‚

nocturne quail
#

I were planning to mute the owner client which is firing, and the other client should listen to his sound

#

but I will follow your perfect idea

#

client one = left, client 2 = right

clear island
#

so I'm using bUseControllerRotationYaw = true and from the server I want to rotate a character that is controlled by a client, I'm getting the controller and doing SetControlRotation(FRotator), but this does not work from the server, except for the listen server player ofc

#

is this normal? I assumed it would already be replicated, do I have no other option than to send an RPC/create a rep notify?

kindred widget
visual holly
#

Hello, In local multiplayer whenever Player 0 spawns and possesses a pawn it works fine, but if player 1 is spawned in, it seems like player 0 gets depossessed. Even though it works as intended if player 1 spawns first... Any clues?

viscid tapir
#

If I feed a TMap server-side only, it is a server variable even if not possible to replicate right ?

chrome bay
#

not following the question, if the TMap is server side, it is indeed server only

viscid tapir
#

But how can I ensure that the TMap is server side ?

#

I just manipulate it within server code ?

chrome bay
#

Not sure what you mean. If the TMap is local to the server machine, it can't exist on a client machine

#

Might need to post code

#

Not really following

viscid tapir
#

Yeah sorry ofc

UPROPERTY()
TMap<FName, FGameplayAbilitySpecHandle> ServerBinds; // In the header file of the inventoryComponent

// In the function GiveAbilityCard() called by the server
FCardDetails* TempCardBinding = CardAbilitiesDT->FindRow<FCardDetails>(CardName, "Context"); 
    if (TempCardBinding) {
        FGameplayAbilitySpec Spec = FGameplayAbilitySpec(TempCardBinding->CardAbility, 1, -1);
        ASC->GiveAbility(Spec);
        ServerBinds.Add(CardName, Spec.Handle);
    }```
#

I add something to ServerBinds in the function that is called from server which means server keeps track of this TMap I believe

tired jasper
#

new to multiplayer blueprints and getting real stuck... how would you go about calling a "spawn Niagara system" event which is within an actor thats spawned by a character?

chrome bay
viscid tapir
#

Oh ok nice

#

but i can do "predictive" stuff by also adding stuff in the TMap client side (not my purpose anyways)

chrome bay
#

The client can change whatever values they want, nothing is stopping them really

rotund timber
#

Hi all, question regarding Custom CharacterMovementComponent, when using method UpdateFromCompressedFlags() to update some booleans e.g. for sprinting - when trying to debug (Rider IDE), the breakpoint only stops when running as client - why is that??, and is there a way to test for listen-server? ๐Ÿ˜ฎ Thanks in advance!

rare blaze
#

Hy so i got a spaceship which i made using blueprint. I want to add multiplayer to it how do i go about adding it
any yt tutorial suggs..

latent heart
#

Literally a million things in the pinned messages.

rare blaze
#

yes looking through them

#

xD

clear island
#

I want to teleport to a certain place on the map and then make him "look" at something by rotating him

dry pebble
nocturne quail
#

how to prevent spawn two players at one PlayerStart?

round acorn
#

If I "get" a variable on the server via Runs on Server and a getter node, and then pass that variable to a Runs on Owning Client as the input for that node, what does the client actually receive? I've tried passing an actor's data component this way but the client logic always sees it as empty.

#

My system involves two different actors with instances of the Inventory System and I want to be able to see the contents of e.g. the treasure chest on the client. The treasure chest items are only generated and kept in the server's copy.

#

It works when I set the component and the underlying inventory array to replicate

forest yarrow
#

Hey guys, please can anyone point me to some guide on what is the correct way to make two players posses each different pawn when spawning in local multiplayer?

nocturne quail
#

when I spawn 4 players
and spawn a cube on server , the cube only shows on players index 0, 1, and 2

#

the index 3 didn't seen the cube

#

why is this happening?

#

Solution:
adding delay of 0.2 sec before spawning the cube solved this issue

#

is this a bug in unreal or what?

native zephyr
#

Hi, folks! When I'm testing multiplayer in the editor, does the Output Log shows logs for all game windows or just the main one in the editor?

crystal crag
#

Whenever I try to build a mission system that supports multiplayer, I always end up hating it and deleting it. I am always torn on how to structure the classes. I first built it to where each mission class represented a player's mission and their state, but then I didn't like it because it was not really efficient. If you have 50 people with the same objective of "kill xyz monster" then you could just have one instance of that objective that has a listener for when monsters are killed, incrementing the player's count as the requirements are met

ember tendon
#

Is there anyone here that have experience with unreal engine Steamcore multiplayer setup which is non region locked

slow wing
#

If a UObject is created on the server and replicated via ReplicateSubobjects to a client, but later the client clears all its hard pointers to that UObject, will the UObject be garbage collected or will something keep it alive because it was created by the server?

queen escarp
#

this gives error as infinit loop

#

why??

nocturne quail
# queen escarp

you are calling server on server which call server again and this is making an infinite loop

round acorn
#

Why won't this Server_TransferAllItems event fire? I call it on the left and it breakpoints there, but none of the code runs on the server event on the right

queen escarp
#

@nocturne quail lol ty x

#

D

round acorn
#

is it because the client doesn't have the ownership or something?

nocturne quail
round acorn
#

still won't get to the breakpoint

nocturne quail
round acorn
#

prints as Client 1: Hello

hollow eagle
#

Only the owning client can call a server RPC.

nocturne quail
#

client is not authority

hollow eagle
#

that's not relevant

round acorn
#

Figured it was ownership but how do I establish ownership?

hollow eagle
#

set the owner on the actor

#

or RPC through something you do own

round acorn
#

In this case it's an actor with an inventory system component that I want to transfer the items from the chest to the player inventory. So Set Owner of the treasure chest's inventory system component to the player character for this?

hollow eagle
#

no

#

RPC through your player character

#

the player doesn't own a random treasure chest in the world

round acorn
hollow eagle
#

it entails moving your networking to the player or something the player always owns

#

the player should not own random actors placed in the world

round acorn
#

This is an Inventory System Component that (one of which) is on the Player Character BP

hollow eagle
#

ok, and the one on the player character is owned by the player

#

so you're free to RPC through that

#

or the player themselves

round acorn
#

Gotcha, so the game is basically saying I'm running this logic on the treasure chest's component, which I do not own

hollow eagle
#

correct

#

nor should you own it - most server RPCs will go through the player controller, player pawn, player state, or a component on any of those.

#

If you want to interact with something in the world, you make a generic "i want to interact" server RPC on the player and then let the server decide how that should work with the thing you want to interact with.
In this case, maybe you have a "Transfer All From Other Inventory" server RPC on the inventory component, which then runs whatever you want on the server.

round acorn
#

So here, I was calling the Container's component

#

The bottom one there is the player's

hollow eagle
#

Right, so you'd need to be calling something on your own component instead, probably passing in the container's inventory as an argument.

round acorn
#

aye, lemme swap those see what happens

#

sweet, we made it to the breakpoint lol

#

with tons of other bugs, but progress

#

thank you

rare blaze
#

hello so i want to make a pawn Blueprint which i made for spaceship movement to have multiplayer in it. i tried to follow a tutorial but couldnt get it to work. (the image is for spaceship yaw).

#

i made similar ones for the pitch and thrust

#

but they dont seem to work

#

the client doesnt update the position of the server spaceship, and the server spaceship in the client window dissapears suddenly

nocturne quail
#

how to call this MyFunction on Server in MyFunctionServer in C++?

MyFunction(AItemWeaponMag* WeaponMag);
UFUNCTION(Server, Reliable, WithValidation)
void MyFunctionServer();

MyFunction will need arg , dunno how to do it ๐Ÿค”

#

thinking to do

UFUNCTION(Server, Reliable, WithValidation)
void MyFunctionServer(AItemWeaponMag* WeaponMag);

but I don't like it

winged badger
#

That is how you do it

livid solar
#

Hi all, I would to save player location to database (mysql) on multiplayer in real time. Anyone has any ideas for this? thanks

velvet island
#

Instead, update it on player leave (if you are doing a game that you spawn in the place you left at) and possibly every 10 seconds or more

livid solar
#

I am thinking to use socket. do you think it is a good way?

woeful trellis
#

Hello everyone, I need help here, there's a race condition happening here I guess and I do not know how to handle it.
the problem here is the server will set the max speed and everything is fine, but once I call the clients to edit theirs it fails to get the pawn.
but it worked if i add a delay before calling it on clients.

#

this is my PlayerState Blueprint, and this called after PossessedBy() from the pawn

icy jetty
hasty mist
#

hello people

#

I'd like to make an open world multiplayer game and I was wondering if any of you could point me into a direction for what to look online since I don't know much about making a multiplayer game

icy jetty
hasty mist
#

will do, thanks

drifting heath
#

What's going to be the most efficient, yet somewhat acceptable way to handle dead bodies in a multiplayer game, where I want to support 100ish players? Right now, I'm trying to get the character mesh to ragdoll when someone dies, but the physics replication is a nightmare. If I spawn a ragdoll actor, it still has the same problem, but there's a hiccup where there's either two bodies or the first one disappears.

The other option is a replicated FTransform member variable, but that only transforms the mesh's position, not the bones/etc. The other idea is the replicate a transform variable, and let each client do their own ragdoll calculation, and just use the transform to keep it in the same spot for everyone.

Not sure what to do.

hollow eagle
#

don't replicate it at all ideally - let clients handle physics themselves. If you really need to keep them all in sync then leave them at a very low network tick rate and think about only replicating a single location rather than the full state of the ragdoll.

warped hatch
#

How do you check authority in Components. Since they are not an actor or character, checking HasAuthority seems to mean nothing here. Would be great to get some help on this, thank you.

solar stirrup
#

So you can do GetOwnerRole() == ROLE_Authority

warped hatch
#

Thanks @solar stirrup .

#

I have the following scenario where Authority is never true, even though I am in a networked game.

icy jetty
warped hatch
#

Works when I move the node to remote.

icy jetty
#

Yeah, so your event is running on the client

#

You should go quickly check @sinful tree โ€˜s recent post in #blueprint . He gave a very good explanation to a question there that was prly meant to be in this channel to begin with

drifting heath
#

Actually. I derped. The actor's world location is replicated, so that's all that's needed to do. Whoops.

pallid mesa
#

you'll notice hard snaps when reping down ragdolls

#

thats normal due to the unevenness nature of the ragdoll

#

and the accumulated time error sums up, attempts to snap, it fails and repeat until server doesnt seend more loc updates in physics state update

woeful trellis
fluid summit
#

Hi everybody!

I'm moving my BP multiplayer (Listen server) prototype to C++.

Previously for my map generation (Think something like Diablo) I was using a "MapGenerator Class".

I'm now thinking on moving that functionality to GameInstance (Or maybe GameState) is there any obvious disadvantages for this?

latent heart
#

Encapsulation is the issue I see.

#

I would use a world subsystem.

fluid summit
#

i'm going to check those, thanks!

sick jetty
#

Hi! I'm wondering if anyone has some clever way to structure their networked code well. I find that since RPCs can only be called by their owning actor, I end up having these big messy "god" classes with a bunch of different RPCs responsible for different things. Ideally, I want to split up the logic and behavior into smaller, more concise classes that are responsible for performing specific tasks. While components can be helpful for this purpose, theyโ€™re not always the best solution.

I have an interface in C++ with a number of child classes; each child has their own different behavior, somewhere within those implementations, I need to call RPCs to achieve my desired behavior. I currently have those RPCs defined in my Actor class, but I would like to move them into their respective implementation. I was thinking of making my classes inherit from UObject and making them a subobject of my actor, would this work? If not, is there any good way to define RPCs outside of an Actor/Component class?

fossil spoke
#

Could you go into more detail as to why you want this?

#

With specifics

#

Its unusual to want to do this for RPCs alone

#

Asking this type of question could generally indicate a potential design pattern issue with the way you are using RPCs or your interpretation of how and when to use them.

#

Keep in mind, you dont need to keep implementation details in the same .cpp file.

#

You can split your implementation out into separate .cpp files, so long as the .h contains all the appropriate declarations.

#

If this is purely a code organizational exercise.

sick jetty
#

Yeah it's purely for organization. Having the RPCs in different cpp's is what I'm currently doing, just wondering if there's a better way.

In general, I'd prefer a lot of things to be data oriented (traditional ECS), but it looks like OOP is the preferred method in UE from what I've seen.

#

I've heard about Mass, but I haven't really looked into that yet

fossil spoke
#

RPCs and Replication in general need to be handled by an Actor with a Net Owning Connection. So generally approaches to organization outside of AActor and UActorComponent are not appropriate.

#

Calling RPCs from a Component also incur a slightly higher overhead than just simply doing it through the owning Actor.

sick jetty
#

What is the overhead? An extra ID or something?

fossil spoke
#

Yeah to identify the component

sick jetty
#

Ah

fossil spoke
#

So you are pretty much stuck with separate .cpps

#

Curious though, for this to be a problem, you need to be declaring/defining a lot of/large RPC functions

#

Is this the case?

sick jetty
#

No, just being super picky and trying to get ahead of a potential problem if possible.

fossil spoke
#

Ok, IMO seems like you are worrying about the wrong things.

#

๐Ÿคท

sick jetty
#

Hahaha, you're probably right

fossil spoke
#

Take a look at the ACharacter class, it is probably the heaviest user of RPCs you can find in the source code.

sick jetty
#

Just kinda poking around and seeing what I can do, since I'm new to using the engine.

fossil spoke
#

It in conjunction with the UCharacterMovementComponent may help you see that you can still be organized within the same files with a lot of RPCs

sick jetty
#

Yeah, the Character class is sort of what spawned this question

#

I'm implementing my own movement netcode since I'm pretty particular on how I want it to work. Took a look at how UE works out of the box and noticed that the character class is huge

fossil spoke
#

Yep

#

Its extremely complex.

#

But it is a fully featured AAA quality battle tested character movement class.

#

Also built for a specific genre of game as well mind you.

#

So if you need something different then you maybe able to get away with making your own.

#

Choose the right tool for the job

sick jetty
#

Yeah, I think the complexity actually scared me away from using it since I'm not 100% on how it all works. I'd like to have a full understanding of how everything works since it's sort of the cornerstone of how the rest of what I'm doing is designed.

#

I guess while I have you here, how well do you know the movement system? Really the end goal of what I'm looking to do is implement something similar to Overwatch's netcode design

fossil spoke
#

Which part of their design lol?

sick jetty
#

Which I'm sure it handles prediction and reconciliation well, I'm just not sure on how to expand on what's there

fossil spoke
#

The CMC and Character class handle prediction and authoritative corrections

#

What exactly do you need to expand on?

sick jetty
#

Well on example is rollback hit detection

fossil spoke
#

I thought you might say that.

sick jetty
#

Hahaha

fossil spoke
#

That really doesnt have much to do with the Character

#

Only that you probably want to have some sort of buffer that can "rewind" the Character.

sick jetty
#

Yeah, does UE have that built-in?

fossil spoke
#

Other than that, its mostly how you go about implementing your Hit stuff

#

No

#

As its pretty game specific

sick jetty
#

True

fossil spoke
#

The UT Source Code on the Epics Github page has rollback from what I can remember.

sick jetty
#

Really all I know about CMC is that deals with prediction and corrections and also supports root motion

fossil spoke
#

Rollback is more about the hit than whats being hit.

#

You will typically only want to deal with rollback for hero actors, actors like the Players character and anything else that maybe dynamic and important for hitreg.

sick jetty
#

Yeah makes sense, is there anything else that CMC does that I didn't mention

fossil spoke
#

Rollback can also be as simply as just buffering the Capsule location and performing the hit test against that.

#

It all depends on how accurate you need it

fossil spoke
#

Unless you start talking about its movement capabilities.

sick jetty
#

What do you mean by that?

#

Like fly, ground, swim, etc?

fossil spoke
#

Yeah

#

But those arent really related to prediction etc

#

Id recommend taking a look at the UT Source Code if you havent already.

#

Its old, but is a great reference for these sorts of things.

#

They also fully predict projectiles as well.

#

If you also want to add further complexity, make sure you get a handle on GAS.

sick jetty
#

Yeah I've heard about that

#

Based on what I've read some people love it other's don't

fossil spoke
#

Its not for the feint of heart.

sick jetty
#

It seems like another intimidating mountain to climb

fossil spoke
#

There are a lot of tools available and yes, some can be daunting to use at first.

sick jetty
#

I guess it really comes down to, does the benefit of learning GAS out weigh just implementing your own solution?

fossil spoke
#

It does in all cases, at worst you come away understanding WHY you don't need it, which is not a waste.

#

Since you will have a better understanding of what you need and how to build it.

sick jetty
#

Ok cool, thanks for all the info. I was pretty dead set on just implementing my own solutions since I'd be 100% guaranteed to understand the in's and outs, but this conversation changed my mind quite a bit.

#

Back to hitting the books I guess ๐Ÿคทโ€โ™‚๏ธ

fossil spoke
#

I feel most of the time when it comes to UE, reinventing the wheel can be a big mistake.

#

Unless you understand why you want to

#

Utilize what already exists first, especially when you are learning, since you will have a framework around you that can keep you centered.

icy jetty
#

Thatโ€™s good advice for programming in general

fossil spoke
#

Learn those tools, you can come away from that knowing of at least one way something can be built.

icy jetty
#

โ€œStand on the shoulders of giantsโ€ as David Malan says

fossil spoke
#

Which enables you to identify potential improvements if it was done another way.

#

Starting from scratch on your own, you will likely often find that what you are doing has already been done and likely in a better way.

#

Which is like pushing a rock up a hill and finding out there is already a rock at the top when you get there.

#

Which sucks.

sick jetty
#

Yeah, I'm really bad at not reinventing the wheel ๐Ÿ˜†
I'm used to dealing with engine-level stuff, which always leaves me with the attitude of "well I know what I want, I might as well just do it myself instead of wasting the time learning this new tool/resource", 95% of the time that attitude backfires

fossil spoke
#

Yep.

#

Even if the system itself isnt available, there is almost always plenty of resources online on how to do something.

#

Like Rollback for example.

#

It doesnt exist in a neat little package/plugin.

#

But its a very well known concept and resources for understanding it exist everywhere.

glass orchid
#

When playing in editor for some reason player controllers are never local for clients, what am i doing wrong?

prisma snow
glass orchid
#

The player controller creates a widget on beginplay. the widget itself has some code that needs the widgets owner (which should be the clientโ€™s controller) but it always returns the listen servers controller. i probably overlooked something crucial

#

furthermore, checking on client if the controller is a local controller returns false, which doesnt make sense to me.

prisma snow
#

are you checking the authority?

#

you could wrap the widget creation on authority check

#

so that it only gets constructed on clients (not ure if it's 100% necessary)

glass orchid
#

ive tried that as well yes

prisma snow
#

I've never used checks for local controller, only authority checks

#

or netmode checks

#

what do the authority checks return?

glass orchid
#

it creates the widget but the controller is still the same controller as the listen server. it's like all clients and the listen server have the same controller

#

hold on i think i done goofed....

#

ofcourse each the client is gonna have the same name for their controllers cause they define the name themselves, not the server assigned name (since only the client controller exists on client)

#

well dont mind me im just dumb xD

#

still doesnt explain why the playerstate is invalid but at least i know its not because of a supposed controller issue

frank birch
#

in the CMC, when the server gets an "somewhat" old movement from a client... does it rewind the other client's CMC to simulate? ๐Ÿค”
or does it compare the "old" movement with the "actual" state of the universe? ๐Ÿค”

ivory bear
#

In a multiplayer game (or not), do you guys/gals put the blueprint nodes for applying damage in the projectiles event graph or on the character blueprint?
I feel like the projectile bp provides for cleaner code.

drifting harness
#

if it's a physical projectile then it should be in the projectile blueprint

edgy helm
#

Hey, noob question here. I have player spawning logic and some other stuff on my player controller, but in multiplayer it doesnโ€™t fire off consistently so clients just donโ€™t spawn in. I tried also calling an event from the gamemode when handling a new starting player, but sometimes it works, sometimes it spawns two characters. Any ideas? Thanks in advance.

latent heart
#

The spawn logic should be on the game mode

icy jetty
#

Oh, thatโ€™s good to know ๐Ÿ˜…

mortal mica
#

when doing an AttachActorToActor, does this need to be done in both server and clients? or just the server? I'm currently using a multicast to do it in both, but I'm not sure if that's what's breaking something

arctic minnow
#

Hello how would I replicate a launch character so if I was in single player and used it it would be the same as if I was in client in used it I know if I check xy override it will be the same in both but is there a way to make it work without xy override? ๐Ÿ™‚

icy jetty
mortal mica
quasi tide
#

Pretty sure it does.

mortal mica
#

Although I'm now testing in standalone and still seeing the same behaviour, I'm trying to debug why when I attach a character to a vehicle, vehicle moves forward 100 units, and then detach, the character apperas 200 units ahead

quasi tide
#

I only attach my weapon on the server and its fine on the clients.

mortal mica
quasi tide
#

I'd have to double check though. Been like 7 months since I wrote it.

quasi tide
#

Cedric says it does. Good enough for me.

#

Funnily enough - he replied to you about this ๐Ÿ˜…

mortal mica
#

lol, funny

#

I didn't remember that

quasi tide
mortal mica
#

lol

#

ok so this behaviour im seeing is definetly not a multiplayer/replication thing

#

grrr

#

I think im going to ignore attach actor alltogether, and just add a "sitting" movement mode to the character movement component

mortal mica
#

gah, I fixed it, needed to use Teleport(), that forces the CMC to reset the based movement so that you don't carry over the delta in position between the character was attached to detached

viscid tapir
#

Hello i'm using GAS and i wonder how can I "send" a client variable to server in this scenario :
I fill the payload in the widget i'm creating client side and i'm sending event from there. Client receives it and resync with server so I can make gameplay actions via the server. However the variable (which is a playerState) only exists on the client and i'm trying to reach the server with that playerState variable. But I couldn't do it (tried RPCs, another WaitNetSync, etc)
The widget is like a targeting list (which is basically listing all players in the lobby) that you select a player from and whenever you confirm, it sends a gameplay event with the playerState representing the selected Player.

thin stratus
#

You usually do that with TargetData

#

WaitGameplayEvent is not doing any RPC work

viscid tapir
#

Yeah its received locally only

thin stratus
#

You would split that code to Server and Client. Let Client wait for the GameplayEvent and add the Widget. Let Server wait for the TargetData.

viscid tapir
#

Oh I see

thin stratus
#

When the GameplayEvent comes back from the Widget, send the TargetData

viscid tapir
#

Custom Task or any in-built feature can handle that ?

thin stratus
#

You should be able to use TargetData :P

viscid tapir
#

I meant how can I send it ?

#

from client

thin stratus
#

WaitTargetData takes in an Actor. You can make your own. It can handle spawning the Widget and sending the TargetData to the Server

#

have a look at existing examples in the source code

viscid tapir
#

Ok thank you !

#

I'll need to convert the widget in some kind of GameplayAbilityTargetActor and it should be okay

vestal token
#

Hi. Does any one have some link or any article with example of a client-server application that implemented by using Entity Component System (ECS)? Or some example with using the ECS on a UE Client?
Also what are you thinking about built-in ECS of UE called MassEntity? Is it still in test mode or no? And also can MassEntity be used for some sort of MMO games to spawn entities (Characters\NPCs\Monsters) and keep them in the ECS system to get maximum performance while operating them in runtime? Thank You.

round acorn
#

This seemingly innocuous node completely disables replication of movement for my pawns in a dedicated server setup. The pawns still move on the client and server but their movement doesn't show up on the other remote clients. And all it's doing is adding an item to a replicated array that has nothing to do with movement.

round acorn
#

It's part of a "take all items" function. When I take 5 or more items at once this happens. 4 or less, everything is fine.

#

I profiled the network bandwidth and that function was hitting 25kbytes of data but very, very fast.

#

Is there some way to know when or why this is going to happen by replicating a lot of data?

arctic minnow
#

๐Ÿ™‚ ๐Ÿ™‚

round acorn
round acorn
#

LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_LootContainer_Indestructible_C_UAID_3814287443F2A67F01_1188285487. Function Server_TransferSlots will not be processed.

This function works when the player is transferring from the container to their own inventory. When trying to transfer the item back to the container inventory the log shows this because the player doesn't own the container inventory?

round acorn
#

I feel dirty. I made the weird replication bug go away by throttling my replication data burden with a Timer delegate event :/

#

So it runs a 0.01 second timer for each item in the array lmao.. ugh

solar stirrup
#

Why though

round acorn
#

if I tried to add the array elements in a for loop it overloaded replication and bricked my character movement somehow?

#

not even really throwing that much data around either

solar stirrup
#

Send an array in the rpc

#

Instead of one by one

round acorn
#

ya? I was sending the entire inventory system component which contained the array, should try that then eh

#

I need to try that

#

At one point it was kinda funny because when I would hit "loot all" the entire pawn would vanish without a trace

glossy kettle
glossy kettle
#

and WithNetDeltaSerializer all the bits

round acorn
sinful tree
round acorn
#

Turns out what I was doing earlier was actually replicating more like 16-60 of these at once

#

So I built my own serializer in blueprints

#

Works pretty good tbh

#

I still need to simulate higher ping and test

sinful tree
#

Still seems way too high. 25KB of data for 60 items = 416 bytes per item, which is something like 100 integers, more than double the number of fields that you state your structures are. Why I asked about what the structures contain is if they contain strings, text or names - those can all end up costing a heck of a lot more than any basic numeric properties normally.

round acorn
sinful tree
#

Enums are fine, those are only a byte.

fossil spoke
#

You should not be replicating static data

round acorn
#

So only replicate the RNG parts of the items

#

I have an array of structs inside the item struct

#

Called item affixes

#

Which is like 160 affixes long lel

#

... i may need to rethink things

sinful tree
#

So you're storing values even if they're 0?

round acorn
#

Some. If the item doesn't use that affix then no

kindred widget
# round acorn So only replicate the RNG parts of the items

Given that you are doing fully randomized items, likely from an integer, this is all you should ever need to send. The very basics of the data that originally constructed the item. The client can reconstruct a randomly generated name, or look up how much a randomly generated stat is super fast. And since most of these values should come from the same randomly generated key, that one key is all you should need to send for the client to see the same values as a server.

That one key then usually then ends up being even smaller than a single replicated item name. So you get all of the stats with a fraction of the data sent.

deft berry
#

hey guys,
Is there are any info, reference project or even a good read on crouching and proning on a networked game?
I am currently having issues with crouching and proning implementation on a network
while they do work on their own, when clicked to prone from crouch state, or crouch to prone state, the data does not seem to be relayed to server and simulated proxies correctly and gets all messed up
any help is appreciated ๐Ÿ™‚

ruby parrot
#

How would I go about syncing changes in a chest I am interacting with?
e.g. Player 1 Opens a chest,its empty.
Player 2 opens this chest and adds an Item to that chest

Now player 1&2 obviously need to get a "update inventory visuals" function triggered..and thats my question...how? ๐Ÿ˜„

winged badger
#

c++ or BP?

#

@ruby parrot

ruby parrot
winged badger
#

have an array in BP with contents, RepNotify

#

OnRep, regenerate the entire chest content

ruby parrot
#

that I do already, unfortunately i have to solve another issue first before i can do the chest stuff (player client inventory aint working no more) for now: stand by ๐Ÿ˜„ ill respond with a tag once the playerInv issue is solved ๐Ÿ˜„

woven basin
#

Is there a โ€œgold standardโ€ c++ tutorial/course in inventory systems that does it the โ€œright wayโ€? I.e. UObjects etc? Some of the YouTube videos are clearly not doing it right.

short arrow
kindred widget
# woven basin Is there a โ€œgold standardโ€ c++ tutorial/course in inventory systems that does it...

You might find one or two, but I'd still be skeptical. Implementation just comes down to what you need. If you need a massive world inventory system, you probably need to consider some form of POD system with structs.

I personally went UObjects on mine just because I like the simplicity for handling. I get a single pointer I can throw around in UI and have an object for delegates etc. But mine is also super abstract in a plugin. Has very basic handling for creating a UObject that supports stacking and the core code required to handle that. Everything else is inherited and extended at the project level.

Having said that, there are performance implications to UObject inventories. Namely that they need an object instantiated for them. And that is fine for several thousands of items. But if you start getting into massive persistent open world stuff, you either need to consider a basic POD system without objects, or do some optimization to allow an inventory to be condensed down to data when not in use. Which isn't all that hard if you already having a basic saving system for your objects that breaks them down into structs, but might not play as easily with an MMO backend for example.

And even with all of that information. "The right way" is a loose term. It's hard to fully answer that without knowing your entire requirements for the inventory. Every game is different, and some people might optimize away whole sections that another game might consider essential.

subtle peak
#

If I want to change collisions on an actor, should that be done on multicast or only on the server?

chrome bay
#

Should be a replicated property changed on server and all clients from an OnRep

#

Multicasting state = bad

rancid badger
#

Why is multicasting bad?

kindred widget
#

Multicasts are once. There's no saved data, no updates. If there is a light on by default and server says a light is off via a multicast. Now a new client joins the game. All other clients see the light as off, but this new client sees the light as on.

quasi tide
unkempt tiger
#

What should I be doing if I want to know when a new player state is replicated? Does game state have any broadcast I can use whenever a player state is replicated?

latent heart
#

BeginPlay on the PS?

#

Or is there an OnRep on the PC for the PS?

jolly siren
#

Plain Old Data

round acorn
#

Need to think about how to generate items from a seed but some of their stats are deterministic, like where in the world they can drop is determined by theme, etc.

round acorn
#

Thinking about this stuff. I am using a base item Object for my items. What if my inventory is just a reference list to the item instances? Then if I want to move items from e.g. a container to the player all I'm doing is changing the owner and sending the object reference in replication?

fathom aspen
#

I mean this is what the latest pinned article does

#

And yeah it's totally legit

round acorn
#

damn I didn't even see that yet, thank you

#

Am not looking forward to changing my struct... every time I do that the game crashes several times lol

quasi tide
#

Idk, I like the struct based inventory workflow.

#

And if I recall correctly, Jambax's blog post doesn't use the cool new way of replicating subobjects

thin stratus
#

Yeah he's old and outdated. Can't keep up with the cool kids.

unkempt tiger
#

what's the cool new way of replicating sub objects?

thin stratus
#

Docs have stuff about it

west maple
round acorn
thin stratus
#

Or maybe first project map not sure

solar stirrup
#

New subobject replication + fast array serializer + FInstancedStruct

#

The holy trinity

#

UObjects for inventories and structs for item instances

rancid monolith
#

For making a multiplayer FPS, I'm debating if I should implement my first person weapons as separate actors, or as components added to my character. I already have it working in a basic form with weapons as separate actors that get attached to the player. Any idea which method is considered "standard" or which is more commonly implemented? I imagine it varies by game.
I was thinking keeping them as separate actors might cause replication related headaches in the future, but not sure.

quasi tide
#

I do it as actors

rancid monolith
#

I was thinking it might get weird if I have to manage attaching the weapon to the first person model on autonomous proxies vs the third person model for simulated proxies

quasi tide
#

Not really

#

Just...attach

rancid monolith
#

k, just wasn't sure how attachment works with replication

quasi tide
#

If autonomous: attach to this bone, otherwise attach to that bone

rancid monolith
#

cool I'll just keep it as is then

#

not rewriting my entire weapon class

broken shale
#

Having an issue where my score update works in single player but not in multiplayer. I have a function GetTeam that checks to see if the player who overlaps the goal is on the right team and the cast to is failing which I think is part of the problem but there may be other issues with other casts failing for reasons I havenโ€™t been able to determine. Basically the player character is redefining a team number from game mode which is set in player controller and then accessed in player character. Overlap is tested in player character and passes the score to game mode and that is ultimately supposed to be updated in the player character hud. Works fine in single player and Iโ€™m not sure where the issue is in multiplayer. The score and related variables are set to replicate and the scoring function runs on server

#

First image is from player controller, second is the player hud, third is overlap logic in player character and last is team assignment logic in game mode

sinful tree
#

So any variables, even if they are marked as replicated, or functions you're trying to call while playing as a client won't be accessible.

#

There's also no point to marking any events in game mode as RPCs as only the server can ever execute the logic - so your OnPostLogin there ends up calling "Run Set Team On Server" but that doesn't need to be an RPC, you can get rid of that event and just immediately call Set Team.

Ideally, you probably want to set team or any other variable that would persist with a player on PlayerState so anyone can see who's team is what and you don't need to use an RPC to do it, just a replicated w/ notify variable using its OnRep function to drive the required logic should suffice, and any team related scoring could be tracked on GameState, however, you likely do not want to call a Run On Server event from your Overlap, instead, use a Has Authority node immediately after the overlap and only use the Authority path - this normally guarantees that the following code is running on the server.

formal solar
#

Is there a way to check for when everyone has logged in (where there are a fixed number of players and no in-game joins)?

#

Or, I imagine there is, but is there a quick solution like a node

broken shale
#

@sinful tree Wow thanks! I was using chat gpt 4 to help with my team assignment and it was adamant about using game mode to assign teams, then passing through player controller to player character. Tried running it through several fresh chats and it gave the same response each time

sinful tree
broken shale
#

@formal solar if your players are stored in an array couldnโ€™t you check array length?

formal solar
#

its ok its to do with the basic setup of my game which I think will be an easy hurdle once I start tackling connection and logins

broken shale
#

@sinful tree So constrict a set team function for Team Number in player state and pass that to player character for the overlap, then store the score in gamestate instead of game mode?

icy jetty
sinful tree
# broken shale <@218956378654507008> So constrict a set team function for Team Number in player...

You likely shouldn't be checking all overlaps in your character - your "goal" actor should have its own overlap check.
Your goal can then have an integer variable indicating the team that owns the goal.
In the goal's overlap, you would check if the overlapping actor is a player, and if so, access the playerstate and retrieve the team ID.
You would then check if the Player's TeamID != Goal's TeamID and if true, that means a goal should occur, and yes, that should be registered in the GameState.

broken shale
#

@icy jetty Yeah Iโ€™ve found it pretty hit or miss but it has at least been useful for learning about certain functions or code Iโ€™m not aware of. Usually I can get it to the right answer by correcting it a couple times. Iโ€™m not solely relying on it though, Iโ€™ve got a couple books Iโ€™ve read together with the occasional YouTube tutorial

#

@sinful tree Thanks! Thatโ€™s how I previously had it set but switched it over to the player character after having issues with the casting

broken shale
#

Thank you so much!

twilit fable
#

So no body in this group that has experience with unreal engine Steamcore multiplayer setup which is non region locked ?

drifting rose
#

Anyone ever had a problem with Client -> Server rpc replication did not register (was called on server) for the first time calling it, but after the 2nd works like a charm?

dim trail
#

for some reason the beginplay is only called on the first client, but for the same controller twice. this happens when i play with 2 clients

sinful tree
# twilit fable So no body in this group that has experience with unreal engine Steamcore multip...

This channel is primarily a help channel where you post what your problems are and people can try to assist. From my experience, asking extremely general questions like if someone has experience with something isn't likely to get a response, especially so since there may only ever be a handful of people ever looking at the channel at any given time.

If you're looking for someone to just do the work for you, then you're better off reading #instructions and putting up a job posting.

woven bramble
#

In one part of the map there is person X, in the other part of the map there is person Y. If an object is hidden from person X thanks to Cull Distance, will the actions and activities of person Y interacting with the object work appropriately for person X?

fossil spoke
#

NetRelevancy?

#

Render Culling?

#

There are different types of culling, for different purposes.

#

Its important to be specific.

woven bramble
#

I mean, just "cull distance" which works by adding Cull Distance Volume at the level. So Distant parts are not rendered (invisible), they are visible as you zoom in.

fossil spoke
#

So visibility (render) culling.

#

Occlusion culling more specifically.

#

In which case, yes, the Actor itself and all its components still exist.

#

They just aren't being rendered for that Client.

woven bramble
#

If the current object is not visible to the Server (if it's far from the object), but the Client is next to that object, will it work properly for Multiplayer?

fossil spoke
#

Why wouldnt it, given what I said above?

woven bramble
#

OK.

#

So, does this process also apply to World Partition, do you know about it?

#

I've read that World Partitions are compatible with Multiplayer, but I suspect there might be problems.

#

If World Partition is dividing the Landscape into parts and Cull Distance is closing the visibility of the distant object, do they both work using the same system? So is it just the visibility of the objects?

#

btw thank you

fossil spoke
woven bramble
#

thanks

meager spade
#

Netculldistance is a different story

woven bramble
#

If I use Cull Distance Volume as normal, will I have problems in Multiplayer? I don't really understand why NetCullDistance is needed.

fossil spoke
#

Please read the documentation.

weary tulip
#

Newbie multiplayer question... So if I wanted to create a non-active multiplayer system, what all would be required?

Example:
Player #1 creates an NPC character. It gets uploaded.
Player #2 pulls that NPC into their game.
Player #1 gets in-game credit for Player #2 using their NPC.
The end.

The NPC would essentially have a small text file worth of attributes. Would I just need a DB hosted somewhere to store the file of all player's NPCs and accept updates to it each time a new player creates a NPC / uses another players NPC?

fossil spoke
#

non-active multiplayer system

#

What does this even mean?

weary tulip
#

So...you can see / use other people's characters, but you arent actively playing with other players.

#

Another example would be a leaderboard system, but no interactive play outside of that. I'm not sure what the official term would be for that type of multiplayer.

fossil spoke
#

Yes you would need some sort of external DB in order to store that information and allow other Clients to access it.

weary tulip
#

Are there any recommendations that play exceptionally well with UE5? I'm really inexperienced when it comes to any type of server/db infrastructure, so if there's a recommended guide I could look up, that would be a great starting place.

fossil spoke
#

There is likely a ton of guides on how to manage this. Unfortunately that makes it somewhat difficult to recommend one specifically.

#

As there is also a lot of different platforms that enable you to do this as well.

weary tulip
#

Ha, fair enough. I suppose my worry would be when I search multiplayer, I just find a bunch of replication guides...which I think for the most part, I wouldn't need to dive into for my basic use case?

fossil spoke
#

You seem to have a basic plan together and a loose idea of what you need to do, try researching it yourself.

#

Google is your friend.

#

Also Youtube helps to.

#

Dont search "multiplayer".

#

Search for something more specific, like "How to use an external Database with Unreal Engine"

weary tulip
#

Good call. I'll look around. Appreciate the help ๐Ÿ™

fossil spoke
#

Learn how to ask the right questions, its a valuable skill.

#

Its half the battle.

#

You cannot hope to understand the answer if you first don't understand the question.

icy jetty
broken shale
#

Can someone help me understand how print is working when playing as listen server/clients? I have an actor, goal, set to on overlap and it has an mswitch node for authority. Itโ€™s getting my team number from game mode and if it ๐Ÿ˜ฎ it is set to print the team number and display nameโ€ฆ but when one of say four clients in my test overlaps it prints the results for everyone server, client 1, etc. Why would it not just print the info for the actor who overlapped? Setup is similar to this which @sinful tree helpfully posted earlier

#

Is there a way to just print the currently active client window when testing in editor?

kindred widget
rose egret
#

is there any ordered array like FFastArraySerializer ?

winged badger
#

put an index in the item and you can get it to behave that way

rose egret
#

yea was thinking of that but maybe need to write my own NetDeltaSerializer ๐Ÿค”

#

im just trying to replicate lots of items without using Actor

winged badger
#

so whats the problem?

rose egret
#

imagine 100k damagable tree

winged badger
#

as long as they are net addressable

#

and you replicate a weak pointer to the tree

#

it all just works

#

(as part of the item)

rose egret
#

I dont want 100k replicating actors in the map

#

its using Foliage system btw, its instanced

winged badger
#

that will have indices you can replicate

chrome bay
#

Also... 100K?

rose egret
#

yea just a big jungle

chrome bay
#

Even fast array is going to hit a brick wall with that

rose egret
#

all trees are supposed to be damagable

#

๐Ÿค”

#

why ? its just static

chrome bay
#

Just how big are these structs?

rose egret
#

very small

chrome bay
#

The point of fast array is to remove/add from anywhere in the array optimally. If you aren't doing that, using it is probably adding more overhead. Just use a static array with a fixed size.

rose egret
#

struct { int16 Health, Enum ItemType , FVector Position; }

chrome bay
#

Mind you, comparisons will probably be the bulk of the cost for 100K so might need it anyway

rose egret
#

u mean something like Type Items[1024] ?

winged badger
#

grid works though

#

each instance on server puts its data into a network manager at its grid tile

chrome bay
#

Yeah, I probably wouldn't use one giant array - split it into sections

rose egret
#

I dont know how fast array works, but all those trees dont need any tick or update, they are just there

winged badger
#

they need an update to spawn on clients, and also to get damaged on clients

#

thats what fastarray solves

rose egret
#

yea im planning the same, one manager actor for each cell

winged badger
#

do note that HISMs tend to shift indices when an instance is removed

#

and then you're fucked

chrome bay
#

Would probably split that struct up to. Presumably ItemType and Position never changes after initially set.

winged badger
#

i don't think i would

prisma snow
#

yeah actually you might want one fast array for each item or item group associated with the entity that changes together frequently

chrome bay
#

You could even pack those "health" values into a uint64 and unpack elsewhere

rose egret
#

uint32 Health : 10;
Is enough for me

#

๐Ÿ™‚

winged badger
#

server - adds instance, adds item to fastarray with an index, marks array dirty

chrome bay
#

But that won't do anything, you're still using the full 32 bits, and replicating them all

rose egret
#

Im also seeing Mass replication to see how they are using fast array or delta net serialize

winged badger
#

client post add - adds instance, adds non replicated int to struct for its instance index

prisma snow
rose egret
#

@chrome bay yea but Im thinking of adding other properties

winged badger
#

but that assumes you don't remove an instance ever

chrome bay
#

definitely going to have to split it up to deal with 100K either way

#

No way fast array is going to cope with that, the max changes per-update is 2048 anyway (by default ofc)

rose egret
#

is there any good example to show how to implment NetDeltaSerialize ?

chrome bay
#

...fast array ๐Ÿ˜„

prisma snow
#

how do you guys deal with fast array mappings? I mean, if I have 1000 structs let's say, that are linked to an actor/entity, and in the server I want to find the struct to set new values and mark dirty, and I don't want to iterate the entire array each time?

chrome bay
#

Can't really avoid it sometimes. I use the ReplicationID for the item ID

{
    FInventoryID GetInventoryID() const { return FInventoryID(ReplicationID); }

};```
#

But you can't guarantee the ItemMap is built at any time - especially if you marked it dirty

#

Hence..

{
    if (InID.IsValid())
    {
        const int32* IndexFast = ItemMap.Find(InID.Get());
        if (IndexFast)
        {
            check(Inventory[*IndexFast].GetInventoryID() == InID);
            return *IndexFast;
        }
        else
        {
            const int32 IndexSlow = Inventory.IndexOfByKey(InID);
            check(IndexSlow == INDEX_NONE || Inventory[IndexSlow].GetInventoryID() == InID);

            return IndexSlow;
        }
    }

    return INDEX_NONE;
}
rose egret
#

is FFastArraySerializerItem.ReplicationID unique per item for server and clients ?

chrome bay
#

It's syncd yes

rose egret
#

Zlo said add an int Index to your struct .

chrome bay
#

The int != index

rose egret
#

with that ReplicationID no need for that

chrome bay
#

It's an ID

#

Also, I did this against Epic's advice ๐Ÿ˜„

rose egret
#

time for writing my own Fast array

#

๐Ÿ™‚

chrome bay
#

You're not going to beat a static array IMO

rose egret
#

the problem is my struct are not the same type

#

I use inheritance and v function

#

I guess static array cant help then

chrome bay
#
{

UPROP(Replicated) // Initial Only
int32 TileIndexOffset;

UPROP(Replicated)  // Initial Only
FVector[1000] WhateverElse;

UPROP(Replicated)
uint16[1000] HealthValues;
};```
#

summin like that, IDK

#

Already got the syntax wrong but.. you get my drift

#

For 100K items you're going to have to be pretty creative

rose egret
#

yea I got

chrome bay
#

The callbacks of FastArray are it's best feature, but you can mimic that with a simple wrapper.

prisma snow
#

i wrote once something that maintained a map of array indexes for fast lookups

#

but I have not tested it so it might happen that some corner case invalidates it

chrome bay
#

Advantage of a static array is that the properties are "unfolded" into the actor, so you don't pay the cost of both a property header and an index

prisma snow
#

there has to be a way though, otherwise ECS systems wouldn't be able to keep sync with their SOA approach

chrome bay
#

Downside ofc is all those comparisons, you can't mark an individual item dirty/for comparison

#

Hoping Iris changes that though

#

Never done anything for that kind of number of items though tbh

#

Probably some learnings to be made

flint hollow
#

I havent started with multiplayer yet but i wanted to quickly what considerations i have to have for using control rig functions in a networked game.

#

same as any animation or separate considerations ?

quasi tide
#

Pretty much, yeah.

flint hollow
#

sorry i asked a double question.

quasi tide
#

CR most likely just gets the info it needs from the ABP, which just gets info from the character

#

Animations are a representation of the data.

#

You send that data to the character

#

Animations just read from that.

flint hollow
#

figures. so it resolves client side based on data transfered

quasi tide
#

Yeah - pretty much.

flint hollow
#

thanks !

#

Only thing i can think matters for networking is my animation driven collision tracing. Im using melee line traces. But ill just make sure the traces are networked properly then.

real ridge
#

guys can I kindly ask I am doing this RPC wrong ? I am trying set boolean value for certain player here but its not working

#

I can change this value only with server on client its not working and also when I change it with server then its true or false for everyone ๐Ÿ˜ฆ

#

I am printing it here

#

I just wanna not to take damage when I have activated shield

#

hm its working I just used self--> get player state and then cast to dfc player in any damage

#

I had no idea I can get self (player on my pc) in server call cool

tired jasper
#

might be better to use a Repnotify... but i dunno, still new to this as well ๐Ÿ™‚

#

so try changing your ?sheild to repnotify, then set the ?sheild from your 'serversheild' event and i think it replicate down to all the clients

blazing spruce
#

Hi, im having an issue with replicating a players rotation correctly.. i have a draw actor that the player can interact with, when they do i have it open the draw and then set their location & rotation to a point just in front of the open draw, the Set Actor Location seems to replicate fine, it puts both server and client player in the correct place when either interact with it, but the Set Actor Rotation doesn't.. it works for the server player but when the client player does it they don't get rotated on their screen, but the server does see them rotated correctly so it appears the client isn't being updated with the new rotation but ive tried rep notifying the rotation, ive tried running the Set Actor Rotation on client if the player isn't locally controlled and neither of those worked.. any ideas? also curious why Set Actor Location seems to work fine but Set Actor Rotation doesn't?

round acorn
#

Location doesn't look quite right to me, either.

#

right side, pawn is standing behind the drawer. left side, pawn is standing in front of it quite a bit

#

So if your location is wrong and you rotate by some arbitrary amount it isn't going to be right most of the time.

#

Not sure if this is because you're multicasting a location change for the pawn but the server still thinks the pawn is somewhere else.

blazing spruce
#

I think that might just be the camera angle, your image is before the client even interacts with the draw which is where their location & rotation are set, outside of interacting with the draw actor it is just normal movement component movement which should be replicated by default

round acorn
#

Yes, but I'm saying even your normal movement has desync issues with location. I dunno if that compounds with what you're trying to do

blazing spruce
#

The location change isn't multicast? i should of mentioned all this code is running on an OnInteract interface call which gets ran on server when the player presses the interact key

#

So when either player interacts with the draw the Set Actor Location is setting them to the correct location its just the Set Actor Rotation that isn't for some reason

round acorn
#

Ah, okay. Yeah I see you're calling the multicast now but not using it

#

At least not for the location/rotation

#

Where are you getting the value for "player spot" ?

blazing spruce
#

Its a scene component on the BP_DrawBase actor

round acorn
#

Gotcha

#

I still think it's problematic that your pawn is in different locations. This doesn't just look like camera angle to me...

blazing spruce
#

lmao the green line in the right image is pointing towards the draw next to it, might be getting confused because 1, i have 100 draws there lol and 2 the white circle widget you see is the interaction indicator widget, the player on the right is within the overlap of those 2 draws but the one on the left is in the overlap of that draw its in front of and the one to its right, which is the left draw out of those 2 draws with the white circle widget on the left image

#

if that makes any sense

blazing spruce
#

Okay i managed to get it working doing it this way, not sure if this is the 'correct' way or not tho

#

Still also unsure why SetActorLocation works just fine and replicates on its own but SetActorRotation doesnt

round acorn
broken shale
#

I had a mechanism where you fire a projectile and it spawns an item where it hits but replaced it with a line trace after issues with multiple projectiles firing in multiplayerโ€ฆ I assumed that there was some issue with the server being able to keep up with the physics but in retrospect I probably just didnโ€™t have my functions set up properly to spawn on server, replicate properly, etc. That being said, do projectiles tend to perform poorly in multiplayer? It wouldnโ€™t be a large number fired at any given moment

austere halo
#

I'm trying to avoid sending a large array over the network in an RPC whenever I update it. The only alternative I can think of is using repNotify, as afaik unreal only sends the parts of an array that have changed, so that would minimise the amount of data sent.

But in the case of arrays, the repNotify only gets triggered when actually setting the value of the array, not when adding and removing elements. I was wondering if I set the array to itself + one extra element, which would trigger the repNotify, would that still be optimised over the network? Or would unreal think that its an entirely new array and send the whole thing?

dark parcel
#

From the Server pin, you want to Call MultiCastShield
From The Remote/Client pin You want to call ServerShield

#

Can someone explained ReplicationCondition OwnerOnly? Why does my value still replicate to the server?

quasi tide
#

Can someone explained ReplicationCondition OwnerOnly? Why does my value still replicate to the server?
Nothing replicates to the server. It is always from the server. This condition means that it will only replicate to the Owner and not other clients.

#

For example - the ammo in a rifle. That could be OwnerOnly because other clients don't need to know how many bullets you have. (unless of course you want them too)

dark parcel
#

@quasi tide Thank you

glossy kettle
fathom aspen
#

But if you got cpp access, you will want to check fast arrays

dark parcel
#

Hmm, so On Rep can have Input Parametre in C++, how can I do the same in Blueprint?

#

How to make it so OnRepNotify don't get called on server? I thought that's what OwnerOnlyCondition meant to do 0o?

thin stratus
#

In BPs, OnReps are just property changed callbacks :D

#

Since your Server sets it, it might call the OnRep I guess

#

C++ it shouldn't call either way, cause OnReps actually don't call on servers

austere halo
fathom aspen
#

A plus you mean

#

BP structs and Repnotifies are the worst pack I could have ever asked for xD

#

You can always call the OnRep in you setter functions

#

That's not a hassle

#

And you don't always need the OnRep to call on the server

#

So having the freedom is good

austere halo
#

yeah true I guess I just need to create functions to add/remove/set all the variables and include some logic for only the server to call the UI functions

fathom aspen
#

OnReps in BP can get called in a very wack way

#

Such that they can get called locally on client when the client sets a value

#

So yeah wouldn't have used them too much

austere halo
#

yeah I can imagine. In my case all the data is updated on the server exclusively so it isn't much of an issue. At this point moving the BP struct into c++ I think would be a nightmare because I'm using it all over the place. I guess I will just try profiling the network while setting the onRep array and see how much data it sends

real ridge
#

guys why I am getting this red doted thing called twice every time when it is executed in client? I tried debug my pawn but there it is called just once and when I get inside this blueprint its twice, I thougt its because I have 2 people in game so I added 3rd and it was also 2x called problem is that I am setting boolean after it and if its called twice then I will change it to true and then back to false so it has no effect...

#

any ideas?

#

its setting this

#

literally every time I debug its called 2x

icy jetty
#

What is currently calling your Shoot event?

real ridge
#

created in weapon attaching

#

but these stuff is all called just 1

#

I debugged it

icy jetty
#

So youโ€™re calling an event on the client and then telling it to replicate to server

real ridge
#

and these changes are always 2x called

#

u can imagine it better

#

it has no sense to be executed 2x

#

in map I do have 3 players all clients

#

one client call shield and it is running twice , also event for sound and animations is called 2x on every client weird

icy jetty
#

Again, you are calling an event

#

On the client

#

And saying replicate this event on the server

real ridge
#

and?

#

i dont get it

#

๐Ÿ˜„

#

when I change event shoot to not replicated its called 2x too

#

even when I put here do once it execute twice lol

#

and rewrite value

icy jetty
#

Thatโ€™s not what do once does

#

It just says you can only run this event once, but if youโ€™re telling both your client and your server to run the same code, you will see it twice

real ridge
#

So I did little test now

#

when I call my event like this via my pawn

#

it is executed just 1

#

when I use my dispatcher call it is called 2x inside but dispatcher in pawn is called just once

#

I am confused

icy jetty
#

Think of the meaning of the word replicate outside of UE

real ridge
#

or I am dumb

icy jetty
# real ridge or I am dumb

Sorry I keep getting distracted with work. When you run the game with 2 players and the print nodes come through, does one of them say client and one of them say server?

tardy fossil
#

if I run IsLocallyControlled() on a client connected to a server, it will only return true for the pawn its possesing right?

austere halo
#

Does anyone have experience with the network profiler? I'm looking at this packet and am wondering why the top row says it was 3308 bits, while its contents were apparently 48k bits. All the other examples that I have seen make sense, with the contents adding up to the total packet size, but not in this case

#

Oh dw, figured it out ๐Ÿ˜…

icy jetty
#

What was it?

austere halo
#

The previous bars before the one I selected were all 7k bits, so it looks like the packets were just split up. So it was just that the last packet that was 3k bits, but it showed the entire 48k bit content inside it

round acorn
icy jetty
#

Nice

dim trail
#

what would be a good approach to send a party invite to another client and have the second client update their ui?

#

right now im doing this, however the second client never updates their ui.

void UPlayerPartyComponent::Server_SendPartyDataToPlayer_Implementation(APlayerCharacterBase* PlayerCharacter, FPartyData PartyDataNeeded, FGameplayTag UpdateTag)
{
    APlayerCharacterGASController* Controller = Cast<APlayerCharacterGASController>(PlayerCharacter->GetController());
    if (Controller)
    {
        UE_LOG(LogTemp, Warning, TEXT("Server_SendPartyDataToPlayer_Implementation: Calling on %s"), *Controller->GetName());
        UPlayerPartyComponent* TargetComponent = PlayerCharacter->GetPartyComponent();
        TargetComponent->PartyData.PartyMembers = PartyDataNeeded.PartyMembers;
        //PartyWidget->UpdatePartyUI(UpdateTag, PlayerCharacter, PartyDataNeeded);
    }
    else
    {
        UE_LOG(LogTemp, Warning, TEXT("Client_SendPartyDataToPlayer_Implementation: PlayerCharacter's controller is null or not of type APlayerCharacterGASController"));
    }
}
round acorn
#

well it's commented out! haha

#

honestly, not sure, I'm all blueprints with widgets

#

I assume you have either another widget or some other means of ensuring you're getting the correct instance of the character (the other player's character), sending that to the server (via making sure you can send an RPC from the correct place, e.g. it's not getting abandoned for no owner) for the server to send the party request to the other client based on getting that correct instance

dim trail
#

well, when I actually invite the second player it updates the PartyData on their client - and the first client actually updates with data from the second client. Its the second client that doesnt update the data

#

I have the variables on COND_None, if that matters

#

fist client correctly updates:

#

second client:

#

the name is the same, but I know that the instances of the widget belong to the first and second client respectively

round acorn
#

Right, they have to

#

Somewhere you aren't getting the data to the second client's widget though. Sounds like the client at least has the data replicated to it

dim trail
#

Yeah, and I have an event dispatcher which calls to update the ui when partydata changes, and It calls on both clients

void UPlayerPartyComponent::OnRep_PartyDataUpdated()
{
    UE_LOG(LogTemp, Warning, TEXT("OnRep_PartyDataUpdated: Calling on %s"), *this->GetOwner()->GetName());

    for (const FPartyMemberData& PartyMemberData : PartyData.PartyMembers)
    {
        Server_SendPartyDataToPlayer(PartyMemberData.PartyMember, PartyData, LastUpdateTag);
    }

    OnPartyUpdated.Broadcast(LastUpdateTag, LastAddedPartyMember, PartyData);
}
#

so party data changes on client 1 -> onrep calls -> send client 1 data to client 2 via RPC -> update UI on first client

#

from there client 2 should also call the on_rep method to update the ui

#

i would think eww

round acorn
#

it's curious client 2 doesn't even include itself in the party

#

ah yeah you still have "Create Party" I see

#

tbh this is normally where I start throwing print strings and breakpoints everywhere lmao

sinful tree
#

I did a party system using a replicated AInfo that is assigned to a replicated variable on the PlayerState and used a IsNetRelevantFor override to check if the playerstate contains the AInfo so it only gets replicated to party members - then you have a centralized "Party" object in which you can store the members and handle any data between them.

Using a Component means you're likely duplicating data and makes it much harder to keep what the party is in a single place.

#

Unless it's a component being added on gamestate or something like that.

fathom aspen
broken shale
#

When a player reaches the goal I want to teleport them back to the starting location. Plan to use a teleport in the goal blueprintโ€ฆ does it need to be set to run on server?

fossil spoke
#

Otherwise it will just cause a correction on the Client.

worn charm
broken shale
#

When you touch a cube with object Ankh it is supposed to destroy the cube and add to your ammo. Worked fine for one player but for the other the cube did not destroy. I have it set to call custom event destroy on server and then the following... am I doing this wrong?

arctic minnow
#

Dose anybody know why my damage add only works in client

#

๐Ÿ™‚ ๐Ÿ™‚

sinful tree
arctic minnow
#

So pretty much each time I get hit it adds my damage into a variable and if its greater or equal then a certain amount before the retriggable delay hits zero and sets it back to zer

#

but it only works in client for some reason

short arrow
#

so the retriggerable delay isn't working?

#

idk what's not working

#

is the event not working?

#

you're not being clear enough to get help

broken shale
short arrow
sinful tree
# broken shale Waitโ€ฆ the touch happens through an overlap event, do you just mean that a has au...

Yes. Anything gameplay related should normally be happening on the server, especially so with things that alter counts like ammo. The "Has Authority" node normally is checking if the current instance of the game, has authority over the object you're working on. Eg. If you spawned a replicated actor on the server, then the server would have authority. If you spawned that same actor by having a client do it (eg. Triggering an overlap and using the "Remote" path on Has Authority) then the client would end up having authority over the actor as the server wouldn't know about it.

If you want to destroy the actor, then it's likely that you want to destroy it on the server, especially so if it is replicated.

arctic minnow
#

๐Ÿ™‚ ๐Ÿ™‚

sinful tree
ivory bear
#

Launching with 2 players from editor, with Play as Client selected... why would the circled ending fire 5 times on launch? and the final ones come in with the crosshair_ref as None. Edit: changing to run on owing client limits it to 2 runs, but still None

sinful tree
#

Can also fire on other clients.

#

If this is on a character, then use a branch before creating the widget and plug in "Is Locally Controlled"

ivory bear
arctic minnow
arctic minnow
sinful tree
#

Where is this event being called from?

#

Well, I mean, put a print string on your AnyDamage, check if it actually is being called properly on the server in the scenario you want.

#

I have my doubts, as calling apply damage will only ever function on the server, and if you're saying that your damage is not being applied while running as client, but works fine in standalone, that's a sign that how you're getting to the point of calling apply damage isn't correct.

arctic minnow
wicked latch
#

Hey I need some help. So I have 2 projects which are entirely different.

Project 1: UE 5.1 using Steams Online Subsystem
Project 2: UE 5.2 using EOS

Both projects when I connect to a friends listen server, there's rather bad jitter when moving. Project 1 is nothing but a blueprint derived from character with some add movement nodes, that's it. I've had that exact setup sometime last year with no problem but now it's occurring. I have replicate movement checked, the character is set to replicate, all components are replicated aside from the camera comp, the other person lives about an hour away from me. I tried everything I can think of as well as loads of different solutions from googling to no avail :/

Attached picture shows project 1s character setup

#

In editor I don't get any jitter, only when I'm in the server

#

This is my first time working with replication alongside enhanced input, so maybe I'm missing a step there?

limpid parcel
#

what's a good way to get started with learning replication

fossil spoke
#

Try to build a networked chat box or something simple like that.

#

Maybe even try a building a door that you can open/close with multiple clients.

#

Simple stufff.

winged badger
#

start by turning off the replication for your Capsule and Skeletal Mesh

wicked latch
#

I've done that as well, disabling all but replicates and replicates movement

#

As well as using smoothsync

#

And it was just information as I wasn't sure if it was on unreals end initially since in engine I wasn't jittering

#

Even a simple cube with physics enabled and is set to replicate jitters and even teleports at times

real ridge
queen escarp
#

hmm why is this not replicated :/ ?

#

like the direction .o

jovial charm
#

Hey guys I have a weird issue. I have an actor that has a property replicated. However, whenever I change the property on the server, it only replicate to the owner client, and not all the clients.

Here is the actor in question:

class MYTHIC_API AWorldItem : public AActor
{
    GENERATED_BODY()
public:
    AWorldItem() {
            this->bReplicates = true;
            this->SetReplicates(true);
        }
    
        // This only gets replicated to the owning client only for some reason???
    UPROPERTY(Replicated, VisibleAnywhere, BlueprintReadOnly, Category = "Item")
    AItemInstance* ItemInstance;

    virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override {
        Super::GetLifetimeReplicatedProps(OutLifetimeProps);
        DOREPLIFETIME(AWorldItem, ItemInstance);
    }

        void AWorldItem::SetItemInstance(AItemInstance* ItemInst) {
          checkf(HasAuthority(), TEXT("AWorldItem::SetItemInstance: Only call this on the server"));
          this->ItemInstance = ItemInst;
          SetActorEnableCollision(true);
        }
}

I run the game with 2 clients, with a separate server in the background, and when I update the value of ItemInstance using the SetItemInstance function, only the owning client gets the value, the other clients dont receive anything. Please help.

#

Solved it. Had to use bAlwaysRelevant = true; in the constructor of ItemInstance

queen escarp
thin stratus
# queen escarp <@94211915902889984> Hey man you got a sec to explain to me why the movement i...

First of all, I would really appreciate it if you wouldn't ping me for personal help. If everyone does that I would be non-stopped pinged.
Post your question and wait for an answer. If I have time I will also help. There are a lot of people here that can help you other than me.

And your issue is clearly that you are using something for the Rotation that doesn't utilize the PITCH of the ControlRotation.
Whatever defines your Direction/Rotation, try use "GetBaseAimRotation" (Pawn function) with it instead.

queen escarp
#

@thin stratus ok sorry ill remember that ! ok ill look at it thansk

thin stratus
#

@ whoever asked about the SchoolDoor teleport and deleted the question

Need more context. There is a couple of things strange about this.

  1. Why does the "SchoolDoor" Actor have a replicated Character property?
  2. Your "Server" labeled RPC is a Multicast. You are calling two multicasts at the moment.
  3. Why do you Multicast for the Teleport at all?

Biggest question would be what is even calling the Server/Multicast? You can't use ServerRPCs in non-Client owned actors.
Your Door is probably standing in the middle of the level, not owned by the Client that executes the interaction.
You'll need to explain how this is supposed to work in general (what does the player do to teleport).

After that we can suggest you changes to make that work.

#

uff

#

They deleted the message

thin stratus
#

That removes all optimization that comes from distance culling etc.

#

That being false is also not the reason that your item doesn't replicate to the second player, unless that second player is far out of reach.

thin stratus
#

That Damage Event you are using is SERVER ONLY

#

The Code will already not call on the Client. There is no need to ServerRPC

arctic minnow
#

๐Ÿ™‚ ๐Ÿ™‚

thin stratus
#

Also if that was you who posted about the Teleport SchoolDoor stuff

#

Then this was my response before you deleted the question

arctic minnow
#

๐Ÿ™‚ ๐Ÿ™‚

thin stratus
#

I assume you are talking about that Knockback anim

arctic minnow
#

Also this is the reason I have a hole bunch of server rps

#

Most of them are servers then multi

thin stratus
#

Alright, I guess that's fair if your code is build like that. I can tell you though that I don't have a single ServerRPC that forwards a Montage to the Server.
That's usually very redundant

#

But either way, can you print in those and check who calls them?

#

Should make it clearer

arctic minnow
#

Where do you want me to put the print and also thank you!!

#

๐Ÿ™‚ ๐Ÿ™‚

thin stratus
#

With different Printed Strings to differentiate them

#

To see what actually calls

arctic minnow
# thin stratus

I did it and it seams like it goes into the damage add and cant make it out

thin stratus
#

Then that function might already have an issue

#

My suggestion would be moving the Print Strings into that function to check what is calling and what not. And also to print the Damagen and Knockback Damage value to see why they might fail the condition

arctic minnow
#

Found out the reason I think so it dose work in single player it just adds way less because in multiplayer since I have a multicast its adding it twice I think so umm not sure how I could make it only add the number once in multiplayer and in single

arctic minnow
thin stratus
#

Idk what values you exactly mean

#

Is the Damage value you receive higher?

#

Then you will want to follow the execution path of your damage backwards until you find where the damage started changing

#

I can't answer that as I don't know your code

arctic minnow
#

So its setting my knockback damage higher each time I take damage but its sets it higher in client then in server? ๐Ÿ™‚

#

๐Ÿ™‚ ๐Ÿ™‚

arctic minnow
thin stratus
#

Yeah well as I said, you will need to go follow the code backwards and check where the Damage Variable comes from

#

You probably already know

#

And then check why it' shigher

#

Print the Value at that point in your code

#

The above code where you add up is already too late I guess

arctic minnow
#

I think the problem is when I apply damage it applys twice in the client this is my damage system

#

sorry if those screen shots cludder ill delete them after ๐Ÿ™‚

thin stratus
#

You are using way too many RPCs

#

Like WAAAAAAY too many

#

That also causes your issues

#

Damage should only be handled on the Server

#

There is no need to ServerRPC or to Multicast

#

You can Multicast things like the Montage fwiw

#

You need 1 RPC to tell the Server to perform the Action that later results in applying the Damage

#

Nothing else

#

That RPC is redundant. The Trace should already be on the Server if you are doing it correctly.

#

That's all wrong too, cause you, again, should already be on the Server and only handle the Damage on the Server

#

That's also redundant. That can be a Multicast if the code before that is, as again said, already on the Server

#

You can always call the code on Both Client and Server, but then the Client should only do local prediction of effects and not deal damage

#

And 100% not tell the Server they dealt damage

#

The basics of how to structure your code seem to be very unclear for you. I would highly recommened rethinking this systems before you create something that falls apart more and more

arctic minnow
#

Ya I just realized I don't even need that multi cast idk why its there or what was going throw my brain

#

๐Ÿ˜