#multiplayer

1 messages ยท Page 728 of 1

fathom aspen
#

Haha yeah but they won't

#

Look underneath

#

GameState

#

GameMode

#

Everything gets destroyed really

glass orchid
#

so where should the server store player-specific variables like selected characters, selected perks, ready-status?

fathom aspen
#

The docs say the same, but it's not true. Or this is a terminology game that we still don't understand

glass orchid
fathom aspen
#

@glass orchid Have you missed this?

glass orchid
#

and if i dont use seamless travel?

fathom aspen
#

I'm not sure why you won't, as it's preferrable

dark edge
fathom aspen
#

But there are tons of other ways

#

SaveGame

#

GameInstance

#

I have a blog post in the making eyes_sus

dark edge
#

Just don't change the level, that's my secret

#

one level from boot up to exit

#

ez pz

glass orchid
#

in theory i could store the selected character on the gameinstance and then have the server request those when the map is ready to spawn them in, right?

twilit radish
#

Wizard where did you even see that actors don't persist throughout levels with seamless travel? All I'm seeing is the engine code actually preserving all data that is marked.

glass orchid
fathom aspen
fathom aspen
#

And it may have to do with the fact that these actors are part of a new world creation cycle

twilit radish
#

But that does not mean that suddenly nothing travels along. Sure player state seems to have some weird specific thing though.

fathom aspen
glass orchid
#

i think i found a solution. using seamless travel i can store the variables on the playerstate, and have the players wait in the transitional level until the final level is constructed

fathom aspen
fathom aspen
winged badger
#

You can just not spawn them until level is ready

#

Dont let HandleSratringNewPlayer spawn them until level is ready

#

And call it agsin for each player when it is

#

Is the map spawned on clients separately?

sacred kraken
#

I feel like I am missing a piece of a puzzle. I feel stupid for asking but: does all code for every player controller get executed on the server? And if not, how can I make sure that properties like health can only be set on the player state by the server?

twilit radish
#

The Player Controller can execute code both from an owning client and the server.

#

So no not "all" code gets executed on the server.

sacred kraken
#

Is that the rpc stuff then?

#

Or, part of what I could use it for*

#

A projectile is traveling, hits me and I should take damage. Does the server keep track of those collisions?

twilit radish
#

You can use it for RPCs yes, but you can also execute whatever you want on both an owning client's side or the server's side.

regal geyser
#

When I try to run standalone builds with simple lobby and seamless travel set to true I get this error below, with seamless travel set to false everything loads up nicely. Is this error supposed to me somewhat specific, because I have no idea how could I fix it

twilit radish
#

The projectile likely exists on the server I would assume and if on the server the projectile hits someone and the projectile says on the server that it should damage that player then yes.

sacred kraken
sacred kraken
#

And if it is, I bind for collisions?

#

And then if it does, I can use the same authority check to apply damage to a player's health

twilit radish
#

The HasAuthority stuff, ownership and net roles / net modes is what makes you able to act on what it should do if that's the question yes.

glass orchid
sacred kraken
#

I'm just trying to figure out what goes where. I've now read most of that compendium and I'm just not following it yet.

#

Let's say guns have a cooldown, then it makes sense to me that the server decides if my projectile is allowed to be spawned

#

In my mind, everything I do only runs in my instance unless I tell the server to run something

#

Maybe that part is wrong

twilit radish
#

I would say the big thing you really need to start thinking about is "where does something happen" if this is an issue. Lets say you have a simple actor that does nothing for now but is replicated and thus at some point exists on both the server and whatever clients join the game yeah? The actor's BeginPlay, Tick etc. all normally get called on both the server and all clients. But no it's not the same exact object that is shared rather the needed things are being shared such as "what actor is this?". Lets say we have a dedicated server (so no client playing on it) and lets say you now add a button to all clients and add a RPC to the actor that sends a predefined string to the server. You press the button and inform the actor on that specific client to tell the server through the RPC "hey I send you a RPC with that string" then the server will receive it hopefully at some point. All that means is that on the client a simple packet was send to the server that will then be executed on the server.

sacred kraken
#

The actor's BeginPlay, Tick etc. all normally get called on both the server and all clients.
This is the part I needed I think

twilit radish
#

But yes the complexity and often confusion comes in when things need ownership, or have "authority" or not or even don't exist on certain clients.

sacred kraken
#

But user input runs on the client, how does that make its way to the server?

twilit radish
#

The client presses a key, the client sends a RPC to the server either saying "I pressed the key and want to pick up something in the world" implying that it wants to do a certain thing or it simply says "I pressed the key" and then do whatever the server wants with it. That's all it really is in terms of networking.

vague spruce
#

i fixed this by using a braindead simple AddMovementInput and getting the target direction and in the future i'll look into using using navmesh points

sacred kraken
#

Or would I do optimistic movement

twilit radish
#

Correct.

sacred kraken
#

Ah

twilit radish
#

But movement is really complicated. That's why Unreal has a built in system for it.

sacred kraken
#

Is that what AddMovementInput does

#

WAIT

#

Is that the built-in multiplayer part I keep reading about?

twilit radish
#

Kind of is the answer, but in the end yes it tells the server through a RPC "I want to move"

sacred kraken
#

Daaaaaaang

twilit radish
#

The moving part is however the complicated thing because of latency.

#

If you were just saying "move" then it would not be responsive, so what Unreal does is apply local prediction of how your character moves and that is where it gets complicated.

sacred kraken
#

And the standard movementinput thingy solves that so you don't have to? Or you still have to?

vague spruce
#

AddMovementInput feeds information to the CharacterMovementComponent, which is the best movement component that UE provides for multiplayer. it has the most prediction code

twilit radish
#

For characters Unreal takes care of things like moving around and jumping.

sacred kraken
#

Oooh

#

Ha, then I might have already done something dumb for rotation

vague spruce
#

you can use other movement tools such as AIController navigation movement, but it's not as good for multiplayer. in fact, it's pretty dogshit

sacred kraken
#

I'm setting rotation on the actor

vague spruce
twilit radish
#

But again all it really does in the end is "client presses button -> client sends RPC to server saying it moved -> Server receives move packet and does stuff with it"

#

The implementation is a bit more complex, but just to simplify it for the example.

sacred kraken
vague spruce
#

that way there is no correction

sacred kraken
#

But shouldn't the server decide if I'm allowed to?

vague spruce
#

ideally they should happen at the same time, but this is almost impossible. so the best that you can do is issue an RPC so that it happens on the server too

#

sure, but the server can correct if something goes wrong

#

rotation is very trivial. usually there are little reasons to want to validate rotation itself

sacred kraken
#

Yeah I'm using it as an example

twilit radish
#

Please just use the built in rotation for characters. Saves so much trouble.

sacred kraken
#

Built-in rotation?

#

๐Ÿ˜ฎ

twilit radish
#

Give me one sec to find it again.

vague spruce
#

yeah what od you mean by "built-in rotation"? you meant like orient rotation to movement?

sacred kraken
#

add controller yaw input

#

dang

twilit radish
#

That one yes.

vague spruce
twilit radish
#

There's also a pitch one.

sacred kraken
dark edge
#

@vague spruceI'd either orient rotation to movement or use the control rotation. Rotation in characters is fucky IMO, it's a mess.

twilit radish
#

CMC uses controller yaw/pitch if you want.

#

Also the controller rotation is already setup for RPCs etc.

vague spruce
#

that is in relation to ControlRotation, which yes, if your character's rotation is dependent on control rotation then AddControllerYawInput will rotate your character

dark edge
#

@sacred krakenWhat is your desired rotation rule?

twilit radish
dark edge
#

The pawn rotates towards..... what?

sacred kraken
#

Snap rotation, 30 degrees

#

vr

#

In this case, anyway

#

I'm just trying to learn what would be the "strictest" way

dark edge
#

and your AI is snapping around too?

sacred kraken
#

There's no AI involved

dark edge
#

VR Multiplayer for a first project, brave

#

lol

sacred kraken
#

AI is fluent

twilit radish
#

Alright I will say one thing right now. VR is an absolute mess in terms of being authoritative or being cheat proof.

sacred kraken
#

It's not my first project :p

vague spruce
#

better than me, MMORPG for my first project

dark edge
#

So what data from the client do you care about in terms of being authoritative?

twilit radish
#

๐Ÿ˜„

quasi tide
dark edge
#

If I look behind me and server doesn't think I should, does my neck break?

quasi tide
sacred kraken
#

It's also not my first project in ue

dark edge
#

