#multiplayer

1 messages Β· Page 5 of 1

royal forge
#

log inside the function

fathom aspen
#

There are multiple ways to tell. If it's a server RPC, you can see that the value is not being changed on other machines(not changed on server and thus not replicated to them). You can also check the NetMode

acoustic drum
#

Just seems so weird...

royal forge
#

i'd understand the client not being able to send to the server, but what's really baffling is that the server can't send to the client, either

sinful tree
#

If the client doesn't own the actor, you can't do a client RPC. All you can do from non-owned actors is replicate values and I believe multicast.

royal forge
#

yeah, that's why i said i'd understand that

#

if that was all, i'd be able to fix it

#

but i'm really confused cuz the rpc invoked from server ain't working either

sinful tree
#

You said what is really baffing is that the server can't send to the client.... The reason the server can't is that the actor has no owning client.

royal forge
#

okay, i probably misunderstood rpcs then

#

in that case, it's the opposite of what i was thinking

#

i've never done networking in games before

acoustic drum
# royal forge okay, i probably misunderstood rpcs then

If you want a nice video: https://youtu.be/JOJP0CvpB8w

An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.

Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe

00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...

β–Ά Play video
royal forge
#

thanks

twin juniper
#

still cant find anything on this but trying to set the array size in the constructor. Setting array size in construct doesnt work, and in post init properties it still sends everything for each index. Where can I set it manually on client before properties are sent to client?

acoustic drum
#

Do you mean if you have an array [0, 0, 0, 0, 0, 0, 0, 0] it should just send 8 * [0]?

acoustic drum
#

That's a very basic method of compression, maybe you can turn on some method of compression for certain replicated data but it might have significant performance impacts

#

Or do you know for a fact that all elements will be the same value?

twin juniper
#

But how would you even for a specific array? I was trying to solve it by trying the client to set it up before the server but I guess server will send the properties first unless it is set anyway.

twin juniper
acoustic drum
#

Can I ask why this array has all the same values and how frequently it has to send this array? At the surface this problem seems like it isnt worth your time trying to solve

#

Since, as far as I know, the server by default will only replicate data when it sees it has changed value

twin juniper
#

Just once, it is because im using indexes as points to reference with dynamically sized array. Just want an initial starting point for the client from which object is created, in which server doesnt need to send everything and only the differences.

acoustic drum
#

Hmmmm one solution is to turn off replication entirely and use RPCs

#

There may be quite a lot of issues with this approach but the main one I can see immediately is having inconsistent data

twin juniper
#

If there is a way to send an rpc before the server sends the properties to client but I dont think there is?

acoustic drum
twin juniper
twin juniper
# acoustic drum TArrays are dynamic :D

I mean how they are populated. Server thinking array starting as empty for client = whole array being sent regardless? If I could use fast T array replicated to send just what is not null and have client fill the unused indexes, and somehow guarantee ordering. isnt a struct also required?

acoustic drum
#

And yes a fast TArray requires the elements to be UStructs

twin juniper
acoustic drum
#

Ah I can see why you dont want to be sending that every single time

#

@twin juniper I'm sorry but I really need to go to sleep XD. I wish you good luck

twin juniper
red sand
#

Can anyone provide me leads on how to setup steam sockets

plush wave
#

Is there a special array that replicates more quickly than others? I don't care for array order

#

I know there is one for Structs, didn't know if there was one for objects

dark inlet
#

Hey guys, I'm a little confused on how a dedicated server works. I have the following questions: Do I have to make a separate build for the server every time I change something inside my game? Does every member of my team have to have the engine built from source?

pallid mesa
#
  1. Yes
  2. Not necessarily, just the one who builds the server instance
lime echo
#

If I spawn a replicated actor and then dynamically add replicated components to it Using AActor::AddComponentByClass, all on the server, are the components guaranteed be replicated with the actor's packet, or can there be race conditions?

open pendant
#

Greetings!
Not exactly a multiplayer problem but has to do with servers and network.
I'm working on a code plugin for the marketplace that will have it's own GUI, and I'm wondering, what would be the easiest way to keep a single string variable somewhere on the internet storing the latest version number of the plugin.
That way every time you launch the GUI, it checks on the background if there's a new version, and it just displays a pop-up, with maybe a button linking straight to the marketplace page.
Would that be easily doable?

chrome bay
chrome bay
#

If you use it in the wrong place it can make things worse

#

For objects you'd just use TArray

acoustic drum
chrome bay
#

Only the changed element

#

But if you remove an element, all elements after the removal have to be resent

#

But either way, TArray has it's own delta replication that works as you'd expect. FFastArraySerializer is really when you have large data sets, don't care about order, and want to optimize for removing elements from anywhere in the array

#

Note that you can also replicate static arrays, they will just be "unfolded" like a regular property with fixed offsets. E.g. float SomeFloats[10];

#

Also FFastArraySerializer has to be a member property, it can't be embedded in some struct or array itself

chrome bay
#

TArray items are identified by their index. If you remove an element then by definition all the items after that element have "changed"

#

Unless for some reason, all those following elements are identical

#

The delta replication works by comparing the full state of the array

#

And can also do deltas on the properties within

acoustic drum
#

Yeah right but if the server removes one element from their TArray and then tells the client to remove the same index from their TArray the result is the same

#

Just seems weird

chrome bay
#

It doesn't work that way, and it can't work that way

#

The Server doesn't know what state each clients' array is in, and packets may not be received in the order they are sent

#

Giving the client explicit instructions only works if you can guarantee deterministic ordered behaviour, which you can't with replication

acoustic drum
#

Yeah that's fair enough

#

I suppose if you remove an element then change one of the elements after that removal the client might end up changing the wrong element then removing

chrome bay
#

yeah

#

If you had an array with 10 elements that all pointed to the same thing, then you remove an element from the start, the array would just be like "I am 9 elements now", but since all the elements themselves haven't changed, you'd only receive the arrays size which would be fast

#

But basically the way it works is imagine you have a copy of that array, you do all the operations, then the replication system looks at both at the end of the frame, finds the differences, and sends those.

#

Whereas FFastArray identifies each item by a unique index, and marking it dirty garauntees it'll be sent

#

and there's a much more minimal book-keeping system for it as a result since the server doesn't need to store a full shadow copy of the array too

#

You can also re-order the elements client-side too if you like without any issues

acoustic drum
#

Surely there has to be a way of ordering array tasks

#

I guess it just takes up more bandwidth to do so

chrome bay
#

Would just be really hard to guarantee determinism.

#

And probably a bunch of edge-cases where it doesn't work that well

acoustic drum
#

I just thought you could provide specs with the packet explain what number operation it is but thats more bandwidth taken up and will most of the time end up using up a lot more total bandwidth than rarely removing an element will

chrome bay
#

yeah also during packet loss, you'd have to build up a buffer client-side of all changes until you receive the last one. Replication is meant to be lossy/order independent by design for perf

chrome bay
#

fastarray is a pretty good stop-gap though tbh

#

If order was important, you could even embed an "index" property in the items themselves

woeful pebble
#

im very sure that if we didn't use a subsystem people wouldn't be able to connect in different countries or cities at that

wispy ingot
#

Am I missing something from the video? What exactly is the issue atm?

thin stratus
#

Check if this is actually CMC related by showing the netcorrections

#

Then it might be your Anim setup?

#

Because server and client might use different variables

#

What are you actually doing there

#

Strafing?

#

What is your code for that

wispy ingot
#

what variables are you replicating?

thin stratus
#

I meant the anim bp

#

The code that calculates the direction etc

wispy ingot
#

AddControllerYawInput does not work as intended?

#

I am guessing you are using some aim offset logic -- I don't have much experience with that sorry. Is the yaw variable RepNotify?

#

That might be the issue. If you're setting yaw on both client and server, client will keep catching up on the server state

#

try making the yaw RepNotify, set it on server only and only in the OnRep method set it on client or do what you have to do

#

Actually you don't need to set it again in OnRep since it is set already (for the client as well)

#

No, set your yaw variable on ~~client ~~SERVER and it will automatically call the OnRep function on the client with the updated value

#

and from there you can carry on with your logic

#

anim logic etc

#

oops sorry! I wrote set your variable on client -- you should set it on server!

wispy ingot
#

Honestly I am not sure. I read that statement in a lot of places but it does on my current project

#

It worked?

#

lol

pure brook
#

hello, could someone tell me how can i initiate particle effect for all players except the server one? right now clients can see the effect on server pawn too 😦

wispy ingot
#

Are you using a multicast RPC ?

pure brook
#

im using a simple listen server, not very familliar with multiplayer stuff

wispy ingot
#

can you post your code?

#

try creating a multicast rpc event where you spawn the particles and call that event on the server

pure brook
#

Thanks i'll look in to this.
I think the problem is the clienet version of the server pawn, i don't know how can i avoid it

wispy ingot
#

I haven't worked with Listen Servers a lot but multicasting will probably work as intended

wispy ingot
#

Hmm, not sure. Looking at the last video again.. the strafing seems quite jittery as well

#

Could it be a collision issue? Do you have any colliding actor components attached?

shell forum
#

You need to use custom flags in the CMC to fix it. I had this issue myself.

#

In C++. I believe it’s Flag_CUSTOM_0.

#

Setup your net code to use that

shell forum
magic furnace
#

I've been wondering, since I have a setup for changing movement speed networked, how would I make it nice and smooth on the transition to a lower speed

