#multiplayer

1 messages · Page 68 of 1

thin stratus
#

Hence why Epic went the other direction and used the movement data to anticipate where a character should stop and then blend to other anims but still using the CMC to move the character

#

There are some dev blogs about Paragon showing that

#

I never developed a system like this but I heard lots of the stuff they made to get that to work is in the engine. Basically that motion matching or whatever the call it. They showed that partially off with the ue5 demo.

quiet fjord
#

ready I did it with the root motion in the blend space hahaha

#

and replicated

#

there is actually a trick to make it super easy

thin stratus
#

Glad to hear it's possible without much work. I wouldn't know how out of the box but there is a lot of stuff hidden in the engine

quiet fjord
#

I actually cheated the engine

#

I made a mirror and that animation replicated me in real time to everything except the blend space actor

still path
#

I’m working on a 2d game with rather small actors (pixel art imported small so I went with it). Everything seems to work fine but I noticed replication can be a little off at times. I assume this is because of my small scale (player is 10 units wide). I am considering making everything bigger with the hopes that these small in-accuracies won’t be noticeable at larger scales. Is this a valid thought process or am I about to waste a few hours?

prisma snow
#

Maybe the jerkiness is due to packet loss or lag or client/server disagreeing about some state

winged badger
#

ensures only ever happen once per application start

still path
prisma snow
#

are you using any of the built in replication (character movement component for example) or is it all custom?

still path
# prisma snow mmm that should make no difference, although I'd personally would keep replicati...

I initially started with the built in stuff but eventually moved to a hybrid of smooth-sync and my custom vector updates. While not on a platform they are just free floating with physics and thrust. During this they use smooth-sync which works perfectly. When on a platform it is just a relative vector replicated. Every tick that position is read and the player is moved.

Platforms use the same smooth-sync settings the player pawn does when free floating.

No character movement component or anything. All custom.

#

I can send a demo if you’d like to see what’s going on

rocky kestrel
#

This is when you stay in helikopter little longer and exit. it spawns player to player start and creates new ui top of old one. Like calling player beginplay. Why this could happen?

#

single player it works

#

This I mean creates new ui also. That ui is created in player beginplay.

ebon hinge
#

guys i need help really bad. i cant get the client to play a gunshot sound without also hearing the multicast gunshot sound. this is my setup

#

if i only play the multicast, the gunshot sound is delayed by a number equal to my ping

#

i cant have a delayed gunshot on left click it feels so bad

worthy wasp
#

I need to trigger overlap events locally for visual effects (item highlighter) - using this BoxComponent i've attached to a 3rdPerson Template project character class - on the follow cam...

While the box (hiddenInGame=false) visibly shows that it is moving with the camera spin (mouse event) - when i play 2player it definitely doesnt move (i expected this... its local translations)

How can i get this overlap event to trigger just locally? When I use the CharacterMovementComponent and make the box overlap the objects in the scene - my overlap event happens no problem... telling me its an auth issue?

#

i have 0 need to make this replicated function to spin the mesh - unless maybe i just change it to repmode client-only .... maybe?

worthy wasp
#

Maybe perhaps is primitivecomponent::onbeginoverlap() a replicated funct?

winged badger
#

overlaps are local only, always

#

so only networking problem you might have there is that the components are not in same position on client/server

rocky kestrel
#

Singleplayer mode this doesn't happen. Weird

rocky kestrel
#

Fixed it was because set actor hidden in game. I don't know Why it deletes actor in server but removing that node now it works.

ebon hinge
#

i think

#

no way to test the actual multicast on another client

fossil spoke
#

Is it absolutely necessary that a Player who wants to Host a Listen Server have the level open with ?listen before they Create a Session?

#

Or can the Session be created first and then immediately moved to the Listen Server level?

worthy wasp
#

this was tested as both listenserver and client playtypes

drifting heath
#

So players outside the render/relevancy range of an entity do not receive the multicast for that actor, and when the player comes into range, they get the update.. Correct?

So for example, if a player is outside of a chest's range when the inventory is changed they will NOT get the update, and then they enter range, when they open the chest, they'll have the latest copy of the contents?

#

Basically I'm trying to avoid players having to receive inventory updates when they're not near the actor, to save bandwith/etc... But if three players all have the same chest open they all need to see the contents in real time, so ownership won't work here.

coarse patrol
#

can someone answer this?

drifting heath
coarse patrol
#

can u pls give me a idea how can i solve this ?
how to replicate movement in client then
is there any other function i can use

drifting heath
#

Just use SetActorLocation on the server, on the one you're trying to move

#

As long as the actor replicates, it'll replicate the movement

coarse patrol
#

i am using it in server

this is the code in player controller and i am calling it in widget since i am using drag operation

UFUNCTION(Server, Reliable, WithValidation)
    void DragCharacterInServer(FVector HitResultLocation);
bool DragCharacterInServer_Validate(FVector HitResultLocation);
void DragCharacterInServer_Implementation(FVector HitResultLocation);

.cpp
void AMultiPlayerController::DragCharacterInServer_Implementation(FVector HitResultLocation)
{
if (CharRef)
{
CharRef->SetActorLocation(FVector(HitResultLocation.X, HitResultLocation.Y, HitResultLocation.Z + 100), true);

}

}

void AMultiPlayerController::ImplDragCharacterInServer(FVector HitResultLocation)
{

if (!HasAuthority())
{
    DragCharacterInServer_Implementation(HitResultLocation);
 //on the client 
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Has no authrity ")));

}
else
{
 //on the server
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Has authrity ")));  //this is executing
CharRef->SetActorLocation(FVector(HitResultLocation.X, HitResultLocation.Y, HitResultLocation.Z + 100), false);
}

}

worthy wasp
coarse patrol
abstract pike
#

@fathom aspen I'm not sure if i'm just missing it but is there anywhere in your compendium that talks about how/when previous level playercontrollers are destroyed after a seamless travel?

winged badger
thin stratus
#

Hm, I got a question about how one would solve this gracefully. I have a GameplayAbility that runs predictively on Server and Client.
The Ability spawns a Replicated Actor with a Spline. I spawn this on BOTH Server and Predicting Client.
The Actor isn't needed to actually replicate anything and only shows a drawn Spline path, so it's mainly replicated for Simulated Clients and the owning Client has a local copy to predict drawing instantly.

Now this all works so far. Now once drawing is over, a Projectile will be spawned that follows the path. That Projectile, in all other cases, is not coded to support prediction (yet, but no time to change this atm).
The Spline Path should fade out when the Projectile gets destroyed or reaches the end. That is also working.

The problem I'm facing is that since the Projectile is only spawned on the Server, the local copy of the Spline Path for the owning Client has no way of getting a ref to that to listen for being destroyed.

I thought about spawning a local copy of the Projectile too and just hiding it, but i'm a bit afraid of any side effects, because the projectile isn't meant to be predictable at this point.

I heard that I could spawn Actors locally that automatically sync up with the Server version and don't create a second copy, but I have no example of that.
I would spawn the Spline Actor with that, so that the Server later can set the projectile ref on that ONE Actor.

#

Currently solving it via this:

#

The boolean is set on the Actor when spawning it with IsLocallyControlled. First time I actually use the SwitchHasAuthority node to check for a local client having auth :D

#

Probably don't even need that since the boolean doesn't replicate to anyone but Server and owning Client on the local copy I guess

#

Maybe my fear for side effects is unjustified. I will keep it like this for now. But still happy to discuss cleaner solutions

foggy idol
#

Whats the best way to handle automatic guns

#

do I just start shooting then send info to the server every shot ?

latent heart
#

I doubt you need to notify the srever every time you shoot.

#

Just the start/stop event.

foggy idol
#

and if so then what do I do when firerates increase ? or am I just trying to optimize bandwidth prematurely

foggy idol
latent heart
#

The server should be handling shooting the actual bullets.

#

You're constnatly telling the server where you're looking?

foggy idol
#

the idea is for the client to shoot first then tell the server to shoot

#

to make it seem as though the client has no latency in his shot

#

then the server would decide on damage and all that stuff

latent heart
#

Nobody said you couldn't do that as well.

foggy idol
#

wait so then my options are to tell the server where I am shooting at with an rpc each shot

#

or replicate look direction ?

latent heart
#

You can't "replicate" look direction.

foggy idol
latent heart
#

That either.

foggy idol
#

bruh

latent heart
#

You'd have to use an rpc.

foggy idol
#

so then each shot would send a server rpc with look dir for the shot ?

latent heart
#

So are you not telling the server where you're looking already?

foggy idol
#

you just said I cant do that

#

as to do that I would have to replicate my look rotation

latent heart
#

No, I said you can't use replication.

foggy idol
#

or derive it from base aim rotation

latent heart
#

Replication is one way, server to client.

foggy idol
#

maybe its my use of the world replication

#

as I can use an rpc from the client to tell the server where I am looking

latent heart
#

That R doesn't stand for replicate/replication. 😛

#

Yeah, it's a terminology thing.

#

If you say you're going to replicate something to the server, you might very well mean you're just going to put Replicated in your UPROPERTY and expected it to work.

foggy idol
#

but that would essentially yeild the same result as sending where I am looking at each time I shoot

