#multiplayer

1 messages · Page 713 of 1

eternal canyon
#

Doesn’t fortnite generally trust clients and just make sure they weren’t shooting through a wal or smthnl, and rely on their anti cheat for the rest

pallid mesa
#

you say I gotta rewind the players??? and vehicles???

#

oh lord!

hollow eagle
pallid mesa
#

its defo complex!

eternal canyon
#

Also unreal tournament has an example of rewinding shots

hollow eagle
#

I wonder what Apex does. It's source engine which means they get rollback for "free" but so much has supposedly been rewritten... and who knows what they've had to sacrifice in the name of performance.

pallid mesa
#

for characters mhm, but things start to complicate when you add more movables to the picture

hollow eagle
pallid mesa
#

and... if you want projectiles? even harder!

pallid mesa
#

x'D

hollow eagle
#

there aren't enough physics props or anything else moveable to matter in any of Valve's multiplayer games so they just didn't bother.

pallid mesa
#

you can get away with lots of stuff tbf

hollow eagle
#

Projectiles (after maybe an initial check) don't need rollback because they're managed by the server in the first place.

pallid mesa
#

yes well it depends

#

if you want anti cheating

#

u need to resimulate the projectile path

#

rewind

hollow eagle
#

you don't

pallid mesa
#

and rollback if something hit the fan

eternal canyon
hollow eagle
#

that's not how projectiles work

pallid mesa
#

well ask jambax

hollow eagle
#

again - projectiles can be managed solely by the server

#

the only lag compensation you generally need is on the initial tick where you might want to do a trace to see if something is close enough to hit in that first tick

pallid mesa
#

oh yes they can, but we are speaking about a client auth trust and verify

hollow eagle
#

not with rollback we aren't

#

not in relation to CS/Valorant/etc

#

they don't trust the client whatsoever with this stuff

pallid mesa
#

ah no, not speaking about those, nono (sorry jumped late to the convo haha)

#

more on the battlefield side

#

or pubg

hollow eagle
twin juniper
#

anyone know if there is a way to bypass max rpc size?

pallid mesa
#

client goes pewpew, and the projectile is resimulated in the server

pallid mesa
hollow eagle
#

ofc

pallid mesa
#

haven't studied those models

pallid mesa
#

so there's no any form of "prediction" in the shooting?

hollow eagle
#

There's prediction

#

that's the whole point of rollback

pallid mesa
#

yes then the client shoots, and then it's verified in the server?

hollow eagle
#

yes

#

but it's fully server authoritative

pallid mesa
#

then it's trust and verify... the client authorative server validated thingy

hollow eagle
#

It's not client authoritative

#

it's client prediction, server authoritative

#

the server does not trust the client in any way except that "i shot in this direction"

pallid mesa
#

only direction, I see

hollow eagle
#

and possibly timing - I'm not entirely sure how the server determines rollback time

pallid mesa
#

ntp usually and timestamp, that's the classical model

hollow eagle
#

client prediction means that the client assumes it was right (this is why you get "blood shots" where you see blood splatter but the enemy takes no damage) but the server resimulates from the client's fire time

pallid mesa
#

