#multiplayer

1 messages · Page 165 of 1

fossil spoke
#

I forgot what they are called exactly.

#

Sorry, i made the assumption you are using FInstancedStruct

#

You definitely want to call NetSerialize on the elements.

formal solar
#

Just a sanity check, 'listen server' PIE testing is what I want to prototype with for hosted (non dedicated) multiplayer with steam sessions yeah?

fossil spoke
#

SafeNetSerializeTArray_WithNetSerialize<31>(Ar, ReplicatedSockets, Map);

#

Take a look at that function. Its in the NetSerialization header

lost inlet
#

Play as client will make all players clients

grave lynx
#

hello, I have a trigger box on the map. On overlap, I would like to execute something on client only (or host only if server). I could run on server and execute client rpc. But is there a better way for this? Only relevent to owner maybe?

tardy fossil
#

dang i wish the CMC didn't handle control rotation.. the only issue with setting its tick rate low

#

but i guess it makes sense since control rotation is related directly to the direction you're moving

timid birch
#

Hi I was watching some old videos on optimization by UE and came across this Network Relevancy View Mode. Has this been deprecated?

wintry forge
#

Hello everyone, I am attaching my character to a scene component in the car actor. Server drives the car and Client attaches to the side seat. As the car moves forward, the Client slides into the seat slightly backwards. How can I solve this?

pallid mesa
half iris
#

Anyone any clue as to why this would return a not valid on the server, but is absolutely fine on the connected clients?

#

This is inside a character BP, and the character gets spawned by the player controller.

dusk fable
#

maybe use "get player controller " instead of get controller , see how it goes

quasi tide
#

Use OnPossess or something like that in the pawn

half iris
quasi tide
#

OnPossess only runs on the server

half iris
#

Unless I create a custom event that is fired through it and replicated to the owning client

quasi tide
#

There is one that runs on client as well, don't remember the name though

half iris
#

Yea I think it is the on controller changed one tbh

#

I now have control of the player on the client and the server side, so the setting of enhanced input was successful, meaning the ref was valid, yet the print string on the isvalid still activates on the not valid

#

Away from my pc though at the moment, will explain in more detail later

half iris
quasi tide
half iris
quasi tide
#

Very common thing that happens to some people in #gameplay-ai

vagrant grail
#

Why the input of the joined player isn't disabled for the client but does for the host even if I call the "Disable" Input method ?

gloomy tiger
#

Hey, do I still need to encode/serialize a TArray<FHitResult> I want to push from client to server or would this datatype benefit from FHitResult serialization and only submit deltas by default?

opal shore
#

is it necessary to mark a timeline as replicated on a multicast event_

hoary spear
#

Is it necessary to multicast a replicated timeline

#

shouldnt be, as in both cases the timeline should be starter from the server

muted reef
#

I wonder anyone tried modding for multiplayer stuff ? Like custom environments created by player and join with their friends. Like making that level accessible for their friends by sending pak files or so.

Will it work ? Is it possible ? Or my dumb ideas overkilling me ? 🥺

opal shore
#

the repnotify function only runs on set or as soon that variable is touched_

oak flower
#

Can anyone explain to me better how replication works? There is nothing wrong with the anim instance part, in my BP_ThirdPersonCharacter there is a bool variable called bWalkInPlace that, through a flip flop and the B button pressed, i alternate the value between true and false. And in my anim instance this boolean is controlling the animation that my character should perform, this part is working, but I don't understand why when I press this button on a client, nothing happens. Is my line of reasoning wrong? In my head I understood it this way: I press the B key, and only on the server is the WalkInPlace variable toggled, and as it is marked as Replicated:true, and replication occurs only from the server to the clients, the server sends back to the clients the value of this variable, which in turn will be consumed in the Anim instance and thus change the animation. When I do this on a server-side it works normally, but not the other way around. Could someone explain better how this works for me?

half iris
#

Does anyone know why UE spawns 3 player controllers when I try to test a listen server setup for 2 players (1 server, 1 client) in the editor?

hollow eagle
#

Assuming this is a listen server, it doesn't. It's 2 controllers, one of which is replicated.

gloomy tiger
half iris
#

Aha

#

interesting

#

Is it normal for your brain to melt when you are trying to learn replication?

half iris
gloomy tiger
hollow eagle
#

It absolutely is true. That one is hooked up on the client directly rather than replicated normally is an implementation detail and nitpicking at best.

#

Conceptually those 3 instances are just 2 controllers with one replicated to a client.

gloomy tiger
hollow eagle
#

Yes, but you're nitpicking what I said. It's not wrong, it's a different way of saying the same thing.

#

And it's important to be able to think in terms of both depending on what you're doing.

half iris
#

So then how does it work in the following context;

Upon the character getting possessed by the controller, I want to spawn another actor for each player (2 players). As far as I understand it we always want the server to spawn things to avoid players cheating in any kind of way. So that would mean I would only allow the server to spawn these actors, however, when I do that it does it 3 times, which might be correct, but is not what I was expecting.

How would I approach this? It has become clear to me that the udemy course I am following, albeit a high quality one, explains the concepts of replication in a very narrow context that does not allow me to learn how this works in my own contexts.

gloomy tiger
#

Also, spawning actors on the server isn't exactly only because of cheating per say. The reason why you want to spawn actors in the server is because otherwise how would the other connections get to know about its existance? The server is the man-in-the-middle of all clients and their interactions.

gloomy tiger
half iris
#

Okay check. Actor is set to replicate, and in the following screenshot you can see the execution line coming from On Received Controller Change. I then check if I have authority, and if not, I will go through the motions to spawn the actor through the server (by using the gamemode).

#

The result is that 3 golf balls spawn in my level.

gloomy tiger
#

You don't need this

#

Just unplug it and ⚡

half iris
#

wait huh

#

I unplugged it

#

and I still get 3 golf balls that are spawned

gloomy tiger
#

What is this doing

half iris
half iris
gloomy tiger
#

Also it's unlikely you need this On Received Controller Change - just use the ACharacter's Possessed (or would it be APlayerController's? don't remember from the top of my head)

#

Possessed -> Spawn

All you need, no requests and other 99999 functions in the middle & whatnot

half iris
#

Right gotcha. so I made those changes, now I have 4 golf balls on the server, and 3 on the client 🫠

gloomy tiger
#

🤔

#

Show me your function pls

#

Show me the Possessed event

half iris
#

Gotcha, here is the possess event in the player controller:

#

Beginplay in player controller

#

Server event for spawning the player character, running through the gamemode (for verification? according to the course).

gloomy tiger
#

Make this a Server RPC and don't go to the GameMode

#

Just replace this Server SVR Request Spawn Player by your SpawnPlayer

half iris
#

Okay this is progress. I am now actually reducing other errors that I was facing before, however, I am still seeing 4 golf balls but now on both client and server

gloomy tiger
#

Just spawn your actor right after spawning the Character, why not? ¯_(ツ)_/¯

#

If you have 2 Characters, you'd have 2 of this other Actor of yours - don't need to complicate

half iris
#

But should I then do that in my player controller, or can I do this inside of the player character

gloomy tiger
#

You can do it in the PlayerController, exactly after you spawn the Character

half iris
#

Testing now

gloomy tiger
#

Unless your golf ball has some sort of dependency of the Character that happens after it spawns or gets possessed by the client

half iris
#

Okay, now I have 3 golf balls on both server and client

gloomy tiger
#

3 on the client? Are you sure it's not 2?

half iris
#

triple checking

#

Server side pic 1:
Client side pic 2:

#

So yea definitely 3 on both sides

gloomy tiger
#

And how many Characters do you have? 3? 🤔

half iris
#

A print string on possessed indicates 4 messages from the server saying CharacterSpawned

gloomy tiger
#

BeginPlay of ACharacter prints how many times?

half iris
#

So the Possessed is firing 4 times. There are also 4 custom player starts in the level, but that shouldn't matter if I set the play in editor settings to 2 players

gloomy tiger
#

There's something weird going on right there

gloomy tiger
half iris
#

Beginplay prints 3 times from the server, and 3 times from the client

#

The order of those prints is the same every single time too, so after those 2 players have done their thing, it seems like a third player is added/initialized later

gloomy tiger
#

... which explains why you have three golf balls. Your problem is addressed, what's left is a mystery unrelated to the current matter.

half iris
#

Yea, and I just checked in the course project, adding a print string to the beginplay of the spawning of the character. there I see 4 print strings. Once from server and client for each spawned player

#

So that is definitely correct, question is why the exact same setup is behaving differently here

gloomy tiger
#

¯_(ツ)_/¯

#

Unless you expose more code, we can't be of any help

half iris
#

Alright, here comes the flow on the course project;

  1. Comes from the widget blueprint on a button press.
  2. Goes to Gamemode on the server.
  3. Goes back to player controller with the spawn transform information.
  4. Comes from gamemode, spawns player, possesses it, and then does some client side setting of input mode.
gloomy tiger
#

🤔

#

It seems you can remove your SpawnPlayer function from your BeginPlay

half iris
#

Well only if I use a widget to control the spawning right? Which is not what I want to do necessarily

gloomy tiger
#

Then you stop requesting spawn from the widget hehe

#

Because Widget is asking to spawn, but you also request upon spawning the PlayerController

half iris
#

haha, yea doing that stops any player from being spawned at all haha

#

Oh right, no in my project I am not using the widget at all to spawn the player

#

spawning happens exclusively through the player controller

gloomy tiger
#