foggy idol
latent heart
#

But, I mean, do you not want other players to know where you're looking? Or maybe you update look direction slower in other circumstances?

foggy idol
#

I can derive that using base aim rotation

#

but idk how that is handled and at the moment when i fire the rotation may be innacurate

latent heart
#

Give it a try. See what happens.

#

If you send a Reliable RPC to the server, it still may be inaccurate.

#

If the RPC fails, it will have to resend it and all kinds of things might bog it down.

foggy idol
#

It cant be unless precision is lost over the network

latent heart
#

It's not about precision, it's about the lag between sending and receiving.

foggy idol
latent heart
#

Plus if you send an rpc every time you shoot, and you expect the server to just take your word for it, it might lead to some speed hacking exploits. You speed your fire rate up by 10% and the server might just think that's within acceptable limits.

latent heart
#

There's no harm (I guess) in rapidly sending your view direction, though.

foggy idol
#

if I send a shot time each rpc I can measure the difference in shot times with the guns fire-rate

foggy idol
#

I just wanted to know if there was some way to do it without rapid rpcs

latent heart
foggy idol
latent heart
#

It doesn't matter what the client's time is.

foggy idol
#

or some time I sync up once the client joins

latent heart
#

In fact, the client doesn't matter whatsoever

#

It's all about the time the packets arrive at the server.

#

Which will not be consistently spread out at the smae rate as your gun firing.

#

If one packet arrives a millisecond late, the next shot might not go off because it arrived on time and, oh wait, it's too soon to fire, let's drop that shot.

foggy idol
latent heart
#

No. I'm talking about inconsistent network latency.

foggy idol
#

between the client and server ?

#

like the latency causing the server to not fire at each x interval and instead fire at each x+-latency interval ?

latent heart
#

Yes. That's part of it. But also, as I mentioned before, you might find clients are cheating and firing too quickly, even by a small amount, and you have to watch for that with your system, which means legitimate shots may be dropped because they hit some cheat detection.

#

Fire the actual shots on the server with the server's own timer. Simulate those shots on the client, with the client's timer. Send your view direction often so the server fires the right way.

#

Or even do some backtracking when you receive view directions on the server. Go back a few milliseconds to make sure you fired the right direction at the right time.

foggy idol
#

bruh

latent heart
#

Maybe I'm just wrong. Shrug

foggy idol
#

nah

#

its just a lot

#

tho I get why tho

latent heart
#

It depends how competitive you want your game to be.

#

If it's just a fun shooter that isn't going to be the next valorant, your system is probably fine.

foggy idol
#

makes me wonder how lyra and stuff do it , since all the WaitForXData tasks are just "Wait for client to tell us what to do" nodes

#

but I guess you're right

#

depends on how competitive you want to get

#

might see if there is some valorant talk about how they do it

latent heart
#

I'm quite sure games like that will have very complicated systems 😛

hexed pewter
#

When designing a multiplayer RTS game in unreal is switching to deterministic lockstep a must? If not what are the alternatives/optimizations - I presume UE's state synchronization is not ideal for this type of games, correct?

I would appreciate insight on how much work it would take to design and implement a deterministic lockstep in context of UE game. Asking this questions obviously hints that I'm completely new to this, so if it is too big of a challange maybe there are some smaller steps one could take to learn?

prisma snow
#

quite a nightmare

#

it is possible just not easy

hexed pewter
prisma snow
#

There are no shortcuts for lockstep, it is really a tricky system

#

But there are way simpler ways to make an RTS nowadays and depending on the unit count and other factors it might be relatively straightforward

hexed pewter
#

How about attempting to optimize what unreal has out of the box, is this valid for RTS?

hexed pewter
ebon hinge
#

if i use a 'Run On Owning Client' to set certain variables from the server to the client, is that susceptible to hackers changing things client sided?

#

it seem to be the only way i can transfer variables from the server to the client

gentle mauve
ebon hinge
gentle mauve
ebon hinge
#

i have a very surface level understanding of replication haha

wooden abyss
#

Hey, I got a quick question. My game can be player solo and in a coop session. I want to have different UI elements shown depending on if it is being played singleplayer or in coop-multiplayer. I'm using the Advanced Sessions plugin. Is there an easy way to check if the game is being played in singleplayer or multiplayer mode? I know I could just save a flag somewhere but I was wondering if there is maybe something already built-in?

quasi tide
#

Check net mode.

#

GetNetMode() == NM_Standalone

latent heart
#

I used to have a load of macros for that. Was glorious.

#

Why I used macros? Who knows...

latent heart
#

Reasons.

#

😛

prisma snow
hexed pewter
prisma snow
#

I suspect we can go up to 2k units and 8 players but didn't confirm it yet

#

I recommend Glenn Fiedler's articles on multiplayer physics to get an idea of the existing approaches, pros and cons to each way to sync movement and positions

#

It doesn't go in depth but it's a good general overview

cold moat
#

uh

#

little help

#

im spawning a projectile on the server

#

its components are not set to replicate

#

yet they exist on the client

#

what gives

hexed pewter
prisma snow
prisma snow
crystal palm
#

Hi
I have made a pawn movement system
That is when you rotate camera you can go forward the direction of forward of Camera
But I have a problem
In multyplayer when camera moved direction don't change and its like 2d movement
Haw can I fix it?

cold moat
prisma snow
cold moat
#

like, "if has authority -> tell server to spawn the projectile there -> stripped down projectile replicates down to clients"

prisma snow
#

yeah I think that sounds right

cold moat
#

huh, how does it work so weird right now for auth proxy though?

#

just so i get it better

prisma snow
#

no idea, never used auth proxy

cold moat
#

it spawns locally, but if i turn of replication it does not get the proper velocity

prisma snow
#

the character movement component?

cold moat
#

its projectile movement component

prisma snow
#

ahhh

#

well I assume that if you intend to use it in multiplayer you need to set it to replicate

cold moat
#

im super confused now
if im on a client instance with replication disabled, the projectile spawns and falls down to the ground
but with replication enabled how does it know to link with the server version?

prisma snow
#

why confused?

cold moat
#

like, everything that gives the projectile initial velocity should work on the client projectile

prisma snow
#

the correct or usual way to use this kind of components, if it is like the CMC, is to spawn in the server version of the actor and set it to replicate

#

if you spawn only on client or client + server, it won't work as expected (and maybe the behaviour is random, undefined or just wrong)

cold moat
#

Ugh i must run

#

Yeah I thought it was getting spawned on the server only, but the ability that spawns it is a bit weird

wooden abyss
quasi tide
#

Maybe there is a simple function to check "Is Standalone"

#

I don't know.

latent heart
#

Check the netmode

#

Oh, is that not in bp?

quasi tide
#

Yeah, that's what I told them to do originally

#

Overall, knowing at least a little amount of C++ will open the door wide open for you in UE. Can easily just make simple BlueprintFunctionLibraries to expose more stuff.

wooden abyss
#

Well I'm not shy of using c++ but I'm still mostly working with BP

#

Was just wondering if there was an alternative

quasi tide
#

NetMode is the way to check.

wooden abyss
#

Advanced Session Plugins has GetSessionState

#

And it has NoSession which might work

quasi tide
#

Could also store a bool in your GameInstance. Then when creating/joining a session, flip that to true. When not in a session, flip it to false. bIsMultiplayer

wooden abyss
#

Yeah I had that as a backup but wanted to see if there was something built-in already i could use

#

Guess I will play around with GetSessionState and see if that works. Otherwise I will just go with some c++ i guess 😅

#

Thank you guys!

kindred widget
#

@wooden abyss IsStandalone will work fine for your issue. You cannot be in Standalone mode while hosting or joining a host. As hosts can only be DedicatedServer or Server, and joiners are always Client.

tall swift
#

Im getting this, any ideas what could i do to check what property is it failing on?

placid flame
#

and how can I replicate it from there?, especially considering late joined clients, and I also need to set a widget component with the name, so should I put all the logic in the game mode?

strong pond
#

Anyone yet to find a fix on this thing right here :DD. Been at it for about 2 weeks and cannot for the life of me find the solution

#

It works perfectly fine in ue4

unkempt yarrow
#

Hey! Anyone have a nice howto in regards to testing a multiplayer game with a dedicated server? Lets say I want to connect 32 clients to that server, just to see if it works and do some measurements

placid flame
thin stratus
#

Which is why it might be desired to use that instead of adding a second name variable

placid flame
thin stratus
#

Usually yes

placid flame
#

alright, thanks, I would try it

wooden abyss
#

Thats nice. Thanks @kindred widget

unkempt yarrow
# placid flame well the server system is pretty much, have a server build that opens a map as a...

Yeah, well of course. The basic knowledge is no issue. The issue is that I'm 1 person wanting to connect with 32 clients (all signed in on different accounts) without having to create a lot of different accounts for this, but I get that this might be the only way. Thing is that we're using EOS service for sessions and that won't work if I'm connecting 32 clients on the same account..
Any testing framework out there worth mentioning when it comes to this kind of testing?

placid flame
fathom aspen
#
  1. Both should work.
  2. Make a copy of the old array and pass it to the OnRep