yes yes I know what prediction is x'D I didn't know it was fully resimd in the server, rather than checking that the shoot was possible (that's the validation part)

#

the server authors the damage part

#

(for starters shootergame simplistic approach)

worthy eagle
#

So TMap can't be replicated nor can I send it in an rpc apparently, no idea why...Is there any workaround before I horribly implement my own map in a USTRUCT and have to redo half my code?

plucky prawn
worthy eagle
#

Yeah I thought of that out shortly after posting. Still seems werid you cant replicate the entire tmap tho. Like why? Its such a used data structure.

halcyon totem
#

if I am running a dedicated server from my home PC, can I connect to the server from my own PC, or do I need to use my laptop?

#

or can I connect at all?

plucky prawn
#

you can connect locally to a dedicated server

near bison
plucky prawn
near bison
#

What do people usually do?

near bison
#

What if i want to send in the whole map?

#

To keep it synced across all clients?

#

For example the state of all tiles in a board game?

plucky prawn
#

the problem with this is not the data structure being used. you could use an Array which works across replication

#

but this use case sounds sketchy to begin with

halcyon totem
#

@plucky prawn I am not trying to connect locally I am tryng to connect from my home PC to the dedicated server on the internet

near bison
#

Why is it sketchy? I've done this in several of my unity projects

#

Most unity networking libraries allow you to replicate a map

halcyon totem
#

is this possible?

plucky prawn
plucky prawn
halcyon totem
#

well I am not trying to connect over lan its over the internet if my server is running on my home PC and I try to connect from the my own PC not lan its suppose to work right?

plucky prawn
halcyon totem
#

yes my server shows up on the epic online server dev portal, I just need to know if there is something with unreal that would stop it, can I join through the editor to the stand alone server on the internet in development mode?>

plucky prawn
#

wait are you trying to prevent your server from showing on the internet?

halcyon totem
#

no I am trying to join the dedicated server through my editor

plucky prawn
#

ok

halcyon totem
#

in stand alone mode is that possible?

plucky prawn
#

depending on the OSS it might have issues. afaik steam has issues with PIE. does it work when you try to connect in a packaged build?

#

standalone has no networking

halcyon totem
#

im goiong to try through my andriod

cosmic epoch
#

thx again for the help, I ended up implementing the attach process into it´s own Gameplay Ability. I initially thought that attachment isn´t replicated by default, but now that I know it is, it´s much easier to get this done

worthy eagle
# near bison Wait we can't do this in c++ either?

No apparently not. Its werid. Doesnt make sense to me. TArray can be replicated but not TMap. UE replication happens at the levels of actors which admittly is better than trying to send a whole bunch of stuff across the network at once. So basically you would define a function inside your tiles that replicates updates its state to the rest of world.

worthy eagle
near bison
worthy eagle
# near bison Yeah I'm disappointed honestly. Such low hanging fruit and will be useful. I can...

Yeah the only thing that even sounds like it would justify it is that quite simply it encourages bad network code since TMaps are inheirtly bigger than TArrays and you really want to send as little as possible over the network.

Even still that feels like a weak argument. I mean realistically how much am I sending over the network with something like TMap<FGameplayTag, FGameplayAbilitySpecHandle>

#

Now i have to do multiple rpcs calls instead of just the one

red salmon
#

Hello, can someone explain to me how the players know how to identify a valid server or not? I want to make 2 apps one which is the game app and one used to be a server app that is only for hosting the game but also have a nice little UI on the side. but idk if I make 2 separate projects will a user still be able to connect from the game app to a session hosted by the server app? what are the requirements to make this possible?

limber echo
#
    if (CharacterOwner->GetRootComponent() == nullptr || CharacterOwner->GetRootComponent()->GetAttachParent() == nullptr)
    {
        Super::UpdateBasedMovement(DeltaSeconds);
    }
    else
    {
        return;
    }
}```
I'm total noob in c++, how can i declare CharacterOwner ACharacter? This is CharacterMovementComponent, how do i do it?
jovial dawn
#

g morning guys !

#

I'm looking today for a good tutorial on how to make it place a login/character creation/database acces tutorial, I'm new to this and I wonder how to create/save into external database and load it back, I would like to do it in BP and not c++ , so looking for good tutorial or if there a bp package that does it all would be better I guess LOL 🙂

#

I'm also want it to be secure. for now on... my game save character info on local client

twin juniper
hoary lark
#

@halcyon totem what you're asking is confusing, is it over WAN or LAN? Use the appropriate IP for each (192.xxx for LAN)

plucky prawn
#

Is it possible to replicate specific properties per client/connection? Like if I have an actor that is not owned by a player, but want to replace properties A, B and C to Player 1, and properties D and E to everyone, is this possible?

#

I figure IsRelevangFor doesn't really help here since everyone would be relevant

solar stirrup
#

Not possible no

#

You'd need to use proxy actors that you make relevant to specific people for that to work

#

Or modify the engine pretty extensively

#

In theory, this kind of addition to the engine shouldn't be too hard

#

in theory

#

You'd likely want to modify void FObjectReplicator::ReplicateCustomDeltaProperties( FNetBitWriter & Bunch, FReplicationFlags RepFlags ) and probably make your own COND_ value

plucky prawn
#

Sounds like I don't want that actually

#

But the proxy actor could work

solar stirrup
#

It's the simple solution yea

#

and likely the sane one

#

Now I actually want to try and implement a custom condition, might try that for fun

fallow shadow
#

how do i spawn a replicated actor?

fathom aspen
fathom aspen
#

Pretty much like you would spawn a not replicated one

fallow shadow
#

Uhh that's just spawning an actor but the actor is only visible to the client that spawned it

solar stirrup
#

Server

fathom aspen
#

Ah you need to make sure the server is spawning

fathom aspen
#

Lol

fathom aspen
fallow shadow
#

Oh also

#

if im applying force i gotta make sure the server is applying force right?

fathom aspen
#

Yeah probably

#

This kind of events run on the server anyways

fallow shadow
#

(you do stuff on the server using a Server UFUNCTION?)

magic yoke
#

do replicated actors/variables cause server stress if they're static?

#

well, not being changed*

empty axle
#

yes, server still have to check it if it changed

fathom aspen
#

Read the compendium (#4 pinned message)

solar stirrup
#

@empty axle ^

#

It's specifically made to reduce the cost of replicated properties since the server won't poll them anymore, you have to tell it you've got properties to replicate

fallow shadow
fathom aspen
#

Depends where you trying to spawn it from

fallow shadow
#

Client

fathom aspen
#

You can't from client. I meant what class has the spawn logic?

fallow shadow
#

uhhh class of mine inheriting from AActor

#

god i cant replicate this for the life of me

tame sapphire
#

Im not sure if this is the right direction but i currently have a button in a widget that calls the player controller for an event, this event (player ready/unready) sets a var on the player state depending on which. Wondering if this is the right way to go about this?
Widget:

#

Player Controller:

#

if this is the right direction whats the best way to call the unready event from within the game mode on all connected player as all players is player state?

#

As i thought the following
Game Mode:

#

Which uses the game state all players array but i can only get the Player State through the element, when what i think Iwant is the Player controller so i can run the toggle unready event? so that i get button states not just the Variable...?

#

or should the toggle ready events be in the player state and just called from the controller by another event?

fathom aspen
# fallow shadow uhhh class of mine inheriting from AActor

If that actor was spawned on the server then you can spawn another actor from it. And you simply need to wrap your spawning with a HasAuthority() check. If you want to see the spawned actor on client make sure it bReplicates. There's nothing special about that

fallow shadow
#

UHhhh well

#

im spawning it from a non-uclass class

#

is this still possible or do i have to switch it to uclass (actually no i cant do that)

fathom aspen
#

I don't work with such classes, so I can't say. Probably ask in #cpp

fathom aspen
#

It SHOULD work

fallow shadow
#

ok can you please enlighten me

#

how to spawn something on the server

fathom aspen
#
if(HasAuthority())
{
    GetWorld()->SpawnActor<AMyActor>(...)
}
#

SpawnActor is overloaded, so use the version you like

hollow eagle
#

It'll work assuming the actor is marked as replicated.

magic yoke
magic yoke
#

(found it, only sends a replication call when a variable is flagged as having changed)

dark edge
#

Anyone have any data on perf savings they got with Push Model?

magic yoke
fathom aspen
nova wasp
#

wow, cool

#

I had no idea it was enabled for BP stuff

fathom aspen
#

Yeah me neither. I hope the source code isn't fooling me though 😅

magic yoke
#

but "mark property dirty" wants an actual property

#

not a variable

fathom aspen
#

You pass the property name

magic yoke
#

right, but without going into C++ how do I define a property name

fathom aspen
#

It's your variable name

magic yoke
#

hm, well unless I need to refix the project somehow for the modified .ini

#

replication still works without marking things dirty

#

unreplicated: marking dirty doesn't replicate it

#

replicated: doesn't care if it's marked dirty or not

fathom aspen
#

replicated: doesn't care if it's marked dirty or not
And replicates it?

magic yoke
#

yep

#

it still replicates it

#

whether or not I mark the property dirty

#

I set the system settings in the .ini by copy paste

#

and restarted the project

#

before doing this

fathom aspen
#

Ok then the push model isn't seem like it's working

magic yoke
#

so that should work then?

#

this is what you meant right?

fathom aspen
#

Right

magic yoke
#

yep, so unless it's automatically handling dirty behind the scenes it's only partially implemented

#

I'm a little iffy btw on that property pin

#

I can't get a property name out of a variable

#

which strikes me as strange if it were properly impleemnted

fathom aspen
magic yoke
#

well yeah, I did manually type out the variable name

#

but as discussed, that didn't work

#

triple checked I spelled it right

fathom aspen
#

Is your project bp only?

magic yoke
#

yes

#

I know how to code other in languages but I didn't really want to learn C++ when I'm doing this for fun atm lol

fathom aspen
#

Well if you had a cpp project, you could debug engine code to see where things are getting wrong

magic yoke
#

yeah, well I'll chalk that up to someday for now :D

fathom aspen
#

Without using cpp

#

Just so you could have that source code to debug

#

I'm not sure if you can do it if your project is bp only

magic yoke
#

last time I tried to convert bp to bp and C++ is actually completely corrupted the project x

#

XD

#

so I think I'm gonna leave it as is

#

right now what's confusing me is setting a material property on a replicated actor, on a replicated component, not updating if the change material is called before a client logs in

#

so I'm still at the basics

#

ah that's what I was missing

#

the function inside the repnotify node

twin juniper
#

I have a question about general networking not completely unreal related, but in a two player peer to peer game,

#

Is the authority irrelevant, can essentially both be treated as the authority

#

if they're both running the same logic?

hollow eagle
#

No. Even in a true peer to peer scenario (which is not supported by unreal out of the box - listen servers are not peer to peer) you generally have clients with authority over specific objects

#

for example, a client would have authority over their own character.

#

what might be different is that multiple clients may have authority over the same object, which normal client-server scenarios wouldn't support

twin juniper
#

Yes, I think what I'm confused about is in a client/server scenario where you send a packet to the server, the server verifies it and sends a response back to you and all the other peers.

#

but in a peer to peer, you're verifying it yourself, as well..

hollow eagle
#

For objects that multiple clients have authority over you'd generally just accept whatever they did

#

But true p2p games are super uncommon.

twin juniper
#

true peer to peer as in, multiple peers allre connected to eachother

hollow eagle
#

RTS games often use p2p but they generally don't have many players, and each client only has authority over their own units.

twin juniper
#

rather than all peers connected to one host

hollow eagle
#

Yes.

twin juniper
#

I see, but even in a case where multiple peers connect to one host, if an object has to be shared across all peers,

#

Do all objects have authority

hollow eagle
#

Very few genres other than RTS use p2p these days. Destiny is a notable exception, except even that isn't fully p2p (there's multiple authoritative servers that handle specific aspects of the game).

twin juniper
#

over it?

hollow eagle
#

If there's something any client can interact with then generally all clients would have "authority". Every client is going to check the result and complain if they don't think what you did is legal, however.

twin juniper
#

Yes

#

precisely,

hollow eagle
#

Lockstep RTS networking will generally show that as being a desync

twin juniper
#

Which is why I'm kind of confused about who actually has authority.

hollow eagle
#

Everyone.

twin juniper
#

Okay so if a host sends a packet to a peer regarding a shared object

#

That peer has to treat it authoritatively

#

simialar,y

#

If a peer sends a packet to a host

#

THe host has to treat it the same way

hollow eagle
#

The peer doesn't have to do anything

twin juniper
#

Hmm

compact talon
#

I am trying to replicate anim montages and every guide I find says to do this, yet it doesn't replicate - only the host can see stuff.

Am I missing something obvious?

hollow eagle
#

Even in unreal client-server networking, having authority doesn't mean all clients have to accept it. It just means that someone is allowed to interact with the object.

twin juniper
#

Ahhh okay

#

Because the host can still send an invalid packet

#

And you should always validate the packet

hollow eagle
#

Or because a client can just do whatever it wants

twin juniper
#

even as a client

#

I see

#

okay, that clears up a lot.

#

So any object that's being shared everyone has authority over, that makies a lot of sense.

hollow eagle
#

The host may say player A moved to position B but player C's client could just... ignore that.

twin juniper
#

But it would desync

#

From A,B,D,E

#

and in that case it's no longer relevant

#

Generally what keeps it valid is the synchronsation amongst all peers?

hollow eagle
#

desync is irrelevant

#

Back in the day an RTS would "desync" which means that the two peers disagree on the state of the game. Since no one is the "host" it's impossible to say who is right and the entire game is cancelled.

#

But that's a choice the designers of the game made

#

They could have just as easily randomly chosen one client's state to be correct in the case of a desync

twin juniper
#

I see

#

Thank you for that clarification!

twin juniper
#

@hollow eagle So any object that doesn't have to be interacted with but is host controlled should only be seen by the host

hollow eagle
#

no?

#

anything that's not purely clientside needs to be seen by everyone

#

but, for example, a player character should only be controlled by the player its owned by

#

any clients receiving commands about movement or aiming or w/e from anyone aside from the owning player should ignore those commands.

solar stirrup
#

Blueprints automatically mark properties as dirty when you call Set on them

#

You literally don't need to do anything else other than enable the push model for bp properties

sweet pilot
#

Hi guys! Is it possible to pause the replication of a FFastArray in PreReplication?

#

Or is there anyway to stop a FFastArray from replicating based on a condition?

magic yoke
#

Check my logic if anyone's feeling frisky:

Server owned object is clicked on. Because the client doesn't own this, it calls an event in the controller.
the controller runs a server event to set w/notify two variables that make something visible

But it only shows up server side.

magic yoke
magic yoke
#

neat

#

any clue about my rep notify issues?

#

and thanks again for all the help :)

solar stirrup
#

Is that actor replicated

magic yoke
#

the actor that's being moved is replicated

solar stirrup
#

Check if the rep notifies are getting called

magic yoke
#

the server is receiving the on rep visible notify

solar stirrup
#

Did you set a replication condition on the two variables

magic yoke
#

I did not

#

should I?

#

(I'm 99% sure I've replicated other things without needing a condition set)

solar stirrup
#

Nah, just making sure you didn't set one by accident

magic yoke
#

if I spawn the box as visible initially

#

I see it on both clients

#

and turning it invisible does the same thing

#

only the server one goes invisible lol

#

which... I mean it's really weird

#

it's like the actor isn't actually replicating after it's spawned

#

if you think of anything @ me cause It's silly late and I gotta get some sleep.

Thanks for all your help :)

solar stirrup
#

Are you sure Replicates it set to true?

magic yoke
#

...

#

well

#

thank you erlite, it's stupid

#

but it's not at all the kind of stupid you'll be expecting :DDDD

#

story time: I want to make a game that involves a lot of actors, and multiplayer would be cool. So I was reading up on how to keep an eye on that

#

tried the push notify thing, but I couldn't visually see it working

#

and other people shrugged cause they weren't sure

#

so

#

I made a "slowreplicatingactor" which takes an update speed as a variable so my actors that don't need updating often could be set easily

#

...

#

guess what I accidentally set to 0 at some point

#

so yes, the actor was replicating

#

but you can have a replicating actor that never updates

#

by setting the net update frequency to 0 :DDDDD

#

but

#

what you just told me

#

suggests I don't actually need to worry about this at all

solar stirrup
#

lmao

#

Don't worry about those things until they become a problem

magic yoke
#

I wanted like 10,000 tiles

#

obviously not all visible

#

but seeing 500-1000 tiles shouldn't be difficult

#

but if the dirty push thing is baked in

#

that solves 100% of my rpoblems

marble gazelle
sweet pilot
#

The top one is FastArray the bottom one is a normal TArray

#

As I switch them between true or false, the normal TArray will or will not replicate

#

The FastArray will just always replicate :P even if I set the override to false

marble gazelle
sweet pilot
#

Do you mean like this?

#

I still get the PostReplicatedAdd call on my client even if it's false :(

marble gazelle
#

No I mean the delta replication function you implemented to call the internal function

#

but not sure it's that easy, as you also need to copy over the delta state hmm

#

why do you want to paus the replication btw?

sweet pilot
#

oh, I'm trying to implement my inventory with a fast array, I want to pause its replication during times when I modify it rapidly, like when firing a gun

#

I'm trying to have some sort of prediction when firing a gun on the client side, and if the fast array constantly replicates it might change the local ammo count back up during firing

#

client 9->8->7->6 receive replication 8->7->6->5

#

@marble gazelle Sorry for the ping but do you mean this function

sweet pilot
#

I gave it ago and it worked! but by doing condition checking here, do I risk of breaking the entire array's replication?

marble gazelle
marble gazelle
sweet pilot
marble gazelle
sweet pilot
sweet pilot
marble gazelle
#

(well if you have access to the implmenetation of the interface, otherwise I don't think you can get it as shared ptr^^)

#

so you need to get the shared ptr from FNetDeltaSerializeInfo::OldState and assign it to FNetDeltaSerializeInfo::NewState (assuming I didn't misunderstood the API)

sweet pilot
marble gazelle
# sweet pilot I have very little knowledge about shared ptr lol

you would need to call a function on the implementation of the interface. AsShared or smth like this. You can't just make a new sharetptr, especially not just with the interface. you need to look at the code for the fastarray and check which class implementes the interface and is assigned to the NewState. Then you get the old state, cast to this impl and call asshared or smth like this

sweet pilot
#

I see

marble gazelle
#

(assuming it also implements TSharedFromThis or how it's called^^)

sweet pilot
#

maybe something like this

#

I'll check it out more

marble gazelle
#

hmm could you check if the Newstate already is not null? if that's the case you might don't need to do anything

sweet pilot
#

maybe I'll do != nullptr instead

marble gazelle
sweet pilot
#

ohhhhhhh

#

yeah I didn't see that it's also an pointer

#

Would this be the right way to check?

marble gazelle
sweet pilot
#

it's false before going into the FastArrayDeltaSerialized

marble gazelle
#

always or only the first time

sweet pilot
#

always :(

marble gazelle
#

then you need to copy it over^^

sweet pilot
#

bummer

marble gazelle
#

you can always write your own delta serialization to fit your needs^^ that's what I do

sweet pilot
#

if I don't do that when I skip NetDeltaSerialize, the next time I let it through it will replicate the entire array?
What I should do right now is to copy the old state to new state whenever I want to pause replication?

marble gazelle
#

yep, then the next time you replicate it knows the old state it replicated

sweet pilot
#

I see, if I don't move it, the next time it tries to replicate it will not find the old state so instead replicate the whole thing

marble gazelle
#

yep

sweet pilot
#

Thank you very much

marble gazelle
#

you're welcome^^

sweet pilot
#

Can I ping you in the future about my progress on this issue?

marble gazelle
#

if you don't expect me to answer right away, but please keep it in this channel.

sweet pilot
#

If you are ok with me dm you, I'll post my findings here if I make any progress.
If not, I'll ping you in the channel :)

marble gazelle
#

as said, you can @ me if you think it's necessary, but don't dm me for now, think its better to keep it in the channel as I also don't know everything in regards or replication so other opinions always are helpful^^

sweet pilot
#

Just to make sure here is a simple pseudo code

marble gazelle
#

NewState = OldState

sweet pilot
#

ahha

#

yes

#

Thank you again :)

noble viper
#

Hi there, I am trying to multicast a sound cue like this. On "Switch has Authority" I have the AUTHORITY to multicast. The REMOTE calls the server RPC to request the multicast. When the client initiates the sound event, the host can hear it as well. But this is not the case they alternative way (host initiating sound event). Is this fundamental flaw I am missing here when using these nodes?

marble gazelle
noble viper
#

The RPC is called by the controller after someone clicks on a VR UI. I figured that the ambient sound is spawned by the server for each peer on multicast

solar stirrup
noble viper
#

yes

solar stirrup
#

Player controllers only exist on the server and their owning clients

#

So the multicast would do the same as a client RPC in this case

#

You'll want to call the multicast on an actor that's available to everyone

noble viper
#

right make sense. probably why RPC call for AUTHORITY doesnt work. thanks

static flare
#

Is it not safe to simulate multiplayer in PIE? I think I'm being buttfucked by code that uses IsLocallyControlled or something..

solar stirrup
#

It is, time to debug :^)

#

Anyone know what exactly Self is in a profiler's stat time?

#

I'd love to know what the bottleneck here is

bitter oriole
solar stirrup
#

well shit

#

how the hell do I optimize UReplicationGraph::ReplicateSingleActor()

winged badger
#

you reduce the number of replicated actors

#

this in particular, looks criminal

#

how many instances is this, and also, what binaries did you use to profile?

solar stirrup
#

and binaries iirc were shipping ones

#

or actually no nvm

#

Development Test

bitter oriole
#

Siri, play "stick to 10 players if you don't want problems"

solar stirrup
#

Considering we're pushing for 100 that won't do

bitter oriole
#

I wish I had that kind of marketing budget

solar stirrup
#

Self doesn't counter DependentActors right

bitter oriole
#

Self is any time spent in that counter not spent in a child counter

solar stirrup
#

Might need to tone them down a little too, 5.7ms

#

aight

winged badger
#

with replication graph taking that long

#

you do not have a viable product right now

#

or a basis for one

#

how many replicated actors around?

solar stirrup
#

I'll need to get a number next time i profile

#

game works well enough at 80 players, server runs at 25-35 TPS

#

Just trying to squeeze more performance so that we can push for more players

#

There's not a lot of replicated actors, it'd mostly be other players, their weapons which are dependent actors, vehicles and deployables

#

spawn points and more too but these replicate infrequently

bitter oriole
#

80 players with weapon as actors means you've got in the 400 replicated actors

solar stirrup
#

There's gotta be something wrong with the soldiers though, they're taking way too much

bitter oriole
solar stirrup
#

I mean yeah when you look at it, 0.3ms per player ain't too bad

#

But I'm sure we can do a little better

#

Maybe if we round robin players thonk

bitter oriole
#

Take some of those millions in the marketing budget and hire a bunch of network engineers

solar stirrup
#

I'm the one supposed to tweak everything

#

Already pushed a lot of performance compared to before, pretty sure i'm getting close to viable performance at 100

#

It's playable, just not optimal

#

(oh btw, the stats i sent were the worst out of all the profiling, the other ones I have have the server keep steady at ~30 fps)

nova wasp
#

have you aggregated their ticks?

#

that might eke out a bit

solar stirrup
#

eh, would that even affect the replication though

nova wasp
#

My company game's playercount is 4 so you can count on my advice 😎

solar stirrup
#

Character ticks take like 0.05ms

#

I think it's fine mmLul

nova wasp
#

so like .25ms is just networking stuff? wowza

#

what the hell is it doing in there

solar stirrup
#

tbf, it's already way better than before, we can have 100 players at about 20-25 FPS instead of 10 without the rep graph and the work that's been put into it

nova wasp
#

nice

solar stirrup
#

Guess I really can't knock down that Self time rip

#

it's not hella bad

marble gazelle
#

you could try adding more profiling into the actual called functions

nova wasp
#

yeah this is kinda vague honestly

#

QUICK_SCOPE_CYCLE to victory

sweet pilot
#

@marble gazelle I think what I am doing here is quite crude but did I get the general idea right?

#

FNetFastTArrayBaseState this is what is implementing the INetDeltaBaseState
In it there are three variables

#

IDToCLMap, ArrayReplicationKey and ChangelistHistory

#

so in method 2 I kinda just copied them :P

chrome bay
#

Eww why would you do that

solar stirrup
#

dunno why it'd take 15ms by itself

chrome bay
#

The point of marking individual items dirty handles the whole "delta" aspect

#

Also, NetDeltaSerialize is called every time the property is evaluated. You don't want to allocate stuff there, especially on the client.

#

Just don't mark the item dirty if you don't want it to replicate changes, easy.

#

I wouldn't pack ammo into the inventory data either, properties that are modified are vastly different frequencies shouldn't really be packed together in fast arrays

sweet pilot
fallow shadow
#

What are rpcs?

#

Server ufunctions?

empty axle
fallow shadow
#

that cleans everything up

#

thank

chrome bay
#

The return value is not whether serialization was successful, it will return true if something should be sent

sweet pilot
#

I see

chrome bay
#

And remember that function is bi-directional, it's called on Server and Client. The Client will just never read in changes if they are comparing states too

sweet pilot
#

I wanted to have my ammo as an integer on the weapon actor as well, but I destroy the weapon whenever I switch to another and I don't really have a small inventory like a shooter game with 4 guns, more like a RPG one

chrome bay
#

But tbh it feels like a workaround for a not-so-great design, ammo is a weapon property not an inventory property - what happens when you have inventory items with no concept of ammo? You pay the serialization cost either way

#

Also unless you're using delta-struct serialization (which has some residual issues), you're sending the full item each time it changes

#

So it can end up being way more expensive

sweet pilot
#

you are right, I should just have it on the weapon and then link the value to the inventory

chrome bay
#

IMO I would just remove it from inventory altogether. the concept of inventory should really be completely separate from ammo

#

What is actually IN you're inventory can replicate independently, that's a good case for fast-array because it doesn't change often but can be large

#

But the properties of each item should exist within that item IMO

sweet pilot
#

but I reload ammo from the inventory like a survival type of game inventory so I'm not sure how to completely separate the two

sweet pilot
#

I currently only have a array of structures

#

I call them up by checking the class in each slot and turn them into actors when I actually use them like spawning a gun

chrome bay
#

So long as the ammo value is replicated by the item and not the inventory you're fine

#

You don't need to mark the inventory entry dirty if the object instance changes

sweet pilot
#

Yes, but I destroy the gun actor if I switch to another, and then save some info into the struct, and find them the next time I spawn the same gun

chrome bay
#

Store the per-instance data in another struct that is linked to the inventory entry via an ID of some kind

#

You can use the ReplicationID of the item as the identifier even

sweet pilot
#

ohh

#

Brilliant

#

hehe

#

What if I fire my gun and then switch weapon, would the ammo count replication be dropped since the gun is also pending to be destroyed?

#

or I should just keep the gun alive

chrome bay
#

once you destroy the actor server side then yeah whatever ammo is in it is gone with it

sweet pilot
#

I see, thanks!

rich dune
#

Hey, how can I force a player rotation in Multiplayer. Like I want the player climbing a ladder to actually face the ladder.

I tried to set control rotation of the Player Controller and basically every rotation on the actor, it get's always ignored

ember dagger
#

Calculate rotation locally. Set rotation locally. Call a run on server rpc that sets actor rotation to a multicast rpc with is locally controlled -> false and set actor rotation again

rich dune
#

Actaully tried this before and nope nothing

#

by set rotation you mean the actor rotation or control rotation?

acoustic drum
#

Both right?

wild aurora
#

Does anyone know what could potentially cause a client's travel to map to change when receiving a ClientTravel from a host's ServerTravel? ie. The BrowseMap (pre-clienttravel) map is correct with the host, but somewhere along the way the LoadMap function calls the the same map the client is currently on.

ember dagger
#

I've used it before in my locomotion system. Worked for me 🤷‍♂️

teal jolt
#

has anyone done any through put testing with the engine with udp? , i've just done some load testing and i'm getting some crazy figures

#

eg i was getting up to and over 1.2meg/sec

silent valley
#

Yeah that's very high!
It's been a long time since I did any profiling but Unreal Network Insights was good to quickly spot some issues we had initially.

chrome bay
#

1.2 Meg/sec is unshippable

#

Won't ever work in the real world

#

Most games don't even hit 1/5th of that

#

Unless you're talking BITS per second, then it's fine

quasi tide
#

What's the ideal range?

#

And doesn't Fortnite get something crazy like a few kb/sec?

chrome bay
#

Depends on player count too, Server has to be able to receive and give data at that rate x # of connections too

quasi tide
#

What are the rates for HLL?

chrome bay
#

Not sure tbh off the top of my head

#

We're way over our original bandwidth budget I know that much

teal jolt
#

yeah it was 1.2meg/sec , i was really just playing with it to see what was possible and i must admit i was quite suprised at how far it went before the frame rate started getting bogged down, it's for a multiplayer system I'm rolling myself but uses a lot of the optimisation ideas from the old days of quake and quake2, from the load testing I've done so far in a peer to peer format the number of players possible in a world is quite ... insane

fallow shadow
#

Hey so Multicast and Server RPCs do nothing

#

what im trying to do is spawn an actor for everyone

#

(ill send code give me a second)

#

(gotta try something out)

fallow shadow
#
    UFUNCTION(NetMulticast, Reliable, WithValidation)
    void SERVER_spawn_projectile(FVector SpawnLocation, UWorld* WorldRef);

and also

void AgfMyCharacter::SERVER_spawn_projectile_Implementation(FVector SpawnLocation, UWorld* WorldRef) {
    FActorSpawnParameters ActorSpawnParams;
    ActorSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::DontSpawnIfColliding;

    // spawn the projectile at the muzzle
    if (this != nullptr) {
        AgfProjectileGrenade* prj = WorldRef->SpawnActor<AgfProjectileGrenade>(SpawnLocation, FRotator(0, 0, 0), ActorSpawnParams);
    }

}

bool AMyCharacter::SERVER_spawn_projectile_Validate(FVector SpawnLocation, UWorld* uwWorldRef) { return true; }
#

this straight up doesnt spawn it on server

#

i assume that if it did it would spawn on both clients

#

which doesnt happen

tame sapphire
fathom aspen
tame sapphire
#

ty for your answer but maybe i didnt word the question properly as thats not what im trying to ask

pallid mesa
#

Mainly because I'd like to have a baseline in terms of performance and network metrics

fallow shadow
#

uh yeah so i cant

#

for some reason that crashes

#

because the world is null

solar stirrup
#

Dunno if worlds are net addressable

#

What exactly are you trying to do @fallow shadow

fallow shadow
#

Spawn something on server and all clients

chrome bay
#

Yeah you can't pass a UWorld via RPC

#

Wouldn't make sense

#

The World is local to your instance

#

You spawn it in the same world that actor belongs to

dull sleet
#

hey guys, this is probably a really dumb question, but if my game's multiplayer style is host/join, instead of matchmaking, once I release my game on steam, can I make it so players host on their machine instead of having to pay for 24/7 servers?

chrome bay
#

Yes, you can support via listen servers, or ship your dedicated server binaries

#

Most do the former for player-hosted games

dull sleet
#

Wouldnt players need to port forward?

chrome bay
#

No, Steam has NAT Punchthrough

dull sleet
#

or does steam take care of that?

#

i see, thank you!

chrome bay
#

Listen Servers are only really viable for small games though, probably 10-16 players at maximum

#

Think UT/Gears etc.

dull sleet
#

yep, its designed to be a duo puzzle game

#

that should be fine, right?

chrome bay
#

yeah all good there

dull sleet
#

sweet, thanks again!

quasi tide
#

Pretty much most co-op games as well to be honest.

quasi tide
#

A wild Lorash appears

dark edge
#

I wish I had a good turn-based idea, it'd be so much easier then the stuff I try to make.

quasi tide
#

I have 2 ideas, but those are like game #3/4 in my backlog of games to make 😅

#

Maybe even further down

dull sleet
#

also, are there non c++ solutions for multiplayer in UE5?

#

i used advanced player sessions in ue4, is there anything similar in ue5?

bitter oriole
#

Advanced sessions

dull sleet
#

oh I'm an idiot, oops, forgot you had to install it outside of unreal first

fallow shadow
fallow shadow
#

i get an error in the Spawnactor itself saying that this was nullptr

#

from SpawnActor's perspective this is the world

hard hinge
#

How do you fix the network corrections that happen when you use AddForce() or any of the velocity-based functions?

ember dagger
hard hinge
#

I heard theres new stuff in ue54

ember dagger
#

Not sure, but doing movement related things on a tick event like add force just isn't going to replicate well at higher ping

hard hinge
#

What is the like "epic way" of doing this though

#

Like they have ziplines in fortnite

#

So its obviously possible

#

the net corrections kill the server

#

coz those rpc's are on tick

#

the corrections are on tick i mean

pallid mesa
#

can do CMC interp A/B

#

or root motion forces using GAS

#

fortnite probably implements a custom guided movement mode in the CMC in which it's as simple as following a line

#

prediction is for free

hard hinge
#

Does the header file confirm this?

#

Oh I see cpp /** * If true, and server does not detect client position error, server will copy the client movement location/velocity/etc after simulating the move. * This can be useful for short bursts of movement that are difficult to sync over the network. * Note that if bIgnoreClientMovementErrorChecksAndCorrection is used, this means the server will not detect an error. * Also see GameNetworkManager->ClientAuthorativePosition which permanently enables this behavior. * @see bIgnoreClientMovementErrorChecksAndCorrection, ServerShouldUseAuthoritativePosition() */ UPROPERTY(Transient, Category="Character Movement", EditAnywhere, BlueprintReadWrite) uint8 bServerAcceptClientAuthoritativePosition : 1;

#

Looks like it has to be set on the server though

#

But it's set to 1 by default... Doesn't that just mean it's enabled? That's a bit field right?

#

SO it's already enabled...?

pallid mesa
#

nono the 1 is the bit packing

hard hinge
#

oh true you're right, i forgot about that

#

it's 1 bit

pallid mesa
#

ye

#

memory goes brr

hard hinge
#

😄

#

u know it

twin juniper
#

I have a question about randomness in peer to peer. If both players are running the same logic and the logic generates a random number for an object to be spawned at a location.

#

Both players migth spawn a diferent random number.

#

Who's random number is decided ?

#

Or who sees what in this case?

hard hinge
#

It's a little more complicated than that

#

lol

#

Is the variable replicating?

dark edge
# twin juniper Who's random number is decided ?

You want to use something with the same seed or the same stream or whatever. Server chooses seed/stream, and client can generate based on it for prediction. But everyone will end up with the same random number tho.

#

Like for proc gen, you can make the same result independently on both machines by sharing the seed, like how Minecraft does it.

hard hinge
#

Soo like, which is preferred? RootMotionSources with GAS? Or bServerAcceptClientAuthoritativePosition? I feel as though bServerAcceptClientAuthoritativePosition could open room to hacking...

#

Like if you enable that, someone could alter their location using cheat engine or something lol

twin juniper
hard hinge
#

@twin juniper

#

tell me lol

dark edge
twin juniper
#

Ah okay, this question wasn't specifically related to unreal,

#

More so a general peer to peer question.

dark edge
#

There's no P2P in Unreal unless you are busting the engine open and modifying a lot of stuff.

pallid mesa
dark edge
#

In a pure P2P they'd come to some consensus for the random seed and then proceed similarly

twin juniper
#

well i think in Unreal you can use something like HasAuthority() right?

#

On replicated variables

#

to change those variables

pallid mesa
#

root motion forces works aswell

hard hinge
#

Nothing just happens on it's own.

fallow shadow
dark edge
twin juniper
dark edge
#

Or just roll on the host and use that

#

either way

hard hinge
twin juniper
#

So in that case some other authority has to decide on the seed

#

and send it to all the peers

hard hinge
pallid mesa
hard hinge
#

@twin juniper ```cpp
UPROPERTY(Replicated)
int32 DiceRollValue;