Hm, aight - like, it seems you have 4 characters for 2 players; there is something weird going on right there, and if you're not using the Widget et al, then I don't know? 🤔

#

It smells like you have an ambiguity somewhere

half iris
#

Yea that is fair, it is very strange

#

Yea my main mistake so far, has been to try and convert a previously singleplayer project, into a multiplayer one 🫠

gloomy tiger
#

Make sure there's a single place calling this

half iris
#

Yea there is only one place calling that event

gloomy tiger
#

Wait

#

Are you auto possessing your Character?

#

I mean, GameMode defaults -> make sure it has no default Pawn assigned?

half iris
#

Yea default pawn class is set to none

gloomy tiger
#

Yea you gotta debug then

#

Print string out and about, plug/unplug nodes, etc

half iris
#

thats the name of the game it seems

#

Really appreciate all of your help and assistance @gloomy tiger

#

I will report back once I find the true issue

gloomy tiger
#

Cool beans

#

Just a heads up - this call below does not guarantee the Player has received/possessed their Character. In C++ we have AcknowledgePossession (https://docs.unrealengine.com/4.26/en-US/API/Runtime/Engine/GameFramework/APlayerController/AcknowledgePossession/), not sure how it'd work in Blueprints tho. That to say - if you do things that require the posssessed Character inside this function, expect it to be quite unreliable since there's no guarantee the entire possession pipeline has happened end-to-end.

wintry bobcat
#

hey there!
I took the third person template and attached EOS login to it.
when I become a p2p host on my beefy pc, everything works fine. but when weak laptop hosts, i get massive network stuttering on client.
how is this usually solved? is it maybe possible to pass the host to player with best pc before match starts?

gloomy tiger
#

Apart from that, I believe these are the two options you got:

  1. Optimize your game - mostly the CPU usage of it - as much as you can and/or,
  2. Take it for granted and put a disclaimer in your page saying 'to host the game you need a beefy pc'
#

I remember I've seen a game on Steam that had two minimum requirements - one for the host machine, and one for the client machine. Can't remember the game though.

#

But that's how it works - no matter how optimized your game is, the host will always be more resource intensive (in p2p scenarios). If your game is pretty well optimized already, then a disclaimer is all you have left - or you go to the 'transfer host' approach, which is complex and unless it's a serious serious (twice the word) project, I wouldn't bother. (Also, transferring the host doesn't solve the problem, it only has a chance to mitigate it. What if all computers you have available are as potato as the notebook you mentioned? lol)

wintry bobcat
#

by average I mean, idk, like 12/24 ryzen pc

gloomy tiger
#

I guess dedicated server would've solved this problem, but I cannot find any info on how many matches can average server host...

There are lots and lots and lots of factors here. It all depends on how you optimize the game. Dedicated Servers would definitely improve the experience of players in general, but as always, lots of trade offs as well - fleeting, extra costs, matchmaking, backends, etc.

empty bluff
#

Hi there, im trying to do a hanging bridge with physics, where each plank is tied together with the next one using a physics constraint. This is bad for replication i realize, but if I were to simulate on a server and just set everything when location/rotation changes, shouldn't it be possible to get something ok stable on a client?
So far i've managed to get the movement to look smooth by sending over loc/rot on tick (just for a test), it looks correct and all, but once i step out on the bridge as client, I get booted from it (ejected rather). Any suggestions what could be the cause of that?

gloomy tiger
#

shouldn't it be possible to get something ok stable on a client?

Probably possible. Not exactly easy. I think you're on the right track, though: simulate on the server, replicate the end result. But getting clients and servers seeing the exact same thing every frame goes beyond me. Not saying that's what you asked for; just imagining what would be your end goal. Regardless - never dove deep into physics + replication myself, so probably somebody else can help you out better.

wintry bobcat
#

@gloomy tiger anyways thanks for ideas. I am yet to learn how to optimize for cpu and networking, considering its just third person template without anything else going on. I will do my research into it~

gloomy tiger
empty bluff
gloomy tiger
#

Good luck!

wintry bobcat
#

I think it is intended workflow, someone on youtube said its best to mix

nova wasp
#

If you send an RPC with an actor pointer that's to an actor that might not be spawned yet on the client as it was spawned the same frame

#

Would it delay the RPC read until the actor is spawned? or just receive a nullptr?

ancient lily
#

if you execute it on the server and somehow got a reference to it, it must exist there

nova wasp
#

I mean an RPC from the server to clients

#

that has an actor pointer that will be spawned from actor replication

ancient lily
#

good question

nova wasp
#

My assumption is you can't assume one happens before the other and have to have a simple ID sent in the RPC and sent on the actor's initial data

ancient lily
#

if you immediately need to send something, probably validate it beforehand on the player side and if null, delay it for a second

nova wasp
#

and have the second of the two indicate both are present

fossil spoke
#

@nova wasp The pointer will be null

#

If the Actor doesnt exist yet on the Client

nova wasp
#

is there any idea of a "net ID" you can send in pre-iris?

#

I'm trying to help a friend with this problem fwiw, I might just direct them here

fossil spoke
#

Most everything is given a Net GUID after the first time its sent across the network

nova wasp
#

so could they send the FNetGUID in the RPC

#

and if the actor is second, it completes the "both are here ,do stuff"

#

and if the RPC is second it finds the actor and does the "both are here, do stuff"

#

that's my dumb assumption of how to solve this problem

#

assuming the actor being replicated is easier than just having it spawn FROM the rpc

fossil spoke
#

You want the client to hold onto the NetGUID and check every Actor that gets created to see if it has that NetGUID, to then process whatever the RPC was going to do if it existed?

nova wasp
#

no, only the one specific actor needs to override PostNetInit

#

It's kind of like, a player pushes a button which spawns an actor on the server

fossil spoke
#

But you would have to cache the NetGUID somewhere for lookup by that Actor

nova wasp
#

seems simple enough

fossil spoke
#

Sure, im just trying to understand what your trying to attempt

#

I mean, I guess it might work?

nova wasp
#

I guess the issue is they want the button press to be an rpc

#

and to spawn the actor from replication

#

and have the RPC know about the actor that's replicated

#

feels to me like the actor could just postnetinit and callback to that

#

with no rpc needed beyond the one to the server indicating the button was pressed

#

gotta go for a bit, thanks for the help

sinful tree
#

RPCs are only one way though. If you want to know the actor that was spawned, you could use an onrep "Actor" property on the player controller that initiated the button press or on some other replicated actor that other players can read that info from. When that OnRep triggers, you can check if it is valid, and if valid, then you know the actor that spawned on the client.

nova wasp
sinful tree
# nova wasp "or on some other replicated actor " would be just as complicated though, no? do...

An example would be, say you have an actor that is a "spawner" of some kind that you're interacting with that actually handles the spawning. If you wanted all players to know what the enemy is that it spawned, you could have that "spawner" actor set that OnRep reference on itself. When that OnRep triggers on a client, you check if it is valid or not - if it is valid, then it must exist on the client for it to be valid. This would then allow _all_clients to know that the particular "spawner" spawned that instance of the actor by reading that property of the spawner.

#

If you wanted it to be player specific, like only the player that triggered the spawning to know about it, then you'd use something like the Player Controller or their Character to hold that reference. If you did it on the player controller, then only the owning client would receive it. If you did it on the character, then anyone could potentially read that property (depending on the replication conditions) to know what thing it was they spawned.

opal shore
#

whats the difference between net dormancy awake vs never?

twin juniper
#

Hey everyone, I'm seeking some advice. I'm in the initial stages (design phase) of a multiplayer shooter project (TPS). I'm wondering whether it's preferable to stick with the current Character Movement Component (CMC) or to invest time in learning and implementing the new mover. It's worth noting that this project is intended for long-term development. Thanks!

fossil spoke
#

Mover 2.0 will likely stay experimental for a few releases and is unlikely to be stable and without bugs.

#

The CMC is very stable and reliable.

#

These should factor into your choice.

#

If your primary motivation is that Mover 2.0 is "newer", I would heavily reconsider what your plan is.

#

"Newer" does not necessarily mean better.

chilly haven
#

Hi,
I'm using IOnlineSessionPtr::FindSessions on PC but the TimeoutInSeconds I set (1s) is ignored and I get the default (5s). Known issue?

#

using FOnlineSessionNull

#

Perhaps I would have to compile the source and set LAN_QUERY_TIMEOUT

#

/** Amount of time to wait for the search results. May not apply to all platforms. */
float TimeoutInSeconds;

#

or any platforms...?

west cairn
#

Does any one have a moment I am still struggling with this button problem - i am so close with Adriel's help but stuck at what appears to be the finish line

#

I keep trying to map player input to call a server bool to update but nothing happens - i am getting a warning about ownership but not sure where I am missing this

#

Error reported:

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

sinful tree
west cairn
#

I have tried to set client as owner of the bp_button on box collider over lap to no avail

#

Adriel mentioned i need to map the player input now into the button but that high level of instruction just doesnt seem to get through my dense noodle here

#

All my RPC's set to run on server i thought was the right way for this type behavior from client to server

dark parcel
#

I think u prob misunderstood what he said

#

Wdym map player input to the button

west cairn
#

Hahha bro i prob am misunderstanding a lot more than that here

#

🥲

dark parcel
#

For ownership read the compendium pinned on this channel

#

U can't call rpc on actor you don't own

west cairn
#

Like i said i tried to set owner ship of the actor to client on overlap w the box collider for the button logic

dark parcel
#

So for client, it's normally the controller and pawn. And some things that is set to the player via set owner

