#multiplayer

1 messages Β· Page 149 of 1

vagrant grail
#

yes

solar stirrup
#

i have no idea then :/

rich crag
#

@vagrant grail Have not messed with it myself to check, but could it be in the widget scale settings?

vagrant grail
solar stirrup
#

it's more that it's keeping the same size

#

so it looks bigger when they're far away but it isn't

humble wadi
#

We kinda did something similar when a client could reorder things in a table of characters/units but since its game critical information for some game state related changes, we'd only allowed those changes to be made on the UI only (so the client mostly saw those as cosmetic/visual changes only) and not on the backing data storage. Meanwhile, the same client also dispatched an RPC to the server requesting it to change the order of the items but instead of doing it on the UI, it'd do so on the backing data.

When the server got the RPC, it either performed the change or not (depending on whether it was possible from his point of view). In case it was rejected, it basically just ignored the client request. For our use case, we didn't need any acknowledgement to be sent back to the client that, alright, you were right, or you were wrong. If the client mis-predicted, then the next time he'd open the same UI table, it'd see a different order (what the server deemed was right).

But obviously, this could go wrong should the client chain more actions together and start reordering players on the table while there was already a mispredicted one but we kinda ignored it because it's doing some ID checks in the background for ordering and the server will still be able to come up with the correct order of characters/units on his local side. It's mainly just a minor inconvenience for the client that it'll look as if he changed the order in a certain way, only to see a bit different one next time he opens the table. But also, mispredictions are almost non-existent in our context, so we didnt bother to go any further than this.

latent pelican
#

I am looking for any advice on how i can overcome this issue i have setup a multiplayer character selection menu with a weapon select. upon selecting the weapon it changes within the main menu but when I spawn into the multiplayer map only the server changes but not any of the clients please look over the screenshots and assist on where I've gone wrong, I know I'm close just missing something.

rich crag
#

Work it backwards... are you certain your multicast event fires?

#

@latent pelican

gusty slate
#

Hello,
Inside an actor how do I know if it is spawned by client or server? using Local/Remote roles?

rich crag
#

I think

#

i mean, i know thats what it means, i think thats your answer

gusty slate
#

authority should mean you are on the server version

rich crag
#

yes

gusty slate
#

what I need to know is if the actor is a proxy of the server spawned or client spawned

rich crag
#

Im not certain why that wouldn't tell you?

#

has authority should also be able to give you results

#

dependent on your use case

#

you could also use a role check

#

which would return authority or proxy

gusty slate
#

I'll test the values and see πŸ‘

#

Authority should only return if it's the server or remote (proxy), but if it's client spawned, I actually don't know what it'll return lol I'll check the roles those should be more specific

rich crag
#

roles should return auth or autonomous proxy or simulated proxy i think

gusty slate
#

Yes, I should be able to get the info I need from that

latent pelican
#

thank you for the quick response i didnt expect it so fast

#

im fairly noobish so i someone can walk me through to work if its client or proxy spawn that would be a big help

latent pelican
#

okay i tried putting a authority switch in the actor with no luck would it be better to load it from the gamemode instead?

rich crag
#

@latent pelican i think you are getting the two conversations confused... Shinzo was asking about authority. For you, I would first make sure my multicast event was firing.

latent pelican
#

ah okay thank you @rich crag

gusty slate
#

to check that it's a client instance

gusty slate
#

authority would be true both on the server instance and the client spawned

#

and checking simulated just means it's a proxy

#

so it has to be authority + not server

rich crag
#

so the role check didnt return what was expected either?

gusty slate
#

yes because the role would be authrority for both the server instance and the client spawned

#

as they both spawned it

rich crag
#

that doesnt make sense for the role check

#

if the client spawns it it would only return one of the client proxies

#

the client should be unable to return authority, as server is the only authority

gusty slate
#

if the client spawned it, he would be the authority

rich crag
#

not in role

gusty slate
#

that's what I was debugging

rich crag
#

role is literall whether it is server or client

gusty slate
#

Local role is authority when it's client spawned

#

I'll remove replication and make sure 100% 1s

gusty slate
#

it depends who spawned the actor

rich crag
#

lemme make sure im clear on what im saying

#

an athority check should depend on who spawned the actor

gusty slate
#

yes which means both actors spawned by server and client will have authority over it

#

but the replicated proxy by the server spawned won't have authority

rich crag
#

yes

gusty slate
#

which means for me to check that an instance is client spawned

#

it needs to be authority + the world it is part of is Client not host

#

which in BP is checked with IsServer and in c++ under the hood it's getting the netmode from the net drive and a few checks

rich crag
#

OOOH i know why youre getting both from server and client

#

because youre running the role check on both

gusty slate
#

yes! I need in this usecase to check inside the spanwed actor BP

#

after it's spawned

rich crag
#

dont run the role check on the server

#

only run it locally

gusty slate
#

how would I know it's local

#

x)

#

usually that's the job of the role no? but since it's client spawned defeats the purpose

rich crag
#

hmmm because using has authority switch might just be client authority

#

I feel like this should be much simpler

gusty slate
#

yes so the solution is, if you have authority and you're not hosting, you're by elimination the client

#

MP leaves simplicity at the door πŸ˜΅β€πŸ’«

#

haha

#

This basically means it's client spawned

rich crag
#

hey theres a get remote role too

#

you should be able to compare the two

gusty slate
#

it's the same for server instance and client spawned

#

so I can't differentiate with that only

rich crag
#

OOOOHHH it just clicked what im not catching

gusty slate
#

both are Local: Authority Remote: Simulated proxy

rich crag
#

client automatically owns what it spawns

#

lol

gusty slate
#

yep x)

rich crag
#

slow today

#

could you handle it earlier, and just flag the client spawned as such on spawn, then check that flag?

gusty slate
#

I mean I could, just that there's a few spots this would be called and I thought it's safer to do it inside the actor

rich crag
#

right on

gusty slate
#

ty for the help

latent pelican
#

that you for looking into it @gusty slate and @rich crag but how would i go about fixing it so it works as intended again I am a noob when it comes to MP blueprints

rich crag
#

@latent pelican first put a print string on your multicast event and make sure the event fires. The multicast is what is responsible for all the clients getting the same information, so if it is not firing we need to move to earlier in the chain.

gusty slate
#

I haven't look exactly at all screenshots but with things like that you should probably use RepNotify not a multicast

#

and process the state on the RepNotify function

rich crag
#

mmm yeah repnotify is good for that

gusty slate
#

the weapon type variable would be RepNotify which means each client will trigger a function when it's replicated to it

#

because imagine a new player joins, your pawn will be created for them, they weren't there when the multicast was called

#

but if you use RepNotify, it'll replicate that value and then trigger the function

#

where you should update the proper meshes/etc

rich crag
#

because the repnotify just replicates a variable that is consistent and each client deals with that variable individually

#

Im pulling my hair out on my own issue

#

The server stops registering a constant collision once the actors are moving at too fast a speed

weary dune
#