pallid mesa
#

or at least they path through the cmc

hard hinge
#

It's very restrictive

dark edge
#

It's not super huge and complex for no reason. Predicted movement is hard.

pallid mesa
#

i dont think it's restrictive xD it is complicated

hard hinge
#

It's annoying

#

lol

dark edge
#

Just do your own movement, you don't have to use the CMC.

pallid mesa
#

I agree, but look this is a very simple use case

#

you dont have input

#

your input is the zipline which is a spline that exists in server and client

#

speed is constant

hard hinge
#

Well for me, it's not a spline lol

#

But yeah I get the point

pallid mesa
#

spline or... whatever haha XD

#

its following a path, isnt it?

#

you can do it without the cmc, but bare in mind

hard hinge
#

it needs to probably be redone using a spline tbh

dark edge
#

For ziplining or general "follow a path" you'll probably want a custom movement mode

pallid mesa
#

root motion sources is a good example

hard hinge
#

Root Motion source is probably better i think

hard hinge
#

i think the movement mode is a lot of extra work just for this

dark edge
#

It all depends on your game mechanics really

pallid mesa
#

well... it can be handy if you make it somewhat generic from A to B

dark edge
#

If you have momentum on the zipline, whatever

pallid mesa
#

and if your game is about ziplines y really want it