#

since when your character is moving at 300 and the max speed gets set to 600 it's nice and smooth

#

but once you wanna go from 600 -> 300 it's not smooth anymore, since it makes you drop 300 speed instantly

#

I could make some wonky calculations using deceleration speed and disable movement input for a certain amount of time based on said value

acoustic drum
magic furnace
#

so you're thinking to have an interpolation every time it asks for the movement speed smoothly down

#

but I feel like that would be flawed too

#

making it a bunch of microlags instead of a singular lag

acoustic drum
#

Well if that's your concern theres no fix

#

Necessarily you will have microlags by the very nature of ticking

magic furnace
#

unreal does it well out of the box when coming to a stop, so there has to be a way

acoustic drum
#

It is simply interpolation

#

There is quite literally no other way for a computer to do it

#

Of course for the smoothest experience what you would really want is to begin your change in max speed interpolation on your server and then not replicate every single tick but you can use client side prediction

magic furnace
#

I mean I understand what you mean, but I gotta test it first before I continue this discussion

acoustic drum
#

So maybe if the time it takes for your server to slow down is 1 second then you might send max speed updates every 100 ms but the client can be doing its own interpolation and just using those "checkpoints" to stay in sync

#

I have a feeling UE probably has a nice function that will do all of this for you though

magic furnace
#

that's exactly what I am looking for

humble bane
#

Does the built in steam plugin work for current ue5?

magic furnace
split siren
#

I am getting the strangest bug (or my brain is has overheated in this weather)
In my DefaultEngine.ini I set MaxInternetClientRate=10000 which should be the default and my client experiences many more movement corrections than when having this line commented out.
Again 10000 should be the default, so nothing should change in theory. Any idea is happening?

uneven chasm
#

making sure I have this right. If i have an event (run on server) any downstream events called from that event will be ran on the server unless I do any of the other replication methods

latent heart
#

Correct

uneven chasm
#

Is it common best practice to ensure all those downstream events are run on server too or is it fine leaving them knowing the context above

magic furnace
fathom aspen
uneven chasm
#

ah ok

static flare
#

If I want the server (dedicated or listen) to spawn an instance of an actor at startup (runtime), as a sort of singleton/"one of a kind" actor instance that I need replicated and a "direct pointer" to from all clients, where should I store it?
Should/can I spawn it in MyGameState::HandleBeginPlay and retain a pointer to it there (in GameState), which will be valid for all clients?

fathom aspen
#

Yeah that seems to be the place, though you can't guarantee it has replicated by the time OnRep_ReplicatedHasBegunPlay() fires. That's why you should have an OnRep for your replicated actor and in that OnRep do what's done inside OnRep_ReplicatedHasBegunPlay().

#

I would probably make a world subsystem instead and tie it with a replicated actor that acts as an info placeholder

static flare
# fathom aspen Yeah that seems to be the place, though you can't guarantee it has replicated by...

Thanks! Can you expand on this?
I'm pretty new to replication in general, so I have a bunch of noob questions. Firstly, I'm not sure what you mean by OnRep_ReplicatedHasBegunPlay (can't find any references to it, so I assume that's something you add yourself for convenience?).

Let's say I want to spawn a building this way. It will exist from game start to game end (though it may be altered). The server spawns it in AMyGameState::HandleBeginPlay, and retains the pointer as such:

UPROPERTY(ReplicatedUsing=OnRep_MyBuilding)
ABuilding* MyBuilding;