Net corrections IRL. I'd just trust whatever orientation the client sends

sacred kraken
#

I mean, I haven't published anything but I make something new every day lol

dark edge
#

and use ControlRotation for something, but IDK how VR works in Unreal, it might be a special snowflake

sacred kraken
#

And now it's vr and my rabbit hole brought me to multiplayer

quasi tide
#

Eh, doesn't mean much imo.

#

If you don't understand the absolute basics of the gameplay framework - doesn't really matter how many projects you've done.

sacred kraken
#

I understand the absolute basics from my perspective of what that means

quasi tide
#

Based on the questions you were asking in #cpp - I'd disagree.

sacred kraken
#

All right

#

A week from now I might too

quasi tide
#

(Not saying there is anything wrong with it mind you; we all start somewhere)

dark edge
#

So yeah you can either use ControlRotation for something or just, per tick
Send info to server, use it locally
Server uses it, setting some replicated stuff
Exclude owner from some of the replication because they're using their local version

sacred kraken
#

Maybe I should just look at the addmovementeinput code and see what happens there

#

Because what I want to know is basically that

twilit radish
#

It's complicated for characters. It's really not fun to try and understand how the CMC / Characters work. If I'm allowed to just give some advice, do whatever you want with it, just try and get maybe some hands synchronized with multiple players without any movement. VR kind of sucks if you want to have 'cheat proof' stuff.

sacred kraken
#

I have some stuff synchronized. Position and hands actually

#

I'm just trying to understand why it works

#

Even if it's not fun ๐Ÿ˜…

#

Oh, it doesn't do anything directly

#

It updates a vector, maybe it's being sent elsewhere. Like some sort of tick. I'll just keep reading the code and stop asking dumb questions about the absolute basics ๐Ÿ˜„

#

Thanks, though, you helped a lot

twilit radish
#

Like I said the character movement code is everything except basic unfortunately. I don't even know my self how half of it works. But good luck ๐Ÿ™‚

#

The small bit of information Unreal has about how it kind of works ๐Ÿ˜„

orchid surge
#

Anyone have an idea or how i should start to make player owned doors for a multiplayer game? Similar to DarkRP / Rust etc? pref in blueprints

sacred kraken
quasi tide
orchid surge
quasi tide
#

So just take those concepts and apply 'em to doors or player made structures or w/e.

vague spruce
#

you can replicate the pointer so it's server-side authoritative

#

that way other clients can't modify objects in the world and make them their own

orchid surge
#

ok. Ill play around with it. Thanks for some pointers

dark edge
#

@sacred krakenFor example this is my Client passing analog input to Server

#

If you're doing VR then IDK why you'd even need Character

#

Just start with a Pawn IMO

#

leave the character bullshit behind

sacred kraken
#

Why though? It already does a bunch of stuff for me, why wouldn't I use it? Or does it do too much?

dark edge
#

I mean what does it do for you?

#

How does movement work in your design?

sacred kraken
#

13k lines of code worth of stuff at least haha

#

No tbh, I use it for basic movement and rotation

dark edge
#

Yes but you're closer to making Beat Saber than Mario Odyssey

#

Do you have walking movement or teleportation?

sacred kraken
#

walking

#

The vr template uses teleportation, I got that part working, but I replaced it with just regular movement

#

Which all works by the way, works just fine

dark edge
#

K so I'd just do the model where you're passing over the HMD and hands transforms every frame

#

If that's stuff that's important for other people to see

#

Do other people see where you're looking and hands are or is it a simpler thing?

sacred kraken
#

They see. I want it to be coop

dark edge
#

What is the minimal amount of data needed to make another client see what you want them to see?

sacred kraken
#

Movement, and gesture based attacks on AI enemies

dark edge
#

for a typical shooter it's position, orientation, and events

#

For you it's.....what?

sacred kraken
#

So the hand location is pretty important

dark edge
#

OK so got the hands. Is the HMD synced?

sacred kraken
#

And the root position + yaw

#

root is the capsule atm

dark edge
#

Is root the thing that rotates in 30 deg chunks?

sacred kraken
#

Yes

#

It's a character

dark edge
#

ok that's fine, use control rotation for that I'd say

#

so capsule orientation = controlrotation

#

that's automagic

#

So what happens if I'm playing and I turn around to look behind me

#

do I swivel my head like an owl?

sacred kraken
#

Haha no

#

The capsule follows

#

The capsule's constantly following the hmd around

dark edge
#

ok so ControlRotation = HMDRotation with some dragging

#

like aim in ARMA

sacred kraken
#

I don't know what arma is, sorry

#

I found the code though

#

It's actually not that bad

dark edge
#

So does capsule constantly rotate to chase HMD or is it only dragged?

sacred kraken
#

What do you mean by dragged?

dark edge
#

If capsule yaw is 0 and HMD yaw is 15 deg, what happens

#

nothing?

sacred kraken
#

capsule will be 15

dark edge
#

or capsule interpolates towards HMD?

#

so capsule yaw is always HMD yaw?

sacred kraken
#

Ah, I see what you're asking now

dark edge
#

You're meaning for capsule to represent the general body orientation I take it

sacred kraken
#

Yes, that was the idea

#

I got movement working, I never checked rotation

#

I am replicating hmd maybe that's why, gave me some food for thought there thank you ๐Ÿ˜„

#

I think I'll have to replicate both

#

capsule and hmd yaw

#

Tomorrow I'll try to use AddControllerYawInput based on the hmd yaw, see if that works, I am curious

dark edge
#

Here's how I'd do it, short of any automagic replication that is going on. This is ignoring ControlRotation.

On Tick:
Clientside:
Send HMD, LH, RH, Capsule rotations and HMD, LH, RH positions to server in an RPC
Set variables

Serverside:
Recieve the data from owning client, set replicated variables (skip owner).

Everywhere
Use variables to drive stuff. You'll need to interpolate on non-owning clients.

#

Something like that

#

Basically everyone is using the same data to drive movement etc.
Except on owning client, they're using their live version, not the server's replicated version

sacred kraken
#

That could work yeah

#

Maybe using the replication would be fine though

dark edge
#

You could also handle the owning/non-owning switch in functions.

sacred kraken
#

A minor delay or a dropped sync here and there isn't that big of a deal I suppose

dark edge
sacred kraken
#

Oh I meant for remote

dark edge
#

you do NOT want to use server data to tell you locally where your gun is

sacred kraken
#

The other clients

dark edge
#

Yeah, it'll be jittery but it'll work

sacred kraken
#

But that's what interpolation is for right?

dark edge
#

You'll want smoothing so everyone doesn't see you spazzing out

sacred kraken
#

Yeah exactly, that's the one part I do know :p

dark edge
#

I need to get a VR setup, I have 2 designs that'd go great with VR

sacred kraken
#

All you need is a quest

dark edge
#

Vehicle and Fishing games. They solve the main problem, in that you don't often walk around much in VR.

#

Nah fuck Oculus, never giving them a dime. Them and Apple.

sacred kraken
#

Ah ๐Ÿ˜„

#

I think you mean meta quest

#

haha

orchid surge
#

OpenXR stuff sounds nice atleast, co-joined collaboration between every big company

sacred kraken
#

vr is my favourite. Even if I still suck at it

#

Anyway, it's getting late. Thanks a lot for all the good ideas and the help

#

I'll be back tomorrow to annoy some more people ๐Ÿ˜„

regal geyser
sand smelt
#

so dumb noob question here: can i have 2 instances of my game running and join if one is a listen server?

#

and whats required to that to work?

latent heart
#

Absolutely.

#

You can even do it via the editor with PIE

grim rain
#

Hello I have a multiplayer game which uses a lobby system and a gameplay system using different game modes/controllers.
I want to make a customizable countdown time for the gameplay that players can choose in the lobby. But how to transfer this value to the actual gameplay ?

sand smelt
latent heart
#

Just run 2 copies of the game.

#

Nothing is stopping you running that exe twice.

dark edge
regal geyser
#

I'm so confused with Seamless Travel, I have custom GameMode, GameState, PlayerController, PlayerState, HUD and default pawn as NONE in the map I want to travel to. (All Blueprints are completely empty)
But as soon as I use seamless travel the game just crashes..

dark edge
#

If you play in editor with 2 clients then one will be listen server

dark edge
latent heart
regal geyser
#

The only gamemode that loads fine is the default one in ThirdPersonCharacter package, my custom one didn't work so I tried to create another custom game mode without any logic (empty blueprint) and it still crashes..

latent heart
#

Debug the crash, find out what's going on.

