#multiplayer

1 messages · Page 144 of 1

lucid badger
#

Well as long as whatever changes the item on one side is mirrored on the client side then the state will remain parallel, but sure I get your meaning

#

So if I put all "WhereAmI" stuff in the inventory into a struct, then just replicate that whole thing, I can OnRep that struct and check for changes (i.e. went from an inventory to an equipment component, so do OnRemove from inventory stuff and OnEquip stuff)

#

As far as actually replicating the items... I just stuff the individual item objects into the replicated subobjects list and forget about it? hmm

pale void
#

Definitely dont want it on tick

#

i am not using enhanced input, are you sure you are talking about last input vector from pawn movement component?

sinful tree
#

Can always use interpolation if you're doing anything less than frame rate etc.

#

The point is - you want it replicated, you have to send it, and have the server set the value.

lucid badger
sweet sage
#

What is the best way to code a scalable gathering system on unreal? where we can have more than 100k gatherable trees on map (multiplayer)

lucid badger
#

Is there a good reason why you're not using enhanced input?

#

That seems like the best (i.e. least calls) choice

crisp shard
#

ok... so ive just tested my game with 30-60 ms latency min/max as well as 1 percent pack loss and my character is rubber banding with no sprint or anything just all movement makes it rubber band. not a clue where to start on this as my inputs are simple and im not sure how this could be out of sync as my character movement speed is the default and doesnt change

tame kraken
#

What does it mean that the event dispatcher has options to be replicated?

I just tried: Game state -> IS server -> call event dispatcher, but my event didn't fire on its calling in the client

pallid mesa
#

it doesnt, if you bind yourself only on the server you will get the callback on the server, think of it as 2 separate worlds

#

to have a callback on the client, you need to bind the delegate in the client

tame kraken
#

I'm binding to the event from my player controller:
get game state -> bind event to TEST dispatcher

pallid mesa
#

just check the execution context with GetNetMode/GetLocalRole on where you are binding yourself to understand where you will get the callback

tame kraken
#

what you mean by binding to myself?

sinful tree
#

The player controller exists on both the server and the client. Event dispatchers are local only, so if you bound to the event dispatcher on the client, but are calling the dispatcher on the server, the client won't respond to it.

pallid mesa
#

The delegate has two basic operations, the binding part and the callback part. Binding refers to registering your delegate so certain function reacts when the dispatcher gets called. The callback refers to the function registered

#

re Datura - Correct but even with that, you can be in PossessedBy (or similar) in the controller, which is a server only function

#

hence checking the execution context.

tame kraken
#

what does it provide for me then in this case?

pallid mesa
#

delegates dont have any replication support

tame kraken
#

they have it here:

sinful tree
#

The answer is because blueprints treat it like a variable. That doesn't necessarily mean that it supports replication.

tame kraken
#

ah ok makes sense 😄

sinful tree
#

Ha, just noticed they made it impossible to mark Map type variables as replicated in at least 5.2. Earlier versions you could mark them as replicated but the engine never did support their replication.

pallid mesa
#

they finally gave up on that 🤣

tame kraken
#

Really? IT doesn't seem that I can set maps to replicate in my 5.03 unreal engine

oblique arrow
#

Guys somebody know why this delegate could not call on a client on the server everything works fine
im creating this widget in Possesed by where function that create it is executed on the client

void UBuffContainerWidget::NativeConstruct()
{
    Super::NativeConstruct();

    FTimerHandle Hanlde;
    GetWorld()->GetTimerManager().SetTimer(Hanlde, this, &UBuffContainerWidget::InitializeDelegates, 1.0f);

    GEngine->AddOnScreenDebugMessage(-1, 8.f, FColor::Cyan, (TEXT("Buff Constructed")));
}

void UBuffContainerWidget::InitializeDelegates()
{
    ASentinelCharacter* Sentinel = Cast<ASentinelCharacter>(GetOwningPlayerPawn());
    UAbilitySystemComponent* ASC = Sentinel->GetAbilitySystemComponent();
    ASC->OnGameplayEffectAppliedDelegateToSelf.AddUObject(this, &UBuffContainerWidget::HandleGameplayEffectAppliedToSelf);

    GEngine->AddOnScreenDebugMessage(-1, 8.f, FColor::Black, (TEXT("Owning player name: %s"), GetOwningPlayerPawn()->GetName()));
    GEngine->AddOnScreenDebugMessage(-1, 8.f, FColor::Cyan, (TEXT("Initialize buff widget")));
}

void UBuffContainerWidget::HandleGameplayEffectAppliedToSelf(UAbilitySystemComponent* AbilitySystemComponent, const FGameplayEffectSpec& GameplayEffectSpec, FActiveGameplayEffectHandle ActiveGameplayEffectHandle)
{
    FGameplayTagContainer AssetTagConatain;
    GameplayEffectSpec.GetAllAssetTags(AssetTagConatain);

    GEngine->AddOnScreenDebugMessage(-1, 8.f, FColor::Cyan, (TEXT("Effect Applied")));

    for (const FGameplayTag& Tag : AssetTagConatain)
    {
        GEngine->AddOnScreenDebugMessage(-1, 8.f, FColor::Red, (TEXT("Tag Name: %s"), *Tag.ToString()));
    }

    ASentinelCharacter* Sentinel = Cast<ASentinelCharacter>(AbilitySystemComponent->GetAvatarActor());
    GEngine->AddOnScreenDebugMessage(-1, 8.f, FColor::Magenta, (TEXT("Owning player name: %s"), Sentinel->GetName()));
}
quaint rain
#

I feel very silly asking such a basic question: but does "BeginPlay" mean actor spawned, or actor enters replication range?

ie. In a persistent server, a user joins late - Does the user's client generate all BeginPlay events for all actors in range, or did the user miss out on the begin play event (assuming the 'beginplay actor' spawned before the user joined server).

sinful tree
quaint rain
#

So if an actor does CoolThing1 on spawn, and that actor is spawned before User1 logs in. User1 will witness CoolThing1 even if it's been several minutes?

#

In which case I assume I'd need some kind of state management system to determine if User1 should see CoolThing1 or not.

Is that accurate?

sinful tree
#

Begin Play fires on clients and server. Anything you put on begin play can fire at any one of those points I mentioned above.

#

Assuming a dedicated server set up (not a listen server), when the server spawns the actor, it'll do whatever you asked it to do on Begin Play and only for the server.
When I join the game and that actor replicates to me, the Begin Play for that actor will fire for me, and only me on my client.
If I move far enough away from the actor, it'll get despawned as it leaves relevancy range. If I move close enough again, it will re-enter relevancy range, and the Begin Play will once again fire on my client and only on my client.

quaint rain
#

You've explained it quite well, thank you! Wish I asked this weeks ago..

oblique arrow
#

Yes but should it not call on client actor instance on the server?

sinful tree
#

It'll only call on the server.

#

Delegates don't replicate. The one above it in the screenshot may be the one you want to use.

oblique arrow
#

Thanks

dusty void
#

I'm trying to set the gamestateclass variable of my Gamemode as this gamestate class i created through c++ that i made into a blueprint and everything is working fine and shows up how i want it to but i can't move any of my characters or do anything when i try playing in the world, here's all the relevant screenshots, there's nothing in gamestate, & BP_MyGameState is the blueprint im trying to use

fossil spoke
#

Set the GameStatClass in the GameMode Blueprint

#

Thats literally what UPROPs are for.

#

To make setting these things easy and safe.

dusty void
#

OH i iddn't even see it mb 😭

thin stratus
#

Anyone lately made some Client Predicted Targeting with Server being able to confirm more or less, with keeping ping in mind?
Asking for a friend..

dusty void
fossil spoke
#

Make one

#

Make a Blueprint that is derived from your GameMode class

#

I think you need to do a bit of research on how to work with Blueprints my friend.

#

C++ and BP work together

dusty void
#

grahhh i thought it would make one for me sorry

fossil spoke
#

There is no single project that is entirely C++ only

#

They are complimentary.

dusty void
#

ohhhh i see

fossil spoke
#

Learn to use them together correctly.

dusty void
#

i did create the blueprint of the gamemode, and i did look in my output logs and see the issue with my character not being able to move or be controlled

#

i will come back if i can't fix this 🦖

thin stratus
dusty void
#

my gamemode was base but my gamestate wasn't

#

why that happens i have NO IDEA

#

i didn't really see it until now and it just seemed off to me

#

so i changed it but didn't expect it to completely fix the issue

thin stratus
#

Yeah they break a lot of mixed up

#

Pretty sure it logs something though

dusty void
#

yeah it did and i thought there would be another issue but nope

#

i will be doing research on how bps and c++ work together tho 🦖

thin stratus
#

BP can know about C++ stuff, exposed via UFUNCTION/URPOPERTY/UCLASS/UENUM/USTRUCT/etc.

#

C++ has a hard time knowing about BPs stuff

#

The go to way is usually coding your logic in C++ (especially cpu heavy stuff) and using BP children to configure everything.
Exposing variables such as floats, booleans, or assigning materials, meshes and positioning components etc. is a good thing to do in BPs

#

Also exposing functions to BP as simple callbacks for designers to hook into

dusty void
lucid badger
#

Dug my way back to this comment because of the exchange I had with @hollow eagle earlier made me think of this discussion. I remembered exi suggesting that you'd just replicate the list of item objects rather than replicating the items themselves... Thinkge does that mean replication of an Array is 'smart' somehow, like it will only replicate members that change or something, rather than the whole list? Thinkge

dusty void
#

That's really interesting tho

thin stratus
#

You can reference other C++ stuff in C++

#

But if you need access to Assets and BPs you usually make a BP child

#

Or something similar. Depends on the use-case

lucid badger
#

I was thinking you'd just replicate the item objects directly via subobjects list

thin stratus
#

You can do that yeah

#

The Subobject List would "only" make sure it's actually replicating

#

The Array still somewhat represents your inventory

#

Idk if you could just highjack the subobject list, but I think there is more in there than just your objects?

#

Not sure how Components are actually handled

lucid badger
#

No this is not a component, this is a lsit of all ItemData regardless of where they are

thin stratus
#

Yeah just thinking out loud

#

Not sure what else you'd do

lucid badger
#

Individual inventories do hold a list of items in them, but that's more of a convenience thing. This list would get updated OnRep when the item's positional data changes

thin stratus
#

Array of Objects which are replicated via SubobjectList by the owning Actor sounds fine to me

#

If it's a big Array, one can use FastArraySerializer stuff

lucid badger
#

The idea was to put all the item's positional data as a struct (so the struct has, ContainingInventory, ContainingEquipmentComponent, GridX, GridY, SlotEquipped in, and some of those would be null/0 based on which it is)

#

Then just replicate that struct

#

So when changes occur we can tell where it came from and where its' going to fire events

#

That struct is part of the item

thin stratus
#

