#multiplayer

1 messages ยท Page 703 of 1

real ridge
#

i dont see problem with copy there

marble gazelle
#

when do you delete the characters?

real ridge
#

i dont understand question

#

how when ๐Ÿ˜„

marble gazelle
#

and how do you prevent that the game mode spawns the characters?

#

Well you create instances, fine, but are you sure the character you play with is actually the one you have spawned?

real ridge
#

yes game mode has default pawn class none , character is deleted and also player start is

#

i just dont understand why I have this problem inside editor when I press play

#

and why not when I run game via icon

#

inside folder

#

then is no copy there

marble gazelle
#

hm I have no idea, you will need to debug^^

real ridge
#

I am sad boy

#

๐Ÿ˜„

#

gonna try

#

but I thank u for your interest

marble gazelle
#

^^ any time

tender acorn
#

Guys, anyone would help me via sharing my screen? ๐Ÿ™‚

#

Im still don`t clearly understand what have to do -_-

cold magnet
#

Is changing ownership to the player's pawn for any given actor an idiomatic way to get RPCs working on the actor rather than on the player controller/pawn? Are there any side-effects I should be careful about? Is there a way to "return" ownership to the server after finishing the RPC?

dusky yoke
#

Hey guys, so I got two questions, would really appreciate some light on them ๐Ÿ™‚

  1. is RestartPlayer a networked function? Im somethings getting issues on my Client upon respawning, not sure if its that node's fault or not, but yeah. Sometimes the client is unable to move when spawned, whereas the server can move. Am I doing anything faulty? Also, is the RestartPlayer function compatible with setting up a random respawning system? Because right now its just restarting the player in the place it spawned in, but then I guess I gotta control the initial spawning in maybe the level blueprint, gamemode or something?

  2. If the listen server starts its server and lets say, a client joins after 1 minute, will an actor thats using a Event BeginPlay be off-sync for the server & client? This actor in particular is firing missiles based on repeating timers. When testing earlier online, the event of the actual firing wasnt multicast so that might fix the sync, but the question is still something Im wondering about ๐Ÿ™‚

real ridge
#

guys i have problem here cast to player state always fail.... can someone give me a tip ?

fathom aspen
# real ridge guys i have problem here cast to player state always fail.... can someone give m...

It's either Custom Players Controller is null or the Player State is null(debug your code so you know by inserting a breakpoint).
If it's the former I would use Get Owning Player function instead. If it's the latter you would need to call an event dispatcher that sets the player state inside this widget once Player State is replicated and that's using a RepNotify. I'm not sure if the RepNotify is exposed to BP though

final oriole
#

can someone tell me why the last node doesnt work

#

im trying to make it so people cant see the pawn anymore

#

and I want it to be networked

fathom aspen
#

Last node ignores collision, it doesn't make your pawn invisible

#

You should be using SetActorHiddenInGame

final oriole
#

visibility channel is only for raytracing

#

it doesnt effect visibility ?

#

also using a replicated variable? is it always necessary if youre already running stuff on a function thats a server rpc

#

i was trying to replicate a light switch and it wouldnt work until I used a repnotify variable

fathom aspen
#

Well I'm not a collison guru, but visibility channel doesn't mean what you think it means

fathom aspen
final oriole
#

im trying to make the actor invisible on the server but not the client and I cant figure out where to set the actor visible again

#

anyone pro in networking ?

fathom aspen
#

GoVisible is executing on client which is bad. It needs to execute on the server

#

Also it doesn't make sense to go visible again immediately right after that. But if you really wanna do that then just call SetActorHiddenInGame(false) right after.

final oriole
#

I deleted the go visible thats in the server call and added a small delay

#

that seems to have fixed it

final oriole
near bison
#

Has anyone used TurnBased built into Unreal? Any success?
What's the quickest path to build a turn based game in Unreal?

fathom aspen
# dusky yoke Hey guys, so I got two questions, would really appreciate some light on them ๐Ÿ™‚ ...

RestartPlayer is a game mode function. So it executes on the server, and as long as your pawn is replicated(which I assume it is) then you're good to go.
What RestartPlayer does is it calls FindPlayerStart, which in turn picks a PlayerStart and spawns the player there. So if you want to change how your players are spawned in these PlayerStart actors, then override FindPlayerStart in your GameMode class.

mellow stag
#

Why am I getting this stutter?

fathom aspen
dusky yoke
fathom aspen
#

Correct

#

If you want to make sure players don't spawn next to each other, I think you want to save an array of all player starts and add and remove to that when needed.

#

Well I just looked through the source and it looks like it already does that for you ๐Ÿ™‚

dusky yoke
#

Thats awesome!

mellow stag
#

WizardCell do you know why I may be getting this stutter? How could I improve the replication?

real ridge
#

@fathom aspen man i am 23 ๐Ÿ˜„ i feel so bad that u are so smart compared to me I am newbie here

fathom aspen
#

You would probably want to look through the network settings in your CMC @mellow stag

real ridge
#

u are working with ue or just its your hobby ?

#

ahhh fck still doesnt work can I send here 2 pictures of blueprints so maybe u can see if its problem there :D?

fathom aspen
real ridge
#

i started last year

#

with singleplayer

fathom aspen
real ridge
#

Ah I just got job also with UE thats why i am learning as much as I can

#

because I am still at university

#

this is my first programming job ๐Ÿ˜„

#

so here on fist I have editable text in widget i am trying to cast inside custom player state and edit name ( which is replicated)

fathom aspen
# real ridge because I am still at university

I'm too. That's why my learning pace is a bit slow. I've also been off unreal for like two years ๐Ÿ˜„
But yeah you gotta get your hands dirty with this engine so you get better at it

real ridge
#

and here is widget 2nd its lobby when I have READY button I am clicking on ready so I can print names of players

#

but I am printing default value "player"

#

its like server doesnt know about change

dusky yoke
#

Is there a way to make the integer-setup more flexible? I.e adding one extra player start to the map would break it right?

real ridge
#

and I have to say that use of get owning player helped with casting no more cast fail

fathom aspen
#

That's why it's printing the default value of the variable, because the variable isn't being set the right way

mellow stag
sinful tree
fathom aspen
real ridge
#

but it is possible in widget ?

quasi tide
#

Widget's are client only

real ridge
#

i kno but i am typing that name inside widget and also I need print it in widget.... So I need set and get it there

sinful tree
#

You can then call the event on the playerstate from the widget.

fathom aspen
real ridge
#

moment

#

and only server event

#

or also multicast ?

#

does rpc mean multicast and also server

#

event ?

sinful tree
#

Just server.

real ridge
#

guys i am gonna try thank u ๐Ÿ˜„

#

i hope i dont act like idiot

young lily
#

I'm experiencing jittery movement on a connected client's character when they move "through" a "disabled" Actor that has a StaticMeshComponent which is invisble and shouldn't have collision. I do this to hide said actor and deactivate it's collision:

Mesh->SetCollisionEnabled(ECollisionEnabled::NoCollision);
Mesh->SetCollisionResponseToAllChannels(ECR_Ignore);
Mesh->SetVisibility(false);

The Obstacle is set to Replicate, as is the Mesh (via SetIsReplicated()). Do I need something else?

#

I suspect the collision is set correctly server sided but not replicated correctly to the client or something like that

lost inlet
#

and do you do that both client and server side?

#

collision properties are not automagically replicated

young lily
#

I thought I'd be clever and do this:

if (GetLocalRole() < ROLE_Authority)
{
Destroy();
return;
}
Because logically the client shouldn't need to know about the actor anymore

#

or so I thought

#

Might there be an issue if I just destroy it on the client, but not on the server and it's sort of replicated still?

dusky yoke
young lily
young lily
fathom aspen
young lily
#

I would absolutely love to use live coding, but it appears not to work with UE5 and Rider (at least on my machine), or I just haven't figured out how to set it up correctly

fathom aspen
#

Ah if you're using UE5 then you don't have to worry about hot reload. LC is on by default I guess

#

I could be wrong, I don't use either one hehe

young lily
#

Yes, but errors ensue. Probably works with VS. But Rider for Unreal I believe is still in an early stage, I use the EAP currently

#

But I'm still new-ish to the entire UE / C++ thing. Might just be a layer 8 error there ๐Ÿ˜„

quasi tide
#

It is on by default from what I recall (UE5). To use live coding you don't compile with Rider. You compile with UE (it'd be in the bottom right). You can also use the shortcut.

#

I forget what the shortcut is though.

young lily
#

me too. I use this little buddy all the time:

quasi tide
#

And Rider is โค๏ธ

abstract sundial
quasi tide
young lily
abstract sundial
#

I mean It wasn't a secret ^_^ we were planning to release it at GDC, but... some stuff happened...

quasi tide
#

Nope - I'm going with it being a secret and we heard it first.

#

Makes it more special.

fathom aspen
#

Well I should start considering moving to Rider then ๐Ÿ˜Ž

real ridge
#

so I dont understand whats the problem if I am retard or smth else

fathom aspen
real ridge
#

i dont know how can I find out ๐Ÿ˜„

#

it have to be executed

#

...

fathom aspen
#

Make it Reliable, and see if it's being called/executed

fathom aspen
real ridge
#

and also its annoying to always build server side after compile , I am using dedicated server on my pc ah ๐Ÿ˜„

real ridge
fathom aspen
real ridge
#

u mean inside editor ?

fathom aspen
#

Yes

real ridge
#

sometimes I do but .... sometimes I need anyway to build it dont know why I am just amateur so problem is on my side on 80%

#

whatever

#

we learn by mistakes

#

๐Ÿ˜„

fathom aspen
#

Did you try debugging your code?

real ridge
#

I just tried to print hello betwen custom event and seting name in state and its executing because I am printing hello

#

so dont know where the problem is....

#

so i think this is correct

fathom aspen
#

Executing doesn't mean it works as intended.
That's why you gotta debug your code.

#

Debugging let you inspect values at runtime

real ridge
#

So if I run it over editor I can see values irl

#

now i am running from folder

fathom aspen
#

Ah correct, I totally forgot about that

real ridge
#

๐Ÿ™‚

fathom aspen
real ridge
#

hmm its interesting i am spectating server and i dont see that something is running but print works wtf

#

this wont work i just dont see anything

#

i just have there a lot of clients.. and noone from client 3 is matching

#

i dont understand u

#

how ?

#

yes

fathom aspen
fathom aspen
#

Show the code where you do the attachment

real ridge
#

ah I am done ๐Ÿ˜„

#

I dont understadn I made points and everything over server and I cant make names

fathom aspen
#

You shouldn't be doing attachments on client. You do it on server and it replicates

real ridge
#

๐Ÿ˜„ I want help u but I cant I cant make mine also .. ๐Ÿ˜„

#

i am done

#

i dont understand...

fathom aspen
real ridge
#

not in state ?

fathom aspen
real ridge
#

so maybe problem is with print

#

oh my gosh

fathom aspen
#

Well yeah

#

You was printing it before it was really replicated

fathom aspen
real ridge
#

I am printing get player name behind set and as u can see I have your name there and it prints same

#

so

fathom aspen
#

yay my name though ๐Ÿ˜›

real ridge
#

My blueprint for printing it from custom state variable must be wrong

#

I was trying to print saved names in next widget

#

this must be wrong

fathom aspen
#

Both are "after" there

#

There is no before there

#

Once you're inside that RPC you have a name that has to be set. At least that's what you're printing

#

If you really wanna see "before", then print the the replicated property, before it's before it's set

real ridge
#

but anyway

#

its okey

#

that part with saving names

fathom aspen
#

It MUST be okay

#

You was not printing the right thing

real ridge
#

so mistake is in widget where I am trying to print it ๐Ÿ˜„

real ridge
#

and this must be wrong

#

but this is in next widget

#

I just put name

#

then hit join

#

and i am in this widget where I can click on button

#

and try to print all names of joined players

#

and here I am trying to get it and its local

#

maybe because of this it doesnt work

#

ohhhhh

#

iam retard

#

oooooooooooooh my gosh

#

i just created custom event , runned on server and try to print it with it

#

ah

#

you can see how big newbie I am

#

๐Ÿ˜„

fathom aspen
# real ridge maybe because of this it doesnt work

Well it's supposed to print out the names if you really click the button after they have been set. PlayerState is replicated to all clients, and GameState is replicated to clients. So It's all good...

real ridge
#

but it doesnt print it ๐Ÿ˜„

#

well i just tried to make server custom event and call print there and still i am printing default name Player

#

I finish... ๐Ÿ˜„

#

its like instance isnt editable

fathom aspen
real ridge
#

i have i am in half but i didnt have problem before with this i was also savings player score and so on

#

and now I cant save name in widget....

#

dont understand

fathom aspen
#

See #2 and #3 pinned messages from the top

real ridge
#

yep

#

but it doesnt make sense

#

what is happening in my blueprint

#

I have same game mode same player state on map

#

because I am going from entry map where I am putting name to Lobby map

#

both have own widgets

#

in lobby map I am printing names...

#

it has same mode , cclass etc

#

it looks like lobby widget is connecting to not same customplayerstate

fathom aspen
#

Well make sure CustomPlayerState is the PlayerState Class you use in your GameMode class

fathom aspen
real ridge
#

all that things are okey I had diferent game modes but now I changed to same , but still there was same player state class.. iam going to relax now ๐Ÿ˜„ i am trying to do this almost 4 hours i am done

fathom aspen
#

Also for your knowledge, Player Name won't persist level travelling if you don't tell it to. That's why I suggest you get to know how networking works in Unreal. Again read Cedric's Compendium(#3 message in pinned)

real ridge
#

Okay.

#

so i think problem is that somehow custom player state on map 2 isnt same as custom player state on map 1

#

and thats why i am printing default ๐Ÿ˜„

fathom aspen
#

Wait are you travelling to a new level?

real ridge
#

I thought using event on server side is everything done

#

I am in Level 1 (start menu) and after filling name and clicked join I execute console comand to my server IP and (open ) level 2 (server)

fathom aspen
#

Ok you didn't say that

real ridge
#

oh i know i see it now.. i am retard

fathom aspen
#

At least I didn't see it

real ridge
#

i cant set server value if iam not on server

#

i am in server after execute

#

.... no ?

#

omg

fathom aspen
#

Info in the PlayerState don't persist if you don't tell it to

real ridge
#

so after I open server with ip it is deleted ?

#

and there is default value

fathom aspen
#

There's a function called CopyProperties in PlayerState that does that. You will have to use it. Also probably you will have to use another function called OverrideWith

#

That's why you should read that Compendium ๐Ÿ™‚

fathom aspen
#

You will have to use either the GameInstance class or the method I said above with the PlayerState

real ridge
#

gameinstance is good

#

i can save player name there

#

then after server opens

#

i will save from instance inside state

#

and its done

#

yep ?

fathom aspen
#

Well no, it's not a good practice

real ridge
#

so i am gonna read compendium

fathom aspen
#

PlayerName is a player specific info. It should reside in the PlayerState

real ridge
#

you are patient with me ๐Ÿ˜„

fathom aspen
fathom aspen
#

sometimes

real ridge
#

thank u man

#

ah

#

๐Ÿ˜„

#

I love u

tender acorn
#

Guys

#

Why this stuff doesn`t work as i want? ๐Ÿ˜„

