#multiplayer

1 messages · Page 223 of 1

quasi tide
#

The first line says if the server calls a Remote function (great, this is going to be annoying to clarify in the future) then it is executed on the owning client.

thin stratus
#

Yeah so it's not a multicast in any configuration

quasi tide
#

Okay - so it is a Server/Client RPC, but not executed locally

thin stratus
#

That is as confusing lol

#

Simulated proxies that have set owner being called

#

So actors owned by a client

#

So no multicast

quasi tide
#

Yeah

#

Who the heck knows. I sure don't

thin stratus
#

That last image seems to be the most correct in explaining it

#

Now we just need a new example of when that is used

quasi tide
#

Which one?

#

It isn't a multicast

thin stratus
#

The thing overall. Cause the example further up was for a Multicast that doesn't call on the server

#

And that's then false

quasi tide
#

Remote RPCs are a unicast RPC

thin stratus
#

Yeah I get that

#

.

quasi tide
#

Maybe it was just explained to me incorrectly.

nova wasp
#

I think they should just format the tables to merge the "does nothing" together into one cell

#

would be less of a "oh god, time to memorize this sudoku puzzle"

quasi tide
#

From here, it sounds like it is literally just an RPC call that doesn't get executed locally. But from the client perspective - server RPCs weren't called locally.

#

And client calls weren't called locally either (from the server)

#

Sooooooo

nova wasp
#

It's difficult to think of a situation where you have an even back and forth except for like input ack or timing things

thin stratus
#

Even that usually has different function bodies tbh

nova wasp
#

never thought I would be wanting LESS networking features... I guess I'm just dreading the extra trivia

thin stratus
#

So basically a ClientRPC always calls, even if the client calls it and even if the server calls it on a Server owned actor.

As ServerRPC always calls when called by the server, but only calls when called by the client and they owned the actor.

A RemoteRPC only calls when called on a client owned actor and in that case acts like a ServerRPC or ClientRPC based on who calls it.

#

"Always calls" as in it's not dropped.

quasi tide
#

I don't know the use case.

thin stratus
#

Yeah me neither. Wild haha

quasi tide
#

Well, I asked for an example/use case in the docs for this. Hopefully we can get something.

muted reef
#

Implementation :
And result is : Getting screenshot of Server view mode.
Any suggestions ?

#

Also tried multiple ways

upbeat basin
#

What are you trying to achieve? Assuming this is your character class, if you're going want to end up on your owning client, no need to do any networking after key input already

muted reef
#

Does it work only in standalone mode for multiplayer stuff ?

upbeat basin
#

Hmm, just gave the command a try, I guess at least for the editor it's screenshotting your main editor viewport only

#

Seems like a shortcut/command for this rather than an actual screenshot tool, but I don't know what's the behavior out of the editor

upbeat basin
muted reef
#

Thank you

upbeat basin
#

But your RPC logic seems still unnecessary if you're just trying to take an SS of your (player's) own screen

lament flax
#

what are the best settings to test real sessions ?

#

for now im launching my PIE sessions using standalone

#

so far no issues

tardy fossil
lusty kelp
#

@lament flax what do u mean by real sessions?

lament flax
#

so LAN sessions

lusty kelp
#

oh okay

#

sessions using just the basic ue provided right?

#

@lament flax

lament flax
#

yes, the null OSS

lusty kelp
#

cool, using photon cloud plugin atm

#

new to it but kind of getting a hang of it

lusty kelp
#

@lament flax not being noisy but what game u working on

lament flax
#

currently an endless runner

lusty kelp
#

sweet deal but u do know that online null only do lan sessions

lament flax
#

i do, i was testing stuff

#

i'll go with steam OSS soon

lusty kelp
#

i am no expert but steam have problems and uploading the game to steam will require artwork and etc.

lament flax
#

i already used steam tools

#

and you dont need a published page to use an app ID and the SDK

lusty kelp
#

um u do in fact do need one in order to download your game

#

if u going thru steam; u need to have a website store page

#

the app id u can use and the sdk but it'll find other people sessions

nocturne quail
#

is that #if UE_SERVER not real?

i mean i have builded a client build from my game and i found the ServerOnlyFunction inside it in an external debugger like ghidra 🤯

#if UE_SERVER
void ServerOnlyFunction()
{

}
#endif
lost inlet
#

ghidra isn't a debugger

#

and UE_SERVER is 1 when it's a dedicated server build and no other configuration

nocturne quail
lost inlet
#

I'm more curious about how you come up with these crazy hypotheses

lost inlet
#

how is a single "server" string proof of anything

nocturne quail
#

i get breakpoint in it for testing when ever that server function accessed

lusty kelp
#

seem to me he using some type of code javascript?

#

to make the test go green for success or what

#

dont tear down the 4th wall hehe

#

we need our wall

#

@everyonedoes anyone knows of a website with none paying freelancers, i really do not want to go through

nocturne quail
#

i guess this is because of cached build artifacts ?

exotic wasp
lusty kelp
#

@exotic wasp i do not know but waiting on one is a pain

nocturne vault
#

I am trying to set the relative rotation of a spring arm so the flame (of a lighter) points up and rotates depending on the players movement inputs. This works correctly for the host, but the rotation from moving doesn't work for a client. I also tried setting the input forward and right to replicated, but that didn't change anything. The client is able to see the rotation of the flame when I move the camera up and down, just not the change when I move using the inputs. Any idea what I'm missing?

nocturne vault
#

If I call the fire rotation event in the RepNotify function, the client can see the rotation from his inputs when he moves around, but it is not as good as the host.

nocturne vault
#

it seems like the problem is the variables for input forward and right. It's always showing as 0 for the client, even if I set the variables to replicated

exotic wasp
#

you can't guarantee that replicated variables will have the correct value when calling an rpc

nocturne vault
#

How would I set this that it only runs for the client and doesn't go through the server? I'm assuming the client has the values for the inputs, and the server doesn't

vapid gazelle
#

Quick question for the gang. I'm told that relying on index 0 to identify the player on the current instance of the game in a multiplayer context may backfire. What alternatives do folks recommend to this sort of check that might be more bullet proof? Is using any of those nodes with indexes a code smell I should unlearn?

tiny pier
#

does save game work with dedicated servers? if not, what would work for saving stuff to server

lethal blade
lost inlet
vapid gazelle
# lethal blade In multiplayer 0 refers as Server right

My understanding was that 0 is the first instance of that class that spawned on that instance of the game. So on client it would always be the client player, on listen server it would always be that local server player, but I could be wrong.

nocturne quail
sinful tree
# vapid gazelle Quick question for the gang. I'm told that relying on index 0 to identify the pl...

The way around it is to not think of things as being tied to a specific index of a player. Your logic shouldn't really care if it's player 0 or player 1, but rather some other logical thing you can set on the actor to know if it's the particular one you want, like whether they're on team 1 or team 2, or they're the killer or a survivor. Possessed pawns also have reference to their controller's playerstate which is a better reference to a player vs. trying to know a specific player by an index.

lusty kelp
#

so nobody going to help me or even talk?

#

wow and here i thought this a community of devs not no butt hurt salty sitting at home wattching boogie woogie

#

seriouisly wolves are more helpful then this community

#

think i am going to sit back but here something you guys dont know

#

bye bunch of inner circle loserz

lost inlet
#

lol?

#

Wanted help for free and got mad no one was bending over backwards to help

icy jetty
#

<@&213101288538374145> ^

#

The customer requires help finding the exit

#

Tbh I’m surprised they didn’t get timed out for @-ing everyone

lost inlet
#

they left themselves

icy jetty
#

took them a while, didn't want them to feel like no one's helping them

burnt coral
#

Lmao, wth did I just read? Entitlement at its finest.

exotic wasp
#

wahhh no one wants to listen to my every whim and let me be an idea guy

#

8 year old

dark parcel
dark parcel
#

Server has everyone controller

#

If server needs to know a player's controller, get the actor -> get controller

dark parcel
vapid gazelle
# dark parcel Clients only know their own controller

Makes sense, thank you! So it is fair to say that in a peer-to-peer setup player 0 or controller 0 will always refer to the local player, assuming just one player per process? I.e. clients will only see their own controllers, at index 0, and listen servers will also get their own controller at index 0 because the server's controller is alwyas the first one to be instantiated?

Or is that making too many assumptions?

dark parcel
sinful tree
vapid gazelle
#

Sorry, wrong terminlology, I meant "without a dedicated server in the mix"

dark parcel
#

It will depend on who's calling the node

#

But if you are client, index 0 will return its controller.

I wouldn't recommend using that node at all though for mp. Just use getLocalPlayerController or something.

sinful tree
#

The reality is, you really should not rely on using any of the index based getters in online multiplayer. They work fine for local multiplayer (ie. multiple gamepads hooked up to the computer) There is almost always a better way to get the reference that you need in online multiplayer.

dark parcel
vapid gazelle
dark parcel
#

Yeah it cover what node to use

lament flax
#

should i attach my game mode and game state to my players since im doing a endless runner ?

#

im worried about the max distance

glad escarp
# dark parcel <@442071142422020146> https://wizardcell.com/unreal/multiplayer-tips-and-tricks/

So I just read through a portion of this and it addresses what I'm not understanding right now but it doesn't really explain to me how to go about doing this properly with Blueprints. They talk about the C++ solution which is not exposed in BP's unfortunately. In a single player game, from my PlayerCharacter, I can use the static function of GetPlayerController with no problems. What's the correct way in multiplayer to get a reliable reference to each pawn's PlayerController?

#

I've tried using GetController as the guide suggests but do I have to use an RPC to accomplish this or something? It's confusing

lost inlet
#

That is the correct way

glad escarp
lost inlet
#

Why would you need a "saved reference"? Also depends where you initially get it

#

Like GetController is returning a "saved reference"

glad escarp
#

BeginPlay is where I'm trying to save a reference. Well I figured I would store it because I use it to access my player HUD and other things. Maybe I should just create my HUD and other widgets from the pawn instead of the player controller?

lost inlet
#

That's a few extrapolations there

#

I'm saying it's redundant and silly

meager spade
#

I very rarely cache things unless I know I need it all the time and it's not trivial to get

lost inlet
#

But in BeginPlay, it's unlikely to be possessed

#

That's why there are possession events, that's when the controller changes

glad escarp
meager spade
#

Like people are afraid to use getpawn or get controller cause there is a cast involved and think it will make the game slow

lost inlet
#

GetController is a trivial getter

meager spade
#

If you want it it in your type of

#

Character has no reason to make widgets

glad escarp
lost inlet
#

No

#

And I typically use AHUD to manage HUD widgets

glad escarp
glad escarp
meager spade
#

AHUD, PlayerController, LocalPlayer, anything but Character

#

widgets are local only

#

we do our widgets through the playercontroller and special managers

#

making sure they are only created on the local controller

glad escarp
# meager spade AHUD, PlayerController, LocalPlayer, anything but Character