What you put into that Item Object that you replicate is up to you

lucid badger
#

Yeah I just mean, you seem to be talking about lists a lot but items are not positioned by lists

#

They are positioned by what the internal data says on the item

#

Because items can be inventories that contain other items

thin stratus
#

I mean, somewhere you gotta have an array or?

#

Even if the location in the array itself isn't important

lucid badger
#

Inventories have a list and EquipComponents have a TMap of <EquipSlot, ItemData> but those collections are reactive, not authoritative if that makes sense?

#

Like those collections update in response to item state changes

#

They're just there so you don't have to search the whole item list (of ALL items) to find the one that is equipped there

thin stratus
#

I mean the TMap isn't replicated anyway

#

So that isn't really important for the replication part or?

lucid badger
#

Sure tha'ts what I mea ntho. The thing w'ed need to replicate is when the item itself says it's somewhere else now

#

Then the client sees that and goes to the relevant lists and changes them

#

Reactively

#

The lists are not the "main authority on where items are" so to speak

thin stratus
#

I mean, sure. I don't mean to argue about that. If I look at something called "An Inventory" I usually expect that Inventory to have a List of Items. If those Items are actually in Slot 0, 1, 2, 3, like a simple list/grid based Inventory, or if they are a bit more complex placed, doesn't really matter. And nested Inventories still work the same.

If an Item is moved from Inventory A to Inventory B, then Inventory A and Inventory B both will have their List updated and that List (being an Array) simply replicates the change.

#

If you are now throwing that all away and say "I have something that defines where the Items are located." then you gotta replicate that part. Wherever it is placed. The important part is however that the Client still needs to somehow get access to that data

lucid badger
#

Well so if you do it that way and you replicate the list when it changes and respond to THAT, then you have an issue where you can't control the order of which list updates first, right?

#

And also you have to walk through the whole list to see what actually changed?

thin stratus
#

The first question: Yes, you would not have control over which updates first.
The second question: That's what FastArraySerializer is for, so you get a Per Element callback.

#

If you save that "Where is my item" data on the Item

#

Which I think you said

#

In form of a struct

lucid badger
thin stratus
#

Then the client still needs the Item Object to get that Struct

lucid badger
#

Yea

thin stratus
#

So somewhere needs to be something containing that Object

lucid badger
#

Yeah you've already answered my question on how to do it my way, now I'm trying to understand how it would work your way Thinkge The per element callback clears that up I think

thin stratus
#

Oki

lucid badger
#

When the array is replicated in that manner, is it replicating the entire item that's in the array still? Thinkge

#

That seems heavier potentially

thin stratus
#

You have to see the Item Object replication and the Array replication as two different things

#

Similar to how an Actor replicates and an Array containing the Array pointer replicates

lucid badger
#

Doing it as an array, the item object wouldn't have anything marked replicated at all, right? Or no? Thinkge

thin stratus
#

The Object still needs to replicate

lucid badger
#

If I'm replicating the array that doesn't jump out at me as "You are replicating the objects themselves as replicating objects"

#

Oh

thin stratus
#

Otherwise the Client can resolve the NetID

#

A non-Replicated Actor can also not be magically transfered via a Replicated Actor Array

lucid badger
#

Because the array is just pointers

thin stratus
#

Yop

#

And for the Network they are just NetGUIDs

#

Client receives an Array of NetGUIDs and tries to resolve those back to the Objects

#

That's why you replicate the Objects via the Subobject stuff

#

Cause unlike Actors, Objects cant do this on their own

lucid badger
#

So if you were doing it array-first, you'd still also need to put the items into subobjects list? Or is presence in the synced array enough to say "also replicate these"

thin stratus
#

Also into the subobject list

#

Spawning an Object on the Server and putting it into a Replicated Array won't work

#

The Object also has to be replicated via the subobject list

lucid badger
#

So at that point is there much advantage to doing it array first? Rather than letting client infer which arrays need to be updated from the object itself

#

And just doing that locally

thin stratus
#

How are you planning on getting the Object reference on the Client?

#

Where are those objects stored?

#

I don't quite get how you are planning on getting a hand on the Object on the Client without said replicated list

lucid badger
#

What do you mean by stored exactly

#

Well the gamestate handles all itemdata creation

#

and any that are created are put in a list on the gamestate

#

So at that time I'd also add it to the subobject list

thin stratus
#

THAT you never said

lucid badger
#

Actually I wouldn't even need that list

#

The subobject list would essentially replace it

thin stratus
#

Yeah but there I would be careful, cause that SubobjectList might have more than just your objects

#

Such as Components

#

At least I think so

lucid badger
#

Sure I'll probably still keep the list for lookups and stuff Shrugeg

#

I just mean its main purpose will be

#

Superceded by this new method

thin stratus
#

I also don't know if that List is actually something avaiable on clients

lucid badger
#

Cuz before I was using multicast rpc's to sync "Actions that change an item's state"

thin stratus
#

Or if it's just a list on the Server to say "Those have to be replicated"

#

Yeah that's baaaad

lucid badger
#

Yea heh

thin stratus
#

RPC + State = no no

lucid badger
#

It just wasn't until the struct suggestion that I could picture a way to do it

#

Since hte struct will replicate atomically I can OnRep the struct and then go from there

#

Before I was like, do I OnRep every fucking variable and do a 6-way wait-and-go?

#

Like GridX replicates before ContainingInventory or something

thin stratus
#

Yeah your replicated UObject can hold an OnRep Struct with info where it is, that is correct

#

You shouldn't use that, but fwiw, C++ allows OnRep functions to be shared

#

In some rare scenarios that's useful

lucid badger
#

Yeah I couldn't figure out where I'd do the stuff where you react to changes. i.e. spawn equipment mesh on skeleton and such

thin stratus
#

There is something I would question though

#

Why are all Items available to everyone via the GameState

#

I would personally only replicate the Items to the Player that needs to know about them

lucid badger
#

Yeah that's the next step, is figuring out what I can cut from there, since not all this stuff needs to be client side really. Since stuff like GameEffects from equipped items is handled server side anyways

thin stratus
#

Having them in the GameState means every player knows about every item

lucid badger
#

Yeah that was necessary under the old model

#

Everyone needed to keep track of all item state in order to properly interpet the multicasts heh

thin stratus
#

Moving those to the Character maybe might make more sense. Then they are bound to its Relevancy

lucid badger
#

And keep everything synced

thin stratus
#

And if you replicate them via an array on the Character you can even make them only replicate to the Owner

#

Not sure that's needed but fyi

lucid badger
#

Nothing inside the backpack has to change

thin stratus
#

Yeah idk, it might be that you are overcomplicating things and making your life harder here

lucid badger
#

Once I get over this struct replicating horizon it'll be easier to see the next steps but I will surely hit you with a reply in a few days if this suddenly makes more sense heh

thin stratus
#

If I drop a backpack full of items, I would have that Backback be an Actor that handles the Items replication

#

Means if people walk away from it, relevancy will make sure they aren't receiving data updates on stuff that isn't important to them

#

Also not sure how sane it is to have the GameState's ActorChannel handle tons of items of all players

lucid badger
#

But data updates only occur when state changes, right?

#

So what updates are we talking about

#

Nothing is changing

thin stratus
#

Do I need to care that someone is interacting with that Backpack, moving items around, if I'm on the other side of the map?

lucid badger
#

No, but do I (the dev) need to care if it's only happening like one update per 3 seconds? 😛

#

I don't mean that sarcastically I am genuinely asking

#

I might be overlooking something but

#

The updates would be very sparse

#

Cuz I think I ould do what you're saying movijg the items around to different relevancy contexts but I would wanna make sure it's worth it to do so

thin stratus
#

Maybe? It's the first time I encounter someone even designing an inventory like this.
Usually Inventories are handled by the Actor that has the Inventory. Items are handled by the Inventories have contain them.
Your setup is a lot different. Doesn't mean it's bad, but I wouldn't set it up like that, at which point it's difficult to give any advice.

lucid badger
#

it was originally designed for single player and is being ported to multiplayer. That's why it doesn't feel originally designed for multiplayer

thin stratus
#

Having every player know where a given Item is currently also sounds like it can be abused by cheaters. Maybe at least.

lucid badger
#

oh definitely

#

That was a concession made early. Coop only so I'm not gonna worry too much about cheaters

#

But I can do it that way too if it makes sense Shrugeg

thin stratus
#

But yeah I think you know everthing you need to do your stuff. If you decide on moving it more towards the actors that should care about the items or if you keep it more globally is up to you. If you can live with the result and yo uare happy with it and it works for you and your game, then go with it

lucid badger
#

Yeah this is stuff I just hadn't gotten to think about yet under the old framework

#

Where I was essentially replicating more state than needed

#

Thanks for the insights it's a big help Okay

#

Since inventories can be items, thus containing more items (note they are NOT actors) how would the assignment of relevance context work there Thinkge

#

I guess you'd have to walk up until you find an actor

#

For every single item Aware

#

I mean, walk up once then assign to all

thin stratus
#

Nothing cares about the Items in that regard

#

The Actor is simply gonna be Relevant or Not

#

And if it's not relevant, it won't replicate to the Client

#

And then also the Items won't

fossil spoke
#

@lucid badger I did mention to you earlier that this approach is non typical and advised you adjust it such that an "Inventory" Actor or Component is the one managing replication.

#

The GameState is a very weird place to be handling this type of thing

thin stratus
#

Yeah I basically said the same thing over the past couple minutes

lucid badger
fossil spoke
#

People answer when they can 🤷

lucid badger
#

I'm not casting blame just saying I couldn't action your suggestions until I got that missing piece

fossil spoke
#

Sure

lucid badger
#

That was the eureka moment lol

fossil spoke
#

The Items themselves likely dont have a concept of relevancy, but the inventories they are contained in might.

#

But we could speculate all day on how they have engineered their systems

lucid badger
#

Come to think of it I don't think cheaters can steal items out of your own bags so there must be some limits

cloud lake
#

i'm having an issue with the player camera position being replicated in multiplayer.

i attach a debug camera to pawn, print string world location on remote/authority and get the same position. great.

i put the camera on a spring arm, and replicate, i can see both positions update so know its replicating. However, when i move the mouse to rotate the camera, the camera position is now different on the client and server.

i can get the camera rotation using base aim rotation / control rotation on authority/remote respectively, but i think if my cameras world location is in the wrong spot on the server i'm going to have a bunch of issues (already am).

any ideas?

lucid badger
#

Thinkge why would you need to replicate the camera

burnt coral
#

Hello, I've been taking notes while doing some documentation reading.. Could someone look over them and tell me if anything is wrong??

thanks for your time in advance..

lucid badger
cloud lake
# lucid badger <a:Thinkge:978090588920508456> why would you need to replicate the camera