(in addition it has GetLifetimeReplicatedProps with DOREPLIFETIME(AMyGameState, MyBuilding))
The server may also spawn additional actors and attach them to MyBuilding (their RootComponent added to MyBuilding's RootComponent).

When a client joins the server, will the building (almost immediately) be spawned for them and the pointer in their GameState point to it? And noob question; will any additionally added components exist (and the components' pre-attachment original owning Actor instances)?
What caveats do I need to know about regarding "replication guarantees"?

#

I'm not too familiar with subsystems either (been reading a bit about them just now), though I understand the basic use of delegates. Do you mean I should have a world subsystem so I call a delegate function like MySubsystem->DidReceiveMyBuilding(..) from the OnRep_MyBuilding, which I can "override"/implement/bind other places to perform actions?
(Is the point of this that it is equal to executing additional code in the OnRep-function, but instead of having a bunch of ugly references to all the relevant classes that need to know about its replication, they can instead "register" for this "notification" through the subsystem?)

fathom aspen
#

AGameStateBase::OnRep_ReplicatedHasBegunPlay() is part of the GameState. It's called when GameState replicates bReplicatedHasBegunPlay, i.e, the GameState replicated. At that time, BeginPlay is called on all actors client-side. That means that GameState is guaranteed to have replicated by the time any actor calls BeginPlay client side. If you spawn the replicated actor inside AGameStateBase::HandleBeginPlay() you can't guarantee it has replicated by the time bReplicatedHasBegunPlay replicates, that's why you should consider having an OnRep function that fires when the spawned actor has replicated. Any components you attach to that actor at runtime as long as they are spawned in the same frame the actor has spawned, they are guaranteed to replicate in the same initial packet the actor arrives in.

fathom aspen
static flare
#

πŸ€¦β€β™‚οΈ searching for the entire name with OnRep_ does give results, but only searching for ReplicatedHasBegunPlay yielded nothing.

static flare
# fathom aspen `AGameStateBase::OnRep_ReplicatedHasBegunPlay()` is part of the GameState. It's ...

Based on what you're saying here, if I only have the capability to join a game that is already "in progress" (no lobbies or synchronized start), wouldn't my actor already exist in the server's GameState before any client joins, and thus the actor would be replicated as part of the initial replication of GameState, I.E. guaranteeing that the actor has replicated "by the time" bReplicatedHasBegubPlay replicates? Or am I thinking about the replication cycle wrong, would the actor be replicated through the "UWorld" or something and the pointer in the GameState is just a pointer that points to nothing yet at the initial replication?

fathom aspen
#

Look in the source code

static flare
#

Yeah, I found it when you pointed it out:) The facepalm is for me.

fathom aspen
#

You can have the GameState dispatch the BeginPlay on all actors inside PostNetInit if you want

fathom aspen
#

BPFL are a group of static functions. They don't store any kind of data, at least I've never tried doing that. Doesn't seem quite right to call them singletons.

#

Maybe #cpp has a better idea

quasi tide
#

No. They're just static functions. Shouldn't have state. Subsystems are UE's singleton, like what Wizard mentioned.

#

Blueprints are code and writing them is coding.

humble bane
#

Does the built in steam plugin work for current ue5?

quartz smelt
#

How come movement in the editor is fine for the clients, but when its packaged client is laggy af

acoustic drum
#

Maybe for whatever reason your net replicate frequency has changed

quartz smelt
acoustic drum
graceful mango
#

How do i pause all actor replication without destroying it? NetDormancy doesnt work in that case

#

Not just pause, but pause to specific player

fathom aspen
#

It's literally what Dormancy is for. Check why it's not working

#

DormantPartial is what you need

#

And implement GetNetDormancy to filter the connections you want

fathom aspen
graceful mango
#

And also if i want to control it on server, and pawn is Autonomous Proxy, will it work?

fathom aspen
#

Like you would control if an actor is relevant to a specific connection (AActor::IsNetRelevantFor). This function AActor::GetNetDormancy exists on every actor and it returns false by default, i.e no actor is dormant to any connection. This function gets called only if DORM_DormantPartial is set, and only called on server (otherwise all of this doesn't make any sense)

#

It's called for every connection

fathom aspen
graceful mango
#

Got it, thanks!

#

If you played Dota or LoL, i am trying to implement fog of war, so after i calculate visiblity level for cells, i would like to decide what player sees specific actor

fathom aspen
#

I haven't played either. In case of dormancy you still see the actor even if it's dormant to you. That's why you need relevancy in that sense as it destroys the actor for the connection which isn't relevant to it, so he doesn't see it anymore

graceful mango
#

Most important, i dont want rpc or movement update come from server, if actor is in invisible cuz of fog for player

#

visual hiding i can implement in many ways

fathom aspen
#

If a connection is not relevant or actor is dormant to it, any RPCs (multicasts in this sense) fired from that actor won't get to that connection

quartz smelt
fathom aspen
#

I don't know how your overall setup works so I can't tell. But you should be able to trace it and figure what's going on

quartz smelt
#

Damb I was kinda hoping it was just an UE quirk

graceful mango
#

IsNetRelevantFor accepts as arguments two actors, const AActor* RealViewer, const AActor* ViewTarget, who is RealViewer and ViewTarget?

fossil spoke
graceful mango
#

So, RealViewer is PlayerController?

fossil spoke
#

Typically

graceful mango
#

And what if i return false?

#

Replication will be paused without destroying actor?

#

Replication of that actor for that specific player?

fossil spoke
#

If its false the Actor wont be Network Relevant to that Player, therefore it will be removed.

#

Until it becomes relevant again.

#

Search for its usage in the code base.

#

Search for IsActorRelevantToConnection

#

Its used in the NetDriver.

#

It calls IsNetRelevantFor to determine if it needs to do something with that Actor for that connection.

graceful mango
#

Will work for me except removing

fossil spoke
# graceful mango Will work for me except removing

Try this?

    /** Gives the actor a chance to pause replication to a player represented by the passed in actor - only called on server */
    virtual bool IsReplicationPausedForConnection(const FNetViewer& ConnectionOwnerNetViewer);
dusky yarrow
quartz smelt
dusky yarrow
#

nice! still do check these tools tho. they're really handy

quartz smelt
#

you right you right

left flicker
#

πŸ˜‘ Another day and a half defeated trying to get this Amazon GameLift setup started. I don't really understand what I'm doing or what is wrong. But I'm getting this error when I try to run; msbuild ALL_BUILD.vcxproj /p:Configuration=Release

#

I have an idea.

shy copper
worn wagon
#

I had issues with steamsockets though, could have just been doing it wrong

winged badger
#

steam sockets work fine, except they make it more of a pain in the arse to debug game with clients

#

you can't configure timeouts

#

so you have only 17 seconds to continue after hitting a breakpoint or you'll time out 😦

pliant moss
#

Clients cant sub to event dispatcher run on the GameMode right?

#

I have a multiplayer setup where the server spawns waves of AI enemies. Lets say 3 waves in total. The client need to know when a new wave starts / completes to display UI stuff. So either i run that in the GameMode if possible or GameState. What do you guys think?

worn wagon
#

GameState is replicated to all clients, so i'd do it there

#

Gamemode only exists on the server so you do your server side logic there, gamestate is replicated to everyone so you hold gamemode specific things the clients need to know about there, like a round timer for example.

#

Unless it per player then you use playerstate

pliant moss
#

yeah that was my thinking too. But is there any benefit to do the actual spawning of enemies in the game mode. its probably more convenient to have the whole "Wave Manager" in one place

karmic briar
#

hi,i wanna ask im currently trying to make a lobby system similiar to fortnite using epic game services..i want to do when player loads up the game,it will goes through a lobby where similiar to fortnite,you can party up,add people to the party then when all ready you can go into the world

#

my game is similiar to minecraft when first launch where you can have a singleplayer and multiplayer aspect and this is for the multiplayer aspect of it

#

anyone have any ideas how can i achieve this because i have no clue where to start exactly

#

tag me

#

just realized how my question is phrase the answer to it can be generic multiplayer design to a game so sorry for how open it is

last jewel
#

Do you already have a multiplayer/session system?

karmic briar
#

not yet

#

maybe i explained what im trying to do really badly lemme rephrase it

last jewel
#

Then I would look into either Epic's session system or the advanced session plugin to get started https://forums.unrealengine.com/t/advanced-sessions-plugin/30020. There's also a lot of video of how to get started making lobbies and session. It's a good start.

karmic briar
#

can i integrate EOS eventually?

#

my knowledge with EOS right now is practically zero but i have tried to make a session system with steam before and that plugin

last jewel
#

Yes you should be able to. As far as I know you should be able to choose which subsystem to use. Just like in my current project, i'm looking for steam.

#

I'm pretty new myself, but I got steam working for me. Then you should also be able to get EOS to work.

karmic briar
#

ah okay

#

can i explain my game workflow from launching the game to getting the world is

last jewel
#

Yeah sure

karmic briar
#

because i think its easier for me to explain that

#

okay

#

so when player launching the game,the design for it is based of minecraft where you have singleplayer then multiplayer

#

the singleplayer aspect i want it so when player click the button,it will prompt then to create a local save game world object to save all the local data of that world..singleplayer stuff basicly similiar to minecraft singleplayer mode.

#

but the multiplayer part,i want it so players can host dedicated servers like how minecraft have hosting server right and players can join their friends up

#

one aspect of the dedicated server part,i have another technology i want to utilize for that but for the players can join their friend aspect,i want to utilize EOS for that

#

similiar how steam online subsystem is

#

does that make sense?

#

if you have played Valheim,the game workflow is similiar to that for the players can join their friend aspect

left flicker
# left flicker I have an idea.

I got it to work!
Remember to celebrate your victories as you go, big or small. You did it. And don't give up!

Now, lets see how far I get before I hit another wall lol

last jewel
karmic briar
#

yeah the dedicated server aspect is not the goal for now for the multiplayer aspect.

#

just for the players can join their friend world aspect

#

i want to utilize the lobby system for that so if they want to join their friend world,their friend can send an invite to the party,similiar in fortnite before starting the battle royale gamemode

#

then they can join the world

#

my game is basicly minecraft and the witcher 3 combine

#

if that make sense?

last jewel
#

Yeah. You can use sessions for that. There's options to invite people, and join people. And to find sessions.

karmic briar
#

thank you

#

also do we know some tidbids on how fortnite handle their lobby before joining the battle royale world?

#

would like follow the recommended way

#

so far im thinking of using advanced session plugin and the online subsysten EOS and use it like how creating and joining a session would work with steam online subsysten

pliant moss
#

On_Rep only runs on client right?

bitter oriole
#

In Blueprint it's both

stray thunder
#

I'm not sure, but don't you just use repnotify after a multicast?

pliant moss
bitter oriole
bitter oriole
pliant moss
twin juniper
#

Im guessing instanced objects that are replicated work the same as instanced actors in the world? When they begin replication only deltas are sent even if they vary from the parent class? Object a value 10, instance a value 15, no values sent unless they were changed? Since that is basically the initial state of the object?

rancid cave
#

Do you still need to do the bOnlyAllowAutonomousTickPose thing in UE5?

#

I'm having listen server animation jitter, and came across that as a potential solution

worthy knot
#

For those who have tested matrix awakens demo in UE5, can you tell me if the car crashes are network replicated?

bitter oriole
#

Pretty sure there is zero network support for that demo

bitter oriole
# worthy knot fr?

I'm pretty sure it would have made the news if you could play it with friends

#

So maybe it doesn't immediately crash when started in MP, but don't expect anything other than player movement to work

worthy knot
#

yeah i know that feature isnt there in that, but i just wanna know if the car crashes look the same on all clients

bitter oriole
#

If no one spent the months of work to get it to work in MP, no

worthy knot
#

the control rig thing

frosty oyster
#

im looking for any infomrmation in regards to creating a session manager for lobbies to generate in a lobby browser. I do not want to use Steam or EOS, this is strictly for testing.

#

I imagine, that its most likely going to involve Rest API calls into a dynamic database of some type

half oriole
twin juniper
#

anyone know what DOREPLIFETIME_WITH_PARAMS_FAST_STATIC_ARRAY() or DOREPLIFETIME_ACTIVE_OVERRIDE_FAST_STATIC_ARRAY does?

grand mica
#

Is there a reason why BotController doesnt show up in the outliner but when I debug the AI system it shows there's a controller attached

#

i am playing it as a client in dedicated server

#

the name is also different but there is only one bot in the game

fathom aspen
#

Because that's the client outliner and AI Controllers don't replicate by default

fluid summit
#

John Carmack is a legendary programmer, co-founder of id Software, and lead programmer of many revolutionary video games including Wolfenstein 3D, Doom, Quake, and the Commander Keen series. He is also the founder of Armadillo Aerospace, and for many years the CTO of Oculus VR. Please support this podcast by checking out our sponsors:

  • InsideTr...
β–Ά Play video
dusk night
#

Anyone know how to start a multiplayer match with the camera faded to black? It seems like on clients the camera is rendering a few frames before any BeginPlay is called. Works fine in single player though

storm bough
#

small question about Print String, it seems to print message on all clients, even though only one client did something. is there possibility for some sort of print string that prints only in window where action (like button press) actually happened?

dark edge
thin stratus
storm bough
#

hmm will check that

rancid cave
#

I'm using advanced sessions. How do I stop that session from showing up in the "Find Advanced Sessions" when I move from my lobby map to a game map? It's currently showing up in the list while a game is being played.

magic furnace
#

How would I check whether a player is the Host aka listenServer? This does not work... ```void USpeedCharacterMovementComponent::SetMaxWalkSpeed(float NewMaxWalkSpeed)
{
if (PawnOwner->IsLocallyControlled() && (PawnOwner->GetNetMode() != ENetMode::NM_ListenServer))
{
MyNewMaxWalkSpeed = NewMaxWalkSpeed;
Server_SetMaxWalkSpeed(NewMaxWalkSpeed);
}
else {
if (PawnOwner->GetNetMode() == ENetMode::NM_ListenServer) {
MaxWalkSpeed = NewMaxWalkSpeed;
}
}

bRequestMaxWalkSpeedChange = true;

}```

rancid cave
#

@magic furnace HasAuthority is what I use in blueprints. I imagine that's exposed in c++ as well.

magic furnace
#

I mean, that is obvious to be honest, let me try

fluid summit
latent heart
#

It should return true.

#

What you really want is !IsClient, but yeah.

grand mica
daring arch
#

Hiya!

I assume I can't send the reference of an actor of the network, can I?

fluid summit
daring arch
#

Sure!

I want to tell the server "Hey, this pawn has interacted with this door right here. Please open the door."

Both pawn and door are Actors.

#

Can I just create a BP Execute on Server event and send a ref to the door over to the server?

fluid summit
fluid summit
grand mica
fluid summit
grand mica
#

breplciates = true lol

rancid cave
#

You shouldn't be replicating Controllers. What are you trying to accomplish?

fathom aspen
grand mica
#

got it. More than this I wanted the behavior to replicate which it does now haha

fathom aspen
fathom aspen
grand mica
fathom aspen
#

bUsePlayerState=true iirc it's called in your AI controller constructor and it gets auto spawned

grand mica
ornate hearth
#

Hello, is there any documentation or resource where there is an example on how to synchronise and replicate a variable from the server to a client that joins later.
I can't seem to get this use case to replicate the variable on the client with the value on the server.

fathom aspen
fathom aspen
grand mica
#

I see, thanks for that

fathom aspen
#

My guess though is that you are replicating some data type that doesn't support replication

#

In such case you should be looking to replicate the state and not the variable, and inside OnRep_StateVariable() you do your thing

rustic charm
#

Hey guys, do you have any info, docs or talks on how to do server rewind for hit validation in unreal engine?

#

I understand the general idea, but my question is more on how do you do the rewind, is storing the position/rotation/animation a good idea?

#

or should I go with box collisions and don't use the physics asset for validating hits?

formal solar
#

If I do my pawn possession in game mode on OnPostLogin, will this information be replicated?

#

And can I put multicasts in game mode

fathom aspen
fathom aspen
formal solar
#

ok

#

thank you

#

spawning actors inside gamemode seems to work though (they are replicated actors I spawn), so is it a general rule that a replicated actor doesn't need to be spawned on server?

fathom aspen
#

That's not what I said. Replicated actors must always be spawned from server. Though to call RPCs on an actor, that actor must be replicated

#

So yeah spawning replicated actors on GameMode is fine

limber gyro
#

Does any 1 have experience implementing steam sdk server stuff that can give a hand? im trying to implement a ping function from the SDK but it always returns "fail"

formal solar
#

I don't know what an RPC is. Is a multicast an example of one?

fathom aspen
#

Though if you are storing a reference to that actor on the GameMode, then you're out of luck as client's won't be able to access the GameMode in the first place

formal solar
#

ok, thanks. I need to look over everything

fathom aspen
fathom aspen
sharp hound
#

Hi everyone, how can I seamless travel with dedicated server?

winged badger
#

same as you would with listen server

#

ServerTravel MapName?listen?game=GameModeAlias

sharp hound
#

thanks, what about the ip?

winged badger
#

with seamless travel enabled on gamemode

#

there is no IP on seamless

#

you don't connect to the server, you just browse a different map on existing connection

#

(also implying that first connect can't be seamless)

sharp hound
#

I'm starting to understand...I'm going to try some stuff...thanks for the help

dark edge
winged badger
#

no, by design, seamless travel requires you to already be connected

#

quite unavoidable

dark edge
#

I mean in general, has there ever been an Unreal game that can go from single to multiplayer without a hard cut / loading screen?

winged badger
#

it can go from single to multiplayer as long as you're not running standalone

dark edge
#

As host right?

winged badger
#

as in, people are able to hotjoin

dark edge
#

So the clients who connect to you will have a cut

winged badger
#

yeah, they do need to load the level

#

server needs to spawn their pawns

#

etc

#

not really following how you planned to go around that

#

even with seamless travel, you're going to have a cut

dark edge
#

We don't travel ever as host

#

1 map, procgen

winged badger
#

and that is assuming you can hack the engine for server to host 2 different maps at the same time

#

we let them choose a map and some other stuff in lobby

#

and procedurally generating the thing takes about 10 seconds

#

having to spawn 50k Actors or so

dark edge
#

This is a town/dungeon loop like Diablo, as host/singleplayer there's no load screen from startup to shutdown. The only hard cut is joining another player's game.

winged badger
#

i mean you can procedurally populate a streaming level

#

then add it

#

host wouldn't notice any loading time

#

if you don't create entire sublevel sync in one tick

dark edge
#

Yeah we got that part handled, I was just curious if anyone's ever covered up the Client joining to be seamless

winged badger
#

they can't

dark edge
#

like Dark Souls

winged badger
#

dark souls is custom engine

#

and i imagine most of it is just masked

#

smoke&mirrors is what we do to pay our bills after all

#

unreal needs to

#

1 - establish a connection with the server, getting the current map back

dark edge
#

Yeah maybe we'll mask it, the town(spaceship) to dungeon(surface) transition is a teleport, so maybe some full screen FX or a fade to white can cover it in all cases. Then the town (local spaceship) to town (serverside spaceship) can be the same. It just needs to LOOK the same, not necessarily be the same.

winged badger
#

2 - browse to that map, which is pretty much OpenLevel

#

3 - wait for the PlayerController and Pawn

#

then it can start playing

dark edge
#

Are there any considerations if it's already the same level? It always is, and that level is tiny. The large area is always out of view when teleporting.

winged badger
#

it will be faster as it won't have to load the assets for it

#

but thats pretty much it

#

provided you don't let the asset manager release them during world cleanup, that is

dark edge
#

Yeah I'll look into that stuff. The hub is ALWAYS around, from startup to shutdown. The only difference you'd see when joining a game is the sun angle being different and interior changes due to game progress. You start and end in the same location on the same map with 99% the same assets around.

rustic charm
#

@fathom aspen thanks πŸ™‚ !

graceful mango
#

NetUpdateFrequency counts RPC queue?

#

Or only for properties?

fathom aspen
#

Properties and unreliable multicasts iirc

graceful mango
#

Uhh

#

I need unreliable multicasts

#

But dont need properties

#

How can i optimise in that case?

fathom aspen
#

I'm not sure I get the question

marble talon
#

Has anyone tried multiplayer VR using VR Preview? I'm trying to teleport in one of the clients but the teleport trace doesn't even show up. It works when there's only one client tho. I'm testing in the VR Template project btw.

fathom aspen
#

Isn't that what relevancy handles?

#

Choose your relevancy radius

tacit bough
#

I can't seem to use Spawn Emitter at Location on the client side.

With my current setup, the emitter spawns only on the server and the client doesn't see anything.

fathom aspen
#

It's being told to spawn on server

sinful tree
fathom aspen
#

Emitters don't replicate (I guess you can make them so, though you shouldn't)

#

Literally what @sinful tree said, Multicast instead

tacit bough
#

like so?

fathom aspen
#

Yeah

sinful tree
#

That's better, but the hit result probably won't be valid.

tacit bough
#

but I guess this has to be called from within a player character is what I'm understanding? because this by itself doesn't work

fathom aspen
#

Hopefully your actors replicates

tacit bough
#

oh

fathom aspen
tacit bough
#

the projectiles (the actor this function is part of) does replicate, yes

fathom aspen
#

Good

tacit bough
#

how would I make the hit result valid?

sinful tree
#

You'd have to pass through the data through the RPC and pass it through the function. If you're only using the Impact Point, I'd send that through the RPC and have Make Blood Splatter function take it as an input.

tacit bough
sinful tree
#

That probably means you're doing the overlap / hit check on both client and server.

tacit bough
#

This is the current flow:

#

and this works perfectly fine for apply damage to players on both ends

client shoots server and vice versa

#

oh....

#

so in here I could take the hit result and do the emitter call from there?

#

instead of from within the projectile?

sinful tree
#

That looks standard for the shooting portion.
On your projectile itself though.... What does your hit check look like?

tacit bough
sinful tree
#

What creates "hit result"?

tacit bough
sinful tree
#

There we go.

tacit bough
#

is this bad?

sinful tree
#

Ok, so that should be fine. The Has Authority node should make it check on the server, but only on the server.

tacit bough
#

yeah

#

that's the case

#

ohhhh

#

I see now

#

okay

#

ok I see why the emitter isn't spawning on the client

#

but I don't know what's best to do here

#

do I move the emitter logic over to the player character? feels odd to me

#

I'll have different emitter effects later on for different projectiles

sinful tree
#

The only thing is, if you're feeding in a value for a location for it to spawn, you have to pass it through the multicast.

tacit bough
#

do you mean with mulitcast a custom event that's set to multicast?

sinful tree
#

Yes

tacit bough
#

because all I've got is just spawn on server

#

I don't think I've got any multicasts right?

sinful tree
#

You did this.

tacit bough
#

one sec

sinful tree
#

Add a vector input on ServerMakeBloodSplatter and MakeBloodSpatter.

#

In the above, connect the the output from the event to the function.

#

When calling ServerMakeBloodSpatter, get the hit location from your hit result and pass it into the event call.

#

Within Make Blood Splatter funciton, connect the input to the spawn location.

tacit bough
#

it works!

#

but

#

Why does it work when I use the Hit Location but not if I use the Hit Result?

sinful tree
#

Because Hit Result isn't replicated and is only being set on the server.

tacit bough
#

I mean they both come out of the Event Hit thingy

#

and Hit Location is?

graceful mango
#

Does Unreal can send via RPC uint16 and uint32 types?

sinful tree
#

So it's not replicating a variable, you're sending a value.

#

It's just like how you're sending what gun it is you want to fire to the server.

tacit bough
#

in other words, the Hit value is not usable if I want it to work on both ends with how I personally have set things up

#

or is the Hit value by default not replicated

sinful tree
#

The hit value isn't calculated on the client as you have the HasAuthority check blocking the event from executing on the clients.

tacit bough
#

ohhhhhhhh

#

omg

#

yeah..... I just realized that lmao

#

omg I was so confused the whole time

#

jesus

#

thanks a lot I'm blind sometimes

#

jeez haha

#

guess it's a good idea to look at the complete flow instead of assuming things lmao

worn wagon
#

What does bClientSimulation do in the Character Crouch function? I'm guessing it makes it so it is smooth on the client and starts crouching immediately rather than waiting for updates from the server?

fluid summit
#

Does anyone remember the command to simulate latency on editor / standalone?

fluid summit
#

Net pktLag=int thanks!

graceful flame
#

L for LAG

fathom aspen
#

Yeah that's the Replication Graph

#

I don't know any info on it but the docs/source code and that video and couple of other places but they are not intros

peak sentinel
#

Quick question, since to replicate UObjects, only actor channels matters, does it matter where that uobject get instantiated or what its outer is?

#

I have an array of instanced uobjects in an AActor, but for management and organization reasons I want to move it to a data asset

#

And during beginplay, I'll copy the array to AActor's replicated Uobject array again

#

like

void AActor::BeginPlay()
{
  ReplicatedObjects = DataAsset->ObjectArray;
}
#

in theory it works, but wondering if there is any negative outcomes on the long run

wet bridge
#

hey how do I automatically set net.UseAdaptiveNetUpdateFrequency to 1

dark edge
graceful flame
#

Even with only 1% packet loss the movement lag is noticeable and jittery is that normal?

graceful flame
#

Well I have two base characters. One is using default movement component and other is using a custom one. Both are lagging about the same with packet loss.

#

hmm actually its not so bad, I think the lag just seems worse when I have a GPU related fps drop

limber gyro
#

does any 1 know if unreal has built in functionality to convert IP to decimal?

pliant moss
#

I have an actor with a replicated defaultSceenRoot with an Replicated SkeletalMeshComponent with physics. I spawn the item on the server. what did i miss? it does not show up on the client

#

I do set the skeletal mesh on begin play

limber gyro
#

depends on the game, is the hit important enough that i needs to be the same in every machine?

pliant moss
#

forgot to mention that the actor itselfe is replicated:

limber gyro
#

are u gonna have a ranked mode?

#

if so i would do it server side

#

im not exactly sure how good that would feel response wise since ive never worked with vehicles

#

do they have like a custom movement component?

#

if they do i would probably let the movement component handle that stuff

pallid mesa
# wet bridge hey how do I automatically set net.UseAdaptiveNetUpdateFrequency to 1

For that, in the Config folder of your project, open DefaultEngine.ini and add the following section:

[SystemSettings]
net.UseAdaptiveNetUpdateFrequency=1

However, in UE4 and UE5 Early Access, this won’t work. To make it work in those engine versions you have the following alternatives:

a) Remove net.UseAdaptiveNetUpdateFrequency=0 from Engine/Config/ConsoleVariables.ini in the Engine’s directory.

b) Switch the CVAR value in the Server when the game starts (right after ConsoleVariables.ini gets called).