west cairn
#

I just seem to not be getting any where

dark parcel
#

It's a pretty bad way to do it anyway imo

#

U don't normally want to set ownership for things that doesn't really belong to the player

#

Like a box that can collide for example in the world

#

Aside from bad design, it's easier to hack the game

west cairn
#

Well

#

I have a button

#

That is functioanl on client

#

but server does not get any bool update

devout sonnet
#

Is the game mode the only thing that exists on the server?

dark parcel
#

The only way for client to communicate with server is thru server rpc

#

That's the biggest tip that u need

west cairn
#

Its just a tutorial super noob question here , very much appreciating the knowledge

#

I have done that Cold

dark parcel
#

I dunnoe

west cairn
#

thats kind why im stuck again 🥲

dark parcel
#

Don't have your project

#

I see that you set the bool on input, in client machine, that will only update the bool locally

west cairn
#

Souldnt the RepNotify update it server side?

dark parcel
#

It's common to get stuck in multiplayer, the usual advice is to read the comedium at least 6 times

sinful tree
#

Replication is only one way Server > Clients

dark parcel
#

Then another 6 times if u are still stuck

sinful tree
#

RPCs is how clients need to communicate to the server.

west cairn
#

SO what is the ppoint of run on server rpc?

dark parcel
#

To run something on server?

sinful tree
#

That's to ask the server to do something.

west cairn
#

So why isnt my rpc working 🥲 lol

sinful tree
#

Replication is not the same thing as an RPC.

dark parcel
#

Read the compendium again >_>

west cairn
#

I promise i will never ask another question here before reading the compendium 10x

#

but i really just wish i knew why my button doesnt replicate and my rpc doesnt work at all as planned

#

Lol pls

dark parcel
#

Go simpler to learn, stop what u are doing. Try to sync a bool with client and server using input

#

Don't need time line , collisions etc

#

Get the basic down first

sinful tree
#

Currently you have an input, which is typically local only.
So if you're pressing that input on the client, you're then attempting to set the state of a variable on that client which won't replicate to anyone else, and then trying to send a run on owning client RPC which this actor doesn't appear to have an owner.

If you're pressing that input on the server, you're then attempting to set the state of a variable on the server, which should replicate to everyone else, and then trying to send a run on owning client RPC which again, this actor doesn't appear to have an owner, so you get the error.

west cairn
#

I did go simpler w adriel yesterday w used a vector first with remote auth

#

errr not remote

dark parcel
#

Just change a bool on key press

#

Make sure it's sync Wether server do it or client do it

#

If u can't get that working yet, u won't get w.e u doing to work

west cairn
#

I dont see that datura isnt the RepNotify and Custom event set to happen server side

sinful tree
#

Normal flow is:
Input from Client > Run On Server Event ( on an actor owned by that client) > Server does things with that Input, such as setting replicated variables and calling any additional client/multicast RPCs.

west cairn
#

Thats why im so confused why that hack didnt work earlier when i set owner of the button to client shouldnt it have been enough to update teh server bool?

sinful tree
#

If you're attempting to run on server on an actor taht isn't client owned, you'll run into a similar problem as the one above where it ignores the RPC as the client isn't the owner of that actor.

west cairn
#

Man so frustrating everytime i feel like I am close but not quite seeing the light yet 🥲

twin juniper
west cairn
#

Ive got other simple things like a box pick up and displayed value working fine with repnotify but this bool..

fossil spoke
#

CMC will not disappear, it will just simply stop being updated.

west cairn
#

it haunts me

limpid parcel
#

there's a new cmc?

dark parcel
#

@west cairn keep reading, replication and server rpc isn't even the hard part for multiplayer.

fossil spoke
limpid parcel
#

aaa ic

dark parcel
#

I was stuck too, but once you get it, not hard

limpid parcel
#

what does it come with?

fossil spoke
#

Is designed to replace it

twin juniper
#

i c, but what if found a bug, it means I will need to fix it alone

fossil spoke
#

Go and read up on it?

west cairn
#

I just wish adriel had mentioned what he meant yesterday during our discussion i just cant make sense of the high level advice we left off on

fossil spoke
#

Its to much to explain here TBH

west cairn
#

He really helped me get things moving

twin juniper
#

np, getting familiar with mover 2.0 in preview

limpid parcel
#

aaa mb

west cairn
#

Replication in general is quite nice the way UE handles it, ive just been stuck on this problem for a while so its one of those phone a friend type moments

#

but i have no friends that do UE MP dev work

fossil spoke
#

Mover 2.0 will likely be unstable and unreliable for a few releases.

sinful tree
# west cairn it haunts me

Take this example - this is done on my PlayerController. Try doing it on your player controller and it should work just fine when you press the P key.

west cairn
#

Yes see!! thats exactly what i think adriel meant

#

mapping player input to this interaction

#

that custom event i wrote in on bp_button though i cant access thorugh the bp_thirdperson char howevver

sinful tree
#

And that's why right now, you should stop even trying multiplayer anything if you don't know how to reference things.

west cairn
#

I need to extend to the character with this now imo also Dat i think youve got it i will try to see what i can do

#

well why not just explain the solution instead ?

sinful tree
#

I already have.

#

I'm not trying to discourage you, more direct you away from something that is far more confusing

west cairn
#

Dude i said i am a noob so many times

#

there is no need to remind me of that fact

#

🙂

#

What is this referencing for the sake of completeness?

opal shore
#

Can I migrate the host status between players? Like instead of terminating the session when host leaves we make someone else server. Is this possibke?

west cairn
#

I will go away with my button problem i promise lol

twin juniper
#

is not that, its more baby steps 😄

twin juniper
#

to get a strong foundation

sinful tree
west cairn
#

I began working with unreal Jan 24th. Thanks for the help guys! I will try and see if i can get this to work 🙂

sinful tree
west cairn
#

Is it a cast to?

#

what is the implementation

sinful tree
#

No. A cast is a type-check.

dark parcel
#

Totally shouldn't be doing multiplayer yet. You are trying to sprint before you can walk

opal shore
#

For persisting the game I need dedicated servers there's no other way?

west cairn
#

listen im just trying to learn the utter basics of MP with a simple button press

#

in no way shape or form would i try to make mp game on my own

#

i can promise you of this

dark parcel
#

Datura have already explained the basic and what you have to do

#

Many times actuallt

west cairn
#

but to reference with a blueprint what exactly was meant? Am i missing a nodeI should be thinking of when trying to do this? lol sorry for being new i guess

sinful tree
#

And you shouldn't be trying to learn the basics of multiplayer if you don't know the basics of Unreal/Object Oriented Programming.
There are many tools that you can use to get a reference, like overlaps, traces, etc.

west cairn
#

Very thankful anyways! appreciate all the help and input 🙂 best on your guys own stuff !! u got this

sinful tree
#

What that tool provides may only be an "Actor" reference in which case you may need to cast, or you'd use an interface or some way of communicating to that reference.

dark parcel
#

Watch blueprint communication by Matthew if you need some guidance on references

#

It's too long for anyone to cover

west cairn
#

I think people should always be encouraged to discuss and learn no matter what level - But i do appreciate your advice to try more single player local or even learning more basics of OOP is great fundamentals

#

Thanks cold ! matt's videos go HARD they are amazing

#

Best MP rep video out

sinful tree
#

It is foundational to multiplayer... Multiplayer just makes it worse as now you're not only having to think of what exists on the local computer - it can exist on multiple computers @_@

west cairn
#

UE needs to hire this man

sinful tree
#

And it may exist on some, but not others @_@

west cairn
#

Well ive been at it a week

dark parcel
#

It's an advice I would give to my self, I'm trying to help , as discouraging it may sound

west cairn
#

so far its not bad but when i am making my own stuff up off the path - all goes wrong haha

dark parcel
#

Got laid off during the mass firing afaik but he did get hired at some point

west cairn
#

Yeah the only way id think of is an interface for this blueprint interaction so thanks for the advice all !

#

aww 🙂 well i will watch like and sub to his unreal videos regardless ty for the lore hah

dark parcel
#

If it's something that collide with player

#

Just do the logic and check on server machine

#

Especially a box collision

west cairn
#

I can follow your instruction until the point of implrementation ')

#

I will try to stare at Dat's BP's and matts video , read some docs ty all

#

I really appreciate it have some fun guys its sunday nite!!

cunning pond
#

if i wanted to start digging into multiplayer programming with UE5, what would be a good target to hit, like a pong game or something basic?

sinful tree
#

A simple "pressure plate" kind of button where the player just needs to move on top of the button is fairly simple in multiplayer, as you can have it all done on the button actor itself.

  1. Detect a collision > Gate with "Has Authority" so that it only triggers on the "Authority
  2. Do whatever is required such as setting any bools and calling any multicasts.

A client needing to press an input to then trigger something on a separate actor needs you to be able to do several things:

  1. Detect if there is something to interact with when they press an input of some kind, this requires doing some traces, overlaps, or other means of selecting the actor you're wanting to interact with.
  2. Send an RPC to the server (through a client owned actor or component of a client owned actor) asking to interact with a reference to that specific actor (the RPC should have an "Actor" type input that you feed in the actor value to).
  3. The server can then use the actor reference and call an interface that is implemented on the actor or call to an "interaction" component on the actor.
  4. The actor component or the interface could then do what is required, such as setting any bools, and calling any multicasts.
#

Running on Owning Client can be done, but it usually requires passing along a reference of some kind back to the player that is performing the interaction and it doesn't necessarily need to be if you're able to control things with replicated stately things like bools, integers or enumerators that you can set with OnReps that can cause things to happen on the client without needing to call a Client RPC.