regal geyser
latent heart
#

No

regal geyser
#

And have you any idea from which point I could find the problems? This is the first occurence of Seamless Travel, but nothing seems to be suspicious.

latent heart
#

How about uploading the entire log somewhere instead of taking random screenshots?

regal geyser
#

On it, sorry!

latent heart
#

Is that the entire log?

regal geyser
#

yes it should be

latent heart
#

There aren't any errors or crash logs.

regal geyser
#

Well I copied the whole .txt file from Crash Reporter, not sure if theres something more to it

latent heart
#

Shrug

plucky prawn
upper marlin
#

A noob question: To start a multiplayer game, should I start first with Menu/user login/matchmaking first, or should I start focus firstly in the multiplayer gameplay, and then manage to save the player info etc later?

#

thanks in advance.

plucky prawn
fathom aspen
#

That's not an #mp question

upper marlin
#

oh im sorry

#

if im asking in the wrong chnnel

fathom aspen
#

Prolly #game-design

upper marlin
regal geyser
plucky prawn
#

Afaik there's no way to debug this without making it a c++ project but I could be wrong and it's also outside the scope of this channel

regal geyser
#

Its already as c++ project I did play with c++ a bit already just didnt use any of it, okey thank you I'm gonna give it a shot

plucky prawn
vague spruce
#

is it possible to issue a Server RPC and get a boolean response back?

#

say, to authorize something?

plucky prawn
fallow shadow
#

does anyone know a good guide on the steam subsystem?

#

like in general what one can do with it and how to

thin stratus
#

So

#

That's two different topics

#

OnlineSubsystem is an interface that sits on top of Steam to expose it in a generic way so we don't have to care about what subsystem is active.

#

Which half the time doesn't work, but whatever

#

If you want to know what this implementation exposes, you'll have to go into the Steam Subsystem Plugin and look through the files

#

That's somewhere in Plugins/Online/OnlineSubsystemSteam

#

Then you can start with OnlineSubsystemSteam.h

#

Where you can find all the overrides of each underlying interface (e.g. Friends, Party et.c) and see which ones are implemented

#

And then go into the classes of those

#

If you want to know about PURE Steam, so what you could do by implementing the library yourself, you should visit Steam's Documentation rather than asking here

fallow shadow
#

Alright, thank you!

twilit radish
#

๐Ÿ‘€

#

But why is it disabled by default? ๐Ÿค”

ancient summit
#

Hey, quick question - I'm trying to make this situation: there are 4 players total, 3 of them sees the item. 1 random player each round can't see the object. i've tried a lot of things, the only thing i achieve each time is that only the server gets these changes ๐Ÿ˜ฆ

thin stratus
twilit radish
#

Fair enough I suppose ๐Ÿ˜„

thin stratus
twilit radish
#

Also kind of depends on if you use C++ or just BP.

ancient summit
#

Both ways can be useful - the thing i'm trying to reach, is that one random player can't see the item everyone else sees. eventually i'll want him to see another item. but hide the item everyone else sees is a good start ๐Ÿ™‚

thin stratus
#

An easy way would be having a PlayerState variable in the Item for who is not allowed to see it

#

And make that OnRep

#

and in the OnRep you check if that PlayerState is equal to the local PlayerState

#

And then hide it

#

But race condition can break it

#

E.g. if the PlayerState is not yet available

#

You can also put the PlayerController in there

#

That will be invalid for everyone but the local player

#

Minus the Server I guess

#

ListenServer's are a special kind of case in all of this

ancient summit
#

That's the problem i'm reaching everytime, the server sees the updates from the clients

thin stratus
#

If you do the PlayerState OnRep variable in the Item Actor (replicated), it should work

twilit radish
#

Btw Cedric if you're still around, what happens if on a Listen Server a "IsNetRelevantFor" is set to false for an actor targeting the local controler on the server? It can't possible just remove it from the server then right?

thin stratus
#

I have not tried that but I doubt this is even used for the Authority

#

Or rather the Server NetMode

twilit radish
#

I'm going to try. I'm curious now.

twilit radish
#

It indeed either doesn't run on the server or just ignores it regardless.

#

Unless I somehow screwed it up xD

twin juniper
#

Why the host can view the steam profile picture but the clients cant?

elder sable
#

Hi, there is no travel node in BP in UE5 ?

thin stratus
#

The only Travel node is OpenLevel

#

BP never had access to more

#

The only workaround existing is ExecuteConsoleCommand with ServerTravel

elder sable
#

Oh that was what i used, thanks

halcyon totem
#

@dark edge when you have a chance can you take a car charger and see if it chargers that 2 and 1 you have? I want to get it but dont know if it can charge in a car with a regular charger

glass orchid
#

does the order in the gamestate's playerarray ever change?

dark edge
dark edge
#

The Flex 5 has 2 charge ports, old style and usb

#

but honestly you can prolly get a better laptop for the money nowadays, i bought mine like 3 years ago

twilit radish
glass orchid
twilit radish
#

I would not rely on the order in the player array in that case.

glass orchid
#

What alternative could i use?

twilit radish
#

Player state has a PlayerId variable. The comments on it seem to suggest you could use that.

Unique net id number. Actual value varies based on current online subsystem, use it only as a guaranteed unique number per player.

#

Although weird how they deprecate it being public and then don't make the accessors for it blueprint callable lol.

#

You could also just of course put the number in the player state of what spot someone is in.

#

You can also make your self some unique identifier and associate the spot with that. Plenty of options ๐Ÿ˜„

glass orchid
#

I think iโ€™ll try that one. Once a player connects they get assigned the first empty spot and stay there until they disconnect ๐Ÿ˜„

#

Altough i really need to look into unique player IDโ€™s for savegame purposes

fathom aspen
twilit radish
#

All it does is increment a number and return that lol. So don't rely on it ever being the same if you have to rejoin a server I would say.

fathom aspen
fathom aspen
twilit radish
#

PlayerID is not UniqueID btw.

fathom aspen
#

I'm referring to UniqueID xD

twilit radish
#

But I was referring to PlayerID ๐Ÿ˜ฆ

fathom aspen
twilit radish
#

It's unique per player and also for clients yes but not truly unique in a persistent way ๐Ÿ˜„

#

But yeah no worries xD

#

Also btw where does the entire reconnect process even happen?

elder sable
#

In a multiplayer game, the hosting client is spawning the default pawn, but not the other clients, is this expected ? If yes i could i disable the default spawning to handle it manually ?

fathom aspen
twilit radish
#

Well yes but not if the server restarts or hard travels.

fathom aspen
#

It doesn't persist a reconnection though. But I think it's easy to make it so

twilit radish
#

It does persist through reconnection.

#

It copies the ID from the old player state.

#

Oh wait does it ๐Ÿค”

#

No CopyProperties also includes the PlayerID.

