#multiplayer

1 messages Β· Page 659 of 1

fading birch
#

that's up to you.

#

You get to decide what the clients get to know and what they should know.

#

Often that's stuff like, current ammo, max ammo, etc

#

stuff the client doesn't need to know is, last shot distance, trace parameters, rate of fire, etc

vague fractal
proud arch
#

Hi Guys!!! I hope you are getting a great day.

Maybe someone have had this issue with a dedicated server in Linux??

When the player chooses the server enter but is kick out immediately.

the Client is for Windows and Server for Linux (running in a gcp vm instance). both built with the same engile, I've deleted intermediate saved and derivateddatacache but the problem is persistent, with a windos server works fine the problem is linux build.

NOTE: the mismatch only happens with characters, we are using GAS for a lot of things

Update: I've cloning the project again in other pc, compile and build but the problem persist, do I don't know the cause of this problem 😦

Any suggestions?

[2021.08.18-04.28.56:227][576]LogNet: NetworkFailure: NetChecksumMismatch, Error: 'GetObjectFromNetGUID: Network checksum mismatch. FullNetGUIDPath: [19]/Game/Characters/Klowns/KlownKlasses/Brawler/BP_BrawlerKlown.[17]Default__BP_BrawlerKlown_C, 2259927734, 2943822821'
slim matrix
#

so my game play seems to be pretty bad when network lag emulation is set to bad is that to be expected or should i try to get it to work more in bad latancy

plucky prawn
#

hey so ive been following the epicc multiplayer tutorial and then the newer one from devaddict but ive been trying to migrate away from using the save file to persist session data (eg character class and picture). so far its working nicely but im having an issue with clients rendering the Lobby Widget. I've narrowed it down to my use of GameState.PlayerArray in a widget construct event. The array is empty, doesnt include myself (joining the session as the client) or the server host. Is there a function or event that exists in blueprint or C++ that is called when the client is fully networked? (eg playerstate and gamestate w/ players is fully replicated)? i'd like to avoid checking this in tick if possible

eternal canyon
#

just make sure its playable

#

but it doesnt have to be enjoyable

slim matrix
#

like its pretty hard to crouch slide like it will just stop most of the time

#

then it will uncrouch and recrouch repeatedly for a few times

#

also lots of times if you jump wile running you will just instantly hit the ground

eternal canyon
#

as I would recommend to not

slim matrix
#

this is what im using

#

i usally use avarage but do test at bad to see how playable things are

eternal canyon
#

as u cant really compensate for that from my understanding

slim matrix
#

but isn't there packet loss in realworld situations

#

and also these are epics default settings

#

for bad

glass vector
#

if I pass an actor reference from the server to the client, using a Call on Client RPC, does the client get the same actor reference?

#

like is the ID the same

#

(ie, i spawned an actor on the server side which is replicated, and I want to pass the actor ref to a client so that the client can set a variable in his pawn that points to the spawned actor)

meager wing
#

Sorry for the noob question, but are UniqueNetIDs steam specific? I've messed around with steam multiplayer a bit, but I'm attempting to make a non-steam multiplayer game

#

im trying to find an easy way to have user-entered usernames

twin juniper
#

Hey guys, would anyone know where FUniqueNetIdRepl is first defined before anything?
I thought that e.g. PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage) was where it was defined. However, even if we set up a different FUniqueNetIdRepl or just give a NULL value into e.g. Super::PreLogin(Options, Address, ConvertedId, ErrorMessage); the program still runs and I can see that FUniqueNetIdRepl is generated normally for all the clients.

short arrow
#

Can ya share some code

bitter swift
#

I've figured out how Rep Notify variables work in Blueprints. I use them to make sure a changed variable is set correctly for a player who joins later.

But how would I do this in C++?
I just need to check bool on an Actor upon entering the game.

winged badger
#
UPROPERTY(ReplicatedUsing = OnRep_MyBool, WhateverElseYouNeed) bool MyBool;
UFUNCTION() void OnRep_MyBool(const bool OldValue <Optional Argument, can have no argument>);```
#

with special note that blueprint OnRep is a hack

chrome bay
#

Just bear in mind.. Rep Notify works differently (aka, properly) in C++

winged badger
#

and as such it gets called on server as well

#

in c++ that doesn't happen

#

the MyBool also needs its DOREPLIFETIME entry in GetLifetimeReplicatedProps override

bitter swift
#

Thank you all. I'll test it out immediately.

empty axle
#

and then inside you do:


    DOREPLIFETIME(AYourClassName, YourVariable);```
hazy silo
#

hey there πŸ™‚
just wondering if any of you have been using Modular Game Features in Multiplayer, yet?
it seems to me that loading features (even via command line) in multiplayer results in weird and inconsistent behavior.

I'm looking for guidelines what to call locally and what on the client, or if it is even possible to load features only locally.

thin stratus
#

Is that UE5?

hazy silo
#

yes

thin stratus
#

Then please keep it to #ue5-general . UE5 is not ready for production. Until UE5 is released, we rather keep UE5 discussions to the early access channels if possible

hazy silo
#

got it, thanks

bitter swift
thin stratus
#

Happens automatically

#

It's a functions from the Actor class that you are overriding

chrome bay
#

Have to get this off my chest.

#

The logic of FindInactivePlayer is utterly stupid.

#

What was being smoked when this was written.

#

So when you log back in:

  1. The controller spawns a new player state.
  2. FindInactivePlayer retrieves the original Player State.
  3. Instead of overriding the new player state properties with the original ones, it actually assigns the original player state to the controller - then calls "OverrideWith" on that, passing in the now unassigned, pointlessly spawned new player state.
#

And the naming of functions and variables suggests the total opposite.

thin stratus
#

Totally confusing

chrome bay
#

What a utterly stupid implementation.

thin stratus
#

Yeah I also didn't understand it

chrome bay
#

This is the sort of crap they should have been fixing/trimming out in UE5. I bet it's the damn same.

thin stratus
#

I had to somehow handle assigning a team again

#

And it was so broken cause I read the function wrong

#

Cause I expected something totally else to happen

#

Theoretically, if you just give the player the Old, currently inactive PlayerState again, it would already work. But even if not, then overriding the freshly spawned one with the old one would still make sense.
But giving back the Old one and overriding it with the empty new one, that is just chaos

chrome bay
#

Yeah the way I understood it, is that the "New" player state is kept - and OverrideWith is called to give it a chance to copy properties from the old one. That makes far greater sense.

thin stratus
#

Yeah exactly

#

I don't understand, at all, what the other idea was

#

Like, what data would the new one have that I want to use?!

chrome bay
#

yeah

thin stratus
#

If I want to keep a newly assigned team, then I could just make sure i clear the old one when the player is cleared and just give it a new one when rejoining

#

But well

chrome bay
#

I'm convinced it wasn't always this way.. I just can't make sense of it.

thin stratus
#

Honestly

#

I think the majority of UE4 programmers that do Multiplayer never even used that function

#

So I believe it has been shit forever

#

And the ones who find it rant in their internal slack

#

And cry to their colleagues

chrome bay
#

Going to whinge on UDN like a madlad

#

I really wanted this sort of stuff cleared up for UE5... even if it makes porting a little harder.

#

Probably won't budge though. I'd submit a PR but why bother when it'll sit there for 3 years anyway.

#

/rant

#

The only reason I can see for this, is if you have other objects/actors which are referencing the old player state and this therefore makes restoring things easier - but what a farce.

bright kraken
#

If an Actor is marked as Replicated & uses RepNotify, the RepNotify will only be called when all replicated properties (inc complex types such as UObject) in the Actor are replicated? Or it doesn't care about the replicated properties are replicated yet? πŸ€”

chrome bay
#

Only when that individual property is replicated.

#

Not for any property

#

If you need a function called after all Rep-Notifies have been called, you can use PostRepNotifies()

bright kraken
#

Wait, to clarify, so if the Actor has a say integer marked as Replicated
the Actor's RepNotify is called the moment the Actor has been replicated, and doesn't care about the integer is replicated or not?

chrome bay
#

It's called on two occasions:

#
  1. When a change to that property is received.
  2. When a new actor is received and the value differs from the "serialized" value.
#

You can however optionally force it to be called whenever the property is received, even if it matches the current client value, by doing the following:
DOREPLIFETIME_CONDITION_NOTIFY(AMyActor, SomeProperty, COND_None, REPNOTIFY_Always);

#

When an individual RepNotify is called there is no guarantee that all other property updates have been applied yet, as they are called inline when the property value is set.

bright kraken
#

Is there a way to know if the Actor's properties have been replicated?

chrome bay
#

In what sense?

bright kraken
#

example :
my WeaponActor has a ItemData (replicated) which contains the name and other information

My UI need to display the Weapon's name.
How I am doing it is :
if WeaponActor's RepNotify is called, I will display using the WeaponActor's ItemData's name. But at the moment, WeaponActor RepNotify is called, but ItemData is not replicated yet, thus is null.

chrome bay
#

So what is ItemData? Is that another actor, a sub-object of WeaponActor, or a class?

bright kraken
#

sub-object, a UObject

chrome bay
#

k so it's a UObject spawned at runtime, then replicated via ReplicateSubObjects?

bright kraken
#

yup

chrome bay
#

kk so you will get the RepNotify twice I expect.

#

The first time will be with the sub-object being null, because the NetGUID of the pointer property is set first - but the object has not yet been created.

