#multiplayer

1 messages · Page 721 of 1

latent heart
#

All the functionality is right there,

normal garden
#

However, if you are expecting your player base to primarily host by listen server this would be useful

#

That's not the issue, I'm trying to avoid duplication

#

Is there some documentation out there on creating custom property specifiers?

#

for example, if you could have OnListenServerChange or something along those lines:

UPROPERTY(ReplicatedUsing = OnRep_TendiesUpdated, OnListenServerChange = OnRep_TendiesUpdated)
bool TendiesUpdated;

this would save you from having to have these OnRep calls all over the code base

latent heart
#

I wouldn't specify it twice.

#

I would add a flag that makes the OnRep be called in c++ too

normal garden
#

You're already executing the OnRep twice

#

What's worse?

latent heart
#

Read the second line!

normal garden
#

Can you explain what you mean?

#

by flag do you mean boolean?

latent heart
#

Yes.

#

UPROPERTY(OnRep=blah, CallOnRepInCPP)

normal garden
#

Is CallOnRepInCPP some custom property specifier you would create

#

or are you talking about creating a completely separate variable to manage the state

latent heart
#

If you wanted to not have to call it manually, then yeah.

normal garden
#

This is what I am asking lol, is there any documentation out there on how to write a property specifer

latent heart
#

Nope.

#

You'll have to find how to add it in the unreal header tool and then how that metadata is used in the engine.

fathom aspen
#

You are prolly doing that on client, and GameState hasn't replicated yet. Add a small delay before that to see if it does the trick

#

Correct

fathom aspen
#

APlayerController::PawnLeavingGame destroys the Pawn. Override it and make it not.

twilit sequoia
#

@fathom aspen thank you, this is exactly what I needed to know

fathom aspen
#

What does this mean? AI controller controls NPCs, while PlayerController controls PCs

twilit sequoia
#

I mean, if the pawn is depossessed ,I want for an AI controller to possess it

fathom aspen
#

Yes, I see no issue in doing that

twilit sequoia
#

For example, a player in an MMO who doesn't log out (properly) and so has an avatar just standing in the world

#

OK

winged badger
#

there is no issue doing that if the Pawn knows how to execute all its actions, and the controllers just tell it what actions to execute, via input or behavior tree

#

if you put the Pawn specific logic in the Controller though, you're kinda screwed

twilit sequoia
#

True. Care needs to be taken that shared implementation isn't in one of the Controllers

regal solar
#

How many game sessions x5.large can handle at once? (Gamelift)

bitter oriole
#

Depends on your game

graceful falcon
#

Hey guys I got an problem where to server and the client are not in sync, I fire an event and then the server is getting called immediately but the client is getting called around a half a second later. Does anyone knows how to fix this?

#

Here are some screenshots

unkempt tiger
#

In fast array serialization, does marking the entire array dirty (when elements are removed) necessarily mean replicating the entire thing from scratch? Or is there still some deltaing happening in the background?

#

I'm trying to figure out how hard I should work to stay away from removals

pallid mesa
#

with removals you are safe with fast arrays

chrome bay
#

Marking it dirty just means it'll do comparisons

pallid mesa
#

fastarray is a bit worse for netbroadcasttick

#

better for bandwidth

#

but meh

chrome bay
#

Depends tbh, TArray removal is faster if you remove from the end

#

FastArray has quite a large header size for changes

pallid mesa
#

we are speaking about bandwidth now?

chrome bay
#

yeah

pallid mesa
#

ah oki

#

yeah tarray is depends ™️

#

x'D

#

but if you decide to netserialize your whole array and ignore deltas

#

it'd be better for the cpu, worse for bandwidth

#

but deltas will be in consideration anyways

unkempt tiger
#

Awesome, thanks 💪 quickly gets rid of paranoid virtual removal code

pallid mesa
#

right, so random accesses with long arrays, fastarray better for bandwidth (in general)

#

short arrays... almost tarray wins always

chrome bay
#

yeah it really depends tbh, just have to make an educated decision on what one to use where

#

the more you know about how they work at the base level the easier it is to decide

pallid mesa
#

rule of thumbing this is really tricky................

#

but I guess with a series of rules and your budget needs you can decide

chrome bay
#

any fast array change for e.g. is a minimum 128 bits

unkempt tiger
#

when we say short, how short are we talking element count-ish?

chrome bay
#
  • 32 bits for each altered or deleted index
#

also depends how well the items serialize etc. By default in 5.0 per-element delta serialization is done with FastArray now, but previously that wasn't the case

pallid mesa
#

depends aswell on the nature of your data

#

yeah what james said

chrome bay
#

So if you have an array of fixed size where only the elements are changing , TArray (or static array) is better

#

Certainly used to be the case anyway. The general answer is just "it depends" as always 😄

unkempt tiger
#

we should have an array type that ughmm yeah i dont know what im saying

pallid mesa
#

🤣

#

it's hard to tell

#

as Dev told me once, tools in your toolset, sometimes you can unscrew screws with the wrong screwdriver

#

profiling gives the solution for your use case always

swift pulsar
#

Hello, I'm trying to blend to Level Sequence camera in a multiplayer setup.
The Player Controller blends correctly and the sequence is played, but I'm not blended into the sequencer's Camera Actor, but in the Level Sequence Actor itself.

In the single player setup, setting the view target to the Level Sequence always automatically blends into the camera. It doesn't work like that in the multiplayer?

grizzled stirrup
#

I'm getting crashes when hosting a session then accepting an invite to another session. Is it essential to destroy any existing sessions before joining another?

quartz iris
#

How can I play an interface on the server?

bitter oriole
#

Define "play an interface"

quartz iris
#

I made a flashbang with an interface which makes the character get flashed with a widget

#

If the character is in the range of the flashbang

#

But it doesnt work for the server

#

only clients

#

However it spawns the projectile

#

Here's the spawning part of the code

swift pulsar
swift pulsar
#

You need to initiate it on the server, but run it on the clients. For example with the "multicast" event.

grizzled stirrup
swift pulsar
#

Sth like this:

#

Or even better:

quartz iris
grizzled stirrup
#

Right so it's a separate projectile spawned on the server that then runs code when exploding?

quartz iris
#

Yeah

grizzled stirrup
#

Is this a dedicated server (pressing Run as Client) when playing or a listen server?

#

Have you tried seeing if the trace even runs?

#

Before thinking about the interface

quartz iris
#

Yes

#

It works every time in singelplayer

grizzled stirrup
#

No but have you verified via a log or whatever that it's getting as far as the interface func call on the server?

#

You can log for client and server separately to see

#

Important to nail down exactly how far it is getting on the server before assuming it's the interface

#

It may not be calling that entire chunk of logic

graceful falcon
#

Hey guys I got an problem where to server and the client are not in sync, I fire an event and then the server is getting called immediately but the client is getting called around a half a second later. Does anyone knows how to fix this?

#

here are some screenshots

swift pulsar
twilit radish
#

Welcome to latency 😅

pallid mesa
#

the way to sync it is by sending a timestamp

#

basically

#

u do action locally, tell the server to do it with your timestamp

#

once the action arrives to the server

#

the server can know when you started issuing the action

#

the server can validate such action

#

if everything is nominal

#

it will proceed to fast forward the action to the point where it should be based on current time and timestamp

#

if a hazard is found the server issues a rollback to the client

swift pulsar
pallid mesa
#

yes your local timestamp

#

usually you'd like to have a synced clock

#

in vanilla UE4 is getservertime

#

or sm on the likes in the gamestate

#

it's not very good

#

in fact I recommend implementing your own ntp clock

swift pulsar
#

NTP?

pallid mesa
#

network time protocol

swift pulsar
#

ok

iron glacier
#

Does anyone have any clue why a root motion anim montage would shake or glitch the animation without applying the movement? This only happens in multiplayer mode. The animations have enabled root motion and the animation bp is set to accept root motion from montage. Not sure what I am missing

magic yoke
#

Riddle me this batman:

I make 7 calls on my server to RPC on my client. I confirm that the call is going out to 7 different actor components. All actor components have the same owner and are the same class, created in a batch earlier. Only the first actor component runs the code, the rest do not. No message log errors indicating that the code hit an error

Am I missing something about how this should work?

#

event dispatcher allows you to make a single call that splits into multiple simultaneous events

#

should be what you need

shell forum
magic yoke
#

fuck it nevermind

#

I'm not 100% sure on the answer since I don't know how you're doing things and I'm no expert myself

#

disregard my info if it's not a simple answer like not knowing about event dispatchers

grizzled stirrup
#