limber gyro
#

i cant be of much help since ive never done it tbh

#

go with client side then

#

it should be easier indeed

pliant moss
#

I found the problem. im passing in a skeletal mesh to actor that i spawn, and then set the mesh on the replicated component. apparently the mesh itselfe that is getting passed needs to be replicated aswell

#

but there is something im missing still. Im getting diffirent meshes on the client and server. im using a subsystem to return the item that should be dropped. i though this would only run on the server.???

dark edge
#

Enjoy the hellscape that is lag-compensated physics.

humble bane
#

Does unreal engine built in sessions work in current version

still owl
#

Hello πŸ‘‹

Does anybody have any idea what might be causing this weird pullback on the clients version of the server / host character?

It only seems to happen on the clients screen when the Server characters stops moving, it doesn't happen the other way around.

**note: ** Game is running at 15fps intentionally to highlight the issue. Its less noticable at higher fps but its still happens

magic furnace
#

weird, looks like a prediction issue

#

but it shouldn't since that's the server

magic furnace
still owl
#

Happens without lag as well.

I'm testing now with a default character just in case its something I've done on my character since i do use Client Auth Movement, but it still happens with the default character πŸ€”

magic furnace
#

It looks like it is predicting the client movement and then correcting

#

have you tried turning on netcorrections