fathom aspen
cold moat
#

Uh, how does visual studio debugging work when I'm running in listen server mode with 2 players? Is it aware of the client game instance?

prisma snow
wooden abyss
#

Hello, I would like to know how I could make an RPC from client to server that tells the server some information it should save in the playerstate of the client that called the RPC. I have the Level of the Player saved in its savegame but I want it to show in the playerlist on other clients as well. So I tried to send it to the server with an RPC. Now how can the Gamemode(Server) know who this information should be updated on?

#

So the client should tell the server to update its playerstate so other clients can know its level as well

cold moat
#

uh

#

huge grain of salt, but wouldnt it basically expose you to cheating?

wooden abyss
#

Yes it would but i'm fine with it

#

It's a singleplayer game with coop features

#

If someone has fun cheating he/she can do it

#

I'm trying to do all the rewarding/etc server side so cheating would only really effect the client that is cheating

#

Like getting more experience

quasi tide
#

Is this supposed to be displayed in the browser list? Or only when you actually connect?

wooden abyss
#

Only when already connected to the session

quasi tide
#

When the client connects, load the save game. Then just do a server RPC to the server to update the level. Then use UE's standard replication stuff

wooden abyss
#

This is basically what I tried

cold moat
#

i might be talking out of my ass, but, when you call an RPC from a client object instance it will run the code on the server object instance

wooden abyss
#

This is inside the controller

cold moat
#

uh

quasi tide
#

It's how I handle clothing for example.

cold moat
#

isnt the problem that the controller does not exist on the server?

wooden abyss
#

Ok so sending the client-side replicated playerstate to the server should make it so the client handles the correct server-side playerstate? And after replication the client will get the correct updated playerstate?

prisma snow
prisma snow
quasi tide
#

Client joins and is given the playerstate and all that jazz
Then do a server rpc to update the client's level.
Update it on the server side, having the player level as a replicated variable.

cold moat
#

i think thats the problem?
you need to put the code in different object?

quasi tide
#

You send the values, not the entire playerstate

cold moat
#

like, auth proxy calls the rpc and the object has to have actual authority on the server?
or am i wrong

wooden abyss
#

Like which playerstate to update

quasi tide
#

Because you're sending it to the server's version of that instance

cold moat
#

network coding deals mental damage to me

wooden abyss
cold moat
#

LogTemp: Error: ROLE_Authority
LogTemp: Error: ROLE_SimulatedProxy

#

okay, wtf is going on

#

no, nvm

#

i am

quasi tide
#

When the server creates an object to be replicated down to the client, it gives it an id for the network. When the client then tries to do a server rpc, it uses that id to know which object to call it on. (Obviously more stuff happens than that, but this is the super birds eye view of what happens)

cold moat
#

incredibly confused

dark edge
#

You have to own an actor to RPC through it. That doesn't mean you have authority locally or anything

prisma snow
#

what does authority mean then, in this context?

#

I though it was tied to ownership, at least in most cases

quasi tide
#

The simple way I always think of authority is "what machine spawned this thing"

#

(I know technically all machines "spawn" it, but you know what I mean)

#

Which machine is the "host" of this actor 🤣

cold moat
#

stupid question, but how is this ID called?

latent heart
#

Hostname? Computer name?

cold moat
#

i mean, what function will return it, i literally forgot and cant google it out lol

cold moat
#

LogTemp: Error: 赈礅뗜쌀쳌쳌쳌쳌譈䣄䢉唈噓䅗䡖梍䢘ŀ

#

hm.

#

😄

wooden abyss
#

Well it did hurt my head but I got it working

#

Thank you very much!

cold moat
wooden abyss
#

Basically what I did before but I didnt try to send the PlayerState to the Gamemode and let that handle it

#

I just changed the level in the playerstate after sending it to the server

#

And I got the PlayerState from the controller on the client

#

Not sending the controller ref to the server and then trying to get the playerstate

cold moat
#

can someone help me with UProjectileMovementComponent

#

how do i actually make it work for networked game?

#

i cant stop it from replicating with my projectile actor

#

and the simulated proxy instance literally is fighting the authority instance making the movement all jittery

#

i guess the UProjectileMovementComponent gets spawned anyway since its a default object in c++ constructor

#

but, how do i make it work right then?

crystal palm
#

does anyone know how to replicate players control rotation to server?

prisma snow
cold moat
#

the simulated proxy instance does not get initial velocity

#

so it just falls to the ground

prisma snow
#

look, it won't ever work if you just do weird stuff

#

If it is a multiplayer game just set it to replicate

cold moat
#

and if you turn of movement replication, the local instance still has no velocity

#

so each update it moves to new point then just starts falling

#

i have no idea how to not "do weird stuff"

#

there is no documentation on how you are supposed to actually use this in networked setting

#

how do i stop the two instances of it from fighting each other

#

do i just disable simulation on simulated proxy?

#

and use the interpolation part?

prisma snow
#

You're always mentioning how you disable replication which makes no sense if you intend to use the projectile in multiplayer

cold moat
# prisma snow have you tried it with replication enabled at all? I've been asking that all day

yes, i described what happens:
the two instances fight eachother

  • server version gets initial launch velocity and simulates using the projectile movement component (so it flies as it should)
  • client version gets no initial launch velocity and simulates using the projectile movement component (so each net update it gets moved, then does random things because the local projectile movement component insists on trying to simulate it)
    so, the end result on client is the projectile keeps jittering and teleporting
prisma snow
cold moat
#

no, i thought it was replicating, but i just realised it is a part of the c++ constructor, so it gets created either way

prisma snow
#

And in the constructor did you put a check to only spawn on server?

crystal palm
#

HOW TO REPLICATE FUCKING CONTROL MOVEMENT HELP ME!!

cold moat
cold moat
#

this seems to have drastically improved the output

prisma snow
cold moat
#

i dont think you are supposed to have any gameplay code in c++ constructor though

#

unless you mean something else

#

im tired lol

#

and madge

prisma snow
#

This is initialization code

#

you check that the component is only spawned on the server so that the replication works fine

cold moat
#

it gets run even when you start the editor/engine, id have to litter it with about 20 null checks to not crash i think

#

actually, i kind of need it, you can use it for interpolation on the client

#

i think

#

what i do not understand is

latent heart
#

Math?

cold moat
#

why cant epic spend like 0.0000000000000000000000000000000000000000000000000000001% of fortnite money to get documentation

#

no need to be violent :p

latent heart
#

The truth hurts, man.

prisma snow
cold moat
#

hey, i did some vector math over past two days and actually managed to somewhat fake rotation physics for the projectile movement component

prisma snow
#

spawning a component and doing a server check is totally fine

latent heart
#

c++ constructors are for initialising variables, that is it

cold moat
#

i gave up on actually making the math real, the rotational velocity has magic 25 number

#

uh oh

#

false alarm

#

i broke it then i fixed it

faint eagle
#

hello there, have you ever figured out how to solve this issue? I am facing the same thing right now with steam online subsystem - client connects to the session (which I can tell by getting session info from the online subsystem and from the logs) but client doesn't load the listen server's map. idk what to do 🤔

faint eagle
pseudo merlin
#

hey all, I'm working on a coop game where NPCs have automatic weapons that shoot physical projectiles (proc movement comp powered). I'm assuming that spawning replicated projectiles on server is a quick way to eat up too much bandwidth. Is that a correct assumption?

#

I'm considering making NPC shooting logic client side, maybe server just determined desire to shoot but actual shooting is done on clients

steep panther
#

what is the best way to troubleshoot poor multiplayer performance? events that require server input for example are pretty 'laggy' even though overall ping is good

#

i think the rpc buffer is overflowing but not really sure how to check what is causing the overflow / taking up too many of the rpc calls

graceful flame
#

Just have to make sure that the anti-cheat logic for if the variables can change or to what values they're allowed to change to (clamp) happens on the server and not the client so that the server can issue a correction if it needs to.

#

So for example if you hold shift to sprint, the movement speed value change can happen on the client first, then RPC to server so they match. But if a cheating client were to change the value to something extreme the server has to clamp the value before setting it.

#

But that's a bad example because something like sprint would be far better off inside of custom movement component written with c++ as part of a series of saved moves but hopefully you get the idea.

frail barn
#

which Replication Condition should i choose to make Health variable replicates correctly?

abstract pike
#

Yo, has anyone come across this before!??!

LogWorld: Bringing World /Temp/Untitled_1.Untitled up for play

#

_ _
I'm having an issue with the game crashing before finishing a seamless travel and this seems to be a warning sign for sure

quasi tide
#

But if you only want it to go to the player and no one else, you'd use Owner Only.

steep panther
frail barn
quasi tide
#

You're doing something else.

#

Replication conditions are not a requirement.

frail barn
quasi tide
#

You are lacking the fundamentals of networking in UE.

#

You need to understand the server client model

frail barn
prisma snow
frail barn
hushed heart
#

Hello! Quick question, if anyone knows. I'm just looking for best or at least decent practise for the following - I'm working with a listen-server model, and have some information past from an initial map to the main one via the game instance. It's only at that point that clients connect to the host, whereupon they need access to the variable stored in the game instance ideally pre-initialisation. This gave me the idea of having the GameState, on preinit, grab the game instance variable and store it as a replicated property.