throwing an object (imagine a grenade). I use predict projectile path, using a combination of the socket on the players hand and the forward vector of the player camera manager to calculate the launch trajectory. the effect is solid in single player mode.

however, in multiplayer i have issues.

I've tried fixing these issues by not replicating the camera and simply setting the vector with a server rpc call / multicast to client, but since the trajectory is updated on tick (imagine visually updating trajectory path every frame) what ends up happening is the server position is fighting the client update position and so i get stuttering.

burnt coral
lucid badger
#

Say... If I have an object on an actor's relative subobject list and its replicated to players, if I remove it from that actors RSOL and put it into another actor's, the client just seamlessly and correctly moves it as well right? We don't get duping or something? 😅

burnt coral
#

Because of my understanding gameinstances aren't sync'd with server and clients but the server and clients do have one of their own.

#

I don't know if that makes sense but it did in my head

lucid badger
burnt coral
fossil spoke
#

Think of the GameInstance as the actual Unreal process thats running on that machine.

lucid badger
fossil spoke
#

Each process has exactly 1 GameInstance, they cannot talk to another process.

#

They are not synced across the network.

burnt coral
#

So storing anything in it other then local settings would be useless?

lucid badger
#

Client has to tell the server it wants to throw the grenade which afaik rpc is the only way

fossil spoke
#

Given that the GameInstance is local, then whatever you store in it would therefore also be local.

burnt coral
#

Thank you!

lucid badger
#

Can a much smarter person with a colorful name confirm that both for my own understanding and this nice fellows? 😛

fossil spoke
#

What part is stuttering?

cloud lake
# lucid badger I'm still being thoroughly educated on this matter so wait for confirmation befo...

maybe a video helps - notice how the trajectory path is updated based on the camera view? the issue in multiplayer is that the final point in the trajectory path is different because the server doesn't have the correct camera view.

this is because when the camera is attached to the spring arm, its location doesn't replicate in the same way as if it wasn't attached, but i can't figure out how to fix this.

i can find the rotation with a different method on client /server, but i just know i'm going to have issues later if the camera is in a different location on the client and server.

lucid badger
#

How are you telling the server you want to throw the grenade

#

The trajectory indicator should be entirely client side I would think Hmmge

fossil spoke
#

@cloud lake You would probably want the Client to send to the Server when it "fires" where its requesting it to be "fired" from.

cloud lake
#

yeah, definitely no need to draw the line on the server etc, but the location of the camera being different on the client and server seems certain to create issues (and already is) if you are using that location as part of calculating trajectory.

fossil spoke
#

The Server can run some verification on that data to make sure they arent doing something they cant in that context.

#

And then accept it as the appropriate data if validated.

cloud lake
#

yea i mean, i think once they click 'fire' i can write the variable and recalculate trajectory one time for the actual target as opposed to drawing the ui, and thats probably more efficient, but again, i feel like i am going to run into major issues long term with the camera just always being in a differnt position on the server and client

fossil spoke
#

Since the server is not running at the same rate as the Client, you do need to take some information from the Client about what they want.

lucid badger
#

You just put the camera forward vector into the rpc to the server Shrugeg

thin pilot
#

Hey guys im trying to learn the unreal replication but I can't figure out how to fix this problem:
basically I want an event in my GameState blueprint where whoever listen to it, client or server, performs the delegated function. How can i do it? I leave some screenshots to understand it better.
Thx for the help.

cloud lake
# lucid badger The client would handle calculating trajectory for the indicator while the serve...

i actually did try this this, and yes it is goblin code as you imply. i set the camera forward vector to update on tick on the client, and i wrote a variable called 'CameraForwardVector' using an RPC call. I set it to be OnRep_CameraForwardVector, and set the rest of the trajectory code to only run when updating that value OnRep.

However, the value then oscillated for some reason, for 2 frames it would be the same, and then 1 frame it would change to something else, and then repeating that process.

that brought me back to just shaking my head like, what am i doing, i should just make sure the camera is at the same place on the server and client and i wont have to deal with any of this, why is this so tricky! and it isn't, until i get to using the springarm which for some reason doesn't replicate the camera position.

lucid badger
#

No wait

#

Again you're talking about variables

#

Just put the camera forward vector into the server rpc as a parameter Thinkge

#

You don't need to communicate with the server at all until it's time to actually throw

cloud lake
thin stratus
#

@cloud lake not 100% sure but BaseAimRotation should only be needed on sim proxy or?

#

Server should have the ControlRotation via CMC

cloud lake
thin stratus
#

Might be a bit different from client due to compression

cloud lake
#

like the rotation is the same but since the spring arm changes the location of the camera as the rotation changes, is it even looking at the same thing at that point?

thin stratus
#

SpringArm would be linked to ControlRotation

#

If you aren't additionally modifying the Camera, it should be "the same"

cloud lake
#

yea the location is not when rotating on the spring arm though. janky looking debug video but you can see:

  1. player spawns in observer mode, camera location is replicated / the same on client server.
  2. player spawns into map. you can see that as they run around, both locations update (client / server).
  3. now watch as i rotate around the player. the spring arm is physically moving the camera, as expected, but these movements are not updated on the server.
thin stratus
#

Where is that Spring Arm parented to

cloud lake
#

RootCapsule->SpringArm->ThirdPersonCamera

thin stratus
#

Probably doesn't matter I guess. Hard to say what's going wrong.

cloud lake
#

yeah no idea goblins

thin stratus
#

You would want to parent it to the mesh either way

cloud lake
#

hrm

thin stratus
#

Small corrections teleport the capsule and smooth the mesh

#

But that's a different topic

cloud lake
#

yea maybe, quite a non standard setup for player camera system here as it is cross play VR. but the base setup should still replicate i think

#

i mean u can see it replicating movement just fine

thin stratus
#

Video looks like the rotation isn't replicated at all

cloud lake
thin stratus
#

In theory GetBaseAimRotation should work just fine on everyone

#

That's what shooters use for their aim offset after all

#

+- missing yaw

cloud lake
#

but if the camera is in the wrong location, that will definitely not give me the right location right

lucid badger
#

What's GetBaseAimRotation? Thinkge the FPS prototype project just uses the camera rotation

cloud lake
#

ill get baseaimrotation then use find lookat vector, feed that into the launch velocity calculation,a nd get the wrong result

#

hrm

thin stratus
#

Hm might be that you are actually just suffering from the lack of yaw replication

#

Now that i think about it

#

Cause base aim rotation takes character yaw

#

And only replicates pitch properly

cloud lake
#

i see.

thin stratus
#

Could fwiw override it in c++ and add a replicated yaw maybe

#

Or you do what you are already doing if that works

#

Pitch should in theory still change stuff though so hm. Too late for me to figure this out over phone

cloud lake
#

i mean, it does seem to get me a good result / is more efficient anyway to just not worry a bout the server until the moment the pokeball is thrown and then pass the value, but i've had some issues with the two things not being in sync that took like, weeks to fix, so just very cautious now of just leaving this permanent offset on the server of the spring arm at all times

thin stratus
#

Can check tomorrow if it's still an issue

#

In theory the camera is a very local construct

#

The server shouldnt need the camera location ( in thoery )

#

UE is still very much a first person shooter engine

lucid badger
#

@thin stratus Does it not make sense to just have the Server RPC take a ForwardVector from the client for the chosen throw? Thinkge

#

Why would it need to know anything about the camera

cloud lake
#

side note, anyone doing multiplayer stuff should immedaitely setup 'debug sphere multiplayer, which is a debug sphere that replicates, spawn those instead of debug spheres 🙂

#

might be obv but didn't do that for ages heh

#