Right. I am using RPC's to create my widgets for all clients on the controller. Therein lies my problem. I am using PlayerController but I can't access it in the same way I'm used to because the GetPlayerController function isn't reliable. So any widget functionality, I supposed should also be handled on the controller rather than referencing it from the character?

meager spade
#

rpcs to create widgets?

#

🤔

lost inlet
#

It is reliable, it literally returns the possessing controller

meager spade
#

i mean without a controller, the player wont exist

#

Controller must exist

#

Controller IS the player

#

not the character

#

Controller == Player

#

Character == Visual representation

lost inlet
#

I'm really curious as what necessitates the RPCs too

meager spade
#

Controller is literally the first thing created in GameMode when a client connects to the server

#

it must exist

glad escarp
#

Guys. I'm obviously new to multiplayer and not familar with even simple best practices. I thought I had to use a RPC to CLIENT to reliably create a widget in multiplayer

lost inlet
#

Like in a widget, I know the PC that owns it, and I can bind to a delegate when my pawn changss

meager spade
#

well can you show what you have done so far

#

and what your end goal is, so we can give some pointers

#

cause MP is not trivial, and i have seen some very bad things done in MP games here, where people are new to MP and do some really questionable things

glad escarp
#

I surely can do that. 😉 Although I'm sure you're about to gasp at yet more questionable practices from yours truly.

I am just adding my player "HUD" widget to the viewport and it has some values which I change at runtime, like any other player HUD. (progress bars, interaction prompts etc).

#

Those values in question, are being calculated on the character mostly, which is why I was trying to reference my PlayerController, where the widget exists, to call the functions I need to

nocturne vault
#

Hello. I am running an interface event on server, but the client doesn't do it unless I call the interface event outside of server... But then if I call the event outside of the server and on the server, I believe it runs twice for the host, since I can hear a sound twice.

#

is an interface event run on server suppose to play for host and clients?

glad escarp
nocturne vault
#

I have the interface event running on server, but I don't know why the client doesn't do the interface event.

lost inlet
#

where in these screenshots is the expectation that the client will run anything

nocturne vault
#

The client only seems to do it if I call the interface event outside of run on server

lost inlet
#

ah, youtube

nocturne vault
#

but the client is the owner of the actor currently held item

lost inlet
#

nothing here tells the client to run anything

lost inlet
#

you don't send anything back

nocturne vault
#

when the client presses the input, it runs on server

lost inlet
#

yes and where's the other way round?

#

the server does something

#

you don't tell the client to do anything from what I can gather here

nocturne vault
#

ok so what should I do?

#

I tried to run the interface event outside of the server

lost inlet
#

a client/multicast RPC to tell the client to do something in response

nocturne vault
#

and it works, but I don't think I should be running the event outside of the server and on

dark edge
#

First off your timer temporary tick to move the lid should be a timeline probably

nocturne vault
#

I'm just trying to set up an event for when items are swapped in or out

nocturne vault
#

when the player swaps them in or out for another item

#

so if I swap to a lighter, the lighter opens the lid

#

which is what I'm working on now

#

If I run the interface event outside of the server, the client does it, but then the others don't see it

dark edge
#

ok so an "animation" to play when something is equipped, like say you were swapping a gun for a lighter.
Gun goes into holster or otherwise does a thing
lighter gets put into hand and flipped open

#

ignore server stuff for now, all of this should be local.

nocturne vault
#

but what if I want others to see it?

dark edge
#

it'll be local to them too

#

what is networked is the fact that the thing just went into the hands

#

OnRep_CurrentlyHeldItem

#

I know in C++ you can get the previous value (to play the PutAway stuff on the item being put away), not sure if you can in BP

#

But anyway, if CurrentlyHeldItem is a replicated reference with repnotify, you'd use the OnRep function to call ItemSwapIn

glad escarp
# meager spade well can you show what you have done so far

So if I want to just simply add a widget to the viewport and then feed it values at runtime, I should get controller and then cast to my player controller every time instead of getting a reference? I'm just trying to better understand this because my grasp of how this should work in multiplayer is obviously way off.

dark edge
#