#

Then it will be called again, after the sub-object has been created and the pointer populates with a valid object.

bright kraken
#

Let me do a breakpoint check

#

the RepNotify is called only once for the Actor

chrome bay
#

Does the pointer ever populate client-side?

#

Because if not that suggests the subobject isn't replicated properly or instantiated on the client

bright kraken
#

sometimes yes

chrome bay
#

More generally though, why is that ItemData a live UObject? Why not simply reference a static data asset

bright kraken
#

its for storing information such as number of rounds in the weapon in this case.
because my project has the concept of inventory and backpack, and backpack consists of only ItemData, so when the weapon is stashed into the Backpack, the ItemData allows me to know how many rounds was in the weapon

chrome bay
#

Why not just retrieve that from the weapon actor itself though I mean, why separate that into another object

#

ItemData can't be replicated without the WeaponActor anyway, so it's dependant on the WeaponActor being replicated and relevant.

#

Essentially it's like an ActorComponent

bright kraken
#

Oh, because I destroy the Actor when added into Backpack 😐

chrome bay
#

Yeah, that won't work then.

#

ItemData is a replicated sub-object of WeaponActor - so when you destroy WeaponActor, ItemData goes with it.

bright kraken
#

Yeah, to work around that issue, I use DuplicateObject and set the Backpack as the Outer so the Backpack gets to replicate the sub-object

chrome bay
#

Yeah you're in danger-zone territory then really

bright kraken
#

Here's a more general question : would you do the UObject approach to store data, or just keep everything as Actor, don't bother about destroying at all

chrome bay
#

My advice would be the simplest approach - keep the data in WeaponActor and don't destroy it, keep it live.

#

When it comes to replication, you can make an optimisation by only replicating the WeaponActor to non-owning clients when it's "equipped"

#

We don't have backpacks as such but do something similar, the weapon is always relevant to the owner - but is not relevant to third-party clients unless it's equipped.

bright kraken
#

So, that means every item in Inventory / Backpack remains Actor but hidden and not relevant to 3rd party clients unless need to?

chrome bay
#

Yeah, that's how I'd go about it anyway

#

Doesn't have to be that way - but you do want to avoid creating/destroying replicated actors routinely, that can end up being way more expensive than just leaving them live.

bright kraken
#

Yeah, that's one of my concern for my current approach as well. It may end up worse than keeping them live.

chrome bay
#

Probably makes it harder to restore state etc. too

#

And Sub-Objects like components/objects also have additional replication overhead for RPC's and properties

#

It's not huge but it's not negligible, but as they are replicated through the actor, there is extra data which identifies the sub-object.

bright kraken
#

Oh, I have struggled a lot using this approach 😐
I see, more reasons to keep them live then. Glad to know.
Thanks again for your help & advices! Appreciate it.

chrome bay
#

nps

#

Tbh, there's a lot to be said for using the simplest approach in MP.

bright kraken
#

oh?

chrome bay
#

Well, it's already about 10x the workload of SP - and you don't want to make life any harder

bright kraken
#

Well, true. Life is hard enough, why bother make it harder.

#

Yeah.

chrome bay
#

When you get into those 1/100 repro cases later on you'll be thankful for it πŸ˜„

bright kraken
#

Hahahaha, definitely not looking forward to that

#

Though definitely learnt a lot from trying to do things this way, which makes it a good journey, I guess.

copper grail
#

hello, so i am making this multiplayer game which has two teams W1 and W2. The problem is, i just want to enable input for those who contain the tag of W1 and not W2 but it doesnt work. Both of the tags are still getting their input enabled

thin stratus
#

It's because you use PlayerController 0

#

Everyone will call this BeginOverlap event

#

And for everyone, if it's a W1 Tagged Character, it will pass the branch, locally enabling input for their Controller

#

If at all you need to cast the Actor to the Character (guessing it is one) and use GetController to get the Controller of that specific character

#

And then you want to limit this to "IsLocallyControlled", because no one else needs the input stuff

#

Now, the question remains what you want to do with the Input on that actor, because you won't be able to execute any RPCs cause some random actor in the level isn't owend by the player

dim minnow
#

I want to experiment with PushModel, but as soon as I do anything with it, my project can't compile anymore because of linker errors. So I assume that my engine is compiled without support for PushModel (UE5 EA2 on linux). Can anybody tell me how/where I could enable it?

rapid sky
#

Hello Guys, I need some help. I have a multiplayer game and the match is composed by 4 Oculus Quests and 1 PC in a Null OSS using LAN. The game needs Voice Chat, I coded all the basics of Voice and it's working pretty well in the first map, after ServerTravel the voice stops. I've tried a lot of things but seems to be impossible to fix this. Anyone knows any about this bug?

chrome bay
nimble parcelBOT
#

:triangular_flag_on_post: draku#4616 received strike 1. As a result, they were muted for 10 minutes.

rich ridge
chrome bay
#

No because, stupidly, the "old" player state actor is the one you get back.

#

But all the functionality surrounding that system suggests otherwise

rich ridge
#

Ohh I see now

#

I hope it gets addressed in UE5

chrome bay
#

I'm fine with using the old one, they just need to really tidy that stuff up a bit

#

The part(s) I don't get (copying from my post)

2) The 'New' PlayerState surely has no data that we are interested in copying to the 'Old' one?
3) The 'Old' PlayerState could very likely be in an unrecoverable or faulty state, especially if functionality is compartmentalised into Components.```
#

But in the case of GAS, that's one instance where it does make sense to keep the old one. I'm just annoyed by the silly naming convention

rich ridge
#

Right

fallen oracle
#

Hi, Is there a way to make a component - spawned in a blueprint construction script - network addressable? The actor itself is placed on the level, and the component gets created in the constructor script (its a simple static mesh), but in networked play, when a simulated character is walking on it, the base is always nullptr, because the engine cannot reference that component over the network, there is no connection between the servers version of that component, and the clients version.

bitter oriole
#

Make it replicated

fallen oracle
#

it is marked as replicated, but isnt doing anything

bitter oriole
#

If the component is marked as replicating after construction

#

Then it should work fine and replicate correctly

#

Though of course, things like setting the static mesh won't replicate

fallen oracle
#

i dont know, that would mean it gets constructed twice on client side, wouldnt it

bitter oriole
#

Not if the actor is replicated

fallen oracle
#

i'd assume construction script is running on the client side too, so the client would run the AddStaticMeshComponent node, and the server would run it too, then the server would replicate the server's version of component, then client would end up with 2 component, one being without static mesh set up

#

gonna check if thats the case

#

it would be nice if i could set like "this component and this component is the same"

bitter oriole
#

Yeah you should probably gate the comp creation with HasAuthority

fallen oracle
#

I'm wondering, is this the only way to do it? It's actually the blockout tool I'm talking about, and every object is created like this. That would mean, initially, there would a huge amount of components to replicate, and complicated code, just so the movement can reference the component it is standing on

bitter oriole
#

I figure the second part might not be true

fallen oracle
#

well it is not my movement, the default character movement component uses it

#

it stores and sends over the network what component it is standing on, and thats where it goes wrong

bitter oriole
#

Yeah right

#

Then yeah, might be a problem to have that geometry be procedural

fallen oracle
#

interesting, how did nobody run into this problem

golden fulcrum
#

Anybody here ever try implementing slowmotion in multiplayer?

#

I was just going to set global time dilation on server then rpc multicast it to all clients

#

But I wonder if anyone has any better udeas

fallen oracle
#

You could save a target value in the gamestate, replicate it, and in the repnotify, set the global time dilation to that value

meager spade
#

iirc ue4 has a slomo function?

#

but yeah i would use a replicated var which adjusts timedilation

fluid summit
#

Hi!
I'm doing the login system for my game, currently i'm using firebase authentication and it's working ok, but i'm kind of worried on the security side.
I'm just storing my keys and user values on a variable on the widget and than passing that one to player controller/PlayerState etc. Not using Server calls at any moment.

What would you consider could be the problems of doing it this way and how would you do it instead?.

red salmon
# fluid summit Hi! I'm doing the login system for my game, currently i'm using firebase authen...

I myself currently have a issue regarding something simmilar but as far as storing user data on variables especially sensitive data and passing it on dirrectly to a server without prior server checking (authentification) can result in some very big problems on the security side. I whould not keep any data on variables (as long as the variables are not seen via multiplayer connection) and all data that the player sends should not be taken granted by the server instead there should be a token or ticket of sorts that checks the user data that the player tries to pass on.

peak sentinel
#

Whats the purpose of CatchupTick(float DeltaSeconds) in UT source code's UTProjectile? What happens when servers DeltaSeconds passed to ProjectileMovement's tick?

#

Comment already explains the purpose actually but I'm wondering the magic behind the sending deltaseconds
// Move projectile to match where it is on server now (to make up for replication time)

fluid summit
red salmon
#

I use playfab it comes with good services for some small indie development although I am still learning parts of it. It has a ue4 marketplace plugin playfab sdk or something like that.

fluid summit
#

Oh playfab looks nice, do you think the "Data management" feature is meant to be used as a realtime database? (not user analytics, but raw user data)
if so, it would be a nice idea to try with playfab auth and database.

eternal canyon
#

then at the end of the session

#

send it back to playfab

#

no reason to do it in realtime i would think

fluid summit
# eternal canyon no reason to do it in realtime i would think

This is one of the issues i'm studying to see how to solve it.
I already created the game in SinglePlayer, now i'm trying to do it with a multiplayer base to expand later. And i already know that there's a LOT of data that needs to be write/read.

My game is something like Art of conquest (https://www.youtube.com/watch?v=v4klOqxePHA&t=732s)
where data is moving back and forth all the time to update the city status.
On a multiplayer basis, do you think it's posible to do it the way you say? storing it all in the session and than saving it.
Or when something specific is requiered, update whatever data we have on the client and than check with the server stat.

#artofConquest #mobilegame #gameplay #moba #strategicGame

β–Ά Play video
#

to be honest i'm kind of at lost on how to approach the data transfer on a game like that without burning the server to the ground.

red salmon
#

Well there are some really crazy fast data bases though I dont think that whould be the way to do it. I think just plain old ue4 dedicated servers are the way to go and the data bases to hold out the more inportant information for your game. But if your game really needs some large amount of data storage and transfer trough a data base you probably whould need some good amount of investment

tranquil yoke
#

Is there any way i can control the delay of in how much time each pawn is going to be created inside Editor.. when i test for multiplayer using dedicated server using 2 clients ?

meager spade
#

no

plucky prawn
#

For listen servers, my server host is not having any client functions run like OnRep and Playerstate.ClientInitialize. Is this on purpose or am I missing something? It seems like the server host is treated as the server itself instead of a client with network authority.

chrome bay
#

On purpose, a listen server isn't a client it is the server

plucky prawn
#

my understanding of listen servers is that the host is still treated as a client. thats my understanding from garrysmod anyway. the server is launched in the background and attached to the game

chrome bay
#

Not in UE terms

#

In UE a Listen Server is a Server, just with a local human player.

plucky prawn
#

hm i see. that sort of doesnt work with what im trying to do.. or i guess what im trying to do is probably wrong. im trying to make it so that when a client joins and some playerstate variables are replicated it calls a function to update the UI, but since the OnRep functions arent called on the host, the host's UI is never updated

chrome bay
#

Sometimes if you plan to support Listen Servers it's quite common to manually call the OnRep() when setting properties

plucky prawn
#

oh interesting

chrome bay
#

I prefer to separate it, sort of like this:

{
    SomeProp = 1;
    OnSetSomeProp()
}

UFUNCTION()
void OnRep_SomeProp()
{
    OnSetSomeProp();
}

void OnSetSomeProp()
{
    // Common Logic
}```
plucky prawn
#