thin stratus
#

What is calling the ServerRPC?

tender acorn
#

When i use it in "server" - it`s destroying only in server

#

On the other hand, when i use it in "client" - its destroying in server too, but in my side its still exist

thin stratus
#

Is the Actor you are trying to destroy replicated?

tender acorn
#

Hit Actor 0 goes from function "LineTraceBeChannel"

thin stratus
#

Why is the variable marked as replicated if you send it via RPC anyway?

#

Replication goes from Server to Client. If that variable would actually be used properly, the Server would be the one setting it, which means there is no need to pass it along.

#

But if you pass it along because the LineTrace only happens locally, then why marking the variable replicated?

tender acorn
#

Im new a multiplayer and other RPC stuff, so i haven`t answer for you ๐Ÿ™‚

thin stratus
#

Is the LineTrace only run locally?

#

What calls the LineTrace?

tender acorn
#

Input Action

thin stratus
#

So you press a Key, you Trace, and you send the Traced Actor to the Server and want to destroy it?

tender acorn
#

Yes

#

Is it wrong way?)

thin stratus
#

Yes and no

#

In theory that works, but you should RPC right after the Input, and let the Server perform the LineTrace

#

Because otherwise Cheaters could destroy whatever they want

#

But let's assume you don't care about that

#

You don't need the variable (HitActor0) to be marked as Replicated

#

The only thing that must be given is that the Actor you hit is replicated

#

So in its Blueprint, the Replicates checkbox is checked

#

Otherwise, sending it via the RPC will result in a nullptr for the Server

#

Cause they can't connect the instances via netids