It'd go like this.
Input -> Run on Server Event
Run on Server Event -> set CurrentlyHeldItem
OnRep_CurrentlyHeldItem -> call ItemSwapIn on CurrentlyHeldItem (in C++ you could call ItemSwapOut on PreviousCurrentlyHeldItem too, but don't think you can in BP)

nocturne vault
dark edge
glad escarp
dark edge
#

this is a playercontroller

#

why get playercontroller 0 when you can get self

glad escarp
#

When I get self, it throws an error that this is not a local player controller

dark edge
#

gate by IsLocalController or whatever

#

BeginPlay runs on server and client. You only want the local version to do the HUD stuff

#

BeginPlay -> am I local? -> yes -> ok setup UI

glad escarp
glad escarp
#

For clarity, the server, on a listen server, is separate from the local client created by the server, so when it checks for local player controllers it's going to find the host controller?

dark edge
glad escarp
# dark edge The check is if self (a playercontroller beginning play) is locally controlled. ...

Yes. It definitely worked. I just want to understand why so I can be as cool as you guys at some point. 😉

ok so now rather than trying to access my player controller from my character to update widget values, should I access my character from my controller? I'm using OnAudioEnvelopeValue for instance, which isn't available on the controller or I'd just move all the calculations over to the controller.

glad escarp
# dark edge

So how would you suggest tackling my problem above? I was trying to store a reference to my PC from the Character and call widget functions from that reference.

lost inlet
#

possession is of pawns

#

and you can safely detect if a PC is local within BeginPlay

glad escarp
sinful tree
# glad escarp So how would you suggest tackling my problem above? I was trying to store a refe...

Work the other way around. Have your widgets listen to event dispatchers rather than having your game code trying to manipulate your UI. Your UI can then work independently apart from giving it a reference to the things it needs in order to bind its dispatchers, and working this way ensures you don't have code that may be trying to manipulate widgets that don't exist on the particular intance of the game.

Your Character already has a reference to its controller. The controller also has a reference to its controlled pawn.

lost inlet
#

I actually mentioned that a while back, that the controller has a delegate for the pawn changing and you can react to that appropriately

glad escarp
glad escarp
dark edge
#

I really like things being agnostic, have the pawn do pawn stuff, and the controller and UI can react and modify the pawn, but the pawn doesn't even need to know they exist

glad escarp
dark edge
#

as a bonus, if every pawn in your game is effectively the same thing, then you can test out enemies and such by just possessing them and driving them around. The player's pawn doesn't need to be a special snowflake that knows about UI and such

#

And to start out, just use binding for your UI until you see the need for dispatchers and such

#

binding is basically just checking stuff per frame.
New frame -> ok do we have a dude? -> yes -> ok whats their health and maxhealth -> update HP bar

lost inlet
#

UMG bindings were a mistake

dark edge
#

binding for stuff that's constantly changing is just fine

lost inlet
#

well they aren't and that's actually literally true, it's also why there's a project setting to make them error

#

especially visibility bindings that can get called multiple times per frame

dark edge
#

I wonder why UPROPERTY doesn't have an automagic OnChanged dispatcher system

lost inlet
#

well this is the kinda stuff that ViewModel is supposed to fix

#

which is event driven with efficient bindings

dark edge
#

I mean even outside of UI

#

seems like half of game programming is doing things when something changes

lost inlet
#

technically, I think the FieldNotify UPROPERTY specifier works outside of UMG land

meager spade
#

i actually did a test with widget bindings

#

10 widget bindings or 1 single tick function setting the stuff

#

the single tick (even in BP land) was a LOT faster

#

problem with bindings is, they are each its own tick

#

and has to go through a lot of layers

#

we used them years ago in a prototype HUD

#

and it was like over 1ms for the widget

#

changed it to event driven and a single BP tick and was like .2 to .3ms for the same widget

glad escarp
meager spade
#

we never really call into widgets

#

our widgets pull the stuff it needs

#

or binds to things it needs

dark edge
#

Like
Tick
For each widget
Go get your data king

meager spade
#

we spawn the HUD with the player controller

#

and we add the stuff to it

meager spade
glad escarp
# meager spade or binds to things it needs

Right so if you need to open and close a widget which is looking for direct input, do you call an event dispatcher and bind it since you're not calling the widget directly?

meager spade
#

but most of it is indepdent

meager spade
#

game never needs to know about any UI

#

it sends events out, etc. Widgets bind/listen to these events to do the work

glad escarp
#

Roger. I'm tracking that from your earlier comments. I've gotta figure out how to implement that.

meager spade
#

like when you change the possesed pawn

#

the widget will update itself

glad escarp
meager spade
#

whatever we need to use

#

for the job/task at hand

#

we ofc use C++ a lot

#

and we have a lot of our widgets core in C++

glad escarp
#

I'm limited to BP's for now

lost inlet
#

I think there's like 2 people on here that have

glad escarp
#

@sinful tree @meager spade @lost inlet @dark edge I appreciate your time and patience. I've converted 2 of my widget functions to be event driven and I I'm separating game from widget. I can see why you'd do it and I'll be implementing this workflow from now on.

quiet fjord
#

Guys I have a problem. I am taking a trip on my server with seamless travel. And when my server travels to the destination map, my players before being initiated take the map camera at position 0,0,0, how do I avoid this.

rustic sable
#

anyone ever encounter error: no member named 'UActorComponent' in 'AActor' when placnig a replicated actor directly in the editor and launching pie?

#

looks like I had an old copy of an actor in the editor and it didn't reflect c++ changes

glad escarp
#

If there is any reason to, can you run RPC's on a component of a player-owned actor? Again I may not be going about this the right way but I'm trying to create an item drop function on my inventory component but it only works on server side so I'm guessing it's an ownership issue.

dark edge
#

ownership means the owning player can call a run on server event / Server RPC on it but other players cant

#

I can send a message saying to drop somethng from MY inventory, but I can't spoof a packet and make you drop your items

glad escarp
#

Ok. So, if this is on the event graph of my inventory component, which is a component of my player character, shouldn't it fire?

glad escarp
dark edge
glad escarp
#

Good question

#

Yes

dark edge
#

Are you saying that only the server's character can drop an item, or that a client can drop an item but the item only appears in the world on the server's screen?

glad escarp
dark edge
#

Item ID being passed over is probably broken

glad escarp
dark edge
#

Print that id on the RPC to see if it's garbage

glad escarp
glad escarp
dark edge
#

All the client should be saying is "I want to drop the item in slot X"

#

and you do not want multicasts involved here

#

what items you have is state

#

use replicated variables and OnReps to respond to them changing

dark edge
# glad escarp

Change your RPC to have the signature of that RemoveFromInventory function

#

that's what you send the server, what index you want to remove the thing at and other data like whole stack

#

I'd start with just the index "Hey Mr. Server, make me drop whatever's at slot X"

glad escarp
#

ok. phew that's alot. I'll see if I can rework it

#

Thanks

dark edge
#

they just make requests "Try pick up that thing" "Move this item from my inventory to that inventory" "Drop this thing from my inventory" stuff like that

glad escarp
#

Right. That's where I'm starting. I'm gonna move the logic from that function, onto the event graph, in a server rpc.

dark edge
#

and in OnRep_Content, you can call a dispatcher which your UI can bind to to update itself (the content changed)

glad escarp
#

Then I'll see about reworking the multicast logic. It's just initiating a refresh where it clears the children of an array of structs and then recreates the widgets. That can probably be bound to an event dispatcher

glad escarp
#

Doesn't seem to be working. Might need to rework this system from scratch to make sure I'm doing things correctly

#

You're right of course that it's a broken ItemID so I'm not passing it correctly at some point

glad escarp
quasi tide
#

Don't crosspost. It is against the rules.

#

Someone already answered you in #cpp

vapid gazelle
compact flame
#

Trying to replicate scalar parameter value with no luck

sinful tree
#

Dynamic Material instances also cannot be replicated, there's no point in marking them replicated. You can create and use them locally only.

left wedge
#

does anybody know if the replay can be captured on the dedicated server? using "demorec" command..

left wedge
nova wasp
#

an unreal demo recording is basically just writing replicated values and rpc calls to a giant file (in a special net connection that uses all of those replay replication conditions and calls)

#

in some ways the server doing it is arguably better as it doesn't have to ignore things that don't get sent to clients

glad escarp
#

If I'm calling a function using a server RPC, is that function still only being run on the client?

#

In this example for instance, everything done in the RemoveFromInventory function should execute on the server, correct?

dark parcel
#

Server rpc literary means, run this function in the server machine.

#

It's the only way for client to communicate with server

glad escarp
#

I'm just doing a sanity check. Because I was getting some results that didn't seem right in light of those facts.

#

Thank you.

#

Or rather, I thought I was. I was just misreading the situation because this replication thing still isn't my forte.

dark parcel
#

For example. Input is local, so imagine your character. It exist in the server machine and also in your machine.

It has a ServerRpc function called Test Function.

If you as the client press input and call the Test Function.

What it does is, you tell the server to run Test function in his copy of your character.

#

Try to do what I said, but make the function change the character color.

You will see that, even if you play as client. When you run the test func, only the character in the server will change color.

glad escarp
#

Thanks

bitter warren
#

hello ...anyone might know this.... :
Why when i creating a custom game instance and i set it ..i start the game and my character is hidden ....on default game instance ofcource no problem works as it should (i need a custom game instance for my multiplayer template) .....mention i try this on 5.5 ...(in the 5,4 engine version there is no problem with the same template /same custom game instance ) ,,,anyone might know this issue?

glad escarp
#

Revamped my inventory and I'm now getting the functionality I wanted. I'm gonna go through my other systems and alter them to utilize OnRepNotify everywhere it should be.

Now, theoretical question before I start developing another system: I know that widgets are created locally and not replicated. So if I wanted to make a world space widget, lets say a digital clock, which should display the same numbers to all players... would I filter a function using "has authority" to do the value changes on a replicated variable, and then OnRepNotify, call an event dispatcher which that widget is listening for to change the visuals on itself?

crisp shard
#

is doing a dmg effect indicator in a widget a good idea ?

#

i know there's a seperate way to do it via post process

#

but not sure which would be more ideal

kindred widget
crisp shard
kindred widget
#

Could work, but even if you do that I highly recommend doing something like setting a scalar parameter in an MPC. Regardless of if you do it in a post process or in a widget, both can use a material that can read the MPC. When taking damage you can simply set to current game time and or animate a different float for a 0-1 alpha value to affect the display.

#

This way your damage code simply sets values on the MPC, no real multicasts or care about the widget or anything, super cheap and anything that cares can animate based on those values.

#

A red flash effect for instance can read the current time minus last damaged time to animate a red flash, or read the 0-1 to play a flashing red animation more the closer to 1 it is for like low health, etc.

crisp shard
# kindred widget This way your damage code simply sets values on the MPC, no real multicasts or c...

this is dope to know, yea was essentially asking for the performance / what would be most efficient so this method seems best. if i did this via mpc, wouldn't i still need to do that soley on that local client htat's getting hit ? and that would already be on the server so i'd need to then call a owning client event after the confirmed hit, unless you're suggesting that an MPC will only happen on that client that recieves dmg on that server event. i'd be adjusting this in a widget let's say, and that widget should only be changed on that client getting hit , how would that work. ?

kindred widget
#

This would strictly be a client only effect yeah. MPCs are purely local to the machine. How you tell the client to handle that would largely be up to you and your systems. For example I use GAS, so it's all part of the same gameplay cue for me. Hit animation on the character, do sparks or blood particles, etc, if locally controlled do stuff that would affect the owning player like the MPCs and whatnot.

crisp shard
#

or i could do this just stright up on that event , still doing a locallycontrolled check ? (not doing it on the notify)

kindred widget
# crisp shard ok so on the server dmg event (on the player getting hit), i could do this like ...

I'm not sure I would do an OnRep here. You'll end up with complex bullshit gating your stuff. For simple example any setting to health would trigger it and you'd have to find a way to decide if it was a valid damage event or just the player equipping something or getting a buff to health, or regen, or etc. etc etc. Realistically I'd just make a multicast or client RPC to handle the on damage visuals that don't persist. Like... Being damaged to a certain percent I'd do from the OnRep, it's based on the state change, but like a blood splatter or hit anim or screen effect I would do from an RPC.

#

That's all the gameplay cue is in my case when you break it down is just a complex multicast RPC told to run when the player takes damage.

crisp shard
cold cipher
#

how to get game state for controllers?

dark parcel
cold cipher
#

however somehow when I do that on beginplay the client said true too
perhaps I have to set it as a variable on begin play

dark parcel
#

Begin play is not the right place most of the time for multiplayer

dark parcel
#

need more context which is missing

cold cipher
#

following gamedevraw's tutorial, first 2 pic is what he did
next 2 is what I did

#

however when I tested it it says the game state is not valid

dark parcel
#

The player state (Game State*) 🙊 should have an array of all players

#

The container in the game mode feel redundant to me

#

@cold cipher btw on ControlledSpawned runs on the controller in the server, not the client machine

#

is this intentional?

cold cipher
cold cipher
#

and the function that run the check is also ran on owning client

cold cipher
#

weird thing is when I try to run it form the pawn it worked

crisp shard
versed prawn
#

how do you create dynamic collision channel during runtime? I want players and NPCs of the same team to have no collision with each other but they will have pawn collision with different team.

cobalt notch
versed prawn
exotic wasp
#

or maybe just make a few channels ahead of time

cobalt notch
lament flax
#

should i attach my game mode and game state to my players since im doing a endless runner ?
im worried about the max distance

kindred widget
versed prawn
lament flax
kindred widget
cobalt notch
#

You can also maybe add to the ActorsToIgnore array when doing the Hit Tracing is another way to filter them. I do not know if you can do dynamic Collision profiles.

#

I'm not sure what you'd add to the ignorearray actors if you do not know the team so that may not work actually unless you had a list of all the players except your own team like if you have a function to get all enemy actors in the beginning and then put this in ignorearray. Just do the first method, it doesn't matter if they hit a friendly team if it doesn't do anything, it won't happen often anyways.
I think you can do hit based on collision profiles and ignore some profiles, which is probably the proper way. I think LineTraceSingleHitByChannel does this but you need the profiles and I'm not sure how to make them dynamic you'll have to work this out, making many profiles for all possible teams or assigning them to players in real time.

glass vector
#

when you change a variable value on the server with set w/notify in BP, does the server itself receive the rep function call?

rustic sable
#

OnRep no, this only is called on the clients, you would have to call it explicitly on the server

verbal ice
#

If it's the Set w/ Notify node then it does call the rep notify in Blueprints

inner reef
#

Hey all - is there anybody in here who has experience with C++ coding in the character movement component? Specifically using the Custom Flags to switch things on / off?

frank creek
#

anyone know why my client is moving faster than the server?

#

the replication works, but it seems as though the movement speed is doubled

inner reef
#

Are you using the standard character BP?

frank creek
#

no

#

pushing a sphere

hollow eagle
#

probably not taking delta time into account

cold cipher
dark parcel
#

unless it's turn based and moved by A.I

#

also why are you still using multicast, thought others have pointed out that it's not the way

compact flame
frank creek
#

you NEED multicast if you're going to have more than 2 players, which I will

dark parcel
#

the alternative is just to set incoming data every tick

#

which was suggested too already

exotic wasp
#

use replicate movement

dark parcel
#

The rule is simple, if something is stateful (everyone needs to be in sync), don't use multicast

#

if you have multicast everywhere in your project, then you are doing it wrong

#

only applicable for fire and forget events. There is even a AAA dev that ship a game with 0 multicast.

tardy fossil
#

has anyone made a custom UChannel class for networking? I'm trying to use UVoiceChannel as an example, but it looks like it's built right into NetConnection.cpp

do I need to somehow make a custom UNetConnection class to initialize my custom UChannel class?

#

or maybe I use UNetConnection::CreateChannelByName? time to go down the rabbit hole

glad escarp
#

Good morning smart people. So I'm trying to go through my systems and make corrections from what I learned to do incorrectly and one of those things is my player's flashlight toggle functionality. Right now it uses a server RPC that calls a Multicast RPC which I understand is incorrect because it won't have persistance so players who connect mid game or reconnect won't get the correct values and other player's flashlights will only be on/off correctly when they use it next. So what would be the correct way to do this with a repnotify without players having to refresh all replicated values when connecting to a server?

crisp shard
#

make it repnotify, and assuming your multicast function/logic was correct you can just put that function / logic into the rep notify, checking whether it is on or off to change the state

#

something i've noticed, is that if the state hasn't change the rep notify doesn't fire again, so a bool for example would need to be changed for the logic to fire but i find this beneficial more than a limitation

glad escarp
#

Or should the bool value change on the client.

lament flax
#

how would you go replicating a object with a rope physic ?

crisp shard
#

does the Initial Start Delay add that delay to Each loop ? so effectively that would make this timer fire every "2" seconds, rather than 1?

crisp shard
glad escarp
#

oh. huh. nevermind. I guess it is working now. Thanks!

quasi tide
#

Newly connected clients get the most updated value from the server. That is why stateful changes are done through onreps.

glad escarp
#

Yeah I just read that when I was starting to be an idiot to concoct my own update system. 😉

crisp shard
nocturne vault
#

I am working on an interactive door and I'm trying to disable the tick when the door reaches the desired rotation angle and enable it again when the player interacts with it. The door doesn't start with tick enabled. The first interaction enables the tick for server and client, and gets disabled in event tick when it reaches the angle, each interaction afterword only shows the tick getting enabled on server. I'm confused why because I'm enabling the tick outside of the server

#

once the tick gets disabled for the first time, it doesn't get enabled again for the client

nocturne vault
#

I think I got it. I ended up setting a repNotify for enabling tick

velvet jacinth
#

Trying to create proximity voice chat using this method I found on the net.
The attenuation sound does work for the host but the client doesn't.
That means no matter how far the host is he will be heard.
Anyone have a clue ?

twin vessel
#

What do you guys do to predict shooting for actor based projectiles? (just looking for a high level description)
In particular my problem is for homing projectiles

barren patrol
#

Question about PIE mode for games with online platforms / features. How are you setting up PIE play of game levels when your server requires a valid login / session to play the game?

#

I am looking at some of the GameInstance overrides such as InitializeForPlayInEditor but it does not allow for an async HTTP request to recieve a callback and then continue.

thin stratus
#

Like, non of the online titles I worked on have had support for any of their features outside of packaged builds and maybe standalone.

barren patrol
#

So what about a game with an inventory / loadout that has to get pulled down?

#

Maybe I just need to use Standalone w/ Start Separate Server option and a quickstart map.

sinful tree
round glacier
#

Am I misunderstanding variable replication? I know how to work around this, but I'm trying to understand why this doesn't work:

I have a component on my Lyra Character subclass that's keeping a reference to a target ATarget. The component and the variable are set to replicate. When I activate an ability, though, on the server, ATarget is out of scope.

I've solved this by using a Wait TargetData task in my ability and moving everything out of the character, but why doesn't this work?

#

Oh, it's because I'm misunderstanding replication, isn't it. It's just server -> clients. Is there some builtin magic inside GAS that lets clients replicate to the server, though?

crisp shard
#

when it comes to dormancy and tick, would dormancy override the tick in this case ? having tick enabled for example would only matter if it wasn't dormant? or does it being set to dormant override any tick enabled thing

velvet jacinth
sinful tree
#

Oh sorry, I thought that was just an IsValid node.

sinful tree
#

If you have something on tick that may trigger network a network update, then that could cause it to wake up.

crisp shard
sinful tree
#

From what I understand, anything that causes a network update (like sending a multicast or setting a replicated variable on the server, including doing things that modify replicated properties like location or rotation) should wake it up from dormancy.

short arrow
#

If you make the entire class in cpp it does not work this way, and the only way to receive replicated changes from a dormant actor is by forcing a net update or calling flush net dormancy on the actor

#

Sidenote: not enough people talk about the benefits of setting variables through RPCs instead of having 100 replicated variables that don't change often.

exotic wasp
tardy fossil
#

but if you set a variable with an RPC, then people joining late wont see it. IMO it's better to condense a bunch of replicated variables into a struct with a custom net serialize function

dark parcel
tardy fossil
#

like having a variable initial only and rpc changes? that might save a tiny bit of performance but at the cost of more code.. i guess itd depend on the use case

sinful tree
#

Gunna make those setter functions actually work for a living.

short arrow
#

everything has a trade off, including serialized structs

exotic wasp
#

so VERY first time it will replicate, but if you walk out of range of an actor, then come back, it wont replicate

sinful tree
exotic wasp
#

thats also what i believed, but it didn't behave in the testing i did

sinful tree
#

Looks to work on my end....

exotic wasp
#

wack

#

need to test it again then

round mist
#

I was just working on something on my player state for clients on begin play and realized that it's... triggering twice. I'm testing with 2 players on a listen server and using a has authority > remote branch to make sure only the client is triggering, and it seems to be triggering twice.

And when I use a breakpoint it's showing I have a PlayerState0 and a PlayerState1

Am I misunderstanding how this works? Or is something wrong with my multiplayer setup?

dark parcel
#

there are 2 PlayerState so each will call begin play

#

There are 2 Player state in the server machine and there are 2 player state in the client machine

round mist
#

But if I'm using a has authority check and only calling the function on remote... would that still trigger twice?

round mist
#

This seems to be adding multiple widgets to the screen. Adding a breakpoint reveals that it's triggering twice. I only have one client and one server player.

dark parcel
#

so there aer 2 player states in the client

#

I will draw something brb

round mist
#

So the client is triggering the server's player state, and adding a second widget to the client's screen?

round mist
dark parcel
#

@round mist

#

There are player state for each player in the client machine.
So when PS1 come to existance, it fires begin play, then check if it's remote. Since it's remote then it fires create widget and the rest of the code
PS2come to existance, it fires begin play, then check if it's remote. Since it's remote then it fires create widget and the rest of the code.

#

so you end up with duplicate

round mist
#

Huh. So how do I prevent this from creating two widgets?

dark parcel
#

You just call it once?

#

Right now, your code is. For playerstate that comes to existance create widget

#

so if u have 8 players, u do be making 8 widgets

#

For a start I don't recommend creating HUD in playerState

#

quiet an odd place to put Widget

#

Second, I suggest to get fammiliar with IsLocallyControlled node

#

IsLocallyControlled checks if the actor is owned by local player

round mist
#

Yeah... let me back up. I'm doing some janky loading screen stuff. Maybe you've got a better suggestion if you've got a sec.

dark parcel
#

so u can have 5 characters in the game, with is LocallyControlled, you can filter to fire the code only on the actor that you own.

dark parcel
#

All widget get destroyed on hard travel

#

Rider is free, join the church

#

you can still get away with plugins, but that's just some one doing what the blueprint can't for you.
If you want to unlock the engine potential it's good to migrate and have the best of the both world.

round mist
#

I have an incredibly large game world (open world with dozens of sublevels). Long story short, but level streaming doesn't quite work for us, so most levels are set to always loaded. THis load time is causing Steam connection timeouts and crashing people's games.

I've set most the levels to bp loaded and that cuts the loading times WAY down. I use a C++ loading screen that is only up for a few seconds because of that. Then when the player controller is loaded in, I trigger a blueprint loading screen with a blocking load that updates a progress bar between each sublevel load.

I'm just trying to find the best place to set this up so the player can listen for loading finished and then trigger spawning their pawn, then unhide the widget.

#

I'm thinking I'll just move it to the player controller instead of the player state. Not sure why I thought that was a good idea.

#

All this is working perfectly, btw. The only issue is that I built it on the game mode not thinking that clients can't listen for updates on it cuz it's not replicated to clients. So my first thought was "Oh, the player state is replicated. I'll move it all there." lol Which is how I got into this mess.

dark parcel
#

Game mode only exist in the server

#

Btw the loading bits, I don't see how that is related to networking?

round mist
dark parcel
#

is there any data the client and server have to exchange in regards to loading the world?

#

So an actor that manage the process might do the job

round mist
#

This needs to work for dedicated servers as well, so I need to separate the widget from the loading. Probably a loading manager actor I guess.

#

Glad to hear that you didn't immediately see any giant red flags with the approach though. lol I was half expecting you to be like "that's not gonna work..." lol

dark parcel
#

I have no idea bro, quiet a newbie in multiplayer as well

#

might want to ask others for opinion

#

Mp is a can of worm

#

Im about to give up yesterday

#

ended up fixing what I thought unfixable, so going forward for another day

round mist
#

Ha ha that's how it usually works.

#

I mean, I've been handling all the multiplayer logic in my game solo for the last 2 years or so now after I had to let my lead programmer go. And nothing's really exploded yet.

#

The only thing I'm iffy on is how the streaming level loading works between server/client. Like.. if the dedicated server loads all these levels in... can the client even join the world without them automatically loading in as well?

#

Cuz if not, then this was all a waste of time.

dark parcel
#

that's my worry tbh when it comes to collab. Nice to hear that you are pushing through

round mist
#

I'm pretty confident with it now. I feel like I could start a multiplayer game from the beginning now without too many issues. Though our game is entirely client authoratiative since it's super casual and cooperative. I don't think I'd even know where to start with server authority. XD

dark parcel
#

You validate the data on the server side

#

rewind on client if the data don't match

round mist
#

Well yeah. I understand the logic of it. But in practice I wouldn't know how to do it. lol

round mist
#

Oh thank you for your help by the way @dark parcel Much appreciated!

obtuse hound
#

hi! I'm experimenting with Mutable to make custom characters at runtime, and am now wondering about replication. I don't have much experience with it but know the basics, the common docs etc.
Now if I at runtime want to update one of the customized options (let's say setting an int parameter from 1 to 2, which changes the mesh to a different hair style), would it be better to just call the "SetIntParameter" function on both server and client, or should I do it on the server, then replicate the change in data somehow, and apply it on the client with RepUsing? Not asking specifically about Mutable btw, just the use case where this came up with

I'm not familiar with this sort of best practice

velvet current
#

what are some games where one player can grab onto another player, and that grabbing players movement is now dictated by the movement of the grabbed player? Only ones I can think of are

  • echo arena (VR game)
  • new BO6 lets you use other characters as a meat shield/take them hostage
#

and to that, how does BO6 handle the collision for that; i.e. what stops the controlling player from forcing the meat shielded player from wall clipping? example here: https://www.youtube.com/watch?v=5aabEkyo13I

Welcome to CDL Clips!

– Your Ultimate Destination for Call of Duty Leauge Clips! 🎮🔥

🚀 Get ready for a rollercoaster of entertainment as we bring you the funniest, most epic, and latest moments from the Call of Duty League.

Subscribe now for your daily dose of adrenaline, laughter, and top-tier Call of Duty content! 🎬🕹️

Don't miss out on the...

▶ Play video
glossy gate
#

heyyy. I have this code on the Pawn:

void ATPawn::OnMouseClick()
{
    if (!TGameState)
        return;

    FHitResult HitResult;
    GetWorld()->GetFirstPlayerController()->GetHitResultUnderCursor(ECC_Visibility, false, HitResult);

    AActor* HitActor = HitResult.GetActor();
    if (HitActor->IsA<ATCard>()) {
        ATCard* Card = Cast<ATCard>(HitActor);
        if (DrawedCard) {
            Hand.Remove(Card);
            Hand.Add(DrawedCard);

            Card->EnableCardCollision(false);
            DrawedCard->EnableCardCollision(true);

            FVector HandCardLocation = Card->GetActorLocation();
            FRotator HandCardRotation = Card->GetActorRotation();

            Card->ServerMoveDiscardedCard(this);
            DrawedCard->ServerMoveCard(HandCardLocation, HandCardRotation);

            DrawedCard = nullptr;
            ServerEndTurn();
        }
    }
}

That calls this server function ServerMoveDiscardedCard but doesn't call the ServerMoveCard. I don't know why one get's called and the other not

sinful tree
quasi tide
glossy gate
sinful tree
#

That would be why... If it's not replicated, then you can't call RPCs on it.

glossy gate
#

OH, I wasn't getting why the Card worked and the DrawedCard not, but it's because I have the hand replicated. but I don't really want to have the DrawedCard replicated, I want every client to have it's own drawed card

glossy gate
#

even adding replication to the drawed card doesn't call the server rpc

velvet current
# quasi tide You could do this stuff in Gears of War as well. The way I'd do it, is attach th...

This was my first inclination too. It might be because I'm using General Movement Component, but trying to attach a GMC pawn is basically impossible because of how the networking is set up. It constantly tries to get corrected back to where it was when it attached.

Additionally, a problem with AttachActorToXYZ is that is loses its collision

I'm experimenting with spawning in a new "dummy" character and setting the location on tick so that it keeps its collision

sinful tree
glossy gate
# glossy gate heyyy. I have this code on the Pawn: ```cpp void ATPawn::OnMouseClick() { if...

so like in this code add the DrawedCard->SetOwner(this);? or how.
because I add the drawed card like this when clicked:

if (HitActor->IsA<ATDeck>()) {
        // If it's the player's turn, get a card from the deck and add it to the player's hand
        if (TGameState->GetDeckCards().Num() > 0) {
            UE_LOG(LogTemp, Warning, TEXT("Drawing a Deck Card"));
            DrawedCard = TGameState->GetDeckCards().Pop();

and the GetDeckCards it's from a replicated array and also every card it's set to be replicated

sinful tree
#

Ownership has to be set on the server, and yes, SetOwner() would be the way to set an owner of something.
You also don't want a client telling the server what card it is they drew. The client can report that they clicked on the deck to the server, and the server should then decide what card to assign to the client.

lament flax
#

any ideas why the unique net id of my player controller is null ?

glossy gate
# sinful tree Ownership has to be set on the server, and yes, SetOwner() would be the way to s...

so I made this:

void ATPawn::ServerGetDrawedCard_Implementation()
{
    if (TGameState->GetDeckCards().Num() > 0) {
        DrawedCard = TGameState->GetDeckCards().Pop();
        DrawedCard->SetOwner(this);
    }
}

// and then in the other code I change it to this:
if (HitActor->IsA<ATDeck>()) {
        // If it's the player's turn, get a card from the deck and add it to the player's hand
        UE_LOG(LogTemp, Warning, TEXT("Drawing a Deck Card"));
        ServerGetDrawedCard();

        if (DrawedCard) {
            FVector TargetLocation = CalculateDrawnTargetLocation();
            FRotator TargetRotation = GetActorRotation();
            TargetRotation.Roll = 180.f;
            DrawedCard->ServerMoveCard(TargetLocation, TargetRotation);

            TargetRotation.Roll = 0.f;
            DrawedCard->MoveCard(TargetLocation, TargetRotation);
            DrawedCard->GetCardMesh()->SetRenderCustomDepth(false);
        }
    }

but I don't know if it's what you mean. also it doesn't work well because the drawedcard it's null on clients (I made it replicated also to try but doesn't work)

verbal ice
#

Your logic is wrong

sinful tree
#

You can't expect the server to immediately return a value into DrawedCard for you to continue your logic.

verbal ice
#

^

#

The RPC will be sent but it is non blocking

#

The server will eventually receive it but your logic will continue regardless

glossy gate
#

mmm I get it now

inner reef
#

Hey all - I'm looking for some industry advice on how to best handle network corrections on the player capsule when launching a player? I have a launch pad which is server-authorative - I want the server to decide if someone should launch or not. But when the player hits the pad and the server launches them, there's a small correction on that frame.

#

This kinda makes sense - the client is predicting no launch, then they get launched by the server

#

What would be the best way to avoid this though?

#

Allow the client to launch locally and then validate on the server if it's okay for them to do so?

verbal ice
vivid seal
#

Is there a way to manually associate a client object with a server object such that when changes to the server's object replicate they propagate to the client's? Specifically, in 4.27 using the Inline specifier for an array of UObjects, replicating those objects causes the creation of duplicates on the client, since the client has created his own local versions of them.

#

apparently this just works in 5, but this is for work and we are not planning to upgrade to 5 before release

inner reef
#

I could just let the client decide when it overlaps and do the launch, but there would be a few fringe cases where that might not work, like if the server had just destroyed the overlap actor but the client still saw it on their end etc

verbal ice
#

I wouldn't worry about it

#

Have the client launch themselves on their end and the server will do the same when performing the movement

#

If for whatever reason the server refuses the client will just snap back

clear valve
#

I'm using a FFastArraySerializer, yet when I add an item to its array and call MarkItemDirty, the item's PostReplicatedAdd gets called, but not the array's PostReplicatedAdd. What would a common cause be?

fossil spoke
#

Heres a quick example

clear valve
#

thank you. Would not have suspected that from the comments 🤔

fossil spoke
fossil spoke
#

However, these arent typically used because they are less useful

#

Its certainly more common and user friendly to call your own from within the Item as mentioned earlier.

clear valve
#

I should clarify, that if you are trying to use the PostReplicatedAdd(const TArrayView<int32>& AddedIndices, int32 FinalSize) version, they should be called automatically.
yes, that's the one I'm trying to get called but it's not happening 😬 I would have assumed if the individual item's PostReplicatedAdd gets called, that is indicative that it did work, so I'm not quite understanding why it's not being called

fossil spoke
#

How have you set up your ArraySerializer?

#

Can you share the header?

#

FastArraySerializer.h::1150

#

Is where they are called if you are curious

clear valve
#

give me a sec. If breakpoints don't make me smarter here I'll send you the header. It's based on lyra

fossil spoke
#

Ewww, Lyra

#

lol

#

Sure thing.

#

Within void FFastArraySerializer::TFastArraySerializeHelper<Type, SerializerType>::PostReceiveCleanup

#

If the line number isnt exact

#

I referenced the line number from UE5.5

clear valve
#

yes, found it. After setting a breakpoint on the line that calls PostReplicatedAdd on the array, my breakpoints inside the function itself started magically working.. a good old log seems like it would have done the job better 😬

#

out of curiosity, what's your beef with lyra? 😄

fossil spoke
#

Its a more of, "look what we can do" than a, "this is how you should do it"

#

In my opinion

clear valve
#

oh yes, definitely not a prime example for more regular games, and more for live service games I'd say

#

I appreciate its complexity but it does come at a cost

fossil spoke
#

The trouble is, as far as I see it, the majority of Devs who will ingest Lyra to make actual use of it, wont be making Live Service games (also unlikely they would even be capable).

#

Im not entirely sure who its intended audience even was.

clear valve
#

I think it's a trove of treasure, but you have to know when to apply bits and pieces

fossil spoke
#

For sure, its certainly more of something to cherry pick from.

#

Not build off of as a base, which unfortunately is what it seemed it was marketed as.

#

So people assume thats what they should do

#

🤷

#

For newer/less experienced devs, this isnt a good idea.

clear valve
#

after working in it for a while I found its architecture quite neat, although it's easy to to get lost.. "where was this component added dynamically again? In the GameFeaturePlugin asset? In the Action Set in the Experience? On the pawn data? Who knows 😄

#

yes it's absolutely not for newcomers

fossil spoke
#

Thats a major issue yeah.

#

Minimal direct references make it difficult to actually track down things

clear valve
#

for sure. I find it less difficult to understand after wrapping my head around most of it, but I had to get there first. And even then it still suffers from its dynamic nature. Good luck getting a comprehensive look at the UI in UMG

#

personally I'm obsessed with modular architectures, maybe to a fault, so I like these overengineered solutions, but I see the issues clearly

fossil spoke
#

I think its fine for large teams where there are enough people to just own specific parts of the project. But for small teams, where they have to onboard developers and have them be able to wear many hats, its a steep curve for them to have to come to terms with the project architecture.

#

But as said before, cherry picking the bits you like and integrating into your own project is the way to go.

#

Im still stuck on 4.27 at work, but Ive been using 5.4-5.5 on a side project

#

Took a few things from Lyra and adapted to suit my needs.

clear valve
#

ouch. I think in the newer Unreal versions it's starting to come together, with new tools such as Mutable. That's what I'm trying to get implemented right now with networking support (for my hobby project I should clarify, I'm currently not aware what plans for replication for Mutable look like)

fossil spoke
#

The trouble I have is trying to keep up with all the new stuff haha

clear valve
#

it's a lot 😄

#

replication for the mutable options is working now, thanks a bunch! For now it's working just for integer based drop downs, but that's already pretty good. Can swap hair styles and clothes now from walking into a cosmetics spawner

fossil spoke
#

Awesome

quasi tide
#

Mutable is probably one of the things I'm more excited about.

#

Also for multiplayer peeps - a gentle reminder, FN is on Iris now (since 5.5). So....soon™️

clear valve
quasi tide
#

But I want it now 😭

clear valve
#

😬 I think it's not too far off!

quasi tide
#

Guess I just have to go back to Deadlock

clear valve
#

I hope you're iai slashing people as Yamato

quasi tide
#

Paradox main. Swap for dayzzzzzzz

clear valve
#

one of those... huh

quasi tide
crisp shard
#

can you do "hitstops" in a multiplayer setup ? not sure how that might impact the sync of the game if you do a hitstop when you hit something on client and it "freezes" for a frame, but ultimately, there would be no stop , so yea assuming it's a no for my case but curious so i aked

fossil spoke
#

Why would you want to freeze something for a single frame?

#

Whats the purpose of a system like that?

nova wasp
#

hitstops are incredibly common in character action games and fighting games

#

they give a sense of impact to the point of a hit

fossil spoke
#

For a single frame?

nova wasp
#

but it's frankly more of an animation thing? I don't see why could not just have this done locally

fossil spoke
#

If its just a cosmetic thing, then yeah, do it locally.

nova wasp
#

More for a very short period, for a lot of games this could be measured in frames but in typical unreal terms this would be a fraction of a second

fossil spoke
#

If it has gameplay consequences, frame accuracy will be an issue

nova wasp
#

Modifying the rate of play for a montage is easily done over the network but because of the time-sensitive nature of this, I would suggest sending the event as a single atomic way of deriving where the hitstop happens

#

replicating the start/stop separately will be very fuzzy imo

#

doing one "the hitstop should happen here" somehow will be better than praying the second one shows up in time

lament flax
#

juiciness in game is a lottery ticket

crisp shard
# fossil spoke For a single frame?

maybe not a single frame, i guess i was just referring to a common hitstop, but yes doing locally is what i consdiered but wasn't sure how that would really work given after the event things would be in different places

#

if quick enough, i suppose it wouldn't be that impactful but yea would have to test it

#

my animations are also sprite animations , not that i think that matters much

plain prawn
#

Looking for any recommendations for replicating flying movement. I have been working on custom prediction but it is not as performant as I had hoped.

rustic sable
#

I'm having a crash when a second player joins the game but not sure what the best way to debug is, I packaged my client as debug game but crash logs still aren't providing any hints as to what is happening. any tips for debugging packaged builds?

#

I basically know what system is causing it just not the what is null part 😅

fossil spoke
#

Include the debug PDBs with the build. If it crashes it should produce a stack trace in the crash reporter that you can use to help pinpoint the problem code

rustic sable
#

ok will do, I feel like it's my mini game actor. It's just placed in editor so doesn't have an owner, and just keeps track of players (on the server) that get inside its collider. It adds an onrep element to an array for players in range, oddly enough when a second player enters the game it crashes

nova wasp
plain prawn
nova wasp
#

the general idea is to do the same thing on both sides

#

this must be done from things called from the cmc itself afaik, things outside are not the cmc doing its prediction steps

glossy gate
#

heyyy, I have this function on the card to be moved to the discarded pile. when some special cards move to the discard pile, they have to execute like an ability.

void ATCard::ServerMoveDiscardedCard_Implementation(ATPawn* Pawn)
{
    if (auto GameState = GetWorld()->GetGameState<ATGameState>()) {
        GameState->GetDiscardCards().Add(this);

        switch (CardValue) {
        case EPokerCardValue::CV_Jack:
            Pawn->IncreaseJackActivated();
            break;
        case EPokerCardValue::CV_Queen:
            Pawn->IncreaseQueenActivated();
            Pawn->ClientStartQueenActivated();
            break;
        case EPokerCardValue::CV_King:
            Pawn->IncreaseKingActivated();
            break;
        default:
            break;
        }

        MulticastMoveDiscardedCard(Pawn);
    }
}

In the queen ability, I call the ClientStartQueenActivated() to only execute this code on the client:

void ATPawn::ClientStartQueenActivated_Implementation()
{
    TGameState->DiscardPile->EnableBoxCollision(false);
    for (ATPawn* GSPawn : TGameState->GetPawns()) {
        if (GSPawn == this) {
            for (ATCard* HandCard : GSPawn->GetHand())
                HandCard->ClientEnableCardCollision(false);
            continue;
        }

        for (ATCard* HandCard : GSPawn->GetHand())
            HandCard->ClientEnableCardCollision(true);
    }
}

I only do it in the client because I only want them to be able to click on other cards, etc. It works perfect for the clients but doesn't work well with the server. I added some UE_LOGs on the ClientEnableCardCollision() of the cards and the logs give me the correct values.
The exact problem in the server is that it's not activating the collision of the other players hands.
Anyone knows what I'm doing wrong?

nova wasp
#

use GetDebugStringForWorld(World) to get the name of each machine for the logging

plain prawn
sinful tree
fossil spoke
#

Just looks like you arent smoothing the Mesh.

plain prawn
# fossil spoke Thats not a performance issue.

Yea I am looking at what my threshold is for interpolating the client to the server when it gets the results. I had an idea as well to filter lastmove and not update if it is outside the threshold. I am still thinking and looking for a good way to get it smooth. I feel super close though.

dark edge
#

Basically the bits where, per frame, it figures out where the heli is locally

plain prawn
round glacier
#

Hey all! Crossposting this --

How do I synchronize the trigger to start movement between client and server?

I have an ability that fires a projectile. When the projectile gets near a target, my player is pushed/pulled (at fairly high speed). Right now I'm having the projectile add a tag (on authority) that my main ability is Wait Gameplay Tag Add for, and then it triggers the movement (using Apply Root Motion Move To Target). This leads to desync -- since the client and server aren't starting the move at the same time.

If I use a delay instead of waiting for the gameplay tag, it works much better. But certainly this must be a common problem, right?

plain prawn
dark edge
#

you aren't guaranteed to get that onrep at any certain hz, that's probably your jittering

#

when the onrep comes through, the position just gets set

#

This is a bit of a confusing mix between server authoritative movement with smoothing and a rewind/reconcile system.

#

Also how do you rewind if you don't know what time moves are at

plain prawn
#

Still new to this but I thought that would be a good place so that it was only getting set for relevant players. Smooth was a helper. I had a previous implementation with a struct that would take in time of last move and I would hold that to check against but it completely broke everything so now I am starting back over from my initial commit of having a somewhat workable version.

dark edge
#

I would start by attempting to implement a smooth movement system without prediction

plain prawn
#

I was trying to take in a time before. I will probably just really have to study more on proper workflow of how this all fits together with better placement and order. I was hoping to use the modular chaos system but it was pretty broken (experimental).

plain prawn
#

Do you know of any other good resources? I am really just working of character movement and the network compendium.

dark edge
#

It'd be shaped a bit like this:

Tick:
if local
send input to server (Server RPC)
update velocity/position/rotation/etc based on replicated input vars (all the math)
if authority:
set replicated state variables
if not authority:
Gently correct velocity/position/rotation/etc based on replicated state variables, hard snapping if error is too big.

Server RPC:
set replicated input vars

#

that'll end up with everyone running the sim, and everyone that's not a server gently correcting the sim towards the servers version of things to keep it in sync. This is pretty much how the built-in physics replication works.

plain prawn
#

Ok cool. I will work through a refactor. Thank you for taking a look and giving me feedback. Still fairly new to programming. Much appreciated.

plain prawn
signal geyser
#

Hello! I need some advice on relevancy. Is it good practice to adjust net relevancy at runtime? Specifically I want to set bAlwaysRelevant to true once an actor becomes visible (I have an RTS - style vision system) and to false once it becomes invisible. Does this work if I set it on the server only? Or does it need to be managed on the client as well?

plain prawn
# signal geyser Hello! I need some advice on relevancy. Is it good practice to adjust net releva...

https://forums.unrealengine.com/t/net-dormancy-and-net-relevancy/351941/2 Quick search as I saw this before going to bed. May be something helpful.

Epic Developer Community Forums

Hello! Sorry for the delay. For Fortnite’s setup, we have all of our building actors in the world using net dormancy. We set them up in their constructor with: NetDormancy = DORM_Initial; which means that when we load in, each building will initially be dormant. We do not use bAlwaysRelevant, as we have far too many actors in our game for tha...

signal geyser
chrome bay
dark edge
#

Probably not literally with relevency but accomplishing the same result, not knowing about things you shouldn't know about

sinful tree
# signal geyser Hello! I need some advice on relevancy. Is it good practice to adjust net releva...

The server determines if something is relevant and then does what is necessary to replicate it out if it is. The client itself doesn't really play a part in it other than receiving the replicated data and doing what the server tells it to do (like spawn it because it's relevant again etc.). There is a function that is overridable for actors called IsNetRelevantFor that can allow you to implement some custom code per PlayerController that you can return true or false from to determine if the actor should be relevant for that particular PlayerController, but of course, that's based on the data the server has.

chrome bay
#

I think they do actually use relevancy for it IIRC, they do have a post about it somewhere. Something about pre-computing LOS.

#

A lot of FPS-bespoke stuff

chrome bay
#

Yeah that's the one

azure hull
#

Hi, anyone know is there a way to change this behaviour - on the Packaged version (PIE/Standalone does not have this issue), only for the Server (Listen Server) widgets are created before GameState even exists, which sets a situation that GameState data is not available for Host in the Widgets. Way to control that in Packaged build widget's are created only after GameState even for Server?

chrome bay
#

Where do you create the widgets?

#

Because the only place that would be "safe" on clients is from BeginPlay(), which incidentally the Server would also call at the same time, after GameState creation.

azure hull
#

Those widgets are created in the HUD.

#

At the begin play of the hud

#

Always thought that begin play for actors is triggered when GameState exists, is the hud exception?

chrome bay
#

It shouldn't be

#

GameStateBase::NotifyBeginPlay is what ultimately results in BeginPlay being called.

#

I would attach the debugger and start looking at the callstack

azure hull
signal geyser
signal geyser
modest crater
#

Whoever worked on NPP was such a breath of fresh air, the code is so well documented and the examples plugin is awesome. Shame they left with some small issues but over-all I wish more of epics code was like this

chrome bay
#

small issues
breathes in deeply

modest crater
tardy fossil
#

are UChannel's bi-directional? or is it server to client only

gloomy ibex
#

Anyone able to help me with why the clients flashlight isnt showing the exact same location on server?

upbeat basin
gloomy ibex
#

ignore that ^, i found a way to do it but now the flashlight movement is very choppy

upbeat basin
#

I wouldn't use the camera rotation on the server to set the spotlight's rotation, as I said base aim rotation is preferable there as far as I know

gloomy ibex
#

when the server is watching the clients light move its laggy but in the right position now

#

ok ill try that

upbeat basin
#

And if the only reason why your components are replicated due to rotating them, I'd make them not replicated and let every client rotate themselves using the base aim rotation again, so no auth checks and replications

#

That's probably why they're choppy

raven plaza
#

I'm having an issue in my game where when I join my host with my client it spawns two player actors like expected but it seems to only spawn 1 player controller?

#

Is this normal?

#

Because only one of the players can move

gloomy ibex
upbeat basin
upbeat basin
gloomy ibex
raven plaza
upbeat basin
# raven plaza the game mode handles it

Having a single controller on your own world as a client makes sense since controllers aren't replicated to anyone other than owning clients (so you won't have your hosts controller while the host will have all the controllers). If you're not spawning another character by yourself then there might be a problem with your input binding logic

upbeat basin
#

Base aim should give you the world rotation

chrome bay
crisp shard
#

has anyone used the GMC ? could it possibly be worth that price tag ? lol

raven plaza
#

Another problem I have is that there's lots of rubberbanding and lag, which unfortunately also seems to affect collision for the connected clients? My game really only needs players to see each other as "ghosts", so collision and things like that don't need to be synced. Is there a way to disable syncing of collision?

quasi tide
upbeat basin
# raven plaza Another problem I have is that there's lots of rubberbanding and lag, which unfo...

If you're seeing jumping or jittery/choppy movements your character movement component might be doing corrections due to latency. That's on you to optimize your network related code as far as I know, it shouldn't be that bad by default. (Assuming you're using CMC/AddMovementInput instead of using your own setup like sending input with an RPC and/or setting your location on server)

Collision on the other hand shouldn't be replicated. If you want your characters to pass through each other you might want to set your character's collision response to it's own object type as overlap or ignored by default. If you're setting it on runtime and not on everyone, then that might be also causing the corrections as well. If you can pass through something on server but not on client, you will see you're being pressed against the object on your screen but as you keep adding movement input server will move you forward and eventually you'll jump on your own screen, or vice versa, you'll see yourself passing through something but put back by server if it doesn't actually allow you to pass

raven plaza
#

Is it possible to have the server not correct for collision checks?

crisp shard
#

and the gmc looks great in theory and price / reviews ratio makes sense, but still would love someone who's used it's take

quasi tide
#

Well, I do know Cyn praises it and even routes things through its replication model over UE's default one.

crisp shard
#

interesting, semi convincing just off that

#

600 bonskis is heavy tho lmao

quasi tide
#

Far cheaper than doing it yourself though.

#

If you pay yourself $15 an hour and can recreate the GMC in one work week - then you'll have saved money.

crisp shard
crisp shard
#

curiuos on some of the workings of it too, like how different would my setup become etc

quasi tide
#

You do have to inherit from their pawn. That's mainly it. (I have the plugin as well, just never used it)

#

But their pawn isn't rigid like the character is.

crisp shard
quasi tide
#

It'd just be a change in the parent.

crisp shard
quasi tide
#

Oh, you bought it? lol

crisp shard
#

lmfaoo no not yet, i just wanted to get more familiar, im def thinking about it, but prob won't make a play anytime soon. wanna think about the implications

nocturne quail
#

why are RPC's strict to void only?

chrome bay
#

Because there's nothing to return..?

#

They are effectively async calls

nocturne quail
# chrome bay Because there's nothing to return..?

trying to do something like this.
i know i need a helper function type of bool that will be called by a void server method, but it will be more code for no reason

would like to directly use a return type of RPC

void AActor::DiscardActor()
{

    if (TryServerDiscardActor(PrimaryAttachedActor))
        return;

    if (TryServerDiscardActor(SecondaryAttachedActor))
        return;
    
    if (TryServerDiscardActor(TrimaryAttachedActor))
        return;
}

bool AActor::TryServerDiscardActor_Implementation(AActor* ActorToDiscard)
{
    if(!IsValid(ActorToDiscard))
    return false;
    
    //Do actor spawn method
}
fossil veldt
nocturne vault
#

I created an enemy and made an animation blueprint for idle and locomotion. For some reason, the client can see the walking animations, but the host doesn't see the enemy walking...only sliding across the floor. This is confusing me since it's usually the client that doesn't see something. I'm not sure why and what I'm missing. I'm only using character movement component which is automatically replicated. Any ideas what I should check? The enemy bp is set to replicated and there is nothing on the event graph, just the enemy ai controller has a behavior tree with a roam task

nocturne quail
lost inlet
#

if this actually worked, you'd be freezing the client until the server responded

nocturne quail
lost inlet
#

well it doesn't work, I was speaking hypothetically

#

and if it hypothetically worked, it'd be RTT

nocturne quail
fossil veldt
lost inlet
#

not sure why the client is capable of an IsValid check

fossil veldt
#

Listen to what sswires is saying lmao

nocturne quail
#

but still it will be prosessed using a helper non rpc function

fossil veldt
#

he actually knows what he is talking about

#

when people that know what they are talking about tell you something is a bad idea or doesn't work, listen

lost inlet
#

I doubt that'll happen

fossil veldt
nocturne quail
lost inlet
#

and?

nocturne quail
#

and server keep track of it, so if client send something valid server is in sync already

#

if they send fake weapon, server will invalidate since server don't have it in track

#
FORCEINLINE bool IsValid(const UObject *Test)
{
    return Test && FInternalUObjectBaseUtilityIsValidFlagsChecker::CheckObjectValidBasedOnItsFlags(Test) && Test->GetOwnerInventoryServerSide()->Contains(Test);
}

this is how my IsValidCheck works

quasi tide
# lost inlet if this actually worked, you'd be freezing the client until the server responded

I wouldn't say it would freeze the client until the server responded. I'd expect it to work just like it does in C#-land personally. In UE, it'd be like doing a UE5Coro co_await with the http stuff. Of course this works because it will return something. But I don't see why we couldn't have a form of RPC operate like that as well. Like, maybe have a specifier or something - idk.

lost inlet
#

well until there's native coroutine support

quasi tide
#

Would it be slower? Maybe by a smudge.

#

But I certainly believe it should be possible.

nocturne vault
#

I figured out where the problem is coming from. For some reason, the character movement component of the enemy is not showing the acceleration on the server. It's only showing on the client.

#

not sure why velocity from the Enemy CMC shows velocity on the server, but not acceleration

kind star
#

I am attempting to convert a project from a Dedicated Server to a Listen Server setup. I am having some issues with the 'host' player. I had assumed that the host player would act as a client to their own 'locally hosted' server, but it seems like their character is actually the authority itself.

Are there any tips / tricks others would recommend who have done something similar?

lost inlet
#

this is going to be incredibly game specific

kind star
# lost inlet this is going to be incredibly game specific

I guess I'll just walk through every feature and rip at it until it works 😂 I 'hope' that because the initial project code is configured towards the concept of client/server then it shouldn't be 'too' tedious, its not like converting a single player to multiplayer project

Is there a node in unreal (or a C++ helper function I can make) that can detect whether the game is using a listen server or dedicated server setup?

lost inlet
#

GetNetMode

kind star
#

I assume that's a C++ function?

lost inlet
#

yes?

kind star
#

Ok thanks, I'll go searching

lost inlet
#

though I can't say I've had to use it too much

hollow eagle
#

there's a blueprint accessible is dedicated server function, probably similar for other netmodes.

verbal ice
crisp shard
# verbal ice It is, what do you want to use it for

i'd like to have more movement capabilities really is all, it's something i've always wanted but have semi avoided due to my lack of cpp abilities and feel it could be a reasonable solution. adding dashes, knockbacks, all kinds of different speed/gravity adjustments, etc, these things are just difficult or nearly impossible w simply just the CMC and bp (to do well*)

verbal ice
#

But both the GMC and GMAS 100% support Blueprints so you'd be able to make your custom movement with no issue whatsoever

meager spade
#

Or use mover

#

Seems usable in 5.5

verbal ice
meager spade
#

Everything supports GAS if you make it

verbal ice
#

I don't think MAiWORLD would be able to do that hah

#

Considering they wanted it BP only

meager spade
#

I mean mover you can do it all in blueprint

#

But regarding GAS relation ATM nothing built in. But I'm working on some ability tasks for my plug in that will allow you to do mover related stuff

#

But yeah prediction systems are just separate that's the issue

verbal ice
#

As much as I like GAS, I'm preferring GMAS a lot more lately

meager spade
#

GMAS?

verbal ice
#

Since it was built from scratch, and isn't meant to be a 1:1 copy of GAS, they fix some of the issues GAS has

#

GMC's community made ability system

#

It also hooks onto the prediction system of the GMC so you're basically golden from the start

#

Pretty sure it does predicting GE removal, and one of the newest additions (which is still being tinkered with) is latent server applied gameplay effects, that give the client a grace period to apply them in their prediction

#

That way you can apply stuns to a player on the server and it won't mess with their movement prediction

meager spade
#

Issue I see with other systems is maturity

#

GAS is like 10 years old

#

Used by triple A games

verbal ice
#

Yeah that's a downside, but you gotta start somewhere I guess. The community works on fixes pretty fast when a bug is reported at least.

meager spade
#

I was looking at able years ago and it just didn't have what I wanted. GAS doesn't have everything but it's generic enough you can literally do anything you want

verbal ice
#

On the flipside it doesn't have issues that GAS still has because they're anchored in years and years of code

#

If you're willing to "gamble" with a new system, then I'd go with GMAS, but otherwise yeah probably stick to CMC/GAS

meager spade
#

Not saying GAS is th best system, but it's got proven use. And it's modifier / aggregating is really powerful

verbal ice
#

Pretty sure GMAS has that as well

lost inlet
#

They're putting a lot of resources into GAS though, their engine GP roles are all for GAS

#

probably cos Fortnite

verbal ice
#

Yeah

#

Although it'd be nice if they updated GAS with Fortnite's frankensteined implementation

meager spade
#

I'm very finicky on using systems from third parties.

verbal ice
#

Likewise, I tend not to, but the GMC has proven itself to me and some other studios and I enjoy it very much

meager spade
#

For example we use redpoint eos. But the coding and code style just makes me feel sick. Lol I actually cringe if I have to fix anything

lost inlet
#

should see more Iris activity now too since Fortnite apparently switched to it

meager spade
#

Yeah fortnite is on iris

verbal ice
#

Hahaha yeah, that icked me a bit when I added support for an event called when you get a synthetic session invite or something similar

#

But I do like how easy Redpoint makes it

meager spade
#

Though mover still not working with iris properly

verbal ice
#

GMC isn't yet either, GRIM (the dev) was waiting for Iris to become "prod ready" or close

#

So that he doesn't have to tinker with the Iris stuff in the GMC every update

meager spade
#

People will be moving away from cmc soon

#

Mover will be the future

verbal ice
#

As a default for the engine, yeah I agree

meager spade
#

I literally added dash, etc in about 20mins fully replicated

verbal ice
#

Will I use Mover over GMC? That's still up for debate, because at this current stage, the GMC is more mature than Mover

meager spade
#

That's how powerful mover is

verbal ice
#

Oh yeah that's about the same for GMC

#

That's why I love it over the CMC

#

I can add sprinting within 2 minutes

#

Same with crouching etc

#

Don't have to mess around with custom FSavedMove classes and all

meager spade
#

Right but from a it's in the engine perspective mover is pretty cool. So is the new gameplay cameras system

verbal ice
#

Yeah it's definitely nice that Epic's giving its own solution

meager spade
#

Cmc is just old, I mean it was made to just work

lost inlet
#

at least the Mover talk in Prague finally taught us the distinction between "experimental" and "beta"

meager spade
#

And it did what it needed too do pretty well

#

Beta is worst than experimental? Lol

lost inlet
#

experimental = we ain't dogfooding this
beta = we are

meager spade
#

Lots of good stuff has come in ue5

verbal ice
#

I'll be keeping an eye on Mover for sure

meager spade
#

What would be nice is to kinda rip out core of the gas system and build it around npp

verbal ice
#

But it won't stop me from recommending GMC depending on what the dev's requirements are

meager spade
#

So it can mingle better

lost inlet
#

though I thought in Mover, it seemed to be going to way of the physics prediction system

#

which isn't tied to NPP

meager spade
#

It uses both

#

Depends if it physics based or not

#

You can choose

#

Though again 2 more prediction systems

#

Just make one ffs

#

And share it across systems

lost inlet
#

ah, the original goal of NPP

nocturne vault
#

On level blueprint begin play, I get all actors of my rooms class in the level and send it to the gamestate. I want to randomly pick 1 room when I load the level. The random room is always different for the server and client. How can I make sure they are the same?

#

I was under the assumption that gamestate was the server and replicated to the clients, so I figured it would be the same variable if I set a random room

quasi tide
hollow eagle
#

I believe it, 10 years down the line.

#

by which point mover will be old news

quasi tide
#

I've also heard that thus far, performance is pretty bleh with Mover.

sinful tree
#

And why does your level blueprint do this.... Why not just make the gamestate do it?

nocturne vault
sinful tree
nocturne vault
#

I wasn't aware I could get the rooms directly from gamestate. I thought I had to pass on the references to gamestate. I'll do that then.

velvet jacinth
#

Hope someone here might have the answer to my problem. Very desperate here 😢
https://forums.unrealengine.com/t/kicked-out-from-server-due-to-access-rights/2133672

verbal ice
#

Considering your code, the only way I see this happening is either you messed around in the engine (I'm assuming you didn't), or you have some sort of corrupted blueprint/intermediate code

#

I would do a full rebuild of your project (and re-package it as well), after deleting the Binaries, Saved and Intermediate folders of your project.

#

In the case of a corrupted Blueprint, if it still breaks after doing the above, I would re-create BP_PlayerCharacter from scratch. A bit annoying but worth a try.

inner reef
#

I was seeing tons of weird multiplayer issues, servers not visible, in-game functions not working properly, replicated data not being passed over properly, defaultEngine variables not being used properly, etc etc

#

As soon as I switched to Dedicated Server play, the vast majority of my issues vanished

verbal ice
#

Never had issues with listen servers personally, you just have to account for some of the oddities

inner reef
#

Some people have issues, some don't

verbal ice
#

And the thread says other server RPCs work so I'm really leaning into some sort of corruption somewhere

inner reef
#

Dependent on Engine version, actor type, player count, subsystem type, etc etc

inner reef
verbal ice
#

I'd also make sure you're both running the same version of the game. You're supposed to get a mismatch anyway if that isn't the case but it'd be weird.

#

That's fair

sinful tree
#

I was going to say... I think it may be a version mismatch or something

verbal ice
#

If for some reason they don't get kicked for that right off the bat, which happens sometimes for some reason

#

But that'd mean the "Server_Interact" RPC was Client/NetMulticast in the past. Doesn't really sound like it would've been.

quasi tide
meager spade
#

I've made multiple games with listen server

#

And not had any major issues

tardy fossil
verbal ice
#
    if ((Function->FunctionFlags & (bIsServer ? FUNC_NetServer : (FUNC_NetClient | FUNC_NetMulticast))) == 0)
    {
        UE_LOG(LogRep, Error, TEXT("Rejected RPC function due to access rights. Object: %s, Function: %s"), *Object->GetFullName(), *FunctionName.ToString());
        HANDLE_INCOMPATIBLE_RPC
    }
#

DataReplication.cpp:1292

velvet jacinth
#

@tardy fossil No, I’m using UE 5.4 didn’t touched the source code at all. That’s very weird 🤔

tardy fossil
#

oh they changed it in 5.5 lol

#

thats the right message for 5.4

inner reef
quasi tide
#

Shooters & up to 4

modest crater
gloomy ibex
#

could anyone help with some basic multiplayer stuff? When I make a development build of my project. The clients movement is very jittery, ive removed sprint functionality to see if that was casing it but its not. The base movement is jittery on the client and I dont understand why?

#

The movement is smooth when I play in standalone

fierce prism
#

So here is the issue I am having, I am replicating a modular character that I am editing through a character creation UI I made. I am having issues trying to get this to work for the client. I don't know what I am missing, if I have to make a rep notify for every variable so be it, but trying to avoid that lol

  • first image I am storing all the variables to select each modular piece in a game instance to use for later.

  • second image I am running the a get mesh event and updating every player in level to sync the models every time a new player joins.

  • third image is the get mesh event calling the game instance and calling the event to pull information from all the variables we have saved there.

  • fourth image is the game instance saving the variables to the player character, all the character variables are being replicated.

  • fifth image shows that at the end of the update character event it will call an event on the player character to update mesh.

  • sixth image shows the basic replication to activate a function that will update the meshes

  • seventh image shows part of the function setting the meshes and materials

  • eighth image ends the function with setting the master pose for every modular body part

  • ninth image shows end result where the right side (Host) is the only one replicated

fierce prism
sinful tree
# fierce prism So here is the issue I am having, I am replicating a modular character that I am...

Image 1)
You can't reliably use the getters with an index in multiplayer.
The Game Instance exists on each client and the server but it is not a replicated actor - it only exists locally, so anything being "saved" or "read" from it is only data that the local instance would know about.
Image 2)
Begin Play fires on clients and server for replicated actors. Every client will be attempting to execute the code displayed.
Widgets do not replicate, there is no point in marking them as replicated.
You're again using a getter with an index which isn't great to use in multiplayer.
Because your third part of the sequence is looping through all characters on begin play, you're basically making all players reset the meshes for everyone.
Image 3) Again, Game Instance is not replicated and is separate for instance of the game running. You're effectively asking every client to retrieve whatever value from their own game instance.
Image 4) Look into structures. This can allow you to store multiple values in a neat package.
Image 5 & 6) Your Update Mesh event ends up calling RPCs but this is again executing on all instances of the game, but you're calling it for every single character, so every single player will end up requesting their meshes to be updated, the RPC will only successfully go to the server when a client calls it, but then all clients will still be attempting to call "Set Meshes" anyway since your remote call still goes to it.
Image 7) Can't make out any details.
Image 8 ) No comment.