But since clients will naturally join later than the host, I suppose the client's game state doesn't attempt to get the server's version on pre-init. Is there a good way to fetch information from the server pre-init, or is it much more sensible to just make the pre-init things more event-based and subscribe to a delegate for when things are ready? Would the game state ever replicate that property to the client, if it isn't changed again? Thank you!

graceful flame
# hushed heart Hello! Quick question, if anyone knows. I'm just looking for best or at least de...

The server and each client have their own game instance. So if you want to share data between the host and all connected clients then yes use the GameState because each game instance has a copy of the GameState inside of it. The server can then update replicated variables and clients will receive the updates.

If you want the host to have ownership over some of the variables then use GameMode as that only exists on the server.

Game Instance should be for things everyone needs to have but isn't related to sessions. Options menu, loading different levels, exiting the game that sort of stuff.

#

Game Instance is always in memory.

hushed heart
#

Apologies! Yep, that much I was aware of, I'll try and be clearer - the specific bit that I'm wondering about is retrieving information from the server on pre-initialisation of the client, and if it will happily receive a replicated version of the gamestate as soon as it connects, or if it actually might remain outdated until that property is updated on the server again. I hope that makes sense, thank you!

graceful flame
#

Well how can the server get info about a client before it has connected?

fossil spoke
#

@hushed heart What information are you trying to allow Clients to know before joining?

#

Whats the purpose of this?

graceful flame
#

The GameMode has event OnPostLogin and event Handle Starting New Player (both are overridable)

hushed heart
#

Ah, I'll take a look at both of those lalwster, thank you! I don't need info about a client before it's connected, I need the client to make sure its instances of things like the GameState are identical before trying to initialise anything. It's mostly for testing purposes, but right now I have on my lobby screen some properties regarding how pawns should behave, which I can move to other points in the logic, but it'd just be nice if they were available from pre-init, ahaha.

graceful flame
#

It's like you have no game state whatsoever as a client before you connect to the host right? So upon connecting the engine starts to load everything, one of the thing it loads is the GameState and if you have replicated variables on there that were presumably changed from their default values via the host before the client connected, then the client's GameState will automatically sync the values (aka replication) from whatever the host has them set as.

#

The duration of that depends on network latency, and the amount of work it has to do and the net update frequency of the GameState and the GameState's tick.

dark edge
graceful flame
#

Handle Starting New Player comes with a Player Controller. I think if you just put it in there without connecting anything it will override the default behavior which is pick a Player Start and use the Default Pawn Class (as assigned by World Settings).

#

So yeah I think it does

#

I have mine setup so that I first set input mode to game only, then I find player start (with a specific tag) then use the transform from that for a Spawn Actor of Class and Possess using the incoming Player Controller.

#

I also call a bunch of other events relating to my game but as an example I think that's everything.

#

Also I think it goes Event PostLogin first, then Starting New Player after in that order.

turbid cloud
#

Hey All: Rookie Question here.
I'm trying to go through the motions of having a dedicated server (just built from source etc).

I'm just playing around so I'll barely have anyone playing my prototypes, and wondering what the lowest barrier to entry to get a server hosted somewhere in the cloud. I know many game server hosting companies work for released games, but wondering about self hosted vs virtual machine somewhere etc. I'm using a Lyra template, so I know there are some services pretty easy to utilize, but I'm looking for the most simple solution just to start playing around.

graceful flame
#

That way I can easily transfer copies of the game via USB stick or LAN.

turbid cloud
#

Hey that's cool thanks. Any tips on how you learned to do that?

quasi tide
# frail barn i know it must be replicated and i need an answer, how do it correctly, because ...

A response like this isn't very attractive of an offer for someone to provide help (image at the bottom of this reply). Knowing the fundamentals will go a much longer way than just giving you the answer directly (even though I already have).

Based on how you said you "solved" one piece of the puzzle, it just tells me even more that you don't really grasp what you're doing. And that is okay. There is nothing wrong with not knowing/understanding. We were all there at one point. The issue comes when you just want the answer now, instead of building up the important knowledge.

Your HP update shouldn't be a multicast, it should be an OnRep most likely - that is if you want something to happen when the server replicates the value down to the client (most likely, you want to update the UI). Damage is if you're using the built-in damage system, it is only able to be executed on the server (when things are set up properly). All damage/health calculations should be done on the server.