tender acorn
#

Hmmm

thin stratus
#

What Actor are you tracing?

tender acorn
#

StaticMeshActor

thin stratus
#

A StaticMeshActor is not replicated by default

#

So this can't work

#

You would need to make your own Blueprint with a StaticMeshComponent and set the Replicates boolean to true

#

Then it will work to send it via the RPC

tender acorn
#

Can i change it`s parent to Actor without any issues?

thin stratus
#

StaticMeshActor is a default engine class

#

Are you inheriting from that or why are you asking?

#

CanvasPanel is part of the Palette

#

Top left, just search for it

tender acorn
thin stratus
#

That sentence doesn't make sense. You might be mixing up some of the terms. Is the Actor you are tracing one that you made your own Blueprint of?

tender acorn
#

yes, it has own

thin stratus
#

Then open that BP

#

And go to the Class Defaults

#

(Big button at the top)

tender acorn
thin stratus
#

Then on the right, there is a lot of settings

#

But you said you are tracing the StaticMeshActor

tender acorn
#

I thought you ask about it

thin stratus
#

No that's the Parent of your own BlueprintClass

#

So you are tracing your own BlueprintClass

tender acorn
#

Yes

thin stratus
#

Remove the replicated property of the HitActor0 variable

#

And ensure that what you are tracing is 100% that Actor by printing its name

#

Also, you should add print strings to your ServerRPC to ensure it even reaches the server

tender acorn
#

It`s tracing this one, yesh

#

yes*

thin stratus
#

Right, then try to check if the RPC even calls on the Server and what the Actor pin is

tender acorn
#

SwitchHasAuthority helps me?

#

To make sure that calls on the Server

thin stratus
#

It basically double checks. You can keep it but it's not really changing much

tender acorn
#

HasAuthority almost equal to "Run on server"?

thin stratus
#

No, it checks if the caller is the Authority over the Actor or Remote.
But since you move the call to the Server with RunOnServer RPC, you kinda can't get the Remote pin to trigger, unless maybe a cheater tries to call the function manually. But replicated Actors can't be destroyed locally, so they wouldn't gain anything from it

#

Well They can be destroyed locally, but that wouldn't replicate to anyone else.

#

Only the Server has the "AUTHORITY" over that

tender acorn
#

Well, look

#

kinda weird thing

#

I add stuff for destroying, like, you know, changing material during destroying etc, and add a string to see what actor we are looking rn, but as i said in server-side its destroying properly, but in client-side its changing material, but when i wanna trace this actor, the server tells me that: "Server: "

#

so i guess it`s a nullptr as you said

#

And this only after changing material to basic, before that server knows about my "actor"

thin stratus
#

The Server probably destroyed it and that's why it can't find it anymore

#

The strange thing is that it doesn't seem to destroy it on the client?

tender acorn
#

Yes

thin stratus
#

I would suggest you try to reproduce this once more with a very clean setup, without any material changes or so

#

Because this is a very simple thing and it should work if you marked the Actor as replicated

#

(which you did)

tender acorn
#

The same thing

#

In server its ok, in client-side its alive

thin stratus
#

Just for sanity, can you open the Blueprint where you have Replicated checked and set NetLoadOnClient to false

#

And then try again

#

Just wondering, although it shouldn't make a difference

tender acorn
#

the same ๐Ÿ™‚

#

i noticed one thing

thin stratus
#

Right, figured as much

tender acorn
#

after destroying it, the mesh in this BP still alive, but without collisions

#

*if it`s important thing

thin stratus
#

I would assume it's pretty buggy collision

#

For the Client

#

Because for the Server there is nothing blocking you

tender acorn
#

yes

thin stratus
#

Yeah that's expected if there is an object only on the Client

#

Stupid question but are you placing these actors by hand into the scene or are you spawning them runtime?

tender acorn
#

runtime ๐Ÿ˜„

thin stratus
#

Coooould you show me how you do that?

#

Because I have a feeling that you spawn it locally too

#

Which would mean your client has a second instance of it

tender acorn
#

could we go the voice chat just for sharing screen?

thin stratus
#

Na, sorry, it's late for me and I can't be loud anymore. Wife would kill me .P

#

Just screenshot it quickly

tender acorn
dark edge
#

@tender acornWhy are you not just spawning a replicated actor on the server?

#

@tender acornWhy are you not just spawning a replicated actor on the server?

thin stratus
#

They do now. I already helped in DMs and I assume they wanted to post the solution along the problem but then Discord died.

mellow stag
real ridge
#

@thin stratus Can I ask how can I pass information about player from player state when I am in start screen not connected on server and type there name then I join to the server and want print all players in lobby but my informations won't stay there

tender acorn
#

Guys, if anyone would get the same problem, this pictures showing you how you DONT spawn actors

tender acorn
dusky yoke
#

Hey guys, is Event Begin Play replicated? I got a missile firing actor that fires missiles on a timer on BeginPlay, and its out of sync online. The firing rate is different, so Im guessing the EventBeginPlay for the client who joins after the server is different than the server's... Or maybe I have to force the timer to the clients somehow ๐Ÿค” Some google searches lead me to adding a ref to the counter in a gamemode.. Do you guys have any recommendations? ๐Ÿ™‚

real ridge
sinful tree
#

Too much assertion of dominance in that video.

dusky yoke
#

So the problem is most likely within the timer, but Im struggling to figure out how to work around it. One thing could be the WorldDeltaSeconds, which I think wont be replicated properly just out of the box? So I tried using this instead (as show in picture), but now the missiles never fire ๐Ÿ˜… (Was trying to multiply by 1 to see if changing the value would help, but no. Using the default pin there didnt help either)

real ridge
#

and what type of object is missile

dusky yoke
#

Its run by the RealisticProjectile plugin (Multiplayer Projectile Physics)

real ridge
#

hmmm so I guess I can t help then :D if physics is ok

dusky yoke
#

Yeah I think physics are okay, its more of a timer problem I think, since its off-sync (the actor that fires the missiles fire them off-sync, which is ran by these timers)

#

Thanks anyway! ๐Ÿ™

real ridge
#

for better understanding if u have 3 actors there u fire on 1 but on other 2 u see it delayed?

#

right

dusky yoke
#

Somewhat, yes

#

Its a missile launcher that fires missiles into the air. When the client joins, the missile launcher is firing X amount of time after the server's missiles have already been fired

real ridge
#

and are u calling fire on server

#

and multicast also

#

is reliable ticket?

dark edge
dusky yoke
#

Hmm, but if it fires on server only the clients wont see them though - however, same thing happens if I just make it a multicast too. Havent done this kinda stuff before, been easier with basic linetraces & replicating damage & traces that way ๐Ÿ˜…

#

@dark edge @real ridge Here's what I've got so far:

#

Hmm, the rotation needs to be fed to the server/client properly aswell, doesnt it ๐Ÿค”

#

Havent been replicating that

dark edge
dusky yoke
#

As close as possible. When the missiles hit the ground they explode and damage the players. Having missiles fired in all different rotations on clients and server thats gonna be pretty bad

dark edge
#

Okay then it's just a simple as a replicated missile spawner spawning replicated missiles.

#

On the client side, the spawner should just be sitting there looking pretty.

dusky yoke
#

Yeah ๐Ÿ˜…

dark edge
#

Start out without multicasting anything. This should be no rpcs. The spawner is a replicated actor, which spawns replicated actors, the missiles.

dusky yoke
dark edge
#

You're making this way harder on yourself than it needs to be. Just have the spawner, on server only, spawn missiles, which are replicated. The thing that is replicated is the fact that the missile exists. Assuming the missile movement is already replicated with whatever movement component you are using, it'll just work.

dusky yoke
#

Hahaha yeah you're saying something there! I feel a bit under depth tackling this hehe, but is this what you had in mind?

#

This is within the artillery itself - but if its only spawning on the server the client doesnt see the missiles

low helm
dusky yoke
#

Hmm, in that case Im not replicated properly, because they only spawn on the server. I mean, the projectile (missile) is replicating itself, but its not being spawned on the clients

#

@low helm

low helm
dusky yoke
#

Hmm ๐Ÿค” Yeah I'll have to sleep on this one ๐Ÿ˜…

low helm
ashen stone
#

I'm doing a souls like and local prediction of the roll ability (sending direction to cast it from client to server) but sometimes if the player is a small amount of distance error from where it was cast on client ir breaks everything.

Is maybe sending the position it was cast on client and on server waiting for it to match (with a small error tolerance) the right way to fix it?