u see at ~22-24 neuro, it seems to use the server location as the target (i've drawn debug spheres on the client and server and only the server sets the target b ehind the player). so i'm still having the issue once in a while where the target variable passed in the rpc call somehow ends up behind the player in multiplayer mode. never happens in single player.

thats what lead me down this path in the first place unfortunately...

#

guess i will focus on some of the other jerky behavior first tho

lucid badger
#

Wait wtf?

#

What does that mean exactly Hmmge any time I add something to RSOL on the server I have to tell the client to do it too?

#

That doesn't sound right...

lucid badger
valid bough
# thin pilot Hey guys im trying to learn the unreal replication but I can't figure out how to...

On Rep notify should be used to change states, i.e, the door is open so it should be in an open state. You are changing the value which is not the way. You should set the variable to replicated, which you have and change the value on the server. Then OnRep will be called which in OnRep_"whatever you name it" will then call your open door function so the rest of the clients will see the door in an open state. You should also use a netmulticast function to actually play the animation because if late joiners come in they won't see the whole animation play but OnRep will at least show that the door is in an open state.

Anyone else correct me if im wrong.

hollow eagle
#

For example, components created via CreateDefaultSubobject (you don't have to do it for these, actors already do this for you - just an example)

#

Objects created at runtime don't need to do that.

lucid badger
#

Thinkge but how do you get a UObject over there in the first place

#

I thought they don't replicate hmm

hollow eagle
#

They do...

#

if you tell them to

#

and override a couple of simple methods

lucid badger
#

ANd how do you do that? I was told in here that's what Replicated Sub Objects List is for Thinkge

hollow eagle
#

it is

lucid badger
#

So you have to get them to copy over in a different way, but once they are copied you use the list to keep them synced

hollow eagle
#

no..

#

you just completely ignored what I said

#

That paragraph is only for objects that are created on both sides separately, generally through the use of CreateDefaultSubobject

#

Objects created at runtime do not need to do that.

lucid badger
#

I'm asking for the specifics on this part:

#

How do I tell them to

hollow eagle
#

you add them to the subobject list...

lucid badger
#

Where does overriding methods come in to adding things to the subobject list

#

You just call methods, no?

hollow eagle
#

You must also override a few other functions. https://jambax.co.uk/replicating-uobjects/
Ignore the bit on the ReplicateSubobjects function if you are using the replicated subobject list (doing it won't hurt, it just isn't necessary - the list replaces the ReplicateSubobjects call)

lucid badger
#

Yeah that's the old method right?

#

It's mentioned in the docs link

hollow eagle
#

ReplicateSubobjects is the old method

lucid badger
#

The part you said to ignore I Mean

#

yea

hollow eagle
#

the other things you need to override are not old (IsSupportedForNetworking, GetFunctionCallspace, and CallRemoteFunction)

lucid badger
#

Thanks for this link I suspect this will answer the questions I have so I'll read this before I keep asking 😛

nova wasp
#

there's also being net addressable but I don't know how that ties into rpcs

hollow eagle
#

that's covered by overriding IsSupportedForNetworking

lucid badger
#

Oh neat, this CallRemoteFunction bit allows you to have RPCs on the object huh? moon2WOW

#

So this says you want the Outer of your UObject to be the Actor which is replicating it. I thought I read that changing the outer on an object is unadvisable, but if I was to move the Object around to different Actors (say as it is dropped and picked up by different actors), wouldn't I need to do that? Thinkge

past flicker
#

Why might my clients be getting corrected every time they move with default Third person CMC? I haven't knowingly touched anything to break replication.

crisp shard
#

Would love to learn what could be causing it as it legitimately is the most important aspect to a game is character movement

nova wasp
#

likely not correctly extending the cmc

#

anything beyond simple maxspeed changes afaik needs to send flags in a custom saved move

#

otherwise they will sim differently and result in corrections

#

or you can just... not care and accept client results (totally valid honestly, who cares about cheating in co-op games)

crisp shard
crisp shard
# nova wasp likely not correctly extending the cmc

What do you mean by not extending correctly? I’m currently not changing anything as far as I know when it comes to the movement (no sprinting logic, etc). I basically reverted most movement to its default when I noticed this latency today and it still is giving that rubber band effect.

crisp shard
nova wasp
#

the source code is over 10k lines long lol, in general if the server notices a big enough distance between results it will send back a correction

#

with simulated latency you might be turning it on for both outgoing and incoming and both client and server which would result in a lot more ping than you probably intend (doubled up again etc)

past flicker
#

The default third person CMC had a bunch of non-default fields set, but after setting them all default it still is being corrected.

nova wasp
#

the docs go over how this works, your server isn't getting the same results for a myriad of reasons

#

you can see this with p.NetShowCorrections 1

#

anything different on what the server does to the cmc resulting in a different end state = correction time

#

and a lot of the values it uses to consider things and timing them etc are settings

past flicker
#

I remember seeing that CMC requires lots of considerations to modify, but I haven't yet. I didn't touch anything. I thought it was suppose to work out of the box.

crisp shard
past flicker
#

Doesn't seem to be. I opened a raw third person template, set emulation to everyone and bad, and it's still better than what I see in my project. I must have touched something.

nova wasp
#

the "bad" preset is apocalyptic levels of bad connection

#

if people actually have 5% packet loss in your game server there's not much you can really do

past flicker
#

My project behaves even worse emulating 30ms with 0 packet loss than the template on bad so something is broken.

dark parcel
#

I see no correction even with 200 ms in pie

#

Only time I get corrected is when I tested it in steam and bump into a friend from the next continent

nova wasp
#

kind of hard to say what is actually happening here, you could be accidentally setting something on client only easily

lucid badger
#

Am I... Hmmge This seems to my feeble eyes to say that this function is not called on the server

#

Hmmge but it is

fair latch
#

@lucid badger listen server is client too, no?

lucid badger
#

It fires even in standalone mode hmm

#

With no clients

#

@dark parcel @fair latch wait

fair latch
#

Actually scratch that, i dont think it fires on server

lucid badger
#

It does fire on the server

#

I'm witnessing it with mine own eyes Looking

#

I put a log in it Shrugeg

past flicker
#

Well it doesn't say "Called only on the client".

lucid badger
#

heh true

fair latch
#

Go deeper and check how its called? See if its client rpc

crisp shard
fair latch
lucid badger
#

Yep it's called in a Client RPC

#

they got me

fair latch
#

On holiday atm, cant check my code but i do override it to apply cosmetic on client side

#

Dont remember that it gets called on server. I have the logic to equip my cosmetic on server side else where

crisp shard
fair latch
crisp shard
#

Bad it could be**

fair latch
#

Try without packet lost snd bump the ping to 150

#

Iirc even 2% packet lost is huge

crisp shard
fair latch
#

I test with constant ping

#

Net pktlag or something like that

crisp shard
fair latch
#

I always test with ping in editor, they r important in multiplayer

crisp shard
#

And in the settings you do both min/max to be the same then? For the ping

fair latch
#

I just type a console command

crisp shard
crisp shard
fair latch
#

Especially for sprinting or crouching etc

crisp shard
#

Lmao yea 100 percent

#

Legitimately having someone help me create a custom movement cpp just for sprinting

#

I just don’t know cpp

crisp shard
fair latch
#

In dota, even 1% packet lost freezes the game

crisp shard
fair latch
#

Lost information will lead to desync imo

past flicker
fair latch
#

Default template shouldnt rubber band even with 200 ms.

lucid badger
#

If I have an Object that is Replicated but a Property on it that is not replicated, if I make changes to that Property before replicating the object itself to a client, does the client see those changes? Thinkge

#

Does the state of those values at the time of replication get replicated, or does it just use class defaults?

#

I know it won't get later updates

#

But what about prior updates Thinkge

crisp shard
lucid badger
#

Put another way: Do I need to bother replicating values that DO change after construction, but will never change after replication? Thinkge

fair latch
lucid badger
#

Okay I tested and it doesn't work, which I figured

#

You DO need to replicate those values, prob that initial only is good though

hollow swallow
#

can an actor update a variable on the gamestate?

#

or will i have to go from the actor, to my player controller, then server command to do it?

vague tangle
#

hello. I've been calling serverRPC and multicastRPC from a character owned by a playercontrol, but the multicastRPC is not working on the client. Does anyone have any clue if there is something wrong, I'm looking for help. ;_;

AOnVRCharacter::AOnVRCharacter()
{
    PrimaryActorTick.bCanEverTick = true;
    SetReplicates(true);
    //skip...
}
void AOnVRCharacter::BeginPlay()
{
    Super::BeginPlay();
        //...
    if (!HasAuthority())
    {
        ServerRequestStartTime();
    }
    //...
}
UFUNCTION(Server, Reliable)
void AOnVRCharacter::ServerRequestStartTime_Implementation()
{
    UNavyGISubsystem* ServerGISubsystem = GetGameInstance()->GetSubsystem<UNavyGISubsystem>();
    if (ServerGISubsystem)
    {        MultiSetStartTimeFromServer(ServerGISubsystem->GetStartTimeForLog());
    }
}
UFUNCTION(NetMulticast, Reliable)
void AOnVRCharacter::MultiSetStartTimeFromServer_Implementation(const FDateTime StartTime)
{
    if (!HasAuthority())
    {
        UNavyGameInstance* ClientNavyGI = Cast<UNavyGameInstance>(GetGameInstance());
        UNavyGISubsystem* ClientGISubsystem = ClientNavyGI->GetSubsystem<UNavyGISubsystem>();
        if (ClientGISubsystem)
        {
            ClientGISubsystem->SetStartTimeForLog(StartTime);
            ClientNavyGI->WriteLogUsingGISubsystem(true, OutputLog);
        }
    }    
}
thin stratus
thin stratus
thin stratus
vague tangle
thin stratus
#

The multicast would work. But the server RPC was dropped I guess

thin stratus
#

Some games like overwatch send updates more often for movement when packages are lost, but in theory even that is over the top.

vague tangle
# thin stratus The multicast would work. But the server RPC was dropped I guess

In fact, when I experimented with logging code in my serverRPC and multicastRPC, I saw that the serverRPC was logged, but the multicastRPC was not, so I was very curious as to why only the serverRPC was working.

void AOnVRCharacter::ServerRequestStartTime_Implementation()
{
    UNavyGISubsystem* ServerGISubsystem = GetGameInstance()->GetSubsystem<UNavyGISubsystem>();
    if (ServerGISubsystem)
    {
        FString OutputLog = FString::Printf(TEXT("ServerRequestStartTime_Implementation() after:%lld"), ServerGISubsystem->GetStartTimeForLog().GetTicks()); //@
        Logger->WriteLogToOnlyMe(OutputLog);

        MultiSetStartTimeFromServer(ServerGISubsystem->GetStartTimeForLog());
    }
}

void AOnVRCharacter::MultiSetStartTimeFromServer_Implementation(const FDateTime StartTime)
{
    if (!HasAuthority())
    {
        UNavyGameInstance* ClientNavyGI = Cast<UNavyGameInstance>(GetGameInstance());
        UNavyGISubsystem* ClientGISubsystem = ClientNavyGI->GetSubsystem<UNavyGISubsystem>();
        if (ClientGISubsystem)
        {
            ClientGISubsystem->SetStartTimeForLog(StartTime);
            FString OutputLog = FString::Printf(TEXT("MultiSetStartTimeFromServer: %lld"), ClientGISubsystem->GetStartTimeForLog().GetTicks());
            ClientNavyGI->WriteLogUsingGISubsystem(true, OutputLog);
        }
    }    
}
lucid badger
#

What's the go to way to replicate something that really needs to be a map? Thinkge

#

Only thing that comes to mind is maintaining a parallel list of pairs and replicating that, and reconstructing the map OnRep

#

Is there a better way? Hmmge

#

Wait, okay, technically, it doesn't need to be a map because it's at most ever like 11 elements, but god if it isn't gonna feel silly having to do an exhaustive search for the right 'key' every single access

#

So I could just accept it and do that too hmm

#

I guess I'll just do that SHRUG

chrome bay
#

Array is the answer, for that number of elements the different will be negligible

coarse patrol
#

hi guys have a basic doubt

i have an crawl movement, where animation of client is not visible to server, even the transition bool value is replicated.
Crawl state value is replicated, when i press crawl both server and client side works fyn, but when i move in crawl state,
Crawling movement animation is not replicated

so - isCrawling repicated - crawl idle animation work on both client and server
isMoving - replicated , works fyn for all different movement mode, but for crawl - animation is not replicated from client to server
anybody any idea or tips, how can i find a problem

normal valley
#

if one developer is running a source build of the engine and another is running stock launcher (but both are running say 5.3.2-release) can you play together over the network from the editor? we are getting missmatched network versions.
https://forums.unrealengine.com/t/network-version-and-determining-network-compatibility/572468
I found this, which to me implies there is a way to make it work, however I couldn't figure it out.

Epic Developer Community Forums

Network Version and Determining Network Compatibility Article written by Alex K. When connecting two instances of the Unreal Engine, there is an initial compatibility check performed during the handshake process to determine if the connection process should proceed. While there are later compatibility checks performed after connecting, such as ...

chrome bay
thin stratus
#
  1. You shouldn't play from the Editor
  2. The Network Version probably says no
chrome bay
#

FNetworkVersion::IsNetworkCompatibleOverride for instance

dusk pecan
#

Hey there, so I have a MainMenu, from which I load into my game scene, but the Input mapping doesnt work when loading from the MainMenu...when starting directly from the Gameplay scene it works...does anybody have an idea on why that happens?

nova wasp
#

you are going to get some nasty issues if they actually try to communicate with different setups but some changes are safe (the FNetworkVersion stuff)

thin stratus
#

I do have a question about this though. A customer of ours says that the Game doesn't seem to allow connecting to each other (ListenServer) with two different builds.
But the game still shows up in the Session results.

Now if I use the override console variable, it will not show up anymore and the connection obviously also fails.
I am a bit confused as to why they report that the game is showing up but not joinable due to that version.

I'm relatively sure teh same version is used for session filtering and rejecting the NMT_Hello or?

#

Also is there even something in that default setup that tracks builds?

#

The function seems like all values it uses to create the hashed string would be the same, no matter how often I build

#
    FString VersionString = FString::Printf(TEXT("%s %s, NetCL: %d, EngineNetVer: %d, GameNetVer: %d"),
        FApp::GetProjectName(),
        *FNetworkVersion::GetProjectVersion(),
        GetNetworkCompatibleChangelist(),
        FNetworkVersion::GetEngineNetworkProtocolVersion(),
        FNetworkVersion::GetGameNetworkProtocolVersion());
#

ProjectName wouldn't change.
ProjectVersion is 1.0.0 by default.
Not sure about the Changelist.
Engine and Game Prototcol Version shouldn't change.

#

Not sure how the changelist is set though

#

ProjectVersion would be pulled from ProjectSettings, but unless one changes that, it should be the same.

normal valley
#

@thin stratus why are saying to not play from the editor. so everytime we want to test internally we should make and distribute builds?

thin stratus
#

You can start the game as Standalone

normal valley
thin stratus
#

But you shouldn't start the game inside the Editor and use PIE to connect to another PIE

normal valley
#

oh why not?

thin stratus
#

Cause stuff can go wrong and break. Simply not adviced

#

Start standalone or package

normal valley
#

then what even is the point of starting a listen server or starting client where it spins up a dedicated server in the background?

thin stratus
#

Local testing

#

You can spin up a standalone Dedicated Server too via command line

#

But ultimately, one would package to properly test stuff

#

And then preferably automate that via build machine etc.

normal valley
#

Right, I guess in general I would have assumed this would be fine for quick and dirty tests

thin stratus
#

Standalone is fine for quick and dirty

#

Just not PIE to connect to outside of the Editor

normal valley
#

right, not what i expected!
is there a page somewhere that lists these practises :)?

half umbra
#

hi, Will checking how many people are in a given team and then replicating this value to each player to disable the widget be appropriate in GameState?

normal valley
#

Changelist is what I was running into with the source build. Not sure if it's helpful but from Engine/Build/build.version file

Source

    "MajorVersion": 5,
    "MinorVersion": 3,
    "PatchVersion": 2,
    "Changelist": 0,
    "CompatibleChangelist": 27405482,
    "IsLicenseeVersion": 0,
    "IsPromotedBuild": 0,
    "BranchName": "UE5"
}```

launcher build:

```{
    "MajorVersion": 5,
    "MinorVersion": 3,
    "PatchVersion": 2,
    "Changelist": 29314046,
    "CompatibleChangelist": 27405482,
    "IsLicenseeVersion": 0,
    "IsPromotedBuild": 1,
    "BranchName": "++UE5+Release-5.3"
}```
thin stratus
#

@chrome bay Do you happen to know if the Perforce Changelist Version of the Project itself is somehow used for the NetworkVersion?
Cause I can't really see how a Project otherwise would even have a different version, unless someone manually adjusts the ProjectVersion every time they build?

#

Well or using 2 different Engine builds of course

dusk pecan
#

Hey there, so I have a (advanced sessions) MainMenu, from which I load into (creating a session) my game scene, but the Input mapping doesnt work when loading from the MainMenu...when starting directly from the Gameplay scene it works...does anybody have an idea on why that happens?

thin stratus
#

Sounds like you have it set to UI Only in the MainMenu but never set it back?

thin stratus
# normal valley Changelist is what I was running into with the source build. Not sure if it's he...
public class BuildSettings : ModuleRules
{
    public BuildSettings(ReadOnlyTargetRules Target) : base(Target)
    {
        PrivateIncludePathModuleNames.Add("Core");

        bRequiresImplementModule = false;

        PrivateDefinitions.Add(string.Format("ENGINE_VERSION_MAJOR={0}", Target.Version.MajorVersion));
        PrivateDefinitions.Add(string.Format("ENGINE_VERSION_MINOR={0}", Target.Version.MinorVersion));
        PrivateDefinitions.Add(string.Format("ENGINE_VERSION_HOTFIX={0}", Target.Version.PatchVersion));
        PrivateDefinitions.Add(string.Format("ENGINE_IS_LICENSEE_VERSION={0}", Target.Version.IsLicenseeVersion? "true" : "false"));
        PrivateDefinitions.Add(string.Format("ENGINE_IS_PROMOTED_BUILD={0}", Target.Version.IsPromotedBuild? "true" : "false"));

        PrivateDefinitions.Add(string.Format("CURRENT_CHANGELIST={0}", Target.Version.Changelist));
        PrivateDefinitions.Add(string.Format("COMPATIBLE_CHANGELIST={0}", Target.Version.EffectiveCompatibleChangelist));

        PrivateDefinitions.Add(string.Format("BRANCH_NAME=\"{0}\"", Target.Version.BranchName));

        PrivateDefinitions.Add(string.Format("BUILD_VERSION=\"{0}\"", Target.BuildVersion));
    }
}

#

I mean they come from here

#

And I assume the Changelist(s) are from the Engine version

thin stratus
normal valley
thin stratus
#

I wonder if Steam builds (uploaded ones) are doing anything

#

But I wouldn't know why UE would notice the different version on connection but steam would still return the session result

#

😩

meager spade
#

Whats the best way to get actor classes loaded on client before they replicate, i am not sure what the best way to do this is

thin stratus
#

I get the feeling that the Customer saying that a game shows up but can't be connected due to version is not true.

meager spade
#

example, Player A picks a weapon up (WeapnItemDefinition), adds to inventory, server creates replicated actor

#

Player B will end up sync loading this actor, because it doesn't have the class loaded

#

thing is, sure i can load all weapon item definitions and switch all bundle states

thin stratus
#

Yeah that's how it usually goes

meager spade
#

but when you have 200 different weapons

thin stratus
#

(the sync loading)

meager spade
#

right but that be avoided if client B loaded the class prior to the actor being replicated

#

surely?

thin stratus
#

In theory, yes.

meager spade
#

i mean i know it works

#

cause if i play in editor, and stop and re-play in editor

#

i don't get the hitch

#

and there is no sync load happening (cause the class is loaded in memory)

#

which loops back to my original question, what is a way to ensure that clients have the needed class before an actor even replicates, cause this sync load hitch is extremely noticable

thin stratus
#

As far as I know, loading them upfront

#

Like, all of them.

meager spade
#

yeah but that is not really feasable

thin stratus
#

Not saying it is

meager spade
#

i am really suprised that replicated classes are not AsyncLoaded

#

i mean they dont need to happen the same frame a bunch comes in

thin stratus
#

I mean

#

There is AsyncLoading iirc

#

In

#

PackageMapClient.cpp

#

In FNetGUIDCache::GetObjectFromNetGUID

#

If it can't find the object

#

It does this

#
if ( Object == NULL && !CacheObjectPtr->bNoLoad )
    {
        if (bIsNetGUIDAuthority)
        {
            // Log when the server needs to re-load an object, it's probably due to a GC after initially loading as default guid
            UE_LOG(LogNetPackageMap, Warning, TEXT("GetObjectFromNetGUID: Server re-loading object (might have been GC'd). FullNetGUIDPath: %s"), *FullNetGUIDPath(NetGUID));
        }

        if ( bIsPackage )
        {
            // Async load the package if:
            //    1. We are actually a package
            //    2. We aren't already pending
            //    3. We're actually suppose to load (levels don't load here for example)
            //        (Refer to CanClientLoadObject, which is where we protect clients from trying to load levels)

            if ( ShouldAsyncLoad() )
            {
                if (!PendingAsyncLoadRequests.Contains(CacheObjectPtr->PathName))
                {
                    StartAsyncLoadingPackage(*CacheObjectPtr, NetGUID, false);
                    UE_LOG(LogNetPackageMap, Log, TEXT("GetObjectFromNetGUID: Async loading package. Path: %s, NetGUID: %s"), *CacheObjectPtr->PathName.ToString(), *NetGUID.ToString());
                }
                else
                {
                    ValidateAsyncLoadingPackage(*CacheObjectPtr, NetGUID);
                }

                // There is nothing else to do except wait on the delegate to tell us this package is done loading
                return NULL;
            }
            else
            {
                // Async loading disabled
                Object = LoadPackage( NULL, *CacheObjectPtr->PathName.ToString(), LOAD_None );
                SyncLoadedGUIDs.AddUnique(NetGUID);
            }
        }
        else
chrome bay
thin stratus
#

I have no clue tbh. I found where both Session and NMT_Hello get their Version from to compare, and I don't see how that could be different between Session and actual Connection.

chrome bay
#

If it's showing up I'd think the backend doesn't know to filter it out, is it steam? They have their own game network version in the engine.ini

thin stratus
#

We tried it too with just changing the game a bit and building again and we can still find and connect.
When changing the Buildversion via CVar, we can't find the game and thus also not join it.

#

A mix where it shows up but isn't joinable is nothing I can reproduce

#

Unless of course I manually connect via IP

thin stratus
#
bool FNetGUIDCache::ShouldAsyncLoad() const
{
    switch ( AsyncLoadMode )
    {
        case EAsyncLoadMode::UseCVar:        return CVarAllowAsyncLoading.GetValueOnAnyThread() > 0;
        case EAsyncLoadMode::ForceDisable:    return false;
        case EAsyncLoadMode::ForceEnable:    return true;
        default: ensureMsgf( false, TEXT( "Invalid AsyncLoadMode: %i" ), (int32)AsyncLoadMode ); return false;
    }
}
#

Try that?

#

Should be UseCVar by default

meager spade
#

Thanks

#

ill give it a try

#

also

#
static FAutoConsoleVariableRef CVarShareInitialCompareState(TEXT("net.ShareInitialCompareState"), GShareInitialCompareState,
    TEXT("If true and net.ShareShadowState is enabled, attempt to also share initial replication compares across connections."));
#

what is ShareInitialCompareState?

#

oh nvm

#
    {
        // See if we can re-use the work already done on a previous connection
        // Rules:
        // 1. We have replicated this actor at least once this frame
        // 2. This is not initial replication or we have done an initial replication this frame as well```