#

hahaha

hard hinge
#

its just a feature

#

of many

pallid mesa
#

but yeah root motion forces works very well

#

lyra uses it for the dash

#

ive used it for a zipline

dark edge
#

I wanna know why TF they call it a force

#

when mass never comes into it AFAIK

pallid mesa
#

🤷‍♂️

#

Root Motion movement would be nice

#

but motion movement seems redundant 🤣

twin juniper
#

What is max amount of data that will be replicated in a variable? 64kb? Or is that just max size of an rpc/repnotify/variable change?

halcyon totem
#

if a map is set to DEFAULT MAP in the server in project settings, can the map be changed at runtime through a bat file?

grim valve
#

Local multiplayer. I want to know how many players are spawnable (createplayer) based on how many gamepads are plugged in. How do you get the number of game pads. I can detect when controllers are plugged in or removed initialization of the gameinstance using core delegates, but this does nothing to give me the initial state. What methods are available for me to achieve this?

plucky prawn
#

If I have a struct property marked as replicated, if any property inside the struct changes, does the entire struct get resent?

plucky prawn
pallid mesa
#

nope

solar stirrup
#

So, what are good ways to speed up actor replication

#

Since I can't really reduce the amount of actors, it's just 80 players

#

I'm assuming less frequent replication obviously. Does reducing the amount of replicating components provide any real boost?