#

to take a look

#

p.netshowcorrections 1

#

I believe

still owl
#

Sure 1 sec

#

Although it would be weird if the server is correcting its own movement on clients, since clients shouldn't be predicting the servers movements

#

No Corrections happening

magic furnace
#

it would be weird

#

but that's honestly what it looks like

#

well, I don't know then, have no other theories

frosty trail
#

Does anybody know why a Custom Event that's set to Run on Server would be changing a Pawn reference to None once it's been passed in?

still owl
#

So testing with a Default Character BP, it actually looks like the Mesh is racing a tiny bit ahead of the capsule, then gets moved back.

I wonder if this is just "how it is" and its masked by animations or something. I'm gonna check the default Third Person Template

still owl
frosty trail
#

It is None once printed in the custom event

#

which is causing it to fail to get my controller, and then fail the cast.

elder sable
#

Where can i pass data from a beacon connection to the game connection ?

frosty trail
#

My Client's Game Instance references a Pawn, and I'm trying to access that Pawn's AI controller (Which only exists on the server), so that I can manipulate it.

#

So, I've grabbed that reference from the Game Instance, and called the Custom Event that's set to 'Run on Server' and passed it a reference to the Pawn.

#

But, it's being set to None.

still owl
#

Assuming that the print you showed in the screenshots is the one saying None, it means the reference you're getting is None

frosty trail
#

The print for the client's custom event above is showing the Pawn's name

#

the issue is the 'Run on Server' custom event

#

that one is providing None, as it's deleting/not accepting the pawn reference

still owl
#

Are you sure its the Pawn Reference? You're immediately casting to a controller which it may not have yet, which would be None.

frosty trail
#

It's a pawn reference, just printing exactly what is being passed in returns None on the Server.

still owl
#

It might be that you're hosting Data in the Game Instance. The GameInstance is essentially the Window the Game is in. Meaning it only exists on that machine.

So if you're trying to pass an object to the server that way, it might fail because RPC i think expect the object to exist on BOTH the server and client, it just says which one to run the code on.

So if the Pawn is in the GameInstance, it never existed on the server, so the server has no idea what object you're talking about.

frosty trail
#

Right, but the item in the GameInstance is set to be replicated currently.

#

Shouldn't the Server be aware of it?

still owl
#

Replication only works Server -> Client not Client -> Server

#

My recommendation would be to use the Game Mode. The GameMode ONLY exists on the server, so its a good place to put anything that should be Server Authoritive. An AI controlled Pawn fits that description since AI Controller only run on the server as well IIRC

Then you replicate that pawn to the clients if needed, but most likely the server should be the one creating / controlling this.

If you want a client to control the AI, thats when you pass a Server RPC, so the Client can tell the server "HEY DO THIS THING FOR ME". And it should be able to, since the Server is the one who created and owns the object, so it exists.

sinful tree
still owl
frosty trail
still owl
# frosty trail The latter point is what I'm trying to accomplish. I'm spawning in an AI possess...

Then what i'd do is the following:

  1. Spawn the AI Possessed Pawn on the server (Can by done via an Server RPC, or a Server Auth Object like the GameMode)

  2. Make sure the Pawn is set to Replicate so All clients get a copy of it

  3. Use ServerRPC's from the Client to tell the server what to do with the pawn. You don't need to pass in the Pawn, only the intent. For example, if you want the pawn to move to a location that the player clicked, you calculate that position on the client, then pass the Vector Location into the Server RPC. When the Server receieves the RPC, it will have access to the Location you passed and then it can call "AI Move To" or whatever method you're using to move the character. Since the Pawn is Replicated, all clients should see the pawn move on their screen.

Note: Make sure the Pawn has Replicated = True AND ReplicateMovement = True

frosty trail
#

Thanks, that's pretty close to what I had configured already. I guess my confusion here lies in why the reference to the pawn I want to move doesn't need to be passed to the server.

#

Does the server also have an exact copy of the player controller, that holds the pawn reference? If it does, and the references are different between the Client and Server, that'd explain it.

pliant moss
#

I have an issue where simulated physics replication is causing problems. When i drop an item on the ground the item some times goes trough the ground (which is a plane). I have a Z check inplace to put the item back above ground again. But once this happens on the client it keeps repeating the process.

#

any ideas how to solve that?

#

doesnt seam like the location is replicated att all...

still owl
# frosty trail Does the server also have an exact copy of the player controller, that holds the...

The PlayerContoller does exist on the Server AND the client, but it DOES NOT exist for other non owning clients.

So in theory it should be an exact copy, but of course depending on how you've got things setup, it might not be since you can easily set Client or Server only information.

Since the Server is the one Creating and Storing the reference to the AI pawn, the Server always knows about it. Most likely you probably want to pass a reference to this pawn or some sort of indentifier to the clients, so when they RPC back to the server, the server knows WHICH pawn it should act on (incase their is multiple).

The most reliable way to pass information like this is using RepNotify, which means it automatically updates the client Value with the Server value when it changes on the server. However, the limitation here is that the object storing the reference needs to exist on the server and client, so using the GameMode for RepNotify won't work. Using the GameState however would.

sinful tree
# frosty trail Does the server also have an exact copy of the player controller, that holds the...

When you first start a game, and you make no changes to any variables, the server and client have the exact same player controller.
You can have variables that are changed on the server only, or that are replicated to the client.
You can also have variables that are changed on the client only. Variables cannot be directly replicated from the client to the server, you have to RPC to the server to feed the server any client-side values.

sinful tree
#

Probably under the Job Board category. #instructions for details on how you can make a post.

elder sable
#

Is it possible to use beacons in editor ?

oak prawn
#

widget that should only appear on the player approaching it. But how can I make it not appear on the other player?

sinful tree
oak prawn
#