twilit radish
elder sable
#
ANVAvatar::ANVAvatar()
{
    bReplicates = true;

I guess

#

What is the expected behaviour ? The spawn should be working be default ?

fathom aspen
twilit radish
#

The pawn should just work as long as it's owned / possessed by a player yes.

#

Otherwise it may be a relevancy issue.

elder sable
#

onposses is not called on client, so i have to do it ?

#

Ah

fathom aspen
#

Inside PostLogin. So reconnecting is a hard travel really

#

Well it's by definition

twilit radish
#

I don't actually know if the default behaviour for a pawn is to posses it.

#

Are you spawning it your self or is it the default pawn player thingy?

elder sable
#

I wasn't, but the host seems to spawn it
I tried to spawn and possess manually but the possess doesn't work, it seems the clients are in spectator mode with spec controls

fathom aspen
#

Are you sure you are spawning it server-side?

elder sable
#

They spawn, i can see them on the host

fathom aspen
#

That was not my question

#

You can spawn it client side on the host and still see it on the host

elder sable
#

I spawn them in HandleStartingNewPlayer_Implementation (in game mode) so yes

twilit radish
#

I hate how they spread out the implementation for by default spawning a pawn ๐Ÿ˜…

#

It's just all over the place.

elder sable
#

:p

twilit radish
#

Is there nothing in your logs for the server? Most of this stuff seems to throw some kind of log message.

elder sable
#

Mhh nop but i have a problem client side with the pawn to spawn, i think i have a different assets on the server, will check that

glass orchid
#

how feasible is it to set your game up for p2p multiplayer and later down the line switch to dedicated servers? is there anything i have to keep in mind or that needs to be set up different?

fathom aspen
glass orchid
#

yeah i meant listen servers

#

i just dont want to have to rewrite a whole bunch of things when i switch over to dedicated servers later ๐Ÿ˜„

fathom aspen
#

Yes ofc. That's why you should take this into consideration from now. Still as I said, you aim for both most of the time, as you do HasAuthoirty for example

#

You generally run stuff on the server with that check, so it doesn't really matter what's the NetMode...

#

Still there are some cases where you want different behavior but I can't think of any rn

glass orchid
#

well, as long as i dont have to rewrite major parts i should be fine

#

this is my first project so im still learning ๐Ÿ˜…

fathom aspen
#

Good, keep it going!

glass orchid
#

ive set my gameplay prototype up for multiplayer, and it works so far. i just have to figure how to do lobbies and such now

glass orchid
#

err, in what bp do i actually start the multiplayer session?

pallid mesa
#

game instance is good

#

otherwise you can grab the common user plugin

#

and add a couple of nodes in your widget blueprints

#

it will handle all oss abstraction for you

glass orchid
#

oss abstraction?

pallid mesa
#

online subsystem

#

just take a look at how Lyra manages their listen servers

glass orchid
#

oh okay. what's the plugin called?

pallid mesa
#

common user

#

weird name XD

glass orchid
#

oh so just common user

pallid mesa
#

yeah

glass orchid
#

hmm i cant find it ๐Ÿค”

#

oh wait, it's a lyra specific plugin ๐Ÿ˜…

pallid mesa
#

you can find it within the engine plugins

#

its used in Lyra

#

but its not tied to Lyra

glass orchid
#

what am i doing wrong?

fathom aspen
#

I guess it's called CommonUI

#

just type common

glass orchid
#

i found it ๐Ÿ˜„

fathom aspen
#

Yes this

glass orchid
#

hmm, i guess ill read through it again then

boreal wadi
#

Iโ€™m revisiting projectile based weapons and trying to find some good resources on accurate server authoritative projectiles that look good client side. Iโ€™m currently spawning them replicated server side only and it works but when Iโ€™m introducing 100-200 ping (which is normal) the delay from when you fire and when the projectile spawns is super noticeable. Any ideas where it canโ€™t be hacked easily Iโ€™m down!

regal geyser
#

Why does Seamless travel fail when using Cast To custom character blueprint?
When I replace Cast To my custom blueprint to Cast To Character it works just fine

fathom aspen
#

This is not A leads to B. No one would figure out travel issues without seeing the logs, and that's where you should be looking

mellow stag
#

Hi I was wondering how I would go about improving my replication for my game.

#

Right now if you are on a high ping server, the animations are played after they go through the server

#

I want it so the animations are replicated client side

#

How would I do that?

dark edge
#

So right now, you do a thing, you need to wait PING ms until you see something happen right?

mellow stag
#

yes

#

exactly

dark edge
#

and you want to do the thing instantly instead

#

Yeah it's the hardest part of multiplayer.

#

Lemme guess, jumping is instant?

mellow stag
#

yes

dark edge
#

That's because jumping is predicted, courtesy of the character movement component

mellow stag
#

for example when I swing an axe, or animation it waits until it catches up with server

dark edge
#

Start there.

#

Shit's hard yo. GAS can help you, but if you're new it's a bit intimidating.

#

You can always just dumb fire animations on the client and not wait for server, but there's gameplay implications. What if you think you hit the tree, and the server doesn't? Then what.

mellow stag
#

true

#

I could try to double the animations, what would be the best way of doing that?

dark edge
#

What do you mean by swing your axe

#

are you chopping a tree?

#

or attacking another moving player character

mellow stag
#

All actions

dark edge
#

So what you have to remember is that for each client, they are in the FUTURE relative to what the server sees

mellow stag
#

they're setup to wait for the server atm till you see them executed

#

I am making like a rust type game

dark edge
#

Yeah you're gonna wanna use GAS, have fun lol. It'll be super hard for a one man show

mellow stag
#

And rust has it so when you swing you see it on client instantly no matter what then the resource is given once server realizes

dark edge
#

Yes, and there's thousands of lines of code supporting that

mellow stag
#

Gotcha, thanks ๐Ÿ™‚

dark edge
mellow stag
#

So I don't need to use GAS to fix?

dark edge
#

Well, depends on what you mean by need

mellow stag
#

I want to replicate Rust and right now it is setup like this

#

Input -> Wait for Server -> Swing Axe Animation

dark edge
#

If you're ok on waiting for the RESULTS of any action you can hack it like that

#

Show your setup

#

show the code path from input event to playing the animation clientside

split siren
#

Is it possible to add JoinGame options (i.e. -myoption) to PIE client, so when I click play the first PIE window connects to the server with -myoption1, second window with -myoption2 etc?

dense sundial
#

Question, what is the typical approach to having a locally controlled character play an animation, but on other clients it plays a different animation instead?
(Like locally the character does a simple jump (to be less disorienting for the player) but on clients does a backflip instead)

#

Thanks in advance :)

split siren
dense sundial
dark edge
#

you don't replicate AttackAnimation, you replicate the fact that you're attacking. It can look different in different places.

dense sundial
dark edge
#

That feel when you realize your FPS guy is just a transform

dense sundial
#

I remember watching one of Epics videos back when I was trying to understand all the major systems in unreal, and the guy was showing paragon assets and turned off the animation BP and removed the mesh and was like "all characters are basically just a bird cage controlled by physics" lol

regal geyser
plucky prawn
vagrant grail
#

Simple question :
If I want to spawn an actor and be sure if someone joins later he will see the spawned actor too, what should I use ? Multicast won't work here I think, so what's the solution ?

vagrant grail
# plucky prawn Spawn it from the server

But spawning the actor on the server won't make it spawn for all the clients to my knowledge, so after spawning it on the server if I use a multicast to spawn it on all the clients, the person joigning the game later won't receive that multicast when the server send it so it won't be there for that client.

plucky prawn
#

You need to mark your actor as replicated

vagrant grail
#

replicated just mean "be exactly the same as the server" but as the client didn't spawn the actor setting it to "replicated" won't change anything I think ๐Ÿค”

plucky prawn
#

You are incorrect

vagrant grail
#

explain to me ๐Ÿ™‚

plucky prawn
#

For starters you keen saying you don't think something will work instead of trying it to confirm it will work

vagrant grail
#

I don't have the editor open but the question popped in my mind ๐Ÿ™‚ And I'm trying to wrap my head around ๐Ÿ™‚

plucky prawn
#

Replication doesn't mean "make actor the same as server" it means "tell clients about replication information based on the conditions of each replicated value". When you tell unreal to replicate a property you can set conditions about who gets this property sent to them. When an actor is marked as replicated and spawned from the server every client will have the actor spawned, then the properties will be replicated based on their conditions

vagrant grail
plucky prawn
#

That's incorrect. When a late player joins they will replicate everything they are told to, including your spawned actor

#

So long as the actor is spawned by the server and not a client

vagrant grail
#

Then I don't understand what's the purpose of RepNotify anymore ๐Ÿ˜ฆ I'm so confused, I thought I understood most of unreal networking ๐Ÿ˜ฆ

plucky prawn
#

Repnotify is for when properties change value

vagrant grail
#

change value on the server ?

plucky prawn
#

yes

vagrant grail
#

Interesting

fathom aspen
fathom aspen
#

You will get the RepNotify fired

#

But as a rule of thumb, don't change replicated properties on client

vagrant grail
vagrant grail
fathom aspen
#

It just doesn't add up

fathom aspen
plucky prawn
#

ye but not called on the server, you have to do that yourself

fathom aspen
#

Yeah ofc

vagrant grail
#

So I was right about this :

fathom aspen
#

Yep you was

vagrant grail
#

So "Replicated" kinda override the multicast to handle late joiners (so "Replicated" kinda mean keep this the same between the clients and the server all the time)

#

What does "resilient" mean ? ๐Ÿค”

fathom aspen
#

Well Replication System is one thing and RPCs is some other thing. But yes replication does indeed guarantee that all clients keep in sync with the server

fathom aspen
regal geyser
# plucky prawn It says access violation which probably means using nullptr. Did you degut this ...

Yes I tried to play with it, but I'm pretty new to this stuff and basically what I did was to open the project in VS, start the debugging process that launched UE editor, from there I did everything like normal Opened 2 standalone windows, and when trying to connect it again crashed like usual, while debugging was still running and didn't catch anything. But I'm pretty sure that I'm doing something wrong with this VS debugging..

plucky prawn
#

if it crashed like normal your debugger would have 100% caught it