Late joining clients will automatically call all OnRep functions that differ from the default values of OnRep variables, correct?

lone steeple
#

Hello, I'm currently implementing a system to add niagara particles to any item I can pick up. I also want to make any upgraded sword or similar have particles as well.

So far, I've gotten to the point where the server spawns the particle systems, but I still gotta get it to the client, which brings me to my question...

I'd assume these weapon particles are spawned on the server then I need to somewhere have a multicast event which spawns them on the client?

I'm still quite clueless on how these systems are implemented in multiplayer. Any guidance or advice would be greatly appreciated!

grizzled stirrup
#

No need for any replication here

graceful falcon
neon atlas
#

Where do you add new players and lookup to check if they've been on before? GameState? GameMode? On the player, when the player calls begin play?

silent valley
lone steeple
#

Yeah, I just tested it by getting ownership during runtime and the moment the playercontroller is the owner of the item that's on the ground, then it works, but also only for that particular client. So, I need the server to distribute the particle systems I guess?

grizzled stirrup
#

So if the pickup actor is replicated and you activate the FX on BeginPlay, it'll play on both client and server without having to specifically call a multicast RPC or whatever

lone steeple
grizzled stirrup
#

Ok so you have a pickup actor and on beginplay you are spawning the FX right?

#

In that case if the pickup actor is replicated, both server and client will see the FX playing

lone steeple
grizzled stirrup
#

I'm still quite clueless on how these systems are implemented in multiplayer. and I implemented a very complex system from an ARPG plugin that does a bunch of things don't get along great: I suggest simple examples to learn how things work

devout berry
#

I know this is under NDA mostly, but how do people test online multiplayer on consoles before release?
I get that you can use steam etc. for pc, but otherwise I would need 2 devkits then or what is the common approach?

grizzled stirrup
#

You get dummy accounts that you can use

#

And yes you'd need 2 dev kits

devout berry
#

But for devkits

#

yeah exactly. Ok thanks

lone steeple
#

At BeginPlay in the BP_MainPickupClass calls a custom event called initialize within the BP_PickupComponent which down the line calls an event called setParticleSystem which sets which systems and location. This same function calls an event in the BP_ParticleService with those variables as input. That event is the Server_SpawnParticleSystem (On Server). This is hard to explain, does that make sense tho? @grizzled stirrup

grizzled stirrup
#

Ok if you are initing data on the server then yes it'll need to replicate down to clients either as an OnRep variable (a custom struct if initing pickup data) or as a multicast RPC for one off FX

#

I personally have a system where I have a DataAsset per pickup type that gets replicated down as part of a struct with a few other properties like Cost and such that gets calculated at runtime

#

So you can then activate the FX on the client when that struct OnRep function calls

lone steeple
#

I have that replicated variable, but not sure what to do with it

#

OnRep it just does this again

#

This system is almost the exact same from how the plugin set it up

lone steeple
grizzled stirrup
#

Honestly I'm not sure this does seem like a very complicated setup

#

In general the GameplayAbility stuff is just very convuluted in my opinion

#

I would just have a simple pickup that gets initialized by a simple struct, that structs replicates down via an OnRep variable

lone steeple
grizzled stirrup
#

It looks clean from what you've done but when that struct replicates you then set another struct

#

When does the FX actually trigger?

lone steeple
#

Here I guess

#

That server event near the end

grizzled stirrup
#

Right but it seems SetParticleSystem is only called on the server at begin play is that correct?

lone steeple
#

Gonna check real quick

grizzled stirrup
#

So the client would never call it when it receives RepParticleSystems as BeginPlay has already fired

lone steeple
#

Barely fits lol

grizzled stirrup
#

Ok so yeah the client will never call SetParticleSystem as far as I can see

#

Because stuff will replicate down after it has already been called most likely

lone steeple
grizzled stirrup
#

Simply call SetParticleSystem in the OnRep func

grizzled stirrup
#

Yes! Particles have replicated down on the client, the client knows what to play, play the FX!

lone steeple
#

I was trying some stuff out, gimme a sec

grizzled stirrup
#

Oh right because you aren't actually playing the FX in that function, you are calling a server RPC to call them

#

Basically it boils down to client recieves OnRep variable with particle info, plays the particles locally

#

Also you'd want to be calling that AFTER you set the struct and replicated var if that struct you are setting is used within the play FX function

lone steeple
#

Idk if this helps, I tried a few different arrangements non worked lol

#

This part with the whole RPC stuff, I just can't wrap my head around it, it seems 😄

#

Do I need to add a repnotify variable here maybe?

grizzled stirrup
#

In theory what is happening here is the client is telling the server to then go back and tell the client to spawn a particle system at a specific location

#

Unless something else is calling the server RPC?

#

Client RPCs are only called on the owning client

#

So if you want ALL players to see it or if the client doesn't own this actor, then use a multicast RPC

lone steeple
grizzled stirrup
#

Ok so the pickup itself doesn't need to call a server RPC if it's happening at begin play

#

Begin play fires on both client and server so you can use the Switch has authority node to filter between server and client

#

That cancels out the need for the server RPC

#

however if the client does not own this actor, the client RPC will do nothing

lone steeple
grizzled stirrup
#

However... it looks like it's actually a multicast RPC as it says replicated to ALL

#

So you named it Client but it is a multicast

lone steeple
#

Would be so nice if I could jump over this hurdle today which would finish this system implementation for now. Spent 15 hours on the whole thing today and want to finish it lol

grizzled stirrup
lone steeple
#

Just this last bit is halting progress

#

Hmm, basically the issue right now is that I'm not able to see anything if the client doesn't own the pickup item.

#

Which usually works if you multicast right?

quartz iris
#

How should I be storing whether a weapon skin is unlocked/locked

pallid mesa
#

your server should be concious of the progress of all of your players

#

so can do through a DB, or through a save

elfin sail
#

keyboard input is not working on client

#

any idea

#

player movement is working fine offline but when it connects to server there is input at all

frosty remnant
#

Should I read this as "runs on client ONLY" or as "runs on both server and owning client"?

obtuse field
dark edge
magic yoke
#

@dark edge
Dr. Evil — Today at 1:11 PM
Riddle me this batman:

I make 7 calls on my server to RPC on my client. I confirm that the call is going out to 7 different actor components. All actor components have the same owner and are the same class, created in a batch earlier. The call is made inside an actor (player state) that is owned by the client. Only the first actor component runs the code, the rest do not. No message log errors indicating that the code hit an error

Am I missing something about how this should work?

magic yoke
#

rgr. one moment

magic yoke
#

the print leading to the call is printed 9 times

#

but the client only runs to code directed at it for the first instance

#

(each call is made on a separate object)

dark edge
#

What happens if you make it reliable?

#

This sounds like a weird approach to whatever you're doing. Why can't you just do one RPC?

#

This sounds like it should be a RepNotify, how big are the chunk struct arrays?

shell forum
#

Will EventActorBeginOverlap fire on all clients no matter how far away they are? Or should you use a multicast for it?

obtuse field
dark edge
shell forum
#

Would it be a simple mutlicast -> destroy component

#

or a rep notify with a variable to disable it?

dark edge
shell forum
#

Hold on, let me set the actor to replicate.

#

Ok, so destroying components works but changing materials doesn't, even with replicates component. Is this how it's intended to work?

dark edge
graceful flame
#

Use repnotify for that

shell forum
dark edge
#

What's the actual mechanic you're trying to do? This sounds like it could just be driven by a repnotify on a bool...

shell forum
#

fire and forget is fine, no need to turn it back on

#

as well as changing the lamp's material to off and playing a sound.

dark edge
#

Just make a variable bIsActivated, repnotify on it, and do all 3 of those things at once when it changes.

#

don't even need to replicated the components then.

shell forum
#

The logic is working btw.

graceful flame
#

If you want to optimize it further you can replace the cast to Smiler_BP with a check for a tag instead. Actor Has Tag “YourTagHere”, true / false. @shell forum

shell forum
#

Are tags really faster than cast to?

graceful flame
#

Casting keeps the objects in memory

#

So it’s not like a faster vs slower thing it’s like how much complexity your game can have at any point in time

shell forum
#

Got it, will do.

shell forum
graceful flame
#

The thing you successfully casted to AND all of the things it references too.

shell forum
#

I might add some functionality like playing an animation with the pawn that walked there so will leave it for now.

graceful flame
#

So for instance in my game I have a few different parent character classes with even more child classes underneath them. Instead of casting them which would be expensive for memory I use tags.

#

