#multiplayer

1 messages · Page 160 of 1

nova wasp
#

this guy has been in the industry for 10 years so I can safely say he knows more than me lol

vagrant grail
#

I understand, but if there are so many bad tutorials that means Epic didn't make their job properly at teaching their engine / their documentation isn't good enough or well presented engouh, and that's really sad 😦

hollow eagle
#

no one ever claimed they did a good job

#

it's just how things are

nova wasp
#

yeah the epic Mass video tutorial mixes up one specific thing iirc (mostly terminology)

#

that's one reason video tutorials can suck: editing them to fix mistakes is almost infeasible

vagrant grail
hollow eagle
#

¯_(ツ)_/¯

nova wasp
#

we are not their business model

hollow eagle
#

not really a priority for them

vagrant grail
#

But this guy isn't doing stuff about unreal 🤔

nova wasp
#

yeah, I said that

vagrant grail
nova wasp
#

it's a great channel for how to approach gamedev problems in general

#

that's about real world examples and experience

#

trying to imagine what the video content of my unreal channel would be...

"yo what's up guys, it's ya boy Megafunk here with another 4 hour stream of me beating third party ecs libraries into the engine with my clenched fists while screaming "

I don't think I'm a good measure of whats "sensible" I guess... If I made examples of how to make a complete game feature it would probably be laced with "this won't scale to 100 of these ever, be warned"

vagrant grail
#

So people get the full things available for each class

#

and understand how ot use those properly

nova wasp
#

I think it has to have some context, because just going through one actor in isolation seems really rote

#

I think it could be some "let's make a modern unreal shootergame" while talking about how the different parts of the framework relate and what their limits are etc

#

there's just too much dumb trivia

#

I think it would be interesting to show like, an example of a BROKEN project and how to fix it etc to show people how a more experience unreal user actually pushes buttons to reason about problems

vagrant grail
#

The issue with that is people always start tutorials series but stop before episode 10 somehow, instead of going all the way in depth and reach episode 99 and 100

vagrant grail
#

To me it's better to see someone do things step by step and follow and understand by doing the same, then fixing an existing code

#

But that would be a nice idea for a separate series called "Fix my Game" or something like that

nova wasp
#

like intentionally making a mistake and showing "here's what you can try to see what's happening"

vagrant grail
nova wasp
#

stuff like that is better off as like, a blog post

#

like Wizardcells's page has all kinds of things like that

vagrant grail
nova wasp
#

perhaps some kind of auto reader browser extension would help make it easier

#

you are missing out if you are ignoring unreal blog posts, especially the ones pinned in here

#

(not that you said you are)

dark parcel
#

a video that hand hold you to a complete game is probably non existence

vagrant grail
dark parcel
#

"I'm looking for videos that explain to me things in the engine in depth and how to properly use those"

This is kinda broad

#

gotta be more specific

#

to make a working game, you probably can just start with knowing how to use variables, functions, event dispatcher, blueprint coms, references, structs, arrays, etc

#

The rest is looking at sample project

#

then reading for advance stuff

#

I'm learning too, all I can say is I have to unlearn soo many things from youtube

#

there are still like 1% videos that helped me but the rest are garbage tbh and because they want to make money with views not show you the proper way which take a lot of time

vagrant grail
vagrant grail
vagrant grail
# dark parcel hmm wat about it?

I didn't know that method existed and the guy I followed on youtube for his tutorial saved player controllers in an array when the player joins, and removes it from the array when the player leaves. So neither him or I knwed about that method because I never saw someone showing it or talking about it

dark parcel
#

what ever the opinion on them, I can only say that you can avoid most of videos in youtube. Especially multiplayer one.
Just read and watch 1 - 2 videos from the pinned section

dark parcel
#

U just need to open game mode and read what's available ot you

#

it's all written

vagrant grail
#

I think there's only 1 perso who did something as close as I want, is Mathew Wadstein where he makes 1 video per node where he explains to you briefly what it is and he shows you an example of how to use it.

dark parcel
#

there are like 10 k lines, no one will go to every single one

#

but u just open the source code

#

u can read tens of function in under a min and get the general idea

#

can't wait for people to make a video that goes over them which probably would never happend

vagrant grail
#

Or at least make a nice documentation, and I hope I can do that one day but right now my knowledge is weak 😬

#

so when I get better I hope I can do that

dark parcel
#

the source code is a nice documentation. It tells what the function return/do

#

can't be more helpful than it is

cedar finch
#

I know this has been discussed in the past but It still bugs me, which is character movement on a moving base. So moving platforms, vehicles, etc.
I know nobody knows an easy solution without some prediction logic, but does anyone have any ideas for how to fake it? I just want to make a 4 player coop pirate game. There has to be a way to fake it whether that be some sort of way to disable replication and then just sync it back when players leave the boat or something. I don't need a absolutely perfect replicated ship because players are not fighting each other. I need smooth movement and jumping but it always feels off.

Anyways, if anyone has some fun hacky ideas, I'm all ears.

glad robin
# cedar finch I know this has been discussed in the past but It still bugs me, which is charac...

I have no idea if it would work/help but the other day someone was having issues with the clients on moving platform jumping and getting thrown around and the next day I saw in the UCharacterMovementComponent there was a bServerAcceptClientAuthoritativePosition which " If true, and server does not detect client position error, server will copy the client movement location/velocity/etc after simulating the move. This can be useful for short bursts of movement that are difficult to sync over the network....". I thought that could maybe help but there was no follow up and I didn't try in my project aha. The stuff around it was also related so maybe check that out.

cedar finch
#

Thanks. I did play around with that and it helps a lot. It helps with the teleporting corrections from the server when jumping, etc. But there are still some issues with jumping while on board a moving object. I was just using a simple moving platform that goes from point A to B back and forth and you can't really jump in the direction that the platform is moving. It's like the velocity or momentum or whatever is fighting you. I mean that's probably realistic just like real life but it's not a good feeling in a video game.

#

I tried checking and unchecking the impart velocity options but nothing changed it. So a real world example would be if you were standing on top of a moving vehicle such as a train, and you try to jump forward while it's going forward, You can't make any progress 🤣

plush mauve
#

Wondering if anyone knows of any information on server meshing with UE games (for large populations). I know there's a couple of examples of big games that use it, however they consider it proprietary information so it's not publicly available. Is there anything that is available for us ordinary developers?

glad robin
#

So I am trying to clean up my game mode and I now have a struct:
FUGAGolfer() which holds the Controller*, Character*, Status in current level; stuff I use a lot in the game mode.
But I thought I remembered reading that there was an issue with pointers in structs for the garbage collection. Anyone know if I am imagining? In the setting functions for the pointer members I just subscribe to their OnDestroyed() delegate and from there clear the pointers. Is this neccesary and ok to handle this way?

thin stratus
#

The UObject pointers in your struct that is

glad robin
#

I found where I thought I read and it said: "By marking a USTRUCT or USTRUCT array as UPROPERTY() and marking any UObject / AActor members as UPROPERTY(), you are protected from dangling pointer crashes" .... "However you must also clear ustructs you no longer need if they have pointers to UObjects if you ever want GC to be able garbage collect those UObjects." so I thought this meant UPROPERTY() wouldn't be sufficient
(Source: https://unreal.gg-labs.com/wiki-archives/macros-and-data-types/structs-ustructs-theyre-awesome )

Guide on using USTRUCTS by Rama the legend

thin stratus
#

You can mark them as weakptr fwiw if you just want to hold a pointer but not stop them from GC

#

You still need to remove the struct from your array though

#

So the callback for that part is probably needed

glad robin
#

Oki I think I understand. I always consider using weak pointer but then second guess myself and don't do it haha

thin stratus
glad robin
#

Yea was just reading more into them. Going to keep it in mind when I review all this weeks work tomorrow.

urban moth
#

Regarding mass mp game. Or just a game with few players but 300+ simulated actors. On which bandwidth you guys aim? 10kB/s per connection? More? Less?

#

i kinda don't get how they did StarCraft 1. Consider internet connection 20years ago and 400 moving units! Even in the very low update budget let's say 1 Netframe/s it must somehow transmit 400x10B(at least)x8 players. Which is 32kB/s out traffic from server. And i dont think they updated position once a frame only😱

fossil spoke
#

They will typically send commands across the network and then execute them locally in a deterministic manner.

nova wasp
#

you send where the player told units to go, and they go the same place on each side

#

to put it simply

fossil spoke
#

Yep

nova wasp
#

"lockstep determinism" is the term I think most use

fossil spoke
#

So they aren’t constantly updating things like transforms across the network

nova wasp
#

there are RTS games that just snapshot replicate though

#

but you don't send updates literally every frame

#

and they are probably quantized a lot

fossil spoke
#

If I was building an RTS. Unreal wouldnt be my first choice.

nova wasp
#

certainly not, but you could write a simple rts engine on top of it

#

just bonk the data over to regular unreal components/primitives to render or something faster if need be

urban moth
#

Yeah, but we have what we have🙂 so we have to cope with ue somehow. I understand that I can update group only but it doesn't help. Just remember micro management of unit in SC or when one unit attack another from a group. So update group position won't save the day 🙁

frigid fox
#

Hi everyone. I currently develop a multiplayer co op game on unreal engine and I have this function for the inventory system. Everything works perfectly until I call this function from a chest actor in the map. When I call this function from chest's inventory component, on client won't work. Is there anyone who can help me about this?

#

even server function doesn't work as well on client idk why

glad robin
frigid fox
#

this function is called from onDrop function of a widget. It works but server function doesn't work on client (can't call the server function I guess)