#

were you running with the debugger attached?

#

this button

regal geyser
#

Yes the whole process is running, but after both standalone windows crash It doesn't seem to catch anything

plucky prawn
#

both windows?

vagrant grail
#

@fathom aspen @plucky prawn Thank you to both of you for the explainations, it helped my brain wrap around the concept of networking a bit more ๐Ÿ™‚

plucky prawn
regal geyser
#

So I can't run Standalone Game? Because that's sort of confusing to me that it opens whole new window and I'm not sure if debugging is still attached to that

regal geyser
fathom aspen
#

It's not

#
#

Also make sure you have the correct solution config

#

DebugGame Editor it's called

regal geyser
#

So I do have a DebugGame Editor chosen, then command line looks like this: "$(SolutionDir)MyProject.uproject" -skipcompile -debug, I start the debug process, run standalone game, crash happens but still can't see nothing in VS

fathom aspen
#

Your content should be cooked too ^^

#

๐Ÿง‘๐Ÿปโ€๐Ÿณ

light iron
#

Mmm juicy content

dense egret
#

I have a listen server and two connecting clients. When I print GetRemoteRole() on the pawn I control on the listen server, I get SimulatedProxy.
Shouldn't it be AutonomousProxy?

void UOverheadWidget::ShowPlayerNetRole(APawn* InPawn)
{
    if (InPawn)
    {
        ENetRole RemoteRole = InPawn->GetRemoteRole();
        FString Role;

        switch (RemoteRole)
        {
        case ENetRole::ROLE_Authority:
            Role = FString("Authority");
            break;
        case ENetRole::ROLE_AutonomousProxy:
            Role = FString("Autonomous Proxy");
            break;
        case ENetRole::ROLE_SimulatedProxy:
            Role = FString("Simulated Proxy");
            break;
        case ENetRole::ROLE_None:
            Role = FString("None");
            break;
        default:
            Role = FString("Cannot get Remote Role");
            break;
        }

        FString RemoteRoleString = FString::Printf(TEXT("Remote Role: %s"), *Role);
        SetDisplayText(RemoteRoleString);
    }
}

Looks like this is a known issue: https://forums.unrealengine.com/t/net-roles-are-different-between-pie-listen-server-and-pie-openlevel-listen-server/568662
_ _

thin stratus
#

@dense egret That post talks about something else though

#

RemoteRole is SimulatedProxy for them too

#

And that is fine

#

LocalRole should be Authority

#

Their problem is that the RemoteRole is AutonomousProxy when using OpenLevel?listen

dense egret
#

Okay, good to know. Thanks for clarifying, Cedric!
I was following a course and they explained how RemoteRole for locally controlled should be AutonomousProxy on the server.

#

Which it isn't for me, so I got confused

glass orchid
#

How's this for finding an available session with the lowest ping? is there a better way i couldve done it?

#

players in lobby is if youre trying to join with friends; i.e. you group up with friends and then actually try to join a hosted lobby. the max amount of connected players is always 5

twilit radish
#

How does your friend/grouping system work though?

#

Because this is not going to group up with friends if they run the same functionality on their own device.

glass orchid
#

yeah i still have to implement that system, but i wanted to include that here so i wont have to go back to it. for now its just for a single person joining the host's lobby

pallid canyon
#

Anyone got a quick and dirty explanation for how to more efficiently package a replicated array of rotators? Something like FFastSerializer or is there something else?
Replicating hand transforms eats the hell out of bandwidth

split siren
pallid canyon
#

That's probably a good enough sentence for me to research then, thank you!

#

Already reduced from 140k bits/s to 40k bits/s but that's still too high for hands lmao

split siren
#

Basically if you using just a normal TArray, it replicates the whole thing when it changes. Fast TArray Rep let's you know when item changes.

split siren
pallid canyon
#

hmmm I might not get much out of that then, fingers move every frame so there wouldn't really be a time where it isn't sending to the network. Unless I did something like check if there was a large enough movement, okay right to transform, Fast TArray Rep picks it up

pallid canyon
pallid mesa
#

if you can live with less precise replicated values

#

you'll win a lot

#

take a look at Quantized vectors

#

also you can normalise your values if they are thresholded

pallid canyon
#

do you know what c++ method I'm looking for for FQuantize?

pallid mesa
#

NetQuantizedVector

pallid canyon
#

tyty

#

will have to test if that doesn't make hands look wicked jittery or something

pallid mesa
#

i mean its usually good enough for sim proxies

#

XD

silver loom
#

I'm extremely confused.

I have a variable set to Replicated in my game state. An array to, however the contents of the array only show to the host client.

For clients, they show a length however they display as nothing when i print contents

split siren
#

I also have a question, I am trying to make Fast Shared Path in Replication Graph work. As written here https://forums.unrealengine.com/t/replication-graph-fast-shared-path-starting-guide/518575

To create a FastShared path for a pawnโ€™s movement data, the first step is to define a custom struct containing all the data needed for the movement update. This struct should define a custom NetSerialize function and support shared serialization (see NetSerialization.h for more info on custom struct serialization).

#

How would one wrap the character movement data in a ustruct, since it is technically managed by RPC calls in character movement class.

split siren
#

Additionally, one would have to somehow supress those RPC calls in the default character movement comp. I managed to create very simple FastSharedPath, but I have absolutely no idea how to hook it to the character movement.

silver loom
split siren
fathom aspen
#

Other clients are not aware of other PCs

silver loom
#

Oh, I see. What's the best way of storing a user then?

split siren
#

Use PlayerStates

fathom aspen
#

You've got PlayerArray in GameState

#

Use it

silver loom
#

Thanks

fathom aspen
#

It's an array of PlayerStates

silver loom
#

Oh. goodie

fathom aspen
#

PlayerState->GetOwner to get the PlayerControler

summer tide
#

So the client's GetBlackBoard appears none. Any idea how to fix that? I guess I suppose to tell server to get it for me

fathom aspen
rocky night
#

Hi, got from nowhere a hefty Bug. Now when i test the Game (Listen Server and 1 client) i see as Client after a few minutes always the Server/Hostplayer glitching in the floor, it happens only when he stops walking. Hรคlp @fathom aspen

fathom aspen
pallid canyon
#

@split siren @pallid mesa Thanks for the help, massive first step in optimization lol
Yesterday vs today:

pallid mesa
#

That's nice, happy it all worked for you

pallid canyon
#

A lot of it was changing 48 transforms into 38 rotators (like...10kb lol), second was the FVector_NetQuantize(). Average packet down from 14kb to 661bit

split siren
pallid mesa
#

the old net profiler provides data net insights doesn't yet have

split siren
#

Ah, right

pallid canyon
#

Yea! That's actually how I got my first path to optimization, not using transforms and using... uh modified rotators lol. Didn't realize a scale in a transform used 96 bits until looking at the packets in Unreal Insights

pallid mesa
#

i always use both ue insights and the ugly net profiler

pallid canyon
#

96*48 is sad networking

pallid mesa
#

yes and i bet these data simplifications work for you

pallid canyon
#

exactly

#

throw in an easy interp and who cares about rounding

pallid mesa
#

and remember about data bounding

pallid canyon
#

Was only initially concerned because 1cm is kinda close to what hand movement might start to notice

pallid mesa
#

anythinf thresholded can be compressed down to a byte if you dont care much about accurazy

pallid canyon
#

yeah, haven't looked at adding thresholds yet but I need to. This was just client to serv, I'm pretty sure I'm not stoked about the server needing to send out the same size array to 16 clients in an instance lol

#

AWS fees would eat me alive

pallid mesa
#

can do extreme culling

#

hands are small anyways

#

wont need to replicate them at a greater distances

pallid canyon
#

Yeah, I can get away with just hand position for movement at a distance, and then I already have a distance based cull in for healthbars and stuff
Because if there's anything I've learned with the Oculus Quest, it's to hate optimization.

pallid mesa
#

VR is hard

#

specially in multiplayer

#

so props to you : ๐Ÿ˜Š

pallid canyon
#

Yeah, I shoulda thought more about that two years ago lmao

#