west cairn
#

Its super hand holdey and will absolutely get your feet moving. I dont reccomend trying stuff on your own otherwise you'll end up cursed like me trying to replicate a button press for way longer than you'll care to admit 🙂

dark parcel
#

Widgets don't replicate

west cairn
#

Technically a text render yes correct 🙂

#

But you'll get your feet moving with out these guys telling you not to do MP stuff early on. I figure why not go crazy and try what ever you want 🙂

cunning pond
west cairn
#

The issue is ownership as datura said above

#

My button is serevr owned

#

I tried a hack to make it client owned but as cold said its a bad praccy

dark parcel
#

what is even the button

west cairn
#

best to avoid and do it right

dark parcel
#

some pressure pad in the world?

cunning pond
#

oh i didn't read that entire thing above lol

#

i figured he meant a regular on-screen button like in a UI

west cairn
#

the button if you looked at the BP is a SM_Chamf_cube from the starter content , that is scaled to like .125 uniformly, then moves in some dimension like 10 UE units - i say just have fun!!

#

go for it !

dark parcel
#

and how do you activate the button? oN overlap? so it's like a pressure pad right?

west cairn
#

that book will get your feet movin! these guys are super helpful u got this

dark parcel
#

then no need for ownership

#

U just check the overlap on server like datura showed

cunning pond
#

how much is this book?

dark parcel
#

118 dollars

#

i wouldn't bother

cunning pond
#

uuhhh..

#

lmao

#

i haven't had much trouble just digging through the UE docs so far for what i've managed to accomplish

dark parcel
#

reading the compedium is enough for replication, RPCS and ownership

#

@cunning pond the only docs you need is the compedium pinned in this channel

cunning pond
#

ooh ok

#

thank you!

west cairn
#

Well give it a look if want a jump start project beyond compiling lyra=) !! u got this man

fossil spoke
#

Not sure why anyone would pay anything for a book on developing with Unreal, all the information you need is online for free.

west cairn
#

rofl never thought id say these words but ily datura. def helped get met SORTED man

#

Its a super great start for noobz needing a push! he asked for the price idk its surely not $110 thats all i know

#

Its just info sharing im not bashing the docs at all they are great. This is just an add on or dlc 🙂

dark parcel
#

didn't notice I get routed to Australian website

#

still expensive tho

#

not attacking anyone btw

#

it's good to push your self

west cairn
#

I mean $36 is indeed pricy. that rounds up to 1 copy of Helldivers2 man!

dark parcel
#

we are trying to be helpful by saying you should climb step by step

west cairn
#

Which is a barrel o fun 🙂 i hope u guys are working on killer MP experiences too

dark parcel
#

not knowing OOP or references and jumping to Multiplayer is not gonna work imho

#

hence the only advice that can be given is to start from OOP first

cunning pond
fossil spoke
#

Buying a book on technology like UE5 is silly. A lot of information in it will be outdated in 12 months.

west cairn
#

Datura and Adriel forsure got me a lot of help and the lot of ye i appreciate vastly. id just say read and make as much as u can - have fun with it. great group of ppl to create around

#

dont be afraid to ask dumb stuff some one will maybe say something that kicks ur butt into gear

dark parcel
#

reading is good, I love your enthusiasm, I am learning my self too and a pleb in multiplayer but for what you are doing, all the info are laid down in compedium

cunning pond
#

so without making assumptions of what material i'm using to learn, what is a good starting project; for me i feel like i learn best by just trying certain things out once i have a handle on the basics

dark parcel
#

for free and compacted to a number of pages

dark parcel
#

you probably want to start with turn based game

#

Board game, chess, etc

cunning pond
#

ok

dark parcel
#

There are more features you do have to cover if you are doing FPS or TPS

#

client prediction, server rewinding are one of them

fossil spoke
#

Honestly, try opening and closing a Door in Multiplayer with a UI element for initiating the interaction.

#

You will have enough trouble with that as a beginner.

cunning pond
#

like opening a door and making sure that other players in the game see it open?

fossil spoke
#

Yes, all Clients and the Host must be able to open/close the door.

dark parcel
#

imo multiplayer is about keeping everyone world in sync

#

at least visually

west cairn
#

Agreed Cold!

Kekedot was a pretty inspiring poster on youtube also that got me wanting to tinker with mp. lol they all make it look so simple ! then you get infront of your own implementation 🥲

Adriel here said something along these lines that you want to approximate your game state from the server to all clients in as efficient of a method as possible. whether this involves net cull , or special rules is up to the experienced net coder.

I suppose as noobz the best we can do is read like mad, tutorial until blind and stay positive.

hoary spear
west cairn
#

wooow big hugs and thanks to all who helped me make the little functionality I wanted to tonight. I couldnt have done it with out all the super help (Adriel yesterday too! superb all of you rly i mean it).
I wanted to do everything on bp_button at first also!! But ended up going with interface.

And also Matt is 100% on point saying UE books tend to go out of date about as fast as well any textbooks i guess 🥲 (im lookin at you calculus 12th edition!! smirking at me with money eyes)

flat night
#

hey guys, I want to have a system that keeps count of enemies that are spawned in an area and calculate the distance between them and players so that I can spawn additional one based on how many there are close to any player. So far I was spawning doing the calculation in the GameMode, because it's server side, but perhaps there's a better way to handle this, than the actual game mode? I heard that Subsystems might be good for that, but not sure how exactly to use them with the rest of the systems available. How would you do such a thing?

hoary spear
#

Spawner manager i guess

#

Youd probably want a spawning subsystem to keep a clamp on max enemies etc

chilly haven
flat night
#

what type of Subsystem would that be? There seems to be a lot of choices

hoary spear
#

Worldsubsystem

#

Doesnt need to survive world destruction

half iris
#

@gloomy tiger It has been resolved 🙏

I am still in the dark about what caused the issue in the first place, however, upon checking the Event OnPostLogin event in the gamemode, seeing it was only ever registering 2 controllers logging in, I figured I could hook the player spawning up to this logic. And this made it work.

Now only 2 golf balls spawn, on both client and server, and I can control them both too 🙂

flat night
crisp shard
#

Just out of curiosity, what is a good way to think of a subsystem? I’m having a hard time thinking of why you’d use one vs something else. What makes it unique or makes it valuable to choose over something else that could do the same logic?

chrome bay
#

The only real advantage is they have a strict lifetime which usually makes them easy to access. Otherwise, nothing.

chrome bay
#

Am example is that a UWorldSubsystem has a lifetime that supercedes actors, so they are always easily accessible to any actor at anytime

crisp shard
chrome bay
#

Subsystems are nearly always C++ only

crisp shard
#

Lmao wel then. Subsystems are not for this guy!!

dark parcel
#

@crisp shard I like the encapsulation, instead stuffing my Game Instance, I can have a subsystem instead for the loading screen

crisp shard
dark parcel
#

not possible in bp

#

all widgets get destroyed during hard travel without interference

lament flax
#

hello,

on server side i am calling a interface on a replicated actor, this interfaces call another one with a param (1)
the thing is, the param went back to default on the interface fire (2)

any ideas ?

crisp shard
dark parcel
#

you can have your custom actions for Editor there without overriding the Engine class

static lava
#

I'm sure its a trivial question, but how do you predict stun effects on client?

#

To prevent correction rubber bending when client01 stuns client02

#

Since the server side the character is already stubned i.e. cannot move but locally its not yet replicated thus it predicts movement until gets the stun tag from server and rubberbands

#

What is the solution for this?

chrome bay
#

Unless the client being stunned can predict being hit by the effect in lockstep with their movement prediction, there isn't one

static lava
#

But then how do games like wow or lol handle these?

chrome bay
#

No idea tbh. Probably use a completely different networking model to UE.

static lava
#

I was thinking of using rpc to add tag on client first and expect a callback

chrome bay
#

But since the controlling clients movement is essentially predicting ahead of the Server, it won't be able to successfully predict something it doesn't know about.

static lava
#

And a safety to fire on server anyway if client doesn't respond in time

#

To prevent cheating

#

This would work, right? Issue is it is 1 ping there 1 ping back in wait time

chrome bay
#

Client01 can't know ahead of time about things client02 might do to it is the problem

#

Unless you can predict everything ahead of time, something will eventually cause a missprediction. It's the same reason any Stamina system driven through gameplay abilities has the same problem.

warm lintel
# static lava Since the server side the character is already stubned i.e. cannot move but loca...

If the ability it's self is predictable, you could opt to use the same conditions on the client as you do on the server.
That is to say, if you're stunned you can't move, and you predict on the client that the unit in question is stunned, as such it can't move until the ability either
A) gets corrected and the stun prediction is rolled back
B) gets the server update and waits for the stun to end

chrome bay
#

You can't predict in this case because it's another client applying the effet. That's the problem

#

If the client is applying effects to themselves, that's slightly easier because you can apply them in lockstep with movement simulation

warm lintel
#

Gotcha. missed that part 😅

static lava
#

I mean like this: caster tells client the intent of slowing target--> server does gas stuff and tells client target that he is slowed--> waits for .2s if it responds stops wait and continues, if it does it slows client target's char on server

chrome bay
#

But you have no way to predict what another player is doing ahead of time

static lava
#

So caster->server->target->server and if target doesn't respond cast anywas

#

Im just trying to eliminate the target side jitter

chrome bay
#