Normal flow of things for handling replication of things like this:
Client makes a choice > RPCs to Server their values > Server sets values in some replicated variables > OnReps used to execute code to modify what is necessary locally on each client. Any late joiners would also receive the OnRep call and execute the same code.

#

Are you intending on storing the selections a player has made on the client's game instance or on the servers?

fierce prism
#

storing selections on client

dark edge
#

put those variables in a struct or array or map or anything but that

fierce prism
dark edge
#

Tidy it up now

#

then joining a server and sending your data is just:
Load game from slot -> send data struct to server in an RPC

sinful tree
# fierce prism storing selections on client

Ok, so when you call the save character data, you should be able to pass the values as an input into the event itself. I'd again maybe think about using a structure to contain the data.

When a player joins the server and you want it to read the character selection, you can use the begin play of the player controller and you can check if it is locally controlled, and if so, have it read the game instance data and send an RPC (Run On Server) with an input that has the data you want others to have. That RPC can then be used by the server to set a replicated OnRep variable on the playerstate - you now have a single location that perists through gameplay including through respawning pawns the configuration the player wants their character to have.

The OnRep of that variable can then attempt to Get the Pawn of the playerstate, and if it is valid, proceed with calling SetMeshes. The SetMeshes function would need to read the PlayerState for the configuration value ---- This will ensure that when a player updates their mesh values, and the playerstate has a valid pawn, it should update the mesh displayed for their character.