Everything looked so good
Until the first time I deployed to the headset (for a year I didn't realize the play in editor didnt utilize the headset hardware)

#

T_T

#

Side question, does anyone have a typical feel for a good server outgoing bit/s?

#

I know I gotta get my server processing down by messing with replication, reduce my waste. But aside from "it really just depends on your server" is there a psuedo recommendation?

twin juniper
#

If I'm reducing a player's health due to some collision, would I utilise HasAuthority to reduce the health , and have the health variable replicate inside PlayerState?

#

Would that be the correct way to do it?

pallid canyon
#

Anything health related should be server authoritative. But it sounds like there's two questions: Should the server do it (HasAuthority) and how should health be implemented in MP

twin juniper
#

Yes essentially.

pallid canyon
#

I can't talk to the latter since I use GAS

twin juniper
#

Is it a good idea to keep the player health in the player state object?

gusty mortar
pallid canyon
#

My sides

gusty mortar
#

Outside of GAS I like having a health actor component, which implements an interface like IDamageable

thin stratus
#

I mean you can ways over-engineer stuff :D there are some simple setups like just having it in the Character.
Some might have it in the PlayerState but that's very depending on the game. The Character's health is in most cases not the State of the Player but of the Character.

twin juniper
#

Thank you for that advice, what variables would you consider being part of the player state?

#

Would it be things like position and rotation? Or is that still character based?

thin stratus
#

Everything that is not character relevant that has to persist over the death of the character

twin juniper
#

Ahh I see

thin stratus
#

Ping, Name, Team, Kills, Deaths, Assist

#

Maybe nothing if your game doesn't need any of that

#

Ping and Name are available by default though

twin juniper
#

Okay awesome, and I should just replicate the variable and use HasAuthority to alter it?

thin stratus
#

If the code that reduces the health is running on more than just the Server then yeah

#

But you can also think a bit about prediction

#

And additionally do it on the local client anyway so their game feels more responsive

#

But that's a bit more advance. Doing it only on the server doesn't break anything

twin juniper
#

Ah I see , like letting the client reduce the health but also verifying it on the server

#

Then letting the client know if it doesn't match up

thin stratus
#

Yeah it will correct itself anyway unless the variable replicates somehow faster than the client locally predicts :P

#

If the client sets it to 5 locally and the server to 7 then the replication of 7 will correct it anyway

twin juniper
#

Ah got it!

#

Thank you!

thin stratus
#

The important part is that the client isn't telling the server to reduce the heath

#

Cause then that opens the door to cheating

twin juniper
#

But in order to do that it would have to use a server RPC correct?

thin stratus
#

Yop

twin juniper
#

And since replication is only done by the server I shouldn't worry too much then

#

I think

thin stratus
#

Yup, just making sure cause peeps tend to just do a line trace locally and then server RPC to do the damage

#

When talking playerinput that results in damage, e.g. a weapon being shot or a spell being casted, one only tells the server about the input. Everything else happens on the server and would if at all be predicted locally

#

So same concept

#

Only that collision takes the need for an rpc away

twin juniper
#

They do the line trace locally to prevent the server being overloaded by line traces?

thin stratus
#

No they do it wrong

twin juniper
#

oh lol

thin stratus
#

:D

#

You can do the line trace locally to predict

#

But the server has to do it itself to make sure the target is actually hit

twin juniper
#

Oh I see what you mean

#

So essentially,

#

As long as the variable is replicated

#

and you aren't doing any server RPC

#

you're pretty much fine to prevent cheating

#

since the replication will fix any variables that change

thin stratus
#

More or less yes.

#

That all mostly only makes sense when using a dedicated server that is hosted away from the clients

#

Which costs money etc etc etc

#

ListenServers are Clients that host, so they can cheat anyway

#

And Dedicated Servers hosted by players themselves also defeat the purpose

#

So unless you develop with dedicated servers that you yourself host somewhere in the cloud, you could theoretically ignore cheating cause you can't prevent it anyway

twin juniper
#

That makes sense yes,

#

But I guess with the listen server,

#

If a player really didn't want cheating,

#

They could host the server themselves

#

And wait for others to join

#

but if everyone had that mentality,

#

Then no one would join servers

thin stratus
#

Yop

#

Listen server games usually are also only played in groups of friends

#

Nothing really competitive

twin juniper
#

Unfortunatle,y I don't have the resources to use dedicated hosting,

#

So I have to rely on listen servers

thin stratus
#

Yeah then I wouldn't worry too much

twin juniper
#

Okay thank you

thin stratus
#

Make it feel nice for the client and server and that's it

#

We didn't care about cheaters in The Ascent either for example

twin juniper
#

Awesome, will do !

pallid canyon
#

I would just echo the caveat that it really depends on your game. If it's something competitive people will have incentive to find out when they're host and do terrible things to your code. If it's a low-key co-op? No issues. If it's an FPS? Need to look at anti-cheat sw + doing things to make host cheating more difficult.

#

COD/Halo is an example that comes to mind (at least the old console CODs / Halo)

twin juniper
#

Anticheat could be a route to take, there's also things that can be addded internally into the client code like checking return address to see if it's within the module. But things like that would go outside the scope of the engine and get into platform dependant territory

thin stratus
#

Most of the time if one wants to make a competitive game it's done via dedi servers

#

It's also often backed by progression system that depend on match results and f2p games that have battle passes and such stuff

#

ListenServer games are better of being kept as a friendly brawler or coop of sorts

pallid canyon
#

Completely agree, just reiterated what you said because I didn't remember reading what kind of game Irelia was making, just that they were forced to go the listen server route. So wanted to make sure the "don't worry about cheating" was entirely scoped ๐Ÿ™‚

thin stratus
#

So e.g. Fortnite, Overwatch, League of Legends, any form of competitive shooter, they are all dedicated server based. Even Fall Guys afaik

twin juniper
#

Yes I think fall guys is dedicated

#

Which I really don't understand why, I think that could have been better off as a listen server

#

Since it doesn't seem overly competitive

#

more friendly type

thin stratus
#

Cause their progressions system doesn't allow for it to be ListenServers

twin juniper
#

ahh I see

#

Rewards, etc?

thin stratus
#

Yop

pallid canyon
thin stratus
#

It's their monetization system

pallid canyon
#

iirc they switched to dedicated because of that too?

thin stratus
#

Especially now that it's free

twin juniper
#

@pallid canyon I think it was always dedicated but it definitely had a cheater problem

thin stratus
#

Like why spent money on a dress if you can cheat your character to look like whatever you want

twin juniper
#

Yes

light iron
twin juniper
#

I know for PlayStation it did

#

I don't know for pc versions

pallid canyon
#

They used to, new age COD I would suspect dedicated to support warzone

thin stratus
#

How often I host migrated into cheater lobbies

#

But that was also a bit before all those matchmaking service type games started blooming I think

pallid canyon
#

Didn't someone do an article that was like, 80/100 in warzone cheat?

#

oh those ones

thin stratus
#

At least when I played it last time

pallid canyon
#

yeah

thin stratus
#

MW 1 or 2

#

With the nuke 25 kill streak thing

#

The old ones not the remastered ones

pallid canyon
#

I still remember going back to MW1 years later and flying around because there were so many cheats, people changing your name and doing all kinds of wonky stuff to you lol

twin juniper
pallid canyon
light iron
#

For Honor P2P sucked connection wise, but I don't remember cheating rampant at that time.

#

Either way, I agree competitive games should have dedicated servers. No question.

grave lynx
#

Hello guys, I wonder how multiplayer FPS (a real one with first and third person animations) works when it comes to shooting. For example, when an AK47 shoots, is the bullet that does damage is from the first person or the third person. The same question for a melee weapon, do we do a linetrace from the first or third person?

pallid canyon
#

If all my communication is client tells hand location and hand location is set on server, it doesn't seem like there's a middle spot to jump in and say do it reduced when you replicate this variable to everyone else that's x distance away

pallid canyon
#

I guess thinking about it, the best option is to never send the RPC if over a certain distance for finger rotations

winged badger
#

you're overthinking it

#

if you're replicating your hand positions, that takes exactly the same amount of RPCs, no matter how many clients are involved, just make sure those RPCs are unreliable

#

and when the Pawn replicates, it will replicate its hand positions as well, it doesn't take any noteable amount of extra resources to do so

pallid canyon
#

I'm not following: I'm looking at it from a server perspective. True I get one RPC from a client saying here are my hands, but if I'm hosting 16 people I'm getting 16 total RPCs aren't I? Each with a bundle of 1KB or w/e

#

Then the server walks through its rep check and says oh yeah, need to let everyone know about these hands, and sends out 16 replication updates to all players?

#

I guess that part I'm fuzzy on

latent heart
#

What do you mean "do it reduced" ?

#

UE has 2 options for replication, either replicate it or not. There's no "replicate it half way." That rep or not is based on relevancy.

#

I wouldn't send 16 RPCs out to the clients to update each others' hand locations, I would set a variable on their player state (or their characters) and have that replicate the normal way to everyone with the Unreliable tag (assuming hand location is updated very often)

#

The client would send unreliable rpcs to the server, though, to tell the srever where its hands are.

pallid canyon
#

Right, so that's what I'm doing. I have an unreliable rpc for an array of rotators each client is sending every .1 seconds. So 16 RPCs are incoming to the server every .1 seconds. Then the server updates the replicated variable and it's replicated out to everyone during UEs normal processing.
What I guess I'm fuzzy on givin Zlo's statement, is that doesn't this also use the same amount of bandwidth as the initial RPCs would? (without rpc overhead).

#

What Zlo says seems to imply that you don't ever need to worry about the size of that backend bandwidth for sending clients a replicated variable

latent heart
#

Why every 0.1s? Why not just every tick? The data you're sending is miniscule.

#

No matter how often you update the server, the clients are not necessarily updated at the same speed.

pallid canyon
#

I wish that were true, I'm sending a bunch of bone transforms. I still use up to 90KB/s right now

#

after quantizing

latent heart
#

Per client?

pallid canyon
#

yeah, client to server

#

19 bones * 60 bits * 2 hands * 10 times a second

#

22Kb/s without other updates

latent heart
#

That's still only 3kb/s

#

Oh are you working in bits*?

pallid canyon
#

yeah

latent heart
#

3KB/s is nothing

#

But okay, I guess you don't need every tick updates!

#

So if you want to update every client with each other's hand position then, yes, you're sending 16 times that data back in the opposite direction - but perhaps a little less frequently than 10 times per second.

pallid canyon
#

No you're right, I'm just concerned about the scaling and if a server would get inundated

latent heart
#

That's where relevancy comes into play.

#

UE has distance-based relevancy (and ways to set other types up.) I'm not sure on the default settings, but there is actually documentation about it.

#

If people are far away, you can obviously just not send data about the other person and save some bw

pallid canyon
#

Yeah so that's what I had just come up with in my head when I said my last thing before Zlo (ish, it was more I wouldn't update/send rotators to the serv specifically and then UE wouldn't send a replicated variable update to clients since it wouldn't change, though it would still waste hz on checking)