Obs: on video it 400ms and 20% packet loss just to show the problem

#

this is really strange

ashen stone
#

It looks like a problem with TargetData "AbilityTargetDataSetDelegate" and packet loss.

plucky prawn
#

is there a good way to detect if a player is returning back to a server they left? i can think of a few options (eg storing this in player state which im saving on leave and loading on join) but i wanted to know what you guys think

ashen stone
plucky prawn
#

if i have a replicated property and set it on the server via assignment (eg myThing = myNewThing) it automatically gets replicated right? or do i need to call a function after to replicate it

ashen stone
#

It is replicanted If you add on the replication list

mellow stag
nova wasp
#

almost certainly want the client to have authority over their own rotation to an extent here

#

otherwise they will have to wait for the server to send them their own viewmodel rotation like what I assume is happening here?

mellow stag
#

@nova wasp How would I fix this? Sorry a bit confused

nova wasp
#

have the client's machine control their rotation

#

instead of just reading the server value

mellow stag
#

Would that be a simple change?

nova wasp
#

probably?

mellow stag
#

Let me ss my blueprint rotation see if you notice anything

nova wasp
#

you may just need a switch on authority somewhere for all I know

#

or just have it use pawn control rotation

jovial dawn
#

hello there, I know it's late

#

I'm wondering, when I compile my server, should I include only the main level? where I need to include the menu level?, the menu level is where we choose the player.

#

normaly the player only joining main level and level that the player is spawn no ?

mellow stag
#

@nova wasp

#

Is this what you mean by use pawn control rotation

#

?

elder sage
mellow stag
elder sage
#

yeah that would be why, I'll bet

#

let me make a screenshot

mellow stag
#

Ok ๐Ÿ™‚

elder sage
#

that can go in the pawn or the controller, but the pawn is a bit easier for dealing with replication

mellow stag
#

Interesting

elder sage
#

I guess it could go either way, depending on your controller's relationship to pawns

mellow stag
elder sage
mellow stag
#

It's in the BP_Character_Player It updates the chars rotation

elder sage
#

unplug it and see if it works anyway

#

that's very likely the thing causing stuttering

mellow stag
#

Yeah that's it

elder sage
#

replicated actors have their transforms replicated as well

#

so basically you were setting it multiple times and it was correcting itself

prisma snow
#

I am setting up some very basic IP based multiplayer widget. Everything seems to go well (the logs show that the connection is established) but the client that joins the game, doesn't "start" the game - it gets stuck in the same level it was before

near bison
#

what's the best way to model a multiplayer game with cards?
suppose player A trades a card with player B, can we trace out an ideal scenario?

#

should I create a full blown class for my cards? (will need a string to represent it + anims, images for it etc)
and when I transfer a card between players, do I send just an int over the server, and then tell the client to take care of the rest?

prisma snow
prisma snow
near bison
#

@prisma snow when I get a card from another player, show a cool animation, show it in my hand (i.e render my List<Card> neatly), + it has an associated sprite etc

prisma snow
# near bison <@!455025316633772032> when I get a card from another player, show a cool animat...

Not want to be condescending or anything, but are you familiar first with Unreal's replication system? I feel like your questions are more general than geared towards multiplayer. You can "architect" your game in a number of ways, which is semi independent of how to replicate over the net. Generally speaking you'll have a copy of the objects in both client and server, do the important logic server-only (to avoid cheating etc) and send the results to the clients

near bison
#

I have 2+ years of experience of hardcore game dev experience with Unity + multiplayer ๐Ÿ˜›

#

And yes, it is more of an architecture question than MP, just needed to think out aloud

#

When a resource card needs to be traded, I am probably only going to send an int over the wire, but will handle rearranging of List<card> on clients @prisma snow

raw thunder
#

Hello everyone,
I am making a multi-player (listen server) ARPG with melee linetraces.
It is working well but I don't really like the flow right now:
Client press button - > server commit the skill (check if can launch, stamina, mana, etc) - > back to client for linetraces on the weapon - > apply point damage (server). There are a lot of back and forth between the server and the client... Is there a better way of doing something like this?
Or maybe it's the normal way and I'm overthinking haha?

bitter oriole
#

Yeah, do everything on client and server at the same time, predict the result locally on client and then roll back changes if needed

#

That'd be a more usual way

raw thunder
#

Because I need to linetrace on the client side right?

#

I am not able to make the linetrace on the server, it does not follow my markers on my weapon

true grotto
#

Hi there! I have a problem, i spawn a weapon(replicated actor) and try to SetOwnerNoSee, but nothing is changes. Where is my mistake?

Server function

SpawnWeapon_Implementation(TSubclassOf<AKT_BaseWeapon> InWeaponClass)
{
    const auto LWeapon = GetWorld()->SpawnActor<AKT_BaseWeapon>(InWeaponClass);

    LWeapon->SetOwner(PlayerCharacter);
    LWeapon->Mesh->SetOwnerNoSee(true);
}
bitter oriole
#

Assuming cooperative play

raw thunder
#

If possible I would like to do as you say, on both server and client then change if the result is different, to remove the lag

prisma snow
# near bison I have 2+ years of experience of hardcore game dev experience with Unity + multi...

Ohh ok, nice :D
Given how Unreal's replication works, generally speaking you can architect your game almost as if it was standalone, the replication can be handled in each class. For example, if the deck of cards was an actor (AActor), it could automatically replicate its state (variables) to all clients.

I'd say that a card game falls very well into Unreal's default tools so you shouldn't need anything out of the ordinary. I'd look into this if you haven't already, it is a very good resource to learn UE's networking:

split sentinel
#

Hey, i am working on a multiplayer game that should run on a dedicated server, but i don't know any "providers" other than playfab (but playfab needs your creditcard information and i don't have a creditcard yet. But i have paypal). Can anyone recommend me a "provider" i can upload my server build on? I will switch to playfab eventually, but for now i just need a server to test the game on

pallid mesa
#

Nitrado

split sentinel
#

isn't this a minecraft thing?

real ridge
#

guys I have CopyProperties in player state for copy my properties when travelling to another level and also OverrideWith when connnection problems but How to call them ? I tried it in widget by casting to player state and this function doesnt appear

#

i mean this I have level where I put player name and then save it in player state then I click connect to server and I am in lobby where I have to set READY BUT ๐Ÿ˜„ I dont know how to pass info from player state on first level (not on server) to second level where I am connected on server

#

its propably easy know anyone ?

split sentinel
winged badger
real ridge
#

its not seamless travel because I am traveling from client map (local on pc) to server ( i am connecting by execute command ip ) so i dont know how to pass info there

winged badger
#

that will just not work

real ridge
#

so I have to use instance to save name ?

#

and then load name from instance to player state on server ?

#

or

winged badger
#

server doesn't have a client instance of PS to copy the data from

#

when you do a hard travel

real ridge
#

so there is no way to make it like this

winged badger
#

any c++?

real ridge
#

I must create instance and there variables which I will put inside player state ๐Ÿ˜„ , full blueprints

#

I thought that some legit way "exist" for this

winged badger
#

generally, there is a good c++ place to put the sending PS data to server on hard travel in

real ridge
#

so I can try

winged badger
#

APlayerState::PostNetInit, its also the first place where its safe to send a server RPC from a PlayerState

real ridge
#

so with c++ is chance

#

the easiest is use instance but i dont know if its right

#

because instance will be local for player

#

and will not delete after login on server

winged badger
#

generally, a subsystem is a better way to go about it

#

doesn't clutter the GI, and can also take responsibility for say, loading saved player setups from a hard drive

#

we have significantly delayed BeginPlay (procedurally spawn an entire level before its called), so our PlayerStates even on hot join - hard travel get fully populated good 10-15 seconds before the game actually starts

#

you do have an alternate approach though, if the amount of data you need to send is not large

#

sending it via the login url string

real ridge
#

of u too smart for me because I am newbie I try to read about all this and watch some videos thank u

winged badger
#

if all you need to send is a name and few bits of data

pallid mesa
winged badger
#

it can be added to the login url

#

then server would parse that data during Login/PostLogin

real ridge
winged badger
#

you can google the syntax

#

i never used it so i don't know if off the top of my head

real ridge
#

just be patient with me please if I am asking dumb questions XD I will do

winged badger
#

but generally its ?data appended to the url string

split sentinel
real ridge
#

@winged badger can you help me how to cast inside player state from game mode ? I want set there name from instance

#

after login on server

#

in on post login

#

i dont know what use as input in object