Now we also need to work on when the character comes into play. You can again use Begin Play of the character, and check to make sure the PlayerState is valid. When it becomes valid, you can read the stored configuration from the PlayerState, and then call your "SetMeshes" function. ---- This will ensure that even if a pawn goes out and back into relevancy it can reconfigure itself based on what the player originally selected without having to RPC any more data back and forth.

fierce prism
sinful tree
#

If you allow players to update their values mid-game, then you just need to send the value again to the server in an RPC and set that OnRep, that OnRep will again trigger the SetMeshes function and reconfigure the pawn. 🙂

dark edge
sinful tree
#

Don't think so. :/

#

I usually rely on all the fun OnReps in C++ that aren't exposed to blueprint.

crisp shard
inner reef
inner reef
grizzled garnet
#

How would I create an object on client (loaded from disk) and then send it to the server to be replicated? Currently I'm creating the object in a CLIENT function, which calls a SERVER function that passes in the object. I see via debugging the object is passed into the funciton call to the server but when checking during play it's null

nova wasp
#

what exactly is it?

grizzled garnet
#

a uobject (savegame technically), I defined the IsSupportedForNetworking funciton appropriately

pseudo wagon
grizzled garnet
#

ok I think with this object I can put its data into a struct and send that struct over

#

then just create the object server side