#

Just wanted to make sure I understood the original response. I think I'm still in the right boat

shell forum
pallid canyon
#

I mean, leaderboards back then were hacked within a week of release like every time. It might have been that simple lmao

pallid mesa
#

look

#

You can normalize thresholded values to 0-255 range

#

which is a byte

pallid canyon
#

just by clamping? It'll rip off all the 0's?

pallid mesa
#

you just normalize the value to 0, 255 range and compress it on a byte

#

ofc loosing accuracy

pallid canyon
#

huh, interesting

pallid mesa
#

this is done on Lyra btw

#

i believe the char movement comp does it

faint eagle
#

how do I pass an array of structs to a FArchive in a custom struct NetSerialize implementation? When I'm just doing Ar << MyArray I get a compilation error that says that "binary '<<': no operator found which takes a right-hand operand of type 'FMyStruct' (or there is no acceptable conversion)" Am I really supposed to override that operator in FMyStruct or am I doing something wrong here?

swift turret
#

hey, how does the "net cull distance" works? what is it a range to? because im working on a spectator, that is using "view target" of another player and if we died long distance from a new player target then the replication doesnt occur

#

what else do ineed to do to make replication work?

hybrid crown
# swift turret

State who is persitent, or every data, should be repnotify.

#

Your client (or the server) update the state of X variable.
And this variable, use repnotify.

#

Cause when an actor became relevant, BeginPlay is call, and iirc also repnotify if it's needed.

#

I guess, but there is maybe a better way, having a replicated array of dead player, or pulling from the server on the client the list of dead player can do the trick.

swift turret
#

my problem is that when im spectating other player that is far from the place i died, things that are close to him (and to my cmaera now, because i changed view target) are not replicating

#

like AI movement etc

hybrid crown
#

Oh

#

iirc replication is around the the actual pawn or the actual position of the controller ?

#

i mean, the net culling is around*

swift turret
#

thats what i would like to know

hybrid crown
#

let me check the source.

#

Not even need

#

the golden source speak

#

check compenduim 75

faint eagle
#

why can APlayerController:UpdatePing override be not called on NM_Client instances when launching the game in standalone mode? ๐Ÿค”

hybrid crown
#

"If the Actor is 'bAlwaysRelevant', is owned by the Pawn or PlayerController, is the Pawn,
or the Pawn is the Instigator of some action like noise or damage, it is relevant" (and other eg)

winged badger
#

you're far more likely to have a server time evaluating actors for replication as a chokepoint, then bandwidth

#

in fact, i only remember one person with bandwidth issue here in last 5 years

hybrid crown
#

So yeah, pretty large i get.

swift turret
#

i cant make all actors always relevant

#

thats insane

hybrid crown
#

Check the whole page.

#

There is ALL the case.

#

where an actor is relevant, or not.

#

by distance, and not.

swift turret
#

ok, i will check it, thanks!

hybrid crown
#

and how the distance is calculated.

#

by what, against what, in different case.

#

I just give you the sentence to allow you a ctrl + f.

winged badger
hybrid crown
winged badger
#

but ROF 2500 is quite manageable

hybrid crown
#

yeah, but sending FHitResult in a RPC, then multicast it, less.

#

or at least, when i do the test, i got an bandwith issue on the profiler.

winged badger
#

need to get rid of the MC bit

hybrid crown
#

but this is by the way, an horrible way to do this.

winged badger
#

its brute force replication, rarely achieves the best results

#

why the entire FHitResult?

#

simulated proxies don't need that amount of information

hybrid crown
#

It was my very first attempt to make shooter.

#

but yeah, sending fhitresult doesn't make sens.

#

but that how i learned it at least.

#

Player was strangely freezing when they start to fire with some weapon ๐Ÿ‘€

winged badger
#

that would likely be hitting an ensure

#

especially if it was just once per editor start

hybrid crown
#

Hum ?

#

Oh no no, from what i remember, people was just freezing on place.

#

then when they stop fire, moving again.

#

but yeah, limit the info of absolute need to re-do the shot + "burst counter" to replicate the shot effect was all it was needed.

winged badger
#

i have a top down 8 player coop that has 2500 rpm weapons

#

i don't even bother replicating shot for shot

#

i just replicate the (Target Actor, Coolrdinate, FireMode, FirePressed) package

#

and let simulated proxies guess what just happened

fathom aspen
fervent gorge
#

i have a problem with RPC Server/Client functions call. By the delay i call PingPongStart function, that should execute server-side function. In That function i want to execute client side function. But it only executes on the client, that is host/lisener. And nothing on connected client

fathom aspen
#

All subsystems don't support networking. What you would do is have an actor that acts as a network manager for that subsystem

ancient adder
#

I tried setting the random actor owner as my character/controller, but im still failing to RPC on that actor

fathom aspen
#

Ah you won't RPC on that actor, as it won't be owned(or server owned) so you would still want to route your rpcs in the client owned actors, but you will use it to replicate stuff

fathom aspen
#

Same issue @ancient adder has

ancient adder
#

I'll try spawn an actor on client side and set the owner on client and try rpc

fathom aspen
#

Route your RPCs through client owned actors, i.e PlayerController, PlayerState, Character...

ancient adder
#

Why?

fathom aspen
#

An actor spawned on client can't replicate

#

Do it as i said

ancient adder
#

atm im trying to rpc not replicate

fathom aspen
#

You can't even rpc in an non repliacted actor

#

Read the compendium

#

Find it in this channel pinned messages

fathom aspen
#

I haven't worked on FPS games before, but if it's an FPS game why would you line trace from the third person mesh

#

It's only for visuals, isn't it?

fervent gorge
fathom aspen
#

That has nothing to do wity solving your issue

fervent gorge
#

also, if i have 2 clients with ROLE_AutonomusProxy, will they both execute Client function or only the first one

fathom aspen
#

Well it might work

#

But you got relevancy issues

#

If a connection isn't relevant for that actor then you're screwed

fervent gorge
#

that's kinda a point to have phantom server pinger

fathom aspen
#

Multicast and client rpcs are one shot events

fervent gorge
#

and if u don't get answer from it - than connection is lost

fathom aspen
#

They aren't stateful

fathom aspen
fervent gorge
#

Got it, thank u

fathom aspen
#

But don't over complicate it with Roles. Client owned actor -> can RPC, if not then he can't

ancient adder
#