@sinful tree now i added "IsLocallyControlled" but this time it is showing on other player, not the closest one

sinful tree
oak prawn
#

@sinful tree

sinful tree
#

You need to connect IsLocallyControlled to a branch

#

and you should do it to both the OnOverlap and OnEndOverlap

oak prawn
#

I don't know much about how to use "Is Locally Controlled"

#

like this ?

sinful tree
#

You need to connect IsLocallyControlled to a branch

oak prawn
#

thank you it works, final version

#

@sinful tree

dark edge
#

Client authority over physics has a fundamental problem when 2 client objects interact

#

They are both "authoritative"

#

so which one is authoritative?

quasi tide
#

Yes

wet bridge
civic seal
#

Hello! I'm looking into a way to get my NetMulticast RPCs to players a little more selectively, and I was wondering what the right way for this was. My initial guess is that the Validate function for the multicast determines if it gets sent? I'm working in C++

Partly it's to not send out data that a player doesn't need to know for performance reasons, but also it's to prevent players from knowing info they shouldnt know.

Thanks in advance!

latent heart
#

Validate is only for client to server, isn't it?

quasi tide
#

Multicast is sent out to all relevant clients. There is no selection.

latent heart
#

You can't multicast to specific players. If you want to do that, you need to rpc to individual players.

quasi tide
#

Server - client machine RPC this to the server
Client - server machine RPC this to the client
Multicast - server machine RPC this to all relevant clients.

latent heart
#

I guess by relevant it means that any actor not relevant to a player doesn't get the rpc.

#

Distance culled etc.

#

But that's not an rpc-specific thing.

civic seal
#

That's right, yeah. I'm just trying to figure out the right way to do this. From what I know, Client RPCs only get sent to Owner, but Multicasts get to everyone. I'm trying to find a way to selectively send out RPCs to particular clients without regard for ownership. I'm not entirely sure what the right process is, so its the reason im asking

#

My first instinct was that there may be some kind of mask that can be applied to the NetMulticast, maybe some conditional in the form of a lambda similar to how arrays get sorted, but i'm just guessing really

latent heart
#

The easy way to send out rpcs to specific people is to send client rpcs on their player states.

#

Or player controllers, ofc

civic seal
#

wouldn't you have to have individual functions for every possible kind of data you're trying to send?

#

Sounds like a chokepoint that will bloat the PlayerState class hardcore

latent heart
#

You need that anyway?

#

Even a multicast rpc requires set variable types

civic seal
#

I mean yes, I'm more talking about the organizational POV

latent heart
#

You can use their pawn

civic seal
#

Currently my RPCs stay in their relevant class

latent heart
#

Point is, there's basically 3 client-owned actors, PS, PC, Pawn

#

Use 1 of them

civic seal
#

I guess I'm just surprised that there isn't a way to multicast by profile or something

#

sounds much tidier

#

property replication for example has conditionals, I expected a similar thing to exist for RPCs

latent heart
#

I'm sure it'd be pretty "easy" to add a FilterMulticast method to multicast rpcs. Just edit the engine.

civic seal
#

I've been trying to stay away from editing engine code because its bound to get borked with updates πŸ’€

quasi tide
#

Multicast RPCs are for one-off events mostly.

latent heart
#

Reliable ones are.

#

Unreliable Server RPCs are generally not events!

quasi tide
#

Server RPCs are the only way for a client to talk to the server.

civic seal
#

Yeah I'm facing a situation where there's certain events that have to be multicast to everyone but given how hectic my game can get it'd be wonderful to be able to narrow down what everyone means. Everyone with a POV? Everyone within a distance? Etc.

#

There's a way to do this with GameState, PlayerState, PlayerController, etc. but good lord it's already so fat

#

navigating it is hell

#

cuz I have so much shit in there

sinful tree
civic seal
#

@sinful tree ooh I didn't know about relevancy being a thing. I'm still learning about UE's networking

quasi tide
#

That's why I kept mentioning "relevant clients"

latent heart
#

We did kinda mention it right when you first asked.

civic seal
#

miscommunication, I happen to be very dumb so I didn't pick up on it

#

thanks a lot! I'm gonna look into relevancy for this

latent heart
#

Bear in mind, gamestates and playerstates are always relevant to everyone.

civic seal
#

I assume there's a way to override relevancy?

#

like whatever getter exists in an actor to figure out whether it is or not for a particular player?

quasi tide
#

You set the relevancy for an actor or you can mark an actor as always relevant

latent heart
civic seal
#

Thanks a ton! This is super great for me

#

❀️ ❀️

latent heart
#

I mean, google is a thing. First links in google.

quasi tide
#

And I'm pretty sure Cedric's compendium talks about this as well

civic seal
quasi tide
#

Which should be a hard requirement for all new people to networking

civic seal
#

Shoulda read it harder then

quasi tide
#

Read it multiple times.

#

Go back and double check stuff.

#

I still refer back to it from time to time.

civic seal
#

yessir

paper plinth
#

Is there a reason ClientTravel() would be working when ran from in the editor and then timing out when ran from outside it as a standalone game?

spring sapphire
#

i'm having a weird issue, I've got a CPP class with a replicated variable, and a BP class that inherits from it, and the variable is simply not replicating

bReplicates and bAlwaysRelevant are set to true on both the CPP class and the BP class, and this is the variable's declaration in the header file:

    UPROPERTY(VisibleAnywhere, Replicated, ReplicatedUsing=OnRep_PlayerName, BlueprintReadOnly, Category="Boing Character")
    FString PlayerName;

it still doesn't replicate when the ReplicatedUsing=OnRep_PlayerName, bit is missing as well, and everything compiles fine because all other changes to the code work

#

the variable is also set on the server and shows up on the server perfectly fine

spring sapphire
#

this is what each client thinks the variables are, Connecting... is the default

spring sapphire
#

ACharacter

sinful tree
#

Do you have the GetLifeTimeReplicatedProps function in your new class, and have declared the variable in there with the appropriate macro?

spring sapphire
#

oh my god i'm so dumb

#

thank you

obtuse field
#

Hi, I have a world divided into chunks. On each chunk, player can place items. Items can also be spawned by world generator, so there can be plenty of them on one chunk. Lets assume, that I want to replicate this chunk, and I have to send an RPC with an array of: Items IDs(String) and Items Locations(Vector3D). How can I optimise it? Whole code is in C++

rotund cosmos
#

Hey Guys! Quick question: If I want to replicate a property (eg.: an integer) that is stored inside an actor component, do I have to set the component to replicate as well?

latent heart
#

Yes

rotund cosmos
#

Alright, thanks.

static flare
#

What is the lifecycle of a replicated actor on the client, compared to one that the client spawn themselves? Are all the same functions called (constructor/OnConstruction, BeginPlay etc), or do they behave differently?

fathom aspen
#

Not speaking from experience, but why would it be any different. It's only the functions that were called for both ends will be now called only for client, BeginPlay for example, and only for that client instance that spawned it

vivid dagger
#

if I have logic in widgets can clients use it to cheat?

karmic briar
#

hi

#

im trying to integrate the Common plugins inside Lyra into my game and i kept getting these errors

#

i tracked it down to this class inside CommonSessionSubsystem.h and to this line

#

and also to this line inside commonuser build.cs

#

if i remove the comment i got this message when regenerate the project

#
Log file: C:\UnrealEngine-release\Engine\Programs\UnrealBuildTool\Log_GPF.txt

Some Platforms were skipped due to invalid SDK setup: Mac, IOS, Android, Linux, LinuxArm64, TVOS.
See the log file for detailed information

Discovering modules, targets and source code for project...
E:\CreationArt\Plugins\CreationArtTools\CreationArtTools.uplugin: warning: Unknown platform Win32 while parsing allow list for module descriptor CreationArtTools
E:\CreationArt\Plugins\CreationArtTools\Source\CreationArtTools\CreationArtTools.Build.cs(70,7): error CS0103: The name 'bUseOnlineSubsystemV1' does not exist in the current context
E:\CreationArt\Plugins\CreationArtTools\Source\CreationArtTools\CreationArtTools.Build.cs(79,48): error CS0103: The name 'bUseOnlineSubsystemV1' does not exist in the current context
ERROR: Expecting to find a type to be declared in a target rules named 'CreationArtTarget'.  This type must derive from the 'TargetRules' type defined by Unreal Build Tool.
#

any ideas on how can i fix this

#

could be how i integrate the .h .cpp to my plugins but i structure it like this

#

i didnt want to multiples plugins inside my Plugins folder so i just copied some build.cs/.uplugin details on each plugins and paste it inside my project plugin and corresponding public/private into their own designated files inside my plugin

#

been trying to figure it out for the last week and still havent managed to fix this one

fathom aspen
karmic briar
#

tag me btw

fathom aspen
#

They can change the data they see in the widget and show their health as 99999999. Would that change anything? No

stray thunder
#

ok, i'm trying to cast to gamemode and my reference is throwing empty. i've tried switch has authority and is local controller, but i'm still not getting any references for the clients, but the server is working. i just need a hint.

latent heart
#

Game mode doesn't exist on the clients and never will.

#

That is your hint.

stray thunder
#

oh yea... thats funny

vivid dagger
fathom aspen
#

Who decides what item you have in hand? Client or Server?

#

If client then yes that's a problem. If server then no

#

That slot can be in the widget and you have no issues whatsoever as long as the server dictates what that slot is and replicates that data to you and to everyone else. So even if you change it for your instance, the server knows the legit value, and any other client likewise