The downside to using tags is that they are prone to human errors with typos and can be frustrating when debugging. You have to make sure that you spell the tag exactly the same when checking for it. They’re also case sensitive I believe.

shell forum
# fathom aspen Correct

My game currently doesn’t have players joining in late for any functionality. Would using a multi cast still apply changes to actors out of the range of clients?

fathom aspen
#

Nope. Multicasts don't count for out of range clients as well as for late joiners. They should only be used for non-stateful events, aka transient events.

#

See first pinned message. The blog explains it very well.

dark edge
#

@shell forumYou should prefer RepNotify when it makes sense, it's really elegant and robust.

#

Depends on if it's a state or not

#

if it's stateful, the variable isn't useless

fathom aspen
#

Use a bitmask then

dark edge
#

I mean how many states does your thing really have?

fathom aspen
#

That does not justify not using them. Their use is just inevitable.

winged badger
#

if this is in blueprint, you don't really have a replication callback there, its a property changed callback masquerading as one

#

so if a client sets a value on RepNotify variable, OnRep will trigger

#

blueprint OnReps will trigger on any value change

#

no matter if it was made through replication, or if the client set the value locally

fathom aspen
#

Also as Adriel told you, try to replicate the thing that drives the action, not the action itself

#

That can save you bandwith

#

There's nothing special about RepNotifys really. You set the value on server and you get notified of the new value on both server and clients(in cpp it's only on clients)

devout edge
#

Sorry if this doesn't make sense bur doez anybody have any advice about learning how to optimize data transmission for better multiplayer performance? Complete beginner. I know data types have different sizes but confused how this works in practice. Does this apply only to the parameter data types passed in to functions, or also how these are used in the receiving end?

fierce oriole
#

Omg someone please help! Im trying to Spawn Sound Attached on an Actor in the Level, but no matter what it will not spawn. I've tried events as Server, Multi, Owning and no Replication. Is there something I'm missing for in level actors?

elfin sail
plucky prawn
thin stratus
#

Sequences are replicated, yes

#

Even quite okayish

shy nymph
#

Hey guys, what would be the proper way for the server to move a client? I have a vault system where the server sets actor location in a lerp towards the target location but the client receiving the location updates is very stuttery

fierce oriole
fierce oriole
lone steeple
# shy nymph Hey guys, what would be the proper way for the server to move a client? I have a...

Sounds like it might be good to have a local character that requests from the server if it is allowed to do the action, then the server runs it and also triggers the action on the local character. So, two things are basically happening.

  1. The server checks if the client is allowed to do the action, then does the action on server and tells the local character if it can do that action.

  2. The local character requests to do the action and on request granted it performs the action locally with smooth client side movement.

I'm a noob at multiplayer so I could be way off, please feel free to correct me if any of this is wrong! 😄

winged badger
#

gameplay task component with root motion animation

shy nymph
# lone steeple Sounds like it might be good to have a local character that requests from the se...

that is basically what it is right now just the act of "allowing" it i am not sure of, because moving the actor (player) locally the character movement component always works against it

which is why i am lerping the character location on the server to let the server have authority over the players location

i guess all i need to do is to start the same lerp on the client instead of waiting for the server updates to get smooth movement - I was just wondering if that was the correct way of handeling it or if there is like a "CharacterMoveTo" function that then takes care of the client side movement natively with the character movement component before I implement it myself

shy nymph
winged badger
#

distance and height would be code driven

#

root motion often is, it can take a float curve for height during the animation, for example

#

we use that method for jetpack jumps

shy nymph
winged badger
#

i did not write it, so i can't tell you much off the top of my head

#

but it handles predicted movement well

#

no jitter involved

shy nymph
#

it's always one thing to have it solved generally but multiplayer always makes it harder and rarly a tutorial covers that part ^^

winged badger
#

for documentation on this, i'd dig into GAS

#

you don't need to use GAS to use GameplayTasks, but GAS does use them extensively

shy nymph
#

thanks - I'll dig into this to start out with then 🙂
https://www.youtube.com/watch?v=YvXvWa6vbAA

This week on Inside Unreal, Technical Writer Michael Prinke will guide us through a tour of the Gameplay Ability System! We'll set up Graystone from Paragon with a couple of gameplay abilities in the Third-Person template.

ANNOUNCEMENT POST (contains project files and resources)
https://forums.unrealengine.com/unreal-engine/events/1850699

TRAN...

▶ Play video
livid arrow
#

anyone have a method to using "Launch Character" in multiplayer? ive seen online in old forums that it doesnt work and it seems to still not work with multiplayer is ue5

#

any tips?

vivid prawn
#

is there anyway that I can track how much data server is getting/sending or in another word how expensive is networking in every session?

winged badger
#

there is a net profiler that comes with unreal

magic yoke
#

I don't mind re-working it to be rep notify at all, I'm just curious what's happening because for sure there's seems to be a "rule" happening here

#

chunks are right now 100 structs with a vector and a string in them

#

you are right that checking it as reliable causes it to work properly

chrome bay
#

Until somebody joins late

#

Persistent state should always be driven by replicated properties

magic yoke
#

so that's not super important

#

I'm horribly abusing the unreal engine to make a tile based game

#

replicating the actors isn't viable with the numbers involved, so the server provides a struct that tells the client what it needs to display on each tile

#

in the past I did it via repnotify for the 100 struct array

#

but I was trying to see if I could refine that so I'm not updating 100tiles every time a single tile changes

#

honestly, probably over-optimizing

#

and it's definitely something I can do post-prototyping if it's an issue

#

but!

#

I learned something about RPCs and reliability :)

chrome bay
#

You wouldn't replicate 100 tiles everytime it changes anyway, arrays and structs only replicate their changes, not the full array

#

The problem with RPC's is if the client doesn't have that actor when you send them, you'll never see the changes

neon atlas
#

Looking at the GameSession code, it seems that BanPlayer, simply kicks the player?
Any googling tells me that it still doesn't actually ban a player, I thought I would ask here, just to confirm?

And if it's the case, does anyone have a proper way to ban a player?
Or would the solution simply be, to use PostLogin or something, to identify the player, and if they exist in the ban list, to kick them again?

magic yoke
# chrome bay You wouldn't replicate 100 tiles everytime it changes anyway, arrays and structs...

ok, that's pretty reassuring, however is there any way to know what the changes are? If I have 100 structs in an array and a single struct is changed, is there a way I can know which struct was that changed? I'm not sure how rough running the setup code for 100 tiles would be if I did it every time a change was made, without having fully planned out that far I'm not sure if small frequent changes to the array would cause issues client side in that sense.

I can plan to do batches instead of smaller updates where possible, but it'd be nice to know how much flexibility I do/don't have

magic yoke
# chrome bay The problem with RPC's is if the client doesn't have that actor when you send th...

That's not an issue for what I'm doing here at least, these are actors that are created on startup immediately. Without them you'd see a blank skybox. The client tells the server when it needs to update the display based on where it is in the world. The issue is the scale of possibly displayed things goes well past the point where actors start to butcher performance, my tests are on 10,000 tiles so far. So the persistent state is the structs that tell the visual tiles what to represent. In a sense I'm re-coding relevancy to a degree because of the actor performance issues.

So long as I wait for the player to properly log in, those actors have to exist or everything is already fuxxed lol. Definitely keeping that in mind going forward though.

chrome bay
magic yoke
#

but now I know there's a C++ backup I can go to if I really need the performance

#

anyway, awesome help @chrome bay, super appreciate it!

sage isle
#

So how do you go about saving information for a dedicated server, like so the player logs out and back in they are still in the same place with the same stats and stuff and not just starting over again. I know there is the saved game object but for multiplayer I am not sure where to start saving that kind of info.

magic yoke
# sage isle So how do you go about saving information for a dedicated server, like so the pl...

you'd store the relevant information in an actor component (probably a game state child?) and add code so when a player logs in they have an ID that lets you know which stored component represents them. Super unsafe way to do that would be a String map that ties player name to their actor component.

Then you load their location/stats/etc from said component. If they don't have an object saved under their ID, make one and start them off from scratch

sage isle
#

Hadn't considered using their ID's to get it like that, I've got their ID's stored so thats not a bad way of going about it, thanks!

magic yoke
#

good luck :)

sage isle
#

One more thing, if I were to store it that way, would the info be saved if the server were to shut down for any reason? Like is game state persistent even if it goes offline?

quasi tide
#

I don't see why you wouldn't use the save game object. Just need to have some unique identifier.

Login - server checks if that save game exists, if it does, loads it and sends that information to the player.
Logout - server creates the save game with the relevant information.

half umbra
#