id only need to do that for a listen server host though right? for dedicated this is not an issue

chrome bay
#

Just so it's more obvious and you can still differentiate client vs server logic,

#

In theory yeah, dedicated server would mean no local players so no UI locally.

plucky prawn
#

i might explore this a little more a bit later on. ive already started a new project with a dedicated server, so i might finish this off, then see about adding listen server support. i guess it also doesnt matter if OnRep is called on the client since it wont actually replicate to the server

#

thanks for explaining that to me

kind ember
#

Anyone here uses Vivox?

halcyon totem
#

hello everyone, I need an answer for a simple question, can smooth movement in multiplayer possible if the character has use controller rotation yaw unchecked?

#

this is my current rotation code

#

I just need to know if smooth rotation is possible

peak sentinel
#

What is "movement acking" exactly?

halcyon totem
#

@peak sentinel are you asking me?

peak sentinel
#

Nope, it was a general question related with movement components

peak sentinel
#

That checkbox overrides pawn's default orientation logic

#

And smooths the rotation

peak sentinel
#

If you are applying rotation or location on tick, it will take some time to arrive and some packages will drop/loss during transfer and it wont be smooth

#

Smoothing that requires some additional effort

peak sentinel
halcyon totem
#

I tried to check this and it made it worse

peak sentinel
#

With input and AI movement it works great

#

Are you good with C++?

halcyon totem
#

no, could c++ solve my issue?

peak sentinel
#

There is a function you can override in C++, not exposed to BPs

#

That rotation yaw checkbox calls it inside C++

#

But afaik (i might be wrong) its empty by default

#

You can add your own interpolation logic there

#

Though, again, if you're adding or setting location on tick its not gonna work

#

Because you're just setting a location, not smoothing the distance between A and B

#

You're just saying "set to B from A"

peak sentinel
#

If you ever need it though dogdance

halcyon totem
#

ok thanks I will get this over to someone who knows c++

#

c++ is an entirely different animal

peak sentinel
#

Kind of, dont pay to someone for this though, its pretty simple, just ask from a friend or try to get guidance at #cpp

#

All you need to do is just create a class in C++, override this function in header, paste this to its definition in .cpp

#

Then reparent your BP to your newly created C++ class dogdance

halcyon totem
#

ok ill try it out and report back thanks for all the help

peak sentinel
#

@halcyon totem

#

That function is not gonna work

#

I was assuming you were having problems with AI controlled pawns before watching the video, I guess I need some sleep

halcyon totem
#

oh damn i got excited

#

yeah its for a character

peak sentinel
#

Its still simple to do though, you dont need C++ either this time

#

I cant see your BP logic because of my small monitor but a method of doing this is
1- Have a replicated yaw and pitch float variables, mark them as OnRep, set their replicaiton condition to "skip owner"
2- On OnRep_Yaw/Pitch function apply the rotation of pawn

#

On Tick, if you are
Authority: Set float and yaw variables
Client: Send server float and yaw variables with an RPC

peak sentinel
#

And every other connection except server will use OnRep function to set simulated proxies rotation

#

tada dogdance

halcyon totem
#

ok I will try this out and see if it works and I will report back

dim minnow
lost inlet
#

NetCore in Build.cs

rich ridge
#

I m doing team allotments for my joining players, and as per my understanding the best place seems to be this
virtual void PostLogin(APlayerController* NewPlayer) override;
Is there any other better place other than this?

fading birch
#

i prefer to use: GenericPlayerInitialization

#

it handles PostLogin and post seamless travel

rich ridge
#

ohh let me check

#

nice this handles the other cases too.
thanks brother for the tip.

fading birch
#

np

dim minnow
#

Or is there a central one I have yet to find?

mossy kindle
#

Does anyone here know a tutorial series for replicating a fps game?

lost inlet
#

If you look at PushModel.h, it’s in a module called NetCore

eternal canyon
dim minnow
mossy kindle
modern cipher
dim minnow
pure kraken
#

Hello all, how's it going? I'm new here and I have a question. I've been struggling with replication for quite a long time and I can't make it work.
Here's the thing: I'm spawning an axe,attaching it to the server side character and setting the net owner to the axe, replication is working because I can see it in the client. When the axe hits something, I'm trying to call the server to apply damage to the hit object but it's never reaching the server.

#

I've also tried getting the owner, which is the server side character, and calling the server there but it didn't work either

pure kraken
#

nvm, I figure it out, the owner has to be the controller, not the pawn

kindred widget
#

@pure kraken Normally that's not true. You should be able to have a Pawn own a Weapon, as long as the local controller controls and owns the pawn, the weapon should be able to RPC.

red salmon
#

have been using Playfab's services to get a player identification method on servers but I got stuck at the part where I gotta authenthicate the session ticket but idk how to do it (if can someone show me a example of how to do it whould be great)

halcyon totem
#

can someone help I am trying to send some repNotify YAW and Pitch Float variables to the client but I dont know how

#

am I sending the variables correctly?

peak sentinel
meager spade
#

and ack is sent to the client to let them know the server processed that move.

#

either successful or not

#

also SavedMoves gets adjusted to only contain unAcked moves

#

basically Acked means it was processed.

halcyon totem
#

hello all I have use Controller rotation yaw UNCHECKED for my character pawn and I am trying to smooth the rotation, is this the correct way for the client to send the server the variables ? its still laggy so I dont k now if I am doing it wrong

halcyon totem
#

@peak sentinel I am trying your fix am I doing it correctly?

ancient cypress
#

hey all, do you think a 50-100 concurrent player (per dedicated server) survival game is viable using UE's native networking, or is a custom back-end a must?

#

have been researching all available BaaS options for the last week

#

and i would definitely like to avoid writing server code outside of UE

#

i'm also noticing that every multiplayer survival tutorial/marketplace tool seems to use UE's native networking

#

but i'm skeptical as to how it'll perform with the high culling distances and many player states required in multiplayer survival games

red salmon
#

have been using Playfab's services to get a player identification method on servers but I got stuck at the part where I gotta authenthicate the session ticket but idk how to do it (if can someone show me a example of how to do it whould be great)

faint hemlock
#

Hello guys , I have an issue with replication so outside of servers view equipping of client doesnt work did ever someone experianced this before ? please help me ...

solar stirrup
#

Check out the Replication Graph

crimson valve
#