winged badger
#

you should not be doing mulitplayer yet then ๐Ÿ˜ฆ

pallid mesa
real ridge
#

best way is trying

pallid mesa
#

at the end of the day you'll be given a series of machines @split sentinel in which you can distribute your binaries

split sentinel
#

alright, i'll try to contact them and ask if i can upload my own game there

pallid mesa
#

not upload, but use their hosting services to host your game

#

in our case we contacted them and they made a deal for us

split sentinel
#

other services have matchmaking, but nitrado doesn't. How is it supposed to work with nitrado? With a server-browser ingame?

tender acorn
#

Hi all, guys

#

Anyone working with multiplayer project based on ALSv4(Advanced Locomotion System), and if its so, i wanna your help ๐Ÿ˜„

real ridge
winged badger
#

You have player controller reference on postlogin event

#

It has a reference to its playerstate

crisp wraith
#

Let's say I have an actor component that has an array of UObjects. For them to properly replicate. do I need to have an outer of the UObjects set to owning actor of the component or can I leave it at transient? (UE5.0)

Wondering about it, because I'll be moving the objects between different actors/owners (e.g. player drops item on the ground, so now pickable actor is owner of that uobject).

If so, what's the proper way to change outer of an UObject? I can think only of UObject::Rename and duplicating with NewObject, unless there are better ways.

If it matters, only server will be creating and marking objects as garbage.

split sentinel
#

@pallid mesa i called the support and they said that they don't do that anymore ๐Ÿ˜”

pallid mesa
#

aww buggers :(

real ridge
#

@winged badger and @fathom aspen thank u for help I did it finally

real ridge
#

I had to use instance for hard travel from client to server then RPC from server to set state from instance and thats all... ๐Ÿ˜„

#

Now I want ask the easiest way to print player name and status is what ? for example

Jaroslav Ready
Maroลก Unready
Peter Ready
Loko Ready

#

structure ? or save it inside player state also or instance and then print it and append somehow ?

dusky yoke
# low helm It likely is spawning but movement code isnโ€™t setup right so itโ€™s not in the rig...

Hey, so my latenight testing yesterday was never going to bear fruition haha, thanks for the assistance! I wasnt even testing on the server, just simulating in the map itself. So, with a mug of coffee in my hand - when playing online the impacts & explosions are very closely matched, which is great. However, the client cant hear the missiles firing anymore, and client cant see the trajectory of the missile actors until theyre within 20 meters. Its almost like theyre not replicating until theyre within a range of the player or something? Is that a thing?

real ridge
#

name + status

#

name + status

#

from array

fathom aspen
#

I don't see how this is different from what you are doing already

#

Save name and status in PlayerState and print them whenever you want

real ridge
#

yes but I need to customize print because now i am still printing last added name only

#

not alll

fathom aspen
#

Append

real ridge
#

also if its done over loop

#

how to add in append new line ?

#

i kno i use append to connect name + ready but then i need make new line and print second name + status ๐Ÿ˜„

fathom aspen
#

You want to print to screen, or to a widget?

#

If you want to print to screen then that's already done for you, if to a widget then that's a whole different story

real ridge
#

on widget

fathom aspen
real ridge
#

like this

fathom aspen
#

You would need a ListView I guess

#

Again this is a #umg question

real ridge
#

yea thank u my friend

dusky yoke
#

Good afternoon guys. โ˜• Im doing this setup to fire missiles from an actor which are running a multiplayer projectile plugin for trajectory. The missile hits on the ground are replicated pretty well, but the sound of the actor firing the missiles doesn't play, and the missiles don't load until they're within 20m of the clients, at which point it's too late ๐Ÿ˜† This wasn't a problem before, when they spawned normally, so it must be a replication issue. The missile actor and the firing actor is set to Replicate.

Anyone know what I could be doing wrong? ๐Ÿค”

low helm
#

You would need to increase their net cull distance squared

dusky yoke
#

@low helm Hmm, so I increased the value and now I see them when theyre spawning, and I can hear the missiles firing on my clients. However, the missiles disappear before colliding. Is there an issue with setting the net cull distance too high?

#

I set it to 6249999872,0 ๐Ÿ˜…

low helm
#

Itโ€™s a normal feature of replicated movement for something to not arrive in the right place or in the exact right time

dusky yoke
#

Hmm, its actually fine before I swap windows - replications and all looks fine on both windows, but once I swap to the server to doublecheck, and then swap back, the misssiles begin to despawn on the client once I swap back to it

#

I'll have to test it online and see if it's fine there ๐Ÿค”

low helm
#

This is a complicated problem with about a dozen potential solutions

#

You may want to research Netwerk interpolation

#

Because servers donโ€™t send movement information as much as you think

#

The clients have to do a lot of guess work as to where a projectile should actually be, especially a fast moving one

young lily
#

Sorry in advance for the long text ๐Ÿ™‚ I have trouble replicating scores. This is how I currently implemented it:

  • In my GameMode, when a player scores a point, I add a point to their PlayerState. This score is a replicated int32 property.
  • After incrementing the score for the player that scored the point, I call a NetMulticast Method UpdateScores() * on the GameState which then triggers a BP Event, so I can update my UI using Blueprints.
  • In the Widget I bound the Event from the GameState to a custom event which updates the score text. The Custom Event in the widget gets called, but the PlayerState seems to not update.
  • I also update the scores when a new round starts. At this point the player state seems to have updated and the score count at this point is correct.
  • If I play in Listen server mode, the score gets updated correctly and in time, on the client it does not until the next round begins.
    So it seems like even though I added a small delay of .2 s before updating the text, the score has not been replicated yet.
#

Is my approach unnecessarily complicated? I was thinking it would be simpler to just use an event that has the score in a parameter, so I don't do "1. Update Score in PS" "2. Use GameState to tell everyone the Score was updated"

bitter oriole
young lily
bitter oriole
#

No idea, no need to

young lily
#

Yeah, this seems to do the trick. Cheers mate

true grotto
#

Hi there! I have a problem, i spawn a weapon(replicated actor) and try to SetOwnerNoSee, but nothing is changes. Where is my mistake?

Server function

SpawnWeapon_Implementation(TSubclassOf<AKT_BaseWeapon> InWeaponClass)
{
    const auto LWeapon = GetWorld()->SpawnActor<AKT_BaseWeapon>(InWeaponClass);

    LWeapon->SetOwner(PlayerCharacter);
    LWeapon->Mesh->SetOwnerNoSee(true);
}
bitter oriole
true grotto
#

It seems to be true. And only owner see is also only a client side?

upbeat basin
#

Is there any overhead to have a TSubclassOf as an RPC parameter? Or is it a common practice?

fallow shadow
#

My character can jump and look around but cant move as it just jitters me back into place, im using a dedicated server

#

Happens both on PIE and standalone

ashen stone
#

How to sync anim montage over network (like a dark souls tumble) on bad network without jittering every 2 seconds?

#

Is disabling network corrections while animating recommended?

#

The red number on log is distance between where client started the animation and server did

young lily
#

I'm wondering about something I'm seemingly having issues with. I set a replicated FString property in PlayerState on the client side in the PlayerController in BeginPlay(), and it seems not to get replicated all the time, if ever? Setting it via Server RPC it works very reliably. Are you not supposed to use replicated properties in PS for one-time/e.g. set directly after joining on the client?

#

as far as I understand it, replication roughly works either like this:

  • server changes a replicated property
  • it's repicated to the clients eventually

or

  • client changes a replicated property
  • the change is propagated to the server
  • the rest is as above
    correct?
prisma snow
prisma snow
#

Does anybody know if/how ENUMS are packed for the net?

#

I assume bools are packed automatically

prisma snow
#

I'd check that all involved objects are instantiated etc

fallow shadow
#

So no matter what i do, even if i move the character in the editor the location gets snapped back to a very specific location

raw thunder
prisma snow
fallow shadow
#

yes

copper karma
#

Hi, im making a game and im hosting a server, and my friend is supposed to join that server
"D:\epic games\Epic Games\UE_4.26\Engine\Binaries\Win64\UE4Editor.exe" "D:\UnrealProjects\PuzzlePlatforms\PuzzlePlatforms.uproject" /Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap?listen -server -log i host with this ^
"D:\epic games\Epic Games\UE_4.26\Engine\Binaries\Win64\UE4Editor.exe" "D:\UnrealProjects\PuzzlePlatforms\PuzzlePlatforms.uproject" IPADRESS:7777 -game -log
and we both join with this ^

now this does not work, he joins a different session (in which he seems to be the host)
when he hosts and I join him it works perfectly fine.
can anybody help me? thanks in advance

(We are using Hamachi)

prisma snow
# fallow shadow yes

then your character movement component is not working properly. What is happening is that your character moves client-side only, and the server forces it back when applying updates.

raw thunder
# young lily That would explain it

I guess you need to rpc to server then set the variable? I don't know if there is a better way (if you want to replicate to every client's)