chrome bay
# modest crater Thats what I originally thought but I am curious how it could demolish so much b...

The main issue is that the aux/sync/input states are constantly spammed even when data isn't really changing, and usually multiple frames' worth at a time. IIRC the default sends the last 6 frames every tick, sync and aux states are resent every tick (the frame is changing, and it's not smart enough to do good delta compression just yet). Fixed Tick is particularly bad at this because it actually sends more RPCs than there are frames to simulate, which is odd.

I would just beware that's all, NPP is so experimental it's kind of bananas to me that Epic are pushing Mover when there are so many flaws, but I assume they plan to rebase mover onto something else at some stage. There's also some issues with most of it's core logic running outside the usual game tick groups (some more general optimisations break etc). We've been using it for several months now but not without a huge amount of changes, and it's still a bottleneck network-wise. Have a look around Cedric's posts too 😄

#

Mover itself also has some pretty dumb design decisions, in that all movement functions are static. That's great until you want to actually customise the movement logic to add new features (or missing ones), but you can't without modifying the plugin directly or copy-pasting a lot of your own functions. Quite frustrating really.

I don't really understand the benefit of all that static logic either, it's not like anything is running in a huge parallel sim.

nova wasp
#

wat? why doesn't it just ack the last received frame?

chrome bay
#

Everything is spammed unreliably

nova wasp
#

movement functions being static is insanely good to help make random things be able to move and sweep... but yeah it's not like you can just override bits of it

chrome bay
#

The system isn't mature enough to handle gaps in streams either, so they double-down on making sure you have enough data. The irony is that it spams data so much you end up saturating the connection.

#

I understand why they did it, but in practice it's awful to work with

#

We had to change so much to just support basic features, like killing the player when they get stuck in geometry etc.

nova wasp
#

I like the decision from the standpoint of movement not being married to uobjects

chrome bay
#

Mover is a great idea, with mid execution IMO

#

Got a long way to go before it can think about replacing CMC

#

But I encourage people to just run a basic CMC movement game, then do the same with mover. The difference in time spent replicating actors will genuinelly shock you.

nova wasp
#

christ... I just want the CMC but not forced to be a giant spaghetti actor that makes it simple to extend movement flags on

#

oh well... Maybe they will actually have it not waste so much data if they actually need to run it when fortnite is running on console wifi

chrome bay
#

Yeah, I mean they are at least actively working on it - but I sense Fortnite is going to push harder for the physics route given the nature of the game and all the stuff they've done with physics vehicles lately

modest crater
chrome bay
#

All I will say is try not to get caught up in Epics own hype about it, it was probably going in a good direction but sadly David left Epic before we could find out for sure.. and NPP itself doesn't seem to be getting much focus atm, judging by ue5_main

#

I just noticed NPP is in the "runtime" folder not "experimental".. probably doesn't help

lusty yarrow
#

Hey I'm looking to send a runtime generated UTexture2D through RPC (256x256 - 256 KB in size), whats the proper way of doing this? I'm trying to do it with Tarray<uint8> but can't seem to figure out how to convert the data properly. Also I believe I also have to compress it since it might go over the rpc byte limit?

dark parcel
#

not that pricy iirc

#

does the compression, async, etc. Might worth to skip implementing your own.

lusty yarrow
dark parcel
#

I would assumed, the plugin does what you want. Again, I didn't buy it my self as I have no need for it. You can probably check it out.

chrome bay
#

65536 elements would indeed hit the TArray network limit IIRC

#

Assuming this is a grayscale texture anyway

#

FImageUtils::CompressImageArray() might help a tad

lusty yarrow
#

Thanks! Ill check it out. Im thinking of using http requests instead for sending/reading textures

#

And have a whole api set up for it.

chrome bay
#

Don't forget there's an entire pixel streaming plugin too

dark parcel
#

that's out of the scope of unreal replication :S

chrome bay
#

Not sure it's really made for that mind

#

Oh apparently CompressImage is the correct function now

lusty yarrow
#

To give a bit of context, my client is creating a fpreviewscene and rendering a texture of the scene. Then I need him to send it to the server. Server doesn t have any rendering capabilities otherwise Id have done this on the server, which brings me to the issue of actually sending the texture over.

chrome bay
#

How often do you plan to send this?

#

I thought we were talking one-off send here

lusty yarrow
#

Not often. Client sends it when he "builds" something special.

#

Basically a thumbnail

chrome bay
#

Does fpreviewscene even work outside the editor..

lusty yarrow
#

Yeah