#

seems its an optimization to avoid doing recalc

thin stratus
#

Also I noticed now how the Join vs Find Version is different

#

Steam uses ONLY GetNetworkCompatibleChangelist()

#

While connecting uses the whole thing of ProjectName etc.

#

Means if the GetNetworkCompatibleChangelist() is the same for both builds, it would find the game, but if any of the other values are different, it wouldn't be able to join

#

Also, of course, Epic has code for BuildVersion etc. like at least twice if not 3 times or more in their code base

meager spade
#

we overrode that

thin stratus
#

With what

meager spade
#

networkversionoverride cvar

thin stratus
#

No i mean, what exactly are you using?

#

Cause I would be expecting that somewhere it should be using the CL of Perforce or similar.

#

I wouldn't know how else one would ensure that games build on different "versions" (Source Control versions making the most sense) can't connect.

meager spade
#

oh

#

we modify our ini before we build on our build machine

thin stratus
#

Yeah that would be easy enough, but this game doesn't have a Build Machine. It's a ListenServer based coop game and the customer doesn't have that automated

#

Hmpf

meager spade
#

we just do this

thin stratus
#

Right

meager spade
#

i mean, one thing you could do... hmm

thin stratus
#

I need to override two delegates fwiw

#

FNetworkVersion::GetLocalNetworkVersionOverride