stray thunder
latent heart
#

What job?

stray thunder
#

oh, communicating from the client PC to the GM.

latent heart
#

What are you trying to achieve with that?

#

There should really be no reason for the client to talk to the GM

vivid dagger
stray thunder
#

oh just a player respawn

fathom aspen
#

GM isn't replicated so you can't fire RPCs on it

latent heart
#

Okay, yeah, that will require an RPC

#

Probably on your PC

stray thunder
fathom aspen
#

If the PC is the one firing then yes

latent heart
#

Client presses button -> triggers RPC on Client PC -> Triggers event on Server PC -> Asks GM for respawn -> GM validates and potentially respawns player

fathom aspen
#

Even if they changed the widget to be RPG widget, for the server they are still rocking the AK47

latent heart
#

What that means is, the client doesn't respawn itself. The server does.

vivid dagger
# fathom aspen Server should do authority stuff. Server shouldn't make the widget and it can't ...

Ah yeah, that's right. I had stored a temporary inventory for the client, and it uses that to create the widgets. They would need to change that to do anything meaningful. Thanks I am dumb. On another note about that exact inventory, where should I store it exactly? It's in PlayerState currently but as everyone can see the PlayerState, I'm not sure if it should be there. It doesn't have to persist as I can always create it again from online.

fathom aspen
#

Even if it's on PlayerState you can make it relevant only to the owner. Normally it's part of the pawn, unless you support reconnections it better be on PlayerState

stray thunder
latent heart
#

No worries.

vivid dagger
#

Alright thanks, then it's a weight off my shoulders.

stray thunder
#

A question on that inventory... if your game supports possessing different pawns, you'd want your inv to be on teh player character, correct?

fathom aspen
#

How come?

#

Explain what you mean by different pawns

stray thunder
#

I don't know much about player state, but if you possessed different a different pawn, they'd have different gear. I'm not hijacking that question, I'm just curious about basic inventory location.

#

wait... does the player state go with the player controller or the player character?

fathom aspen
#

Oh now I get it. Let's say you have heroes/pawns on your game, and each hero has its gear. That gear would be part of a DataAsset that is linked to that pawn. When you possess it, you PlayerState inventory gets populated with that data

fathom aspen
#

Even if you unpossess your pawn you still have the PS valid

#

PC is what spawns PS and owns it

stray thunder
#

wait do i have the arrows going the wrong way?

fathom aspen
#

GameInstance exists on both though it's not replicated

#

Also what does the arrow mean?

stray thunder
fathom aspen
#

Oh then yes a lot of the stuff here aren't correct

fathom aspen
stray thunder
#

it is a work in progress haha

vivid dagger
#

Where is the best place from all of these to store stuff like logging in and granting items? I guess GameMode should be better for granting items and GameInstance for logging in than for example PlayerState as it's a lot of unnecessary commands for other players to replicate in the blueprint. I just stuffed everything there since I didn't really have a proper idea.

fathom aspen
#

GameMode already has login methods. IIRC PreLogin for example approves the login, and you got Login, and PostLogin

#

What do you meaning by granting items?

vivid dagger
#

I used playfab for all the item management stuff so I send API calls for granting items from a temporary array made from collected items, so I guess my better question should be what blueprint should I store all my playfab SDK things?

fathom aspen
#

I don't use such services, but I don't think it's such a matter. Collected items seem to me inventory and that usually goes either to Pawn/PlayerState

#

Unless you meant they are world pickups

#

Then they are spawned by an actor manager or maybe GameMode

#

Your choice

latent heart
fathom aspen
stray thunder
#

wait, the game instance is replicated to all but lives on the server correct?

fathom aspen
#

I clearly say it's not ^

#

It's not replicated

#

So has two potentially different copies

#

One on server, one on client

stray thunder
#

oh right, so its like the game state

#

no wait

#

there is only 1 game state

fathom aspen
#

Yeah on server, and it's replicated to all clients

fathom aspen
vivid dagger
fathom aspen
#

GameState is replicated, GameInstance is not

vivid dagger
#

They are like this, I hope they are fine there.

fathom aspen
#

Yeah as I said they are added to your inventory, so pretty much where your inventory is

vivid dagger
#

Aight, thanks.

stray thunder
latent heart
#

No

#

yellow box goes inside the blue border only

#

and a different one inside the red border only

#

There are 2, they are entirely unique and not shared.

fathom aspen
#

To be honest I find it hard to understand it using such diagrams. Literally understand it and that's it πŸ˜„

vivid dagger
#

need that blueprint brain to unveil the secrets of diagrams like this

elder sage
#

So the Game Mode is server-only, the Game State is sort of the replicated extension of that, and the Game Instance is non-replicated and represents the game process that's running, from the point you open the game to the point that you close it

#

@stray thunder

#

Game Instance is for stuff that should be persistent between loading screens and connecting to host, because nearly everything else is destroyed at some point

stray thunder
#

i have in my notes the game instance:
Only 1 exists for each client, only on clients.
Does NOT replicate
Persistent through maps
Save Game Data goes in here.?

fathom aspen
#

This is just one place

#

I can count up to 8

elder sage
fathom aspen
#

It's a good place that's no argue. But I guess Subsystems make more sense, as that can potentially clutter you GameInstance making it a less optimal class

fathom aspen
elder sage
#

I've never done anything with subsystems so far, so that may very well be the case

fathom aspen
#

They are a game changer, yeah you need to check them out

elder sage
crystal crag
#
OnPresenceArrayUpdated(const FUniqueNetId& UserId,
    const TArray<TSharedRef<FOnlineUserPresence, ESPMode::ThreadSafe>>& PresenceArray) const

This signature confuses me and the documentation doesn't help much either. If User Id is the current local player, playing on the game client, then why doesn't the FOnlineUserPresence contain a unique net ID? If it is a friend's presence data, then why is there an array, given that the user can only login and play on one machine?

#

If UserId == currently signed in local player, then the array makes sense, except that I would see the presence structure to have the friend's unique ID so I could know to whom the presence data belongs. That's where it stops making sense. There isn't a unique net ID anywhere that I can find in either FOnlineUserPresence or FOnlineUserPresenceInfo structure that's available underneath it

fathom aspen
elder sage
karmic briar
crystal crag
#

The error is telling you what is wrong

vagrant grail
#

Does anyone know why when sprinting my code works as intended and it decreases the stamina by 1 every 0.1 sec however stopping sprinting doesn't stop the decreasing of the stamina. Somehow clearing the timer doesn't stop it πŸ€”

#

Please ping me if any answer πŸ™‚

elder sage
#

Print for the handle and see if it's getting anything

stray thunder
elder sage
vagrant grail
zenith wyvern
#

I want to have instanced housing for players to each have a room of items they can use for storage. where should i start with that? dedicated server with 1 level orr?

elder sage
elder sage
stray thunder
elder sage
# stray thunder

Yeah, that's about right. The net compendium does have something like this already

zenith wyvern
#

As a starting point for now, i just want players to be able to connect to their own rooms as a starting point. Visitors probably down the line

fathom aspen
stray thunder
#

yea, i'm consolidating all of my references and info

zenith wyvern
#

players host their own halls?

vagrant grail
elder sage
zenith wyvern
#

Also, i want to be able to save/load starting area contents, from server, to prevent cheating

elder sage
stray thunder
zenith wyvern
#

Would I do something like.... 100% non replicating content

#

so everyones technically on top of each other, but no one can see each other

elder sage
elder sage
stray thunder
# fathom aspen ^

ok got it. if the game instance is the maker - then it should point to the PC as well ? and PC should not come from game mode?

elder sage
#

Run that on the server if you're setting it from the server, of course

fathom aspen
elder sage
stray thunder
#

yea that makes sense

#

the game instance persists through levels, so I guess it just comes with the controller its attached to.

vagrant grail
fathom aspen
elder sage
stray thunder
vagrant grail
elder sage
# vagrant grail Here

Where is the value for that variable being set? All I see is you're creating a timer without using the return value

fathom aspen
elder sage
stray thunder
vagrant grail
stray thunder
zenith wyvern
#

I keep leaning towards the only way to do instanced player housing being not replicating anything except to the owning player

fathom aspen
#

bOnlyRelevantToOwner if you haven't figured it out yet

zenith wyvern
#

Is there a way I could expand on that to allow visitors, or a guild hall kind of thing?

#

define some relevance identifier?

fathom aspen
#

Override IsNetRelevantFor

#

It's on every actor and called per connection

zenith wyvern
#

awesome! thank you

#

I'm going to need a dedicated server for a game instance, and one for 'player housing' level right? When I setup settings -> maps, i define the server starting map. how would i do that for each? Package multiple times with the diff settings?

sinful tree
zenith wyvern
#

Thanks!

tired epoch
#

has anyone here worked with the Oculus Subsystem?

#

I haven't been able to get it to work

waxen umbra
#

With a Packet Loss of about 1% should I expect some jitter in movement due to NetCorrections?

#

I feel like I've seen networking models where this can be solved with redundancy but I'm not sure how Unreal does it

sinful tree
waxen umbra
graceful flame
#

I'm not sure what can be done about smoothing out packet loss jitters. I do however know that using client side prediction can help reduce the feeling of input delay when there's a high ping.

waxen umbra
#

Yeah those aspects are set up to work correctly, I've even managed to sort out prediction for melee swings and hits with GAS.