Sounds like a lot of complexity to avoid a small jitter that players won't notice most of the time

#

I'd probably just increase the amount of smoothing on the target client instead.

static lava
#

I know it cant be predicted in a way to eliminate latency i'm just trying to avoid a correction on speed change

#

What are the downside of increasing the smoothing?

chrome bay
#

less accurate world view, less accurate mesh positioning relative to servers actual view of things. Might not feel good etc. Could be a bunch of things but it really is situational

static lava
#

This video is badly recorded sorry for that

chrome bay
#

But a client telling the server "slow this other player down" authoritatively sounds like another avenue for cheating, if that is a concern

static lava
#

But as you can see the cloved client was on the location of ggecfire that is spawned at the moment he got slowed

#

And he got janked back really hard more than 2 meters

#

Basically that is what i'm trying to fix on high latencies

chrome bay
#

At high enough latency players will expect things to not be smooth

#

That's on them really

#

You only need to ensure a decent experience at the sort of latencies you expect

static lava
#

But it will jank back on lower latencies too just less

#

So generally it is better to rubber band high latency players than tocwait latency×2 for smooth no rubber banding?

chrome bay
#

The problem you've got is this, how can one client tell another client "i am going to slow you down a second or so from now" reliably?

#

Especially when the caster is seeing the target BEHIND time by at least their ping to the server + the targets ping to the server

static lava
#

In my "solution" caster tells server, it tells client and applies on self thus it basically waits the latency difference

chrome bay
#

But the target is already ahead of the server, by the time that call arrives it's still too late

static lava
#

But sith high latency it can be a 200ms delay not to mention thd traffic

#

Is it? As target gets slowed before server this was

chrome bay
#

For ref, if you play either paragon or fortnite with enough latency, you still have the same issue.

#

You can't avoid miss predictions when two clients are interacting essentially

static lava
#

How high is the acceptable latency for this to appear?

chrome bay
#

Just have two players walk into each other and witness the chaos unfold, even at low latencies.

#

It's an unsolvable problem in a predicted server auth model

static lava
#

But it is a physic issue no?

chrome bay
#

It's the same inherent problem. Two clients are simulating things ahead of the server independently, but every other object in the world is behind them.

static lava
#

Other games like lol or wow cannot send data faster than light either

#

And they must be server authoritive

chrome bay
#

Any prediction that needs to reach outside of the movement sim is going to have the same issue ultimately

#

Game like lol/wow have their own solutions for masking it

#

But they undoubtably still have to content with the problem IF they do any form of prediction, which they also might not

#

A quick google search tells me that WOW uses lockstep networking, so they have to hide input latency instead. Unreals' networking model doesn't really lend itself to deterministic lockstep

hoary spear
#

Can barely play wow with high ping

#

Even pve

chrome bay
#

There's the answer then

warm lintel
chrome bay
#

lol indeed

warm lintel
#

and you WILL rubberband (dota as well) and see your effect happen and be undone

static lava
#

I tried playing on us server with 200ms ping and it was rather smooth

#

On wow

hoary spear
#

200ms aint terrible*

chrome bay
#

Due to the physics laws of the universe we occupy, there's no closed form solution. All you really gotta do is find a way to hide misspredictions as best you can.

static lava
#

What i noticed is that abilities activate with delay

chrome bay
#

Yeah so input lag

hoary spear
#

And cooldowns get weird

static lava
#

That is why I thought it works as I said with client->server->target->server

chrome bay
#

Aka, they're asking the server to do something and waiting to get the data back, so no prediction

#

Downside of course is, your games responsiveness is dependent on your latency, which for the kind of games UE generally is targeted towards is not ideal

static lava
#

Would this eliminate correction? Is my solution viable?

#

I'm creating an rpg with button spells

#

So not a fast paced fps game

crisp shard
#

i am be out of pocket here, but why would you need a client to predict a stun in the first place?

static lava
#

Predict might not be the correct term

#

I'm tryibg to remove the rubber banding caused by movneent prediction

crisp shard
#

im also assuming you mean the client recieiving the hit

static lava
#

As ib the video I linked

chrome bay
#

Presumably the "stun" effect affects movement

crisp shard
#

ahhhh

chrome bay
#

Which is a problem because whoever is moving the pawn is simulating ahead of the server

crisp shard
#

yea, trust me i am struggling with the same problems lmaoo

#

movement w cmc and mp is grossly limited

static lava
#

Yes basically the clients jeeps moving as it recives the stun that stops movement too late

#

And it causes a correction, pretty severe on high latency

#

But even pn lower ones

crisp shard
#

i haven't figured out solid solutions

chrome bay
#

Unless the client is stunning themselves, there isn't a perfect solution. You just need to find a suitable way hide the correction and hope your players are sensible enough to not play at stupid ping

crisp shard
#

gas seems to be best use case but too complex to redo all my code

#

and i dont know gas

static lava
#

I'm thinking of solving it via input lag instead of correction

crisp shard
static lava
#

So basically he gets stunned later, not sure itcis viable tho

chrome bay
#

If you want to use input lag then you can't use the engines character movement system AFAIK.

crisp shard
#

lmao damn

chrome bay
#

Not sure if it supports a fully server-auth mode

crisp shard
#

i thought mover 2.0 was xoming w ue5.4

chrome bay
#

mover 2.0 will have exactly the same issue

#

It's not an issue with the way CMC works, it's a fundamental issue with the entire client prediction paradigm

static lava
#

I mean server tells you to stop, target to stop, target stops then calls server back

hoary spear
#

Just check ping on tick and kick if >55ms

chrome bay
#

a client cannot predict something it doesn't know is going to happen

static lava
#

Its not predicting

chrome bay
#

The controlling client IS predicting movement

crisp shard
chrome bay
#

It's movement is ahead of the server, everything else is behind

crisp shard
#

lmao

static lava
#

But if client is stunned beforecserver it would solve it no? If server waits for target to stub itself, and it recieves client's movement prediction along with the response rpc of it being stunned no?

#

So you mightvbe stunned longer when you get higher latency but no rubber bandibg

chrome bay
#

But this is the whole point - how can it possibly stun itself BEFORE it knows another client is going to stun it.

#

the server would have to tell it, at which point, it's already too late

hoary spear
#

Client to client prediction data?

#

Risky.

static lava
#

Stun will be applied with a delay, but it won't cause sync issue no?

#

As target is told to stun by client it wont move anymore when server stuns itself

chrome bay
#

Even if you could get this to work, there is no way it's going to avoid a correction in the real world. Perfectly synchronising a timer or delay over a network is also impossible.

#

IMO, it's not worth the massive complexity to avoid a minor rubber band

hoary spear
#

True that

chrome bay
#

Which is something players are already very used to dealing with

#

And something you can "hide" with some smoothing, up to a point

#

If in doubt, KISS 😄

static lava
#

Syncing up timers is a non issue, worse latency players will be on the bakc foot iwth longer stuns but still it will look smooth no?

#

As 100ms extra stun is not too noticable

chrome bay
#

I've exhausted my opinion on it at this point tbh

hoary spear
crisp shard
chrome bay
#

"Keep It Simple, Stupid"

warm lintel
#

Keep it simple, stupid 😛

crisp shard
#

lmao easyyy

chrome bay
#

Not meant in a derogatory way in this case ofc

#

But it feels like we're trying to galaxy brain a solution to an unsolvable problem

crisp shard
#

of course, and i fully agree w you, i've been focused on this exact topci for about 3 months, i've implemented as much client prediction as possibel and made any addiaiontal movement things either no longer exisiting and replcaed by another mechanic or had something done in cpp to help but yea, the testing at high latenecy wanting zero correction seems very difficult to do without custom cpp work

hoary spear
#

"If we apply the worst latency to all players!..."

chrome bay
#

high latency and zero correction is just pointless to even aim for

#

And players don't even expect it anyway

crisp shard
#

i think it can actually be beneificall in some cases

static lava
#

To sum it up we either get rubber banded or work a lot to get delay like he gets stunned later

chrome bay
#

Unviersally all players know that high latency sucks in multiplayer, even if they don't know why

crisp shard
#

at least latency in general

hoary spear
#

Players with high ping know they got high ping..

#

They know they have a lesser experience

chrome bay
#

In HLL we had a hard cap on something like 400 ping where the game would be literally unplayable

#

But it broke down way before that usually

hoary spear
#

Im not sure im gonna fix 200 even 😅

chrome bay
#

But after 400 or so we wouldn't even accept client shots, just get ignored

crisp shard
#

lol some things break in mine at even 200ping

hoary spear
#

Sorry mates but it makes it worse for everyone

crisp shard
#

lmao same

chrome bay
#

you can smooth most things out in a fairly regular 30-80 ping game. For parts of the world where infrastructure isn't as mature or if your game isn't that popular you can usually target 100-200 max, but players usually accept the game won't be smooth by then.

#

Can't really put precise numbers on it though because there's far too many factors to consider

#

But that'd be my go-to probably

#

A playable experience sub-100 is good enough for me

crisp shard
#

im aiming for 200ms ping max, as i said it breaks certain things. not most things just some thigns but 200ms ping would be my cap for ideal highest ping, but i realize i can't stop it completely

#

testing at 100 or less, it's virtually unnoticeable

#

i also test w 1p packetloss

chrome bay
#

tl;dr, multiplayer is hard, make it easy for yourself when you can 😄

static lava
#

Truer words never spoken

#

Here i though GAS was complex

chrome bay
#

well GAS is a whole other discussion

#

and a mixture of feelings

static lava
#