Anyone know of a good set of videos that provide a crash course on UE networking, ideally aimed at someone who understands typical networking concepts (I've got experience with Quake networking.)

ancient cypress
uncut atlas
#

Hi, how often is too often for reliable RPCs? When toggling a flashlight, an unreliable RPC gets called locally which calls a reliable NetMulticast RPC so the flashlight is guaranteed to toggle in everyone's game. My concern is if players spam the toggle button. Sources recommend not to call reliable RPCs often like in tick. Should I worry too much?

ancient cypress
#

thank you!

lost inlet
solar stirrup
#

People spammed the flashlight using a cheat, which would end up with everyone being disconnected

#

But yeah I'd use a replicated variable for this

lost inlet
#

that would mean they had a replicated multicast function for it

uncut atlas
#

@lost inlet @solar stirrup Thanks for ur replies!

lost inlet
#

and you could rate limit that on the server

solar stirrup
#

Yep

#

Replicating a variable would fix that anyway

chrome bay
#

State = Vars, Events = RPC

#

Golden Rule (TM)

vagrant lance
#

Can anyone explain how RepNotify works for when the variable changes before a client joins the game? Does the RepNotify function automatically run for a client if the variable was changed before they joined?

chrome bay
#

Yes

#

It'll run so long as the current value is different from the serialised (default) value

finite goblet
#

I've seen games calling multicast several times a second without issues

vagrant lance
#

And if I reference the variable within its repnotify function it will use the new variable, right?

finite goblet
rich ridge
#

For AI controlled Pawns the vector length is always zero when using MoveTo Node.

Any other way to get acceleration.

vagrant lance
finite goblet
#

In c++

#

You can do
OnRep_MyHealth(float LastHealth)

#

So last health is your health as it was while current value of your variable will be latest from the network

vagrant lance
#

Got it now, thank you!

quiet fjord
#

Guys I have a problem when it comes to replicating an address blend space, it does it to me in the local but the user who sees it does not see it correctly because it is I have everything replicated

steady musk
#

Hi guys. Do you know where to find some info about animation based combat system for multiplayer? Cause rn I have a huge problem with overlapping when its amazing locally and its totally broken on dedicated server

meager wing
#

Easy question: Are you able to open a level with the "?listen" option BEFORE you host a session? or do you have to host a session and then open a level

#

example would be a single player game level you could decide to host later

plush cypress
#

Hey, has anyone run into the problem where skeletal meshes that simulate physics on characters start flipping out whenever the host player isnt looking at it? This only happens on non-possessed characters.

halcyon totem
#

is smooth non laggy rotation possible when you have use control rotation yaw in UNCHECKED? I am trying to do a fix someone mentioned but its still laggy is this the correct way to send a variable over RPC??

#

I tried with both server_rot and multi_rot in different combinations but its still lagggy

#

supposidly if I have skip owner picked on rep notify local controller skip OnRep function and you will be able to simulate the rotation without any lag, but its still laggy

real nimbus
#

Hi, can somebody help? I settuped dedicated server with my game, but whenever i try to join it with client via open 127.0.0. 1, i get connection timeout error(if it helps im using Steam subsystem), thanks in advance.

quiet fjord
#

guys how can replicate the axis for example moveForward and moveRight

harsh ice
#

Is there any online subsystem for mobile ?.

candid helm
#

So I created a beautiful networked weapon system where the player spawns a server sided weapon that the client owns and then the player calls a command on the weapon to shoot. then the weapon responds back with a delagate which tells the player when to do animations and sounds for the first person model..

#

only downside? when actually taking latency and things into account, it sucks

#

there is a huge gap between when the client fires the gun and when it actually fires server side

#

so, I'm going to have to probably remake the weapons system so that everything is done on the client.

#

What is the best way to have the weapon set up? Have dummy models on the rig that switch mesh when using different weapons? Have the same system but only have the weapons spawn on the client instead of the server? A mix of both? I feel lost.

eternal canyon
#

You never want things to be done on the client(in the sense when they are critical to gameplay)

#

what u want to do is predict those things

candid helm
#

I'll have everything done on the client and then checked by the server

candid helm
#

because I found this chart

#

so I guess what I'm asking is should I have the shooting logic on the player, or on the weapon. I would like it to be on the weapon itself so that way it's just an agnostic system where I can wildly different types of weapon setups and all the player has to do is tell the weapon to start and stop shooting

#

I guess I'll try editing my current system before re writing it and if I break it too much then I'll just make a new one.

ancient cypress
#

so the 'Create real bullet(s)' event in that graph could be the agnostic system

#

which can draw upon your weapon types

#

i'm not sure if that is best practice at all, that's just what i'm imagining

#

does anyone know if replication is still single-threaded in UE4.27?

red salmon
#

How do you get the player data after they rejoin.
Scenario: a player joins a server and collects 5 coins than leaves. Later he decides to join back and get back to his 5 coins. How does the server know that the player controller that just rejoined is the same player as the last one that had collected 5 coins?

#

As far as I know you tie the data to a specfic player ID and when the playet joins you get his ID and when it matches with the player ID of his data he gets that data. If that is how it works than how do I get a player ID that persists and make sure its secure ( I have tried playfab but it doesn't really work out for me since I cant make the server authenthicate the players session ticket and get his ID in a secure way)

thin stratus
#

That does require a unique I'd, which online subsystems usually provide. e.g. steam

red salmon
#

trough unique net id?

thin stratus
#

Yee

red salmon
#

hmmm I see

#

so without a online subsystem it returns always random PC name and ID

#

but with steam it gives out a real id

thin stratus
#

Could be yeah

#

Don't know what null produces

red salmon
#

a combination of product display name and ID

#

Is it like a steam64ID?

thin stratus
#

I think so yeah

red salmon
#

I have looked trough some forums to get more details on wht the unique net id with steam prints out and there is some debate on how and what it prints some ppl say to use the player id in game state others with unique net id some say that you cant print it. https://forums.unrealengine.com/t/how-to-get-player-steam-id/21709 idk what to do about it. I guess I will have to test out everything

final rover
#

Hey, I'm trying to set up hot-swappable controllers, such that you can use any controller you have connected to your pc to control your player.

I'm having some issues with setting my player controller id. As once I set my player to use a new controller id I can't control my player at all until I unplug and replug my controller. Any ideas what might be causing this?

#

I can confirm that the inputs from both controllers are being detected.

elfin sail
#

should i create player properties struct in player state or i should i handle separately by creating the On_Rep events ?

thin stratus
#

Years ago I did the same mistake

#

The Id itself is not accessible from BPs without exposing it from cpp

#

You can print it, it has a ToString method

#

But you also don't really need it. Just for rejoining you should be good with just blueprints

#

And the OverrideWith function of the PlayerState

#

(which is a bit confusing, as it calls on the old PlayerState, passing in the new one from the rejoin)

red salmon
#

Than what do I use as an ID?

thin stratus
thin stratus
elfin sail
#

wdym by single property ? struct ?

thin stratus
#

No each being their own

elfin sail
#

why not struct and single on_rep ?

thin stratus
#

More control

elfin sail
#

but i have 25 properties and it could be more

#

it ll create a lot of code

thin stratus
#

So you want one OnRep firing for all of them? Potentially calling lots of code to figure out which param even changed to then react to it? Sounds mad

#

Unless it's always the same code that should run I would go with multiple props

#

The only thing I used structs for in the past In regards to player data is customization settings

#

But that kinda counts as one property anyway.

elfin sail
#

what if i create type and share only type

#

which ll be one byte only

#

for each property

thin stratus
#

Up to you. Again I would use multiple props

#

Depends on the data

red salmon
thin stratus
#

Why does the server need a stable id

elfin sail
#

yeah actually i create separate and its not looking , same code looks to me thats y I want to get advise on that

thin stratus
#

The clients all have their id set through the subsystem code

elfin sail
#

if there is another better way to do it with minimum code

thin stratus
#

Minimum code is not always the desired way if it limits functionality

#

What properties are we talking about

#

And why do they all need OnReps?

elfin sail
#

yeah you are right that's y i am here may someone can suggest if there is which i am not thinking of

thin stratus
#

For that we would probably need to know exactly what properties you are talking about

elfin sail
#

like player shoes , socks , jersey , helmet name etc

thin stratus
#

That's customization data. That as a bunch i store in a struct

#

But things like Kills, Score, Assists, Deaths, etc I keep separate

elfin sail
#

how you will get which one is changed

#

and there i bit explanation why struct

thin stratus
#

By hand or you just refresh completely

#

Struct because it's very likely that you move this data around

#

And then it's easier as a struct

elfin sail
#

actually its looking good to me because there already a struct buy for sharing i am doing each property saperate

thin stratus
#

PlayerState to PlayerCharacter. PlayerState to PlayerState etc

red salmon
elfin sail
#

okay great

thin stratus
#

You get it from the PlayerState through c++

red salmon
elfin sail
#

one think more if yo have any suggestion how should i get which property is changed ?

thin stratus
#

Hm not sure maybe by hand comparing them. It can always be that multiple properties changed

thin stratus
elfin sail
#

okay if create a delegate kink of onpropertiy chnage let say

#

i change each property which is updated ?

#

it make sense ?

thin stratus
#

Yeah I guess

#

I would suggest you make your system work and then worry about this

#

Cuase you are overoptimizing stuff atm

#

I would start with refreshing everything even if not changed

elfin sail
red salmon
# thin stratus On what? Me asking why you need the id?

well for my project when a player leaves all its data are stored on a pawn that mimics the player "sleeping" and I want an ID so that the server knows when the player joins the server what sleeping pawn he is assigned to so it can get his data.

thin stratus
#

Right well this is actually a shitty setup to be fair

#

The data should be on the PlayerState

#

Including a pointer to the sleeping character

#

UE4 already has the code to re-give the PlayerState, so you would have all data

#

And you can reposses the character

red salmon
thin stratus
#

Yeah it gives you the option to move some data. You will need to toy around with that a bit cause epic made it a bit confusing.

#

When the player rejoins they get a new one and then it finds the old one. And then calls OverrideWith on the old one passing in the new one. But I think it also reassigns the old one so I never understood why I would want to override anything there if it gives the correct state anyway

#

Maybe mistaken. @chrome bay ranted about this the other day too

#

Your GameMode should define the inactive PlayerState lifetime.

#

Not sure if your dedicated server is supposed to have those sleeping characters even after a restart cause that needs saving of all the data outside the server process

#

SaveGame or Database

chrome bay
#

Yep. Silly implementation. I went all the way back to 4.0 and its the same there though, so it must have always been like this. Waiting from feedback from epic.

thin stratus
#

Figured

chrome bay
#

There's only one reason I can see for it, which is it makes it easier to restore other references to the PS

#

But the function naming is mental

thin stratus
#

Either way if you still need/want the id to do things manually, you can store it and compare it as a variable type and I think also as as string

#

But requires c++ to access it in the first place

#

Not much c++ but some

#

FunctionLibrary with one function in it for example

red salmon
#

I really hope there is some documentation on the internet about this

thin stratus
#

Yeah some person somewhere most certainly posted a code snippet about it

#

But as always, Multiplayer in UE4 more or less requires c++

#

If you aren't willing to use/learn it you will have a hard or even horrible time

chrome bay
#

E.g, firing anim, muzzle flash, sound, apply recoil etc.

#

99.99% of the time, the shot will succeed server-side, so those 0.01% of times when it doesn't the player never notices anyway.

#

You can predict ammo client-side too, just requires some careful implementation. Generally though stuff like this that requires instant feedback you should try to predict client-side.

#

GAS makes it easier, worth looking at the GAS Shooter template too as a more modern way of doing it.

#

Not yet seen that tried at scale though

grizzled stirrup
#

GAS Shooter template? Is that the RPG project or a new one?

chrome bay
grizzled stirrup
#

Oh that's cool I hadn't seen it before

#

Thanks for sharing

twin juniper
#

i am making a spectating system, i made it so it activates when there is more then 10 players, but i dont know how to connect so it attaches the player bp of the first 10 players and loops thru them if pressing space. I only sofar managed to make it attach to the player itself who was joining and being 11th player.

grizzled stirrup
#

@twin juniper in the GameState there is an array called PlayerArray

#

You can use this to find the characters of all players on the client

copper grail
#

Hello how can i hide other players when i click the keys? like when i click right mouse button, all actors containing a specific tag will not be seen by my camera

granite nest
#

3 parts: 1. google how to do something on key press 2. google how to get all actors with tag 3. google how to hide object

pale grail
#

Can I use single keyboard to control two players ?

violet sentinel
#

If player-possessed pawn has multiple AI-controlled satellite pawns what would be simplest way of referencing owning player from satellite pawn?
scenario: satellite pawn kills other player / or other player pawns, need to get actual player for damage processing
what would be simpler and better

  1. setting owner of satellite pawn to playercontroller on spawn and using Getowner
  2. setting instigator of satellite pawn to player controller pawn on spawn (but there is a possibility that it may not be present)
  3. Add a reference to owning player controller to AIController of sattelite pawns
  4. something else?
short arrow
short arrow
violet sentinel
#

for various reasons

#

now debating between owner/instigator/custom replicated variable to do so

short arrow
#

uh when the satellite is spawned by the actor plug in self as owner

#

then inside of the satellite blueprint you can call get owner node

violet sentinel
#

that is pretty much what i did right now, thinking if it is fine

short arrow
#

it will work reliably

meager spade
#

i mean i would set the owner as the player controller that owns the actor

#

and set the instigator as the main pawn.

#

then run all damage stuff using GetInstigator..

orchid violet
#

Hi all, This should be an easy one for yas lol. I'm trying to replicate a simple action. When the player presses a key, they will spawn their weapon and switch their animation based off 'Combat State'. I have set the actor which attaches to the players hand to be replicated and it does show up, However the client is not updating their animations locally, but updated on the server. What am I missing? (New to Replication) Thanks

thin stratus
#

That multicast is redundant

#

And you are only changing the combat state on the server

#

You need an OnRep variable that you set there instead ( in your character ) and set the state on the animBP in the OnRep

orchid violet
#

Ahhh ok thank you

charred crane
#

I know that the game mode doesn't replicate, but if I set a variable to repnotify on it, will it fire the OnRep function when it changes?

violet sentinel
#

onreps called only on clients when value is received on client

charred crane
#

My game mode keeps a list of all player controlled pawns, and I want my game state to have that information. When would be the best time to send that information to my game state? Each time a player joins/leaves in the onPostLogin and whatever the leave one is?

violet sentinel
#

game state already has PlayerArray which is a list of PlayerStates of your players. you can get Pawns from it

charred crane
#

I guess I would just do extra checking to see if the states have controlled pawns

orchid violet
#

@thin stratus So I kind of have it working, however when the (top left) client equips a weapon while out of render distance and then goes back to the (top right) client, The top right doesn't see the animation change. Only the weapon attached. Is that just the variable thats being repnotify i'm messing up?

meager spade
#

@orchid violet I kinda handle this in a slightly different way. When player equips a weapon i replicate the pointer(reference) to that weapon. The anim blueprint checks to see if a weapon is equipped (in the players hands), and asks the weapon, hey what anim state (Melee, Ranged Rifle, Ranged Rocket Launcher, etc) then does the correct animation.

#

no need for anything else or setting things manually, anim blueprint should be able to handle that and adjust the animations without any external stuff.

#

you should never tell the anim bp to change states nor should the anim bp handle the states like that

#

it should pull what it needs from the player character.

#

also never spawn the weapon like that

#

weapon should be spawned SERVER only

#

and set to replicated

#

never spawned on the clients manually

#

flow would be this, Client presses key -> Server Spawn Weapon (Run on Server) -> Server spawns weapon actor (which is replicated) and attaches it -> Store reference to weapon in a variable (set to Replicated) -> AnimInstance checks if weapon is equipped and runs combat state.

violet sentinel
orchid violet
#

Ah ok, Thought I was just using F key for now so I could learn a bit more, Having a hard time with replication.

orchid violet
#

So this would be incorrect? It is ran though an on server node

meager spade
#

then in your animinstance

#

for example this

orchid violet
#

Thats kind of what i'm doing though.. I should make the weapon itself repnotify and then use the animation based on that, got ya :

meager spade
#

doesnt need to be repnotify

#

your anim bp should ASK the weapon

#

your weapon should hold what blend space to run

#

or w/e

#

anim instance just checks if weapon is equipped (via the weapon replicated property)

#

and then goes Weapon->GetBlendspaceRef

#

that is it

#

this also means your code is cleaner/easier to maintain

orchid violet
#

Ok, Appreciate all the help πŸ™‚

meager spade
#

if you need more help or clarification you can ask πŸ™‚

quasi tide
#

I'd probably use an event dispatcher to update to the proper weapon blend space

pure kraken
#

ctrl + c

crimson void
charred crane
#

Do I need to set a component to replicate if it exists within a blueprint actor that already replicates? I'm attempting to swap a mesh out at runtime and clients aren't seeing it, despite multicasting the mesh swap.

thin stratus
#

Your own components that have replicated variables and maybe rpcs would need to be set to replicate

#

Epics components like StaticMeshComponent, could be set to replicate, but that would only have an effect if it would also replicate the static mesh change

#

Which I think it doesn't

#

So you can keep it non replicated and instead add an OnRep staticmesh variable to your actor and handle setting the mesh in the OnRep function

charred crane
#

It's strange because I basically did the same thing with a skeletal mesh and it replicates properly.

charred crane
kindred widget
#

Worth noting that StaticMeshComponent already has an OnRep for it's StaticMesh pointer. So if it is set to replicate on a replicated actor and that value on the component is changed on the server, it should also update on clients.

charred crane
#

hm ok, thanks

thin stratus
#

Yeah okay I always have the rep notifies in the actor cause epic is super inconsistent with that stuff

kindred widget
#

To be fair. I'd personally put it in the actor anyhow. Less networking with a property in the actor, and I'm also still sour that the OnRep for StaticMesh in the StaticMeshComponent is not virtual.

finite goblet
charred crane
#

I'm streaming in a level and when it finishes, streaming in another level, but I'm setting the second levels transform beforehand. This works for the host and most of the clients, but not all. Does anyone have an idea why it might be failing for one person?

fluid summit
#

Hi! one question about sessions.
I'm using firebase auth for login and than moving into a "server map"
i'm saving one unique tokenID that i get from Firebase to identify the players, i'm adding it to the GameInstance.

Is there any way to check if the same TokenId is already on any client connected so they can't log in twice?
Is there a built In component for things like this already? (player session)

fading birch
#

@fluid summit probably better suited for #online-subsystems , but i'll answer here anyways. If you're authenticating through a non-engine based authentication system, ie one that has a online subsystem implementation like Steam, then you'll need to do some handling yourself. Personally I use a game instance subsystem to manage that stuff. Once I have an auth token from my authentication service, Cognito for me, I just set a bool as true and call a function named IsLoggedIn() which just returns that bool.

short arrow
mossy kindle
#

Can anyone help me please? This deducts the health of the player shooting instead of the one being hit

mossy kindle
#

I made some changes, but still its random whom it's health it deducts

round yew
#

Someone knows the console command to join again the editor server when you disconnected from it?

#

trying "open 127.0.0.1" but it doesn't work

#

I was doing it before but not sure its the right command

mossy kindle
#

Try making a HUD widget and using it there

round yew
#

you mean instead of using a console command?

mossy kindle
#

yup

#

Use the Execute console command node if you aren't already

balmy sable
#

my character is not able to move
pls help

chrome bay
#

@balmy sable don't cross-post

fluid summit
#

and yeah, i'm using VaRest to make requests to the firebase api, through there i can make a token for the logged user, but i'm not sure on where to save the token in order for it to be in a safe place

#

also, how to check that's not someone with the same token already logged in as a client (i.e.: the same client logging in twice)

summer tide
#

Why update only when rendered causes dedicated server replication issue?

fluid summit
#

maybe because the server doesn't render anything, but i'm not sure

chrome bay
#

Yeah, it doesn't render anything - so no updates.

#

Usually considered wasteful to run animations on a dedicated server

fluid summit
#

just for testing purposes, i gave a random numbe between 0 and 1000000 to my clients when logging.
both clients got the number 7 the first time

fluid summit
#

So i'm not sure if what i'm looking for is exactly game sessions.

I'm running my game on a dedicated server and players interact in a mmorpg style (one big persistant world).
I'm trying to get a way to identify the users after they log in, in order to fetch their player data.
Currently i'm using the unique token id i get from my authentication service, i'm saving it on GameInstance for each client (this works ok)

Is there a better way to do it? The "sessions" that i see everyone else use, they are more oriented towards Game Rooms like a particular match in fortnite and it's not what i'm looking.

(currently i'm trying to find a way check if when a new user tries to log in, if there's another player with the same tokenId (the same player logging in twice)

chrome bay
#

How many players?

#

You can't have a dedicated server in UE4 with more than 100 or so players, it's not designed for it. Even 100 players is a butt-load of work.

fluid summit
#

wow really? didn't knew that

chrome bay
#

MMORPG is a whole different ballgame

#

Usually needs bespoke architecture

fluid summit
#

i'm looking for something like travian or art of conquest

#

i can expand with multiple servers horizontally, there's no problem in that i guess

chrome bay
#

A UE4 dedicated server is a single game "session", with some connected players. That server has it's own instance of the game running and players drop in and out.

thin stratus
#

Yeah natively you can't get that to work

chrome bay
#

If you want data persistence, you typically need a global data server that your dedicated servers then interact with, or the clients interact with directly.

#

Either way, not something you can do out of the box.

thin stratus
#

Either you replace the servers with something that can do what you need, or you wrap them with something

#

Both need a special solution

chrome bay
#

yeah

fluid summit
#

that makes sense, for data persistence i'm using mysql and for user authentication firebase auth sys.

thin stratus
#

Yeah that's all fine

fluid summit
#

what about knowing wich users are connected and identifying them?

thin stratus
#

Don't use Firestore :D good choice

chrome bay
#

That's what user accounts are for

#

And how the session stuff works in UE, at least.

#

They login, then you have an account ID - in UE that's known as FUniqueNetID

#

And that's the key to whatever backend online service you're using that identifies that player

fluid summit
#

maybe i can just store the ids on an array on the server and check against that

#

and as they log out/log in, remove the ids.

thin stratus
#

No the ID is the same every time

#

It's the unique identifying ID

#

What you are talking about is a session

#

At least as a concept

fluid summit
thin stratus
#

Cause it's expensive as fuck

fluid summit
#

oh firestore, yeah jajaj

#

i went for mysql exactly because of that, the price were madness

thin stratus
#

That and limitations

fluid summit
#

i'll probably change the user auth also, the prices don't make any sense. but the free plan is great for testing

fluid summit
# thin stratus At least as a concept

so either i find a pluging that handles sessions on a dedicated serve or build the functionality for myself, there's nothing already setup on ue4?

thin stratus
#

kinda but not really. It's not meant to work for MMOs

#

You usually have one Server

fluid summit
#

also i need to find a way to "do things on the server side" when a user logs in (even if they just shut down the game) like saving data and things like that.

thin stratus
#

And you connect to that

chrome bay
#

UE4 isn't an MMO engine, ultimately

thin stratus
#

And that Server might have a Session

#

ANd you might be part of that Session

#

But that's it

chrome bay
#

So it's going to be an arse from the get-go

thin stratus
#

The proper way of doing an MMO with UE4 is to only use it as a 3D engine and to write the whole network part outside and integrate it via a plugin

#

At least that's my 2 cents

chrome bay
#

You might build an MMO client with it, but not an MMO server

#

yeah

thin stratus
#

But the thing is

#

In all honesty

#

If you can't pull that off

#

Don't make a fucking mmo

chrome bay
#

πŸ˜„

thin stratus
#

Don't be one of the people that think they can pull it off

fluid summit
#

yeah i know, i'm just trying to build a prototype to learn the engnie and multiplayer functionality

thin stratus
#

Yeah that's the wrong genre then

fluid summit
#

i already reduce the scope of what i want to do a few times as i get to know what is posible

thin stratus
#

Make a 8 vs 8 shooter

#

Then you can embrace UE4

#

Make a second Unreal Tournament and you might have half the game already done when opening the Engine

#

(sad truth)

#

There is this outside system that makes large worlds with Ue4 possible

#

But $$$$$$$$$$$$

#

I can't recall the name

#

And I don't know if that is still alive

fluid summit
#

have you seen art of conquest or travian? i think the main functionality can be done without the "mmorpg" aspect and only fetching to the database

thin stratus
#

SpatialOS was that thing

fluid summit
#

but i'm not sure if i can do something like that in a secure way without using a dedicated server.

#

was?

thin stratus
#

As in, was what I meant 10 seconds ago

fluid summit
#

oh right

thin stratus
#

I mean, okay, so something that doesn't actively need LIVE multiplayer

chrome bay
#

SpatialOS I think is about tying multiple UE dedicated servers together as one big one, and having players in different spaces IIRC

thin stratus
#

Can be achieved with UE4 and database stuff

chrome bay
#

Very niche solution to a very niche problem though

thin stratus
#

The 100 people limitation is 100 people playing live on a server aka Fortnite

#

Travian looks like you don't actively interact with a live player

fluid summit
thin stratus
#

That is something else, but that would also not be done with any ue4 network code

fluid summit
thin stratus
#

If you want to do that, then do it via some socketed database

#

Something that can give you live updates on the database with callbacks

fluid summit
#

okey, i'm gonna check what other functions do i have as a base on UE4 for players when joining/leaving a server and try to build custom functionality on top of that

thin stratus
#

Maybe instead of Mysql (I'm not good with databases) look into MongoDB

#

I know that can be sharded and has a socket connection to the currently "playing" user to get updates

#

If Mysql can do the same, then nvm

fluid summit
#

that's interesting, i'm gonna look into that

thin stratus
#

Yeah my fiancΓ©e created a mobile app with MongoDB (previously Firestore) and FirebaseAuth recently and dived a lot into this. That's why I know about the sharding etc., cause I had to listen to the evening "Bug talk" :D

#

That's also why I say that Firestore is expensive

#

And limited

fluid summit
#

jajaja nice

#

yeah, the main problem right now is how to know a player logged in and how to do stuffs when a player shuts down the game (wih could be solved by constantly updating the database whenever there's new info available, but that sounds extremelly net expensive, maybe mongoDB can come to the rescue there)

vocal ridge
#

Assign players an ID when they register and use that as the unique identifier in game

thin stratus
#

The MongoDB Socket connection would help here yeah

vocal ridge
#

Save it in database and load it every time a client logs in

thin stratus
#

Generally you could have a socket connection to the backend to know if they are online or not

vocal ridge
#

Check if a player with that ID is in game every time someone tries to connect to avoid dual accounts

thin stratus
#

And to send data isntantly

vocal ridge
#

You will need to save state in database, so for example online=true/false

#

When player logs in successfully, set it to true, and when they leave game set it to false

fluid summit
fluid summit
thin stratus
#

Yeah i would just read a bit into database + socket + session etc.

#

It's an annoying entry into this shit

#

Cause it's always done in 20 different ways

vocal ridge
#

There are built in nodes for that

fluid summit
#

things like internet connection problems or things like that, i would need to account for those things

thin stratus
#

And Stackoverflow hates new users

fluid summit
fluid summit
vocal ridge
#

Let me try to find it, I use them in my game but don't have the code at hand atm

#

There are several events

thin stratus
#

I don't know of any build in socket related nodes

#

If at all via plugins

vocal ridge
#

There is one in controller, one in gamemode

blazing cloak
#

Hello. I'm trying to access player state in begin play of pawn. But when clients join the game PS is null on server, but its correctly accessed on clients. And this happens only in standalone game, and not in PiE?

thin stratus
#

Yeah that is correct behavior

#

Here is why:

fluid summit
thin stratus
#
  • When the Client receives the Character, it might already have the Replicated Properties set. So it's actually not a give that you get a Character on the Client with a valid PlayerState. You could be lucky here.
  • When a Character is spawned, it is not possessed. The PlayerState comes from being possessed by a Controller. BeginPlay is thus too early. If you need the PlayerState, you need to use a function later down the chain.
#

@blazing cloak

vocal ridge
#

I can't remember which one I use, but it's one of those two πŸ™‚

thin stratus
#

@blazing cloak Examples would be:

  • PossessedBy (Server only)
  • OnRep_PlayerState (Client only, C++ only)
vocal ridge
#

From there you can pull player id and update the database to set online=false

fluid summit
#

yeah, i'm gonna look into that one and the one with MongoDB, thanks a lot for the help

vocal ridge
#

Np

golden nest
#

Hi, does someone know if when i log into an online session my game instance disappear or every client has it's own?

thin stratus
#

GameInstance is per game process and is not accessible to other processes

#

So each Client and the Server have their own

#

No networking and preferably not gameplay code in those

golden nest
#

So, can i load player info from game instance instead of reading a save game file?

thin stratus
#

You could, but both ways would be loading it locally on the process's machine

#

If that's a Client SaveGame, then you still need to send it via a different, networked class

golden nest
#

Can i load the info an send it to the server via RPC?

thin stratus
#

You can try

#

I know that in The Ascent we had to send it segmented

#

Cause too much data for one RPC

golden nest
#

And how can i know if there is to much data?

#

:c

thin stratus
#

When the Log is telling you that the RPC is too big :D

golden nest
#

Oh that's nice

thin stratus
#

There is probably a number

#

Which I don't know

short arrow
golden nest
#

And do u know if i can send data structures?

#

or i need to break it?

empty axle
golden nest
#

Nice

#

Thanks β™₯

mossy kindle
#

I remade this and now it works

golden nest
#

Hi, it's me again, if i replicate a component that i create in GameState, it replicates its variables?

bitter oriole
#

If the component is replicated and owned by the game state, variables marked for replication will replicate

golden nest
#

oh, that's my mistake

#

Thanks

green delta
#

What is the node for a player leaving a game or disconnecting?

fading birch
vocal ridge
green delta
#

actually, would this be correct?

empty axle
green delta
#

Good point with the game state

#

I'm also labeling players to announce the winner

fading birch
#

Gamestate is definitely what you want to use. It holds the array of player states. If you need access to the controller, you can just use:
PlayerState->GetOwner();, which would be the controller that owns the player state.

#

i'm not sure if BP has an equivalent

empty axle
green delta
#

player state is owned by the controller? I thought it was the game mode.

green delta
fading birch
#

Player state is owned by AController. The server spawns one from the game mode.

fading birch
green delta
#

rock paper scissors online proves to be more challenging than what i thought πŸ˜„

woven sinew
#

Anyone managed to use their steam app id in PIE ?

fluid summit
#

@thin stratus i'm gonna end using mysql with VaRest and read all the userinfo when the clients logsin, and save it all when the players logouts.
If for some reason some other player requieres that player data, i'll check if it's online and update it in that moment.

that way i can save a lot of data transfer and i avoid using a live connection.

The mondoDB approach seems like a overkill for some prototype like this, but it looks quite interesting. i'll look later on how to implement a mondoDB and use KAFKA integrated with UE4 for a live connection and datastream

thin stratus
#

Sure. Wasn't sure if you have any things that need a live update

fading birch
thin stratus
#

E.g. a friend invite being sent which would update a collection of invites, and thus needs to update the UI

cosmic trail
#

Does anyone have a cheat sheet of interview questions to ask someone for a multiplayer engineering role?

fading birch
rich cradle
#
void UCustomMovementComponent::OnMovementModeChanged(EMovementMode PreviousMovementMode, uint8 PreviousCustomMode)
{
    Super::OnMovementModeChanged(PreviousMovementMode, PreviousCustomMode);

    // Landings
    if (MovementMode == MOVE_Walking && PreviousMovementMode == MOVE_Falling)
    {
        if (GetNetMode() == NM_DedicatedServer) // Sometimes gets called when jumping with output saying MovementMode = Waling and PreviousMode is equal to falling. How is that even possible?
        {
            GEngine->AddOnScreenDebugMessage(50, 1.f, FColor::Red, FString::Printf(TEXT("Previous: %s"), *UEnum::GetValueAsString(PreviousMovementMode)));
            GEngine->AddOnScreenDebugMessage(51, 1.f, FColor::Red, FString::Printf(TEXT("Current: %s"), *UEnum::GetValueAsString(MovementMode)));
        }
    }
}```
Any ideas on the above? This code works 100% of the time on the client but 40% of the time or so the server seems to think that a jump is actually a landing. It makes no sense, how does the if even get triggered on the server. 
*(I gotta go to the shop quickly, but I will just leave this here and check back in 10min)*
faint hemlock
vocal quail
#

Anyone who has a pointer about the best way to handle gunshot hit location on the player mesh? I would like to implement a more detailed damage system depending on where the player or AI got hit.

fading birch
#

you can use a physmat, and just check against that.

#

you would just need to set a physmat for each of the body parts you want to display.

vocal quail
#

Wouldnt that give me the same results as hit bone? Not sure if hit bone returns the location if hit is in the connected mesh to the hit bone

green delta
#

alright so this is a pickle of sorts.
I am playing rock paper scissors and set it up as multiplayer (local) for now.

So I got player A (auth) and player B (rem).
My MP functions work as such:
Widget button choice -> PC X -> GM -> PC Y -> Widget Y updates
And these are the base functions for the replication in the player controller:

#

and in the game mode, I use this:

#

In the current setup, ONLY Auth manages to get the data to Rem

#

But Rem fails completely

#

if adding print strings, the remote part doesn't fire at all

#

I'm wondering if i missed something simple

#

huh... turns out my get game mode and cast fails when assigning my player's choice on remote.
Does remote not see the game mode?

#

damn it eXi!

green delta
#

Alright i am out of ideas. So the client cannot see the game mode but the game mode can track the other players.
So i need to make the client talk to the server to get that data.
How??

rapid bronze
#

Depends on what you're trying to achieve

smoky wing
#

hi everybody , i wonder .what is the difference between EOS and online subsystem ?

green delta
#

@rapid bronze i want data to be sent to only opponents not self. I need the player controllers but only server has game mode with that info.

rapid bronze
#

There's PlayerState to share data between players, atleast access it

#

And it really depends on what type of data

green delta
#

Hm...

hollow eagle
#

You cannot send data from one client directly to another regardless.

green delta
#

Ok so how about this
Log in
Server has access to game mode.
Client logs in.
Server asks game mode to update player profile
Game mode updates all game states
All player controllers access game state data?

hollow eagle
#

Game state and player state are accessible everywhere.

green delta
#

Whatbthe heck is a player state!?

hollow eagle
#

I suggest reading through the common classes section of the network compendium.

uncut atlas
#

Hi, can a TArray of custom structs be replicated? If so, can it also be replicated using RepNotify?

lost inlet
#

yes

#

TArray is supported, TMap and TSet aren't

uncut atlas
lost inlet
#

all members of a struct are implicitly replicated

#

if they're UPROPERTY

#

you can specify NotReplicated for stuff you do want to skip replication on but be UPROPERTY'd

lost inlet
#

I didn't know either until someone mentioned it here the other week

gleaming vector
#

i've found that FFastArraySerializer is far better at replicating arrays than normal Replicated TArrays

#

the comment in NetSerialization.h goes over why it's better and how to use it

#

highly recommended

#

I don't replicate TArrays anymore once I figured out FastArraySerializer

#

still, you can't replicate TMaps or TSets without custom netserializers

#

which i've done before, extremely not recommended tho

#

there is a reason Epic never wrote that code and you figure out pretty quick when trying to figure out how to replicate a map's keys

#

and sometimes replicating the key changes it's hash!

eternal canyon
#

this shows some of the stuff you can do

#

with FFastSerializer

lost inlet
#

What’s with the tag

eternal canyon
#

oh i meant it as a response

#

as roy awesome was talking about them and i just realized that he wasnt actually in the conversation

#

my bad

meager wing
#

Been thinking about a project im working on. I just realized I have no reason to care about cheating (it's a 4 player co-op party game)

eternal canyon
#

lol

meager wing
#

Been over-designing everything to try and prevent cheating, but like

#

who tf cares

#

this is my first time learning a lot of this so making it more complicated than it needs to be isn't helping the learning process lol

#

On that note, there are a lot of videos talking about specific classes and nodes and some follow-along tutorials in the pinned messages. But does anyone know of any good sources for learning about the general design of multiplayer features. I'm at that point where I mostly "get" all the constituent parts, and can make simple standalone features replicate over a network, but am yet to make that final step to really "getting it"

#

may just need a bunch of practice, always of course.

#

kinda the shit at the whole planning it all out part, even aside from multiplayer.

peak sentinel
#

I copied this lines of code exactly from UT's source code and PostNetReceiveLocationAndRotation() throws stack overflow error which is kinda irrelevant. Anyone implemented UT's method before got the same error too?

    if (bMoveFakeToReplicatedPos)
    {
        AssignedFakeProjectile->GetReplicatedMovement_Mutable().Location = GetActorLocation();
        AssignedFakeProjectile->GetReplicatedMovement_Mutable().Rotation = GetActorRotation();
        AssignedFakeProjectile->PostNetReceiveLocationAndRotation();
    }
fossil spoke
peak sentinel
#

Normally if this is equal to fakeprojectile it should never run that code

uncut atlas
twin juniper
#

Is it possible to use bots (with simulated connections) to stress test a game's networking?

sinful marlin
#

Idk if this is the appropriate channel, but is anyone here familiar with using aws sdk's inside of Unreal?

peak sentinel
#

I had some little differences with UT's version since instead of spawning projectiles, I'm using an object-pooled system so at the beginning I thought that stackoverflow issue is my mistake

#

But now after debugging I'm realizing its very accurate that I'm seeing an stackoverflow issue

#

Am I missing something or BeginProjectileSynch should be called on server?

#

On UTProjectile.cpp's beginplay its called if ROLE_Authority is false

fossil spoke
uncut atlas
#

The FFastArraySerializer instructions says use MarkItemDirty for changed items and MarkArrayDirty for removed items. What about adding items? Is that automatic? If I call SetNum(3) on the array will it automatically replicate the added elements?

fossil spoke
#

Adding is a change.

uncut atlas
#

So I would have to call MarkArrayDirty or MarkItemDirty?

fossil spoke
#

No, MarkItemDirty

uncut atlas
#

Ok thanks!

fossil spoke
#
/** This must be called if you add or change an item in the array */
void MarkItemDirty(FFastArraySerializerItem & Item)
{
#
/** This must be called if you just remove something from the array */
void MarkArrayDirty()
{
#

Always check the source if your not sure about something.

#

Source is gospel πŸ˜›

peak sentinel
#

Just asking for curiosity though, UT method is solid

fossil spoke
#

Alternative to UT? Not sure, Id say they will all share similarities.

#

Predicting everything has major drawbacks which become apparent after you attempt to Predict everything.

#

Then you usually realize that its easier and more performant to simply trust the client more and do server side verification instead.

#

For the most part the result is the same.

peak sentinel
#

Yes, I agree with you

fading birch
#

less prone to lag issues that way too

fossil spoke
#

Players generally care more about actions being immediately responsive.

#

Not so much that damage/health was updated/caused a few frames late etc.

peak sentinel
#

I'm only using predicted spawning for my bullet projectiles since my project is very strict with projectile movement components

#

Kind of a bullet-hell game

fading birch
#

there's a good GDC talk on how overwatch does it.

peak sentinel
#

Hmm, I actually remember that, but I watched that on my very beginner days, I need to watch it again to understand

#

Thanks for reminding

fossil spoke
#

I heard that OW grenades arent predicted at all, Players dont even notice that the grenade itself is spawned a few frames late because of lag, the only thing that matters is that the action of throwing the grenade is immediate.

#

So the Player has the feeling of responsiveness.

fading birch
#

umm

#

grenades?

#

what OW are you playing?

fossil spoke
#

I dunno man, like i said, i heard.

fading birch
#

xD

#

OW doesn't have grenades

fossil spoke
#

Like flash bangs or something

fading birch
#

like at all

fossil spoke
#

Throwables

#

🀷

fading birch
#

ah ok

fossil spoke
#

I dont play it lol

fading birch
#

xD

#

It is pretty instant

#

however, a common problem is a no reg

#

where the server just says, nope you didn't actually do that.

#

happens with everything in the game

fossil spoke
#

Yeah well thats the downside i guess.

fading birch
#

yeah

fossil spoke
#

Its a good choice for matchmaking games, since you can (for the most part) always ensure a player has the best connection to the server.

fading birch
#

mmhmm

#

well, ish

#

OW complicates matters with SR in comp games

#

I've seen a lot of people play on 200+ ping

#

their shots are instant but there's a noticeable delay in confirming a kill.

fossil spoke
#

Obviously you cant always ensure that, given whether you expose the choice for players to change regions etc

fading birch
#

It's not even about region

#

there's only 2 servers in NA iirc

fossil spoke
#

But by default your casual audience will be on servers they have a good connection to.

fading birch
#

west coast and east coast

#

EU only has 1 iirc

#

oh yeah

#

Blizzard games in general separate out by regions from the get go.

#

Granted, you could bypass that if you were using flexmatch on gamelift or something

#

But that leads to some weird occasions too

#

if your scaling rules aren't set to keep up fast enough

fossil spoke
#

I think "no reg" is better than being hit behind cover like what plagues BattleField games for example.

peak sentinel
#

What is "no reg"?

fading birch
#

that happens in almost every game

#

non registered hit

#

basically you clicked the head, but the server says you didn't

fossil spoke
#

Yeah but its by far most notable in BF in my experience.

fading birch
#

it was way more noticble in COD for me

#

granted, i'm not a huge BF fan

fossil spoke
#

I havent played CoD since BlackOps

#

But i remember BF went full retard into hyper prediction lol

peak sentinel
#

COD uses listen server model sometimes and you see a lot of errors with the projectile logic

#

Since connection is not always good

#

It blows up

fading birch
#

does it still use Listen Servers?

#

i thought they abandoned that

peak sentinel
#

latest CODMW was using it

fading birch
#

ofc it is

#

I don't think the BR is though

#

a listen server couldn't handle all that madness

peak sentinel
#

Ah.. Warzone is quite good about network architecture

fading birch
peak sentinel
#

I never encountered the connection issues I've had with the other COD games there

fading birch
#

I was clearly around a corner on my screen, wasn't in the kill cam.

fossil spoke
#

They went P2P in MW2 from what i remember.

#

Could be wrong.

#

Pretty sure the "Host" was just designated for authority over the GameState.

fading birch
#

Yeah, the days of red bar ping haunt me

#

and the never ending "finding better host"

fossil spoke
#

Probably saved them a boatload of money though.

fading birch
#

oh definitely

#

CS:GO uses dedicated servers right?

peak sentinel
#

Yep

fossil spoke
#

🀷

fading birch
#

I looked into the costs of those once

#

running 20 servers per fleet instance on aws gamelift

#

and their average player count

#

was something like $30k a month to host on AWS lol

#

assuming 24/7 uptime of full load

fossil spoke
#

They would have a custom contract though as well.

#

If that was to happen

fading birch
#

they have their own servers

#

but yeah

#

like they have bare metals

#

which is def preferred

fossil spoke
#

There is risk to both methods, especially for indies.

#

I really like old school browsers lol

fading birch
#

same

#

much easier to program

rough kestrel
#

so I have this issue in multiplayer where if a player leaves for the main menu, the server detects the disconnect but when I directly quit the app, it does not and the pawn stays there. Any way to work around this?

fossil spoke
#

Which in turn should remove the pawn.

mossy kindle
#

Anyone knows why this might be happening?

#

Ded custom event

fossil spoke
#

@mossy kindle These screenshots are way way to small to even read.

mossy kindle
#

Oh wait i'll resend it

#

Here is the dying logic

#

This is where dying is checked and called

#

And here the HUD reference is being set

#

But when the player respawns, it gives an error about removing the widget crosshair and the HUD

#

In short, I need a way to remove the HUD

rough kestrel
pure mango
#

I have a sphere collision that will print the name of the actor that overlaps it
But when the player on the Server touches it, both the Server and Client prints this, which is incorrect
CustomCharacter011 is nowhere near the sphere collision. Only CustomCharacter01 touched it.
Why is this?

rough kestrel
thin stratus
pure mango
#

Okay, here's a test..
I don't know how to differentiate between the two players, so instead I print out the player rotation
On the server, I walk towards the sphere collision from left to right
On the client, the player is facing straight
So it looks like the issue is like what @rough kestrel stated, that:
On Server: player1=CustomCharacter01 and player2=CustomCharacter011
On Server: player1=CustomCharacter011 and player2=CustomCharacter01
That's pretty confusing

pure mango
rough kestrel
#

that id why you never use actors name to refer to the player. Grab its player state which is replicated on server and client keeping the player data for the session.

Actors are adsigned random names on spawn. As for not wanting the overlap to work on client, you could do a switch has authority so it only works on server allowing you to do consistent multicasts

fading birch
#

the name isn't random, it's procedural. It's basically the number that it was spawned. Until you destroy Actor_1, then the next actor that spawns will become Actor_1

pure mango
uncut atlas
#

Can u declare a delegate in structs or only classes?

rough kestrel
# pure mango Which variable from player state is best used to differentiate between players?

https://youtu.be/unKEXM_IE6Y

you could declare custom variables in player state which are assigned by the game mode. Set the variable replication to repnotify.

You can get the reference of player state from any pawn if it has one.

Check out this video to understand the networking classes first.

What I did was assign an int id via game mode on the pawn itself (pretty sure that was a bad approach tho)

Hello guys, in this video I will explain the GameMode Class, GameState Class, PlayerState Class, and Player Controller Class within Unreal Engine 4. I will explain the practical uses of these classes and how you can implement them in your multiplayer game. To move forward, you must understand what role each of these classes play in your multipla...

β–Ά Play video
thin stratus
#

To identify the player uniquely your only proper way is to use the UniqueNetId which is only accessible via C++

rough kestrel
kindred widget
#

@rough kestrel The general reason for that is because often players need to be distinguished via their Subsystem account. For instance your EpicGames account in EOS games, or SteamID in SteamGames.

mossy kindle
#

How can i destroy the gun actor?

#

When player dies it leaves the gun hanging in the air and respawns with a new one

#

It is being spawned and attached on begin play

modern cipher
mossy kindle
#

Tried

#

Didnt work

#

For the server it destroyed the gun but for clients the gun was still there

modern cipher
#

is the gun actor replicated? make sure Replicates is checked

mossy kindle
#

yes its erplicated

#

replicated*

modern cipher
#

I don't see a reason why it shouldn't work if you destroy the actor on death event from the server

#

show code how you doing it

mossy kindle
#

Ok

kindred widget
#

Most often the cause of that is because you're spawning the gun on all machines and it just looks like there's only one.

mossy kindle
#

its spawned on the server

#

Wait

#

I Fixed it!

#

Thank you