fallow shadow
#

well that's what i thought too but how would i fix it

#

i made sure that the cmc is set to replicate

young lily
#

if it ran on the server naturally the props would get replicated

ashen stone
ashen stone
young lily
near bison
#

Does Multicast run on server too? Apart from all the clients? If yes, how to prevent that?

dawn ledge
#
{ ... }```
young lily
#

What @dawn ledge wrote ๐Ÿ˜„

near bison
#

@dawn ledge how to do this in Blueprint

#

is this correct?

#

Looks like it works for me

real ridge
#

Guys How can I create session on selected server with specific IP ?

#

I am just wondering how it works when someone is developing a game and they have server with ip for example 127.0.0.2 and you can connect there and play a game

#

I am just asking because in all turtorials on unreal engine youtube they are using sessions

#

but how its really works irl

prisma snow
#

What you cannot do as far as I know, is to chose your IP

real ridge
#

I have done dedicated server like this

#

and joining via ip

#

but my question is (if I am game dev) and developing multiplayer game How I make it ? I will use dedicated server

#

or how

#

i dont understand

#

๐Ÿ˜„

thin stratus
#

If you want to join via IP; why sessions?

real ridge
#

I am just curious about how its going in real life if I want develop multiplayer game I am working with dedicated server right ?

#

and also then server is only for joining but all job is made on clients pc they call functions and server does it

prisma snow
real ridge
#

listen server is when another player is hosting game ? yea ?

#

And if I use dedicated I need to run it 24/7 right?

prisma snow
prisma snow
real ridge
#

yes I am reading that compendium its briliant... I hope I will be as smart... one time ๐Ÿ˜„

real ridge
#

right ?

#

or this is wrong

#

( i hope its okay to talk about stuff like this )

#

I am really curious and I dont have anyone to ask

prisma snow
real ridge
prisma snow
real ridge
#

ah ๐Ÿ˜„ but anyway thank u but maybe one another question maybe u will know how it works then if I will have dedicated server to host games how I know what part of folders and files must be stored on server to run it.

#

and one more XDD I did dedicated server but folder has maybe 24 GB what is really really much If I realize I dont have anything there no textures only 2 maps with default characters , maybe I can something delete there or ?

#

Imagine to have to download game where 24 gb is nothing

#

and 60 gb are textures

boreal wadi
#

Double checking something before I start writing it. If I'm using the method to client side predict movement actions like sprinting or sliding with a custom movement component in order to replicate the animation states of those actions I still need some replicated booleans on my CMC so that I can pull from those in the anim bp correct?

brave solar
#

Is only relevant to owner not a thing for characters? Can only get them to be visible for all clients or none, spawning non-characters works fine

grim rain
#

Hello, when I try to set a boolean to decide a random enemy from the group of players it only picks the person hosting the server. any way to fix this?

sinful tree
grim rain
#

how would i make it select a random client?

#

run on owning client?

sinful tree
#

You already have it selecting a random player controller. The issue is more to do with where and how you're setting the variable. Game Instance is a bad place to store variables that need to be networked as it only exists on each client and no one, not even the server, can access other Game Instances. Further to this, if you did store it on the game instance and were to RPC values back and forth, it could be a potential place for someone to cheat. Your best bet would probably be to move it to the PlayerState if other clients need to know about the value, or in the player controller if only the server needs to handle it.

grim rain
#

Im using game instance because it selects a random player in the lobby and we switch game modes for the actual game level so i needed to communicate across that

#

thank btw i will look into it

jovial dawn
#

Hello

#

I compiled my project and created a package... but it seem that the server is lisen only on local ip

#

LogNet: Created socket for bind address: 0.0.0.0 on port 7777

#

so it's work if I connect my client to local ip

#

but not from external

#

it's there a way to bind it directly to my static ip

young lily
#

I'm fairly new to UE networking, but in general, 0.0.0.0 should be open to external connections, at least from your LAN. If your firewall/router/whatever gateway doesn't block it, you should be able to receive connections from outside your network too

prisma snow
#

Yep, with NAT routers you might need to port-forward

jovial dawn
#

ok well. my other project when I start the server it bind to my IP. I don't know why it use 0.0.0.0 on this project

real ridge
jovial dawn
#

I add the port-forward to 7777 in my router setting

#

yes I would like to test it with some friend

real ridge
#

you have to find out ip address of your pc

#

in cmd

jovial dawn
#

it's a static ip

#

so never changed

real ridge
#

you dont have dedicated server ?

jovial dawn
#

yes I have a dedicted server

young lily
#

Does your friend connect via the internet or over the same LAN as you are in?

jovial dawn
#

via internet

real ridge
#

so I had also and I could connect from my laptop to server on pc

young lily
#

If you have port forwarding set up, your friend should be able to connect via your public IP if you bind to 0.0.0.0, unless your firewall or something prevents that

jovial dawn
#

I just found it strange that for this project it bind it to 0.0.0.0 , cuz for me it's a local ip

young lily
#

0.0.0.0 is your public interface as far as your machine is concerned

real ridge
#

if you have 2 devices at home try to copy game to another then run server on first

#

open cmd

young lily
#

meaning, you can connect from local host addresses like 127.0.0.1, LAN addresses like 192.168.1.123

real ridge
#

type ipconfig

#

find IPv4 address

#

and try to connect to this address from another pc

#

u need this

#

i think

jovial dawn
#

ok I will try that. thank.

young lily
real ridge
#

or he can find it on router somewhere

jovial dawn
#

in my router setting i port foward the 7777 port to my LAN IP

#

it's there a way to force to use the same port ?

#

I see that it's change

prisma snow
#

What is the default bandwidth limit in UE4.26? It was 10Kbps iirc but I think it was higher in later versions :)

kindred widget
#

100k if memory serves

prisma snow
kindred widget
#

You're not limited to that by the way. Those are project settings in ini files. Easy to edit.

prisma snow
#

So I assume it's 100k bits (not bytes)

kindred widget
#

Not sure about the net stats, but yeah, that setting is in bits if memory serves. Been a while since I've messed with it. ๐Ÿ˜„ Been so focused on UI stuff the last year.

quasi tide
#

I just feel like there is a ton of overlap with a regular gameplay programmer and UI programmer personally. So it kind of feels weird to have them as separate titles.

kindred widget
# quasi tide Genuinely curious btw - if you don't mind; but what actually constitutes a "UI p...

I think that highly varies by studio. I haven't touched slate until this last week at work. My main job is just creating new UI for new gameplay stuff. I've personally implemented an awards system for the game, but I don't touch most gameplay related aspects. I still have to be able to follow them though because I generally need to know if UI bugs are from my own stuff or from data in a gameplay class. But at the same time I've done a small amount of networking and such.

prisma snow
# quasi tide Genuinely curious btw - if you don't mind; but what actually constitutes a "UI p...

I did quite a lot of UI work in Unreal, and also am a Frontend dev at work. For me, somebody specialized in UI might be good at UX, sometimes design, and understands certain principles such as component based design systems, component libraries, how to build/architect a presentation layer, sometimes graphics, shaders... as always, it's hard to categorize.
I agree that at the core we are all programmers

quasi tide
prisma snow
round star
#

Are you not able to add instanced meshes from the sever at runtime? I am trying to replace an actor with an instanced version of itself but to no avail. ..not by having the server add it..or a multicast..or even have the client just do it themselves

echo pasture
#

Does anybody know if the order for clients receiving events is enforced

#

For example, if I have a server send event A and then event B, is it guaranteed that the client will execute A then B

jovial dawn
#

Hum weird I got this error now when I tried to connect with my client to my dedicated server

#

LogOnline:Warning: NULL: No game present to join for session (Game)

#

LogNet: Client netspeed is 100000
LogNet: Join request: /Engine/Maps/Entry?Name=Alienware-R4-FAST-E843D7184BEA539370DC899D3BDC9F76?SplitscreenCount=1
LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
LogNet: Join succeeded: Alienware-R4-FAST-E8

#

it seem that it join but black screen on the client

jovial dawn
#

I think the problem is the map

#

my game has a menu map and the main map... if I compile the server, I need only the main map for the default map ?

#

or I need to set the menumap as default map ?

fathom aspen
snow turret
fallow shadow
#

...RPC?

snow turret
#

Using custom events to replicate, โ€ฆ on client (run on client), โ€ฆ on server (run on server), โ€ฆ on all (multicast).

#

If itโ€™s a replication error

fathom aspen
#

Lol, no yes

#

Was my #1 pull request, so no ones here mock me

echo pasture
#

hilarious

#

but honestly that's the type of commit I would pr too so no shame, typos embarrassingly enough are valid fixes

#

I kinda wanna submit a PR myself just improving the documentation on some functions

fathom aspen
#

Well considering I'm a detail oriented guy, yeah I hate typos, bad names and stuff

echo pasture
#

cause you know some of them will just be one sentence statements that literally explain nothing about what it actually does

fathom aspen
#

Literally. And some are /*An octree*/ if you came by it already

#

I kinda wanted to document some of the stuff the other day, but no, enough of this stuff heh

boreal wadi
#

Question about replication. I have an actor being spawned by the server, the actor has a replicated variable that is initialized by the server before I finish spawning it. Both clients can see the actor being spawned but only one of them can see the information from the replicated variable. I tried using RepUsing and calling the initialize function on the client but the game crashed because of the data being passed was null. How can I go about making sure when an actor is spawned both players know what the data is?

ashen stone
# ashen stone

Thanks everyone for help, i managed to make root motion over network with predictions looks good finally

mellow stag
#

This is my current method on updating the player rotation

#

Although it creates this weird stutter effect when you are not the host

#

If I uncheck the character rotation setting it fixes the issue but then the character doesn't look up or down

#

So how could I use that code but make it so it uses the client as priority rather than the server?

boreal wadi
#

I think you only need to run that code on the server, in the case of listen servers I believe it should only run on tick if the actor running it is not locally controlled that way it will update the simulated proxies but replication has been bustin my ass so I could be wrong here sorry

ashen stone
#

@mellow stag don`t use set actor rotation. Use control rotation