#

That's for actual connection

#

Actually

#

There is only one

#

My god why is this so overcomplicated, Epic

#

Why is connecting us FNetworkVersion, but Sessions are using only GetNetworkCompatibleChangelist

#

What brain did come up with that

meager spade
#

where does session use GetNetworkCompatibleChangelist>?

#

inside GetBuildUniqueId ?

thin stratus
#

Yeah

#
        // Unique identifier of this build for compatibility
        Session->SessionSettings.BuildUniqueId = GetBuildUniqueId();
#

That happens in Steam's CreateSession function

meager spade
#

why does the ID change though

thin stratus
#

That can be set by:

  • CommandLine (BuildIdOverride)
  • ini file (bUseBuildIdOverride + BuildIdOverride)
#

The ID doesn't change

meager spade
#

a cooked build should have the same uniqueid

thin stratus
#

The problem is that the ID is the same, returning the Session, but the FNetworkVersion is not, stopping the connection.

#

Ideally, this would use the same version

meager spade
#

but why is that different?

thin stratus
#

Because FNetworkVersion uses more than just BuildID

meager spade
#

in a cooked build, they should all match though (if cooked ont he same machine)

thin stratus
#

It should even all match if not cooked on the same machine. As long as they use the same engine version

#

But this still allows to have two different versions...

#
FString VersionString = FString::Printf(TEXT("%s %s, NetCL: %d, EngineNetVer: %d, GameNetVer: %d"),
    FApp::GetProjectName(),
    *FNetworkVersion::GetProjectVersion(),
    GetNetworkCompatibleChangelist(),
    FNetworkVersion::GetEngineNetworkProtocolVersion(),
    FNetworkVersion::GetGameNetworkProtocolVersion());

CachedNetworkChecksum = FCrc::StrCrc32(*VersionString.ToLower());
#

This is Network Version's checksum

#

Which means you could change ProjectVersion

#

Which would cause the two builds to not connect

#

But since Sessions aren't using that, it would still find the session

#

Which is kinda mäh