sacred kraken
#

I am making multiplayer snake for learning reasons. I am primarily looking at a couple of things:

  • Overlap events (pickups). How can I make it so that this is validated, instead of the client saying "I picked this up, pinky promise".
  • Maintaining a player's score. Where should I store this but also where do I set it? I want it replicated to everyone, but I only want the server to write to it.
  • And lastly, probably a combination of the other two, where do I put the overlap logic and subsequent impact on the game (game mode? Since it's a win condition)
urban moth
sacred kraken
#

I have a custom event set to run on server with an autority check on it, and I call it from the overlap event.

#

Is that ridiculously overcomplicated or the way to go?

viscid monolith
#

Hi, is it a good idea, to use actor for replication of third party structure using custom net serialization? Are there any ways to send custom network packets?

thin stratus
#

It's enough to lock it with ServerAuth or similar

#

No RPC needed

sacred kraken
#

Oh, the authority check?

thin stratus
#

jop

thin stratus
thin stratus
thin stratus
sacred kraken
thin stratus
#

No

#

Never

#

That's a base rule

#

Client setting values will never sync back

sacred kraken
#

Ooooh

frigid fox
thin stratus
sacred kraken
#

You need to set it specifically on the server? That explains so much

thin stratus
#

Cause for SetOwner you need to be on the Server @frigid fox
And if you are on the Server, why do you need the RPC? :D

#

And if that Chest is in the Map, then why does a Client own it?

#

If think what you are missing is some sort of "InventoryManager" Component that sits on the PlayerController and routes RPCs

#

So you can call Server_OnDrop(InventoryComponent) on that Client Owned Manager Component

#

And that ManagerComponent then does InventoryComponent->OnDrop

frigid fox
thin stratus
#

What if two players interact with it?

#

Is that forbidden in your setup?

frigid fox
frigid fox
thin stratus
# frigid fox yeah

Alright, then you might be safe. If not, then you will have to think about routing the RPCs. Just trying to make sure you aren't coding yourself into a corner.

thin stratus
#

Cause only then it works with the SetOwner stuff

frigid fox
#

😅 yes make sense

strange zinc
#

Is there a way to package a multiplayer game with a dummy test server. (Like the preview in the editor itself)

strange zinc
thin stratus
#

There is no "dummy server" fwiw

strange zinc
#

(in single player, no actual multiplayer thing is done yet)

thin stratus
#

DedicatedServer, by definition, have no UI

strange zinc
#

All the logic of the game works just no UI. I need to send it to a friend and I want him to be able to see that UI. What is the simplest solution to the problem?

thin stratus
#

I have a hard time answering this, cause what you write doesn't make enough sense to actually understand the problem

#

If you want to send the GameClient to your friend, you can package it and do so

#

There is no Dummy Server

#

If your game uses DedicatedServers, then you need to package and send/host that one too

#

You never even answered if it does

strange zinc
thin stratus
#

Then that's a bug in your game

strange zinc
thin stratus
#

What is to the left of this

strange zinc
thin stratus
#

So that's in the PlayerController

strange zinc
#

yes

thin stratus
#

If that's the intended code flow, then you are indeed expecting a DedicatedServer and player's themselves can't be a ListenServer but only connect to a Dedicated one as a Client

#

Is that correct?

#

I assume you are testing the game in Editor via "Play as Client"?

strange zinc
strange zinc
thin stratus
#

If your friend has no access to UE and the project, then you need to also package a DedicatedServer

#

And either send that to him so he can connect to it locally, or host it and make sure he can connect to it

#

To package a DedicatedServer you need a Source Build

strange zinc
thin stratus
#

Hosting Locally, in terms of DedicatedServer, means he starts the Server locally on his PC

thin stratus
#

If he also doesn't open ports, the only he can connect to it though

strange zinc
thin stratus
#

Right, yeah so if you don't support actual Singeplayer, then you gotta package a DedicatedServer and send that one too

strange zinc
thin stratus
#

Depends on what you call simple.

#

DedicatedServers require a Source Build

#

So not the one you downloaded from the Epic Games Launcher

#

You will need to download the one from GitHub, then download all the requirements (follow its tutorial) and build it via VisualStudio for example

thin stratus
#

But you require this anyway if your goal is to use Dedicated Servers

#

If the rest of your game works without being connected to a Server

#

Then there might be an easier option

#

Which is changing your UI code to show even for singleplayer

strange zinc
thin stratus
#

And DedicatedServers are a must?

strange zinc
#

I will clone my current project and chnage the logic so widgets show on singleplayer. Is that what I have to do?

thin stratus
#

I would just change it in general

#

No reason to clone a project

#

Just change the "HasAuthority" to "IsLocalPlayerController + Branch"

#

True -> Add UI

strange zinc
#

alright, sec

strange zinc
thin stratus
#

Yop

strange zinc
#

Thank you so much for your help and time, it really means a lot!

thin stratus
#

No worries

strange zinc
thin stratus
#

That makes no sense, no

#

You can just leave it the way you changed it

#

That works for either

cyan bane
#

does "Start Session" turn a standalone game into multiplayer? Or do i still need to do something like "open mapname?listen"?

thin stratus
#

Could you tell us what "Start Session" we are talking about?

cyan bane
#

Sorry I meant "Create Session" that exists in the player controller

thin stratus
#

CreateSession can be called in many places, but no, this does not turn the game into Multiplayer

#

Sessions and the Multiplayer aspect of your Game are two different concepts that work together.

#

Your Game can be a Multiplayer Game, without a Session.
You can also have a Session without being a Multiplayer Game (although this one doesn't make too much sense).

Most of the time you want both, which is Creating Session and then turning your Game into Multiplayer Game.

#

Multiplayer Game here means that your Player opens a level with ?listen, effectively becoming a ListenServer.

cyan bane
#

Oh ok, I was trying to figure out how to turn a standalone game into a listen server without reloading the map.

thin stratus
#

The Session part is just a system that helps your players to discover online games.

cyan bane
#

Oh ok :/ Well thanks!

empty briar
#

I'm taking an online udemy course and I'm trying to apply it to my situation. Players should be able to spawn a shield (actor) whenever they press a button. In the shield actor BP I've set replicates and replicate movement on. This didn't work... I learnt that replication needs to be run by the server.

The course specifically states that all spawning should happen in the gamemode blueprint and the GM is always run on the server.

So my idea is when a player spawns a shield, the pawn BP would call a function in the gamemode BP which would then call a shield spawn function in the pawn BP but since it's being called from gamemode it will be run from the server.

I just want to confirm my understanding because this all seems kind of backwards but this is roughly what was shown in the course I'm taking.

gloomy tiger
# empty briar I'm taking an online udemy course and I'm trying to apply it to my situation. Pl...
  1. Spawning can happen wherever you want, server or clients - it depends on your needs. But yes, if you want an Actor that exists on all clients and it's a consistent instance, then yes, you'd need to do it in the server domain.
  2. No, you don't need to spawn things in the GameMode. It was advised as such probably b/c the GameMode is guaranteed to only exist on the server, so it wouldn't lead to confusion, but should is a strong word.

To give you an alternate way to demonstrate spawn doesn't have to happen on GameMode: you can create an RPC to ask the server to spawn the shield for you virtually in an Actor that both the client and the server owns: PlayerController, for example, or PlayerState. I am not saying its ideal, I am saying its possible.

empty briar
gloomy tiger
empty briar
gloomy tiger
#

So, "as long as PlayerPawn is owned by a remote"

#

And when I say the word "owned", I mean, when you call the SpawnActor function (in Blueprints), there's one parameter called Owner, and that's what I am talking about.

#

I don't know the process you are going through when spawning the Pawns of your players, but chances are high they are already owned by your remotes/clients. So all you have to do is calling a Server RPC on the PlayerPawn class itself, and inside this RPC, you call the SpawnActor to spawn your shield.

empty briar
#

Reading the unreal docs on RPCs it says it's for unreliable events and my spawn is integral to the game so it needs to be reliable.

gloomy tiger
empty briar
gloomy tiger
#

Because I didn't want to add more into your plate.

#

But shrug

empty briar
#

I appreciate your help

#

I see this being the easiest and most intuitive way so as long as it actually does then I'm going to proceed with this. I want to learn good "coding" practices or at least understand when I'm taking a short cuts so I can fix them in the future if need be.

#

I was taught I should go through the GameMode which just like a lot of back and forth, maybe it makes sense if I want to check for cheating in the future but for now a simple run on server function is great assuming it works and isn't terrible practice for some reason.

gloomy tiger
#

GameMode will do nothing extra for you in terms of cheating. That is, the cheating problems you'd face by spawning your Actor in your GameMode vs. spawning it on the PlayerPawn would exist all the same. Also, RPCs, like everything else, is just a tool. "Good" vs. "bad" will depend on a lot of factors, and are really tied to the constraints of your game. I won't spiral into the matter, but brace yourself - you have a really long ride ahead of you. Good luck!

empty briar
#

Thank you. I heard multiplayer is hard. I will read those now thanks.

obtuse field
#

How much can unreliable RPC's be delayed? And can they be totally scrapped, so they won't even arrive to the client?

hollow eagle
#

forever, yes

obtuse field
#

Can I somehow check if they haven't been sent yet?

hollow eagle
#

by digging into low level net code I guess? Why would you need that?

#

unreliable RPCs are fire-and-forget, you shouldn't think about them once they're sent.

obtuse field
#

For debug. My I'm sending about 80 of them, and about half of them ever arrive, and I would like to know what happened. I don't think they should be scrapped, as I'm sending from localhost to localhost

magic karma
#

Hello, I'm trying to make a game with a dedicated server, but to be honest it looks very complicated. How hard would it be to make the game listen server based and then switch to a dedicated server later?

obtuse field
#

Its based upon same principles, like RPC's and replication. The difference is, on the listen server, you have a player hosting a game

#

The thing that really differs is the design. While making listen server, you basically have to make a dedicated server, with keeping in mind, that one player is still using it

obtuse field
#

Btw. Is there a function that returns true whenever is running dedicated or listen server?

#

UKismetSystemLibrary::IsServer()

reef bison
#

I am trying to develop a very basic inventory system but I hit a wall with a sync issue that I don't really have any idea how to solve it
I started off the Lyra example so my logic is this:

  • a FInventoryEntry that implements FFastArraySerializerItem
  • FInventoryList that implements FFastArraySerializer
  • UInventoryManagerComponent that implements UActorComponent. this class has a UPROPERTY(Replicated) FInventoryList InventoryList
  • the inventory manager component is added to the player controller

when an item is added to the inventory (FInventoryList) I call MarkItemDirty and a broadcast message is sent to all the clients (using the UGameplayMessageSubsystem). I subscribe to this message on the UI so I can clear everything and re-render the items, and this is where I am having problems:

when I walk into an item drop as the server everything works normally, I receive the message and the item shows up in the UI. but when I am playing as the client sometimes I have up to 1 second of delay after I pickup the item and it showing up on the UI. and when I throw the item away the UI is always 1 "action" behind the items, I need to reopen it so the item is not there. for some reason when I call Entries.Num() it always give me the value in the past

fossil spoke
#

Or are you sending RPCs?

#

Ive been developing a free plugin that does exactly what you are looking for.

#

Might be a reference point for you

reef bison
#
void FInventoryList::BroadcastChangeMessage(FInventoryEntry& Entry, int32 OldCount, int32 NewCount)
{
    FInventoryChangeMessage Message;
    Message.InventoryOwner = OwnerComponent;
    Message.Instance = Entry.Instance;
    Message.NewCount = NewCount;
    Message.Delta = NewCount - OldCount;

    UGameplayMessageSubsystem& MessageSystem = UGameplayMessageSubsystem::Get(OwnerComponent->GetWorld());
    MessageSystem.BroadcastMessage(TAG__Inventory_Message_StackChanged, Message);
}
#

this is called from the PostReplicatedRemove/Add/Change methods in the FInventoryList

fossil spoke
#

Does that Subsystem call an RPC though?

#

Right

#

So it should be instantly called the moment the array updates

#

Which is what you are saying is being delayed?

reef bison
#

yeah I am trying to figure out how it can be delayed since I am not adding the test latency from the editor

fossil spoke
#

It should be near instant in that case

#

You might want to try and work out where the delay is occuring.

reef bison
fossil spoke
#

Is it occuring during replication or after already being received?

#

That might help you understand if that subsystem is the culprit

reef bison
#

is there a way to split the output log for each player window?

fossil spoke
#

Just breakpoint the FastArray functions

#

If they breakpoint immediately

#

You know its not that part of the system causing an issue

#

And likely something further downstream

#

Also

#

Make sure your Actor replication frequency isnt causing it to be delayed

reef bison
#

but wouldn't the breakpoint trigger when the function runs on the server too?

fossil spoke
reef bison
#

ohh ok

#

uh I am having trouble with the breakpoints , they are not being hit but I think the issue is with my rider setup, I can see the logs in the output window

#

I added more logs and this is what I am observing:

  1. the AddEntry function is called (to add an item to the inventory)
  2. the BroadcastChangeMessage is called right after to notify the UI, this function is called inside AddEntry, after MakeItemDirty
  3. I notice the delay...
  4. PostReplicateAdd is called and the UI is updated
#

I think this eliminates the subsystem from the issue because it looks like the array itself isn't updating fast enough

#

I will give a look at the replication frequency

fossil spoke
#

Not sure where it would be coming from 🤷

reef bison
#

I found the issue, I turned off net.UseAdaptiveNetUpdateFrequency and it started working with no delays

#

but I need it turned on for GAS fine

#

thanks for the help! I will give a look at your project, I might need to rewrite everything again and it will be a good learning source

#

tbf I will probably just move the inventory to be entirely client side

obtuse field
#

So, I found out, that even reliable packages can be scrapped/destroyed. If I run a dedicated server in editor, as a separate server, the server can start sending packages before client is fully loaded

#

Any idea how to prevent this? Preferably, without sending additional packages from BeginPlay from the client

#

Basically, what I mean is AGameMode::PostLogin is firing before client is fully loaded and can e.g. receive packages

hollow eagle
#

And?

#

Don't send data to them in PostLogin then

#

seems like an odd thing to do

#

and what do you mean by packages

obtuse field
#

TCP/UDP, basically RPC

hollow eagle
#

err, what?

#

do you mean packets?

#

what does that have to do with PostLogin

obtuse field
#

Ah, yes

#

My bad

obtuse field
# hollow eagle what does that have to do with PostLogin

Just updating player with the current state of the game. I though, that PostLogin is the moment for it. If its not, then what is a reliable, trustworthy place for it? When can I be 100% sure, that RPC won't be destroyed due to client being not prepared? On the client's PlayerController begin play?

hollow eagle
#

Why are you using an RPC for that

#

property replication is the best place for stateful data that isn't one-off

obtuse field
#

Cause ISMComponent is not replicable

hollow eagle
#

sure it is, if not directly then through a custom actor or component.

#

trying to manually RPC over a bunch of instance transforms is exactly what you shouldn't use an RPC for

#

trying to send a bunch of RPCs right as a player connects is a great way to get your RPCs dropped or delayed (if not disconnected entirely) due to the server trying to send everything over to the client.

obtuse field
hollow eagle
#

You really don't have to.

#

Use property replication.

#

This is stateful data.

obtuse field
#

I remember, about year ago I asked about replicating objects just to particular clients. The thing is, this is a sandbox game, and I can't just replicate all the data to all clients

#

As each clients has its own render distance

hollow eagle
#

Which is exactly why unreal has tools for that built in...

#

relevancy distance is a thing

#

not to mention repgraph for more advanced scenarios

hollow eagle
#

so?

#

why do you have everything on one actor

obtuse field
hollow eagle
#

And there's your problem.

#

Chunks should be actors.

#

Actors are the primary unit of network communication, all replication goes through them one way or the other.

obtuse field
#

But then, shouldn't each chunk has its own set of components in order for relevancy to work properly? Or can relevancy work per instance?

hollow eagle
#

Sure, every chunk could have its own components

#

nothing says it has to

obtuse field
hollow eagle
#

It's not the only option.

obtuse field
#

And its unnaceptable for performance

hollow eagle
#

Again, it's not the only option.

#

Nothing says the thing rendering your chunks has to be the replicated chunk actors themselves.

#

Actors could be used purely as a replication channel and on the client you could send events over to some central subsystem/actor/component/whatever.

obtuse field
#

By events, you mean rpcs?

hollow eagle
#

No, I mean everything.

#

Property replication, RPCs, whatever.

#

Again, you do not want to be duplicating what property replication already does with RPCs - it's more work and you're going to do a worse job of it.

obtuse field
#

So, how to determine what instances from the ISM should be replicated using this method?

hollow eagle
#

Actors have positions

#

and should have chunk data assigned to them

#

network cull distance figures out which to send to a client automatically

#

(or you can do custom relevancy if you really want)

#

when a client receives the actor (or an OnRep with the chunk data) you update that data in whatever does the actual rendering.

obtuse field
#

So then, after all, ISMC can be replicated automatically, and even partially replicated?

hollow eagle
#

I didn't say that

#

I doubt the important properties on ISMs are marked for replication

#

But the data that defines your chunks, whatever that may be, could be thrown into a replicated array and then read back in an OnRep on clients and fed into an ISM.

obtuse field
#

right

#

that's all actually makes sense now

#

So, store all the data inside actor chunks

#

Then use OnRep, and rebuild chunks when necessary

#

But, actors are heavy

hollow eagle
#

not really

obtuse field
#

When there are very large render distances, won't it become a problem?

hollow eagle
#

and I don't know how big your chunks are, but you don't even need one actor per chunk

obtuse field
#

9x9x9 distance as a sphere is 256 chunks

obtuse field
hollow eagle
#

yeah but how much data is it, how often is it changing, how big is it, etc. You don't need 1 actor = 1 chunk, each actor could be a 2x2 grid of chunks. Or 4x4. Or whatever. Tune it depending on need.

obtuse field
#

Ah, this way

#

makes sense

hollow eagle
#

And prioritization helps as well. As can repgraph.

#

You can have closer actors be prioritized higher, and therefore receive net updates more often.

#

see AActor::GetNetPriority

obtuse field
#

Btw. is there a way for manually seting relevancy?

hollow eagle
#

yes, there's a function to override

#

AActor::IsNetRelevantFor

#

though distance-based relevancy works out of the box (if enabled in config and NetCullDistanceSquared is set on actors that need it)

nova wasp
#

and you can set things net dirty I guess?

obtuse field
#

You mean fast arrays replication?

hollow eagle
#

I don't think that's what he means but using fast arrays for this isn't a bad idea anyway.

#

Mostly for perf reasons.

obtuse field
hollow eagle
#

it isn't a bad idea

obtuse field
#

Ik

#

Maybe my last sentence was unclear

hollow eagle
#

fast arrays are more complex but they're much more performant if you need to be dealing with lots of little changes to a replicated array.

obtuse field
#

I've heard opinions, that fast arrays are basically in every way superior to normal arrays

hollow eagle
#

And want callbacks for when specific items change rather than only knowing when "something" changes and not specifically what item.

#

They are... pre-iris.

#

but they take more effort to set up.

nova wasp
#

I mean AActor::ForceNetUpdate for when you need stuff to be sent to avoid needing to wait for relevancy etc without changing relevancy

hollow eagle
#

With iris, fast arrays are mostly unnecessary for their performance (still need them for per-item callbacks). But I'm not going to recommend using iris to anyone who isn't intimately familiar with the engine.

nova wasp
#

the good news is you can more or less drop in Iris once it's ready

hollow eagle
#

It's great. It's just unstable, hard to debug, and requires a ton more boilerplate when you need custom serialization.

nova wasp
#

I am going to say that making some fast arrays will be less work than using an entirely new beta netcode backend that could do things you don't want that epic hasn't fixed

obtuse field
hollow eagle
#

heh

hollow eagle
#

there's no indication that's getting better 😦

nova wasp
#

It's all in the service of not having it in the same file it seems

obtuse field
#

So, going back to low level coding

#

Sounds like fun

hollow eagle
#

Eh, not so much that

#

More that NetSerialize methods in the current system are really simple. In iris... they're not.

#

But for most things you don't need them.

#

Almost everything else is a drop in replacement for the current replication system

#

bugs/instability aside

nova wasp
#

Iris serializers can be fairly simple but even the most simple one will have 3x more lines of code and macros

obtuse field
#

From what I know, switching to iris in the future should be mostly seamless

hollow eagle
#

Yep

#

aside from custom serialization

nova wasp
#

but the cool thing is... Iris kind of precludes the need for a lot of hand written serializers in some ways with delta serialization

hollow eagle
#

it's the one thing that isn't

nova wasp
#

Iris will warn when you have old netserialize code defined for a struct with no iris serializer

#

but it will still work and just use the regular reflection serialization codepath

obtuse field
#

So, summing up - time for rebuilding building system

nova wasp
#

assuming said type works with regular uproperty serialization

hollow eagle
#

Trying to use RPCs for property replication is almost always a bad time ™️

#

unless you're riot and making valorant, but that was before push model was a thing

obtuse field
#

Good think I designed code to be modular, so at least I don't have to rebuild e.g. item system

hollow eagle
#

I mean tbf the "interface" to your chunks could still be the same single thing, but the place the data is being stored and the way the data is sent over to clients will change.

nova wasp
#

one thing I'm thinking of trying is to see how hard it would be to add my own extra piece on top of the replication bridge to help with my ECS crap as that's one big thing I'm missing... It's simple enough to RPC commands around but persistent state is just going to be insanely annoying without taking advantage of that

hollow eagle
#

Really depends on how you want to go about things.

nova wasp
#

I think I should probably settle for pairing up the larger entities with uobjects/aactors that exist purely to ferry over their state... but that would almost certainly mean a custom iris replication fragment or serialization (not mass fragment...)

hollow eagle
#

tbh sounds like you need to make a mass bridge like we have an actor bridge

#

good luck lol

nova wasp
#

there can only be one bridge, right?

#

the funny thing is Iris internals have no clue what a uobject is... there's actually not a lot in there that relies on actors at all

hollow eagle
#

well yeah

#

that's why the uobject/actor bridge exists

obtuse field
#

Ok, thanks for all the knowledge. I need to go on the walk rn to think a little about rebuilding the building

nova wasp
#

so yeah, I would probably have to extend the aactor bridge and add my stupid stuff on like a sidecar

hollow eagle
#

idk that you have to extend it

#

just make a new thing that works similarly

#

you're not replacing the actor bridge, just making a new system that does something similar but for mass

nova wasp
#

This would be in service of having entities become network objects

#

which honestly... I don't know if they need to be in some ways besides taking advantage of actor replication style stuff

#

like distance based relevancy

#

Mass replications is just a hand written fastarray template per broad category of entity

#

which is a very... incomplete solution

#

you can't add new components over the network, that would be a new fastarray

#

which in some ways I would say makes sense, you uh, probably don't have that many different kinds of network primitives

#

but it still sucks when the data is so simple as is

#

one thing I tried: having a fast array per component type

#

which vastly simplifies the setup but was very bad for bandwidth... I could... chunk it I guess ironically

obtuse field
hollow eagle
#

The only control you have over that is property replication conditions, which are not that granular.

nova wasp
#

the easy solution is to just write to objects owned by that actor if it's just for them

#

player controllers have replicated values that are just for that player for example

#

for just raw properties at least

#

so instead of storing the two arrays in one object, you just have them write to the object owned by respective the player

obtuse field
#

Storing chunk data inside controller would be a bad solution, because of the variations, data replication etc.

nova wasp
#

it doesn't need to be the only place this data is stored, it could serve as a temporary thing in X state

#

but yeah this seems zany for something as fundamental as chunk data

#

but I've never made anything quite like that myself, I have no real hot takes

obtuse field
#

The idea is:

  1. Make an actor that is the cluster of chunks
  2. Each chunk is a separate object or at least array
  3. Each cluster can hold e.g. 4x4x4 such chunks
  4. Cluster takes player position into account for relevancy, and then, based on that distance replicate only particular chunks
nova wasp
#

I wasn't here for the earlier part of the conversation but... how much is going on in the chunk?

#

I think your idea is sensible... it's similar to how Mass replication bubbles work afaik

obtuse field
nova wasp
#

I would argue FInstancedStructs are some wasted data...

#

each one has what type of thing it is as the scriptstruct

obtuse field
fossil spoke
obtuse field
fossil spoke
#

👍

obtuse field
# fossil spoke 👍

But then, should I use UScriptStruct? I've never used previously, and idk if it is a good option for this

fossil spoke
#

FInstancedStruct is fine. Its net serializable.

nova wasp
#

I'm just saying you may be sending repeated data in the form of "this is the type of the data" as it has to

#

so if you have 500 instances of FMyStruct2

#

a large amount of that data will be just... 500 instances of the ID of the scriptstruct over the wire

#

but if it's random and sparse by nature it might be easier to just do that

#

the alternative I think being something where you have a buffer of N FMyStruct2 sent over in one bunch

#

also... oodle compression exists so don't go crazy here until you see a real bandwidth issue imo

fossil spoke
#

I havent really benchmarked FInstancedStruct bandwidth.

#

I need to though

#

Its a core component of the plugin im working on.

#

In my use case though it wouldnt really be an issue.

nova wasp
#

It's still an absolute blessing to be able to send it over at all (bless ye Jambax)

#

but it just has to have some idea of what the data is for by nature

fossil spoke
#

Yeah my plugin wouldnt be possible without it

obtuse field
#

All hail the great Jambax

obtuse field
obtuse field
#

Is dereferencing a pointer on pre replicate an option, in order to prevent object from build replicated?

warm scaffold
#

Probably this question was asked a trillion times:
Where can I store a variable that can be easily written by server and all the connected users.
My case is this:
All players are in game, and I want each of them to press a button on their controller to signal that they are ready for the game to begin.
I have a integer variable with the number of the connected players, and I would like to put a global variable that the server and any client should update with +1 when they are ready. When the number of "Ready Players" is equal to the number of connected clients, the game should start. How can I do this? Can you point me way to achieve this?

hoary spear
#

Id just stuff it in the lobby GM

#

Playercontroller RPC their new state Ready/NotReady

#

Assosiate it withbtheir controller and you know exactly whos stalling

#

Can even notify them

#

Any drawbacks of doing client loaded inventory struct, where only the key fields are replicated?

#

Guess im forced to include the DT in client builds but no biggie

warm scaffold
#

Please explain like I'm a retarded 3 years old noob 🙂

hoary spear
#

Actually it's probably more sensible to use GameState, since it's just there for all players already 🙂

#

SetReadyState includes a bool

SetPlayerReadyStates includes the assosiated PlayerController reference, and the bool they've already sent

upbeat basin
#

Hmm, so apparently GetOwner<APawn>()->IsLocallyControlled() returns false on UActorComponent::BeginPlay() for a component on character, since it's not yet possessed right after spawning is finished, on the listen server. Is the way to do this creating a delegate to be called when pawn is possessed so I can check again once it's possessed?

hoary spear
#

you can just bind to its OnPossessed

upbeat basin
#

Oh there is one already?

hoary spear
#

i guess

#

yeah there should be

upbeat basin
#

Isn't OnPossessed just a function?

hoary spear
#

let me verify...

#

could be im mixing with the playercontroller

upbeat basin
#

OnPossessed is for player controller

hoary spear
#

but even so, just adding your own delegate to that is ofcourse ann option

upbeat basin
#

Pawn has PossessedBy

#

But they both should be functions, not delegates

hoary spear
#

yes, But you could easily add your own delegate to it

#

memory failed me 😛

upbeat basin
#

Yeah that's what I'm planning, my question is if that's the way to do it

hoary spear
#

sorry, my coffee hasn't even reached me

#

should be a sufficient way to do it

upbeat basin
#

Got it, thanks

hoary spear
#

this one

#

is what i had in mind

#

Its in the APawn

warm scaffold
# hoary spear

Is there a tutorial I can follow, I'm bright new to replications and all this.

hoary spear
#

Guess i won't be making any more tutorials 🤔 😅

warm scaffold
hoary spear
#

There's plenty of them on youtube

#

i wont put my name on any of them tho

warm scaffold
#

hehe

hoary spear
#

check out Exi's multiplayer compendium

#

first pin in this channel

#

read it 3 times. then 3 more times

warm scaffold
#

will do

hoary spear
#

It can be overwhelming in the start

#

but flowcharts helps (atleast me)

left willow
#

if RPC run on owning client is called on the client, will there be a load on the Internet or will the ue skip the Internet part?

meager spade
late wind
#

hi! is there any way to set initial value of my camera to black (alpha 1)

#

in blueprints

#

because i have an issue when connecting to remote server, there is a period where the camera is transparent (alpha 0)

#

it seems like this default camera is initialized before everything else

#

just to clarify i'm using bluepring project, and the camera is default

viscid monolith
#

Hi, can i use NetDeltaSerialize to replicate struct, that is not USTRUCT and can’t be UPROPERTY?

chrome bay
#

negative

#

It has to be a native UPROPERTY member of an object. Can't be embedded in another struct either.

viscid monolith
#

Are there any ways to make struct into UPROPERTY? Or maybe there are ways to replicate non-UPROPERYs?

chrome bay
#

Not unless it's a USTRUCT no

#

The engine can only replicate UPROPERTY data

#

Since the whole replication system is built around reflection

viscid monolith
#

Maybe there are ways to send data to clients as packets? Or some other low-level way to manually send data

#

Are RPCs fast enough to make like 30-60 updates per second?

chrome bay
#

You can't rely on it in any case

#

RPCs will send as fast as you call them, but calling reliables at that rate is not advised, and unreliables are likely to be dropped since you'll likely saturate the connecton

#

Maybe best to explain what you're trying to do

hoary spear
#

You could always open your own socket and do your thing ?

viscid monolith
#

I have a world structure from the external ECS(Entity Component System), and i need to add multiplayer support to it

#

Generally there are few arrays, i only care about 2: entities and components

#

Yet as it’s not USTRUCT, i need to make my own replication method for it

viscid monolith
hoary spear
#

Old but seem to cover some of it (altho exposed for bp)

#

Havnt tried any of this myself, just fyi

viscid monolith
#

Interesting, thanks for link

#

Aren’t udp non-reliable tho?

hoary spear
#

Yes

#

Seem to cover the tcp socket, but also python script

#

Should be enough here to get you going, or atleast see if its feasable for you

#

If you're gonna send tons of the same data all the time to all clients, might be worth investigating multicast tech aswell...

viscid monolith
#

Thanks!

#

As i understand it, multicast UDP should not be problem even with occasional packet losses, if I communicate around at around 60hz

hoary spear
#

Thats what im thinking.. and far less trouble for your server as the network equipment does the copying of the packets

#

Not sure if its possible to check if all equipment supports it but i believe like 99% of it does already, if not all ...

#

Nvm, im wrong.

#

About the supprt of it *

#

Ipv6 demands multicast support 😄

viscid monolith
#

I also have concerns about how safe actually packet loss is. Im talking about potentialy(theoretically, but if players want, they can spawn as much enemies as they feel like) thousands of units, so i should not send full data, only diff of it. If i do it, packet losses may be fatal, as client's version may get very outdated.

chrome bay
#

At what point do you realise you're just reinventing all the stuff the engine does for you 😄

viscid monolith
hoary spear
#

You'd send "full frame" packets from time to time

#

To ensure equal states

#

But this gets complex. Fast

viscid monolith
#

I also think that settling to Mass may be not so bad of the idea after all, creating such deep integration seems like a very long and tedious work

late wind
#

when i connect to a server, in a blueprint project, where is the first hook where i can add some code

#

when i say first i mean it, first of the firsts

#

i need something before camera gets initialized

chrome bay
#

Mass does indeed have at least some primitive replication support

mellow oasis
#

anyone maybe able to help me figure our why my projectiles dont always count when hitting the host client at distances but it works close by and works perfectly if the host shoots the other client close and far?

hollow oriole
# hollow oriole actually you can.

if you're using GAS.. you can create a new globals and force the engine to use your defined globals.. pretty much you want to create a new effect context handle completely .. I did this by overriding UScriptStruct to return the actual struct used for serialization, than override NetSerialize to make it uint32 to open up more streamed packets instead of uint8.. than you just need to make RepBits for each type of struct you want to pass along... when you send data via NetSerialize you are really just sending a binary packet of 0's and 1's across the network.. all you have to do is change the key so that the extra 0's and 1's mean something.

chrome bay
#

NetDeltaSerialize requires a history state which needs to be mapped to a UPROPERTY

#

NetSerialize will work, but NetDeltaSerialize needs a lot more plumbing

#

But yeah it's more than feasible here to just wrap the data type with USTRUCT and forward the calls appropriatelly

#

anything can be a USTRUCT ultimately

hollow oriole
#
bool FCustomGameplayEffectContext::NetSerialize(FArchive& Ar, UPackageMap* Map, bool& bOutSuccess)
{
    uint32 RepBits = 0;
    if (Ar.IsSaving())
    {
        if (bReplicateInstigator && Instigator.IsValid())
        {
            RepBits |= 1 << 0;
        }
        if (bReplicateEffectCauser && EffectCauser.IsValid() )
        {
            RepBits |= 1 << 1;
        }
        if (AbilityCDO.IsValid())
        {
            RepBits |= 1 << 2;
        }
        if (bReplicateSourceObject && SourceObject.IsValid())
        {
            RepBits |= 1 << 3;
        }
        if (Actors.Num() > 0)
        {
            RepBits |= 1 << 4;
        }
        if (HitResult.IsValid())
        {
            RepBits |= 1 << 5;
        }
        if (bHasWorldOrigin)
        {
            RepBits |= 1 << 6;
        }
        if (bIsBlockedHit)
        {
            RepBits |= 1 << 7;
        }
        if (bIsCriticalHit)
        {
            RepBits |= 1 << 8;
        }
                if (bIsParried)
        {
            RepBits |= 1 << 9;
        }
    }
``` etc.
#

in that i passed along bIsBlocked, critical, and parried in the newly created effecthandle

#

as an example

#

do the same with Ar.SerializeBits

#

i mean.. yea it needs to be UPROPERTY because it needs to be able to to communicate with the reflection system

#

but you can really put anything in it.

pseudo merlin
#

hi all, do Pawns or Characters that are simulated proxies have any info about controller rotation replicated in them by default?

#

my use case is AIController possessed pawns, the server can get their controller rotation but clients can't, unless I manually replicate that through pawn? but it seems like something that should already be available

hollow oriole
#

that makes sense since all AI functions are passed on server only

pseudo merlin
#

I did find something, pitch is replcated with RemoteViewPitch

hollow oriole
#

pretty much whats happening is you have some desync betwen host and client locations.. your clients think it hit the host, the host is saying it wasnt hit

#

are you using any sort of network prediction key with your projectiles?

#

or using any sort of local prediction whatsoever? or is the server pure auth?

pseudo merlin
#

could also be distance based net culling

#

maybe try ticking "always relevant" on projectiles and see if it helps

mellow oasis
#

okay ill try that ty so much

mellow oasis
dusk pecan
#

Can anyone explain why both the client and server UI end up on the server instead of having one UI on the server and one on the client?

crisp root
#

Good morning! Good afternoon! Good evening!

#

I'm noticing jittery simulated proxy movement using the stock CMC and AddMovementInput, can anyone think of something I should look into?

warped oxide
#

if you hover over the little tower icon on the top right of the event node it'll explain a little more

dusk pecan
bronze glade
#

Hey everyone! For multiplayer, what type of code should go in game mode / game state? I had a conversation with someone yesterday in this discord who said to completely ignore them and just do it inside a replicated actor but that sounded like bad practice to me, otherwise why would they exist

#

Currently I am handling any checks for if score should update, if a team wins the game, etc in game mode and if it should it fires a delegate to game state that can replicate to clients if needed

chrome bay
#

Whoever told you not to use them is out of their mind, but you can also use components for example and append them to both.

bronze glade
#

That’s what I thought. Thanks for the info

#

So if game mode is setting rules, what is best practice for when a rule is met? Broadcast a delegate to game state to run something?

chrome bay
#

There's really no hard and fast rules honestly

lost inlet
bronze glade
lost inlet
#

yeah you can ignore those actors but I don't really get what they're saying at all

bronze glade
#

Yeah I wasn’t too sure what to make of it either so I just wanted to confirm lol

#

I’m going to be on my computer in like 10 minutes and I’ll send my flow here. If you are still on I’d appreciate if you could tell me if it’s bad practice 😁

#

So currently, here is an example of what I do:

  • game mode starts the round & begins a timer on game state
  • when game state timer ends, calls a delegate that game mode is bound to
  • game mode determines which team won and increases that value on game state
  • repeat
#

Also some other scenarios like:

  • game mode checks if all players on a team die before the timer ends
  • updates score value on game state
  • stops game state timer & restarts round
mental pendant
#

I'm having a hard time understanding this section from IsLocalController(), in what scenario would this statement be true for a PlayerController?

    if (GetRemoteRole() != ROLE_AutonomousProxy && GetLocalRole() == ROLE_Authority)
    {
        // Local authority in control.
        return true;
    }
solar stirrup
#

If the remote role is autonomous & local role is authority, means the player controller is another player's

#

but if the remote role isn't autonomous, it means we're the server & it's our player controller

mental pendant
#

oh makes total sense, cause even if they replicate the "same" thing they are still different objects

glad robin
# bronze glade So currently, here is an example of what I do: - game mode starts the round & be...

I could be wrong here, My first run through of my main game loop I was trying to figure out how I handle game mode versus game state and put too much in the state. Where as now the state just has some replicated stuff.

In your case I feel like with the round timer I would handle that timer on the server but then send it to the game states. I assume It is just a round timer so I don't see why the client should have their own things versus passing info.

I always doubt myself tho so I could be wrong haha.

Edit: ALSO, check out the Lyra sample project. It's on Epic GitHub too if you don't want to make. I read through a lot of it when fixing up my stuff.

bronze glade
obtuse field
#

Why TMap and TSet are unable to replicate?

#

I mean, from the technical point of view. What is preventing epic from adding support for replication?

mild lynx
#

How can I multicast a GameMode Event onto all Clients? I'm updating a Material Parameter to change a Selected Person to the Color Red, but it only works on the Server.

solar stirrup
mild lynx
hollow oriole
# obtuse field Why TMap and TSet are unable to replicate?

Unlike TArray, the relative order of TMap elements in memory is not reliable or stable, and iterating over the elements is likely to return them in a different order from the order in which they were added. Elements are also unlikely to be laid out contiguously in memory.. due to this they are not exposed to the replication system

#

There's a lot of things that happen under the hood when something is marked to replicate.. for Instance an item that's replicated is given a unique name, etc. And identified as a unique item In the replication system. None of that is possible with TMaps or TSets

primal trellis
#

Hello, guys!
I'm trying to replicate my animations, but the **server **animations only work on it and the **client **animations only work on it, neither replicates to the other. (I'm using multicast, my error must be somewhere else and I must be making mistakes in a noob way)

I have an animation state machine, ABP_Mage, and I'm setting it in a variable (in the character). After that, within an event (server only) I call the animation event (multicast)

and it always gives the error, for example:
"Blueprint Runtime Error: "Accessed None trying to read property ABP Mage". Node: Set SpellBall Graph: EventGraph Function: Execute Ubergraph BP Third Mage Blueprint: BP_ThirdMage (my player character)"

magic karma
#

Hello, multiplayer noob here, how would I go about making a bunch of different multiplayer game instances, like how a Valorant server hosts many games at once?

hollow eagle
#

I don't think there's any evidence that valorant hosts multiple games at once in a single process.

#

They run multiple processes per physical server, that's all.

#

Unreal has little to no support for hosting multiple separate multiplayer worlds in a single process - it would require some pretty hefty engine changes if it's even remotely reasonable to do at all.

meager spade
#

^

#

one machine can host multiple UE dedi servers

#

normally on different ports

hollow eagle
mild lynx
#

Does anyone have any good advice for making a Delayed Respawn System for Multiplayer in the GameMode Blueprint?

The Main issue I have is when multiple die at the same time, it can't handle respawning all of them. I was thinking of building an Array for "Awaiting Respawn" but not sure how to delay it properly.

snow trail
mild lynx
snow trail
mild lynx
#

On Damage Receive on Pawn, goes to Health Component, then if Health is <= 0 it will call a Respawn Function on the Player Controller, which disables HUD stuff needed, then does an Interface Call to the Gamemode for "On Player Killed" where I pass all my references.

#

I have all my respawn Logic on the Game mode for finding spawn and possessing.

snow trail
#

and the "on player killed" call just uses a delay and then does some stuff im assuming?

mild lynx
#

Yep, some Gamemode specifc stuff, but because of the Delay, it can't handle multiple people dying at once

#

The Controller References would then change as well, so it will skip the first player killed in the delay period

meager spade
#

use a timer

#

not a delay node

#

and store the ones that need respawning

#

C++ is a bit more simple to do that BP, bp is very limited with this kind of thing

mild lynx
#

Cancel the timer when nobody is pending respawn I assume. and I can timestamp the death and respawn when time is greater than added respawn time maybe.

meager spade
#

one thing you can do, why doesn't your HealthComponent or PlayerController have it?

#

ideally your player controller will schedule the respawn

#

and fire into the gamemode

#

this way its linked to the player not the gamemode and you can use delay

mild lynx
#

I was thinking that, but Respawn time is going to be specifc to the type of gamemode

#

Some gamemodes may handle respawn differently

meager spade
#

but your controller can ask the gamemode

#

for the respawn time

mild lynx
#

Hm, that is true

#

I'll give it a shot and see what I get

#

Thanks for the idea. Seems like that'll be the easiest route

mild lynx
harsh ice
#

When I play as a client my gun is stuck in air but not alway. It happens only sometimes

#

Does anyone know how to fix it ??

obtuse field
#

Variables not marked as UPROPERTY() inside Fast array replication struct won't be affected, nor serialised, right?

fossil spoke
fossil spoke
#

See how the ItemInstances property is passed in as an argument to the delta serializer

obtuse field
fossil spoke
#

No, the FFastItemInstance is a regular struct that just inherits from the FFastArraySerializerItem which just enables it to be used with the FastArray.

#

It follows normal replication rules for USTRUCTs

#

So anything marked as UPROPERTY will be serialized by default

#

(Unless you override the NetSerializer function)

obtuse field
#

ok, ty

meager spade
#

or specify NotReplicated

#

in the UPROPERTY @obtuse field

obtuse field
#

Why Fast Array Replication events, like PostReplicatedChange(const struct FFastArraySerializer& InArraySerializer) or PostReplicatedAdd(const struct FFastArraySerializer& InArraySerializer) give const references to the serializer struct? Is there something unsafe about modifing data from up there? E.g. if I hold some pointer inside serializer struct, and I want to modify some data via this pointer, should I const_cast?

fossil spoke
#

The FastArraySerializer has similar functions

#

Which return the index of the element in question

#

You can apply modifications that way.

#

Also, you wouldnt want to make modifications in those functions anyway as they are only called on the Client

#

So you would only be modifying the Clients version of that element.

obtuse field
stable grotto
#

is replicating an int array with 10,000 elements a bad thing?

obtuse field
obtuse field
surreal peak
harsh ice
meager spade
#

@obtuse field you are in the item though?

#

this == item

harsh ice
#

@meager spade do you know anything about my problem.. ? I shared a video

solar stirrup
#

^^

#

Also check the output log for warnings

harsh ice
#

This is the code...

#

When I set a pickup weapon trace on owning a client replicate it works fine but not showing on the server. I don't know how to implement that

old knot
#

hey guys, where do you suggest implementing player game data in multiplayer games? GameInstance or GameMode?

old knot
solar stirrup
#

I'd say PlayerState if it's per player

#

and needs to be replicated to everyone

hazy scroll
#

Hi all,

I have a replication issue in Unreal egnine 5 and I don’t know what is wrong.

I call an interface event in my replicated CharacterBP in an non replicated event:
(Image 1)

It get executed on my pickup Item:
(Image 2)

It prints “server” on the server and “client” on the client which is fine:
(Image 3)

This event is Run on Server but only the listener server prints “2” and the client does nothing:
(Image 4)

So the actor doesnt get destroyed (on server and clients which is very strange) and the client cant execute this function. I have no idea why this is happening. I hope I can get help here.

Thanks!

warm scaffold
#

Starting a fresh VR Template as Listenserver is ok, but if started as client returns this error:

Blueprint Runtime Error: "Accessed None trying to read property CallFunc_GetPlayerController_ReturnValue_1". Node: Enable Input Graph: InitializeInput Function: Initialize Input Blueprint: VRSpectator

unkempt tiger
#

Can anyone help me understand why APlayerCameraManager has multiplayer stuff in it? This is so weird to me

primal trellis
#

Hello, guys!
I'm trying to replicate my animations, but the server animations only work on it and the client animations only work on it, neither replicates to the other. (I'm using multicast, my error must be somewhere else and I must be making mistakes in a noob way)

I have an animation state machine, ABP_Mage, and I'm setting it in a variable (in the character). After that, within an event (server only) I call the animation event (multicast)

and it always gives the error, for example:
"Blueprint Runtime Error: "Accessed None trying to read property ABP Mage". Node: Set SpellBall Graph: EventGraph Function: Execute Ubergraph BP Third Mage Blueprint: BP_ThirdMage (my player character)"

tacit nova
#

If I have a struct called 'commands' that any 2 players can send a message to the server to add values to at any point, which replication type is recommended?

solar stirrup
old knot
solar stirrup
#

I'd probably make a game instance subsystem

old knot
#

thanks

lost inlet
vital girder
#

hey guys, I'm following a paid multiplayer game course, and at event "Multicast Fire" it makes me set the player pawn not equal to owner at player index 0.
But doesn't that mean it will only work for those with player index 0?

If yes, how can I make that it changes the index based on the player?

lost inlet
vital girder
lost inlet
vital girder
#

so is it possible to change the player index value based on what player is playing?

lost inlet
#

well it depends on the intent right

vital girder
#

because I have also implemented myself a simple recoil system that also uses get player pawn

vital girder
vital girder
lost inlet
#

well recoil is typically something that's clientside anyway

vital girder
warped sedge
lost inlet
# vital girder

I'm not sure why this is running through the multicast or why you use GetPlayerPawn(0) when you already know the owner of the weapon

vital girder
vital girder
#

yeah sorry I am pretty new to game development

lost inlet
#

though still, why does it need to be an RPC when the client would usually predict their firing first. you would add a delay to recoil otherwise which would feel strange

#

with the delay being proportional to ping

vital girder
#

the recoil works fine

lost inlet
#

yeah when your ping is 0

vital girder
#

ah

lost inlet
#

but I'm not a big "networking in BP" guy anyway

vital girder
#

yeah fair enough

#

after I complete this not full fledged game my intent is to learn C++

lament flax
#

i tried to turn the FPS template into multiplayer
the thing is, when the client overlaps with the BP_Pickup_Rifle, the client is instantly kicked to its solo world.

what is the source of this problem ?

vital girder
dark wing
lost inlet
vital girder
#

also even at low ping the fire event takes about 0.8 seconds before firing

#

this one

#

welp must be BP being slow

lost inlet
#

that seems pretty long in that case but in general, this is why games usually predict things like effects before the server has even processed anything

vital girder
#

I'll see if I can try optimizing it

olive crow
#

question, if I call a client rpc from an actor instance and then immediately after tell it to destroy itself, will the call be executed on the client before it gets destroyed or is it possible to end up with some undefined behaviour, where it decides to destroy the actor and then it attempts to do the call?

chrome bay
#

If the RPC is reliable it'll be processed before the destroy call

#

If it's unreliable, no garauntees

olive crow
#

I see, thank you

tacit nova
#

If you're running a Server and a Client and only replicating the game state and 'messages' between server and client directing input, the game should be deterministic purely off those messages right

azure vessel
#

Hey guys, my client can server travel when i test two stand alone games on the same pc, but not when i'm playing with two pcs.. does anyone know what i should look for?

tacit nova
lament flax
#

whatever the replication type of the event, i get this error. And the client is kicked of the session

slim heron
#

Why is this not replicated? Does the node "is input key down" not support on client or the "get player controller from object"? Can't seem to figure this out, tips are much appreciated.

viscid monolith
upbeat basin
#

I'm not sure if this is a #cpp or #multiplayer question, I have a replicated component which I add to character on server. Then in the begin play I create a sphere component, add it to the component owner (character) and listen the overlap begin/end events. If I walk with another character inside that collision, it triggers overlap events on both server and all clients. But when I try enable/disable collision only server receives ovelap begin/end events. Clients receive nothing. Same thing is applicable for adding the sphere component as well, if there already is something that will overlap the collision, upon calling UpdateOverlaps() server receives the overlap begin event, but client doesn't. Is there something that I'm not aware about this?

sterile plaza
oak pond
#

struggling with an embarrassingly simple thing, got some enemies that randomise their outfits on begin play, just set mesh to random within array, and SOMEHOW I cant manage to replicate this. at all. wherever I make the event it just refuses to do anything. I can try print string and it shows me the random list of outfits, and yet setting it does nothing

#

literally just

#

dont know if multicast is even needed for enemies I know some things work with just server but things like their animations needed to be multicast

sterile plaza
# oak pond literally just

this looks like you're calling a server RPC to do it? Why not do it all on the server from the start? Clients can only RPC to servers on actors they own, which would presumably not be enemies.

oak pond
#

oh yeah true, then I have no idea how setting up multicasts fixed some other enemy events

#

but the problem with this is that it naturally randomises differently for each player

magic vessel
#

Is it normal for the level blueprint to not run on clients?

oak pond
#

well this is ridiculous

chrome bay
#

Should run on all

oak pond
#

so why does this incredibly simple little script not work when everything else Ive set up in the enemy has worked as it should in multiplayer

#

it wont set mesh at all it wont do anything

#

yet it still prints string

#

I think it just refuses because something to do with calling from a child actor, I dont know, I only need it on this actor

obtuse field
magic vessel
#

I'm sure you won't need to replicate the setting of the mesh, are you sure that the mesh component is set to replicate?

oak pond
#

yes, it just randomises it differently on each client

magic vessel
#

Try instead of a server RPC, have an authority check and if it is the authority then set the skeletal mesh

oak pond
#

does nothing, since its an enemy so it wont have authority

velvet kettle
#

if the enemy exists on the server then the server has authority over it so you can do an authority check to run things only on the server. If it only exists only the client then a server check is useless

oak pond
#

oh

#

then it should be working fine

#

but it wont

#

wow, god forbid I try to get one little thing done today

solar stirrup
#

Skeletal Mesh Components do not replicate

#

You want to have the skeletal mesh be a replicated property on the actor

#

And set it in the rep notify

#

@oak pond

oak pond
#

still randomises differently between clients

solar stirrup
#

Only run the setting on the server

#

Not clients

#

On the server, grab a random mesh, set your replicated property to that mesh

#

In the rep notify, apply the replicated mesh to the skeletal mesh component

#

In Blueprints rep notifies run on both server & client so if you have a listen server, it'll still work

oak pond
#

OMG thank you, yeah that was it, forgot it had to be a server event too

velvet kettle
#

As to what Erlite is saying... i have a mesh color changer i was toying with a while back on my old player character using a repnotify... the player requests a new color, then let the server change the value, and the repnotify applies it on both the server and the client.

serene furnace
#

Hi guys

can someone explain me this,

I have a replicated actor that cant fire a server event "has authority " is showing that it is a client, and still cant fire any kind of server event. What is the option to make this replicated actor able to start a server event ? 🤔 thanks

solar stirrup
#

On the server side, use Set Owner on the actor

#

That is only if the actor is owned by one player

#

If not, you'll need to route the RPC somewhere else like the player controller

#

Since this seems to be doors, yeah probably not a good idea to set the owner to a specific player

hoary spear
#

Would it be frowned upon to always swap owner of said door ?

#

So you "own it" during the animation etc, but not after ?

serene furnace
solar stirrup
#

Not the best idea to own stuff like doors in the world

serene furnace
hoary spear
#

Setting ownership is an option, but unlikely ideal for a door

solar stirrup
#

Better to route the RPC somewhere else like an interaction component or something, that sits on the player controller/player pawn

serene furnace
#

and this pannel can control up to 5 static meshes to open when entering the code

solar stirrup
hoary spear
solar stirrup
#

Generally if you're gonna do something like play an animation, the client will have told the server somehow already

#

Meaning you already fired a Server RPC from something you own

hoary spear
#

I was considering doing it for my NPC's, but i've gone the other path instead

solar stirrup
#

At that point, why bother with setting ownership on the server ^^

hoary spear
#

I needed some event in return to the client 😅

#

On a server owned actor

#

It became weird, to put it mildly

solar stirrup
#

Use a proxy that's owned by a player

hoary spear
#

Actually..... thinking about it, im just stupid about thisn

solar stirrup
#

Probs better

serene furnace
#

if server fires this event, all doors moves in a replicated way since I set those static meshes to replicate movements

hoary spear
#

I can just pass the thing to the playercontroller directly

#

And let that handle it

solar stirrup
#

Yep

hoary spear
#

Thats a far better way

solar stirrup
hoary spear
#

Dialogue in this case. And they're already uobjects so easy enough

serene furnace
#

how do I get a reference to the player that is the host of the game ?

and from there your telling me I should Multycast the door movement rather than run the door movement on the server that automaticly replicates ?

#

in all cases if I want to multycast I need this actor to be able to run a server event.
Cause when there will be 10-20 players opening doors im not sure how it's gonna act if only have one function " This panel is currently opening this doors" into player controller and those are fired at the same time

I think I'd rather have those actors saying to the server "Hey i'm currently opening those doors"
So that the server can handle those doors at the same time

solar stirrup
#

You do not need to multicast - make it automatically replicate

serene furnace
#

yeah I'm testing that right now, chat GPT said playercontroller 0 should always be the server / host i'm testing that to see if it's true xD

#

i guess it makes sense tho that the first controller is the host, but what if we change host at runtime ?

#

does it become player controller 0 ?

hoary spear
solar stirrup
#

Yep

#

Server always spawns first

#

Can't accept clients before the server itself

hoary spear
#

Makes sense

serene furnace
#

then what if hosts leaves ?
I guess you should make a code that sets the best player connection to now be the new controller 0 ? But is that possible to set it's controller to be the new player controller 0 ?

solar stirrup
#

The engine does not support host migration, at all

#

Attempting to implement your own requires:

  • A very very naive implementation that could work but is hacky and requires tons of tinkering. Players will still be kicked, but you can "reconnect" and have them rebuild the state. Players will need to know everything about the game to recreate the state.
  • An actual implementation of host migration that requires an insane amount of engine modifications and additions.
serene furnace
#

my final honest conclusion about making a code that migrates hosts : Fuck it

quasi tide
serene furnace
#

So i made this to test if the player controller is always 0 but every clients and the host returns 0 to the print string x)

Did miss concept what a "Net player index" is ?

solar stirrup
#

Player controllers only exist on the server & owning clients

#

So any player that isn't the host only knows about its own player controller

#

which means they'll always be 0 for themselves

primal trellis
#

Hi, guys!
I'm trying to replicate my animations, but the server animations only work on it and the client animations only work on it, neither replicates to the other. (I'm using multicast, my error must be somewhere else and I must be making mistakes in a noob way)

I have an animation state machine, ABP_Mage, and I'm setting it in a variable (in the character). After that, within an event (server only) I call the animation event (multicast)

and it always gives the error, for example:
"Blueprint Runtime Error: "Accessed None trying to read property ABP Mage". Node: Set SpellBall Graph: EventGraph Function: Execute Ubergraph BP Third Mage Blueprint: BP_ThirdMage (my player character)"

serene furnace
#

so the suprem technique of " get player controller 0" to find the host will never work if it is fired from a client.

So im stuck again with "how to get a reference to the host of the session from a client event into an actor that cant fire server event" ?

serene furnace
solar stirrup
#

Animation blueprints do not replicate @primal trellis

#

Don't try to replicate them ^^

serene furnace
#

what we usually do is multy cast an animation or anim montage

solar stirrup
#

No

#

Depending on the context that isn't the right way to do it

primal trellis
serene furnace
#

well looks like his context is just playing a "cast a spell ball" animation

primal trellis
#

I thought it would make sense to replicate the animation blueprint

solar stirrup
#

Whatcha trying to do exactly

serene furnace
primal trellis
#

I want my character to release a magic animation and this is replicated for everyone

#

here the current status:

serene furnace
#

so yeah if it's just animation and SFX / VFX

I would do :

Input key -> tell the server he is casting a fire ball so we start a multy cast ( let the server spawn and handle the actual projectile / explosion)

Muty cast : play anim montage

I might be wrong tho, there is not only one way to do that and it depends on the scale of the project

primal trellis
#

Perfect, I'll try that way. Thank you for your help!

solar stirrup
#

Don't multicast

serene furnace
#

how to you display a specific animation / VFX / SFX to all clients then ?

solar stirrup
#

@primal trellis does casting a spell have a start and end?

primal trellis
#

has an animation for casting and one for "releasing the skill". But they are two different

serene furnace
#

for VFX and SFX you could spawn a replicated actor that displays those on spawn, but I dont see any other way to make a player display an anymation on all machines ^^

dark edge
solar stirrup
#

Would suggest using a replicated property, which is the spell the player is currently casting

#

That way you can play animations when you set it (start casting) and remove it (stop casting)

#

Better than RPCs for this - a scenario would be a player popping into existence and you seeing them throw a spell without seeing them cast it

primal trellis
solar stirrup
#

Not the worst, but also easily fixed by using replicated properties instead of RPCs

primal trellis
dark edge
#

Why not pawn?

#

I'd do it like
Time to do the hit -> if ThingImGonnaHit.Team != MyTeam -> do the hit

primal trellis
#

because I'm a noob kkkkkk
I don't know for sure, I needed a way to check the teams, but I wasn't able to do so using the tag on pawn. And I found this way

serene furnace
#

I did pretty much the same type of code from player controller ^^

dark edge
#

That can work but then if you ever want to involve teams with other things like AI then you either gotta give your AI playerstates or otherwise work around it.

primal trellis
dark edge
#

Even better, bake team-ness into your collision, if you have a set number of teams

#

Then the hits just don't happen to begin with

primal trellis
hazy scroll
mystic estuary
warped oxide
#

I was about to ask a question but figured out the answer while typing it out phew

hazy scroll
mystic estuary
#

If it tries to call it, the server will execute it only if the client has the authority over the actor you're executing the RPC on

hazy scroll
proven jolt
#

Hello there, is there a way to replicate another UPROPERTY from a "FFastArraySerializer" struct, that is already replicating TArray perfectly fine? Something like this: ```c++
UPROPERTY()
TArray<FEntry> Entries; // This works great because of the NetDeltaSerialize

UPROPERTY()
int32 DummyValue = 0; // This does not replicate at all

Or wrapping it into yet another USTRUCT the only way to get it to replicate?
hazy scroll
mystic estuary
hazy scroll
mystic estuary
hazy scroll
mystic estuary
# hazy scroll In the replicated Pickup Item class

Well, if the outer of the pickup is not an actor that the client owns (their player controller, their character, or their player state), the client will unable to call a server RPC, it'll simply fail, and do nothing

hazy scroll
mystic estuary
#

I actually meant "owner", sorry. Owner is the actor that has the ownership over a particular object. Usually, it's the actor that created the object, but it really depends on what you do.

What do you mean by "That's a structure"? You cannot call RPCs or have any events in structures, those are plain data

mental nest
#

Hey, Is it possible to replicate data only to specific connections. I mean for example Replicate a value between Teammates

hazy scroll
mystic estuary
#

Well, so you call the server RPC on your character?

hazy scroll
hazy scroll
formal solar
#

will onpostlogin of gamemodeB get called after seamless travel from a map with game mode A (transition map with game mode A)?

#

if not what about non-seamless?

mystic estuary
serene furnace
#

well, thanks guys.

You were right I needed to set the owner of the actor to be the server i've find a way into my code to make just that.

Fixed a few details and stuff, and I was able to open 8 Doors at the same time, with 2 clients or 1 client and the host.

Codes were random and synched for all machines and doors openened smothly for everyone looked like a pretty solid code for an online hosted project ^^

hazy scroll
hoary spear
#

If you're the client that own them

mystic estuary
mystic estuary
hoary spear
#

nono, replicated actors, where the owner is the client

#

just like the player character would be

#

Im sure that's what you ment aswell, I just read it differently 😛

mystic estuary
#

oh, alright 😄

#

oh, yeah, I mean the opposite

hoary spear
#

figured

#

Ugh I'm in a bit of a mess myself with this

#

The back and forth just seem so... insane

#

Client Playercontroller TryInteract -> RPC to Server for actually Interacting -> server reaches NPC -> server reaches BP_Dialogue (a dialogue manager, of sorts) -> Informs NPC that it succeded -> Informs PlayerController that the interaction was succesfull -> RPC to Client for a local Interaction -> Reaches NPC locally -> reaches BP_Dialogue (client side) -> Gets the dialogue data....

PC(Client) -> PC(Server)->NPC(Server)->BP_Dialogue(Server)->PC(Client)->NPC(Client)->BP_Dialogue(Client)

hoary spear
warped oxide
#

okay so if I want a player to open a storage box, it's best to do an interaction, have the server verify it, then have the server open the storage box's inventory widget on the client that interacted? Or should the client open it

hoary spear
#

Unless there's anything to verify for the server , the client can prob just open it

#

server will verify / confirm any transactions from it

warped oxide
#

Gotcha! I was just worried about the client somehow opening the widget without doing the interaction

#

Thanks for your help!

hoary spear
#

that could be something you verified during the transact if so

#

just letting server check that they're actually within a reasonable range for example

warped oxide
#

That's a good idea! I already have a distance I use for interacts generally so I'll plug that in and have a go seeing if I can make it work. Thank you!

magic karma
#

Multiplayer noob back with another question. I'm reading the Setting Up Dedicated Servers documentation and it says to start a server I have to run this command: ./Binaries/Win64/<PROJECT_NAME>Client.exe 127.0.0.1:7777 -WINDOWED -ResX=800 -ResY=450. And also another command to connect a client. Does this mean that the play button in the unreal editor is useless? Will I have to run these commands every single time I want to test something?

obtuse field
#

So, I have a dilema on how to design one thing in my building system. So, its building system based on instanced static mesh components. World is divided into chunks, e.g. like minecraft. Now, during gameplay, its easy, just send RPC to all relevant clients. But, what if player enter the chunk that already have something builded? Storing data like location and rotation for the replication would be reduntant, as this data is already stored inside ISMC. And sending it over rpcs is overall just bad idea

warped oxide
#

When doing traces for interacting/shooting/etc. is it better to do the server trace first and then the client does its own trace or does the order matter at all?

obtuse field
#

Keep in mind, that if server is making the trace, and then sends the results to the client it takes time

#

So client will feel like it would have some lag

warped oxide
#

Yea, I figured for shooting it might be better to do client line trace that does the shot visually but the server is what applies damage but didn't know if that was the right approach

fossil spoke
warped oxide
obtuse field
meager spade
#

why would ViewTarget be this?

#
    UPROPERTY()
    class AActor* InViewer;

    /** The actor that is being directly viewed, usually a pawn.  Could also be the net actor of consequence */
    UPROPERTY()
    class AActor* ViewTarget;

    /** Where the viewer is looking from */
    UPROPERTY()
    FVector ViewLocation;``` comments explain everything
#

which you could find by searching what calls IsNetRelevantFor

obtuse field
meager spade
#
static FORCEINLINE_DEBUGGABLE bool IsActorRelevantToConnection( const AActor* Actor, const TArray<FNetViewer>& ConnectionViewers )
{
    for ( int32 viewerIdx = 0; viewerIdx < ConnectionViewers.Num(); viewerIdx++ )
    {
        if ( Actor->IsNetRelevantFor( ConnectionViewers[viewerIdx].InViewer, ConnectionViewers[viewerIdx].ViewTarget, ConnectionViewers[viewerIdx].ViewLocation ) )
        {
            return true;
        }
    }

    return false;
}```
#

does it say Pawns location?

#

what if your a ThirdPerson with the camera behind the player

obtuse field
meager spade
#

where would the src location be?

obtuse field
#

Camera?

meager spade
#

yes

ruby lodge
#

So the following is for the grass to bend when a player runs over it. Now, it works in single player but in multiplayer it works for no one. I don't even want it to replicate, I just want it to work for every one on their own device. How can I do that?

#

like this everyone can see the others bending grass but not themselves lol

obtuse field
#

How does Fast Array Replication interacts with maximum size of replication? Does it chunk it by itself, or do I need to chunk it with the RPC?

drowsy meteor
#

hey guys, i'm stuck on making a simple multiplayer leaderboard, display name and score on all player widgets, i created 2 widgets (one to hold the name and score and the other has a container for all player slots), here is the code on how i made it , i followed a youtube tutorial for the replication part

#

the last function call there is related to the UI where it adds components and such , this code should work fine no ?

fossil spoke
#

This is completely wrong

#

Whatever tutorial you followed was garbage

#

@drowsy meteor Just use the PlayerState

#

The GameState (which all Clients have) has a list of all PlayerStates (each Client has its own PlayerState).

#

Therefore you can create a Widget (such as a Scoreboard) which when opened will loop through all the PlayerStates and make a "slot" for that Player to list out its details./

drowsy meteor
#

any suggestions on how to make the leaderboard because i'm feeling quite blocked

fossil spoke
#

You can have the Players Kills, Deaths, Score etc in their PlayerState

#

Which you can replicate to all other Players