mellow stag
#

I can't find it

ashen stone
#

SetControlRotation

boreal wadi
#

its in the controller

ashen stone
#

yes

#

And on your character you do this:

mellow stag
ashen stone
#

yes

mellow stag
#

gonna try it out ๐Ÿ™‚

ashen stone
#

And do this only on client

mellow stag
#

How would I do it only for the client?

boreal wadi
#

These objects are spawned by the server but only the client that initiated the loot box can see what data is in the pickup and the other client even though they can see the actors the data on them is invalid check the logs top left to see what I mean

#

Everything but the data on the actors is replicating properly. Even though the data is both replicated variable and initialized by the server

fathom aspen
#

Show the code that initiates the loot box

fathom aspen
boreal wadi
#

No the variable is only set by the server

fathom aspen
#

that is initialized by the server before I finish spawning it
I'm not sure how such a thing is possible, but you should Expose On Spawn the property you want to replicate and set it once the actor is spawned(On server)

boreal wadi
#

The server randomly picks a data asset based on some simple logic then spawns the actor from that data asset then passes that data asset to the actor when its initialized. All done on the authority and the data asset member variable is replicated

boreal wadi
fathom aspen
#

I see, never used that function before, so I can't tell if it's causing your problem(although I'm pretty sure it's not)

ashen stone
mellow stag
#

I got it fixed, thanks

boreal wadi
boreal wadi
#

My best guess is because Im working with the Asset manager and these data assets are async loaded by each players controller something is going wrong. I tried to load with the server but nothing ended up spawning. Not much information out there about using the Asset manager in a multiplayer environment, but I'm sure they use it in fortnite so its definitely possible

vague fractal
#

Is there any good reason as to why this here

UCLASS()
class AMyActor: public AActor
{
    GENERATED_BODY()
public:
  UPROPERTY(Replicated)
  int32 MyReplicatedVar;

  void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override
  {
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    
    //DOREPLIFETIME(AMyActor, MyReplicatedVar); <--- Not doing it
  }
};

Wouldn't do a hard crash ?
Like the logs will warn me, but that's about it.
I just don't really see why it is just a warning as it seems very error prone

upbeat basin
#

Is it okay to give TSubclassOf parameters on RPCs?

thin stratus
#

Should be fine, they are assets basically

kindred widget
#

I probably wouldn't unless the class is always loaded class for all machines. If it's a TSubclassOf some character that is normally loaded by softclass refs, you probably shouldn't. Else it's perfectly fine.

silent valley
#

Is there a function I can call to prompt an Actor to replicate property changes immediately?
So if I change a property I want replicated asap...

kindred widget
#

Not really. Replication prediction happens at end of frame if memory serves. You could modify the actor's net priority, but that's a slippery slope.

#

What is so important that a replication needs to happen immediately?

silent valley
#

in this case it's showing that Simulated Proxy is firing a weapon

#

it works ok, just wondering if I can improve it a bit

#

sometimes it doesn't pick up single shots for example

#

I already have specific RPCs for firing etc which are replicated via RPC, this is specifically the looping fire fx

#

Like I say, it works ok, would be better if I could set the bool and tell the Actor to replicate itself asap

#
    /** Force actor to be updated to clients/demo net drivers */
    UFUNCTION( BlueprintCallable, Category="Networking")
    virtual void ForceNetUpdate();
#

this might do it ๐Ÿคทโ€โ™‚๏ธ

bitter oriole
#

Simply do not use replication for events

#

If you need every single data point to pick up on the client yes you actually need RPCs

silent valley
#

Yeah I wasn't clear, I actually forgot how this system worked. All the important stuff is already RPC, the replicated bool is just for looped firing sfx/particles.

#

Tying this visual a bit closer to the shots is what I am trying to achieve

#

It seems to be working anyway

#

Although with low second client framerate it's a bit tricky to see for sure

kindred widget
#

I know for some of those effects people use an incremented counter.

stark tree
#

Hi, I'm trying the Unreal's Collab Viewer Template, as it is out of the box. How do I find the IP of my computer so that my client device can connect to it? (over another wifi network)

faint eagle
#

I'm trying to add some multiplayer to my project but for some reason the client's character movement is fiercely stuttering, especially when I'm changing direction. I was thinking that it might be because for some reason my speed changes don't replicate but I hardcoded the speed in CMC's GetMaxSpeed and nothing changed. What might be the issue for this stuttering ๐Ÿค” ? On an empty project movement works just fine when launching multiple clients

kindred widget
#

Is your movement speed incredibly fast?

faint eagle
#

nope. 600.f

pallid mesa
#

listen server, right?

faint eagle
#

yes. movement works fine on server

pallid mesa
#

what I mean with the question is if you only observed this behaviour in a listen server setup

#

or if you had it aswell in a dedicated server

faint eagle
#

Actually there's even no stuttering on the client's character on other client and server instances

pallid mesa
#

so it's only the listen server sim proxy that stutters

faint eagle
#

oh I'm not even trying dedicated servers yet. I'm just starting learning multiplayer

pallid mesa
#

the server character you see from client 1

#

right?

faint eagle
#

no, it's the other way around. from the listen server POV the client character moves just fine, but from the client's POV his character is stuttering

pallid mesa
#

can you add more clients? and see if other clients stutter?

#

afaik this historical issue is only for the listen server sim proxy

faint eagle
#

I'm testing with 1 listen server and 2 clients to test authority, simulated proxy and autonomous proxy cases

pallid mesa
#

so from client 1 client 2 also stutters?

faint eagle
#

no

pallid mesa
#

or only server stutters from client 1 and client 2?

faint eagle
#

the server's character doesn't stutter at all

pallid mesa
#

okay then who stutters

faint eagle
#

only client's character is stuttering and only autonomous proxy client can see the stutter

#

for simulated proxies and authority roles there's no stuttering for the character

raw thunder
#

Can you check if your client has the same movement speed as the server? How are you setting the movement speed?

pallid mesa
#

well i think you are not udnerstanding what a simulated proxy is

faint eagle
pallid mesa
#

a simulated proxy is defined as the characters that you see in your screen

#

(in short)

faint eagle
pallid mesa
#

no, well it's contextual

#

you need to understand what is meant by that

#

tldr: the char you are controlling in your pc sees other chars

#

these other chars u see are sim proxies

#

except for the one u are controlling

#

which can be authority or autonomous

#

so everything u see in your screen that is controlled by someone else is a sim proxy

faint eagle
#

ok let me rephrase my problem then