winged badger
#

push model might help, a little

solar stirrup
#

It did boost property comparisons a little

pallid mesa
#

and for those things with range you can try to normalise it to 0-255 range

#

to save some bits

#

it will compromise a bit quality but it is okay

solar stirrup
#

It's really a CPU time issue

#

Will reducing the bandwidth help much? It's pretty much fine rn

pallid mesa
#

cpu performance and nit bandwitdth?

#

ah okay

#

then use the rep graph if you aren't yet probably 2D spazialization or aggresiver culling methods will help

solar stirrup
#

Yeah it's server fps that's a little underperforming

#

Well we're already using the rep graph, sec I'll send profiling stuff

pallid mesa
#

animations process in the server?

#

if so you'd really want to avoid it

solar stirrup
#

So, this is a worst case scenario at 80 players

#

80 of these soldiers

pallid mesa
#

ye properties going brrrrr

#

see net broadcast tick time

winged badger
#

Well he has over 6000 replications to go through

solar stirrup
#

6000?

winged badger
#

80 players for 80 connections

solar stirrup
#

oh yeah right

#

So I guess reduce the amount of actors replicated to each connection

#

Guess I'll start working on more aggressive culling of the enemy team when possible, oof

upbeat basin
#

Is the usage of push model only for variables that I don't want to replicate each time they change? Or can I set every replicated variable as push model based, mark them dirt manually and expect performance gain?