How can i set for attached weapon "Only Owner See", on client it works, but when server pick up weapon then client see this weapon

magic yoke
half umbra
half umbra
#

I want only owner see

chrome bay
#

You make them the owner

#

It's based on Owner, not what it's attached to

half umbra
fluid horizon
#

If I were to assign a UUID to every new player, and that UUID will save to lets say your steam account, how would I go about that?

fluid horizon
#

U can do that?

#

Oh lol

#

That makes it 205x easier

fluid horizon
#

Idk if ima get a steam app cuz its $100 and like breh

winged badger
#

game using steam uses the steam ID as unique net ID

#

in the playerstate, by default

fluid horizon
#

Yeah but what would I do if I wasn’t usibg steam

winged badger
#

other services have other ways ot determining what unique net ID is

fluid horizon
#

Wb a custom one

#

Like blueprint sessions

winged badger
#

and if you don't have at least 20-30 people in studio, you do not want to even consider crossplay

fluid horizon
#

True

#

Do u know any other service there are other than steam

#

One that doesn’t cost $100 lol

winged badger
#

eos might not cost you

fluid horizon
#

I’ll check it out, thanks

dark edge
winged badger
#

the console folks are really fidgety about keeping their standards

#

and when you patch anything it has to pass their QA for every console

#

and you have to time all patches for all platforms together

#

its a real pain in the arse

dark edge
#

Would PC first with EOS be a good foundation? I realize console is a stretch but I'd like to keep the possibility open in the future.

winged badger
#

epic store requires crossplay on PC to work iirc

#

but not consoles

#

which is a far shorter order

dark edge
#

If we do console at all I'd want crossplay as default, I'm a big fan of crossplay and would rather not release on consoles than have a fractured population. This is all spitballing, it's one of them good problems to have.

winged badger
#

our console release will (hopefully) be 18 months after the steam release

pulsar river
#

how do i ensure that a replicated variable is replicated down to a new client, before the new client's actor calls its begin play?
example)
client1/server change a ball from red->blue
client2 joins the new server and on the balls begin play updates itself using a replicated variable "color"
client2's ball doesn't change color

winged badger
#

it always does

#

when client receives instructions to spawn a replicated actor

#

it first spawns the actor, then sets the replicated variables that are sent in the game package, then calls OnReps, then PostNetInit, then BeginPlay

pulsar river
#

i see okay maybe im doing something wrong then ty @winged badger

winged badger
#

i am not entirely sure that applies for replicated variables in ActorComponents, or in Bleuprints

#

as Blueprints don't have a replication callback

pulsar river
#

C++ does?

winged badger
#

it does, in Blueprint they masquerade the PropertyChangedEvent as RepNotify

#

you can easily test it by setting a value of replicated variable locally on client and then watching its OnRep fire

dark edge
winged badger
#

it uses IPropertyChangedTracker i think

#

and it is a 100% BP hackery

dark edge
#

aww we don't have an automagic property changed listener in C++?

devout berry
#

Isn't event handle starting new player also supposed to be called after a seamless server travel?

#

I kind of only get the event fire for 1 out of 2 travelers (I believe its the server )

winged badger
#

it is, and it does

devout berry
#

Hm

glad escarp
#

Hey all. Quick noob question. If I have a lobby-specific player controller, when I do server travel and load a new level, if that level has a different default player controller, will it switch over or will this cause issues?

azure hull
#

Is it expected that movement should be always reliable or not?

dark edge
#

movement input shouldn't be reliable, you're sending it constantly

azure hull
#

Basic movement, movement like dodge etc.. But alright got it, though so, still learning.

fluid horizon
#

I need some help, clients are jittering so much but it is replicated correctly, bcuz its the default character replication

dark edge
fluid horizon
#

Its a true first person camera

#

It’s probably something to do with that

graceful flame
#

Are you doing any sort of wall running or dodge or dash?

#

If so you'll probably need to extend the character movement component to use compressed flags over the network.

#

@fluid horizon

graceful flame
#

Are you simulating some network lag and or packet loss?

dark edge
#

@fluid horizonWhat about sprinting? Are you doing anything movement-wise that's not just a change in the default numbers on the CMC?

chrome quest
toxic lion
#

you don't need to do that in cpp. you can easily just do it in BP
Set sprint speed on the client, and on the server

chrome quest
graceful flame
#

Always test multiplayer with at least some simulated lag and packet loss. Otherwise you're just lying to yourself.

toxic lion
#

That doesn't really make sense to me. The movement speed is set on one frame, not continuously.

hollow eagle
#

Nope, it's set on one frame on the client and a completely different frame on the server.

#

Which results in at least some amount of time where the client thinks it should be moving faster than the server allows.

#

The solution to that is to either:

  • not set speed predictively (ie wait for server response), but this results in input lag
  • use saved moves (or a similar system) to reconcile client prediction with the server.
graceful flame
#

Additionally, running your game with simulated lag and packet loss will expose these kinds of issues if you opt for a blueprint only approach.

toxic lion
#

but that would still resolve itself in a matter of a few ms in most cases wouldn't it?

#

they're saying that the client is jittery is likely an ongoing problem because they haven't set the max walk speed on the client & on the server

graceful flame
#

I have mine set to 72min and 150max with 1% packet loss for both incoming and outgoing traffic. You can configure this via Editor Preferences ---> (search for network) then look for the Multiplayer Options and Enable Network Emulation.

toxic lion
#

thanks for the input here. I'm going to have to test this out myself

graceful flame
#

If you have jitter without simulated lag, its gonna be much worse with a little bit of simulated lag

#

You can also use p.NetShowCorrections 1 in the console to have it draw whenever there's a network correction. Ideally when simulating lag you want there to be nothing drawn, but a little bit here and there isn't so bad. If you see lots of blue capsules something is wrong.

fluid horizon
unkempt tiger
#

Any way to prevent the stand alone server console from closing immediately after spurting out very useful red errors that I want to read?

regal geyser
#

I'm using simple On Component Begin Overlap and it triggers on all clients while I can't see option to turn it to run on server only so the client don't have to bother with this event, how can I do so? (Each client have capsule overlap collider in its Blueprint)

fathom aspen
shell forum
fluid horizon
#

The camera follows the character animation

#

I chose head as the parent socket, and it only jitters when im walking backwards

fathom aspen
regal geyser
fathom aspen
#

You would need to modify the source code to do such a thing. And if you do it, it might break some engine functionality down the line

#

It's a micro optimization really

plucky prawn
#

does RPC work with return values? like if i have a Server RPC that returns some type and call it on the client, will the client get the proper return value? or will it just be the default of the return type?

latent heart
#

Rpcs can't have return values.

#

If you wanna return a value you need to call a second rpc to send the response back.

plucky prawn
#

oh thanks i didnt know this

pallid mesa
#

it's an if, so no rpc's implied

winged badger
#

it just reads the Role from the Actor

#

note that client has Authority over Actors it spawned itself

#

so do not confuse HasAuthority for IsServer

#

its not the same

winged badger
#

not really a #multiplayer issue, and definitely not the best channel to ask

#

probably, but i have no idea how

#

i mean you can get code to compile for server only with #if UE_SERVER

#

no

#

but i would use the preprocessor diurective in c++

#

to instantiate a blueprint with server only code only on server

#

and i wouldn't even package it on clients

#

so you get the same effect

#

not sure if UE_SERVER is correct, but its something to that effect

#

your intellisense will probably figure that out

#

you can also use GameMode, as clients won't really have that one

#

but you would need to package the server only blueprint code that way

azure hull
#

Could anyone tell me, why if I use PlayMontage, I need to pass it through RunOnServer and Multicast, but if reguar animation is used through StateMachine, only RunOnServer is needed (Multicast is not required)?
Is there something under that I'm missing or some kind of integration by building project out of Template?

regal geyser
#

I'm so confused, each player has a cylinder overlap collision around him and when other player enters it, this player will be added to the array. But why on client its adding itself to this array?

#

Also when I use branch so that Other actor is not equal to self reference it won't add anybody to this array, what I can't understand

winged badger
#

its a component collision, Actors don't have a form or location if not from their components

#

if your collider can trigger an overlap with another component on the same Actor, it will

twin juniper
#

hello guys

#

can i use EOS to host my game?

#

it have any dedicated servers

#

?

twilit radish
#

Probably would fit better in #epic-online-services , but the answer is no. EOS does not host dedicated servers for you, that would be an insane large cost for them. Unless you're referring to perhaps matchmaking / server discoverability. Then maybe? I see some resources about EOS + Dedicated Servers but can't quite figure it out quickly.