(copying from #cpp)
Good day all. Suppose I have two local players where A is signed into an OSS and B is a guest player. I then have player C, hosting a game, which A and B then connect to. Is there any way that player C can deduce that A and B are connecting from the same device (Say, getting the FUniqueNetId of player A only given player B's APlayerController)? (For context: Need to figure out a good way to get a nickname for a guest player - so I figure that using the nickname of the primary player on their device prefixed by a number is the way to go. The problem is getting that nickname given the player controller of the guest, over a remote connection)

#

It seems that getting the UChildConnection and tying it back to its parent would be the way, but if anyone knows an easier method it'd be appreciated

weary dune
rich crag
drifting quail
#

What could cause a client owned actor to not run a server rpc? I have replicates ticked.

thin stratus
drifting quail
#

I did get owner and printed it and it looked to be the right character.

#

Should I try to get controller id or sumthn?

gaunt crown
#

Is there a way to make Foliage Instanced Static Mesh Component Replicate?

Adding / Removing Instances in the Component doesn't replicate at all. You'd have to do everything outside of the component which will get messy IMO.

#

Trying to do Interactable Foliage. It works on singleplayer of course. But yeah..

#

I've seen some games continue to use Foliage Instanced Static Mesh Component for their trees and add / remove instances, so I know they have a way to do it, but would it mean going into the C++ side of things to somehow make that component replicate for Blueprint use?

vagrant grail
#

Why doesn't this update my health value on top of my head (health plate) for other players, but locally it updates that value for my healthplate but applies the same value to the other player too from the local camera. Let me explain :

  • From Player 1 POV, I go through a Collision box that reduces my HP by 1 every second. From Player 1 POV, it decreases his HP above his head, but it also decreases Player 2 health above his head (to be the same value as Player 1).
  • From Player 2 POV, he's just standing and watching Player 1 going through the damage zone but Player 1 HPs don't decrease above his head, and he doesn't see his own HPs above his head decreasing (so that's good).

The Widget Component is set to replicate, the health value to RepNotify.

What am I missing please ?

drifting quail
dark parcel
dark parcel
#

You should just assign the owner to the Widget. The owner being the character that owns the widget

drifting quail
#

Also are you changing health only on the client? If so, you should have any changes be made on the server and multicast the value

quasi tide
#

RepNotify is correct when changing health. It is a stateful change

dark parcel
#

Make an actor variable , call it Owner in your Widget.
Set it to instance editable and expose on spawn

When you create the widget, set the owner to the character

quasi tide
#

It is also beneficial in order to run stuff when the health does change

vagrant grail
drifting quail
quasi tide
#

Yes

dark parcel
#

U run server RPC if u are the client

#

or simply set the health if you are the server

#

Clients will eventually get the server's health value

quasi tide
#

Don't use the Get Player Character {0} node either. Widgets have a way to get the correct controller/pawn. It's like, "Get Owning Player" and "Get Owning Player Character" or something like that

#

It is decreasing player 2's because you are getting the same character that you are getting for player 1

#

Specifically because Get Player Character 0

vagrant grail
vagrant grail
quasi tide
#

Controller has a method called Get Pawn

#

That will get the currently possessed pawn

drifting quail
#

I have my own question. Can clients spawn actors in their own instance? And if so, would a server rpc not work on it because the server doesn't have a copy?

vagrant grail
quasi tide
dark parcel
#

Where do you create the widget? If you are doing it in your character bp, then simply pass the character to the widget when you construct it

quasi tide
#

No need to cast

drifting quail
quasi tide
vagrant grail
quasi tide
#

Then maybe it's called controlled pawn or something like that

#

But AController has a reference to the pawn it is possessing and you will be able to get that

vagrant grail
quasi tide
#

The result, yes. Because that's where your Health variable lives

#

All of these exist as options

#

So you can do Get Owning Player Pawn and then cast to your pawn.

cobalt pollen
#

I'm having an issue where I'm trying to attach an actor to the player pawn when a level loads. I'm using the possessed event and the listen-server fails to attach it although the client has no issue. (all actors involved are valid at the time)... if I place a delay then the attachment works... any idea what event I should be using instead of pawn possession?

vagrant grail
dark parcel
#

@vagrant grail how do you reduce the health?

dark parcel
#

for your widget

#

@vagrant grail yeah but what triggers it

quasi tide
cobalt pollen
# quasi tide How do you know that all actors are valid at the time? Delay causing it to work ...
{
    if (IsValid(ShipComponent)) {
        if (ShipComponent->CanAttachTo(this)) {
            ShipComponents.Add(ShipComponent);
            Mass += ShipComponent->Mass;
            ShipComponent->AttachToActor(this, FAttachmentTransformRules(EAttachmentRule::KeepWorld, true));
            ShipComponent->SetAttachedState(true);
            RecalculateCapsuleSize();
            return true;
        }
    }
    return false;
}```this is my pawn method that attaches it, the ShipComponent actor is valid and the method returns true
#

I'm assuming the pawn is valid since it's the one that is calling the method...

vagrant grail
quasi tide
cobalt pollen
quasi tide
quasi tide
vagrant grail
cobalt pollen
#

I'm not sure how else I could check the result of AttachToActor

quasi tide
cobalt pollen
#

I guess it has a bool return DOH. Going to log it brb

vagrant grail
quasi tide
# vagrant grail In the Player Controller

Okay. So you're having the exact same issue as before because you're giving it the exact same controller.

So, you can go about this a few ways

  1. Have the health on the playerstate and when the playerstate's health updates, update the widget.
  2. Pass in a reference to the character when creating the widget (what ColdSummer suggested before) and update the widget when the character's health updates

You won't be able to rely on the UMG player controller stuff because well...other client's player controllers don't exist on the local machine (unless server).

cobalt pollen
#

That's going to haunt me though lol

quasi tide
#

Just Unreal thingsℒ️

vagrant grail
dark parcel
#

@vagrant grail I would follow Duroxxigar advice in regards to player state,
But this is a very simplistic way of doing it (Don't even know if I'm doing bad practice, just a newbie who are struggling with mp)

quasi tide
crisp shard
#

should footstep sfx be on the client and then server -> multicasted to other clients?

dark parcel
#

Nah, just play it locally on each machine?

#

doesn't really make much sense to do any rpc either, there is ping remember.
When the server version of their character plant the foot on the floor, it doesn't mean it's the case for your machine

#

Yeah this is redundant, I don't even need to set the owning player and it still work

crisp shard
solar stirrup
#

You do it on every client

#

Locally

#

no replication

dark parcel
#

you don't have to think about multiplayer at all in this case imo

crisp shard
#

yea i might be overthinking it, i just wasn't sure how other clients would hear my characters footsteps for example

dark parcel
#

you are still thingking multiplayer tho, in your world, other player will move around yeah?

crisp shard
#

yes

dark parcel
#

everytime a character plant their feet it play sound, that's it

#

no need to communicate it with anyone

crisp shard
#

that sound just spawns and i hear it?

dark parcel
#

tldr, just play sound when ur foot plants on the floor

crisp shard
#

no matter what? there's no real way for me to test by myself

dark parcel
#

Get a laptop or 2nd pc

#

πŸ˜„

crisp shard
#

lol that's wha ti have but im just not sure how other players would hear those sfx but i'll take your word for it

#

i simply have a notify event no replication just spawning the sfx

solar stirrup
dark parcel
#

yup, no replication required at all

solar stirrup
#

in editor

crisp shard
crisp shard
crisp shard
dark parcel
vagrant grail
#

so anyone please ? πŸ˜„

dark parcel
crisp shard
dark parcel
vagrant grail
crisp shard
vagrant grail
dark parcel
crisp shard
dark parcel
#

@vagrant grail

crisp shard
rain condor
#

I'm trying to pickup a gun and then spawn it and attach it to socket. Idk why it's invalid.

dark parcel
vagrant grail
# dark parcel <@112981085423452160>

the image is already done. The other thing I can't do that, I don't know how to explain better because I'm not using the node "Create Widget" because I'm using the Widget Component attached to my player (so it's not through scripting) πŸ˜„

dark parcel
#

@vagrant grail that's fine, as long you have an instance of the widget in the world

dark parcel
#

do you actually still have issue with the health?

dark parcel
#

print string to be sure

crisp shard
vagrant grail
dark parcel
vagrant grail
dark parcel
#

@vagrant grail should work in listen server

#

even if u play stand alone, u are playing as clients anyway so it should work regardless

#

not sure how you set the variables on your end, you can try this to test

vagrant grail
dark parcel
#

ok im getting desync if i used widget component

#

will look into that

vagrant grail
vagrant grail
dark parcel
#

using widget component

dark parcel
vagrant grail
dark parcel
vagrant grail
dark parcel
dark parcel
#

but move it all the way to the start of the begin play

dark parcel
#

then let me know, gonna sleep soon

dark parcel
vagrant grail
vagrant grail
dark parcel
#

@vagrant grail this logic is run on every character in the world, for character that you don't own, you are not gonna pass the GetController check because the character you don't own, don't have a controller

#

so u end up never calling the Set owner logic

#

Move it all the way to start of the begin play to set the owner then it should work

cerulean lintel
#

Also, I'm not sure if I should use for that case a multicast reliable or not

rain condor
dark parcel
rain condor
#

And then i return spawned item

dark parcel
#

Multicast RPC only run on clients that is currently in the game

#

so if there is late joiner, they are guaranteed to be desny

#

say u play a montage using multicast, late joiners cant see other character dance

dark parcel
vagrant grail
cerulean lintel
#

problem is, I intend to run the onrepnotify that changes the weapon attachment upon replicated montage (draw/switch)

#

and most examples I've seen use a multicast to play the montage, maybe that's not the best approach

dark parcel
cerulean lintel
#

it's working for now, but I'm wondering when players are not network relevant

dark parcel
#

can't say I understand multiplayer, on the brink of giving up tbh. Too hardβ„’, but if it consolidate something, Epic use Repnotify to play montage pretty sure on GameplayAbilitySystem

dark parcel
#

you might get away if u don't simulate lag, but that doesn't say much in a real environment

#

always test with some lag when doing multiplayer

rain condor
#

So.. what can i do?

vagrant grail
# dark parcel yes, like that

Problem solved ! But I have another issue, which the damage volume applies damage only to the player hosting the game and not the other player, is that because I used the HasAuthority node to receive the damage detection to decrease health ?

dark parcel
#

open console Netemulation.pktlag 150 to test with lag

rain condor
#

Still the same

dark parcel
vagrant grail
dark parcel
vagrant grail
dark parcel
#

the last pic I sent, this will let the server start a timer that damage every actor in the box volume

vagrant grail
dark parcel
#

I know nothing about that

#

never used it

#

but most likely the issue is how you set the health value, just my guess

#

anyway for something like a pain volume, the client doesn't need to do anything

#

the server will check on it's end, if any player is inside the pain box

dark parcel
#

and set the health to any actor on it's end, which will replicate the value to the client

dark parcel
#

simply let server set the health

#

client don't have any business here

vagrant grail
dark parcel
vagrant grail
dark parcel
#

Something like this would suffice

#

no RPC needed

#

RPC for?

#

we don't need the client to report to the server that it's health is reduced

#

The server does the check here

#

whenever a character enter the pain box in the server machine, the server will set the health value which will replicate to client (eventually, the time depends on ping)

rain condor
dark parcel
vagrant grail
# dark parcel RPC for?

so an RPC could be called by the client even if I don't have any code in my whole project calling that Server Event "Execute on Server" ?

rain condor
dark parcel
dark parcel
#

my guess is that it might not be valid on client

#

try to play on listen server only, see if u get not valid still

rain condor
#

I'll try!! Thank's

dark parcel
#
  1. Server Checks if there is characters inside the pain volume every second
  2. Server deduct all the health variable of characters inside the box
  3. Health variable will be replicated to clients
#

Server RPC is the only way for client to communicate with the server. which in this case adds nothing to the logic

vagrant grail
rain condor
dark parcel
#

most of the time, I would use Rep_notify to do stuff

#

Like when server replicate a weapon value to the client, the client then can do the logic on rep_notify. attachment, cosmetic, etc

vagrant grail
dark parcel
vagrant grail
queen escarp
#

listen server

#

anonye :/

dark parcel
#

@queen escarp getting rubber banded, seems like the movement is not in sync with server

#

you get that effect when trying to sprint on blueprint

solemn dirge
#

hey guys I'm trying to synchronize a day night cycle using the sun position plugin.

Any reason why this logic wouldnt work? My solar time is always 1 hour behind on client side

queen escarp
#

yeah but im doing nothing of that

#

the movement is all defaulty

solemn dirge
#

this is the solar time update function in the daynight blueprint

queen escarp
#

@dark parcelbut really do u have this problem ? i always have this problem with all my projects

dark parcel
#

tested with friend accross continent

#

imo ur issue is you are setting Speed somewhere but the client and server are not in sync with the speed

dark parcel
#

You are trying to run faster than what the server think you should be running

#

hence the correction

queen escarp
#

that makes sense im gonna check that right away

#

acctualy im not setting the speed anywhere

#

except in the CMC...

#

should the cmc be replicated ?

late iris
#

Hi all!

I'm trying to understand simple replication,
and i've been up for 6 hours more than i should've been trying to figure out why this crashes client (or disconnects the client from the host server)
this is basically the only change i've made iirc to the starter content BP_Weapon_Component Blueprint.
(The print Text function i've been using to check things, goes from listing the source as the server and client to just general, so that's what makes me think the server crashes)

I've made the projectile itself replicate from the server, just for testing purposes, and ideally want the projectile to come from the server. But any attempt to replicate to server in the BP_Weapon_Component ,seems to crash the client when it attempts to replicate (and if i set run on server as reliable, it crashes UE5 completely. and going from run on server to multicast doesn't work either lmao.).

fair latch
#

Client can do a server rpc and get the time from the server

solemn dirge
fair latch
queen escarp
#

@fair latch any more ideas wjat could be causing it :/ ?

fair latch
queen escarp
#

are u replicating the CMC ?

fair latch
#

You said you set the speed in cmc, how do you do it?

queen escarp
#

the max walk speed ?

fair latch
#

I think its already replicated by default. I dont remember ticking any box

fair latch
#

Its not what cause ur rubber band

#

No idea at this point

queen escarp
#

bleh, any suggestions how to trubbleshoot it :/ ?=

#

anyone ?

rain condor
#

What do u want? Replicate speed?

queen escarp
#

this is the issue im having

#

and im using the default "add movement input" to replicate the moving

#

this is on client playing

rain condor
#

Are u sprinting?

queen escarp
#

no

rain condor
#

O just walking

queen escarp
#

walking

#

and im only setting the speed in the CMC

rain condor
#

Show me ur code

queen escarp
#

its the default one

rain condor
#

U don't change anything?

#

That's weird

queen escarp
#

nope

#

im always having this problem

#

even if i do a need project and try

rain condor
#

Did u replicate ur character'

#

?

queen escarp
#
[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxNetTickRate=30
NetServerMaxTickRate=30
LanServerMaxTickRate=30
NetClientTicksPerSecond=30
bClampListenServerTickRates=true
MaxClientRate=50000
MaxInternetClientRate=50000

[/Script/Engine.Player]
ConfiguredInternetSpeed=500000
ConfiguredLanSpeed=500000

[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=600000
MaxDynamicBandwidth=100000
MinDynamicBandwidth=5000

#

this is what ive added in the defaultEngine

#

stuff i got from Google but cant say if its helping anything weird ?

rain condor
#

Mmm

queen escarp
#

im replicating the "Mesh & CapsulComponent" not The Cmc

rain condor
#

If u start a new project whithout that?

queen escarp
#

same

rain condor
#

go to ur character

#

and press class defaults

queen escarp
#

yeah

#

its replicated

rain condor
queen escarp
#

y

rain condor
#

mmm

#

I only replicate movement and replicate and works

queen escarp
#

i just enabled this one what dose it do ?

rain condor
queen escarp
#

yepp

#

all

#

none of you guys have this problem ?

#

are your movement on listen server running smoothly ?

rain condor
#

U checked replicate on mesh?

queen escarp
#

ye

rain condor
#

Componen replication?

queen escarp
#

y

rain condor
#

Uncheck

#

Uncheck all component replicates

rain condor
queen escarp
#

but that will mess with many of my other systems :/

#

since im changing collision box settings etcetc ?

rain condor
#

Try it

queen escarp
#

ok i will

rain condor
#

U can undo later

#

What components do u have on ur character?

#

Pic

fast dagger
#

Has anyone had issues with disabling character movement replication on event using SetReplicatingMovement(false) ? When I do it in BeginPlay, all is ok, animations play correctly, but when I call it from an event in middle of the game, server animations completely stop, and client animations are too fast

queen escarp
rain condor
#

Only this ones

#

Not all

queen escarp
#

huh ?

rain condor
#

Uncheck component replication on that components

#

And check replicates and replicates movement on playercharacterparent

#

Wait.. that charactes is a child?

queen escarp
#

yeah

rain condor
#

Go to his parent

queen escarp
#

yeah i know

vestal shale
#

Should Weapon Attach and Detach from player be MultiCast RPC from server ?

rain condor
#

Nop

#

Only sv

#

This work's for me

vestal shale
#

Mine works properly for the first time attaching

#

But trying to attach after detachment if not working

rain condor
#

Code

vestal shale
queen escarp
#

@rain condor gah now im having some other o#issue with client controller not being possessed… gah ill have to look at it tomorrow ty for help tou might se me tomorrow asking again πŸ˜…πŸ‘

rain condor
#

But jittering walk it's fixed?

burnt hinge
#

How can i set character references for a passenger vehicle. I play animations for getting in & out but the animations can only reference one character at a time

rain condor
#

I have a event dispatcher to refresh inventory. How can i replicate it?

solemn dirge
#

I never did figure out the lan if youre still interested lol

languid bridge
solemn dirge
#

you managed to find yourself using the online steam subsystem without another computer?

gleaming kite
fossil spoke
#

This is likely why its marked as "Wont Fix".

#

Because its not an Engine issue, its a, not understanding Actor lifecycle for Level Transition issue of the users.

#

Seems to me like the Actor needs to be marked for being retained during travel would fix the issue.

#

IE: Add it to the seamless travel actor list.

gleaming kite
fossil spoke
#

Putting it on the Pawn would mean that its destroyed during Travel

#

As the Pawns are not retained.

gleaming kite
#

I figure an easier approach is cleaning up the array of RemoteTalkers so the AudioEngine doesnt try to play anyones voip during travel

#

right

fossil spoke
#

You would honestly be better off creating a dedicated Actor for it instead.

#

Which you add to the seamlesstravelactor list

#

I wouldnt tie it to the PlayerState

#

As that can be replaced as well.

#

It is retained during a travel, but can be recreated

gleaming kite
#

yeah that sounds like the best solution but when using a positional audio system, id imagine it would be an awkward cut from spatialized to non spatialized when seamless traveling

fossil spoke
#

How would you spatialize it during a travel?

#

Also, the intention would be that the dedicated Actor would be attached to another Actor

gleaming kite
#

well yeah you wouldnt, so you go from hearing some on, say, your right then during travel they are right in your ear

fossil spoke
#

In order for it to Spatialize

#

It would follow whatever the intended "Source" is

#

IE: the Pawn

#

That decouples it from the lifetime of the Pawn, while also retaining any spatialization support.

gleaming kite
#

Yeah I know it will persist just fine and work on the next map, i was just referering to the split second of non spatialized audio when all the voip actors are bunched up in the transition map

#

because afaik, the audio system stays live during seamless travel, which is what causes this crash

nimble sky
#

anyone able to help me understand game instance can i have a host local and a dedicated together in one Instance?

gleaming kite
#

i appriciate the help though :) im going to attempt the remote talker clearing idea first, and if that doesnt work, ill go with your idea

nimble sky
#

im using steam advanced sessions that i want to use for coop and I want to have dedicated as well

#

this all works as intended

#

this is what i want to occur to i just buld the client first without the init and the build the server with the init?

kindred cypress
#

Hello, is there any info / graph that shows the replication order for base classes?

if not, is this order correct?

Game Mode > Game State > Player State > Player Controller > Pawns (?)

sterile prism
#

Hello, anyone willing to help me out. I have advanced session steam setup. I can find the sessions, but fail to join sessions.

bleak plover
#

This question might be more general than multiplayer, but what’s the best approach for handling first person (arms/weapon) while displaying third person models to replicated clients ?

Do you have both third person and first person meshes on a player and hide third person for the local player ?

nimble sky
#

@sterile prism do you have them in standalone in the same editor?

#

and do you have it as listen server?

sterile prism
nimble sky
#

make sure your ports are open

#

27015

sterile prism
nimble sky
#

you will have to look up how to open your ports with your router

fossil spoke
#

Its the fact that whatever Actor the Audio is attached to is being destroyed during travel which causes the crash.

#

Thats my assumption based on what Ive seen in the report.

sterile prism
fossil spoke
#

But if that isnt the case I am happy to accept that.

nimble sky
#

if you have a internet service provider look up how to open ports with that company and if or you havesay an asus router look up how to open the ports for that you still need to allow the traffic to flow in and out of your home

kindred cypress
#

Advanced Steam Session doesn't require to open your ports - mines aren't open and it worked on both lan and over steam network (tested with a friend)

Other common issues are:

  • Check the steam app id (make sure you use the test one)
  • Make sure you build your game for Development if you're using the steam dev app
nimble sky
#

^^^\

sterile prism
nimble sky
#

if he can see the server tho it wouldnt let him create the server tho will it?

#

like if his steam app id isnt set up

#

im really new at this as well im trying to get dedicated as well as steam going at the same time lol

sterile prism
#

https://forums.unrealengine.com/t/advanced-session-lobby-findable-but-cant-join/567072 This dude had the same issue. Was able to create sessions & find sessions. Wasn't able to join them until he built it in development.

nimble sky
#

try that

kindred cypress
nimble sky
#

yah neat i never knew that about development and shipping but makes sense now that aI read it

sterile prism
#

I remember doing this years ago and it was so much easier. What happened unreal..

nimble sky
#

i just started last january never touched it before lol

#

so i have no reference of whats good or bad

sterile prism
nimble sky
#

i love it

#

should have started 20 years ago

short arrow
#

remember the good old days of net 2.0 when almost every service online had free API's to almost everything

sterile prism
#

bro you aging yourself

short arrow
#

I'm barely 25 :(

nimble sky
#

dude im 45 i dont care lol

sterile prism
#

Game design is rewarding when you get things working. It can be really frustrating working with a team though that wants to go in 9 different directions

nimble sky
#

yah when your done your build lemme know if that worked thow it in the old memory bank

sterile prism
#

still cookin packages

gleaming kite
# fossil spoke Its the fact that whatever Actor the Audio is attached to is being destroyed dur...

here's the full stack trace / thread dump. Its caused on the audio thread. It seems like the voice engine is trying to route audio to a component that doesnt exists like you said.
https://triiodide-studios.sentry.io/share/issue/04c0ad0bb3b94366ab43f4857fd6d4fa/

fossil spoke
twin juniper
#

I storing state change function on notify in montages, and play those montage on GA. However those notifies are not predicted by GAS, as print not syncing in the server window, and it cause bug like stuck in Chained state, those bugs never happen on the server.
Can i solve this with GAS prediction somehow or i have to make my own?

gleaming kite
sterile prism
nimble sky
#

more @kindred cypress then me

#

but good to know either way

sterile prism
#

I can finally sleep now. Wasn't going to bed until this thing was done.

nimble sky
#

hahaha

#

thats awesome great feeling

kindred cypress
sterile prism
#

Now on to replicating all the events in the game. Oh boy.

nimble sky
#

thats always fun

rain condor
gleaming kite
# fossil spoke So I would be curious then, that if the component was on an Actor that can trans...

Sorry for the ping, but I got around to test my idea. Shutting down the module. Didnt work. Your idea is indeed the best (or only!) solution. One question I had with the persistent actors because Ive never really worked with them, how would you associate a voip actor with a certain player after traveling? Because they need to be registered with a player state and attached to the mesh of the character, how do you know which VOIP actor belongs to which player? You cant rely on Controller of PS refs... maybe net ID or steam id? Net ID would have issues and steam ID feels too hacky. Is there something im missing?

fossil spoke
twin juniper
#

is there any advantage on putting inventory on PlayerState over PlayerCharacter

#

Since they are both exist on client and server

#

I kinda prefer PlayerCharacter because it's closer to mesh and everything

#

And bind Enhanced Input stuff too

urban moth
#

hello do you guys concern about Bandwidth? Back in the days(like 6 years ago) we aimed to 1Mbps at max. Now we're about to start a new multiplayer title so I wonder whether the number changed. Or no body takes care any longer since most of players have 1000+ GBps πŸ™‚ connection?

fossil spoke
#

Network code needs to be performant more so than the packet size its producing.

fossil spoke
#

PlayerController would be even better.

#

Assuming you dont want other Players to have access to all your Inventory information.

#

You can always replicate a minimal list of stuff to everyone that might exist in an Inventory for visualization. For example, Armor on a Character.

twin juniper
#

i wasn't worry about those stuff, more like do they functioning the same when being replicated

#

Anyway, i was thinking, if Player A have 200ms, and Player B also have 200ms, when A moves, it would take 400ms for B to see that, right?

#

Then when A attack on the server, A not actually attacking B but more like the past version of B

#

So on A machine it's like using the future version of self to attack the past version of other players

queen escarp
#

@rain condor no jittering walk aint fixed *

#

@rain condor hm i think it got better when i did your change but it seems like the jittering is on the server side now "the host sees everyone jittering instead"

vagrant grail
lost inlet
#

and it is using NPP afterall

opal pulsar
#

Why is something as simple as pushing a simulating sphere around causing so many corrections, how do people deal with that stuff?

queen escarp
#

hey have this look around system where i rotate the character but doing that in a RPC is bad since its super glitchy

#

what should i use instead+

#

add controller yaw input is already replicated right or ?

#

add movement input is replicated but it dosent rotate just move towards direction

fair latch
#

Stop using multicast for something like that

#

A replicated value is enough

#

For rotation you can interp to replicated variable on tick

#

For clients use server rpc to update the variable

queen escarp
#

is tick a good way really :/

fair latch
#

Afaik control rotation is already replicated

queen escarp
#

i solved it like this and it kinda works tho but your saying this is bad ?

fair latch
#

I dont know a better way, it seems to me its only logical to interp on tick to incoming values and soo far i see ppl doing the exact same thing

queen escarp
#

the "Add Controller Yaw Input" is already replicated as u said thats the one i wanted to use tho

fair latch
#

I could be wrong but i dont think so

#

Something like movement u have to set the values very often

queen escarp
#

yeah

fair latch
#

Since clients cant update fast enough

#

It just need to interp so u dont get snappy result (on proxies)

#

Multicast is terrible most of the time and for this case its probably take the cake imo

#

A replicated variable sufficem. Client will interp to the values the server send on tick

#

Control rotation is already replicated i think, if thats what you need

#

So u can interp to that on characters u dont own. I think they r called proxy not sure

queen escarp
#

aye i get what your saying i will try to mess around with that to find a proper solution

#

your way makes more sense

#

altho i think i fixed the rubberbanding stuff, but a new problem merged

#

left (Server) right (client)

#

now theyre slower on the client side or more jittering

#

it dosent even take the same amount of footsteps

#

its like all clients on server are in slow mo

karmic briar
#

just saw it at a glance and it loom pretty good

#

i wonder how it compare to CMC

queen escarp
#

@fair latch i need to change bOnlyAllowAutonomousTickPose to false
edit: to set bOnlyAllowAutonomousTickPose to false, you need to override ACharacter's OnPossess because that is where it sets it to true.

is that something you could help me with whenever you got a few mins over =)?

fair latch
#

Its not a 100% fix

#

When playing montage u have to switch it off or u get all sort of problem

queen escarp
#

ohh really...

#

bleh

fair latch
#

Only true fix is dedicated server afaik. Or something else that i dont know

#

Thats the bandage im applying atm anyway

queen escarp
#

ok but worth to try ? i mean its a simple change i suppose if u know where ?

#

dedicated server ?

#

i did that on my last project but the 100+gig extra space is a real hassle in my case :/

fair latch
#

Read the post, u have to override some stuff. I think in move autonomous you need to set the charactertickpose or something like that cant remember

#

Cant really help you more than the article

#

Btw if ur character jitter in pie thats probably not the issue to begin with

#

The jitter the article mentioned happend in packaged build as a listen server

queen escarp
#

oh, well i guess ill have to test it before doing stuff

#

gotcha

fair latch
#

@queen escarp someone mentioned move2.0, i think that will be the new character movement component. Probably address the jitter issue. One can only hope

queen escarp
#

aye that would be a big improve

vagrant grail
#

I have an issue with the name plates, going through each other when I'm at mid to far distance but too spread when close. How to have 1 consistant distance ?

#

I want it to be like this all the time

fair latch
#

Easy mode would be to make them the same widget

#

Add a vertical box

#

Add the name first then the health

vagrant grail
#

Epic should add an option for the scaling so we don't have to code it

fair latch
vagrant grail
#

But it makes me wondering, how did they achieve the fact that we're able to see names through walls tho πŸ€”

fair latch
#

I just scale and fire a trace. If something block the trace, hide the widget

vagrant grail
torpid whale
#

Is Doreplifetime still used in ue5?

burnt coral
fair latch
#

Screen space

vagrant grail
# fair latch Screen space

But in screenspace it creates the problem of having the UI widget always in front which gives this issue where when I'm in front of another character his name is still showing up inside of being hidden by my body like in Minecraft

fair latch
#

Then check if it get blocked by a character

#

Which if thats the case, set the widget to be invisible

vagrant grail
fair latch
#

Each widget will run the logic

#

The logic being a ray trace from player camera to self ( the widget comp )

fair latch
#

Component

vagrant grail
#

so I have to write that code in the widget component itself rather than the BP_Character ?

fair latch
#

Ye do it on the widget, keep dependency one way. The character doesnt need to know or deal with the widget. Widget handle the widget logic from it self

twin juniper
#

I am thinking again, which one is the purpose of prediction? Is it to sync the exact time between the server and the client, or to accept the delay and make behaviours happened similarly?

Let's say player A have 2s ping (2000ms)
A try to play an attack animation that last 5s, and use client prediction to play it on himself. At 00:00 A play the attack, but up until 00:02 the server received the command. What is the job of the server here?
1 - The server try to guess the delay and play the attack animation at 5 - 2 = 00:03. The animation will only last 3s on the server.
2 - The server just play the animation as they receive it, with full 5s. But if it behave like this, what is the point of client prediction anyway, since the real animation is not played yet..? So the client rather tried to simulate the delay so it would feel more real?
I don't understand how multiplayer games work, it all feel like some illusion. Is there any video that explain this?

Well, it really make sense when i write about it, like for an animation last 5s, the server can predict and roll to the future, but for spamming switching movement, there is no way to roll to future, so i guess it's option 2? But i still want some confirmation.

fair latch
#

Just get the player camera manager

vagrant grail
vagrant grail
fair latch
#

And dont think about multiplayer here

#

There is nothing that required rpc or replication

fair latch
#

Character movement component is another example

#

U get to move your character without waiting approval from the server

#

With no prediction u will start moving after a second if u have high ping

#

Thats not playable at all

twin juniper
#

so short question, the server don't predict, only the client?

fair latch
#

Ye

#

Another simple example is probably toggling a flashlight

#

If u dont care about cheating just do the check on client side, and toggle the flashlight right away while telling the server that the flashlight is toggled

#

Point is u dont want to wait for server to comeback to you because without prediction ping gonna ruin gameplay experience

vagrant grail
fair latch
#

@twin juniper you can do client prediction for the montage and play sfx right away but the damage check should still be on server

#

Doing something like an attack in multiplayer is not easy. You prob should send a data to the server with time stamp then server will simulate thst data on their end and check if its valid

#

Some keywords to look for is probably network clock, client prediction, server reconciliation

twin juniper
#

Yeah, i understand client prediction, but if the server have 0 prediction, we are basically trying to control delayed dummies and fight with each other on the server. That imagination surprise me a bit

fair latch
#

I dont see any relation with prediction and the server

#

Server is the truth

#

It also has no ping

#

@twin juniper u can check stephen ulbardi multiplayer shooter if u want. It goes over client prediction and server reconciliation

twin juniper
#

udemy courses are incredibly long lol. I had some, now i prefer just testing stuff myself or watching youtube videos

fair latch
vagrant grail
fair latch
#

But there is also free option, which is to read. But im no programmer and still in a stage where i need someone to hand hold me

#

The course is valuable to me but not for the big brain ppl around here

vagrant grail
fair latch
#

Or tick is disabled

vagrant grail
fair latch
vagrant grail
fair latch
#

Do you add key in your print string maybe?

vagrant grail
fair latch
#

Make sure the key is None in print string

vagrant grail
#

what "key" ?

fair latch
#

Check your print string

vagrant grail
#

Oh "key" is set to "None" already

fair latch
#

Well i have no idea then

vagrant grail
vagrant grail
#

nevermind it only fire 4 times

rain condor
vagrant grail
fair latch
#

If you dont want to hide the widget on top of the player that u are controlling, then make that happend

#

You can start using plain english for the algorithm or rules

vagrant grail
fair latch
#

U r only hiding the widget wdyn by hiding other player

livid jetty
#

Is there way to migrate server after listenserver quits ?

fair latch
#

Every widget will do a trace except the widget thst is owned by the local player ( if thats what u wish )

fair latch
#

But i personally wont do it. Not worth the time as a small team dev

livid jetty
fair latch
#

Indeed but it is what it is πŸ˜”

livid jetty
#

Maybe i need way to transfer autosaves to client ?

fair latch
#

You can always check marketplace, i cant remember the nane

vagrant grail
fair latch
vagrant grail
fair latch
#

The struggle continues

vagrant grail
#

I will ask the shader gurus maybe they know :p

fair latch
#

And multiplayer amplifier the struggle

livid jetty
#

Are there any differences between saving singleplayer and listen server?

fair latch
#

Your game your design

solar stirrup
#

New Mover plugin is out

#

πŸ‘€

cerulean lintel
#

Hey there guys, what do you consider the best strategy to replicate weapon switching? I mean, the montage itself

#

Using repnotify? Multicast? Just AnimBP?

#

I’ve been trying some stuff but not really sure about a reliable approach to chain montage properly, like put weapon back socket, grab new weapon to hand socket montages in sequence

stable grotto
#

is there any reason why I should use apply damage over a custom blueprint interface where I can customize it even more?

crisp shard
#

For movement replication?

solar stirrup
#

experimental, but yeah

#

in the 5.4 git branch

#

i wouldn't bother with it for now

crisp shard
#

When 5.4 supposed to release?

hallow fox
#

Hey, I'm setting up replication for the First Person template and for some reason EnhancedInput.InputAction /Game/FirstPerson/Input/Actions/IA_Shoot.IA_Shoot fires twice on the remote clients. Would anyone happen to know why? Works fine on the listen server, and still fires 2 times when there are three players in the server

dark parcel
#

not saying I can help but you get more chance of getting help by others if you show your code

hallow fox
#

Fair point lol, screenshotting it atm

#

these are both the results of a "single mouse click"

dark parcel
#

Triggered runs every frame

#

is that the intention?

hallow fox
#

I don't think so

#

I'll give Completed a try

dark parcel
#

if u just want to fire once, I think use Started

hallow fox
#

Event still fires twice, even with Started

dark parcel
#

doesn't explain why the client fire more than the server tho

#

only fire once to me

#

both on server and client

hallow fox
#

This is in the WeaponComponent

#

Wait

#

Let me just check something

dark parcel
#

I wouldn't handle input inside weapon component

#

but don't quote me on that, I don't know any better

hallow fox
dark parcel
#

πŸ‘€

vestal shale
hallow fox
#

I guess I'll refactor input out of there and see what happens

#

Thanks for the help

vestal shale
#

Pressed fires only once when pressed and relased fires once when your release the button

#

It's perfect for Weapon firing.
You can start the fire in pressed and stop it in released. Works perfect automatic weapons too

dark parcel
#

imo every multiplayer FPS game use timer for automatic fire

hallow fox
#

Which might mean there's another underlying problem

stable grotto
dark parcel
#

input have nothing to do with replication imo

#

it's just what every machine execute locally

hallow fox
#

I guess I may need to modify the pickup bp, standard one w replication seems to attach the component multiple times

stable grotto
dark parcel
#

How do you add the component

#

came accross youtube tutorial today that Spawn using multicast 🀒

#

and everyone was thanking him for covering replication

#

a lot of victims it seems

stable grotto
#

πŸ˜‚

hallow fox
#

lmao

#

funny enough, i didn't even change the pickup code

#

(I mean, I did add a Print String)

stable grotto
# hallow fox

add switch has authority and execute this on authority only

torpid whale
#

When I remove an actor from the world using a destroy actor, I just have to replicate it on the server, right?

dark parcel
#

Handle destroy and spawn in server only imo

hallow fox
stable grotto
dark parcel
#

If an actor is marked as replicated, if you spawn it on server, client will get a copy of that

torpid whale
#

Ok, that's what I assumed, I did it that way, but the clients still see the object even after it was destroyed by the server, do I have to consider something?

dark parcel
#

Unless it's cosmetic object that can just exist on client, imo handle the spawn and destroy on server side only

hallow fox
torpid whale
dark parcel
torpid whale
#

But only the server sees it destroyed, the clients do not

dark parcel
#

when you destroy the actor on server side, the client version will get deleted too eventually

torpid whale
#

Sure, it's what I assumed, in fact in other code it does work for me, but it's not working for me in this case

vestal shale
dark parcel
#

So if you are client do a server RPC that tell the server to destroy the actor

stable grotto
vestal shale
#

@dark parcel Do you know which build in functions get called in server by default ?

torpid whale
#

I don't think this really has anything to do with it, but does it matter if the line trace is replicated?

dark parcel
stable grotto
# torpid whale

We already know that the destroy works fine, its the fact that the actor you are destroying is not replicated

dark parcel
#

there are things that get called on server side only

#

like Set Owner or On Posses

vestal shale
#

I asked this question multiple times, but nobody answered

stable grotto
torpid whale
#

Actors blueprints

dark parcel
stable grotto
dark parcel
#

and also whenever an actor become relevant

#

it's kinda not the place to put stuff imo

#

but im a newbie so I could be wrong

#

For my case, I handle my cosmetic in On Posses for Server

torpid whale
stable grotto
#

No worries lol

dark parcel
#

and On Rep Player state or Acknowledge possession for Client

vestal shale
stable grotto
# torpid whale

You don't need switch has authority its already running on server

dark parcel
dark parcel
#

if you are the server just destroy the actor

#

if you are the client run a server RPC

#

the only way for Client to communicate to server is thru server RPC

stable grotto
solar stirrup
#

we dont even have a roadmap

vestal shale
crisp shard
#

if i wanted to have a client equip before a server event, but im using a spawned actor's info, would it be a bad idea to spawn that actor on the client before the server event? this is really just to get a client side weapon/armor etc equip , like showing the item

thin stratus
#

For whoever needs to read this:

BeginPlay, Tick, EndPlay, and Overlaps/Hits can totally call on everyone out of the box.
But you shouldn't see this as "replication". The reason Actors call these events on Server and Clients is because they CAN happen on both. This isn't really a guarantee but more a side effect.

If an Actor is spawned, during Play, on a given Player or Server, the Actor will call BeginPlay. That's a side effect. Same with EndPlay when it despawns. That can also happen multiple times per client if Relevancy changes and despawns the Actor.

Tick can call on everyone that have the instance too.

Overlaps and Hits can also call on everyone where such Overlap/Hit happens.

The important part is that it's not guaranteed, as in if the State on the Client differs from the Server, it could just not happen. And that's not a "random" thing, what I mean is that you could be having different Collision Settings on Server and Client. Or have one that has the Tick disabled through a series of events.

This is mainly a feature of the Actor Instance on your Game, which is spawned via Replication, but afterwards those events are somewhat part of the Actor's lifecycle and instance and not reaaally replication controlled anymore.

And it's totally valid to do Network Stuff on there. You can use BeginPlay, EndPlay, Tick, with SwitchHasAuthority nodes to check against Server or Client (be aware that IsLocallyControlled in Pawns and Characters is probably not gonna give a correct value on BeginPlay, as the Pawn isn't possessed yet properly on the Client as that happens "later" after spawning).

You can also totally handle Overlaps and Hits like this ,without needing any RPCs, cause you "know" it happens on everyone relevant.
That's also something that you utilize for stuff like JumpPads (stationary overlaps) knowing the Character will walk on the pad on Server and Client in the same timestamp and trigger the overlap.

#

There are more events that are part of the Actor lifecycle that also fall under these "rules".

thin stratus
#

The Local Version and the later Replicated one

#

If you can resolve that by deleting one of them, sure

crisp shard
# thin stratus You'd end up with the Item twice

yea, i guess i just keep it happening after the server event, just a bit lagged in high latent envoirment, but i guess it's semi importnat to make sure they have that weapon in the first place

crisp shard
ember vine
#

is it worth going and changing all my replicated bools to uint8

vital barn
#

Inside my player controller, I am adding a widget on begin play that let's players choose their team. However, when playing two players, the widget appears twice on the first players screen (but only once on the second players screen as intended).

Why is this?

livid jetty
#

Will Event BeginPlay node run every time new level is loaded ? Or just once on start?

#

And what if is this node inside level blueprint ?

fossil spoke
vital barn
#

PlayerController

dark parcel
livid jetty
#

I want to load new menu (different for each level). Should i do it inside level blueprint or on character ?

vital barn
dark parcel
#

The Is locally controlled check will ensure that you are on an actor that you are controlling, so it will create the widget only in the character that you controlled

livid jetty
#

Will BP_Gamemode persist when server change level ?

vital barn
#

Connected to my system above for choosing teams, is it possible to make it that the player doesn't automatically spawn into the game when connecting to the server, but only after having had selected a team?

#

Because right now they spawn in and then after choosing a team I make it so they spawn again

dawn pendant
#

I’m having issues running console commands when the Net Mode is set to Play as Client (UE 5.0) but it works when I’m playing standalone. What can I do to alleviate this issue? I figured maybe it was just a consequence of multiplayer in general, but after searching this channel, it seems like others are using console commands as normal. It’s worth noting that I’m working off of a template, so it’s possible they disabled something i haven’t found

dark edge
#

Your assumption should be that it'll run on clients and server unless indicated otherwise

#

not that it'll be automagically synced up, but begin play will fire locally whenever the actor begins play, doesn't matter if it's on the server or client. An overlap event will fire when the overlap begins, no matter if it's clientside or serverside.

vestal shale
#

Non RPC ones

dark edge
#

They get called as a consequence of their caller, whatever that might be

vestal shale
dark edge
#

if you call MyActor.DoSomething on the server, it'll DoSomething on the server. If you call it on the client, it'll do something on the client.

#

the default is to do the thing local

vestal shale
#

Thats what I knew

#

But Beginplay, Tick and Overlap are called on server by default

dark edge
#

they are called LOCALLY by default, they run on all machines

vestal shale
#

You mean, they are called locally and on server simultaneously

dark edge
#

no

#

local doesn't mean client

#

local means local to whatever machine the thing exists on

#

doesn't traverse or care about the network

#

BeginPlay will run when the actor begins play on server. It'll also run on the client when the clients version of the actor begins play (late joining, just got into relevence, just got spawned, etc)

#

it's fairly simple. When play begins for that actor, whatever machine it's on, Begin Play is called.

vestal shale
#

In terms of server Authoritative Actor.
It will run on server and then on client

livid jetty
dark edge
dark edge
#

It's just a simple rule. The frame play begins on for the actor, it'll call Begin Play.
The frame an overlap happens on, it'll call OnBeginOverlap.
Each frame its tick function is ready to be fired, it'll fire.

vestal shale
dark edge
#

yes

vestal shale
#

And without RPC there's no way to call that on server from client. Right ?

dark edge
#

yup

#

RPC is the only method of communication from client to server

#

Some RPCs are hidden, you might notice you can call Jump on a Character and it'll be networked. Character / CMC is doing that RPC under the hood

vestal shale
#

Alright. Now I wanna know the names of the functions which are run of server by default like BeginPlay and OverLap

dark edge
#

by default they all run locally

#

So if on the server, something overlaps, then Overlap will be called

#

if on the client, something overlaps, then Overlap will be called

vestal shale
#

I got that.

dark edge
#

Usually the 2 coincide, but there's nothing stopping you from haveing different things on server and client where one might overlap and the other not

vestal shale
#

Other than Overlap and BeginPlay which functions are called om server

dark edge
#

all of them

vestal shale
#

How many comes in all ?

dark edge
#

Like thousands

vestal shale
dark edge
#

no lol

vestal shale
#

That's what I wanted to know

vestal shale
dark edge
#

that's for conditional compilation

graceful flame
#

If WITH_SERVER is useful to exclude stuff from the client build such as URLs for an external database or something like that.

solar stirrup
#

You shouldnt be hardcoding urls heh

#

Config files are there for that

livid jetty
#

How does this work? Can server enable mouse remotely on client because of that parameter?

woeful willow
#

Hi there!

I'm getting rubberbanding when trying to replicate a movement position using a class deriving from UCharacterMovementComponent (Unreal 4.27).

I have a Character who when jumps, should follow a Curve before freefalling.

The problem is, when I enforce a PktLag of 500, I get rubberbanding on the client.

I've tried to follow tutorials that involve sending a flag to the server using UpdateFromCompressedFlags, and then update the position inside of OnMovementUpdated.

Using log output, I have been able to verify that OnMovementUpdated is correctly calling on both client and server, but I still get rubberbanding.

Maybe I'm overridding the wrong function? I have included code samples and would really appreciate any help!!

tardy fossil
# woeful willow Hi there! I'm getting rubberbanding when trying to replicate a movement positio...

your moves might be getting combined and messing up the simulation on the server since your CanCombineWith() is empty.. try:

bool FDogSavedMove::CanCombineWith(const FSavedMovePtr& NewMovePtr, ACharacter* Character, float MaxDelta) const {
    const FDogSavedMove* NewMove = static_cast<const FDogSavedMove*>(NewMovePtr.Get());

    if (SavedWantsToBeInJumpCurve != (NewMove->SavedWantsToBeInJumpCurve))
    {
        return false;
    }

    return Super::CanCombineWith(NewMovePtr, Character, MaxDelta);
}```
woeful willow
#

@tardy fossil No dice, I'm afraid. Same problem, but thanks for the suggestion!

tardy fossil
#

yea custom prediction can be very finicky and hard to get right. one thing i found that gave me issues was setting variables I used in the compressed flags in the movement function

#

for example you could make another bool called CanBeInJumpCurve thats not set by UpdateFromCompressedFlags

#

set it to false when the jump starts and true when it finishes

#

somethin like

if (WantsToBeInJumpCurve && CanBeInJumpCurve) {
    CanBeInJumpCurve = false;        
    StartJumpCurve();
}
woeful willow
#

Glad I'm not the only one who's been having difficulties!
I thought about doing that, though I did some logging during a jump and attached the result.

It seems to be going in and out of that curve just fine, though Unreal seems to think the positions don't match, and attempts to correct it.

I wondered if SafeMoveUpdatedComponent is the correct way I should be updating the position, not entirely sure πŸ€”

tardy fossil
#

its a combining issue

#

notice how the times get desynced by the third tick

woeful willow
#

Ahh that's very interesting.
I guess we can't rely on the delta parameter here, and would have to use a timestamp instead?

I assumed the different timings would just be a result of different tick rates between server and client, but I guess this in itself can throw the positioning off?

Thanks for the help, will have to play around some more!

dusty void
#

can rpcs have parameters? im having an issue where when i create an rpc without one, it works fine, but when i try to put parameters in, it starts giving me errors, and i even tried building solution to see if it was just vs being dumb but it doesn't go thrrough, any help? ill provide more if needed

#

What I'm trying to do:

fair latch
fair latch
# vestal shale Other than Overlap and BeginPlay which functions are called om server

It gets called on all machine. Picture a box collision, each machine will have that box collision in their world. Whenever a collision occur it will trigger the overlap event on that machine (regardless server or client).

Depend on the game u can ofc can do nothing on client with switch has authority.

Imagine a pain box, you only want the server to care about the overlap. The overlap logic on client machine in this case can just be ignored (using the has authority check)

dusty void
#

and i am trying to use an OnRep this time

fair latch
#

@dusty void create a variable for the material. Mark it as rep notify.

If server want to change, it can just change the variable right away and then set the material.

For clients, do it onrep of the variable. Set the material to the value of the variable.

If client needs to change the material, do a server rpc that tells the server to change the variable (passing material parametre)

dusty void
#

yeah that's what i was doing rn, the issue im coming across rn is it can't get the material through this cast since the getmaterial returns a UMaterialInterface

#

it passes all the other checks to get through the capsulecomponent and skeletalmesh

fair latch
#

Why dont u use UMaterialInterface instead? I think thats what u need

dusty void
#

yeah i just did that xd

#

would applyign a diff mateiral to it work the same way tho

#

and is the cast supposed to work or?

fair latch
#

Dont know, im newbie. But i do use umaterialinterface to edit my character material

dusty void
#

yeah i was realyl trying to avoid the multicast but couldn't really think of a way until i looked at the source code for the skeletalmeshcomponent

fair latch
#

Ye dont need multicast at all

#

Thats the wrong way actually

#

Cuz multicast can get dropped

#

So if u for instance run this on begin play, client that join later are guaranteed to not see the material change

dusty void
#

Ohhhhh ic

#

imma use the materialinterface for now

#

and figure out how the cast isnt' going th rough later

dusty void
#

Now my issue is that it's not actually changing the material T_T

#

I even used an OnRep to see if it was detecting and it is but the material still isnt' changing for the client or the server

fair latch
#

Show code

#

@dusty void

dusty void
#

@fair latch

fair latch
#

U never set the material btw

#

I mean the actual material

#

U only set the variable

#

Get your mesh component-> set material

dusty void
#

i thought i set the material in the post login

fair latch
#

Yourplayerchar->mesh->setmaterial at index

#

U also need to change the material on the on rep for client. Do that instead printing msg only

#

Also i think post login only get called on server? Might be wrong here i dont do much mp but the authority check might be redundant

#

Yeah its in game mode. Game mode only exist on server

dusty void
#

yeah gamemode is a server

#

just kinda did it just to see xd

fair latch
#

Call the cpp of that

dusty void
#

i got it to work just like this

#

i was thinking i needed a hasauthority check tho augh

fair latch
#

Yeah u were missing set material

#

On rep is for clients and only get called on client

#

If u add authority check in on rep it prob will never go thru

#

Just to add from here if you need to set the material as client. You will need to run a server rpc that tell the server to change the material variable and to set material

dusty void
#

yueah mb i just got smth confused with how pointers worked which is why i didin't set it in the onrep in the first place xd

dusty void
#

@fair latch gonna sleep but tysm tho u helped a lot πŸ™

twin juniper
#

Hi, i have been struggling with this bug all day, can anyone help?
I played an animation with an anim notify on both client and server. But the print on the anim notify only appear 100% on the client, on the server it's 50-50.
I tried everything but nothing works, that i begin to wonder if this is a bug or a feature..?

#

Nvm, i figure it out. I need to change the nofify mode to some random f*cking thing called "Branching Point"

harsh ice
#

Do you have to replicate construction script

#

Which version you are using?

thin stratus
twin juniper
#

Random in a sense it feel so hidden and appear like a random encounter in video game

urban moth
#

Has anyone ever worked on multiplayer RTS title in UE? I wonder what is a role of player's units. Are they all simulated proxies or autonomous per client?

rich crag
#

that i understand they are generally simulated as proxies on each client with server maintaining authority. @urban moth

#

second hand information, though. I'm not that knowledgeable

pallid mesa
#

finally possible :)

#

With Mover 2.0 pawns can have all types of primitive shapes for world collision, it just worksℒ️

thin stratus
dark parcel
#

🀩🀩🀩