The general process on how to do something is:

  1. Client does a server RPC to request to do something (say, pick up an item)
  2. Server verifies this is allowed and either processes it or rejects it
  3. Server then replicates (or does a multicast, depending on what you're trying to do) back down to the client or clients.
hushed heart
#

Thanks for the information, friends!

turbid cloud
hushed heart
graceful flame
#

Ahhh I just used Ubuntu. You download a file and install it directly to a USB thumb drive then insert and reboot (go to bios) then install from usb. The ubuntu website has detailed installation instructions.

#

From what I can tell, Windows hosting on AWS is much more expensive than Linux hosting.

quasi tide
#

There is a service that I've been seeing pop up more and more frequently that might be able to help with personal dedicated server machines. ngrok

turbid cloud
hushed heart
#

Correct, dedicated server!

quasi tide
#

Doesn't matter if it is dedicated server or listen server

#

That's just how you let anyone connect to something on your network

hushed heart
#

Yep, it should work the same for both

quasi tide
#

By default - your home network doesn't let any outside connection in unless you give it explicit permission. This is done most often by just...connecting to something.

#

What port forwarding does is tells your router/modem that you want to let people connect to this port.

#

So people from outside of your network can freely connect to it.

dark edge
#

or a spare laptop and Ubuntu

turbid cloud
turbid cloud
graceful flame
graceful flame
#

But hey if its an empty linux box then who cares. It's not like you save your banking login as passwords.txt right on the desktop right?

turbid cloud
graceful flame
graceful flame
turbid cloud
#

Really appreciate all the replies in this channel. Nice to see so much action around here.

graceful flame
#

So I can test via LAN. Then once I'm ready for other players I'll probably upload to a cloud somewhere because I don't know how well my internet connection can handle player data.

turbid cloud
quasi tide
graceful flame
#

Very true, there's a reason why cloud providers have been so successful. Ain't nobody got time for that!

dark edge
#

That'd be just fine

turbid cloud
gloomy flare
#

Hey dudes quick question is it best to play sounds in multiplayer using a rep notify?

thin stratus
#

Is the sound a one time sound like an explosion, then a Multicast is fine.

If it depends on something that qualifies as state, e.g. a fire that can be turned on and off, then it should be part of the OnRep of that state variable, e.g. bFireOn

#

Late joining players, or players that come into relevancy range, will get the OnRep update to turn on and off the fire sound, but won't get the Multicast anymore. Which makes sense because why would they need to hear an explosion Sound that was in the past

mortal mica
#

is there a way to change the replication properties of a Super replicated property?

#

basically call DOREPLIFETIME_CONDITION with different conditions in a child class

thin stratus
#

There is a macro for override

#

Your best bet is to f12 to the macro definitions and check what others exist

mortal mica
#

thanks

vague fractal
#

Is there any specific reason why lobbies can't provide informations like ping and similar till you actually join the lobby ?
It's just kinda confusing me as you can still find them through some kind of server browser.
While at it, is there maybe an workaround for that ?

thin stratus
#

You can add additional settings to them, such as current map, and you can display those in a server browser

#

They should also have a ping if the subsystem you use provides one

#

If you need more than that, then you can look into Beacons. They are a lightweight connection you can establish that doesn't require joining the server. They require c++ though and you still need to initially find the server

vague fractal
thin stratus
#

That's usually toggled via the Presence setting iirc

#

Which should indeed be off for dedicated servers

vague fractal
opaque sage
#

What have y'all experiences been with implementing multiplayer for UE4 vs UE5? We're considering staying on UE4 for a bit longer but we don't want to start on multiplayer if it means migrating to UE5 later could cause problems. I assume most of the same logic still applies but I did hear they've made some improvements, I just can't find a good comparison

thin stratus
#

The only thing I'm not sure about with that docs page is if it is using the new steam net driver or the old one

#

There is one called SteamSocket or so, which also fixes the 9999 ping issue

thin stratus
vague fractal
#

This here made me ask this in first place Unlike servers, no information about a lobby is available before joining, such as ping times or current number of other users
And also a quick test on my pc + gf pc where i didn't got the informations in my server browser, so it seems to be true

thin stratus
#

They are working on Iris which would replace the old system I guess, but that's probably far from release

thin stratus
vague fractal
#

From how i read it seems like it is intended

thin stratus
#

Lobbies are ListenServers right?

vague fractal
#

I'd assume so, but my term knowledge isn't great so far :D

thin stratus
#

If so then you should be able to get this information

#

One of our clients uses ListenServers

#

And we moved to SteamSockets for that reason

vague fractal
#

Hmm, i can only tell that it worked just fine on my local machine, but there i also had to use the NULL system rather than the steam system 😅

thin stratus
#

That's an important difference though:P

#

Null doesn't use sessions in it's traditional sense

#

Null just asks all PCs on the lan if they are hosting

vague fractal
#

Well, gotta play more with it then xD
Btw, any chance that you can recommend a way to quickly share a shipped version to the pc of my gf ?
Currently i've just put it on an USB which works, but this seems so insanely slow which makes me wonder if that could be speed up, somehow

quasi tide
#

If you're on the same network, just set up a shared folder between you two

opaque sage
vague fractal
quasi tide
opaque sage
ionic turret
#

hi guys, I am struggling with a request related to streaming a multiplayer experience. Up to how many people can be contained in the same experience? Using pixel streaming + AWS or similar

quasi tide
#

Which, if you don't care about that, nothing really changes.

quasi tide
opaque sage
#

That was really helpful. thanks! Seems like Iris is meant to be backwards compatible so we could switch to it further down the line (apart from the subobjects change)

quasi tide
#

It's going to be a minute before Iris is ready.

#

I wouldn't even think about it currently

ionic turret
quasi tide
#

You can have however many players you want, you'd just have to optimize the networking. As well as linking multiple hubs together. Each "lobby" is one instance of Unreal.

prisma snow
#

the idea of pixel streaming and tech like GeforceNow fascinates me

ionic turret
ionic turret
quasi tide
ionic turret
#

can i send you a message?

quasi tide
#

No

ionic turret
#

Ok no worries. i just wanted to now more about custom networking, is a field i dont know anything actually

quasi tide
#

Neither did the Runescape people when they made Runescape.

quasi tide
prisma snow
quasi tide
#

And all of Diablo 2 was ran off one PC

prisma snow
#

nice

quasi tide
prisma snow
#

hahahahah

quasi tide
#

Now of course back then, it was much easier to deal with certain things.

#

These days...dear lord.

prisma snow
#

what do you mean? maybe that the context and tech in general has evolved a lot and therefore everything is way way more complex?

quasi tide
#

Just the general evolution of programming, as well as the expectations of players.

prisma snow
#

the player expectations are definitely something big, good point

quasi tide
#

Back then - it was super cool just to be able to play with each other across the net. Didn't matter that it was laggy as hell.

prisma snow
#

yeah ofc

quasi tide
#

Now it is, "oh, I have 20 ping. Trash devs who don't care about optimization"

#

Okay buddy, let me just fix the speed of light.

prisma snow
#

true

#

so much is taken for granted

quasi tide
#

Don't have rollback in a competitive game? Garbage company. Dead game. blah blah blah

#

Did Diablo 2 PvP have rollback in PvP? Nope. Did people care? Nope.

prisma snow
#

and players expect that some feature from one game can be automatically applied to another

quasi tide
#

Pretty much, yeah.

#

But it is just the nature of the beast.

prisma snow
#

ye

quasi tide
#

Co-op all the way baby. So I can code like it is 1999 ❤️

prisma snow
#

hahahahahah

quasi tide
#

"Client said they have 300 health", Okay buddy.

prisma snow
#

just do an RTS

#

RTS players think 300 input lag is normal ^^

#

except SC2 players

quasi tide
#

They're a different breed anyway

prisma snow
#

indeed

kindred widget
opaque sage
frank birch
#

If a game is running and I plug in a new controller... does unreal create a new player right then and there? 🤔

solar stirrup
#

The fast array serializer doesn't call the PostReplicatedAdd/PostReplicatedChange/PreReplicatedRemove serverside/with authority right?

cold moat
#

does "PlayAsClient" actually make any sense? the description says, but it just feels like im on a listen server anyway

#

im having trouble testing my networked projectile code because my old pc cant run two instance at fps high enough to actually know if im getting decent interpolation or not lmao

dark edge
dark edge
#

and small windows

split wind
#

Can anyone think of a reason the client can see the server host character, but the server host cannot see the client character? Both are using the same character type.

dark edge
#

How are you spawning the characters?

split wind
#

One sec, ill. SS it. Need to get back to my PC.

#

@dark edge

#

i think this is where. sorry, i'm not sure, still learning.

#

or do you mean the onpostlogin?

dark edge
#

I mean wherever the client is getting their pawn

split wind
#

this one?

dark edge
#

Why are you possessing a pawn that you already possess?

split wind
#

aw, so i'm telling it toactually possess the same....

#

i'll get rid of this and try it. i think it won't matter though, cause i added this after i seen that the server was not seeing the client character.

#

brb

mortal mica
#

I just read a forum post that confused me a bit... the server is the authority on a player's pawn right? not the client itself.

#

(the pawn being controlled)

#

and the client has an autonomous proxy

split wind
#

yea, it made no difference.

#

i got rid of that whole onpostlogin, didn't change anything..

dark edge
mortal mica
#

that's what I thought, but in this forum post someone was saying that client is authority for it's own pawn

#

just wanted to double check

dark edge
#

Yeah they just mixed up the two.
You need to be the owner of an actor to call server RPCs through it.

#

Typically that's playercontroller, pawn, sometimes a few more actors.

mortal mica
#

yeah

#

ok everything still makes sense 😛

cold moat
quasi tide
split wind
#

@dark edge the spawn player function

#

this is where i'm trying to spawn the joining player

dark edge
#

you can already easily get all playercontrollers etc

#

Also this

split wind
#

in the tutorial is said to plug it in there, and for some reason, it will not let me get from new player anymore..

dark edge
#

There are no good tutorials

#

you're calling Spawn Player but not passing a playercontroller

#

but you don't need to do any of this

#

it's all built in

#

just override the functions you need to in GameMode

split wind
#

i don't understand. but. for context, i just tested it in both headsets. host now spawns +1 pawn. when the client joins, the +1 is all the server sees, and not the actual player. joined client still sees the host character bouncing rubberbanding and the other 2 pawns.

#

so i'm not actually possessing any pawns

#

cause as this thing looks, i should be possessing the spawned pawn

#

cause now the server can see the clients +1, but not him

#

but the client and see the server pawns just fine, minus the rubberbanding jitter

#

override which?

dark edge
#

you haven't hooked up the joining controller to that spawn pawn function

split wind
#

Thats what I'm saying, it won't actually let me plug new player in the player controller

#

I did change one of the cast though... but switched it back, then I could plug it in anymore

#

I'll fiddle with it. I am getting closer. I think.

#

from new player to player controller problem was my input reference. i changed it from player controller to my players controller. referencing the wrong one ( at least this will fix my allowed connection Problem.)

#

gonna test it.

regal grail
fathom aspen
regal grail
#

I know lots of people re-invent the wheel all the time for what UE provides, but sometimes things can be hidden. I think I was mostly looking in gamemode and not gamestate for such things

fierce oriole
#

Speaking of Re-inventing the Wheel: Do people use the Legacy Damage System and Damage Types in MP or do most devs use GAS or Roll their own?

fossil spoke
glass vector
#

when using seamless travel, the documentation says that the gamemode will persist, does it mean that you cannot travel to another map that uses a different gamemode??

fossil spoke
glass vector
#

ok thx

karmic briar
#

does game state a good place to store information such as how players have been kill in a game,global bountry system similiar to the one in fortnite?

shadow arch
#

Hey All i have a quick question that i can't grasp. So i have a player controller that stores a variable called "Target"

#

My server sees my player controller correctly, but that variable is always null on server. Any reason?\

mortal mica
shadow arch
#

normally in the player controller

#

does the setting have to pass through a server event for the server to see it?

mortal mica
#

well yes, if the server never writes to that variable, it wont see the value

shadow arch
#

i was under the impression server is supposed to see player controller but other player controllers don't see other player controllers

mortal mica
#

basically think of server and client as if they were 2 different applications

#

just because you define a variable and write a value to it in ApplicationA, doesn't mean that value exists at all in ApplicationB

mortal mica
#

but the memory on the server and the memory on the client computer are 2 different things

#

so they are not the SAME object

shadow arch
#

ok i see what you're saying

mortal mica
#

in fact in a real server/client scenario, they are in fact diffferent computers!

#

of course there is a connection between the two

#

so even though 2 computers have 2 different objects created, they share an ID

#

which is used by them to identify the corresponding object on each computer

shadow arch
#

ok so the correct course of action is to have a server replicated event on the PlayerController that will set that variable and then only use that event when i want to set the variable?

#

seems a bit roundabout but i guess it is what it is

mortal mica
#

so, even though you have a printed copy of a receipt, and I also have a printed copy of the receipt, they are different pieces of paper, but if we were to talk, and I want you to look at your copy of the receipt I'm looking at, I could tell you the invoice #id, and you can look your copy

#

now in your example

#

I could call you and tell you, "hey, remember that invoice #1234? Ok, I need you to write "DELIVERED" in the back of it"

#

(that phone call would be the equivalent of the client calling an RPC on the server)

#

keep in mind you can only call RPCs on Objects you are the owner of

#

(your Pawn for example)

#

now in case you are wondering, there's also "Replicated variables"

#

but all that does basically is that whenever the server updates a variable, it notifies clients automatically to update their values

#

but that only works Server to Clients, not the other way around

#

hope my analogy makes some sense 😛

shadow arch
#

yeah it actually cleared up quite a bit hahah

#

i appreciate the writeup 😛 Especially the replicating variable part. I couldn't find that info anywhere online actually

mortal mica
#

no worries

#

and if you think it's a roundabout, think about it this way

#

you don't trust your clients

#

so you dont want clients to be making any changes on your server

#

so what you can do, is allow clients to REQUEST changes, "pretty pretty please, can you update this for me?"

#

and then if the server is ok with that, it will update the variable for you

#

that's why replicated variables work one way, not both ways

shadow arch
#

yeah but all i'm doing is calling an event on server to update that variable but whatever i feed is what gets set

#

so there's not really any layer of security. At least not that i can see

mortal mica
#

not sure I follow

shadow arch
#

ok so my clientside function calls a serverside event

#

which will set my clientside(and now replicated serverside) variable

mortal mica
#

if you only need the variable client side, then there's no need to do any networking at all

shadow arch
#

no i need it on the server that's the issue

mortal mica
#

but if you want your variable to be visible to your server (and the rest of the clients connected)

#

then yes, the variable needs to be set ON the server

#

again, the client can't write to the server's memory, so you need to tell the server to do that write for you

dark edge
#

nothing replicates from clients

#

the only communication a client can send to a server (and then to anyone else) is through a Run On Server EVent

shadow arch
#

Yeah i've been experimenting with my issue , just got it working but yeah passing it from server to client is a pain haha

glass vector
#

if I use seamless travel, according to the documentation the player controllers persist, does it mean that the begin play event wont be called on the player controller when traveling to a new map?

mortal mica
#

are things like Attach Actor to Actor or SetMovementMode (CharMoveComp) expected to be ran on the server? or both client and server? do they replicate automatically?

thin stratus
mortal mica
#

I thought actor attachment was replicated, but it's not working properly

#

gonna have to debug

#

client side seems to lock position, not rotation, and after a while even the position flies away

thin stratus
#

I know for a fact that it's replicated, but maybe it requires ReplicateMovement to be ticked?

mortal mica
#

(this is a character that im not controlling (player entered vehicle))

thin stratus
#

Ah

#

Yeah not sure if characters have any side effects

#

Uncontrolled ones don't run the movement component unless you enable that

#

Not sure if that matters

mortal mica
#

that would solve some problems

thin stratus
#

Run Physics on bla

mortal mica
#

but yeah i noticed that the simulatedproxy code is way simpler

thin stratus
#

Something like that

mortal mica
#

doesn't do many things

thin stratus
#

In the Character Defaults

#

Or just Run Physics

mortal mica
#

ohh let me check

thin stratus
#

It should say something along the lines of Run + Physics + Unpossessed or Uncontrolled

mortal mica
#

the only reason im attaching the actor is because the floor moves

#

and when i unpossess it

#

the character just stays in the same world position

#

voila

#

awesome

thin stratus
#

Yeah or that xD

mortal mica
#

ok that worked

#

no need to attach the character anymore

#

it broke something else, but that's a diff story

#

xD

thin stratus
#

Wanna know something funny? You are by far not the only person to suffer from that checkbox

#

Even Riot Games f*cked that up :P

#

They have a Character that can control a Camera, which is also a Pawn (probably even hero, cause that thing could equip Weapons and shoot them lol). And while the original Character was unpossessed, it might have stood on a wall of a different Hero. When the Wall broke, it wasn't falling :D

mortal mica
#

lol

#

in my case it was very evident from the beginning, since the characters are standing on a ship that moves/rolls around

thin stratus
#

I like those little stories, cause they make it more apparent that even the big studios don't do everything perfect and struggle with the same things the small indies do

mortal mica
#

so as soon as i unpossesed it, it went flying the other way

#

oh trust me, aaa companies suffer as much or even worse

#

xD

thin stratus
#

Yeah, not sure how your Character would handle rolling of the ship

#

Cause the Character Movement Comp likes its up vector, but maybe that's actually not a problem

mortal mica
thin stratus
#

Very well

mortal mica
#

and I abuse the "base movement" part of it

#

basically hacked it so it always has a base movement component attached to it

#

well, unless you float away from the ship

#

it still has some issues, like compensation when landing

#

seems to unsync a bit from the server

#

but it's barely noticeable in normal ping

thin stratus
#

Yeah some time ago I had a client that needed Hovering Drones to drive on walls and ceiling.
I rewrote the CMC for it, so I can have any given Up Vector (based on surface).
Was in the end a lot of work but also went around the CMC's limitations.
Can't suggest doing this though, wasn't fun.

mortal mica
#

hehe

#

yeah I'm learning that the hard way

#

although for now im deriving from the base charactermovecomp

#

and just overriding methods

#

but it's annoying

#

i WANT TO DELETE THE SWIMMING CODE

#

not "disable" it

#

😛

#

I guess I could have a swimming pool inside the ship for relaxing purposes...

thin stratus
#

Well, you never know if you ever land on a planet with some hot tubs

mortal mica
#

true xD

vague fractal
#

Is there some tutorial on how to properly work with IOnlineSessionPtr::RegisterPlayer/IOnlineSessionPtr::UnregisterPlayer ?
I'm not quite sure how to actually work with it, i was even surprised that this doesn't happen automatically when joining (and also leaving as i assume) a session 😅

rose egret
#

I feel like replication is disable when I make my actor hidden and no collision

#

🤔

#

oh nvm, AActor::IsNetRelevantFor returned false, epic optimization hah

    else if(IsHidden() && (!RootComponent || !RootComponent->IsCollisionEnabled()))
    {
        return false;
    }
cyan mirage
#

Hey everyone, I've just started learning about how multiplayer is implemented in unreal. So first of all wish me luck, second of all I'm wondering where I've gone wrong with this blueprint because I'm clearly missing something. I'm trying to spawn a cube for all clients when a single client presses a key. My understanding of how this should work is 1.) from the character controller if the client presses the key then request that the server spawns a cube 2.) from the server tell each client to spawn a cube locally at a certain position. Below are my blueprints. But so far if I try spawning the cube on a connected client then nothing happens and if I spawn the cube on the server then it spawns for everyone

fathom aspen
#

Correct, but you are requesting the client to spawn it instead of the server

#

So your wording is correct

#

Your code is not

#

Just make it a server RPC instead of a client RPC

cyan mirage
#

Which part should I make a server RPC?

fathom aspen
#

How many RPCs do you have?

#

Ah well you have 2

#

The one in GameMode is meaningless (considering GameMode isn't net addressable)

#

Just make it a normal event

#

The one in PC make it server RPC

cyan mirage
#

Thanks, but now if I press the the spawn key on the client it still doesn't spawn locally but spawns on the server

fathom aspen
#

Right because that's what we told it to do

#

Now make the actor replicated and you're done

#

BP Replicate bamboozled me into thinking it's replicated

cyan mirage
#

Oh intresting, that makes sense, I just didn't realise I needed to check that box. I had figured that the server would have to call a custom event I made on each PC to spawn the cube

fathom aspen
#

That is called a Multicast

#

Which can be used, but its got its own use cases

cyan mirage
#

Another question I have then is it ok to create a server replicated event that lives inside a client blueprint like the PC? I understand that the game mode lives on the server so I thought I had to put all my server replicated events on there

fathom aspen
#

If you dont care about the object being replicated and you literally just want to spawn the object locally for clients the PlayerController is relevant for then you use Multicast

#

Server RPCs generally live inside Actors that are owned by the client, with those usually being PC, PS, Pawn

#

GameMode is server only exactly as you said. That's why it makes no sense for RPCs to live inside it. There is no form of two ends that you need to transition from/to

cyan mirage
#

I see, and I had originally tried a multicast event. If you take a look at my screenshots again inside the game mode I have a multicast event which spawns a cube, but that didn't work

fathom aspen
#

Right because the Multicast is an RPC and it can't be inside GameMode

#

It could have been inside the PC for example

#

Again with the other event fired from input being a server RPC

latent heart
#

Sticking a multicast on a PC seems a bit superfluous. Might as well be a single-cast as it's onyl going to 1 player.

#

Well, one player and probably the server that executes it.

fathom aspen
#

Damn right, on PC multicast == server + client RPC ^^

drifting heath
#

If anyone may have some insight, it would help. I am trying to get a ship to move, but when I load the game in client mode, the ship just floats stationary. I've written a custom C++ transform replication component which is working fine, but the movement doesn't seem to be working. If I load up in standalone or listen server, it move perfectly fine.

Some context: All ships are owned by the server, replication is on but replicate movement is off. Custom transform replication (location & rotation replication) is on. Physics simulation is on for the server, off for the client. The ship updates location & rotation excellently, but it does not move.

TLDR; Server controls ship location, rotation & movement. Location & rotation is replicating flawlessly. Movement does not happen on clients.

#

And here's what it's showing during play

fathom aspen
#

Well you are adding movement on the server (on authority) but not on the client, and you have replicate movement turned off

#

Why would movement be replicated?

drifting heath
#

It's moving on the server, thus the location would be updated and replicated through the custom transform replication component.

fathom aspen
#

Transform is replicated, but it's not set on the client

#

Add Movement would need to be done explicitly on the client too in such case

#

Unless you turn on replicate movement

#

But then I don't think you need to replicate transform or any of that

drifting heath
#

I opted for transform replication because the ships were choppy to anyone who wasn't the owner of it, which made multiplayer completely useless lol... I'm checking into my server->client routing, because now i'm curious if something's not communicating correctly. If I cna't find it, I'll screenshot my replication in C++

fathom aspen
#

Yeah replicate movement has by no means smoothing or any of that

drifting heath
#

I think I may have found it. I missed a NetMulticast designation in my UFUNCTION.

fathom aspen
#

Ah and if my memory isn't failing me floating pawn movement component has no network functionality

#

Unlike CMC for example

drifting heath
#

That would be part of the reason why it was working before I tried going the transform route then, lol.

quasi tide
#

Still waiting for WC's review of the GMC

drifting heath
#

My thought was if the movement works on the server I can just replicate it via the transform variable. Looks like I may have forgot to Multicast a couple things though.

quasi tide
fathom aspen
quasi tide
#

I do sometimes wonder if there is merit to having just a really lightweight MC. Like, think FPM...but with gravity and basic network stuff

fathom aspen
quasi tide
#

Soon, you're going to go the way of Kaos 😭

fathom aspen
#

Maybe I will never know until I write my own ^^

quasi tide
#

Ugggh - work

#

That's the thing that stops me from doing it

#

(And CMC works fine for me, lol)

fathom aspen
fathom aspen
quasi tide
#

Because of course it is

fathom aspen
#

I was faced by such bug at work, and it's fixed in 5.1.1

#

Must love it when you have to make sure to update for the fix to come in

quasi tide
#

Root motion has always been wishy washy from what I've seen anyway.

#

(In UE that is)

fathom aspen
quasi tide
#

Has root motion?

fathom aspen
#

Yes

quasi tide
#

If so - well...yeah, that's just the name of the technique

fathom aspen
#

Unless I was bamboozled by unity ads

quasi tide
#

No, it has it.

#

Root motion isn't something that is exclusive to UE. Pretty common way to author animation

fathom aspen
#

In the making ladies and gentlemen

prisma snow
quasi tide
#

Tip: Stop trying to do stateful changes with multicast

Am I hired?

fathom aspen
#

That's tip #10

#

I will take the chance to say that I will have a live talk at #notGDC this year about it (will try to cover as much of it as I can)

quasi tide
#

Hope it's not during the same time as Epic showcasing Verse, lol

prisma snow
prisma snow
fathom aspen
#

Yes it should be ^^

errant vapor
#

A call to FObjectReplicator::ReadyForDormancy is returning true and letting the object go into early dormancy despite there(seemingly) being outstanding acks for that channel.. at least according to the client who hasnt received his replicated property.. is there some caveat with this system that I'm unaware of?

drifting heath
#

Since ships will be moving literally fractions of a second during the entire game session, because of waves, it's probably no big deal to do one over the other.

fathom aspen
#

The variable/transform you replicate, do you come to set it on client (aka SetActorTransform or w/e?)

drifting heath
#

I was using OnRep_TransformAuth(), with C++, which would OwnerRoot->SetActorTransform(TransformAuth), but it would never be received. Or rather, would get received but do nothing.

#

I ended up doing Multicast(loc, rot, scale) and it's working, or so it seems

prisma snow
drifting heath
#

basically, version 1 was set transformAuth on the server, multicast to clients. Version 2 was just nuke it by sending a multicast event every tick.

fathom aspen
#

version 1 was multicast replicate to clients

#

Unless I'm misunderstanding you

#

Unless something very internal to SetActorTransform that is failing, I have no idea why that would fail

drifting heath
#

No that sounds right. A replicated variable to all clients.

fathom aspen
#

Make sure the multicast is not reliable at least

drifting heath
#

Yep, unreliable.. Not gonna open that can of worms 🤣 It's sent so fast anyway that it doesn't make sense to handshake. If you miss the update you'll get the next one.

crystal crag
#

I asked this question in C++ and then I realized maybe it is better to be asked here since I am working on the multiplayer aspects

#

I've been trying to learn more about the character movement component and one term that keeps getting thrown around without explanation is that it is a "safe" movement method / action. What does it mean that it is a "safe method" or that "I can do this because it will only ever happen in a safe movement"?

#

Does "safe" just mean that I store it in the custom FSavedMove class and set it up in PrepFor and MoveFor methods?

prisma snow
#

I think movement sync is one of those cases where multicast is justified over replicated state

#

due to the rapid changing nature of the value, and the time-sensitiviness nature of it

shy yarrow
#

how use the unreal engine for Steamcore multiplayer setup which is non-region locked?

clever hound
#

Blueprint Runtime Error: "Accessed None trying to read property ShopWidgetRef". Node: Add Shop Items
Why does this error comes only on the Client
Im calling AddShopItems() after the player collides with it so why is ShopWidgetRef empty? I dont get it
It sets the Widget in the end of BeginPlay just fine but can't get the target for AddShopItems

#

During simulation:

drifting heath
#

The only thing I can think of is that you need to run AddToViewport, or it may be getting destroyed in the background. Not really a multi-player issue though.

clever hound
drifting heath
#

Widgets don't exist on the server

clever hound
#

Playing it as the listen server and standalone works

drifting heath
#

There's something else going on, but I'd still add the AddToViewport call. Maybe just create the widget after SetShopItems instead of BeginPlay, so it's created when you need it? I'm guessing something is wrong with how you're creating the actor or whatever this is that's creating the widget.

#

Widgets are client sided so if it works on the listen server it'll work on the clients, unless something is wrong with the actor that contains the widget you're making.

clever hound
#

Ok ill try stuff out. The widget is is attached to an actor which is in the world from the start and the widget is rendered in world space

drifting heath
#

Or so you expect 😉

#

Also make sure your widget isn't removing or destroying itself if something is invalid. If it works on the listen server and not the clients, you may not be replicating a variable and that's causing your widget to self destruct.

#

Too many possibilities, but it's not the widget in and of itself

clever hound
#

ok ty

turbid cloud
#

Hi all - happy Saturday!
I'm a rookie building my first dedicated test server today and have a question about the best way to set up access.
I'm under the sense that a client can connect to the the main server over the console, but not sure if that functionality crosses over networks.
Also I see the LyraGameEOS in the VS solutions, and wondering if that's something I can be looking at if I'm just goofing around and don't have a real game yet?

Any general tips on this first hurdle of getting a dedicated server going for testing (and the easiest way to do it) would be amazing.

hushed mauve
#

Dumb question, i guess its completely implossible to programm, but is it possible that i have multiple dedicated servers that serve one single level on the entire world, and every of these servers serve a little part of the map?

#

i guess i have to overwrite the spawn point of the player when a player joins one of these servers

dark edge
hushed mauve
dark edge
#

To be honest, if your game is too heavy for 1 server but 4 can handle it, just make it able to be handled by 1

#

if it takes 400 to handle it, then it's probably worth doing. But you're not going to do that, that's 100M budget territory probably.

hushed mauve
#

i have a concept for a game where every player in the world plays on the same map

#

and a single unreal dedicated instance wouhld never be able to handle this

#

so i came up with this split idea

dark edge
#

Everyone playing Mario 64 plays on the same map

hushed mauve
#

like in multiplayer?

dark edge
#

no but it is the same map

#

lol

hushed mauve
#

yea but i mean that every player is connected to the "same server"

dark edge
#

Yeah that's not gonna happen.

#

That's basically EVE, Starbase, maybe a few more. Big operation.

hushed mauve
#

thanks for your answer 😄

dark edge
#

Leaving signs etc like Dark Souls is a bit more feasable, but it's still a big operation

#

I mean if 10 people in the world are playing your game, sure

#

100, probably not

#

1000, no

#

1,000,000, hell no

dark edge
#

Has anyone done a seamless server transfer or join in Unreal 4/5 yet?

#

I can't think of any

sinful tree
#

Pretty sure I've seen external solutions to handle something like that, but that's basically skipping unreal's networking entirely.

dark edge
#

If there's a simple way to do it I'm all ears, I'd love to have that for my roguelike

#

We're trying to have zero cuts from startup to shutdown

#

right now the only hard cut is on joining another game in progress

#

host has zero cuts, standalone has zero cuts (it's basically a host with zero clients)

#

Full screen teleportion FX it is then

#

Teleportation is a thing (like diablo town -> dungeon loop), so as long as it's consistent and it's not obviously different from a teleport from base to dungeon locally it's fine

#

joining a game is teleporting from your base to theirs

frail barn
#

tell me pls, how it is possible at the same time, and how to fix it?

turbid cloud
turbid cloud
dark edge
#

but if you're targetting Steam get steam sessions working asap

turbid cloud
#

for me for the next month or two it will just be me and a friend.. would be more cool to just connect direct to the host. Should I just google 'port forwarding unreal game server'?

#

Any general tips for me on how to get that set up?

mortal mica
#

ok I'm still seeing some oddities with replicated physics... I have an actor with a static mesh component, I set it's physics linear velocity to 15000 on the server, and then I'm printing the velocity on screen, both server and client and I see this:

#

Ignore the other values, the ones that are the velocity are the ones that have 15k on the X axis

#

the velocity on the client jumps around 15k, on the server it's 15k spot on.

#

there's no linear damping, the velocity is not being set or changed anywhere else

jovial charm
#

Still learning replication, and was wondering if uobjects are not replicated, what if they are used as a variable in an actor? Like I have an actor that is replicated, and then I create a variable of type uobject in this actor. Will this uobject variable be available on the replicated actor?

candid verge
#

Im trying to make a holy ground effect where no one can walk inside but the player who creates it. Would be easy in singleplayer, but it doesn’t seem possible in multiplayer.

I’m doing it with sphere colliders, but there’s no way to designate who can go in and who can’t, I can only set collision channels. For example, on the server I can only tell if I can go in or not; I would have no way of telling Client 1 he cant go into Client 2’s zone

candid verge
#

What does that node do, exactly?

#

When who is moving

dark edge
#

When anything with a movement component is moving I'd guess.

#

Just calling that locally everywhere should do it.

candid verge
#

Which, in hindsight, is very dumb

mortal mica
#

ok there's definetly something very wrong with the default physics replication 😐

#

anyone knows where in the engine code the physics portion of the staticmeshcomponent is handled? I'm assuming it must be a more generic physics body being used somehow

#

but I can't find it

turbid cloud
#

hey all - I'm SO excited - just build my first dedicated sever and game. Ran the server on my own PC and started two games, then alt-tabbed back and forth (using the ~ connect local thing). I just tried running the server on my PC and connected on my girlfriends computer (different machine / same network) with no luck.

Anyone have any tips on connecting to another server on machine on home network? Does Connect 127.0.0.1. not work to other machines on home network?

mortal mica
#

127.0.0.1 is your local host ip

turbid cloud
# mortal mica 127.0.0.1 is your local host ip

Thanks.. So that's on my own computer right?
Meaning my girlfriend would not be able to connect from her PC by punching that in? Any tips on how I might do that? Is it the same process on a local network as outside local network (ie. port forwarding router stuff -- way beyond my skill level tonight)

mortal mica
#

you need to know the ip of the machine you want to connect to

#

local network doesnt need port forwarding

#

that's when you are exchanging between LAN <-> WAN

dark edge
#

Physics error correction in project settings btw

mortal mica
#

yeah we already went through that

#

I tweaked em

#

but there's still something weird

#

I'll explain in a min

mortal mica
# dark edge What makes you say that?

so I made a similar sample as the other day, basic actor (not even a pawn now), static mesh component. Simulate Physics = true. Replicates Movement = true. Component Replicates = true. Linear Damping/drag = 0

#

on begin play on the server (authority switch) I set the velocity of the player and the test object to 15000

#

and this is the result

#

if you watch the logs or the prints on the top left

#

the server's velocity is stable at 15000, which is what I set

#

the client's velocity jumps around

#

which induces that jittering motion that's noticeable

#

(I assume)

#

(lol, I jsut realized that it recorded the music too, sorry about that)

fluid prawn
mortal mica
fluid prawn
#

from my experience I've seen the character movement component have some code in there to handle moving platforms for networking

mortal mica
#

the platform is not the one moving

#

the big white cube is the one moving

#

also my character is in flying mode, so there's no based movement, and the character has the correct velocity 15000 constant.

fluid prawn
#

ah

mortal mica
#

the velocity im printing is the velocity of that white box travelling at the same speed than the player

#

what Im thinking is that unreal doesnt really sync the velocity/angular velocity

#

but calculates it on the client based on the position delta / rotation delta

#

and that's why it's not exact

dark edge
#

There's a bunch of tunable parameters there

iron turtle
#

I have a replicated Struct (FGameplayEffectSpecForRPC, from the Gameplay Ability System). The first time it attempts to replicate (set value on server, call rep_notify, nothing crazy), I get an error, the connection drops and the game restarts.
However, from there, further attempts of replicating the struct work just fine and everything seems to be normal.
Why is this failing the first time and then from there, everything is okay on future attempts?

This is the error:

Error        LogRep                    ReceiveProperties: Invalid property terminator handle - Handle=3839
Error        LogRep                    RepLayout->ReceiveProperties FAILED: NinjaCombatComponent /Game/Maps/UEDPIE_1_Lab_Combat.Lab_Combat:PersistentLevel.BP_Battlemage_C_0.CombatComponent
Error        LogNet                    UActorChannel::ProcessBunch: Replicator.ReceivedBunch failed.  Closing connection. RepObj: NinjaCombatComponent /Game/Maps/UEDPIE_1_Lab_Combat.Lab_Combat:PersistentLevel.BP_Battlemage_C_0.CombatComponent, Channel: 3
#

Also, what should I look for (or how do I debug) this type of error?

#

(btw, my assumption of why it works on further attempts is because I presume I'm actually running "locally" and not as a "client" anymore, but please correct me if that's incorrect)

mortal mica
#

the only thing I'm thinking of doing is just storing the velocity on a replicated variable

#

and forcing the velocity on the client side

#

but this is very very lame

glass vector
#

for seamless travel, will the begin play be called for player controllers when they enter the final destination map? ie, since the controllers persist, will they call begin play again?

dark edge
mortal mica
#

yeah, makes no difference

dark edge
mortal mica
#

weird

#

you set the velocity just on the server?

dark edge
mortal mica
#

is there a difference between Set All and Set ?

dark edge
#

if there's only one body, doubt it

#

it takes about 4 seconds to sync up perfectly but it does sync

#

You gotta remember it's simulating physics everywhere, the replication is just to bring things "in sync" so to speak

mortal mica
#

ah so you do see it jitter at the start?

dark edge
#

I'm just printing velocity but my first velocity is about 14960

mortal mica
#

are you moving the camera/player WITH the object?

#

cause I also saw that it synced but when the object goes far away from the camera

#

im assuming it has something to do with net relevancy

#

if you stay close with the object it never syncs

#

(probably the client doesnt even bother extrapolating when it's far away)

dark edge
#

I checked Always Relevent and yeah it's always 40 off

#

yeah velocity appears to never be actually replicated, just derived from positions

#

What are you actually trying to do gameplay-wise?

#

Most replicated physics mechanics don't just rely on one boop on the server then everything just going with that

#

Setting Linear Velocity Coefficient to 10 makes it much much tighter

#

prolly worse if you're constantly changing velocity tho

#

Anyways, the physics replication stuff is meant to "square up" server and client simulations, not necessarily to just have sims run on server and appear on client

#

you should sync stuff like VelocityTarget etc

#

If i put linear velocity coefficient to 1

mortal mica
#

I think im gonna replicate the velocity myself

#

I did a quick test and it works way better

low vine
#

I got stuck for several days now on something dumb and perhaps my solution itself is part of the problem - I want my capsule component to match my character mesh somewhat closely during animation (mainly jump/land atm). I've made a 1s long timeline with a curve from 0 to 1 that I then use in cpp w/ variable PlayRate to lerp various values for mesh offset and for halfheight, the timeline is triggered from movement mode change, thus there is no replication for the timeline. The opposite value of the mesh offset is added via AddActorLocalOffset to not sink visually. I got this to work very smoothly on the controlling player (by also running this on server, otherwise the mismatch would cause jitters) and the capsule matches the mesh nicely. However the issues begin once I connect another client. In my current iteration they see the jump to the same height correctly (the AddActorLocalOffset is not called on remote players so that gets replicated from the server) but don't have the mesh offset, despite setting it within the timeline on their end too. If using SetRelativeLocation_Direct, it does nothing for the remote player at all. If using SetRelativeLocation, the offset is correct until the timeline ends, at which point it bounces back. From doing some logging the mesh comp RelativeLocation seems to locally reset every frame on remote player despite changing on the server and local player just fine. I do not have replication on for the mesh component either so I'm unsure what causes this reset? (Did try having the mesh comp replication on but it didn't replicate the offset on the server, maybe I missed some setting for that)

Perhaps there was a better/simpler way to handle this all along and I just went down a wrong rabbit hole? 🙂 Perhaps my approach may bring some unwanted side effects later I'm currently unaware of

peak notch
#

anyone know a guide or video on how to set up EOS for android? if so do let me know it will be greatly appreciated

graceful viper
#

this is the code I am running but on the overlap it seems that it increments coin twice, why?

#

even with 4 servers it increments by 2

#

also how can I do something like this to rotate the numbers? since the components rotation replicates by default it looks like I cannot

prisma snow
graceful viper
prisma snow
#

is the overlap happening ONLY in the server?

#

have you debugged it?

graceful viper
#

it

#

it's happening on every client

#

but idk what that means

#

do I just use authority switch?

prisma snow
#

well

#

if you have an event happening in client + server

#

it is likely that it is duplicated

#

so that is why it increments by 2, most likely

#

server adds once, clients adds once if that makes sense

graceful viper
#

ok yeah that makes perfect sense

prisma snow
#

so either do it server-only with an authority switch

#

or do it on both sides, but then you need to implement reconciliation when the server sends the update

graceful viper
#

how would I do something like that?

prisma snow
#

well it is more complex

#

basically you need a way to know what is the state on the server and, even if the client is allowed to temporarily apply locally, the server value eventually overrides the client one