Ikr, that is what im trying to jerry rig together with movement

crisp shard
#

lmao i say jimmy rig

wintry forge
#

Hello everyone, I have 2 players, one of them drives the car and has access to 4 cameras in the car. My other player is sitting in the next seat and I don't have access to any cameras because I don't have possess. If I do "set view target with blend" it feels like I'm watching the person driving the car and I can't take control. What can I do for this situation?

static lava
#

Why don' you add a camera for the passenger to use?

#

Itt can just possess a passenger seat that is attached the same way the passenger char iscattacked to the car

#

And passenger seat had its own cameras

opal shore
#

what are the steps for shipping online game? 1. make sure all replicated 2. sessions 3. steam optionally and thats it?

oblique arrow
#

is the OnPostLogin function called only on the server?

lost inlet
#

yes, gamemodes only exist on server

#

and not calling Super there also seems like a bad idea

oblique arrow
lost inlet
#

if you're creating HUD, make a custom AHUD class or perhaps put it in the player controller

#

gamemode seems the last appropriate place to create UI

oblique arrow
wintry forge
modern cipher
opal shore
#

are these 2 equivalent?

shadow aurora
#

Morning everyone. So I'm trying to look at a way to handle this situation, and so far nothing I've tried has worked...

Basically, if a server closes or crashes while a player is on the loading screen transitioning to the server, they get stuck on the loading screen. I looked at using GEngine->OnNetworkFailure and GEngine->OnTravelFailure in the game instance, but neither of those seem to be triggered when I force close a server while the client is loading in... Anyone have any thoughts?

lament flax
#

can i trigger repnotify if i set the same value ?

high lotus
# opal shore are these 2 equivalent?

Switch Has Authority is just a check, you can put it after execute on server, and nothing changes. Execute on Server will run things with authority on the server (if possible)

#

@lament flax not in blueprints. I'm not sure the best way to do this, but for level instantiation I'll start the rep notify vars with things like -99 or a value you'd never see regularly.

lament flax
#

okay thanks

opal shore
#

do new joining players see the effects of old repnotifies?

lost inlet
#

they only get one variable update, the latest value

#

if you depend on all previous updates then you'll have to rethink what you're doing

dark edge
#

On that topic, can't believe I don't know this, but will repnotify fire on begin play or only if there's actually a change?

slow wing
# static lava That is why I thought it works as I said with client->server->target->server

To answer your question, you can do this. I feel you were perhaps misunderstood in the conversation above. You can have client A apply a stun, decided authoratively by the server, server will apply a stun ability to client B (the client A is stunning), server will wait at the start of the ability (sync point here) for the client to activate the ability that the server initiated on it, and respond. At the point of responding the client and server are at the sync point, and the client can predictively apply the requested stun on itself, and the server will apply the stun when the response is received. This will allow client B to predict the stun application that was decided authoratively by the server and initiated by client A.

Aside from the added complexity, client A is going to see a fairly delayed stun on client B. So pick your poison

lost inlet
dark edge
#

So the general form to be responsive to data at all times would be:
BeginPlay -> do thing based on state
Repnotify -> do thing based on state
If you wanted to always be set up based on state no matter what.

lost inlet
#

well you don't really have to do it on BeginPlay, you can just do it in response to the state variable changing, unless you have something more complicated with sub-states

dark edge
lost inlet
#

not sure how that last message is relevant, but if it doesn't change from the default you don't get a repnotify until it actually does change on the server

opal shore
#

so then multicasts before a player joins are discarded?

lost inlet
#

yes, I'm not sure why there would ever be the expectation they would be buffered for hypothetical late joiners

high lotus
#

if you have an event on any change, it would also not trigger for the "late joiner" or whenever that repnotify becomes relevant (could be distance related as well)

hoary spear
#

This surprised me

#

Not an issue, but surprising

lost inlet
#

I don't find that surprising at all, it's the default value

dark edge
high lotus
#

if you wanted to see a change to 0, you'd want to start at default of -999999999999 or something you'd never see, and then going to 0 would fire off before begin play

#

(although i believe in c++ you can run rep notifies on non changed variables, but I could be wrong)

lost inlet
#

But if you are resetting something to a default state, you shouldn't expect it to behave or look any different than how it does by default

#

So why'd you need a rep notify for that?

high lotus
#

0 doesn't mean default necessarily

lost inlet
hoary spear
#

Beginplay or smth

#

Prob not beginplay but

dark edge
lament flax
#

The weird part is repnotify and arrays

#

Use nodes like "add" wont trigger it, but doing afterwards "Set MyArray (MyArray) will trigger it

#

Idk if its BP specific

lost inlet
lament flax
lament flax
high lotus
obtuse field
hoary spear
#

Is that worth it for something like an inventory?

#

Seldom changes, and limited size

#

Guess those inventory structs can be rather large when doing superstructs ;p

obtuse field
#

Imo, they are always worth it

#

The only downside is that you have to mark items dirty

#

But they have better performance, they eat less resources etc.

#

There are no downsides otherwise than marking items dirty

hoary spear
#

Why wouldnt fast array then be default?

#

Generally just delta replication

obtuse field
dusk fable
#

i hope im not interrupting with my question

#

i've got a small issue i hope u guys are familiar with it :
so in lobby , i have a 3d widget where players can see a list of maps and click to chose any map to load , the issue is that when client click on the map , the string variable stays empty , only the host can chose the map , how do i make the client change the map (string variable ) ?

dusk fable
#

yes

#

i tried several solutions , but doesnt seem to work , i replicated the variables , and events also

obtuse field
#

And you want give client an ability to change level on the host?

#

Then replication won't help you. Replication is one directional - From server to client

#

You should send a RPC to the server

dusk fable
#

i did , the run on server and all that

hoary spear
#

From a client owned actor?

dusk fable
#

basically a 3d widget that any one can click on , yes

hoary spear
#

Sounds like a no

#

All clients cant own it

dusk fable
#

i see

#

the thing is i was trying to change the level string var through a button press on the 3d widget

hoary spear
#

Thats usually a no can do

#

You must rpc through a client owned actor

dusk fable
#

if it doesnt take much of ur time , can u direct me a lil bit ?

#

otherwise i appreciate it < 3

high lotus
dusk fable
#

i'll give that a try , thanks champ

high lotus
#

@dusk fable a pattern like this, don't try to call execute on server from a umg referencing the player controller. - I could be wrong about this, maybe it's a step more than necessary, but it's been working for me

lost inlet
#

you definitely can directly call a server RPC from a player controller reference

#

it doesn't matter where it is

hoary spear
#

A 3d widget in a server owned widget component

dusk fable
#

i have the widget interaction through the player character bp

#

i got to work around that

#

quick question , do i make the "load level event " in game instance , or player controller , or where exactly ? (if theres a diff)

lament flax
#

makes more sens to have it in game instance

high lotus
lost inlet
#

well if it's an interface, sure, if it's an actual actor ref then you can

hoary spear
#

As in, can a playercontroller invoke an rpc on a server owmed actor? Didnt think it could

lost inlet
#

no?

#

if the player controller has a server RPC that affects the state of a different actor, sure that works

hoary spear
#

Right, ok

#

Thats what i thought. So the actor doing the rpc must be owned by the client invoking it

#

So for something like a strict server owned actor, the rpc must happen in another client owned actor (typically PC or Pawn) and go from there

graceful nexus
#

Anyone have any luck with switching VOIP settings for things like radios or intercoms? It seems like it requires some sort of 'reset' to be called to actually apply them (or a toggle mute is the only way it works for me)

dark edge
#

PlayerController:
IWantToPlayOnThisLevel(LevelToPlay) //Run on server event

Then your widget just calls that.

dusk fable
#

aight ill try this

dark edge
#

The code path should go like:
Widget button -> Controller.RunOnServerEvent //You're on the client here
Controller.RunOnServerEvent -> GameMode/GameInstance/Whatever.ChangeMap //Now you're on the server and can do anything

dusk fable
#

so on a map click , i set the string var , i send it to the player controller , and from player controller(run on server ) to game instance where the load level event is ,

#

ill test and see

obtuse field
#