lament garnet
#

is it normal that if i add even something like 30 to pkg lag command my attack traces just dont work or they work very poorly?

#

should i execute the traces on clients? how can i trust client traces tho?

winged badger
#

if you don't, any FPS game will feel not responsive enough

#

you do sanity checks on server when you get the client's trace result

twilit radish
#

The problem in this case is that the client sees a different view of the world than the server or yet another client does because of latency. What happens is that while a character on your screen seems like it's in a certain position it may have already moved on the server and hasn't been changed on that client yet. So if you shoot at a target on your client and the server does the same thing whenever the 'shoot packet' arrives the server may say that the shot missed because the target mean while moved.

#

how can i trust client traces tho?
If this is a Player vs. Player game then the answer is you can't. The client could obviously could just say "I hit this person!" while maybe being miles away. A solution to that is for example rewinding characters/physic objects etc. to compensate for the latency, but I must say I've heard people having a lot of issues with this because of the way Unreal's physics engine works. Although I'm pretty curious how that is now in UE5 because of the "async physics tick" system. But regardless it's still quite the setup.

What I believe Zlo said is the more common way. To do sanity checks, e.g. "is the character behind a wall when it was shot?" or "was the shooter facing roughly the direction of the target?" etc. but this obviously still has the issue that not all shots will be valid when they should have been. It's however a lot simpler.

#

A point someone else has brought up before which I couldn't agree more with is, first try to make your game actually feel good and if you can prevent cheats that's cool. But if no one plays your game and you spend all this time trying to make it cheat proof then there was no point in doing it in the first place.

#

If your game does grow big you can always hire people to fix these kind of issues or at least reduce them 😛

lament garnet
#

i totally understand the issue and i appreciate the detail explanation to begin with

#

this is a melee project so i guess making the "sanity checks" would be much easier

#

i also agree on the last part, people are going to cheat anyway and its not like i have a studio behind me to deal with it

twilit radish
#

For what my opinion from a random person on the internet is worth, I would not spend all the effort on trying to make it fully cheat proof and rather instead just do some sanity checks yeah 🙂

lament garnet
#

ill move everything client side then

#

ty

twilit radish
#

👍

kind sequoia
#

Hey guys, I recently got into unreal engine and I'm trying host a multiplayer game in aws. I haven't done this before, so I'm kinda skeptical.
Anyone tried dedicated servers before?

silent valley
#

And if you don't want to have to connect via IP address, you're going to need to setup an #online-subsystems too (e.g. Steam or EOS)

unkempt tiger
marble gazelle
fathom aspen
unkempt tiger
#

I can't seem to find the Standalone Server's log, argh

marble gazelle
#

should be in the same folder as the editor logs

unkempt tiger
#

Scratch that, found it, that works!

marble gazelle
#

^^

unkempt tiger
#

Thanks for the help! 😍

devout berry
#

Hi all,

Not sure what I changed recently, but all of a sudden, when I PIE, the client does not spawn the pawn anymore that is set in the game mode. The server does of course and when I run two standalone experiences, they both work as well.

How can this be?

#

And I don't have any custom spawn logic. I literally mean the case of pressing play in a level where there is a game mode override with a pawn set

undone galleon
#

Hi Everyone, I am fairly new to Unreal and I created a modular character creator for a multi player game I am putting together. I have the character creator finished but I want set it up to save your character to a character section screen and when selected you can load him into the game. Is there any tutorials or documentation to do this?

azure hull
#

Hi, TopDown situation here. When I press movement for either Server or Client, I can see movement on both sides. The issue is when ever (after the Release tirgger) the Client character is supposed to stop at the end (finish movement to location), it does stop, but right at the end when it goes to the location, it jumps back for milisecond and then jumps back to the initial location. I think it's something related with Server forcing to move character to it's position but right at the end client finishes the movement? I did move MoveToHitLocation node after SR node, but the result is the same in both cases either if that node is executed before or after. I'm not sure what causes this.

dark edge
#

Once you have the struct definition of the character, it's trivial to also pass it over to the server so it has it and can build your character for you.

undone galleon
#

@dark edgeTrying to make multi player like a conan exiles dedicated server

dark edge
undone galleon
#

@dark edgeYou got a link to a good one?

dark edge
# undone galleon <@127902729677963264>You got a link to a good one?

With my name, you really think I'm gonna recommend any tutorial videos? Just read up on how save games work. It's just a wrapper for some structs that you can save to disk. You need to be able to condense all the info about a player (their inventory, their custom character data, whatever else) to some structs and just save/load them with the savegame system.

undone galleon
#

@dark edge👍

still rampart
#

I love HTF HTF/WTF IS explanations. Excellent content. Adriels suggestion to stop watching tutorials and actually understand the core concepts is something that should be repeated more often 🙂 I suggest following their advice

pallid mesa
#

☝️

devout berry
#

Is there a cvar or something to display current lag to the server I am connected to?

dark edge
devout berry
#

Thanks!

#

hm I think that is only working for server browser and such when iteration through found sessions

dark edge
#

Maybe it's on controller, it's somewhere

devout berry
#

'stat net' was the cvar I needed

fallow shadow
#

ok so im making an FPS as you might or might not know

#

so when you shoot that gets executed on the gameserver as well as on your client, and then the server looks for hits from the line trace, if it finds any it does everything tied to the "On Hit" event and then multicasts the "hit" back

#

is this the "right" way to do things?

quartz iris
#

Hi folks

thin stratus
#

It sits on the PlayerState class.

thin stratus
# fallow shadow is this the "right" way to do things?

Yes and no. There are so many ways of doing this, that you could get away with it.
If the Shot happens on the Client too however, you might want to think about simply simulating it locally.
So basically strip all the authority based stuff from the code, like dealing damage, and keep the visuals like hit effects, so the client doesn't feel the lag of sending data back and forth.

fallow shadow
#

oh yeah quick correction the visuals are on the client but the line trace and hit detection itself is on the server

#

shouldnt be an issue because many games have some sort of small delay when firing but ill fix it later on if its an issue

quartz iris
#

I'm still trying to get a flashbang to effect both players but right now it only effects server and the clients don't even see the flashbang let alone the effect of the flash

#

I'm able to quickly stream whats happening with my code if that helps