meager spade
#
        FApp::GetProjectName(),
        *FNetworkVersion::GetProjectVersion(),
        GetNetworkCompatibleChangelist());``` 🤔
thin stratus
#

Can filter locally...

#

Yeah BuildID only uses GetNetworkCompatibleChangelist()

#

It doesn't rely on the rest

meager spade
#

looks like they changed it in UE5

#

o longer has NetVer and GameVer

lost inlet
#

If you're using a native source build, UGS populates that information through the SetVersion UAT job

thin stratus
#

Launcher Build. No UGS. No Source.

lost inlet
#

which buildgraph or invoking UAT manually can also do

thin stratus
#

No Automation.

#

Just plain up building the Client for ListenServer.

meager spade
#

you could add it to your cook thing though ?

#

i think cooker can run a UAT job

thin stratus
#

It should, cuase UGS doesn't do anything special, they just run the command line

#

Not sure where to grab the Perforce CL from though, guess I would need to check their wonderful docs

#

Doesn't overall change the fact that Connection and Session use different ways to build Versions

lost inlet
#

or just run p4 changes to get it

thin stratus
#

I've been using git for the majority of the last 1-2 years. So for me that's not "just", cause I simply don't know :P

#

But thanks for sharing, I will have a go at it

lost inlet
#

p4 changes -m1 #have should get it providing the environment has the workspace in it

lost tinsel
thin stratus
thin stratus
#

If you want that, use Standalone (not Play Standalone, but literally Standalone Game at the top)

lost tinsel
#

I didn't even know that was possible

thin stratus
#

The Net Mode stuff is for local testing

lost tinsel
#

sure enough, ty 🙂

flat night
#

hey thanks a lot!
I managed to get it working by making the setting of the Stick Vector a Server function!

#

I have a question, on calling ServerTravel, the Client's character on the Server gets destroyed (on the Client nothing happens). So when players are in a lobby and I click Start or if I restart the match after it's over, I can see the Client get destroyed and some FX play on top that I've added to the Destroy() function. Anyone had this issue before?

thin pilot
#

yo guys where do i put global events (event dispatchers) for a multiplayer game in unreal? in a game state, game mode or something else?

dusk pecan
#

Hey there, so I got a multiplayer game with advanced sessions and the problem is when the second player joins, the first one doesnt work anymore, any idea on why this happens or on how to fix it?

half umbra
#

hi, Should automatic team matching be done in GameMode?

crisp shard
hoary timber
#

as a Client, if I want to change a variable of an actor that the Client is not an owner of, do I need to use and RPC to change the variable on the Server, and then when it does change on the Server, it should replicate back to the client? Is that the usual approach?

thin stratus
hoary timber
true stream
#

Hi, what could be the reason why Im seeing only on server 2 prints of my tick event on playerController

#

in which one of those has like not initialized my playerController variables

#

as if Im running a duplicated dummy version, it seems.

#

(on client works fine)

#

construction script triggers also twice for the listen server, not sure if thats normal.

#

ok re-reading the compendium it mentions:

"A client's PlayerController only ever exists on their end, as well as on the server."

So I guess that explains that.

However shouldn't the tick event only fire on the playerController of that client?.

normal valley
true stream
#

Alright so after googling a bit it seems like I can use "isLocalController" but it seems a bit of a hack.

sweet sage
#

Can we enter a dungeon on unreal without loading using world composition? (multiplayer)

#

Can we load the map in background before entering dungeon

tardy quarry
#

@true stream your listen server acts as both a client and a server. Since it's a server, it has 2 player controllers (1 for each client). One of those is the listen server client's player controller (aka the local player controller), that's why you need that check. It's not a hack, the purpose of that function is to help you distinguish the listen server's local player controller from the others.

inner cove
#

Hey people, one question, do the restart player from player start (and the other restart player functions) work in multiplayer games or these are supposed to be used on single player only games?

tardy quarry
twin juniper
#

When using seamless travel, is there a way to delay the load of the final map, or otherwise control the duration that the transition map is loaded?

cerulean flax
#

Hi everybody. Sorry if this is wrong channel, don't know where to address this question.
Does anyone know any docs/tutorials/etc. about using Unreal Session API with Meta Oculus Platform?

latent nest
#

What’s the best way to make a game that’s multiplayer cross platform with pc and Xbox, and what documentation can I read and follow

#

Is playfab a good way to go?

queen escarp
#

How would u play Montages on NPC on MP ? is this correct ?

lucid badger
sinful tree
#

Apart from the CMC movement and using Gameplay Abilities within GAS which does have client prediction built in, I don't think there is anything else client predicted in Uneal so there is no "Unreal's client-side prediction" really.

Client side prediction == You're doing the thing on the client before the server checks/does it. That's all it is. You can allow a client to do something without having it do everything involved with that thing. So like, you could allow clients to swing their weapon so they get some kind of input response at which point you would send the RPC to the server as well requesting that you've swung your weapon, and you could even have it happen that the enemies visually appear like they got hit, but in reality the server would be the one that actually verifies if the hit should happen and perform the damage, and replicate the swing and hits to everyone else.

How complex you make it is really up to you. The harder part is rollback - how do you handle things that shouldn't have happened on the client.

#

I know it does, but I don't have a good way of answering that for you. #gameplay-ability-system would probably be the better place to ask.

dark edge
#

On a scale of 1 being single player and 10 being networked multiplayer, how hard do you think small LOCAL MULTIPLAYER ONLY platform fighter would be to pull off?

#

You still need to do the player specific stuff but don't gotta worry about replication or anything in couch co-op right?

sinful tree
#

11 being science based dragon open world MMO?

To answer the question, couch co-op would probably be a 2. You're absolutely right, no replication stuff involved, just handling the player specific stuff.

dark edge
#

That sounds like a dream, my brother in law wants to make a small project for when his buddies come over, he's a fighting game nerd and wants to dabble.

lucid badger
#

I guess you would still use multiple playercontrollers though hmm

#

But yeah there's nothing mind-bending about that

#

The replication stuff is like going from 2D space to 3D space

sinful tree
#

There can be additional complexities to local multiplayer - like if you do split screen stuff... I think it was LEGO Avengers had some crazy means of handling split screen that changed based on where the players were in relation to each other in the world.

dark edge
#

It's shared cam so that's no problem

lucid badger
#

Where it goes from shared fullscreen to seamlessly split screens

dark edge
#

just a dumbed down physics-driven Smash clone

lucid badger
#

I mean, it goes seamlessly, there would obviously be a seam after the transition

#

Yes shared camera local multiplayer is just about the simplest possible version of MP I can think of Thinkge short of just having one player controller with lots of bound buttons heh

#

If you can pull off all the other parts of making a platform fighter you can surely pull that off Okay

dark edge
#

you obv wouldn't render twice when not split but the naive implementation would do that

lucid badger
#

I daresay if you can pull off all the other parts of making your game, that even the more complicated "proper multiplayer" with replication and everything is quite approachable thanks to Unreal

dark edge
#

Yeah it depends on the design. I would kill for a great turn based or slow-paced project to work on, too bad all my ideas are hell to network.

queen escarp
#

@sinful treewanna shead some light on my question 🙂 ?

dark edge
dark edge
lucid badger
#

I went from like "The only networking code I ever wrote was a single RPC in a Valheim mod" to "My fps is now entirely cooperative with replication and everything" in about 9 days Okay Unreal makes this very easy on us

dark edge
#

Although you could just rpc the attack and seed or whatever, depends on where you want the data to cross the network

#

Attack -> choose montage -> Multicast
Everywhere -> Play Montage
That's the quick and dirty way to do it

lucid badger
#

So it was impressed upon me that multicast RPCs are like, rill bad. Really really bad. But are they bad enough that in a situation where I might need one, I'd be better off doing something corny like a Replicating boolean i.e. bDoTheThing and then OnRep that bool to achieve whatever code I'd have put in the multicast? hmm

queen escarp
#

@dark edge but there is no "notify begin" if i rpc or

dark edge
lucid badger
dark edge
#

is that built in?

lucid badger
queen escarp
#

what

#

no

#

this my custom event

dark edge
queen escarp
#

thats

dark edge
#

You'd repnotify stuff like MyEquippedItem since that's stateful

lucid badger
#

RepNotify is just the blueprint version of ReplicatedUsing right? hmm

dark edge
queen escarp
#

hm

dark edge
#

all you need to do is tell everyone (server included) "hey, we're doing the spin move now"

#

if not has authority, just don't do the logic for damage etc

queen escarp
#

well

#

@dark edge i mean how would u apply the dfamage in this sitt then ?

queen escarp
#

oh right ofc..

#

hm on all 3 outs tho :/ ?

dark edge
#

You might not have to do anything different, damage should already gate by authority

lucid badger
queen escarp
#

hm well its not working tho :/

lucid badger
#

That's stateful, but otherwise you'd just have ot use a replicated boolean and trigger the effects onrep

dark edge
dark edge
#

on all machines

queen escarp
#

yepp

#

only damage isent dealt

#

but i just noticed something

#

sec

#

the collision wasent put on Component replicates so the Linetrace missed

#

testing

#

hm still misses

dark edge
queen escarp
#

hm ok it worked before but now something broke its not hiting in standalone either

rain condor
#

How can i rep hand ik?

dark edge
#

send the client data to server, server replicates it out (or multicasts, depending)

lucid badger
#

In all my desperate searching I have found no answers: Is there some way, some ini file setting somewhere, to make the friggen client windows during PIE/SameInstance be a larger size?

#

It makes them so small I have to expand every. single. time. moon2SUFFER

#

I found that you can use a console command to set the window resolution but I couldn't find one to position them so they all end up stacked in the center of the screen moon2SUFFER

queen escarp
#

ok now i found it working on standalone

dark edge
#

replicate the data through your pawn just like any other state

rain condor
#

Got it, thx

#

i'll try

queen escarp
#

@dark edgehmm im gonna have to sleep on this one its kinda weird but ty so far 🙂

limber minnow
#

hey guys Im working in a multiplayer project, and I put some nodes into the gamemode class, they should be only in the server side, but if the client disconnects from the server somehow the client starts to run as server, and gets all the functions working from the game mode which should be only in the server

dark parcel
limber minnow
#

yeah I was looking for something that goes only in the server console, maybe some class

#

because the game mode seems not reliable

#

since its also inside the client and then client will have access to all the functions

#

and the ideia is, if the client looses the connection he wouldnt get any host

#

till the connection gets stabilished again

dark parcel
#

Game mode only exist on the server

#

You r not client anymore if u r the listen server

fossil spoke
#

Im on my phone so dont have the ability to show you where exactly.

snow trail
#

hello!
me and my (small) team are looking to create a smaller-scale MMO
we know how hard it is to achieve something like that which is why we are reducing our scope and doing a lot of preparation and research beforehand

one question we still havent found a proper answer to is, how suitable is unreal's default multiplayer system for MMOs?
i know it depends a lot on internet bandwidth and server hardware, but generally speaking, when does it start to be more demanding?
can it handle 1000 players in a server? 2000? 5000? or is the soft limit something closer to a couple hundred?

what would be the solution, if unreal multiplayer wouldnt be suitable then?
(ping me if you answer please! thanks in advance)

past flicker
snow trail
past flicker
# snow trail yeah, i suppose that makes sense whats primarily stuff that takes up a lot of ba...

not replicating some stuff like animations when theyre farther away
That's built into the relevance system, which has knobs you can tweak for distance, viewing angle, etc...

The less you replicate, the better. The less work the server has to do, the better. I always wondered why the combat in MMOs was so bad. After dabbling in game networking I know they didn't make autolock, autoattack, high cooldown combat for fun, but for optimization.

snow trail
past flicker
# snow trail interesting just one more question, thanks for being patient, is firing a lot of...

That's not something I have experience with, but I know networked physics is even more complicated. If you do your own approximate physics you can optimize in ways a raw flying projectile won't be. Even more optimized would be to not have a replicated projectile at all. As in, the server would just replicate the attack itself, then if successful you fake a projectile client side that doesn't actually impact gameplay serverside.

snow trail
fossil spoke
#

@snow trail Unreal is not designed for MMOs

#

You will need to either make large scale changes to the engine yourself or utilize 3rd party systems that manage this for you

dark edge
#

If you have to ask those questions, an MMO is 100% not in the cards.

snow trail
#

well, i've never worked with multiplayer this big before

dark edge
#

Depending on how M the MO is.

snow trail
dark edge
#

Have you ever worked on a published multiplayer title?

fossil spoke
#

You are best not to make an MMO

#

Or at the most try something similar to Ark Survival Evolved.

lost inlet
#

Well I've completed a couple of Blueprint tutorials, I think I'm ready to make an MMO now

snow trail
#

why ark specifically? whats the connection?

dark edge
fossil spoke
#

They also argue they are an MMO even though they just separate dedi servers

#

That only have 100 players

dark edge
#

or look at Fortnite. Fortnite is by the people who know the engine best. If you're trying to something more extreme than Fortnite then you're in uncharted waters.

snow trail
#

is something more like 200 players realistic enough then?

fossil spoke
#

No

dark edge
#

Depends on what they are doing. 200 people playing Chess is easy enough

lost inlet
#

1000 to 200 is not an appropriate correction based on what people were telling you lol

dark edge
#

If you don't have a dedicated professional Unreal programmer who knows what they're doing, you'll be lucky to get 10 people doing stuff.

lost inlet
#

Baby's first networked multiplayer I would have something much smaller in mind

fossil spoke
#

With your experience. Try for 50 max. That will be challenging.

lost inlet
#

2...4...maybe 8?

past flicker
#

Epic's own Fortnite Battle Royale starts each game with 100 connected players and about 50,000 replicated Actors.
Like I said, it all depends on what your characters and other actors are doing. Make a stripped down character class and see how clients you can connect. All you can do is experiment. Making an MMO is probably the hardest multiplayer to attempt and will require customization to the engine.

vagrant grail
#

I have a question related to multiplayer. I learned that RepNotifys are there to call a function when a replicated variable change its value and it calls this function both on the server and on the clients. But what if I want the code inside the RepNotify function to execute only on 1 specific client, or all but 1 specific client ?

Like I'm thinking about the famous example of the cupcake in the Networking Content Examples project where there's a cupcake in the player's hand, and was wondering how would you do to make the cupcake visible to only 1 player ? And another question on the same topic : How to make the cupcake visible to all except 1 player ?

dark edge
#

that's one approach

snow trail
#

alright, thanks guys
we'll adjust our current scope and see what we can do then

dark edge
#

"Adriel is holding Gun_3"
ok I'm Adriel, put it in the 1st person socket
I'm not Adriel, put it in the 3rd person socket

fossil spoke
dark edge
#

I wouldn't attempt an MMO if I had 100 million dollars.

vagrant grail
dark edge
#

ymmv for edge cases like AI but that's the general idea

past flicker
#

Everything must be extremely optimized, the servers are expensive, and at the end of the day you still need a fun game.

dark edge
#

The closest thing to an MMO you can do as an indie is a community hosted thing like Valheim or DayZ IMO

snow trail
dark edge
#

You don't want someone working for equity to be writing the code that can bug out and spin up $1M/mo worth of AWS instances

snow trail
#

ah and, are blueprints particularly worse than c++ in this situation?
doing most of the simpler stuff in blueprints would definetely help us as a small team

past flicker
#

Many of these "1000 player MMOs" are heavily instanced anyway. It's all an illusion spread out across multiple servers. Any game that actually gets 1000 players in one spot crumbles.

fossil spoke
dark edge
#

and it ticks at 1Hz

#

and the pawns are spheres

#

and runs on a supercomputer

past flicker
#

I honestly hate MMOs. You sacrifice so much just to get a bunch of players in one area when you could have less players and immensely more fun gameplay. It's literally choosing quantity over quality as a genre.

dark edge
#

If designed well (encouraging splitting up) they can be insanely fun, WoW was the most fun I ever had in a game before cross realm and flying mounts were a thing.

#

Starbase was the most fun I ever had for the month I played it before it died

past flicker
#

I hated every second of WoW all the way to 60, then the expansion came out to 70 and I quit. Starbase was amazing though. I honestly don't know how they came so close to making that work.

dark edge
#

They had incredible tech and an aweful game loop

snow trail
#

why did starbase fail?

dark edge
#

all they had to do was copy EVEs homework and it woulda been a home run

dark edge
# snow trail why did starbase fail?
  1. No reason to fight
  2. Too big of a playfield vs the ability to find anyone (3d space scales much higher than a 2d terrain
  3. No support for grouping
  4. Prioritized shiny new stuff instead of getting the fundamentals right
#

It had so much potential it actually makes me sick

snow trail
#

i see

past flicker
#

The tech was ambitious but buggy, not enough content, which lead to not enough players, which is the death of an MMO. Player count is so important. If people look your game up on steam and see only 100 people playing they won't give it a second look even if it's free.

dark edge
#

not doing the YOLOL thing but doing something more akin to WireMod

snow trail
#

their ship building reminds me a bit of space engineers tbh
and the idea of a persistent universe, of star citizen

#

i wonder if star citizen will actually be able to pull off whatever theyre trying to do with their new server meshing technology

dark edge
#

it was waaaaaay crazier than space engineers on the ship building side, but they also had some dumbass design ideas

#

bolts are just stupid

past flicker
#

Awesome. A game with their ship building, design, destruction, and physics, and actual stuff to do. Having stuff to do with your cool ship is what no game has achieved yet.

snow trail
#

bolts? you had to manually bolt stuff down?

dark edge
snow trail
#

sounds unnecessary lol

dark edge
#

they also didn't have a way to save designs you modified in the field, at least not before I quit

snow trail
#

well, the reviews on steam are terrible and its 35€ so doubt anyones playing it now

dark edge
#

If it was my game to design I would have never had the ship editor and instead made the system a tiny bit simpler and had a way to scan a ship and print it from the blueprint

past flicker
#

I actually kinda liked bolting things. I enjoy the fantasy of getting damaged out in space and having to bolt whatever scrap you have on hand to patch the ship.

past flicker
#

I can't believe they got dynamic voxel ship destruction replicated though. That's insane.

dark edge
#

the voxel stuff was a huge waste IMO

past flicker
#

That's my favorite feature!

dark edge
#

your ship already has 1000 parts, could have just destroyed parts or fractured them

past flicker
#

I wanted to go out into space and scrap ships with my saw. They were so close.

dark edge
#

I made an autopilot mining system and everything lol

snow trail
dark edge
#

yeah they had some fancy tech

#

the networking model was very interesting

#

basically ad-hoc p2p when not in a crowded area

#

with some sort of serverside validation I'd suppose

snow trail
#

p2p? isnt that like super slow in certain cases?

dark edge
#

eh i mean

#

not too bad

#

but basically when you were out in space alone you were simulating locally

#

when you get in relevency range of someone then one of you becomes a host

#

in big crowded areas it's probably dedicated hardware

#

but it was all seamless

snow trail
#

interesting

#

wonder how they transition all of that seamlessly

#

especially the p2p to dedicated transition

dark edge
#

I don't think it'd be that insane to do but the server validation would be a nightmare

snow trail
#

by the way, if you dont mind me asking, back on what we were talking before, how expensive would 50 players who can only exclusively move already be on the server?
would even that require optimization? how would you even optimize straight up movement

dark edge
#

50 would be heavy

snow trail
#

even if theyre just moving?

dark edge
#

go slap 50 people into the 1st person template and see how it does

snow trail
#

hmm

dark edge
#

I mean it'd work

#

but without a dedicated Unreal pro it'd be really rough

#

like PUBG on a really bad day rough

#

the CMC is pretty hefty

snow trail
#

what would a pro look into doing to optimize that situation?

dark edge
#

idk I'm not a pro

#

I mean if you don't have anyone on the team who's worked in programming on a real published game then I'd not bet on it

fossil spoke
#

@snow trail Its difficult for anyone to give you definitive answers on performance. Since your game and your abilities are factors that only you can profile for

#

You need to profile the scenarios you want to try and support

#

You need to profile your game.

#

To find out what you can achieve.

snow trail
#

im comfortable with doing so, i just wanted to try and find a baseline to compare to

dark edge
#

That's like asking "How hard is it to race in the 24 hours of LeMans? If that's too hard, how bout the 12 hour version?"
And I'm asking "Has anyone on your team raced before? Do you guys have a car, a pit crew, money?"

fossil spoke
#

There is no baseline that wouldnt be a vauge answer thats likely not applicable anyway

dark edge
#

Start with autocross

fossil spoke
#

You develop the baseline

#

Game dev is not easy. There are no easy answers.

snow trail
snow trail
fossil spoke
#

If you have little experience. Go and get some. Stop worrying about these issues and just go and learn how to build a simple multiplayer experience

dark edge
snow trail
#

that is a good point

fossil spoke
#

You seem to much worried about the theory and not enough on actually practicing.

snow trail
#

you are correct

fossil spoke
#

Go and practice

#

Go and learn how to connect 2 players together in a session and have them both be able to open/close a door.

#

And have that correctly synced.

#

This simple example touches a large bredth of networking concepts

snow trail
#

i guess ill try that first then

#

thank you both!

past flicker
#

This is the reason my character was getting corrected every frame. Turning them off allows my character (mostly default thirdperson template) to smoothly replicate to clients as expected. Was this because CMC replication was conflicting? Guess I shouldn't just click checkboxes I don't understand.

fossil spoke
#

lol

snow trail
#

isnt there a better way to do this?

fossil spoke
#

Better way to do what?

dark edge
past flicker
dark edge
#

repnotify

fossil spoke
#

@dark edge Why is that better.

#

(This is for his benefit not mine)

dark edge
# fossil spoke <@127902729677963264> Why is that better.

Because a door being open or not is state, if you multicast, then a missed update (network conditions, late join, outside of relevency range) would end up with state being out of sync between server and client.

OnRep / RepNotify is a function that runs whenever a variable is changed(BP) or replicated(CPP), so you can do something in response to the new state.

#

Basically what you want to sync is "is the door open or not" not "The event of opening the door just happened"

fossil spoke
#

@snow trail Have you read the Network Compendium?

#

It is the first pinned message in this channel.

snow trail
#

ill check it out

fossil spoke
#

Please do, read it thoroughly

fossil spoke
#

Read it twice

#

Even 3 times

snow trail
#

alright

dark edge
#

hell I had the venn diagram from it as my desktop background for a while

snow trail
#

wait, so if my understanding is correct, playerstates are just completely replicated by default?

fossil spoke
#

Yes

snow trail
#

convenient

dark edge
#

What do you mean by "completely"?

snow trail
#

hold on, so for every event i need to call from the server, it needs to be from within an actor the client owns?
meaning, they should be mostly just be in the player controller and character?

fossil spoke
#

RPCs you want to call from Client to Server, need to come from an Actor that has an NetOwningConnection owner.

#

A PlayerController is a NetOwningConnection.

#

A Pawn that is possessed by that PC has the PC as its owner.

#

Therefore that Pawn can call RPCs from Client to Server.

#

If that Pawn owns an Actor like say a Weapon, that Weapon can call RPCs from Client to Server.

#

Because it has an owner chain that results in a NetOwningConnection (the PlayerController, via the Pawn).

#

The Server can call an RPC on Clients from whatever it likes, since it has full authority over all Actors.

snow trail
#

right, makes sense

vivid seal
#

Anyone used FInstancedStructs in multiplayer? When I try to RPC an array of them from client to server, the server ends up with nothing in the array. Is there some NetSerialize stuff I need to do for that to work? I'm making the structs in BP, confirming that they have the correct data, then sending them. If I do this as the server it works (obviously, I'm not actually RPCing since its Server->Server), but as a client I get nothing

#

upon further inspection, it looks like the commit that implements NetSerialize for FInstancedStruct might be in a later engine version than what I'm using, because that function doesn't exist in FInstancedStruct in 5.1. Anyone know what version I need to upgrade to?

fossil spoke
#

@vivid seal 5.3 is stable for InstancedStructs

vivid seal
#

thanks, guess i gotta upgrade

snow trail
#

interesting, i tried to spawn a projectile and noticed it was being spawned twice
apparently if you set the projectile itself to Replicate, you dont need to call the multicast, you can just spawn it on the server directly and it will replicate automatically

fossil spoke
#

Correct, for Replicated Actors that are Spawned by the Server, you do not need to create a local copy of that Actor, it will be created automatically for you when the Actor Channel is opened on the Client.

dark parcel
#

@snow trail I will suggest to scrap the idea of mmo unless you are a big studio and have millions of dollars (and you know what Ur doing)

snow trail
#

you really did not have to edit in that last part xDD

#

but yeah, its okay
we'll keep the mmo part out of scope
the game still needs small lobbies for multiplayer though, so i'll be learning it anyways

dark parcel
#

Afaik No mmo made with unreal engine use ue replication system

#

U can't even have multi world out of the box in UE

#

These all require engine modification and many engineering from scratch

#

You can prob make do with a 60 to 100 players Max in a single map. That's around how many players there are in fortnite

crisp shard
#

wait, i unchecked it for the capsule component as well and it did work

#

but not a clue why i should be NOT replicating it?

#

i have basically nothing replicated (component wise) now

#

is this actually how it's suppose to be? (anyone could help me on that)

lucid badger
latent nest
#

If I use steam subsystem, will that be compatible with Xbox

fossil spoke
latent nest
#

How should I do it then

#

Playfab?

#

I know games have steam as there like multiplayer but are cross platform with Xbox

#

How do they do that

fossil spoke
#

A platform agnostic server deployment system is ideal if you are going crossplatform for dedicated servers.

latent nest
#

Alright I will look into it, thank you very much

fossil spoke
latent nest
lucid badger
#

Dude they still can't make it easy on me moon2PAIN

#

Every single time the editor reopens

#

It just picks at a fucking random a new resolution for the main pie window. Only the client window stays same size for some reason

#

this setting just changes itself 🙂

#

Client window at least says same size thankfully moon2SUFFER

lucid badger
#

So putting Always Center fixes the size issue, but then of course it's in the wrong place. So I fixed that with this monstrosity in PlayerController BeginPlay smh

if (HasAuthority() && GIsEditor && GWorld && GWorld->IsPlayInEditor() && GEngine && GEngine->GameViewport)
{
  GEngine->GameViewport->GetWindow()->MoveWindowTo(FVector2D(364, 314));
}
queen comet
#

Hey guys, I'm so desperate, I have posted this everywhere and got nada. Has anyone tested the baseline ping when playing locally with a dedicated server? If I run both client and the server on a single machine the lowest ping that I can get is 8ms. This is both in-editor and also with packaged builds. I have tried this on a different machine, same result. I would assume the local ping would be 0. If i set a manual pktlag, this 8ms gets added to it. Has anyone experienced this? I'd hate to think my budget starts at 8ms. Just also to be clear, this is on a blank map that runs at 600fps.

cursive steeple
# queen comet Hey guys, I'm so desperate, I have posted this everywhere and got nada. Has any...

Now I don't know the exact way things are routed, but in my mind a 0ms ping would be pretty unreasonable to expect, as that'd mean you're sending and receiving data in the same frame, and I'd assume in multiplayer there are just things that are async by nature, especially when you have two different processes (game+d.server) ticking at different times, some delays just seem inevitable, at least to me. Also, I'm still trying to figure out why this is such a big deal, especially that in a real environment, that +8ms doesn't seem like something that should break your game. Like what's the feature that works with 150ms but doesn't with 158? Would love to learn about the issues this is actually causing to you.

rain condor
#

How can i replicate a letf hand transform?

queen comet
# cursive steeple Now I don't know the exact way things are routed, but in my mind a 0ms ping woul...

yeah i hear what you're saying but the ping is not frame dependent. this is obvious by the fact that the default server tick rate is 30 which would induce a 33ms baseline ping, or 15ms if we split frames between client and server. secondly if physics uses substepping i find it inconceivable that the netcode does not. As I said in the example the test I did was running at 600fps, so if there is some relationship to the frame as you suggest then this would be 2ms and not 8. Why does it matter? Well if a game hopes to achieve a 30ms ping for it's players and a third of that is lost to the engine that's a big deal. And yes, my features will work fine. But I need to understand if this is normal and rule out any config issues etc. What I'm really looking for is for someone to say "yes this is the case for me too" or "no i don't have that". The fact that nobody has tested this or even noticed it is bizarre to me.

cursive steeple
rain condor
#

How can i replicate this?

#

I need replicate lefthandik transform

green delta
#

is multiplayer having cache issues in 5.3?

#

when testing in PIE, a lot of times stuff doesn't work. I have to restart the editor and then it works

queen comet
twin juniper
#

Is there a function that can be used to get whether the local client is a host of the game or a client within a static function?

queen comet
# cursive steeple thanks I'll appreciate

ok, you were right, it is the tick rate. what was confusing me was a little quirk that when running in editor the server tick rate syncs with the client tick rate which is much higher (100) leading to a lower ping. this was the part that i couldn't get my head around, why it was showing 8ms, not 33ms if it was server tick dependent. so yeah, i just went down a rabbit hole, but i learned a thing or two 🙂 thanks for the help. the network insights was very helpful in being able to visualize the fame vs tick relationship

cursive steeple
manic prairie
#

I have an issue where i have an inventory component and i have a delegate on it. when i host a session as a listen server everything works fine but when someone joins the game the host's delegate gets unbound and i have no clue why it is happening

dark edge
rain condor
ashen plume
#

with play mode set to 2 clients, they can both see each others line traces, which exec after "Switch has authority", is this the server showing the debug?

setting play to listen server, it acts as expected, the client doesnt see anything