Is There a shorter way to check if host is Server(Dedicated or listen, doesn't matter) than this?
UKismetSystemLibrary::IsServer(GetWorld())

Something like IsRunningDedicatedServer() without arguments or namespaces

empty terrace
#

how do I print an on screen message specific to a server or client? I want to debug and see what the value of a variable is on a server and client. Eg I have variable X but when playing multiplayer the value of X is different on server and client

obtuse field
#

How can I check is client is a listen server or remote?

hoary spear
#

GetNetMode?

obtuse field
#

Ty

high lotus
#

it's like rebuilding your entire game if you haven't built in a multiplayer flow from the start.
You can run listen servers, but offline / online is locally manipulatable without some central server authority

obtuse field
#

If you want to make your game multiplayer, you need to consider rebuilding whole communication system. It also depends on how much data you have to transfer over internet, how players most communicate with the server, how clients will communicate about things that are not natively replicated(like ISM)

maiden flame
#

It will also be impossible to prevent cheating. With a listen server, any host can cheat, and with an offline mode with no external server verification, any player can cheat.

#

If it's not competitive, that does not really matter though.

obtuse field
#

Is UGameplayStatics::GetPlayerController safe to use on listen server?

solar stirrup
#

It's always going to be 0 for clients and the listen server host

obtuse field
dark edge
#

You need to get what you have working and start testing in multiplayer right now.
Don't add anything new until you're up to parity with multiplayer.
It'll take you anything from 1 month to forever, depending.

dark edge
#

The fact is that nobody is making an uncheatable live service game as their first project

#

no 1 man team is doing that

#

probably no small team

dark parcel
#

you can let people host them self. Use steam to broadcast the games.

As for cheating, read what Adriel says

high lotus
#

most people pick a super huge complex game as their first project, learn a lot, retarget and do other projects that are more time / size appropriate until they can tackle the big project

fossil spoke
#

But there is certainly also something to be said for tapering expectations, especially for new folks to the industry

obtuse field
#

@fossil spoke Hey

#

Works like a charm

fossil spoke
#

Cool. Got a video?

obtuse field
fossil spoke
#

How effective is it?

#

Im guessing you managed to sync it well?

obtuse field
obtuse field
obtuse field
# fossil spoke How effective is it?

Also, during benchmark I would also need to make other threads into account. As foliage is generated asynchronously, so not all chunks are spawned synced with the client at the same time

fossil spoke
#

Glad to hear you arrived at a solution you are happy with.

#

This should also ensure your regular gameplay networking doesnt suffer either

obtuse field
#

And it can easily chunk data

#

btw. is unreal's TCP a real TCP, or is it UDP in disguise?

sinful tree
#

Unreal uses UDP from what I was aware, and adds some TCP-like features higher up the OSI chain so that it can do things "reliably".

keen hound
#

for some reason, the shooting isn't replicating properly. When I shoot, on the other the client the line trace comes from their camera rather then the camera on the player shooting

#

probably not a good image, but it should semi-explain what i mean

obtuse field
#

and owned pawn is player's pawn

#

so its getting camera from the player's pawn

keen hound
sinful tree
#

Apply Damage will only function on the server as denoted by that little icon on the top right of the node, therefore you only need the server to perform the line trace and call the Apply Damage node. It's also not good to use the nodes that gets player things by index in a multiplayer game. If the server needs to get the player's camera, you should be able to grab a reference to the camera from the character rather than getting the camera manager.

dark edge
#

that gets the LOCAL camera manager

keen hound
#

thanks for the help

obtuse field
opal shore
#

which is easier to replicate, animations or montages?

dark edge
#

that's not really a real question? What are you actually trying to do?

#

the easist thing to replicate is just some fundamental state

pulsar grove
#

has anyone encountered an issue where you get a gpu crash when joining a MP match, but works fine if you start it

obtuse field
#

Replicate state, e.g. which frame of the animation is playing

#

Or rather, at which frame should it start playing

obtuse field
#

Someone surely had similar bug

#

More help will cost you 10$ or logs

#

You can find 10$ in your pocket
Or you can find logs in ProjectName/Saved/Logs

pulsar grove
#

sec, getting a debug build

#

ty

vagrant grail
#

Why does my code doesn't work ? Like I'm trying to disable movement and camera movement when joigning the game level and somehow it doesn't work properly.

On the Client I still can move and rotate my camera, on the server I still can move but can't rotate my camera. It doesn't make sense to me as I thought changing a variable set to "RepNotify" on the server would call that function on both the client and on the server but somehow no and I don't understand why 🤔

obtuse field
vagrant grail
obtuse field
#

So it won't execute on client

vagrant grail
#

But from what I learned switching a RepNotify variable should be done on the server

obtuse field
#

Ok, my bad. I though that you are trying to RPC these values to the client

obtuse field
obtuse field
vagrant grail
#

But I wonder if it does make sense to use an RPC here as to me it doesn't make sense

#

Even like this it doesn't work. As it's being called by the GameMode which is server only, somehow it works only on the host. I don't understand why

meager spade
#

how would you authenticate a dedicated server for an external service?

meager spade
#

like i said, for an external service

#

they have no auth tokens unlike players

obtuse field
#

Which type of authentiocation? E.g. QR code? 2Fa?

#

Ah, this

#

Idk then, unfortunately

obtuse field
#

Not the cleanest solution

#

But definitely the dump one

fossil spoke
dusk fable
#

quick question , i have a 3d widget , both host and client trigger click events regardless of whos clicking , is there a way i can make each player control it seperately ? (the widget is for map selection )

west cairn
# dark edge what

Heh adriel NP it was the 2nd part to the simple button problem u helped me with. (Soln: i had to call RPC from player controller and used a interface for bp_playercontroller-bp_button connection)
I owe you a coffee i believe sir! You, Datura, and others really helped me get some practical understanding the otherday. Appreciate you both and others tremendously. I will try to pay attention to your net code reccomends and pop by from time to time 🙂

hoary spear
thin stratus
#

What was all needed on the UObject side when wanting to replicate it?
IsSupportedForNetworking? Anything else?

hoary spear
thin stratus
#

@chrome bay :P your pages cert is invalid

hoary spear
#

Unacceptable!😱

#

If the certs are not valid, how can i trust the content....

thin stratus
#

Also, is that even up to date?

#

I thought one uses the AddReplicatedSubObject function/s now

hoary spear
#

Ohh thats prob true. My search-fu isnt on par these days, cant even find the post that had the instructions posted a few days ago 😅

thin stratus
#

I found instructions, but they aren't saying much beyond the functions

#

They don't talk about what has to be done to the UObject itself

#

So, one thing I'm not sure about: Do I have to create the UObject locally too?

#

And if so, what links that to the Server's?

#

Alright, so either that is said somewhere, or I'm too blind, but you gotta create the locally too, which is what I expected

hoary spear
#

I didnt think you had to 🤔

#

Damn. So howd you link em

thin stratus
#

Well, it made sense to me. I know that runtime create Components also need that

#

The ue docs generally suggest it

#

In general, these are the guidelines to go by to determine if you can reference an object over the network:

  • Any replicated actor can be replicated as a reference
  • Any non-replicated actor must be stably named (loaded directly from a package)
  • Any replicated component can be replicated as a reference
  • Any non-replicated component must be stably named.
  • All other UObjects (non actors or components) must come directly from loaded packages
#

Followed by

#

Stably Named Objects

Stably named objects are simply objects that will exist on both the server and the client, and have exactly the same name.

Actors are stably named if they were loaded directly from packages (not spawned during gameplay).

#

That first point is what I remember. E.g. you can just spawn a replicated UActorComponent and hope it somehow gets created locally

#

At least we never were able to do that on The Ascent

#

But that's 4.27, so maybe things changed

#

What I did now is this

#
        UNKAchievement* DuplicatedAchievement = DuplicateObject<UNKAchievement>(Achievement, OwningPlayerController, FName(FString("AchievementObject_") + Achievement->GetAchievementTag().ToString()));
        Achievements.Add(DuplicatedAchievement);

        if (OwningPlayerController->HasAuthority())
        {
            AddReplicatedSubObject(DuplicatedAchievement);
        }
#

That seems to work, cause in one of those Achievements i have a flag that I set to true runtime and print in an OnRep

hoary spear
#

Perhaps this should be included in compendium 😇😆

chrome bay
chrome bay
fierce egret
#

I need help. Dedicated server should be able to read the widget. I am not talking about reading another client's widget. I need to just create or construct a widget in the given class and check the default values of the widgets in it. Is it impossible to do this?

lament flax
#

dedicated server is headless

#

if i remember correctly, if you try to create a widget on server it will give you null

fierce egret
#

Yes but if i "construct" the widget class, i can reach the widget variables. But given variables of these widgets are not correct

lament flax
#

what you have to do is :
give client some values and let him check if its valid on his widget

#

(maybe, prob a better option)

fierce egret
#

I summarise my problem:

When the game starts, players send each of the slots in the inventory widget class to the server and server saves them to Struct Array. In this way, each client's inventory is created when the game starts.

But I want to add an enemy AI and I want it to have the same inventory shape as the players. Since the AI is not a client, it can never read the widget and send it to the server and have the inventory. In this way, a client has to create a widget for the AI and send it to the server. This makes the system very complicated and long. That's why I wanted to change my whole system so that the server can interact with the widget. I don't know how else I can do it

thin stratus
#

Is that correct?

fierce egret
#

I want to set the inventory shape from the widget because I don't think I can set the position, shape, default variables (each one has about 10 variables) and size of each of the slots anywhere else but the widget editor. The widget only represents the shape of the inventory and the properties of the slots when the game starts. (As example client checks the widget and says to server that widget has 2 weapon slots, 1 armor slot, 1 head slot). The server saves them to the array once and has nothing else to do with the widget.

fierce egret
#

I just want the server to be able to read this widgets default values by itself instead of the client sending it to the server

hoary spear
#

Ahh i see

vagrant grail
hoary spear
#

Nothing comes to mind except actor not being set to replicate 😅

fierce egret
# hoary spear Show some code

Sure.

  • Client loops all widgets in inventory tab at begin play, (inventory component)(screenshot 1)
  • Client checks variables of every slot and sends them to server to save them, (slot widget)(screenshot 2)
  • Server takes it and saves to replicated array (inventory component)(screenshot 3)
hoary spear
#

So... inventory lives in widget? As exi asked?

fierce egret
#

Just setup

#

Yes, setup lives in widget

hoary spear
#

That is rather strange

#

And then inventory comp gets the 'setup' through server rpc's

fierce egret
#

Yes, because server cant read widgets and player's inventory shapes are stored in widget

#

like that

hoary spear
#

But why is client dictating what slots and sizes they gotn

#

Wouldnt that be servers job?

fierce egret
#

I determine what the inventory will look like from the widget, how does the server know that?

#

Not only size and position. I also set the properties of the slots that will affect the game in the widget, like Banned Item Types.

hoary spear
#

Right. But this could still be provided from the server. Widget just interprets this data and maps them to the slots you have (and resize if appropriate)

fierce egret
#

So should I store the slot information in a something like DataAsset instead of a widget?

static lava
#

I'm having an issue with this rubber bending on locally cast predicted abilities with GAS

#

this is how it's called

#

and as you can see it is set on Local Predicted, using the same movement comp setup tranek shows in his documentation and write the result of if the ASC has the tag the gameplay effect applies

#

on client if is false both times while on server it is false and true as it should be, but character is only stunned when the server side runs

#

sorry for the long post but I'm completly puzzled of why this doesn't work

#

Aren't application of GE supposed to be predicted? are there some pre requisites for this to work?

vagrant grail
half iris
#

If I:
-> use my PlayerController to Spawn a PlayerCharacter,
-> and then after validating that the playercharacter exists and is possessed,
-> I change a value of a variable inside of that PlayerCharacter
-> Is that enough?

When checking in the PC if the variable is valid, it returns IsValid.

When I subsequently check the variable in the PlayerChar, it returns IsNotValid.

And I do not understand why

#

I have read the compendium and watched 3 or 4 videos on the topics of multiplayer and replication, but I do not understand why this would happen

hoary spear
#

It must be set to replicate

#

Afaik

half iris
#

oh wait, I am setting the variable only on the server, not on the client. I suppose setting this variable to replicated would solve my issue probably

hoary spear
#

Minimum 6 times

indigo brook
#

Hey guys, quick question, in multiplayer, in a actor class, how do I get a reference to the player character

hoary spear
#

Usually a cast suffices

#

As high as possible

indigo brook
half iris
#

Okay, setting the variable to replicated solves my client complaining about the reference being not valid. But it still does not execute the code as I wanted it to

indigo brook
hoary spear
#

It knows a player

#

It is ofcoure the correct player if cast succeeds

indigo brook
#

Also, what if I want to stay away from casting, is it possible to still get current player's reference?

#

Also, thanks for responding!

hoary spear
indigo brook
loud heart
#

Hello.
How do I launch two clients with different user accounts in a PIE session.
From command-line, I can do that quite easily.
start UnrealEditor MyProject -game -windowed -resx=1280 -resy=720 -online -account=user_2
start UnrealEditor MyProject -game -windowed -resx=1280 -resy=720 -online -account=user_1

dark parcel
#

If you are in the stage where you are not sure what to do with casting, doing multiplayer will really make learning the basic much much harder

#

because u will be dealing with multiple instances that possibly not sync

half iris
#

Alright here is what I am trying to do;

Goal:

  • Upon LeftMouseButton click; Fire golf ball actor into chosen direction.

What I am doing currently:
-> EnhancedInputAction registers input, checks if our reference to our golf ball is valid. If yes, fire the SRV shootGolfBall event.
-> SRV shootGolfBall event checks if our reference to the GolfBall is valid. If Yes, Check if we are allowed to shoot. If yes, Fire ShootGolfBall event on the player character that requested the SRV event.
-> ShootGolfBall event fires, and communicates to the GolfBall actor (That is owned by the relevant PlayerChar) so that it can apply an impulse to the GolfBall Actor.

The GolfBall Actor has bReplicates and bReplicatedMovement both set to true.

Result:
-> All print strings show that we go through the whole flow, yet nothing happens on the screen for the clients. It works on the server, but does not replicate the movement back to the clients.

Anyone any clues to where I am going wrong?

#

Accompanying visuals in the described order:

hoary spear
gloomy tiger
indigo brook
# gloomy tiger Curious - why stay away from casting?

Usually to lower the memory usage, in this instance I just want to find which exact character is running into this volume. In single player, all you do is GetPlayerCharacter == and you're good to go, but in multiplayer it's a bit more confusing with authority

dark parcel
#

that's got nothing to do with single player or multiplayer

#

also cast to the base class

#

you can just cast to the player controller (not your custom player controller) and it's free

#

because your player controller will always be loaded anyway

gloomy tiger
dark parcel
#

💀

#

also avoid ticks etc

#

without context

gloomy tiger
gloomy tiger
hoary spear
half iris
dark parcel
#

Multicast (can only be called by the server) will run the function on both server and client machine

#

if u are doing that for movement, you are probably already doing it wrong

#

multicast don't really belong to anything that is stateful, because they can be dropped

half iris
#

Right I see, so how am I supposed to this then? I find it very confusing at the moment.

As I understand it, the server is authoritative, and the client is in essence trying to mirror what happens on the server. but how does it do that at all?

dark parcel
#

How do you handle the golf balls movement?

#

you have to replicate it's transform somehow

half iris
dark parcel
#

if it's a projectile comp, it might have something already for it

#

but I never touched it so no clue

half iris
#

Actual movement is handled with physics using an Add Impulse node.

dark parcel
#

that's unknown territory to me but I'm glad I never have to deal with syncing physich because I heard even the battle tested veterans struggle with it

#

afaik, the physich have some randomness and not that determistic

half iris
#

thats a shame, because that is literally what my entire golf ball movement is based on 😅

dark parcel
#

well hopefully someone wise have opinion they can share

half iris
#

With using the multicast (even if this is not the right way to do it) I do see quite reliable movement on both server and client, including collisions between the golf ball from the server and the client.

dark parcel
#

if no multicast, I assumed the golf moved on the server but not on client machine?

half iris
#

Yea true

dark parcel
#

if the golf ball location is not corrected then the movement is not replicated

#

So with the multicast

#

u are basically just telling each machine to do it's own simulation

#

if physich have some randomness to it, or affected by lag etc

#

then it's possible that people will see different result

#

If i were u, I might do it differently

#

replicate the transform on clients

#

Handle the Physic in server side

#

So in client machine, you are only Interpolating to the server's golf ball location, that's it

half iris
#

So server does the add impulse for each golf ball upon input being registered, and then calls a Run on Owning Client event for each golf ball to pass the transform through, which then just sets the transform locally for each client?

#

Do I understand that correctly?

dark parcel
#

For clients, I would just interpolate the golf ball location, to server's golf ball location on event tick

#

I do hope someone else have opinion tho, they probably have better idea than me

half iris
#

So event tick; Server RPC to request the world transform for itself, then set the world transform to that of the servers?

dark parcel
#

no server RPC

#

client have no say where the ball should go

#

it just read a replicated variable

#

(golf's ball transform)

lament flax
half iris
# dark parcel (golf's ball transform)

Oooo, right! So the world transform of each golf ball gets set to a replicated variable on tick, and each relevant golf ball will pull its own transform data from that variable?

dark parcel
#

so who knows what the result would look like

lament flax
half iris
lament flax
dark parcel
half iris
#

So if we have authority, we can set the transform. If we do not, we read from the set transform and interp towards it

#

Oh! This works sweeney_activate

hoary spear
#

Probably a tad inaccurate between clients but

dark parcel
half iris
lament flax
#

quick question (not really linked to MP but the next will) before asking another one :
does UE renders all objects in a scene by default, or only renders object that the player see ?

#

regarding this, i had a random thought yesterday :

  • lets say that my player can drop items to the ground.
  • right now, on multicast, i run a timeline to smooth the drop of the item from the hand (A) to the floor hit point (+ some offset) (B).

so now, i got all clients doing the animation, and the server keeps track of the actor location

now, my question :
can i make that, the multicast is only run to client that sees/render the item ?

because, the players that are far away doesnt care about knowing the location of the item while it drops, i could set the location only at the end of the drop.

hoary spear
#

Just do onrep

#

bIsFalling ?

#

Not sure id care tbh

#

Micro optimization

half iris
#

Okay this now all works, with one small exception.

The player can determine how much power they want to apply to their shot. This variable is saved inside of the Player Character seen as that is where the input gets registered for it.

When I then call the ShootGolfBall event on the server, I pass a reference to the player character that requested the shot, from there I can get the ShotPower value.

This however does not work. The server registers a value of 1.0 (the bare minimum). The variable is replicated, so I am out of clues where this is going wrong

#

For clarification, the server registers the right shot power for the ball shot by the server. It does not register the right power when the client requests the shot

dark parcel
#

U doing server rpc to tell the server how much it should push the ball?

#

No replicated variable is needed

#

Player input pressed -> server rpc, shoot ball (have float input that represent the velocity) and just pass the value via rpc

half iris
#

I can't pass the player ref in the server rpc, and then pull the float from there?

indigo brook
dark parcel
#

Yes u can

#

U can pass any data u need

#

But if u are client, your rpc gonna get dropped in actor you don't own. So route that to something you own like player controller

#

Anyway gotta hit the hay. Gl to you

half iris
dark parcel
#

It's as simple as, player input pressed -> run server rpc which takes a float or any variable u need to push the golf ball

half iris
#

Yea I think I understand now

half iris
umbral gale
#

Hello 👋

I am trying to update my player velocity in air if no inputs are pressed, it's working perfectly on standalone mode with a single player, but in multiplayer mode with some network lag (average settings), my client is jittering until the server receive the new velocity, I tried by using RPC and FSMN_NetworkPredictionData_Client but it still jiterring, do you have a hint to help me please ?

dark parcel
half iris
dark parcel
# half iris Gotcha, I might need to dive into more then in the future

Ofc server will get a ref to the character that it has in its own world, so the power in the character on server version would be 0. Your method of passing the velocity or power should be a server rpc.

Remember that the only way for client to communicate to server is via server rpc

half iris