chrome bay
#

You can expect little to no real performance gain tbh. All it does is "don't compare this property until I mark it dirty"

#

But the actor will still be checked for "dirty" states anyway, so it's really only going to be useful if you have properties that are large and/or costly to compare

nova wasp
#

can you remove an actor from the ones that get checked for dirty state?

chrome bay
#

Best way to get performance back is to nuke the net frequency of actors, and call ForceNetUpdate() when properties are actually changed

nova wasp
#

Actor.VeryCleanDoNotCheck

chrome bay
#

Don't think so, it just runs the usual netcode that checks the actor at it's given frequency

nova wasp
#

I'm guessing ForceNetUpdate() helps it skip the check?

chrome bay
#

ForceNetUpdate() just resets it's "last comparison time"

nova wasp
#

ah, hence nuking the update freq

chrome bay
#

Effectively forcing it to be checked the next network frame

#

Yeah

#

At least then you aren't wasting cycles comparing properties at 100 ticks a second. The default setting of 100Hz is stupid

#

It's just a shame you can't set the frequency to zero, then update it when you actually change something

#

Sadly if you do that, the actor just fails to replicate ever

magic helm
#

That's also what dormancy is for, you have a dormant actor then that's basically the same as 0hz net frequency

#

I do wish the networking compendium covered dormancy because its SUPER powerful for lowering CPU usage

#

You can even mix it with having an actor be always relevant which is pretty nice... But take that with a grain of salt because of "Million ways to shoot yourself in the foot" sort of thing

nova wasp
#

so you can have a dormant actor that just gets updated on every ForceNetUpdate()?

#

while still being relevant etc

solar stirrup
#

Don't think ForceNetUpdate() affects dormancy

#

Last I checked it only resets the next check time to next frame, which probably wouldn't do much on a dormant actor?

pallid mesa
nova wasp
#

step 1 make every actor in the game dormant

#

step 2 round robin tick every replicated actor and call ForceNetUpdate()

#

sterp 3 maor frames achieved

nova wasp
#

the price to pay for 20 tps servers

solar stirrup
#

hey we have 35 tps servers at 80 players, they just shit the bed at 100

#

well, 20 is playable, just not optimal 😢

nova wasp
#

how do the clients themselves run the cmcs?

#

surely the animation ticks are killer

solar stirrup
#

nop

#

haven't checked that part out yet

#

it's part of Squad's code afaik

#

but they run well

pallid mesa
#

also if you tell me ur server runs animations

#

ima 💥

nova wasp
#

no fucking way they do lol

solar stirrup
#

dont think it does

#

the server tick is stupid fast

pallid mesa
#

okay, good

solar stirrup
#

replication is the hot path

nova wasp
#

they would reach the lands of .5 tps gameplay

#

where only god knows where the fuck your cmc is

solar stirrup
#

cmc is at like

#

2ms per frame

#

for all players

nova wasp
#

yeah, we all bitch about the cmc but I guess the true cost is all the extra scenecomponents that follow it

#

I assume

solar stirrup
#

ain't cheap but it wont kill ya

#

is there a good place where i can get info about the rep graph's fast shared replication path?

alpine owl
#

Hello, how the physics works with multiplayer games? Since replication is a one way only server - > client how can I manipulate physics objects with a client? For example how can I use a physic handle on the client so he can move objects around?

plucky prawn
#

Can someone please explain to me, or point me to some resources about how to have something like a storage chest only network it's contents to the player/s accessing that storage? Like in Satisfactory if I open a storage container or even a Constructor, I can see what's inside/what recipe it's making and I get updates in real time about the storage contents and the incoming/outgoing resources from the constructor. I've been trying to think about the best way to design it but I can't wrap my head around it. The only way I can think to have this work is either replicate all the data the ui would need (which sucks because it would be replicated even for players who don't need it, or to use a proxy actor which is relevant to only the players who are need it (which also sucks because it means when I update some data on my storage, I need to also update it on the proxy actor). I really wanted to just use a struct per actor type (eg one for a storage box and one for a control panel) but I don't know how to make this work nicely with replication and wildcards.

formal solar
#

I am using CMC in a flying game, using 'add controller pitch/yaw input' for rotation and 'add input vector' for movement, the movement replicates fine but the rotation is only updated to other clients after movement (so rotation on the spot is invisible to other clients), why might this be?