#

I just sort of assumed the CharacterMovementComponent could handle dropping some positions and just resending what was lost

graceful flame
#

It does, that's why you see jitter

#

otherwise the client would be out of sync

#

The server notices a packet loss and issues an immediate correction

waxen umbra
#

I mean, as long as the player did not move illegally, the player can revert itself to a correction, and then play through every update that is unconfirmed by the server to get back to where they were, and just keep resending data that wasn't confirmed by the server

#

That's how I learned to do it when I wrote my own networking stuff πŸ˜›

#

It would already have to do that in order to not correct itself back to a previous position every time the server acknowledges an update that was in the past.

#

If not you'd constantly be corrected running in a straight line

glass orchid
#

whats a good system to have a reference to a specific client's pawn without sending a hard reference over the network?

sinful tree
glass orchid
#

isnt that kinda expensive?

sinful tree
#

No.

#

You're not sending over all the details about the reference. You're sending over a pointer.

glass orchid
#

hmm

#

okay

sinful tree
#

tested on the profiler... Sent an actor reference... The RPC was 4 bytes.

solar stirrup
#

You're not sending a pointer, but the FGuid assigned by the server for that actor

sinful tree
#

I stand corrected πŸ˜›

solar stirrup
#

Any time the server sends a UObject to a client that it does not know about, it'll also send an FGuid that identifies the UObject

#

That way any time you reference it over the network, it just sends the id

#

Before you get a GUID is the costly part since you send the full path to the object (when possible)

glass orchid
#

so it's only 'expensive' the first time it's loaded?

solar stirrup
#

technically yes

#

until the client acknowledges that it received a GUID iirc

#

Curious as to why the Guid was only 4 bytes though

karmic briar
#

felt like an idiot wasted a week because of that errors

#

the OSS one

#

could be a plugin thing now that i think about it

#

ughhhh

glass orchid
#

So how would i go about checking wether a character reference is controlled by the local client, or a remote client?

glass orchid
#

thanks πŸ˜„

lusty yarrow
#

Hey, I'm trying to use the online subsystem to connect to a game I'm hosting, the session creation works fine, its when I'm trying to join through the internet where it goes wrong, LogNet: Browse: 79.112.93.79/Game/Maps/L_WorldSplashMap LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 79.112.93.79:7777, Name: IpConnection_8, Driver: PendingNetDriver IpNetDriver_9, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Channels: 2, Time: 2022.08.07-22.52.57 LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 79.112.93.79:7777, Name: IpConnection_8, Driver: PendingNetDriver IpNetDriver_9, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID LogNet: DestroyNamedNetDriver IpNetDriver_9 [PendingNetDriver] LogExit: PendingNetDriver IpNetDriver_9 shut down LogInit: WinSock: Socket queue. Rx: 32768 (config 32768) Tx: 32768 (config 32768) this is what I receive when trying to connect to 79.112.93.79 with Execute COnsole Command node

#

this is how I try and join the session

#

this is how I initiate the session

glass orchid
#

What's the best way to get the reference to the local controller's currently posessed character?

sinful tree
glass orchid
#

thank you πŸ˜„ youre super helpful. i did just realize i have no clue how to get the local controller.

#

would this work?

sinful tree
#

It can, but it's not great to use in multiplayer - and under certain circumstances you shouldn't use it in multiplayer.

glass orchid
#

hmm

#

then how should i go about this

sinful tree
#

In what blueprint are you attempting to get the local player controller?

glass orchid
#

a seperate actor. an interactable that the players can interact with

sinful tree
#

Ok, and in what way is the player controller being used?

sinful tree
glass orchid
#

the controller itself is just used to get the controlled pawn reference

#

ultimately im trying to check that pawn's ASC for a matching gameplay tag

sinful tree
#

Is it something that is triggering with the interaction event?

glass orchid
#

i dont understand the question πŸ˜…

#

you mean if it checks the gameplaytag when the interaction event starts?

#

if so, yes

#

what i want to acomplish is, when you interact with the interactable, your pawn gets set to state B, and become invisible to everyone in State A and visible to everyone in state B.
State A can see other pawns in state A but not pawns in state B and vice versa

#

so my idea was to send a multicast RPC to check if you have the State B tag or not and then set the interacting actor's visibility accordingly

sinful tree
#

Ok, so when beginning that interaction, is it being triggered on your player controller or character? Like you're pressing a key then calling an interface on the actor?

glass orchid
#

the ability system component is on the playerstate though, if that helps

sinful tree
glass orchid
#

oh it already does that, getting a reference to the interacting actor i mean. for the multicast i just need all other clients to set the visibility of the interacting actor to either visible or hidden depending on their gameplay tags

#

im sorry if this question is super confusing, im having a hard time putting it in words πŸ˜…

unkempt tiger
#

Does it make sense to want my weapon, held by the ROLE_AutonomousProxy local player, to also have a ROLE_AutonomousProxy net role? Is it possible to achieve, if the weapon is spawned serverside and is in fact, not a pawn?

glass orchid
#

so Pawn A is visible on Client A but not on Client B

fathom aspen
#

With visible you probably mean relevant.

fathom aspen
worn wagon
#

So i'm having an issue where firing a client rpc in beginplay doesn't get registered, seems like the client isn't technically the owner of the pawn yet but the server runs the function anyway. Is there a function that is called early like beginplay but guarantees the owner has been set?

#

Seems like OnRep_Owner could work, and just check if you are the local pawn owner before doing anything. It would be nice to have something that isn't run on every client though.

sinful tree
worn wagon
#

Is that what you normally do?

sinful tree
#

If you want to do something whenever a player possesses that pawn.

worn wagon
#

hmm

magic furnace
lusty yarrow
magic furnace
#

Good question, I use the steam online subsystem, but I think it works out of the box with the unreal networking too. So my guess would be yes.

lusty yarrow
#

does it have any limitations?

magic furnace
#

Not any that I know of. And if I remember correctly before I used the steam online subsystem it required absolutely nothing. Granted I am no expert in this matter so you will have to research a bit on your own.

sinful tree
#

Otherwise, use AppID 480 for testing πŸ˜›

magic furnace
lusty yarrow
#

and I don't want dedicated either

lusty yarrow
magic furnace
#

I don't know for sure, since I never had an issue with it, so yeah.

lusty yarrow
# magic furnace .

Aslong as you tried to connect over the internet and don't remember any manual port forwarding I guess it works

magic furnace
#

That's what I mean

#

I didn't have to do anything and it worked.

#

I did 1 test without Steam about 8 months ago and it worked, that's all I remember. Since then I use Steam.

unkempt tiger
fathom aspen
#

Yeah that's the other option. I mean I don't really care for the roles. At the end of the day you probably wanna route server/client RPCs through your weapon and as long as it's owned by your pawn and your pawn is possessed you're good

grand mica
#

@fathom aspen if we fire a multicast delegate from OnRepNotify(), this should fire the callbacks to all the actors who are registered to the multicast right/

fathom aspen
#

Yeah if they are on the same end.

#

A function listening to that delegate on the server won't get called

fathom aspen
#

Unless you call the OnRep explicitly for the server

fathom aspen
grand mica
#

I am calling the delegate like this

#

OnRepNotify happens on all clients right?

#

@fathom aspen

fathom aspen
#

Yeah considering that's GameState. It's always relevant

grand mica
#

yeah, but somehow the functions connected to the delegate don't get called and I am trying to figure out what's wrong exactly

fathom aspen
#

Or call the OnRep on the server

grand mica
#

@fathom aspen okay, so the issue is that the functions won't get called because it's not fired from the server

#

just to be sure how do I call OnRep from server? Make that OnRep function a server RPC?

fathom aspen
#

Nope

#

Where you change the replicated value tied with the OnRep, you call the OnRep right after, as that's the server

grand mica
#

@fathom aspen I see, thanks

last jewel
#

Does anyone know how to prevent two clients joining at the same time? There's only two connections open, but they can join at the same- if they search at the same time. Breaking the game. So it makes it 3 out of 2 players joined. Really weird.

chrome bay
#

You can either use beacons to "reserve" space in a server before triggering the lengthy join process, or you just kick the second player if they exceed the player count once they've joined.

#

First method is obviously better for UX, but requires C++ and knowledge of how beacons work

last jewel
#

I tried looking at the current player amount- but that changed nothing really weird.

glass orchid
chrome bay
fathom aspen
#

If owner is controller that's possessing the pawn, and camera is following etc. then there is no way they will be not relevant

#

Though what if I want it to be OnlyRelevantToOwner but bAlwaysRelevant to it. Can I set them both to true and that will automagically be the case?

last jewel
glass orchid
fathom aspen
glass orchid
#

how can i set it to be relevant to some clients and not others?

fathom aspen
#

APawn::IsNetRelevantFor()

#

Override it to your liking

#

It's called on server for every connection

glass orchid
#

is it exposed to blueprint?

fathom aspen
#

100% no

glass orchid
#

damnit

#

would you know about a plugin that exposes it to blueprint?

fathom aspen
#

No idea actually, and I won't bother looking for workarounds. Most multiplayer functionality is in cpp

#

Only about 10% is in BP

#

6 is your case

glass orchid
#

hmm

#

all of those sound very useful

#

guess ill have to learn cpp

fathom aspen
fluid summit
#

I was so high on sugar and other stuff yesterday that it took me 4 hours to do this "bounce" effect when the cells spawn