#

I have client A, B and listen server LS. When moving player's character on A I can see the stutter on A. Both B and LS don't see the stutter in movement of A's character in their instances

#

so it's stuttering only for A and only for player character, not for B or LS characters which are also on the level right next to A's player character

#

the same applies for B but not for LS

pallid mesa
#

ah so A statutters in A screen?

faint eagle
#

yes

#

but not in B or LS screen

raw thunder
#

For me it seems the client has wrong speed data and server is correcting, that would explain the simulated proxies not suturing. I would suggest to print the speed, sometimes you think you set it correctly but you don't ๐Ÿ˜Š

pallid mesa
#

yeah! what Ysure said

#

it seems that you are doing something wrong!

faint eagle
#

i was thinking about the same thing but i hardcoded the speed for testing purposes

pallid mesa
#

I just asked because there is a historical issue in UE4, in which the listen server sim proxy would stutter and it's unsolvable unless you fine tune the config

faint eagle
pallid mesa
#

mh rn i don't know if maxwalkspeed is being used somewhere else

#

but if you are getting corrections, it should be

raw thunder
#

Print it, it takes 1min

#

If you are setting it elsewhere maybe!

faint eagle
#

k I'll try

raw thunder
#

Are you sure you are currently using maxwalkspeed and not run or something else?

faint eagle
#

i guess so i mean I'm using default movement mode and the MaxWalkSpeed is the one that is used in PerformMovement AFAIK

raw thunder
#

Ok

#

If the speed it normal on client I have no idea sorry

real ridge
#

does exist some turtorial or guid how to create own subsystem ? and also questions multiplayer games like Battlefield etc are using own subsystem or subsystems of some platforms ?

faint eagle
#

okk so I added these loggings and what i've got is weird. While I was running straight client A didn't experience any stuttering and speeds were consistent for both A and LS but as I started turning left and right an obvious difference started appearing in logs so it is something about velocity. I guess I just have to find where exactly speed is changed when turning and why isn't it replicated ๐Ÿค”

nova wasp
#

which side of the bed they woke up on?

faint eagle
real ridge
#

guys How can I get info about server for example how many players are there if I am inside lobby ( not connected on server )

#

I want my game with max 2 players so I want to check if on server are 2 and then connect via execute command

marble gazelle
#

hm I guess for this you need some service to do that, that talks to the game servers. Don't think it makes sense if each client asks each server if there is space or not. Maybe the EOS can help? But I never used that, so no idea.
How ever you could join as spectator maybe and then join a team if there is a slot left

mild urchin
#

Hello everyone, I am making a system to change the player's material depending on the team he joins. I'm using repnotify for this, however if the first player joins, the second player joining the game won't see it's colour. Does anyone have an idea why ?

#

Also adding a delay makes it work for some odd reason

little finch
#

hey guys

#

i have a scope material

#

but it kinda fucks up in multiplayer

#

the scope shows the view from another player's scope camera

#

its the picture in picture style scope

#

how do i fix this issue

bitter oriole
#

Literally impossible to say without understanding in-depth how you implemented your scope camera

little finch
#

a 2d scene capture component

#

and a plane that is set with that material

#

so it projects onto the plane as an image

#

the view static mesh is the plane

bitter oriole
#

Yeah, I think your mistake is that you have a single render target for all players and then every camera renders on the same thing

little finch
#

so how do i fix that

bitter oriole
#

Probably disable cameras on other players

#

Since the perf cost is enormous anyway

little finch
#

ive made it so that only the owner of the scope can see the static mesh named 'view'

#

but it breaks when there are multiple players with scoped guns equipped

bitter oriole
#

Did you try the fix I just suggested?

little finch
#

yes that worked

#

but then how can i have many players having a scope equipped at once

bitter oriole
#

You probably do not want to have multiple camera scopes visible on screen at the same time if only for performance reasons - one is already a large expense

#

If you really do, you need as many render targets as concurrent scopes

little finch
#

server

#

client

#

as you see the client works fine, but the server scope uses the client image

bitter oriole
#

Just disable the capture on other player's weapons.

little finch
#

ok

#

but how

marble gazelle
#

only setting it up if the actor is controlled by the local player for example

real ridge
#

C++ vs Bp if you want develop multiolayer game for market ?

woven sinew
#

Anyone know why another actor's widget component doesn't show for a new player ?

little finch
#

it is multiplayer compatible#

#

bbut sometimes it switches views

#

the servers sees what the client is meant to see and the client sees what the server is meant to see

#

and the viewpoints keep switching as more weapons are spawned

#

every time, it switches to a new one

pallid token
#

I am passing an int32 as a parameter to a Server RPC, but the value is changing on the server. What could be causing this?

little finch
marble gazelle
#

well maybe you should spawn less cameras, and just attach one camera to the current equipped weapon from your local player?

marble gazelle
real ridge
marble gazelle
#

didn't ship one yet, but 'am working on one, so I'd say yes? But its simply a fact that BP doesn't have all features you could have if you use c++ \o/

real ridge
#

Yes I want to start learn and try to develop for myself because I want own server own subsystem etc

#

hard times incoming

marble gazelle
#

own server?

real ridge
#

yes

rustic kraken
#

I had a question

#

Do sessions work in case of joining public hosted servers?

#

and not LAN?

#

cause i am trying to add voice chat AND VOICE CHAT ONLY WORKS IF SESSIONS NODES ARE USED FOR HOSTING AND JOINING\

#

sry caps

pseudo merlin
#

hi all. I'm working on rapid fire weapons in an FPS now, rather than RPC per shot I just RPC on trigger state down or up and let each client shoot weapon using a local tick. How might I syncronize a random bullet spread in this case? thanks

thin stratus
#

You have to keep in mind that this will always be broken in pie

#

If everyone has their own instance of the game they all have their own render target

#

But in pie you only have one asset and that is shared unless you play without single process enabled

#

pie = Play in Editor

thin stratus
#

If you locally join a fake session it will also solve it

#

Might require CPP though

calm hound
#

@pseudo merlin What i did for my system, which seemed to work fairly well. Was I did an RPC that was BeginFire() and EndFire(), and BeginFire would send off a Random Stream - and all I did was replicate the seed between server/client on fire

near bison
#

Is PlayerArray not available in GameState in BeginPlay? Am I supposed to wait on some other event?

thin stratus
#

It is available but there might be other playerstates still being replicated

#

Which might take longer than beginplay

near bison
#

What's a suggested approach to have a consistent state?

chrome bay
#

Bind to an event on the game state that is broadcast out whenever the PlayerArray changes

#

And listen for changes

#

PlayerArray will change at runtime anyway

near bison
#

There should be some built in event for when my PlayerArray is populated with the no.of players in game

#

This is so inconvenient

#

Also one question: any function I run on GameState runs on all clients?

pallid mesa
#

if you are asking if you can do multicasts in the GS, yes, you can

near bison
#

no..that's not what I'm seeing when I run a function on BeginPlay in GameState. It runs on all clients

#

This is in my GameState. Runs on all clients

pallid mesa
#

because begin play runs everywhere in the GS, as it exists on all clients as James pointed below

chrome bay
#

Makes sense

#

GameState exists on all clients

near bison
#

right right, my bad

chrome bay
#

Unfortunately networking in BP is extremely limiting

pallid mesa
#

and different

#

onreps for example don't work in the same way than in C++

near bison
#

How so?

chrome bay
#

aka the correct way.. still frustrating

#

BP will call an OnRep whenever that var is changed

#

Whether it's on the Server, or if the client changes it locally etc.

#

In C++ they are only called when a value is actually received from the server

crisp wraith
#

I'll try once again ๐Ÿ™‚
Let's say I have an actor component that has an array of UObjects. For them to properly replicate. do I need to have an outer of the UObjects set to owning actor of the component or can I leave it at transient? (UE5.0)

Wondering about it, because I'll be moving the objects between different actors/owners (e.g. player drops item on the ground, so now pickable actor is owner of that uobject).

If so, what's the proper way to change outer of an UObject? I can think only of UObject::Rename and duplicating with NewObject, unless there are better ways.

If it matters, only server will be creating and marking objects as garbage.

  • I have noticed, that if I have actor with UObjects and I collected them with another actor (e.g. picking up items from container). The UObject gets GC'ed on server, but on clients remains until the first owning actor is destroyed.
chrome bay
#

Client-side they will be created using the actor as the outer. But they usually cause crashes then when trying to destroy them etc.

near bison
#

just update the var only in server context ๐Ÿ™‚