winged badger
#
bool AActor::IsWithinNetRelevancyDistance(const FVector& SrcLocation) const
{
    return FVector::DistSquared(SrcLocation, GetActorLocation()) < NetCullDistanceSquared;
}```
#

so, yes

glad escarp
#

Assuming the path is correct for my GameMode, anyone know why this wouldn't work?

GetWorld()->ServerTravel(SelectedMapURL + "?listen?game=/Game/_BALLS/BPs/Game/GameModes/BP_Labtastrophe_GameMode_GAMEPLAY");

vocal cargo
#

Is it possible to run a Client function on a Client that's also the Server? (Host-Client). I thought setting the function as "RunOnOwningClient" would fix this, but that doesn't seem to be the case

vocal cargo
#

But that would never run on my Client that's also the server, right?

#

I thought the Client that's also the Host would run two instances of the game, one as the Server and another as the Client, but that doesn't seem to be the case (?)

kindred widget
#

A Client function will be ran on the machine that is supposed to "own" the actor. If the server owns the actor and it's called on server, it will run on the server with no networking.

#

The server is the server. The server 'CAN' have a player as well. This is called Listenserver. Where one player is both a player and a game host. The other is called Dedicated Server. Where the server is a whole separate application. It can be ran on the same or a different machine than a player. The only difference is that the server itself becomes a whole different application.

bitter oriole
#

So by definition not server

#

Listen server is a server

kindred widget
#

In this regard though, Client function is not aptly named to describe the issue. As, sure, a "Client" is a remote machine. But the client rpc will still call the function locally on the server, on the correct actor when it's called from "server" code, and the code will still technically run on the server, but on that player's version of the actor.

#

So it's really just easier to consider the client RPC as something that contacts an actor owned by a player instead.

glad escarp
#

Anyone have any idea why my arguments above in server travel won't work? I'm trying to load a new game mode when we travel from the lobby to the game.

#

%GetWorld()->ServerTravel(SelectedMapURL + "?listen?game=/Game/_BALLS/BPs/Game/GameModes/BP_Labtastrophe_GameMode_GAMEPLAY");

quartz iris
thin stratus
#

And maybe try to use the short codes for GameModes that you can set up in the maps and modes settings

#

You can give GameModes a unique key there

#

And then use ?game=Key

glad escarp
# thin stratus Hm you don't need the listen option

I think I figured it out. I reformatted it like this:

GetWorld()->ServerTravel(SelectedMapURL + "?listen" + "?game = / Game / _BALLS / BPs / Game / GameModes / BP_Labtastrophe_GameMode_GAMEPLAY.BP_Labtastrophe_GameMode_GAMEPLAY");

thin stratus
#

Again try to use the shortcodes

#

Removes the need of knowing the full path

glad escarp
#

I will do that. Taking a look now.

thin stratus
#

GameMode aliases or so

#

Can't remember that name

#

It's an array or map in the maps and modes project settings

glad escarp
#

Game Mode Class Aliases?

thin stratus
#

Yeah

glad escarp
#

So if I add an alias of "GameplayGM" my new format would be:

GetWorld()->ServerTravel(SelectedMapURL + "?listen" + "?game = GameplayGM");

?

thin stratus
#

Yes

glad escarp
#

cool. Tahnks. I'll give it a whirl

thin stratus
#

Just the listen is still redundant afaik

glad escarp
#

?listen inherent to severtravel?

thin stratus
#

I think it's only needed for the first hosting call

glad escarp
#

Ah. So when I create the lobby session, that's the only time I need ?listen

#

That argument will be persistent? I did set my sessions settings to allow JoinInProgress so I guess that'll work.

glad escarp
glossy crown
#

Hey does anyone know what the best way to store replicated data is?

chrome bay
#

In what sense?

dark edge
#

I mean, what's the question here?

glossy crown
#

I've had issues with structure arrays, they don't replicate well so I was wondering if a data table is better

dark edge
#

What specific mechanic are you trying to do?

glossy crown
#

I wanna replicate people's customized clothing

dark edge
#

Show your current data setup

glossy crown
#

the other part of it is on a widget

#

I didn't make it to replicate though

dark edge
#

Lose the Get Player Character too, just have some data on the pawn or their gear (depending on if gear is actors attached to actors or not) and repnotify on it

#

OnRep_PlayerGearData -> Apply it.

dark edge
glossy crown
#

It's on the player state

dark edge
#

Player state can get to its own pawn, don't do Get Player Character 0.

#

Anyways, you want an onrep on some replicated data, whether that's an int, bool, enum, or struct

glossy crown
#

ok, thank you I'll see what I can do with this information

sinful tree
#

There is no reliable way to do this. If you are relying on any data coming from the client to tell the server something, the client can potentially spoof it.

#

Yes and no. No, because if someone figures out those random numbers (which can potentially be done via packet sniffing), they can intercept the packet with that version number, prevent it from going, and instead send the spoofed data.

#

Yes, if you expect no one to be malicious.

thorny saddle
#

Hello folks
if i have some actor with bNetLoadOnClient = false;
and this actor call some multicast function on another actor with bNetLoadOnClient = true;

#

second actor run that function on both side(Client and Server)?

grizzled stirrup
#

For my game, I load into an empty map and instantly open a level with ?listen and then create a session

thorny saddle
#
    UFUNCTION(NetMulticast, Reliable)
    void Debug(const FString& Text);
void APCSAICharacter::BeginPlay()
{
    Super::BeginPlay();
    if (HasAuthority())
        Debug(TEXT("test"));
}

void APCSAICharacter::Debug_Implementation(const FString& Text)
{
    // Debug
    UE_LOG(LogTemp, Warning, TEXT("%d"), HasAuthority())
    const FString Str = TextRender->Text.ToString() + "<br>" + Text;
    TextRender->SetText(FText::FromString(Str));
}
#

why this not work in client side ?

#

TextRender is work ok in server

#

but nothing in client

glad escarp
grizzled stirrup
#

Yeah it likely won't hurt!

lament garnet
thorny saddle
twilit radish
thorny saddle
#
    UFUNCTION(NetMulticast, Reliable)
    void Debug(const FString& Text);
lament garnet
#

yeah is the replicate checkbox ticked?

thorny saddle
#

yes

twilit radish
#

Not necessarily the checkbox rather the time it takes, an actor isn’t magically instantly created on a client the moment you spawn it on the server.

#

Considering that you call this in BeginPlay on probably the server I would imagine it didn’t get the chance to do anything yet.

thorny saddle
#

so what should i do ?

#

i replicate this TextRender

#

but no fix at all

#

im so confused

chrome bay
#

Should be a replicated property, not a multicast

#

It's a stateful change

#

State = Replicated Property

thorny saddle
#
    UPROPERTY(VisibleDefaultsOnly , Replicated, Category="Components")
    UTextRenderComponent* TextRender;
chrome bay
#

Not that

#

The string

#

Replicating the component reference does nothing

thorny saddle
chrome bay
#

You replicate a string property, and use it's RepNotify to update the text on the component

chrome bay
#

any persistent change should be made via a property or you risk clients going out of sync with no way to know about it or solve it

lament garnet
#

does the rep notify allow for the previous value as an argument?

chrome bay
#

In C++ yes

#

In Blueprint no

lament garnet
#

i see

chrome bay
#

But if you're making an MP game in Blueprint you're already missing all your limbs

lament garnet
#

we live in a weird moment..i wouldnt say that

#

moment/period, not sure

chrome bay
#

What I mean is, BP makes life more difficult and has fewer tools

lament garnet
#

yeah i understand

graceful flame
#

Isn't Fortnite something like 80% blueprint and 20% c++?

chrome bay
#

Fortnite is 80% GAS which is heavily subsidised by complex C++

graceful flame
#

Well its all c++ under the hood

#

The way I see it, blueprint is faster for development iterations and allows you to quickly play test and adjust as needed, but eventually you'll probably want to convert most if not all of your game over to c++ for better performance and other benefits.

kindred widget
#

Looking for a general refresher. Normal TArray supports delta serialization usually? As in if you have an array of structs like an FVector for instance and change Z, then X and Y are not also sent, just Z?

#

As far as I know FastArrays can't do this, If Z is changed, the entire struct is sent.

chrome bay
#

Both TArray and FastArray support deltas

#

FastArray has it enabled by default in 5.0

kindred widget
#

Oh, that is convenient. 😄 Is there anything I need to do past specifying the structs and using them by marking them dirty like normal?

chrome bay
#

Nope just the usual setup 🙂

#

It is optional in case it causes any issues, but it seems to be pretty safe now. I suspect the packets are a bit larger than with TArray though

fluid summit
#

Hi everybody! i'm trying to change where i put variables and i'm trying to use more "GameState" for certain things, like what Controllers are on the game at the moment.

Is it okey to say that all the variables (even custom ones) by default are replicated on game state?.

latent heart
#

When you say controllers...

#

You can't say all variables are replicated, you have to mark each one as replicated or not.

graceful flame
#

If a replicated boolean is set to true and some server event fires that attempts to set it to true, does anything get sent over the network?

#

I have a few different events that can all set the same boolean to true, but if the bool is already true nothing happens...right?

latent heart
#

Depends what that srever event is

#

If the boolean is already true, it will be set to true again on the server (So if you have a setter method, this will run again)

#

But only changes will be replicated.

graceful flame
#

Okay so the setter method is still processed by the server, but only changes are sent over the network?

#

So its kind of wasteful to do things like that right?

latent heart
#

Wasteful, sure?

fluid summit
latent heart
#

That is correct.... when you say controllers, what do you mean?

fathom aspen
#

I think he mean players? You got the PlayerArray

fluid summit
#

The list of current connect player controlers

latent heart
#

Player controllers aren't replicated

fluid summit
latent heart
#

So an array of player controllers on the gamestate will just have the local player's one and the rest would be null I guess?

#

Unless you're the server.

fathom aspen
fluid summit
#

Oh there's already an array for that?

#

i was making a new one

latent heart
#

Yes.

fathom aspen
#

No need

latent heart
#

PlayerArray for the player states.

graceful flame
#

its inherited

latent heart
#

Don't put things which you want replicated on player controllers, ptu them on player states

fluid summit
#

it's on the Game State, not on the PC.
From the GS i tell the PC to update the UI with a RPC on owning client

latent heart
#

Controllers should handle movement and stuff like that, not hold state information you want shared with other players.

fluid summit
#

yap, thanks for the data. i'm gonna change the custom array on gs for the default one

latent heart
#

However, just because the player has arrived on the server, doesn't mean the player state has been replicated to all the clients

#

A better way is YourPlayerStateClass->BeginPlay

#

And EndPlay

fluid summit
#

i was doing a little workaround to solve that issue, but it makes more sense to control it on the player state if i already have a replicated array of players

#

gonna try with that, seems more simple

#

to use "Get player controller (0)" From any Player State is okey or should i use "get owner" and cast to controller?

latent heart
#

If you're using it on the server from any player state, get owner is probalby the better idea.

#

There's a chance that a listen server will fail somehow.

fathom aspen
latent heart
#

Well, if it's for UI updates, then Get Player Controller(0) for UI stuff will cause you to do the wrong thing for a listen server.

#

But it won't matter on a dedicated srever, there is no UI

fathom aspen
#

I see, was not following up on the purpose. But anyways it's discouraged as hell

fluid summit
#

so it will fail with getcontroller for the purpose of update UI

#

better just call get owner, cast and do rpc owning client for ui

latent heart
#

You could run the RPC just directly on the player state.

#

You don't need to use the controller.

fluid summit
#

The RPC is for the controller

latent heart
#

..okay..!

fluid summit
#

the flow would be.
Ps BeginPlay (authority) -> RPC on Client to Owner

#

does that make sense or would you recommend other way?

latent heart
#

Why the authority check? It's not needed.

#

Whenever any PS is fully replicated (and begin play is called,) the client it was replicated for needs to call RefreshPlayerList.

#

Ther'es no need to go through an array.

#

Or use RPCs

#

Player joins -> Player state is created on server -> Server calls begin play -> refreshes local player list ui on srever (or not if it's dedicated) -> player state is replicated -> client calls begin play -> refreshes local player list ui on client

#

That client part will happen on each client

fathom aspen
#

Though this logic will collapse sooner or later, as the list isn't being updated real-time

latent heart
#

How will it collapse? It's always accurate per client

fathom aspen
#

I mean, say a client logs out, you still have him on the list

latent heart
#

No.

#

That's why you also use the EndPlay event.

fluid summit
latent heart
#

That's the idea.

fluid summit
#

you are right that i can remove the array, i can get that info on the PC

latent heart
#

Begin play will be called once on each instance (server/client)

#

That already happens, you don't need to use rpcs at all.

fluid summit
#

oh get it now

latent heart
#

This should be your BP

#

End Play*

#

In fact

fluid summit
#

since it's UI only, maybe just run on Remote of PS?

latent heart
#

Better

#

Then you will break your listen servers.

#

There is a function specifier that will make it not run on dedicated servers. I don't know if it's accessible via BP.

fathom aspen
#

BPCosmetic right?

latent heart
#

That's the one.

fluid summit
#

that makes sense, remote won't trigger on listen.

latent heart
#

Mark the UI update function as cosmetic and your logic is done.

fluid summit
#

I'm fully BluePrint at the moment

#

is that c++ or bp?

latent heart
#

Checks if it's in BP

fathom aspen
#

Seems like cpp only

fluid summit
#

Only info i could find, not sure if it's this one

fathom aspen
#

Has nothing to do, no

#

Goes and submits a PR

latent heart
#

Is all the documentation you need on specifiers.

fluid summit
# latent heart

Just in case, this won't work.
only the new one is updated. The one that work is.

latent heart
#

When I did Update UI - I assumed this update the entire UI, not just the UI for a particular player

#

But glad it works!

#

Consider this situation, though.

#

There are 3 players. a 4th joins. A 4th player now pops up on the UI. This player leaves. Now, there are 3 players in the player array. The 4th player's UI won't be touched.

#

That is IF the player state is removed from the players array before endplay is called.

#

It might not be.

fluid summit
#

that makes sense, but it doesn't matter in this case, if the player leaves, the changes on the UI should be handled by the Change of level

#

But i'll keep that in mind for later

#

Like a charm, thank you

#

also it's way more simple this way

latent heart
#

Np

daring gorge
#

how would i go on about creating a widget for another client? and that client only.

stiff topaz
#

Some One can help me please! I need to know how best practice about replicate animation in top down character with cursor?

#

I need tick for this or another way to success?

woeful ferry
#

How do I know if a actor is spawned by a client? Not requested by client, but spawned in client world

#

Since client has authority over that actor, HasAuthority wont work

undone python
#

Hi, Sorry, maybe a stupid question)
what is the basis for choosing a character revival technique? Usually a character is destroyed and then a new one is created and the Player Controller is put into it. But you can also fake kill a character and then just move it to a respawn point. I want to know why this or that way is worse or better? Thanks in advance

upd:
I think the main reason - the state. Maybe the character had some additional parameters that need to be reset, or he was registered in some systems (for example, AI enemies always know about the character) and so on. Sometimes it's easier (but not necessarily cheaper) to just kill a Persian and create a new one, with clean state and you can be sure he's pristine, properly registered in other systems, etc. If you do not want to destroy, to create - need to prescribe Reset logic everywhere. If it's just to put Idle animation and change the position nat the point of resurrection - go for it. But often you need to "clean" a lot more places.
But I could be wrong.

winged badger
#

Generally, its not better or worse either way

#

One tends to be a better fit for your specific game

chrome bay
woeful ferry
zinc light
#

hi all, anyone can tell me, on top of his head, why my client side character moves like he's on thin ice, and doesn't stop moving when i stop the input? it behaves like a stuck throttle rather than an on-off input on press. It was working perfectly right before i changed skeleton

azure hull
#

Does EnhancedInput have a support for Multiplayer? Because of the "Enhanced Input Local Player Subsystem" context, I'm wondering about that.

chrome bay
#

Input has nothing to do with multiplayer

#

So in a sense, yes

uncut schooner
#

Hi

#

How is everyone

#

I remember using a variable that had replicated rotation, Was there one or am I misremembering?

near bison
#

Has anyone used listen servers for a mobile game in production?

bitter oriole
#

That seems like a particularly horribly bad idea

bitter oriole
#

Because it takes one user passing under a bridge

#

To literally kick the entire game

uncut schooner
#

But minecraft?

#

...

bitter oriole
#

So in real-world conditions it wouldn't work at all

uncut schooner
#

Its not unreal but it has a listen server

near bison
#

"passing under a bridge"? Sorry didn't understand

uncut schooner
#

Amongst many other mobile games?

near bison
#

Isn't Among Us also doing listen servers?

uncut schooner
#

Yes

bitter oriole
uncut schooner
#

... /:

bitter oriole
#

Since mobile is normally not on Wifi 100% of the time

uncut schooner
#

True but probs not the problem

near bison
near bison
#

And unreal doesn't let me play multiple matches in one server process

bitter oriole
#

Other problems with this approach include unpredictable performance (like maybe 10x the CPU load), higher battery usage, and generally poor connectivity leading to a bad experience

#

Most mobile games aren't fast-paced action, too, so I figure a vast majority runs on Web servers without any of the client's game engine

#

Your average mobile game is extremely asynchronous with little real-time player interaction

near bison
#

True. Mine's a board game

#

Looks more and more like i have to switch to using websockets

bitter oriole
#

We've had this discussion before I think but yes I would certainly suggest something like that

near bison
#

Yeah I'm just ruling out all options

#

SocketIO client for unreal doesn't look promising. They don't have SSL support

bitter oriole
bitter oriole
near bison
uncut schooner
#

For local matches its not

#

For both games

bitter oriole
near bison
near bison
uncut schooner
#

Local, so lets say we all connected to the same network at a house and play together

near bison
bitter oriole
#

For Among Us I'm not sure it's an Unreal dedicated

#

So that could make the servers way cheaper

near bison
bitter oriole
#

Yeah I meant Unity - I mean I think they have their own server

near bison
#

Well since you have experience, how much RAM does an Unreal headless server usually eat up? Bare bones.. any benchmarks?

near bison
#

But i didn't think they'd be dedicated, because one of the devs did mention they use a relay

near bison
bitter oriole
near bison
#

Here i was, optimistic as I am, thinking i can bring it down to 10mb through some voodoo magicb 🤣🤣🤣🤣🤣

bitter oriole
#

An Unreal game executable alone is about 100MB so obviously that's a baseline

near bison
bitter oriole
#

I'd plan for say 4GB per instance with the expectation to be able to drop to 2GB per instance but it's sooooooo game dependent it's a pointless random guess

#

It literally 99% depends on your game

near bison
#

Baseline 100mb is insanely bad for a mobile game
My day job our unity headless server for a game with a lot of stuff going on (movement, animations, 100s of CCU) is like 60mb
30-35***mb when it's got 2-3 CCU

#

I may be exaggerating the 60mb, but the base unity + a few CCU is definitely in that range

#

Actually lemem check rn

bitter oriole
#

"Hundreds of users" is definitely not something you'll see for an Unreal server

#

Again, Unreal MP is meant for fast-paced action titles with server-authoritative gameplay

#

Say Unreal, Fortnite, etc.

near bison
#

ok our unity server with 0 players connected is 60mb. Tbf there's a lot going on though

#

60mb is still a lot

#

Now 100mb doesn't look that bad

#

But unity also allows me to run multiple games on 1 server process, so there's that

#

So it's more like 5-10 games distributed on 1 server. So it's actually 6-10mb per match going on. Which is extremely reasonable.
That's like...200 games on 1VM

#

800CCU for $30-40 a month

bitter oriole
#

Websocket, your own server.

near bison
near bison
bitter oriole
#

No, I don't know anyone working with Unreal on mobile. It's not exactly a great fit in the first place

near bison
bitter oriole
#

Frankly if you're making a game from scratch that's gonna be mobile exclusive it's hard to shake the idea that Unity might be a simpler choice

near bison
#

and also I now understand crsytal clear now why unreal is not suitable for indie devs...

#

even if we were to go through toil to do websockets + unreal client, I'm still scared because it sounds like Unreal clients are also super heavy

#

and websockets....we'll have to reinvent the wheel with how replication handles everything for us currently

#

constantly sending messages back and forth, an entirely new API. It would be easier to just rewrite in Unity imo

bitter oriole
#

I mean Unreal is incredibly good for indies, imho. That Unreal isn't good for networked mobile games is hardly an unpopular notion

near bison
bitter oriole
#

Multiplayer in Unreal is arguably a much better experience than Unity if you're doing something the engine is good at

near bison
charred pebble
#

Heyo folks - I'm setting up a game server currently and seeking to stack users in a single instance - what I believe I'm looking for is to create a repeater, but having trouble sourcing information around the topic, does anyone have any links on hand by chance?

twin juniper
#

I'm trying to learn networking, how do I actually talk to a client as a server?
I want to issue a command where I print his display name

lament garnet
twin juniper
#

I'm using blueprints for now for testing things out+

lament garnet
#

if you make a custom event on the top right you can set where the event should execute

#

it should be OwningClient or smth like that

twin juniper
#

Basically I have 3 pawns in the world and three clients (one as listen server, two as normal clients) and I'm trying on begin play to give a pawn to each client

#

Issue is the PlayerController is server-sided

lament garnet
#

you have to do that in the gamemode which only exist on the server too

#

by using the onpostloginevent (i think)

#

the event has as parameter the player controller for the character joining but it require some setup

#

i suggest watching tutorials if you are completely clueless

twin juniper
#

The server owns a player controller itself as well

lament garnet
#

yes

#

when another player join, a new player controller is created and assigned to the new player

twin juniper
#

Fine, but how do I actually distinguish between the server and the client?

#

Every command I issue on either the gamemode or the player controller is always fired by the server

#

So I can't really address that particular client it seems

lament garnet
#

through the player state that also exist on the client and is accessible throrugh the playrr controller

quasi tide
twin juniper
#

Rather than the clients

#

but if I set it to "run on owning client only" I get it correctly but it is still replicated?

near bison
quasi tide
#

And a lot are not building mobile games.

near bison
#

most of us are privileged who are building for PC markets and playing PC games, that's not the case in 90% of the world

twin juniper
#

It's a simple print string

#

Nevermind that I figured it out

quasi tide
#

I'm not doubting what you are saying in the slightest. But "a lot" isn't very useful of a metric. Because it can be true in both statements.

quasi tide
#

Know your target audience, choose the right tool for the job. Doesn't mean that a particular tool is not good for a particular demographic.

#

It's just not suited for that job.

twin juniper
lament garnet
near bison
twin juniper
#

Like, here's what I'm not getting: I have a player controller class with a custom event that just prints a string. If I set this event to "not replicated" then I see in the top right "Server: " printing that string three times (I have three clients, one listen server + 2 normal clients) - HOWEVER if I set the event to "replicate on owning client" I see Server: then Client1: and then Client2: strings

raw thunder
#

No the player controller exists on client as well! How would you send the input otherwise?

twin juniper
#

But those three strings are always synchronized between every client, I see them all in every client

#

I assume that "run only on owning client" meant that if the event is fired on the client it would not get replicated to the other clients

#

I can show you a quick video if that helps you

quasi tide
#

Run on owning client does the RPC to whoever owns the object.

twin juniper
#

Thanks for all the help

raw thunder
#

I suggest you to take a look at some pinned messages, you can look at eXi compendium to start :)

twin juniper
quasi tide
quasi tide
# lament garnet what?

Player controller exists on the server and the single owning client. That's what they are saying.

#

Client will have 1 player controller, server would have X amount.

raw thunder
lament garnet
#

oh okay i was just getting confused i gurss, im sorry

raw thunder
#

But other clients don't see other PC

#

Only their own, the server sees every one of them

lament garnet
#

i did with bad words

twin juniper
#

I still don't get how am I supposed to address the server's player state

#

monkey brain hurts

raw thunder
twin juniper
#

No, the opposite

dark edge
twin juniper
#

I'm having a stroke

raw thunder
#

You want from a client send a message to the server?

twin juniper
#

How do you get the client name on the pawn itself?

#

From the player controler

#

The pawn is being possessed by a player controller, how do I get the client name from that player controller?

raw thunder
#

I'm not sure what you mean by name, do you have a variable with the client name on your pawn?

magic yoke
#

I'm currently running the game in "Client mode". I have a feature that is, as far as I could see, solely client side because I have branches "is dedicated server? false do something"

However my code is coming back saying it's being run on a server, not on a dedicated server. Which makes no sense to me, I'm not using listening servers in the dropdown run mode

daring gorge
#

so i need the same kinda thing to do, basically whenever i kill someone i show a notification on the player who killed and the notification should contain the name of the victim, im getting the widget to spawn but the name is always of the server, can anyone tell how i can fix this?

#

im using an interface message that has the controller creating a widget on multicast

#

and if the owner controller matches the controller then it should spawn the widget

raw thunder
twin juniper
twin juniper
#

There was 3 different ones one for each client

magic yoke
#

thanks though

#

I was trying to make both dedicated/non-dedicated servers possible

daring gorge
raw thunder
#

(dedicated and not dedicated)

magic yoke
#

which is why I have is server and is dedicated server branches

scenic ruin
#

Even for a BP project, is it a wise idea to define mostly all variables in c++, just in-case they get used in code for whatever reason?

sinful tree
raw thunder
magic yoke
#

so those branches don't work

#

any idea where?

#

I checked the settings and don't see it

#

unless it's a launch option thing

magic yoke
raw thunder
daring gorge
raw thunder
magic yoke
#

5.0.2

sinful tree
#

You can't use player controllers to get player names as the player controllers are not replicated to all clients.

daring gorge
#

oh i see i see, in online subsytem do player states have the same name as the steam name?

twin juniper
sinful tree
#

If you know the pawn then you can get the playerstate from the pawn.

twin juniper
#

without calling the player controller

daring gorge
#

theres a get player state node

#

you can use that and cast to your player state

sinful tree
#

For an example, this "Player State" variable exists within all pawns, so I can use that to pull the player name.

uncut schooner
#

Hey guys

#

Is there any way to validate weapon spread

#

Or is that a pipe dream even If I made it deterministic?

daring gorge
#

wow the player state node really worked

magic yoke
uncut schooner
#

Yeah

dark edge
uncut schooner
#

I get that, but how do I validate a shots rotation, accurately, I guess I could check on the server by recording the control/ cam rotations, then when I fire locally, check the history to make sure its correct but wouldn't bad network cause invalidations where there is valid data>?

magic yoke
#

launching "client" seems to launch a listening server still

lament garnet
magic yoke
#

that's not happening

dark edge
magic yoke
#

yeah I'm using out of the box "client mode" on the editor

#

and it's not launching a dedicated server apparently

twin juniper
#

How do we launch a separate dedicated server?

sinful tree
#

If you have multiple copies of your project open, it can bug out the dedicated server networking setup - make sure you only have one open.

magic yoke
#

I only have one

raw thunder
#

In fact I just read the unreal documentation and on UE5 it should spawn a dedicated server in client mode

twin juniper
#

I can't breathe

quasi tide
#

Launch it in standalone mode. PIE can be funky.

magic yoke
#

and my settings say it should launch dedicated

#

which is why I'm confused

raw thunder
#

In previous versions you had the check the dedicated checkbox but now it does not seems to be the case

uncut schooner
#

So anything within like 50% of the screen could pass

raw thunder
uncut schooner
#

Yeah on the server it does a test to see if your angle between cam forward and client 'reported' forward is in 45 degrees

#

After some testing

quartz iris
#

Hello