So its not possible to rpc if its not PlayerController, State,character? im trying to make a plugin that can be added to an existing project without editing existing blueprints/code

fathom aspen
#

Correct

ancient adder
#

Thats bs xd, why would they do that

fathom aspen
#

Well you can still grab his PC without knowing it's infrastructure

fathom aspen
#

Getting a PC is project agnostic

#

That's what I mean

ancient adder
#

Im sorry i dont understand whats that and how i can use it to achieve my goal

bitter oriole
#

Character is only when possessed, too

ancient adder
#

Thats kinda very limiting

#

Forcing to do rpc on those specific actors

bitter oriole
#

It's fairly good practice, you don't want clients to have dozens of open channels uploading stuff

#

Normally the only things you need to upload would be player input and local save/user data

#

Those widely overlap with PC, PS, Pawn

ancient adder
bitter oriole
#

It's literally three lines in the player controller - createdefaultsubobject, uproperty, and replication field

ancient adder
#

So its impossible to do network in a plugin if you're going to add it to an existing project without editing anything in that project?

bitter oriole
#

You would expect users to easily opt into those new features

ancient adder
bitter oriole
#

An actor component is the most obviously modular option since you could add it to any actor

regal geyser
#

Why when using seamless travel on Server in Begin Play it correctly outputs Objective variable, but as soon as Rep Notify event is triggered it says that Objective is not valid? (In the same Blueprint)
(Only happens on Host, Clients RepNotify events works like it should)

#

That BP is already in level by default, the begin play event fires correctly, but as soon as RepNotify event triggers Objective is not valid..

regal geyser
#

So found out that if I want to use Objective variable I need to set it as "Instance Editable" and then it works with seamless travel, why is that?

fathom aspen
#

2 issues here.
1- Why Objective variable isn't repliacted? Client has no idea what that is on case it was set on server.

2- You make it replicated. You can't guarantee it replicated at same time Taunts variable has repliacted

swift turret
#

@fathom aspen im looking for more tutorials from you, im working with UE for so many years and i didint knew about this state in PC!

regal geyser
#
  1. Every client will set Objective variable during Parent:Begin Play event manually, on clients it also worked without problems only the host had it set to None
  2. Objective gets initialized at the very beggining of Begin Play because its already in level prio to seemless travel, this Taunt is basically an ability so if clients want to use it they need to press given key so at that point Objective should be already initialized
fathom aspen
regal geyser
#

And the weird thing for me is that Objective variable is being set inside of the same BP, where function Construct Root Objective Collection is an override from its parent BP. So I would think that Objective variable should be set correctly and there is no need for it to be set as Instance Editable.
Then If you are Host in the BeginPlan it still correctly outputs given Objective, but as soon as RepNotify events is triggered it says that Objective is not valid.

#

I also tried setting it to Replicated and removing Instance Editable checkbox but then it again stopped working

winged badger
faint eagle
#

how does the emulated latency that you set in the editor work? I set it to 50ms for incoming and outgoing traffic but when I launch the game in standalone mode my ping (in both player controller and player state) is ~250. Is it expected behavior?

regal geyser
#
  1. Each BP_Quest is present in level by default, and in Begin Play event Quests root objective, and other objectives (child of root objectives) are created, both functions need to be overriden by Child BP_Quests because they Construct different Object class
  2. BP_Quest_Taunt constructs its root objective and also sets the reference to created Object actor (Objective)
  3. BP_Quest_Taunt in Begin Play calls parents Begin Play first and then when I try to Print given Objective, it works. But as soon as I try to use this Objective variable inside different event it says its not valid
twilit radish
#

Not sure why it's 250, unless my understanding of it is just wrong.

bitter oriole
#

You need to add the framerate too

#

If you're running at 30fps that's 33ms to add

twilit radish
#

Ah so there is the extra delay then yeah.

#

So network latency + processing the actual requests.

faint eagle
twilit radish
#

Sorry wrong method. Can you try GetPingInMilliseconds() and see what that returns?

#

Also I don't think roughly 80ms is wrong in the first place. 60fps is roughly 16ms of processing times roughly two/three for total processing + 40ms of latency

faint eagle
twilit radish
#

PlayerState.

#
float APlayerState::GetPingInMilliseconds() const
#

But I guess it doesn't really matter as it shouldn't be wrong.

faint eagle
#

doesn't exist ๐Ÿ™ˆ

twilit radish
#

What engine version are you on?

faint eagle
#

4.26.2. I've checked Lyra project, that method exist in there

#

but the code inside of it is basically return legacy Ping * 4.f

twilit radish
#

It was added 10 months ago I think, so may just not exist in 4.26.

bitter oriole
#

UE5 exclusive

#

But yes, it's trivial

twilit radish
#

But like again, 80ms isn't wrong regardless of the method.

faint eagle
#

hmm ok ๐Ÿค” i was always thinking that those latency editor properties don't take the processing time into account. it's just strange to think that my final ping consist more of processing time than the actual data transfer

twilit radish
#

Well the lower it goes the more that affects it. It's also not the exact frame time, that's why I was saying 'roughly' because in the end it's not an exact full frame of delay. But processing requests definitely is a part of it.

grizzled stirrup
#

Just double checking on this: if a player has a replicated TArray<FSomeStruct> property where FSomeStruct has say 5 uint8 properties. If the player changes a single uint8 on a single one of the structs in that array, will only that one uint8 replicate down to other players? (or will the entire struct... or even the entire array?)

fathom aspen
untold orbit
#

Hello, I'm stuck on a problem: I would like to be able to retrieve a value from a widget (or a reference to it) on the server side to be able to process information. Basically I have an actor (replicated) when I interact with it, a widget is created on the client side and I would like to be able to retrieve the information from this widget on the server side when the player re-interacts with this actor. Actually I'm only able to get the information on the server on client side my widget ref is empty.

The part of code in my actor to try to get the slider value:

#

And this is the way I create my widget ref: (Thanks in advance)

fathom aspen
#

Widgets are client side only

#

UMG widgets to be specific

grizzled stirrup
untold orbit
# fathom aspen Widgets are client side only

Yes I know but actually I have a slider (it's a QTE) and when the player press the button I want to send the information to the server with the slider value to check if player succeed or not the QTE, I just thought about this one do you think it's a good idea to store a variable in PC and update this one every time the slider is updated and get the value from this new variable in PC ? (Or there is a better way to do that)

fathom aspen
#

Ok then send the info to the server. Info shouldn't be stored in widgets originally. It would be stored in PlayerState for example and you retrieve your data from there to the other classes

faint eagle
#

am i still supposed to see the contents of network data bunches in unreal insights after I implemented bool NetSerialize for data structs?

fathom aspen
untold orbit
potent coral
#

how do i set the IP of my listen server?

grizzled stirrup
#

It will be your public IP

potent coral
#

how would it even know whats the correct IP to use?

bitter oriole
#

Your server (the machine) has an IP

#

The server (software) doesn't need to know it

#

It doesn't in fact have any easy way of knowing the IP of the machine

potent coral
#

so it will just work if i use RAdmin or the likes?

bitter oriole
#

No idea what that is.

potent coral
#

basically like hamachi

#

it creates a new network

#

with its own ip

bitter oriole
#

I'm just answering the question here - your server doesn't need to know it's IP, and cannot easily know it. It's the client that may need to known the IP of the server, which is what online subsystems do - by using a centralized authority. Steam, EOSD? Xbox, PSN, GOG etc all provide such a service.

potent coral
#

im not using a subsystem

#

just direct connect

#

so how to actually set the IP on the client so he knows where to connect?

bitter oriole
potent coral
#

i dont think i need online subsystem to make local multiplayer...

bitter oriole
#

For local multiplayer on LAN, the NULL subsystem works in fact out of the box

potent coral
#

so how to change the IP it uses for LAN?

bitter oriole
#

You cannot change the server's IP, that's the IP of the machine

#

You can however search for sessions on the local network using the NULL subsystem

potent coral
#

but i have 2 IPs now...

bitter oriole
#

Server would create a session, then client would search for sessions, and join a session

#

No IP needed

potent coral
#

i dont understand how i should connect to a server that listens on the wrong IP...

#

i cant fkin use 127.0.0.1

#

because i have a new LAN with its own IP

bitter oriole
#

You cannot in fact "listen on the wrong IP" because you do not listen to an IP

#

Servers do not need to know their own IP

#

It's the client that needs to know the IP of the server - and fortunately, online susbystems solve this!

potent coral
#

ok so i just do the networks IP and 7777 as port?