chrome bay
#

Since any changelist/ack history is lost when the channel is closed - so waking something from dormancy has the same bandwidth cost as spawning a new actor

#

It's useful but only if the actor is changing really infrequently

magic helm
#

Ah I didn't realize that, but yeah totally agree with you about not changing frequently...

magic helm
# solar stirrup Don't think ForceNetUpdate() affects dormancy

This week we'll be joined by Ryan Gerleve and Dave Ratti to discuss general server optimization in UE4, as well as techniques and solutions to improve your Actors' performance in a networked environment.

NEWS

Unlocking Breach’s combat with Unreal Engine
https://www.unrealengine.com/en-US/tech-blog/unlocking-breach-s-combat-with-unreal-engine
...

▶ Play video
chrome bay
#

But yeah, dormancy is pretty much useless for stuff that changes often like characters, weapons etc.

#

Really better for stuff like chests and such, or trees in fortnite etc.

magic helm
#

Yeah I should have said something earlier about when to use it. Middle of the night for me haha

#

Going to sleep to avoid making things worst. Good night :)

solar stirrup
#

I'll take a look but I think I've watched it before

#

But yeah last time i tried reducing the frequency of player characters just a little bit, results were meh

#

I wonder if it's possible to reduce the replication frequency of actors per connection

#

i.e. replicate players in front of you more frequently than those behind ya

chrome bay
#

rep graph does prioritise based on distance IIRC but not LOS

#

Since LOS can change too quickly for rep to respond I guess

#

I know Valorant did line-of-sight stuff but it caused them a lot of problems, and they have super tight maps etc.

solar stirrup
#

Yeah distance I've done but I feel like it's a bit too finnicky

#

Or maybe I need to tweak more

#

Yeah, I'm thinking more of a simple dot product

#

Anything outside your fov replicates less often

#

Not culled, just has its priority lessened

chrome bay
#

yeah maybe. if it's any help, we've always just run at 20 ticks on servers, but we started out with that so was easier to workaround

#

Vehicles are what really nuked it

solar stirrup
#

Bleh we still need to optimize ours

#

Physics are annoying

#

Honestly if we can stay at a stable 20-25 at 100 players it'd be good enough

chrome bay
#

yeah

solar stirrup
#

I've just got a hand tied behind my back since I'm optimizing everything waaaay too late

#

And the game started off as a Squad mod mmLul

pallid mesa
#

someone here knows about this? It's closely related to multiplayer https://forums.unrealengine.com/t/noise-when-profiling-multiple-instances-unreal-insights/553123

#

Because makes MP profiling a bit tougher

granite jolt
#

Does anyone know how to set the UNetConnection Timeout value? Nothing in the class stands out, just a getter.

chrome bay
#

Doesn't seem to be a fixed value

#

ConnectionTimeout would be a config property for whatever net driver you are using

#

E.g:

ConnectionTimeout=xyz```
granite jolt
#

thanks I was using [/Script/OnlineSubsystemUtils.IpNetDriver] bNoTimeouts=True but it didnt work

halcyon totem
#

is it possible to load a map to a dedicated server through a bat file?

marble gazelle
granite jolt
#

Path\To\Project\projectname.exe /Game/ProjectName/levels/mapname -port=7778 -log

#

change the port to whatever you use obv

fathom aspen
# solar stirrup is there a good place where i can get info about the rep graph's fast shared rep...
solar stirrup
#

Ty

#

Looks like it does what I think it did, neat

#

Sounds like hell to implement tho oof

ancient adder
#

Can i replicated an object? and how?

#

on blueprint

#

Im trying to construct an object on server and rpc it to client

bitter oriole
ancient adder
#

Im constructing the object in thirdPersonCharacter and the replicate box is ticked

bitter oriole
#

Does that happen on the server, what's the parent class

ancient adder
#

Yes, i construct the object on server and verify it is constructed, Parent class of what?

#

Parent of Object is Object, i made it in blueprint

#

I have a default variable for the object in thirdperson blueprint, when i construct it on server in thirdperson i set the variable with constructed object then pass it to client via rpc

bitter oriole
ancient adder
#

My object has a struct inside of it, im doing that because i think passing and working with objects is easier than struct

bitter oriole
#

You can't "pass" objects - they can be spawned, re-created on every clients, and then RPC pass an additional reference to it

#

If this is short term data that only matters in the context of that RPC, should be a struct

#

Dunno if Objects specifically (rather than components) can even replicate in Blueprint

solar stirrup
#

They'd need to be added as replicated subobjects of an actor

#

Don't think that's exposed to blueprints in UE4, or even UE5 with its changes

bitter oriole
#

Yup

ancient adder
#

Oh, i think i'll just stick to using both then, When it comes to rpc i'll just take whats inside the object and send it

atomic barn
#

Hi when i use the find session node, it returns an empty array (the session has already been created). However, when i use the console command open 127.0.0.1 , the command works. Does anyone know how can I fix this?

silent valley
atomic barn
#

i am using the node to search over lan

silent valley
#

are you testing with two machines? or two clients on same machine?

atomic barn
bitter oriole
#

Make sure to not test with the editor.

#

If using Steam, need two accounts / two PCs

#

Don't use IPs with subsystems

atomic barn
silent valley
#

Yeah important to test not in Editor

#

If it's still not working you might need to take a look through the logs

atomic barn
chrome bay
#

Just use an Actor Component if it has to be an object

#

But in BP, may as well be an actor

silent valley
chrome bay
ancient adder
chrome bay
#

No then, but you can't replicate sub-objects of actor components all that easily anyway

#

Well you can, but it has issues and caveats

#

Even in C++

silent valley
chrome bay
#

BP is not good for any kind of advanced networking ultimately

ancient adder
ancient adder
silent valley
past seal
#

does anyone know why if i unpossess a playercharacter as a client while it is in air, then on listen server it stays in the air but on all other clients it falls to the ground? guessing it has something to do with the listen server being the new owner of the pawn?

ancient adder
#

Is it better to send an array or the elements with foreachloop over rpc?

marble gazelle
#

array as you only need to send one RPC instead of N

chrome bay
#

Yeah, definitely the array

halcyon totem
#

@granite jolt hey I am trying but its not working, do I need some code in the blueprints for it to work? I had this set up in my blueprints but it not working

restive musk
#

your blueprint is getting unmanageable you should organize!

#

@halcyon totem

halcyon totem
#

this is what my bat file looks like

#

in my game instance I called event init, then command line parse command line,, execute command line and then suppose to host the game

formal solar
#

How do I handle rotation replication in character movement component?

#

I solved the issue using a get set multicast every .05 secs

#

But wonder if there is a more efficient way

chrome bay
#

Rotation is already replicated

formal solar
#

For local its just smooth rotation

chrome bay
#

It's sent as part of the movement tick

#

All you need to do is make it follow control rotation

formal solar
#

I am

chrome bay
#

The default setup, so long as you are possessing it properly should work fine

#

You don't need to do anything else

lost fulcrum
#

how is FText serialized for replication? Is it replicated by identifier or literal content?

#

And will it work correctly if server and client has different locales?

formal solar
#

I am using add input vector for location and add controller pitch/yaw to rotate. Works perfect on client (hosted multiplayer) but not replicated, rotation only updates when I am moving not when stationary.

#

But with get/set actor location every .05 secs, I can get replication, but have to sacrifice a few fps

manic agate
#

Quick question: is there a way to retrieve the PUBLIC ip address of a client using some Unreal function/class?

chrome bay
#

No localisation info is sent, you receive the sender locales' translated string only

#

That's what I've experienced at least, but worth testing it to be certain

#

We had servers running in GER and Clients in UK, clients would receive FText literals in GER

lost fulcrum
lost fulcrum
#

So if I'd be making a global message system, I'd have to intentionally send localization keys instead and lookup localized FText manually on the other end.

chrome bay
#

yeah I believe so

livid sluice
#

Hi Guys I have a Relevancy issue.
My map is quite large and it takes a while to load. When I connect to the dedicated server you can see each of the player briefly then they disappear.. The two players cannot see each other but the collision is still there. When I tick always relevant in the player base, It works.
Question is. Is there a way to refresh all the relevant actors near you? (I already tried teleporting the player back and forth hoping to re-trigger the relevancy)

lost inlet
#

FTexts are serialised as FTextHistory, which can do things like formatted strings that show up on the user's local machine in their locally set language

#

if you convert to FString on the server, then it'll obviously be in the server's locale

lost fulcrum
lost inlet
#

I've used this with string table entries

#

and it just works

willow prism
#

Hello, I have a problem with my multiplayer game in oculus quest , to make some player movements I use the rotation and location of the controls, when I play it only works without problems, but when playing client server, the client does not take the rotation or location of the controls. Any idea what I can do to fix this?

twin juniper
#

hello i have a qustion about delegate in ue4, i am working on an inventory system were the inventory component calls the refresh function of the inventory widget. this works perfectly fine for single player or playing as listen server but this does not work for clients. since the event is called from the server but the ui is client sided.anyone know what i could use instead?

thin stratus
#

The delegates aren't really a singleplayer or multiplayer concept

#

So you can keep using them

#

What you need is a way to move the call to everyone else

#

For which you can use a multicast rpc

#

And in there you could call your function

#

It is however important to know that rpcs could be dropped and aren't called again for users that hotjoin

#

So you have to work around that if it's an issue or utilize rep notify

willow prism
# twin juniper hello i have a qustion about delegate in ue4, i am working on an inventory syste...

something very similar happened to me, but in my case my game is vr, so the interface was an actor that contained a widget, to solve it what I did was that the actor that contained my widget was not replicated and was only called locally by client, now at some point I wanted to replicate some things from that widget for all clients and server, what I did was create an actor that is replicated and relevant to all players with variables that are replicated and each player sees, every time change this variable, my hud reads this variable and gives the feeling that it is a single hud for all.

thin stratus
#

Depending on your systems a lot of this can be driven through the PlayerController, PlayerCharacter , PlayerState or GameState

#

Not necessarily needing an additional actor

twin juniper
#

the plan is that it is only called on the owning client and not the rest to prevent unwanted behavior

thin stratus
#

Then a client rpc would be enough

#

Given whatever that is called on is owned by that client

twin juniper
#

right know the delegate is called from a component by the server

thin stratus
#

E.g. my inventories are replicated components on the player

twin juniper
#

but never makes it to the client

thin stratus
#

Delegates don't have a concept of multiplayer

#

They just broadcast where they are called

#

Put the broadcast into a client rpc and it calls on the owning client

#

(If the component sits on a client owned actor and is replicated)

twin juniper
#

thanks for the help i will try your suggestion

winged badger
twin juniper
#

at the moment i barely use c++ with unreal because i find it a bit confusing but i will remember the option

#

@thin stratus thanks for the help such simple solution and i never even thought of it

glad escarp
#

Is there a good way to store a reference of an actor that I'm spawning from a server replicated event? When I try to save the return value of "SpawnActor BP" in the Server RPC, it stays empty and I can't reference it and I don't know how to store it locally since the spawning happens in the server rpc.

sinful tree
# glad escarp Is there a good way to store a reference of an actor that I'm spawning from a se...

If you're spawning an actor on the server, and the actor is not set to replicate, then clients will not be able to access the reference to the actor as it doesn't exist on their ends.
If you're spawning an actor on a client, and again, the actor is not set to replicate, the reverse is the same - the server and other clients would not be able to access the reference to the actor, because it does not exist on their ends.

If you're spawning an actor set to replicate and are spawning it on a client, then you'll still run into the same problem. Replication only happens from Server -> Clients, including actors.

If you're spawning an actor set to replicate and are spawning it on the server, you still may not necessarily be able to access the reference to the actor if it does not exist on a client, either because it hasn't spawned on the client or it is not relevant on the client (eg. the client is too far away from the actor, so relevancy can be lost and it gets despawned on the client).

#

If you're doing something like:
(While Running On Server) Spawn Actor > Run On Client (or a Multicast even) RPC (Passing Reference to Spawned Actor)

Then the Run on Client RPC may be executing before the actor has spawned on the clients.

glad escarp
plucky prawn
tribal trout
#

is generictoolserver.exe a UE component?

tawny nova
#

client side interacts with the "chest" or whatever as an actor and that actor gets replicated

plucky prawn
#

so i end up with a proxy actor for every single "interactable" actor in my game?

dark edge
#

So it's not ThisChest.Contents, it's GetContents(ThisChest)

#

All inventories live inside a subsystem for reasons

plucky prawn
dark edge
plucky prawn
dark edge
#

It all really just depends on how you're doing your inventory data structuring. You could do the push model and push the inventories when they're within range of a player pawn

#

If you're doing things object oriented like that.

#

We just do a rpc + callback for inventories as they're rarely updated and rarely needed. It'd be different for something shuffling around thousands of items.

plucky prawn
#

interesting, i had not considered making the client RPC for the data. i was trying to send it to the client with the request to open the UI

dark edge
#

You can do that, depends on how snappy it has to be

plucky prawn
#

i think for right now i might just replicate all the data i need and i can fix it "later"

dark edge
#

Yeah it all depends on what you're going for. Might be clogging your pipe with millions of widgets moving around.

plucky prawn
#

🤷 sounds like a problem for future me or the poor person who i hire to do it for me

left flicker
#

Can someone explain something to me. If I am going to package a game and a server, and I want the server to have data that someone playing the game can get from the server, without having that data like in the game, how would I do that?
If that makes sense

winged badger
#

that making sense depends on how large is the data

left flicker
#

It wouldn't be large data. Just like a very short data table or something

#

or a texture maybe

winged badger
#

its easy enough to configure packaging not to package that DT for clients

#

textures are much worse

left flicker
#

Okay haha, I'll stick with the data table

winged badger
#

but this has significant drawbacks - so why?

left flicker
#

So would I just package for the clients and then add the data tables to the project and then package as the server?

winged badger
#

you'd make a mistake soon enough with that approach

#

you'd use something like jenkins to configure build machine with build scripts

#

then when you tell it to package the server it updates, it adjusts the config files for server, then packages

left flicker
#

Interesting okay. I'll look into that. I'm not familiar with it.

winged badger
#

having to wait for that (static) data on clients is pretty inconvenient

#

why would you do this?

left flicker
#

The project I'm working on is a Bingo game (if you are familiar with Bingo). And all of the bingo cards that players use need to be stored on like a database.

#

So I'm trying to figure out how to go about getting pre-made cards to the players

winged badger
#

unreal can replicate a path to the texture asset btw, it will be turned to a NetGUID after the first time the pointer is replicated

#

so clients should really have those

left flicker
#

Oh, and one more thing, none of the players will be interacting with one another

winged badger
#

unreal also doesn't know how to repllicate a texture asset in its entirety

#

so you'd have to convert it to POD and then reassamble the texture on the other side

left flicker
#

Yeah, I don't think I'll use texture assets

brave sundial
#

Hi, I have a question I am making a Multiplayer game. In the Game I have 2 Ki. One Ki for the first Player and second Ki for the second Player. In the Ki I cast to my Thirdpersoncharacter and set it as a variable. How can I make that the first ki follows the first Player and the second Ki follows the second Player that joined the lobbys? (sorry for my bad english)

#

So that the Variable in the Ki shows the first and second Player

winged badger
#

widgetcomponent with a widget displaying it on each character,

#

you inject a character reference to the widget

#

BeginPlay->GetWidgetComponhent->GetUserWidgetObject->CastToWidgetType->SetCharacterReference being the simplest one

#

after you do that your widgets moving with your characters in the world have a reference to that Character

#

if you want players to see only their own KI, then you gate that behind IsLocallyControlled

brave sundial
#

So I have to do a widget on my character?

#

Is there like another way that I can get player 1 and 2 in the world? And that set this as the character variable in the ki? @winged badger