#multiplayer

1 messages Β· Page 90 of 1

thin stratus
#

Player -> PlayerState -> Cast -> SetTeamEnum

twin juniper
#

I did this

thin stratus
#

Also clean up your blueprints :P

#

That is wrong though

twin juniper
thin stratus
#

BeginPlay of your GameMode or even GameState has absolutely no connection to doing what you are trying

#

Do that in the ChoosePlayerStart function

twin juniper
twin juniper
thin stratus
#

Yeah but why in two different places?

thin stratus
twin juniper
thin stratus
#

That Player is your Player's Controller

twin juniper
thin stratus
#

ChoosePlayerStart spawns the PAWN

#

Or rather selects the Player Start to spawn the PAWN at

twin juniper
thin stratus
#

Pawn != PlayerState != PlayerController

twin juniper
#

Sorry terminology

thin stratus
#

PlayerController exists relatively early when your Player joins the server

#

PlayerState is created by the PlayerController

#

And Pawn gets spawned

#

So yes, the PlayerState is totally valid and available at that point.

twin juniper
#

Oh, so player state is created before spawning?

#

That is what I was looking for.

thin stratus
#

The PlayerState is created by the PlayerController (or rather Controller as its parent class but well)

#

By default PlayerController (Controller in general) has a Pointer to the PlayerState of that Controller

#

A Pawn/Character does not have a valid pointer to either by default.

#

If you possess a Pawn/Character, THEN you have access to the PalyerState and Controller via the Pawn directly

#

+- time it takes to replicate

twin juniper
thin stratus
#

Correct

#

Pawns only have convinience pointers to it when possessed

twin juniper
#

Also, I want to thank you for your tutorial on Online Subsystem. I am doing a task for a job interview and it really helped me understand how to set it up πŸ™‚

twin juniper
thin stratus
#

That just means you can do Pawn -> PlayerStart instead of Pawn -> Controller -> PlayerState, which is especially useful if other clients want to get the PlayerState, cause they have no valid version of other player's Controller

strange canopy
#

hello there, i'm new to multiplayer, is there a way to get my OnRep_Nofity to fire on standalone or should go trough another path? i got something working while connected to the server but would like bring it to allow player to also do it before connecting

dark edge
#

You need to call C++ onreps manually on ther server. Standalone is effectively a listen server with no clients

strange canopy
dark edge
#

BP on rep should fire any time the variable changes, no matter how it changed

#

So if you set your code up right, it should just work no matter if its dedicated, listen, client, or standalone

strange canopy
#

thanks a lot, thanks to your confirmation i went back to debuging more

#

finally figured it out

#

was a issue with seting the same variable during spawn

sage light
#

Does anyone know how to deal with server builds which get this error?
Log Net: Error: UEngine::BroadcastNetworkFailure: FailureType = NetDriverCreateFailure, ErrorString - , Driver - NONE

queen escarp
#

hi guys im using seamless travel to open a new level while playing where i use a transitioninglevel aswell, what is the normal way to show a loadion screen or something since now ALL ui gets enabled while transfering for some reason ?

muted onyx
#

If I am changing the position and rotation of a character on server, how do I know when this is done on client? The characters are being replicated, but as I am spawning like 20 characters, I am having a delay when positioning the pawns.

quasi tide
sinful tree
#

Sounds like it could be a memory leak situation, or something else not being handled correctly causing the engine to work harder over time.

quiet yarrow
#

does anyone know how to properly replicate the character movement physics interaction? The push force seems to break everything

subtle peak
#

How does games usually handle loading of player skins? Do you load them from cloud save/local save when the player gets spawned in the match? Cause I keep getting this visible 0.5 second delay after spawing where the player has the default mesh/skin before its getting loaded. Whats the best way to handle this?

dark edge
subtle peak
dark edge
#

You'd probably have to implement that yourself

subtle peak
#

I see, thanks! I'll do some more experiments

kindred widget
#

Also a reminder that normal Unreal dedicated servers do need restarted every couple of days. Probably minimum of once a week on average

sour compass
#

I have not yet tried UE5, but I might want to make something with it.
I want to make a multiplater game you can use to connect directly to your friends without needing dedicated servers. Think personal minecraft servers or CS where you just /connect to an IP.

Is this supported by the engine or do I have to code my own networking handler in C++?
I know it might make some people struggle with port forwarding, restricted nats etc., but I don't really care about that.

dark edge
#

You can pretty easily implmeent steam or EOS or some other system for joining friends or do the old school IP and port thing

sour compass
#

Thanks! I will try to give it a whirl then.

obsidian walrus
#

from what i understand, replication graph is getting the axe with iris right?

obsidian walrus
# fossil spoke It is.

will there be another way to route RPCs? im glad i hopefully wont have to learn replication graph it looked like detritus

obsidian walrus
fossil spoke
#

RepGraph isnt a required feature to utilize if you dont want to use it

fossil spoke
#

Also you can do that already.

#

In that, you just call a regular RPC on the Client objects you want to have received

nocturne quail
#

I implemented this correctly?
I should use if (!HasAuthority()) or if (!Client) ?

UFUNCTION(BlueprintCallable, Category = "Vehicle|Overlap")
void ExecuteBeginOverlap(class AVehicleBase* NewVehicle);
UFUNCTION(Server, Reliable, BlueprintCallable, Category = "Vehicle|Overlap")
void Server_ExecuteBeginOverlap(class AVehicleBase* NewVehicle);
UFUNCTION(Client, Reliable, BlueprintCallable, Category = "Vehicle|Overlap")
void Client_ExecuteBeginOverlap(class AVehicleBase* NewVehicle);



void AARMAPlayerControllerBase::ExecuteBeginOverlap(class AVehicleBase* NewVehicle)
{
    if (!HasAuthority())
    {
        Server_ExecuteBeginOverlap(NewVehicle);
    }
    else
    {
        Client_ExecuteEndOverlap(NewVehicle);
    }
}

void AARMAPlayerControllerBase::Server_ExecuteBeginOverlap_Implementation(class AVehicleBase* NewVehicle)
{
    Client_ExecuteEndOverlap(NewVehicle);
}

void AARMAPlayerControllerBase::Client_ExecuteBeginOverlap_Implementation(class AVehicleBase* NewVehicle)
{
    VehicleInRange.Add(NewVehicle);
}
nocturne quail
nocturne quail
halcyon totem
#

are these time stamps bad? Cam changing the NetServerMaxTickRate fix this? How can I go about finding out whats casuing it?

sinful tree
# nocturne quail since I want to run the logic only on the owning client, not on all clients... b...

The overlap should be getting detected on the server, and you don't want the client to tell the server that they are overlapping. Begin Overlap chould just check HasAuthority(), and if so execute what you need on the server, no RPCs needed. Now depending on what you want to happen when the overlap is detected on the server, you may not need to RPC anything back to the client either.
For example, you're adding a vehicle to an array named "VehicleInRange". That's likely something you want to keep track of on the server so you can make sure players are not cheating. If the client needs to know that data, then you would likely want to replicate that array instead, and then the client would have the same array values as the server.

timid moss
#

It's cool to see that they are still pushing for a generalized prediction system even after all that has happened. There's hope guys :o

edgy helm
#

Hey there. I was wondering if there was a way for a client to interact with a world space blueprint containing a widget. Through widget interaction only fires off from the server, not the clients. I know widgets are not replicated. The logic behind the widget is: on button click get actor of class and send interface message. Is there a way to get this to work both for server and client?

sinful tree
edgy helm
#

But… how can I get the widget to get the player controller of the interacting player?

sinful tree
edgy helm
#

Alright thanks a lot, I’ll give it a try.

nocturne quail
ebon zealot
#

how'd one generally generate a player ID that's unique to each player?

#

the game will be launched on steam so I'm thinking thath as to do with it but during testing I wouldnt use the steam api would i

chrome bay
#

The Editor environment/null subsystem just generates a random GUID each time you run, since there's no online service or account to pull from

ebon zealot
#

that makes sense but I still need to test the saving system w/o using steam or anything

#

do I just use mock IDs for that?

gusty slate
#

Can't you just brute force it for testing? each controller is "indexed" we could say, so you could just load player data like that in series

fossil veldt
#

Is it possible to pre-initialize fast array serializers with items, for example add 500 empty items, so that the server doesn't have to send this initial delta, it would just send the items that changed in those initial 500 items

chrome bay
#

So long as the initial state is saved into the CDO it should work AFAIK

#

Not 100% certain that works with fast arrays though.

fossil veldt
#

Not sure yet if that means that the server doesn't send the delta, or if it means that the client just doesn't care and discards it

ebon zealot
#

How does one usually connect to databases from unreal?

#

MySQL / mariadb

#

is there a built in plugin for it?

quiet fjord
#

Guys I'm having a problem when it comes to synchronizing positions when I create the players in gamemode. It turns out that when I start my game my characters sometimes jerk when I start moving them. How do I solve the position synchronization problem when I create my players?

knotty briar
#

Hello, I have a question, I am using blueprint system and I am wanting to make a LAN game system. I am running into a problem. Both spaceships spawn, and from what I can tell, both are being replicated too. The listen server can move his/her spaceship, whereas the client spaceship jitters as if the server is setting it location where it spawned all the time

#

How would I fix this does anyone know?

#

If both of them are clients then they both run into the same isssue

knotty briar
#

Its all fine now, I had to create custom events for server and multicast and that fixed it

oak pond
#

right so why did I go through the whole process of setting up the multiplayer hosting and joining servers, then tested it across two different steam accounts on my current and old pc, works literally fine, but when any of my friends try it nothing happens the server doesnt show up

#

what am I even supposed to guess to fix this

knotty briar
#

is it set to LAN?

knotty briar
#

which means something wasnt made correctly

oak pond
#

yeah I considered trying that. I didnt actually set anything to lan though but itd explain why it works on my pcs

knotty briar
#

yeah its the only logical explanation, especially if it isn't popping up for the others, if it was popping up but couldn't connect, I would say there would have been so many possible reasons

real ridge
#

guys what is better way than this to set up color on screen and status for every player in his ui?

#

I am trying set change ui of everyone but only Me has changed it πŸ˜„

dark edge
#

RepNotify my dude

#

What are the rules? Color is based on.... what?

kindred widget
#

Also don't do string comparisons like this. FNames are much better if you need to == a string for gameplay purposes.

quasi tide
#

Honestly doesn't look like it should be a string at all. Should be an enum most likely.

#

Or if you wanna be real fancy, a gameplay tag

dark edge
#

If this is for friendlies to be blue and enemies to be red then just check if team = local player's team

real ridge
#

and every player in his own ui will change it up to game state variable status

real ridge
dark edge
#

don't multicast any of this

real ridge
#

what is multicast good for then

dark edge
#

non-state related stuff.

#

FX, chat, etc

real ridge
#

repnotify is fine I dont need use event tick then

#

i just will get noticed on change

dark edge
#

Explain in plain english what you're trying to do. You're trying to base the color of the thing on what?

real ridge
#

thats all

#

its working but its made kinda retarded

#

πŸ˜„

dark edge
#

ok so the bomb should have a color or team variable that's replicated. When you pick up the bomb on the server, Bomb.Color = CharacterWhoPickedItUp.Color

#

In the onrep, set the color on the material

#

that's it

#

Event picked up -> has authority? -> set self.color = WhoeverPickedItUp.Color

OnRep(Color) -> do the color logic

real ridge
#

I get it but see

#

this is rep notify

#

inside I make this

dark edge
#

Don't use strings but ok

real ridge
#

but it will change only for 1 player πŸ˜„

#

but color is written in string heh

dark edge
real ridge
dark edge
#

only do it on the server

real ridge
#

every player in game has own ui

#

I have reference to just that 1

dark edge
#

the repnotify can talk to the LOCAL UI

dark edge
#

It'll only ever be red

#

you need to choose the color based on team in the repnotify

real ridge
#

okay gonna try

dark edge
#

I'd put that all the way at the beginning right after the overlap event but it's whatever

real ridge
dark edge
#

Have the bomb print the team in the onrep for now, make sure it's updating correctly

real ridge
#

ok I did it for Heal for now not for bomb but its basically same heal is just adding heal I picked it and it is red for me but not for my game friend

#

so propably rep cant change ui of others

dark edge
#

If you're gonna have a bunch of things you should probably make a TeamComponent that handles the onreps and has a dispatcher for when the team updates

#

You can add it to anything that can be thought of to have a team and the dispatcher can handle the UI updates for you

real ridge
#

will look on it

fleet viper
#

hey there, i have a really big problem with attaching my character to my vehicle. The character literally falls trough everything instead of being attached to the vehicle.... This is how I do it:

#

before you ask, yes player ref is valid on server and on client

#

it seems that my actor isnt being attached at all...

meager spade
#

you should not be using multicast for such a thing to start with

#

it will break with relevancy/late joining

dark edge
hearty pine
#

Is it not possible to pass an Object as a parameter to a Server Event?

dark edge
#

You can pass a ref/pointer to it if that's what you're asking

hearty pine
#

That would not hold the values inside it?

dark edge
#

It needs to be stably named so the server knows wtf you're talking about

hearty pine
#

i have an itemData inside the "item" object, tried to pass the "Item" but it was null everything

rich locust
#

if object also exists on the server, it means it is replicated

#

check for it on the serverside and avoid unneccessary RPC s

hearty pine
#

should the Armor objects not exist on server?

#

and only pass the "looks" to the players

hearty pine
rich locust
#

send itemData then not the object itself

dark edge
#

Hey mr Server I totally have this Sword of 1000 Truths

fleet viper
dark edge
#

although attachment should be handled for you with replicate movement stuff

fleet viper
#

i just want to attach my character to this other actor for all clients and this server

dark edge
#

Client input -> run on server event

Run on server event -> set replicated variable

Repnotify -> do something based on new replicated variable value

#

Assuming you don't just attach on server and it works everywhere, that's what replicate movement gets you

fleet viper
#

i think you are mixing my problem up. I dont have any variables to replicate here...

dark edge
#

Sure you do, MyVehicleToAttachTo or MyCharacterWhoIsAttachedToTheVehicle

fleet viper
#

or do you mean a bool and then in the repnotify i have to attach?

dark edge
#

First off check if attachment on server attaches everywhere

#

that should happen if you have replicate movement turned on but characters are special snowflakes so check that

#
Epic Developer Community Forums

Hi, I’m trying to attach a character to a vehicle in a multiplayer game. The problem is the character doesn’t always attach right for non-owner clients. Depending on the exact attachment method I use, occasionally the character is offset or totally missing when the vehicle comes into view. I suspect it’s a relevancy issue of some kind but I ha...

fleet viper
dark edge
#

It looks like Character already handles attachement to another component, read that

fleet viper
#

yeah

dark edge
#

You should just be able to do the attach on the server and everything just works ℒ️

fleet viper
dark edge
#

read that forum post, you gotta do some stuff it looks like

fleet viper
#

so i need to disable gravity

dark edge
#

If you're BP only, I'd look into disabling the CMC, turning on replicate movement if it's not already, and then attaching.

fleet viper
#

lol

#

just disabled movement and it works perfectly now

fleet viper
#

aka to show jittering for example

worn wagon
#

Hoping for some big boi brain's on this, I'm trying to implement client predicted stamina in the CMC from the info in this repo (https://github.com/Vaei/PredictedMovement/blob/main/Source/PredictedMovement/Public/Stamina/StaminaMovement.h and https://github.com/Vaei/PredictedMovement/blob/main/Source/PredictedMovement/Private/Stamina/StaminaMovement.cpp). It works as intended but the issue comes with my specific use case which is stamina for jumping. When a correction is made the client character's JumpCurrentCount is not reset causing a check in JumpIsAllowed_Internal to fail.

GitHub

CMC extended for predicted abilities. Contribute to Vaei/PredictedMovement development by creating an account on GitHub.

#

This results in the client failing to jump locally, but the server jump goes through anyway and causes a jarring correction.

#

The CMC is quite complex and I'm still trying to understand it all, it might be that ACharacter::ResetJumpState is not being called in ACharacter::OnMovementModeChanged but I am unsure. The **FSavedMove_Character **class does include JumpCurrentCount so it should be corrected.

#

This is likely something I will just have to spend some time debugging, thought I would ask here too in case anyone has experience with the CMC and might know the cause πŸ˜„

terse talon
worn wagon
terse talon
worn wagon
blazing spruce
#

Hey, whats the best way to replicate the head rotation of my characters? im calling CalculateHeadRotation function on the Event Blueprint Update Animation event

dark edge
#

GetBaseAimRotation

#

Head is driven by control rotation right?

#

looks towards where camera is looking

blazing spruce
# dark edge Head is driven by control rotation right?

Yeah so the head does go to where the camera is looking to the extent of -70/70 degrees, threshold of 130 so after that it just resets it back to 0, 0, 0 but clients dont see the head rotations of other players at the moment

nova kelp
#

I have a general question about revelency: WHen Playering as listen Server + One client, If I move the Seerver player far enough from the client does revelency happen, I did some test on Sphere Trace running on server it hit well on when Server is near the Client but not at all when far (not sure I am clear)

sinful tree
nova kelp
#

it's weird then cuz I have a use case where my line Trace from Client only work when the listen server is not too far^^

sinful tree
#

Are you sure you're running it on the server?

nova kelp
#

Affirmatif

#

hum

sinful tree
#

Not sure what you're showing there? You're using the server (the main PIE window) showing the traces. The print strings are stating "Server: <insert numbers here>" in both scenarios. Are you maybe expecting that you shouldn't see those prints on the client PIE window?

nova kelp
#

No, The first few seconds when Server on left is near the player attacking the attack land properly, deacreasing health and the first result of the SphereTrace is a Hit True

#

at the eend I move the listen server, do the attack with the client but the SphereTrace always return false

#

So I don't really understand why moving the listen server player affect The SphereTrace running on server

sinful tree
#

Well it definitely isn't anything to do with relevancy as you can still see the server in the distance on the client view. If something wasn't relevant, it wouldn't be showing at all. It's more likely that it could be because you're using an animation montage to perform the trace. There is a setting called "Visibility Based Anim Tick Option" on the mesh that you may need to change, not 100% sure, but try out the settings and see if one starts working.

nova kelp
#

alright will explore this, Thx a lot Datura for your time and help also at least I know what to not look for which is reducing options so it's nice!

green fjord
#

hey guys how do i get latency or ping on session?

small grail
twin juniper
#

Hey all, Hitting a bit of a brick wall here.
Trying to change the color of a playername based on if a player owns a DLC, or their SteamID matches the adminlist/ or is a developer. It works on the own player's side, but they also show other players names as the same color as theirs, even when the other player is just a normal player or doesn't own a specified DLC, etc. I'm not entirely sure what's going on here, but I do have replication set up... I just think not exactly properly. any help is appreciated!

winged badger
#

paste the code that does that coloring

twin juniper
#

Okay, will do

#

So, it's actually a predefined text widget, colored and all, just hidden. The check for example, is if you own a DLC, it shows that one instead of the default normal one.

#

Let me blueprintue it

winged badger
#

IsDLCInstalled will check local steam client

twin juniper
winged badger
#

so it will color all PlayerStates to the state of the local player

twin juniper
#

so about the BIs DLC Installed function, that's part of this plugin:

winged badger
#

yes, and it calls into steam API

twin juniper
#

Okay, so it's checking local.. got it

winged badger
#

which reads the client running on that machine

twin juniper
#

So how do I go about getting the other player's AppID ownership?

winged badger
#

not entirely sure you can do that with steam

#

you can have local players RPC their DLC state to the server from their PS

#

then just replicate that, color in OnRep

twin juniper
#

Just for clarification, what do you mean by "RPC"?

winged badger
#

runs on server event

#

(remote procedure call)

twin juniper
#

Okay, so am correct there

icy jetty
#

Apparently that’s the sticker for RPC lol

twin juniper
#

So theoretically... something like this?:

#

I think?? Maybe?

winged badger
#

you need to access the controller to see if its locally controlled before RPC

#

or everyone will color to the state of last player that joined

#

also

#

you need to call IsDLCInstalled client side

#

and then send the boolean through the RPC

#

or you end up checking only the host's DLC state

twin juniper
winged badger
#

both locally controlled check and DLC installed check need to be called before you call server event

#

not inside the server event

#

click on red node for server event, and add boolean input in its details panel

#

to carry the DLC installed value from client to server

twin juniper
#

I think I'm lost

winged badger
#

Event On Initialized

#

is called client side

#

ServerEvent and everything connected to it is executed server side

#

also, another problem here is that you're trying to send server event thought a widget

#

which won't work

twin juniper
#

I have no clue wtf I just did lol

winged badger
#

now move that branch and the IsDLCInstalled between OnInitialized and IsPlayerSupporterOnServer

winged badger
#

you have one

twin juniper
#

Nvm, am an idiot

#

Move it.........how?

#

Between them?

winged badger
#

yes

twin juniper
#

Am I supposed to move the connections? Lol. There's something I'm not seeing here I think

#

Like this?

#

Problem is the bool for IsDLCInstalled is always false since it doesn't actually tie into the BIs Dlc Installed funct.

winged badger
#

not your isDLCInstalled

#

you can go on and delete that

#

one from steam core

#

and the locally controlled condition gets plugged into the branch

twin juniper
#

Like this??

winged badger
#

better

#

2 things left to make it work

#

you need to use the boolean that comes with server event to setup your visuals

#

and you need to move that RPC to a PlayerController or PlayerState, because widgets can't sent RPCs

twin juniper
#

So this?

winged badger
#

probably? i don't know your intentions for visuals, but it might work

twin juniper
#

So if you own the DLC, your name shows in the 2nd one (gold, which gets set to visible), and if you don't your name gets shown in first one (green, which gets set to visible and gold gets collapsed)

#

So hold up... widgets cant send RPCs? Do I need to move the entire custom event to PlayerCtrlr or PlayerState? Or just the call funct?

winged badger
#

you need to move the server event, you can still call it from the widget

#

which is why its usually best to have a variable bHasDLC in PlayerState

#

and have widget just read it/react to changes in it

twin juniper
#

Oh ... lucking fovely... Okay, gonna try something - I'll get back to you in just a second lol

#

Soo...... what do I put as the object? lol

winged badger
#

is the widget on widget component?

twin juniper
#

Parent Class of the widget is User Widget, if thats what youre meaning

winged badger
#

no

#

i don't

twin juniper
#

It's just some random widget that's displayed above the player's head. I don't think it's "on the widget component" per se

winged badger
#

how do you put it on screen?

twin juniper
#

NVM it is a widget component... my bad was thinking something else

winged badger
#

and that widget component is on what actor?

twin juniper
#

Widget Component is on the pawn, it gets the widget class (actor: W_PlayerName)

winged badger
#

but ofc it is

#

proper way to do this is to setup variable replication in the PlayerState for bHasDLC

#

then have the widget read it from PS, without referencing the widget from game code

#

you could connect GetPlayerPawn->GetWidgetComponent->GetUserWidget object to it, but that won't work 100% of the time

#

if the widget component was on PlayerState and PlayerState was attached to Pawn, this could be made to be reliable

twin juniper
#

I'm gonna try to put it on the PS, but not sure if tit'll work

winged badger
#

did you read the network compendium?

twin juniper
#

Nope, can't get the widget comp. on the playerstate

winged badger
#

it would take me about 3 minutes to wire all this up ^^

#

network compendium is pinned on this channel

#

give it a read, or more then one

twin juniper
#

I have all the playername components on the PlayerState. But the widget itself I can't get the one on the PlayerState and use it on my pawn

#

Because If I'm understanding you right, I add the widget to the PS and get that widget on the pawn

sinful tree
#

You don't want the widget component on the playerstate. The widget component exists on the pawn.
Begin Play of pawn > Get PlayerState > Cast to your Custom Playerstate > Feed in a reference of that playerstate into your widget (which you have to get from the widget component and cast to) and then feed in a reference to the playerstate to the widget. The widget can now bind and otherwise read values from the playerstate of the pawn that has the widget component you're using.
Then the fun begins where you basically must use C++ to know when the playerstate is replicated so you don't run into any race conditions.

winged badger
#

no, you put a widget component on PS, you set the W_PlayerName on that widget component, you attach PS to the Pawn and you fix the references inside the widget

#

and he will run into a race condition with current setup

#

reducing the number of actors involved to 1 removes it

sinful tree
#

Attaching the playerstate to the pawn? That's one I've not heard of but sounds interesting πŸ˜›

winged badger
#

i didn't want to even mention race conditions, he seems confused enough as is πŸ™‚

#

if the widget is basically showing PS data, its more natural then having it on the Pawn

twin juniper
#

I'm so confused I think I said WTF a few times already... lol. So have the widget on the PlayerState?

winged badger
#

problem with RPC in PS and widget on Pawn is that if the Pawn did not replicate by the time RPC lands, entire thing fails

#

so lets take this one step at a time

#

PlayerState blueprint

twin juniper
#

Fuck me

#

Okay here we go

winged badger
#

BeginPlay->Branch (GetOwner Cast to PlayerController IsLocallyControlled condition) -> SteamCore IsDLCInstalled -> Call Server Event on PlayerState sending that boolean through the RPC

twin juniper
winged badger
#

PlayerState

#

from ServerEvent

#

promote the boolean to variable, set it as replicated

twin juniper
#

Which bool?

#

The one off branch or cust. evt?

winged badger
#

the one that arrives with IsPlayerSupporterOnSErver

#

the why...

#

BeginPlay runs on every PlayerState, including ones belonging to different players

twin juniper
#

"GetOwner"... get owner of...?

winged badger
#

PlayerState

twin juniper
#

I have no GetOwner functions

winged badger
#

which is PlayerController

#

Actors have GetOwner function

#

OnInitialized happens on BeginPlay instead

#

and GetPlayerController[0] gets replaced by GetOwner Cast to PlayerController

twin juniper
#

Cant replace GPC with GO and cast to PC

#

The nodes dont connect

#

Infact the branch on the PlayerState doesn't even do the local player controller thing

#

Ok, maybe I fugured it out

winged badger
#

sorry

twin juniper
#

Server evt has this now

winged badger
#

IsLocalController

twin juniper
winged badger
#

from PC

#

not instigator

#

or IsLocalPlayerController

#

one of those will work

twin juniper
#

I have this

winged badger
#

now

#

from the ServerEvent

twin juniper
winged badger
#

that works

#

now from server event

#

just pull the DLC installed pin

#

promote it to variable

#

and set it as replicated

#

delete everything else

twin juniper
#

like that?

winged badger
#

yes

#

now the PlayerStates on each machine have correct data

#

all thats left is having the widget access it

twin juniper
#

Here's the evt beginplay

winged badger
#

and we'll do the simplest and super inefficient approach for that, as this is taking a bit too long already

#

in the widget add binding functions for both textblocks

twin juniper
#

The textblocks are both set to IsVariable true, does that need to change

winged badger
#

GetPlayerOwner from the widget is its local controller, from it you can access PlayerState

#

after that you can cast to your PS type, and read DLCInstalled variable

twin juniper
#

Like this?

winged badger
#

no

#

you don't call the RPC, you just read the DLCInstalled variable

#

from your default PS pin

twin juniper
winged badger
#

that

#

you can give it a try, it should work most of the time now

#

unless widget initializes before the PlayerState replicates the value

#

which is a situation that needs to be handled

twin juniper
#

Ok, now to package it and try it out

#

Sit tight lmao

#

If this doesn't work.........

#

Oh, just a thing I thought I'd mention real quick. There's a small delay on when the widget initializes, so the playerstate should always replicate the value before the widget inits. This was actually implemented long before i messed with this whole thing of the widgets and the ownership thing with replication

twin juniper
#

Oh, nother replication thing for you guys 😏
Trying to replicate color change of the city sample vehicles... doesn't work..

#

NVM. If RPCs cant be called on Widgets, thats why

small grail
#

No, because widgets only on client.

#

Not replicated.

twin juniper
# small grail Not replicated.

Right. In figuring this all out I just realized why my color change stuff never worked... because it's all on a widget

small grail
#

Usually the way doing this is widget getting the variable from playerstate and the player state has the replicated variable for colors.

#

Like team or something.

twin juniper
#

Hmmm or would I be able to put a custom evt on the PS, replicate that to server, than in widget, on button clicked, call that function and set the pawn's color there?

small grail
#

You should put the rep to server event in your player controller

twin juniper
#

I'll have to try that once I have my other issue nailed down

small grail
#

But yeah, you can surely call the function in PS from PC.

twin juniper
#

Okay, so theoretically something like this?

small grail
twin juniper
#

This is on PC

small grail
#

If it is a multiplay game, please don't use get player pawn 0πŸ˜…

#

Using get controlled pawn instead.

#

Well, for either single/multiply game, it is always good to get the pawn you are controlling from get controlled pawn.

#

In PC.

twin juniper
#

Game's SP or MP πŸ˜›

#

MP if you join a session or DS

small grail
#

But your code should be MP robust, right?

twin juniper
twin juniper
drifting stirrup
#

why does my rotator values bounds go from 0 to 180 and -180 to 0 on the client and when it gets sent to server -> multicast it becomes 0 to 360?

twin juniper
#

@winged badger Managed to do it from PlayerController. Playerstate sucks balls

#

I'm going to bed lmao, 3 am here

sour spindle
#

I have built server build from UE 5 to which using command line I can manually run it on a custom port and then client can connect to using the port.

My question is how can I make it scalable for moba styled games where I auto create new unreal server instances with different ports?

(The core game is: I have 2 different maps and 20 players connect to play against each other)

drifting stirrup
#

im having an issue where when i tap A or D key quickly, my character will not turn in the proper direction. its suppose to turn left and right but half the time its in between. this is only in multicast, when i set actor rotation on client it works perfectly from client pov. i noticed that rotators sent over the net get modded so that its 0 to 360 whereas before its 0 to 180 and -180 to 0. so in the multicast i undo that, now both values are the same but when i set actor rotation only on multicast, rotators from BOTH client and multicast are- broken. when i set actor rotation only on client, it works. WTF

#

how does simply having a multicast break the rotator from the original client

small grail
#

How are they broken? Like consistent?

drifting stirrup
#

like it wont turn the correct direction half the time

#

and btw if i set actor rotation on both multicast and client, then both multicast and client rotators work (although other clients will see stuttering from it not being authorized by server i think)

small grail
#

Have you checked the value passed from multicast is the one you want?

drifting stirrup
#

wdym

#

when i do multicast only it tends to be wrong

small grail
#

Yeah, I guess you sent the rotation value from server to all the clients to set?

#

Or how did you get your rotation consistent?

small grail
#

What is the whole process you set the actor rotation?
In my image, should set it from your PC for the local controlled and rep to server and server sent to all other remote clients to the same rotation, right?

small grail
#

Even local controlled?

drifting stirrup
#

Set actor rotation on client only β†’ rotators are correct on both client & other clients

Set actor rotation on multicast only β†’ rotators are wrong on both client & other clients

Set actor rotation on client & multicast β†’ rotators are correct on both client & other clients (but afaik server doesnt authorize it so other clients see stuttering)

small grail
#

Well, yeah. Because it is by the CMC? I guess your character is set using controller rotation?

small grail
#

character movement component

drifting stirrup
#

i use "set actor rotation" not controller because that changes your camera

#

i want body to rotate independent of camera

twin juniper
small grail
#

Ah, ok. So your character is not using controller rotation.

small grail
drifting stirrup
#

@small grail do you know how to exclude client from multicast?

small grail
drifting stirrup
#

?

#

ur own client will turn, but other players wont turn on your screen

small grail
drifting stirrup
small grail
#

So that's the local controlled client. Who sent the Rep server event.

#

In which class you called the multicast event?

drifting stirrup
#

character

small grail
# drifting stirrup character

You may use "is local controlled" method to tell it is a remote character or local one. If it is local one, then skip it.

drifting stirrup
#

im going to bed gn

#

i will try again tmrw

quiet fjord
#

guys can someone help me how to synchronize the players their positions when starting a game. I'm having problems when I run it on a remote server. What happens to me is that the players take time to synchronize their positions and prevent me from seeing each other

ebon basin
#

My notifies are not triggering locally on Anim Montages launched with Multicast from Server, is this something that happened to anyone before?

I have a client that starts a RunOnServer call to play a montage. Server only gets the montage and Multicasts it. The montage plays correctly but the printString I have in the notify only prints in other clients, not on the one that started the thing

Edit: I'm on UE 5.1
Edit2: It prints everywhere if I play this from server

#

Just noticed, the notify works if it's a bit later in the timeline, was at the first couple frames

worthy wasp
#

I'm certain this has probably been addressed a few times over - but with TMap not being replicatable - how would I return values from an actor in the world to clients whom need to access the values in this TMap for UI/code purposes?

#

all i can find online is "no you cant replicate tmaps" as answers to the subject

dark edge
#

Client needs to know..... what?

worthy wasp
#

TMap is of type <ActorClass, int> I have to lookup actor and return int. works fine (if server) but clients ... not so much

dark edge
#

I mean what does that int mean?

#

What are you trying to do here

worthy wasp
#

i just said whaat i'm trying to do

#

tmap.find(actor) should return int..... for server this works fine. for clients its nto the same

dark edge
#

More context would help. How often does this have to be done, how immediate does the change to the int have to be, etc etc.

#

And is it class or actor ref?

worthy wasp
#

i dont udnerstand the why/howoften/etc question - simply because..... fwiw - it doesnt change often, i'm setting this variable to configure a spawner in the world.

and its a class TMap<TSubclassOf<AActor>, int>

quasi tide
#

Because if it isn't often, doing an RPC to keep things in sync (as much as possible) could be a solution.

worthy wasp
#

i'm setting this AS SERVER - so the RPC is there

dark edge
#

Or it could be an array of structs with class,int in there

worthy wasp
#

yah that makes sense... i didn tthink about the Struct[]

dark edge
#

This is what the spawner is spawning right? Like:

Skeleton 50
Mage 3
Boss 1

worthy wasp
#

yes exactly

dark edge
#

Yeah I'd do it as an array of structs or just 2 arrays in the actor, whichever is easier

worthy wasp
#

i'll go the struct array - then i can ensure data is consistent and array order doesnt get fkd

#

thanks for hte suggestion - makes perfect sense!

rotund onyx
#

I feel like I ask this frequently, get it to work, and in a week forget why or how it works.
How do I send data from client to server? For instance the client sets a display name in settings, then when they join a server they send that string to the server.

rich locust
#

You can use gameinstance, it is persistent between levels, and when player gets in you can call an RPC, using data from gameinstance

#

you can also send it as parameters when joining server,

rotund onyx
#

I haven't heard of parameters before, I think I've always just been using RPC

rich locust
#
Epic Developer Community Forums

Hi everyone, I am currently trying to create a simple game with a dedicated server to which I would like to join with my whole Steam-Lobby. What I have so far: Steam is running on the dedicated server and the clients One client (master-client) can invite multiple other clients by creating a (Steam)-Session (using the AdvancedSessions plugin)...

rotund onyx
#

What's the max amount of data that can run through an rpc?

rich locust
#

ther might be different aproach on when using subsystems tho

rotund onyx
#

I don't think that link has a solution in it, lol. Looks like they never got an answer

rich locust
#

probably using game instance would be better though

rotund onyx
#

What's the best way to use the Game instance for this?

rich locust
#

gameinstance is persistent while game is open, unbound to any server etc.

#

you can store your variables before joining server

#

when you are ready as a client in game

#

you can use these datas and send them to the server

rotund onyx
#

I'm all too familiar with the Game instance, I probably use it too much

#

If a client sets a RepNotify variable on their end, will the server still get the notification and start downloading the data?

#

Similarly can this help bypass the limits on large replicated arrays or no?

dark edge
#

Pretty much the only way to send data from client to server is an rpc (run on server event)

#

there might be some other edge case stuff but that's pretty much it

#

What are you sending and how big is it?

rich locust
#

rep notify is, as it is name, notifies on replication

#

client does not do replication

boreal bison
#

I'm trying to have the UI update based on whose turn it is. It works for the hosting player, but not for remote clients. I've got this code for creating the viewport:

#

and then this code for changing the text:

#

but I keep getting the error Only Local Player Controllers can be assigned to widgets. BP_PlayerController_C_1 is not a Local Player Controller.

rotund onyx
# dark edge What are you sending and how big is it?

Right now just a name and color, which I have gotten to work with rpc
But eventually I want to send images. I think most are small enough to get through rpc but I'm looking for something a bit more scalable

pallid mesa
knotty briar
#

Hello there... I have a question if you guys don't mind

#
#

I have uploaded it there if you wanna see the code

rotund onyx
#

Wow that's an awesome resource

knotty briar
#

but

#

basically the issue is that you can't join from a different PC even if it is on LAN

#

Which breaks the whole Idea of multiplayer

#

Just wondering, how could I fix it, as I have absolutely no idea, I have checked through as much as I could

#

and still don't understand what it could be

rotund onyx
#

Is that your Writeup?

knotty briar
rotund onyx
knotty briar
#

Yeah

rotund onyx
#

Love it

knotty briar
#

The issue?

#

I am so confused

rotund onyx
#

When you say maximum pessimistic size of the inner array what does that mean?

knotty briar
#

wait what are you talking about

rotund onyx
#

I'll try implementing when I get home and see what I can find

knotty briar
#

I don't know what write up youre talking about

#

Oh

#

that wasn't me

rotund onyx
#

Ohh

knotty briar
#

I think you got the wrong person

rotund onyx
#

Well either way do you know what that means

#

I think I did ping the wrong person though lol

rotund onyx
pallid mesa
#

if your data structure has an array inside

#

which has variable size, assume the worst case: ie: the maximum amount of bits this inner array will have

rotund onyx
#

So we must set an upper limit on something then?

pallid mesa
#

if you want to preallocate a chunk size, which is what we want, yes

#

and by worst case i mean: the max size you can ever have

#

but this is in case you have an array inside an array, if you just want to send a bitstream - which would be the case of an image\

#

just encode it by: image bit size (n-first bits) - data

#

thats essentially how lossless compression algorithms work

rotund onyx
#

But if I did have an array in an array I would need to make sure my inner array is always under some max size?

pallid mesa
#

yeah

rotund onyx
#

What would be a good value for such a thing?

pallid mesa
#

it depends on the nature of your data

#

in general i would rearrange my data structures to avoid having an array inside my data structure

rotund onyx
#

So if I have an array of structs and each of them has an array of floats like the example. I need to set a maximum limit to the number of floats my structs will ever contain?

pallid mesa
#

yeah

#

because you are preallocating

#

and splitting on chunks

#

think of the max bunch size is at 64K afaik

#

64K is a lot of data specially if we talk about plain old data

rotund onyx
#

The most extreme example I can immediately think of is like a Voxel level or something

pallid mesa
#

imagine you have aan array that holds player ids or whatever

#

you would bound the array by the max players that ur game can have

rotund onyx
#

I thought that was only necessary for an array in an array?

pallid mesa
#

yeah

#

but I am speaking about an array inside your data structure

#

so TArray<FMyDataStructure> MyArray:

#

and the FMyDataStrcuture has the Array of player ids

#

so thats an array inside a member of a data structure holded in an array

rotund onyx
#

How would I put together the data on the other end of the connection?

#

Or split it up in a way that makes sense for that matter

#

Especially if my struct has an array in it

pallid mesa
#

the way i do it on my blog is by splitting the main array. So the receiving end will eventually get all of it

#

you just have to chunk it accordingly based on your inner array max size

#

thats all, you dont have to send a bitstream, you can send members as I do in my blog

sinful tree
# boreal bison and then this code for changing the text:

You're getting the error because Begin Play of player controller fires on the server and the owning client, so both the host and the client are calling it and the host shouldn't be creating a widget for a different player controller. You should be able to use "Is Local Controller" connected to a branch and using the true path to sensure that you're only doing that widget creation on the game instance where the controller is local.

As for why your UI isn't updating, you'll need to show the code leading up to when you're calling the OnMyTurnChanged and how you're determining who's turn it is.

knotty briar
#

Hello. I have a question. basically the issue is that you can't join from a different PC even if it is on LAN which breaks the whole Idea of multiplayer. Just wondering, how could I fix it, as I have absolutely no idea, I have checked through as much as I could and still don't understand what it could be

#

This is on UE5 Multiplayer using blueprints

#
#

if you guys want the images for it too

boreal bison
#

my gamemode:

#

and my widget function:

#

when I threw some print statements around, Player Index in the gamemode was being set correctly to 2 for player 2

#

but then when I printed index in the controller, it was 0

#

so the gamemode wasn't passing the value correctly

sinful tree
# boreal bison so this is my controller rn:

That RPC on begin play is unnecessary. Just connect up the begin play up to the branch you have above.

You really shouldn't bother using indexes to manage players as it becomes too cumbersome to manage.
In your own example there, you're "Getting Number of Players" but what happens if say, three players join, then the second one to join drops out, and then another one joins? Although index "1" should be available, it would see you have 3 players - 1 and so they'd be assigned index "2" which already belongs to player 3.

You have the player array in the gamestate which gives you a listing of all the playerstates.
From playerstate you can get the controller or their controlled pawn (the variable is called Pawn Private)
From controller you can get their controlled pawn or the playerstate.
From pawn you can get the controller and the playerstate.

So basically, from any one of those references you should be able to know which one is which. If you want to keep track of whos turn it is, you should probably do so by playerstate.

Additionally, you're using the "Player Index" variable on the client, but it's not set up as a replicated variable.

boreal bison
#

OH

#

replicating it literally fix it

#

lol

#

but to what you said before, I've been able to keep track of whose turn it is using the gamestate to the player controller, should I move the turn logic from the player controller to the playerstate?

sinful tree
#

Your turn logic should probably be in gamestate.

boreal bison
#

I lied actually it's in the gamemode:

dark edge
sinful tree
#

Gamestate can store a variable containing the playerstate of who's turn it is. It can be marked as OnRep.
In the OnRep you can call the event dispatcher and pass along the playerstate of who's turn it is.
Your bind in the widget can then get the owning player's playerstate and check if it == the one from the event dispatcher, and if so, it's their turn.

And game mode always runs on the server, so having RPCs within the game mode doesn't really do anything. You can't even have clients call anything in the game mode.

Don't just mark events as RPCs unless you want clients to be able to call them at any time. RPCs are not really about "This needs to run on the server", they are more of a means for allowing clients to make requests to the server to execute the code on the server.

boreal bison
#

Okay, got it, I'll try to clean up some stuff with that in mind, thank you!

sinful tree
# dark edge General architecture question, would you put it all in GameState or the logic in...

Personally I like to keep GameMode mostly for player spawning or anything that absolutely must be server only that shouldn't be exposed at all to clients.
GameState should handle things that are about the state of the game. A player's turn seems like something that should be handled and stored on gamestate. There's also no point in jumping around through different classes if you don't need to. That said, I can see how one may want to store just the data on the GameState for replication sake, but if we're coding actors to handle all of their logic rather than jumping to the GameMode to perform their logic, why couldn't we do the same with GameState?

#

I'm no professional though, so...

boreal bison
sinful tree
#

You have to select it (usually in the bottom left) and then usually near the top right there'll be the + option to add an input.

boreal bison
wanton bear
#

What's the best way to handle this situation: based on the amount of items a player has placed in the world of a specific class, a variable increases that all players need to see in a GUI

#

I'm thinking when an item is placed an event on a character triggers an event in game mode, which runs the logic to count how many actors of class exists and figure out the score, then passes the result to game state which replicates it?

boreal bison
echo bough
wanton bear
#

instead of having the client trigger a count

sinful tree
#

The actor should be spawned when running on the server, so when you spawn it, you update your count variable which should probably be on gamestate.
Your gamestate could have an event dispatcher that you would call on the OnRep of the variable.
Your widget binds to the gamestate's event dispatcher to update itself.

wanton bear
#

the issue with that is the actor is also used as the "building shadow" while placing, although i could add a simple boolean in it to check i guess

sinful tree
#

The building shadow should be local only.

#

When you confirm the build, you'd be telling the server where and what rotation to build it. The server spawns it for everyone.

wanton bear
#

any reason for that? i'd prefer other players in game to see the other players building

sinful tree
#

That's fine then, yeah... But you would only increment the value when you know that they have confirmed placing it.

wanton bear
#

wait so going back, how would i trigger an event whenever an actor is spawned in the world of that class

#

without involving the client

sinful tree
#

You have to involve the client if you want them to build something in a certain place.

wanton bear
sinful tree
#

Player Input > RPC to Server with location/rotation > Server spawns actor.

wanton bear
#

yeah i have all the spawning already sorted out, just thinking about the variables and their logic and how to secure it reasonably

sinful tree
#

You don't need to use game mode for something like this.

wanton bear
#

oh really? what do you need game mode for? i was under the impression that you should run any logic on it that the client shouldnt be able to access in any way

sinful tree
#

Game Mode handles player connection/spawning players and is the only class that is server-only. That doesn't mean you have to put all game logic in the game mode.

wanton bear
#

in theory though, if i had some super secret formula for working out a value, it would be best put in game mode though right?

sinful tree
#

Are you planning on distributing the game where players can host their own servers?

wanton bear
#

yeah i am, so it's not actually an issue but doge_kek

sinful tree
#

Right, so that's the thing - If you say had dedicated servers that never got released, you could in theory never distribute the game mode in a client build, thereby locking out players entirely from knowing about that super secret formula. If you package your game with the game mode, then technically, the data is there, and someone could potentially reverse engineer that secret formula of yours.

wanton bear
#

so basically the place that makes most sense is to put it all in gamestate to make it a little easier to navigate unless i'm making some mmo or something

sinful tree
#

Probably not.

#

It all depends on what it's being used for and how you need to access it.
If it makes sense to put in gamestate because there are a bunch of variables about it and you need to replicate bits about it, and it doesn't need to touch the game mode and there only ever needs to be one thing keeping track of it, then gamestate would probably be a good fit.

#

Like a building system could potentially just be a component you add to your players.

wanton bear
#

yeah it is basically that, it's essentially a shared energy bar between all players

sinful tree
#

But additional systems that work off of that building system, like that shared energy bar, would probably be gamestate πŸ™‚

wanton bear
#

hmmm

sinful tree
#

But if that energy bar was more a part of a base that the players built, then it would probably need to be part of a separate actor manager that handles what a "base" is, has its own energy bar, and contains all the data about all the parts you used to assemble it.

wanton bear
#

so more generalized would be best in game state

sinful tree
#

If there's only ever going to be one, yes.

wanton bear
#

ohh i see what you're saying. yeah that makes sense

#

thanks a lot, this helped me think through some stuff

peak mirage
#

I don't know if this is a bug but I noticed when a multicast RPC is received depend on the NetUpdateFrequency. At first I though I was paranoid but then I did a test.

#

I set the NetUpdateFrequency to 0.1f (once every 10 seconds). And my server actor will send a multicast RPC every second. First RPC arrived almost immediately but the next calls are all late, and they are mostly arrived every 10 seconds.

#

So just want to ask if this is UE standard behavior when it comes to multicast RPC or something went wrong?

#

This test was done in UE 5.1 source build. I did modified something in the source code but it's only in GAS and have nothing to do with replication or network system at all

jolly siren
#

@peak mirage No this isn't a bug. Unreliable multicast RPC's are the only type of rpc that depend on NetUpdateFrequency

peak mirage
jolly siren
#

Sorry typo, corrected it

peak mirage
#

Oh, you edited the answer, I got it

jolly siren
#

Unreliable Multicast RPCs are queued up and sent out with Property data. Reliable and Unreliable unicast (client/server) RPCs will be sent immediately.

peak mirage
#

Thank you, so this is an intended behavior, never encounter a problem with its timing before so I didn't noticed that

jolly siren
#

yes, it's intended and how the engine has worked for a very long time

peak mirage
#

Thank you mate, that helps a lot :3

jolly siren
#

np

#

You can use ForceNetUpdate() after calling the rpc if you want it to go out immediately

peak mirage
#

That makes sense, too. Send a lot of RPC would cause problem with network bandwidth :\

peak mirage
jolly siren
#

No, it's actually pretty best practice to decrease NetUpdateFrequency for most things to 1 and call ForceNetUpdate after modifying a variable/calling a unreliable multicast

#

Although Iris makes all of this a moot point

peak mirage
#

Oh so that was a good side effect 😌

#

I know Iris will make a lot of thing go out of the window but that's too far into the future so I guess I will stick with what we got here for the time being πŸ˜‚

jolly siren
#

Makes sense, yeah just thought I would mention it

obtuse field
#

As ReplicateSubobjectList is deprecated, what should I use instead?

Doing something like this doesn't work:

UTestObject* TestObject = NewObject<UTestObject>(this, UTestObject::StaticClass());
        TestObject->TestValue = 5;
        AddReplicatedSubObject(TestObject);
        TestObjects.Add(TestObject);
#

.h

UPROPERTY(Replicated)
    TArray<class UTestObject*> TestObjects;
quiet sable
#

Hello! Any1 could help me out? The horse is jittery for the rider, but not for other clients

sinful tree
dark parcel
#

I'm trying to understand basic multiplayer framework

#

I have climbing system and it's jittering on client side. I set the rotation for the character using rpc

#

Perhaps using rpc for movement Is a bad idea?

quiet sable
sinful tree
# dark parcel Can I ask if it's a good idea to control movement and rotation with rpc at all i...

Technically all movement is made to the server through RPCs. It's when you're using the Character Movement Component that you may be breaking how the prediction and replication works.

If you're not using the CMC, then it doesn't really matter, you can do RPCs however you like, but you won't have great prediction - the CMC works by the client sending a bunch of "saved moves" at the same time and the server when it receives it, rewinds the game back to those timestamps to see if those moves are possible and if not, it'll correct the position of the player. To the client, they'll move smoothly until such time as a correction is made.

knotty briar
#

Interesting

knotty briar
sinful tree
# quiet sable I attached my camera to the horse after mounting, and actually, my horse is perf...

Don't attach actors VIA multicast as they only execute if everyone is present and relevant when they are executed - use a variable called something like "Mount" and have it store a reference to the horse and make it an OnRep variable - when the reference is valid, you can do the attachment, when its not, you can deattach.

As far as the jittering goes, you may need to disable collision on your character as it could be interfering with the horse.

sinful tree
knotty briar
#

I have a spaceship and I’m thinking of applying there because it’s also jittering with rpc

knotty briar
#

I’ll have a look though, thank you for your help

dark parcel
quiet sable
karmic briar
#

hello,i want to ask im thinking of making a vaullting and mantling using motion warping in multiplayer. in thinking do i need a flag in cmc to drive the vault and mantle that called another func that does it in CMC? my prototype right now is all in character bpnwith the tracing and the act of vaulting and mantle
anyone can give me pointers

keen flicker
#

hi. if this's called on the server and i want to change the player character material that other players can see also, from my understanding i need to use simulated event because it gets executed on server and client but for the server i doubt that getting player character 0 is not correct

#

do i also need a server's player controller for this player also?

soft halo
#

Guys, how could they have made this system?
At a certain angle, the camera does not move left and right, but when it passes a certain angle, the camera does.
When Desired Control and Use Controller Yaw are disabled, after a certain angle for the left and right, the set actor rotation system works manually, but this is not compatible for Multiplayer.

Which way would you apply to set up such a system?

tame kraken
#

I'm tired of the frequent and hardly explainable multiplayer troubles.
After working on my character movement component for several days, I just notice that multiple clients aren't able to see each other move AT ALL 😬

#

and ofc my character movement component is weirded out now πŸ™„

soft halo
#

be sure that desired c. is enabled and "replicated" section is enabled

tame kraken
#

I hope the rebuild will fix the problem because the cmc is totally broken for now

crisp loom
#

Hello everyone! I need help with the multiplayer sessions in UE 5.2. I'm new to unreal and game dev in general and while everything else I've tried seems to be going ok so far (documentation is helpful, conventions are reasonable) with LAN multiplayer I seem to have hit a bit of a wall and can't make any progress on my own. I'm using blueprints and would like to avoid C++ if possible so early in my journey and focus on learning the engine's concepts. If however what I'm trying to do is impossible to do with blueprints obviously a C++ solution would be much appreciated πŸ™‚ Also I apologize in advance if the knowledge that solves the issue I'm facing is in the docs and I've missed it. Any links instead of elaborate answers would also be awesome!

What I'm doing: I've setup a really simple game with a single map that allows players to move around and create/join sessions in LAN
What the issue is: When running the game from the Editor (in standalone mode, 2 clients) client A can create a session, client B can join said session, everything works great! When running the game after packaging it (standalone) it works exactly like in the editor between 2 clients BUT only from the same PC. If I use 2 different PCs in the same network I can't seem to make it work, the session client A creates is not discoverable by client B. I'm not sure if I'm missing something about the multiplayer sessions or if it's an issue with my network configuration. My home network has the structure in the image. I've tried every possible combination:

  • PC A <===> PC B (under switch): sessions not detected
  • PC A <===> PC C (under router): sessions not detected
  • PC B <===> PC C (under router, pretty much same thing as the second test): sessions not detected
    At first I tried between A and C and thought it might be an issue with the 'find sessions' message being broadcast to all the machines on the switch instead of all the machines on the network (router), but the test between A and B makes me thing that's not the case.
    What I've tried: I've tried using ZeroTier to connect to another PC in the virtual network and the strangest (to me) thing happened, the session was actually discovered! But the client who tried to join (even though they received an acknowledgement from the server) did not actually load the map and the join was aborted. I don't think this issue is in any way related to my original problem, I just thought I'd include it in case I'm wrong and it's helpful info. I've also tried adding
[OnlineSubsystem]
DefaultPlatformService=NULL

to my DefaultEngine.ini file, but this seems to have literally zero impact, it changed nothing.
Finally I built the LyraStarterGame project and did the exact same tests I did with my game (hosted lan games and tried discovering them). It works with 2 clients on the same PC but not in different PCs.
I've tried adding exception rules in windows firewall (on all PCs), I've also tried disabling the firewall completely, still no change. I used wireshark to look for the broadcast message but I couldn't find any packages from the source (client looking for sessions).

Side note: I've looked for events I can capture to log network errors, after googling a bit I stumbled on 2 events (can't quite remember their names for sure, I think they were called EventNetworkError and EventTravelError) in UE 4.27 documentation, but they don't seem to be in the UE 5.2 documentation and also I can't find them in my blueprints (even when I set Context Sensitive to false). What's the standard way to capture network errors in UE 5?

I'm always available for more information if needed.

Thank you for your time!

PS: I've also included a screenshot of the logic I'm using to create/join sessions, the event is triggered by the press of a button.

soft halo
#

How can I inverse camera lag speed?

I'm making a FPS game, what I want is for the arm to move faster than the camera when the camera moves, at least up to a certain angle. When I set the Camera Lag Speed in the spring arm, the arm moves slowly from the camera, so there is lag. What I want is the opposite, for the arm to move faster than the camera.

How can I do that? Any idea?

clear island
#

if I have a USTRUCT with all fields inside replicated and I added it to a TArray that is also replicated, what happens when I change a field inside this UStruct? will the UStruct inside the TArray on the clients be updated aswell?

boreal bison
lime iron
#

I downloaded some plugins and when I rebooted this problem occurred and the project does not open what should I do

dreamy scarab
#

has anyone had issues with clients sliding around in vehicles but only on client view from other clients and server view it does not?

dry pebble
eternal canyon
#
struct FPhysicsPredictionSettings
{
    GENERATED_BODY();

    /** Enable networked physics prediction */
    UPROPERTY(EditAnywhere, Category = "Replication")
    bool bEnablePhysicsPrediction;

    /** Enable physics resimulation */
    UPROPERTY(EditAnywhere, Category = "Replication", meta = (editcondition = "bEnablePhysicsPrediction"))
    bool bEnablePhysicsResimulation;

    /** Distance in centimeters before a state discrepancy triggers a resimulation */
    UPROPERTY(EditAnywhere, Category = "Replication", meta = (editcondition = "bEnablePhysicsPrediction"))
    float ResimulationErrorThreshold;

    /** Amount of RTT (Round Trip Time) latency for the prediction to support in milliseconds. */
    UPROPERTY(EditAnywhere, Category = "Replication", meta = (editcondition = "bEnablePhysicsPrediction"))
    float MaxSupportedLatencyPrediction;

    FPhysicsPredictionSettings()
        : bEnablePhysicsPrediction(false)
        , bEnablePhysicsResimulation(false)
        , ResimulationErrorThreshold(10.0)
        , MaxSupportedLatencyPrediction(1000)
    { }
};```
#

OMG OMG

#

OMG

#

in the main branch

#

of 5.2

sinful tree
# keen flicker hi. if this's called on the server and i want to change the player character mat...

You don't want to do this on a multicast as they fire once and don't remember the state, so if anyone isn't present in the game or have this particular actor out of relevancy, they will not see the change.
Instead, drive stateful changes through OnRep variables (Replicated w/ Notify). When you change the variable on the server, then when the client receives the updated value, the generated OnRep function will be called, and that's where you can use the value to do things to change visuals.

You are correct that using Get Player Character is not the way to go as that will almost always call the local player character rather than the one needing the change. Instead, this functionality should be present on the player character class itself. So the variable I mentioned above that you should create should likely exist on the character so the OnRep can exist there, in which case you could just use the direct reference to the mesh on the character and make the required changes.

crisp loom
twin juniper
#

guys

#

i'm downloading unreal engine 5, but it got stuck for an hour at 82% even if it finished downloading all 20GB

#

what do i do

#

please, i need help

sinful tree
clear island
#

ah I see, thanks

sinful tree
crystal crag
#

If there are characters that would only appear if certain events are triggered, is it common in that case to only async load them across the server and clients or would you still just load those assets when the level loads for both clients and server?

#

I like the idea of only having assets in memory that are actually going to be used. That being said, it seems weird to make all connected clients async load character assets in the middle of game play. For one, it'd have to be multicast reliable, and secondly, you'd have to somehow report back once all clients had loaded the asset.

#

Reading that back, that does sound pretty terrible. I can't imagine that being a good approach.

ember furnace
#

hi, i'm trying to spawn this only on client that triggers sphere, i'm playing as listening server and its replicates to client, on clients alone works as expected - spawns only for client, dunno how to code that correctly

sinful tree
ember furnace
#

it's not marked as replicated at all

tribal badge
#

Hey Guys,

Im making the JoinSession call after finding the list of servers and clicking join. I'm seeing the join session call fire success but im not loading the map of the new world like expected. It seems like there is some kind of connection issue, but im not sure what or why. Here are the logs>

LogNet: World NetDriver shutdown IpNetDriver_95 [GameNetDriver]
LogNet: DestroyNamedNetDriver IpNetDriver_95 [GameNetDriver]
LogExit: GameNetDriver IpNetDriver_95 shut down
LogInit: WinSock: Socket queue. Rx: 32768 (config 32768) Tx: 32768 (config 32768)
LogNet: Created socket for bind address: 0.0.0.0:0
LogNet: IpConnection_81 setting maximum channels to: 32767
PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
LogHandshake: Stateless Handshake: NetDriverDefinition 'GameNetDriver' CachedClientID: 2
LogNet: Game client on port 0, rate 100000
LogNet: Initial Connect Diagnostics: Sent '10' packets in last '10.019615' seconds, no packets received yet.
LogNet: Initial Connect Diagnostics: Sent '9' packets in last '10.021638' seconds, no packets received yet.
LogNet: Initial Connect Diagnostics: Sent '10' packets in last '10.033020' seconds, no packets received yet.
LogNet: Initial Connect Diagnostics: Sent '10' packets in last '10.012784' seconds, no packets received yet.

I dont think I have any subsystems activated, and Im not using LAN. Though I am connecting to a local game instance running on the same computer as the first instance.

Does anyone have any idea how to point me toward a solution?

knotty briar
#
knotty briar
#

Hello. I have a question. basically the issue is that you can't join from a different PC even if it is on LAN which breaks the whole Idea of multiplayer. Just wondering, how could I fix it, as I have absolutely no idea, I have checked through as much as I could and still don't understand what it could be

#

This is on UE5 Multiplayer using blueprints

ember furnace
#

check if your network is private in windows settings

knotty briar
#

Thing is, I tried it with three different networks

#

not just mine

ember furnace
#

yeah, but did you set network as private?

#

windows will protect you if you don't set it as private network

arctic minnow
#

Does anybody have a problem with character movement being less smooth in multiplayer?? should I turn on network smoothings or smt??? or Network always replicates ticked on or off????
Should this be on?? also should I have this on?

#

πŸ™‚ πŸ™‚

#

πŸ™‚ πŸ™‚

knotty briar
dark parcel
#

I have a problem with the server seing the client "raw" animation. It's jittering. But client to client is fine. I don't want to resort to dedicated server, how can I make sure host sees the same anim update as everyone else? I tried to update the anim tick rate but it just result on the character animation to play many times faster than client

knotty briar
#

Idk jittering is so annoying, and I would use a CMC but the issue is I have a spaceship that flies

#

not a character

#

soooo can't really use a character movement component

#

which normally fixes the jittering

dark parcel
#

The jitter happends to everything. Not just movement but montage too.

This problem is apparent on packaged game 😦

sinful tree
dark parcel
#
ember furnace
#

i found problem but dunno why this work like this, overlap is triggered on server and on client

#

dunno why but that fixed issue

knotty briar
#
Epic Developer Community Forums

I understand that, the reason I tried it this way is that I’m setting a CONSTANT velocity, so it’s never changing! And I wasn’t sure why it was changing on the client. Anyway, with the later investigation on why the velocity fluctuates on the client (the coefficient) I removed the force-setting the velocity on the client, simply setting the coe...

#

found some form of solution to the jittering

#

which may actually work

#

Add this to your DefaultEngine.ini for a huge performance boost!

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

[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=500000
MaxDynamicBandwidth=80000
MinDynamicBandwidth=20000

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=800000
MaxInternetClientRate...

β–Ά Play video
dark parcel
icy jetty
knotty briar
#

quick question

#

what is call pre replicationj

#

I saw replication

#

but

#

whats the pre-replication property

fossil spoke
knotty briar
fossil spoke
#

Thats not a property

#

Well

#

The Setting itself is

#

But PreReplication is likely referring to the function itself

#

Which if you are using Blueprint only, you dont need to worry about

#

Leave it enabled.

knotty briar
#

okay

#

I'm guessing its an inbuilt function then

#

something replication related

#

πŸ’€

fossil spoke
#

What does the tooltip say?

knotty briar
#

literally just says "call pre replication"

#

no description either

#

thats what it said

fossil spoke
#
    /**
     * Called on the actor right before replication occurs. 
     * Only called on Server, and for autonomous proxies if recording a Client Replay.
     */
    virtual void PreReplication(IRepChangedPropertyTracker & ChangedPropertyTracker);
knotty briar
#

I see

#

thank you

#

sorry I kinda got another question

#

say I want to only run a function on all clients and except for the one who owns the action

#

actor

#

would that be possib;e

#

like multicast but without the owner

#

actually no, I came up with an idea

sinful tree
#

You either have to send RPCs to the individual player controllers of those players (either through their playerstate, playercontroller or their controlled pawn), or use a multicast and determine if the owner != local controller, then perform the action.

knotty briar
#

interesting

#

That makes sense

#

so its like a more manual check of whos who and induvidiually send it to them

#

well the last point would be easier

#

or, I could use the CMC but somehow make it work on my aircraft

#

which I have no idea how to do

#

lmfao

#

I will figure it out now tho

#

I could try converting my static mesh into a skeletal mesh

#

hmmm

#

possibly could work

#

but Ima try with just normal stuff first

tribal badge
#

Hey Guys,

was wondering if I could get some help with my multiplayer issue. To break it down, clientB is unable to load the level after connecting to clientA through the session list.

I create the session and load player 1 into the game.
I find sessions with player 2 and the session pops up.
I hit join as player 2 to join player 1.
I get connection successful fire.
I dont load the level and stay staring at the join button.

When I look at the logs right before hand this was happening.

LogNet: World NetDriver shutdown IpNetDriver_95 [GameNetDriver]
LogNet: DestroyNamedNetDriver IpNetDriver_95 [GameNetDriver]
LogExit: GameNetDriver IpNetDriver_95 shut down
LogInit: WinSock: Socket queue. Rx: 32768 (config 32768) Tx: 32768 (config 32768)
LogNet: Created socket for bind address: 0.0.0.0:0
LogNet: IpConnection_81 setting maximum channels to: 32767
PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
LogHandshake: Stateless Handshake: NetDriverDefinition 'GameNetDriver' CachedClientID: 2
LogNet: Game client on port 0, rate 100000
LogNet: Initial Connect Diagnostics: Sent '10' packets in last '10.019615' seconds, no packets received yet.
LogNet: Initial Connect Diagnostics: Sent '9' packets in last '10.021638' seconds, no packets received yet.
LogNet: Initial Connect Diagnostics: Sent '10' packets in last '10.033020' seconds, no packets received yet.
LogNet: Initial Connect Diagnostics: Sent '10' packets in last '10.012784' seconds, no packets received yet.

I am also placing a collection of screen shots for my blue prints for creating, finding, and joining sessions. https://imgur.com/a/xqEt5ik

I havent changed anything about the subsystems or anything and tbh I dont even know where i'd do that. I've spent a good 4 hours googling trying to find an answer but im stumped

tribal badge
#

Whenever i load the map from the editor with 2 players it connects no problem. The issue seems to be specific to the Join Session command

twin juniper
#

I want to get reference to Game Widget which I am creating and adding in Level Blueprints in PlayerState and Game State on Client and Server Both. The problem is that Player Controller doesn't have it's Player State initialized on Client and therefore GameWidget references are setup correctly on server but not on Client. Any solution?

echo bough
twin juniper
#

I came across it but tried BeginPlay on PC but it fires twice for Server setting GameWidget to None after it's been set correctly

#

Why would it do so?

echo bough
#

tried on playerstate's begin play?

twin juniper
sinful tree
# twin juniper Why would it do so?

Begin Play of most replicated actors will fire on both the Server and Clients. Treat it as if when the server spawns the actor, the begin play fires, when the client receives the notice to spawn that replicated actor, it also fires the begin play. Also, if you're using dedicated server (play as client in editor) widgets can't exist on them so that's why you end up getting the "None" error when trying to add to viewport.

#

You can gate off something like begin play with Has Authority. Has Authority will almost always be the server (whether dedicated or listen server) unless the object is spawned locally on a client, where the Remote path can be thought of as the clients.

echo bough
#

there is this macro to check for dedicated server

#

for anything cosmetic

twin juniper
echo bough
#

only to owning client

twin juniper
sinful tree
twin juniper
#

I have a server (not dedicated) and a client

#

Okay got it

#

Server PC is replicated but not the client one as it is on client

#

But why would Server PC beginplay on Client Side affect the one on Server Side?

sinful tree
#
  1. Host (listen server) creates their playercontroller - Server begin play fires on playercontroller0
  2. Host (listen server) creates the second player controller - Server begin play fires on playercontroller1
  3. Client1 receives their player controller - local client begin play fires playercontroller1
echo bough
#

Server PC0 Fires
Server PC1 Fires
Client PC0(PC1 in server) Fires

twin juniper
#

Oh, so server created PC for both client and server?

sinful tree
#

Of course.

#

It's a replicated actor, so it must exist on the server and you definitely want it on the client πŸ™‚

twin juniper
#

Is there a way to implement OnRep_playerstate in BP?

sinful tree
#

Nope

echo bough
#

dont think so

#

so the best bet is to use PlayerState's begin play instead

twin juniper
sinful tree
# echo bough so the best bet is to use PlayerState's begin play instead

Even that's not great - Begin Play of the playerstate isn't reliable since a client will ultimately create a local copy of a player controller and playerstate before they are replicated. So the begin play that fires usually ends up being their local one first, and then when the replicated one takes over it doesn't fire again.

twin juniper
#

That is where all this ruckus began in the first place

#

Would try and see what happens

#

Thank you for the help 😊

twin juniper
twin juniper
arctic minnow
#

Can someone show me how they replicate a launch character?? The right way and a animation montages also how would i make my launch characters smoother in client??/playmontages seams as if they run jumper without shooting in client

#

πŸ˜ƒπŸ˜πŸ˜ƒπŸ˜

#

πŸ˜ƒπŸ˜πŸ˜ƒπŸ˜

buoyant scaffold
knotty briar
#

Just a question? How can I get a reference to the current session result

#

Like the session the player is in if it’s a multiplayer match

#

Cuz I wanna get firstly the max amount of players and secondly the current players to find out when to start the match

limber cloak
#

How do you change the skeletal mesh from a USkeletalMeshComponent in multiplayer? I know how to do run on Server and NetMulticast
I need an answer in C++
Please do help

blazing spruce
# knotty briar Cuz I wanna get firstly the max amount of players and secondly the current playe...

Im not sure if you can get a reference to the current session result cause CreateSession doesn't return the session result but you don't need it to set a max amount of players or keep track of the current number of players, when you're calling CreateSession the 'Public Connections' is your max players and then in your game mode you want to override the 'Event Handle Starting New Player' event and create a 'Connected Players' array that stores player controllers, then cast 'New Player' to your player controller and add it into the Connected Players array

#

You also want to override OnLogout on your game mode too so when a player leaves the session you want to remove their player controller from the Connected Players array

#

Then before you start the game check if the length of the ConnectedPlayers array is equal to your MaxNumPlayers, if ture, start game

clever hound
#

This is happening in the server:

#

it goes to the client rpc

#

Then in the client RPC it somehow shows it is empty

#

So the variable which turns into parameter has value in the server RPC but is empty in the client RPC and I can not figure out why

#

(This is in the same place as pic n.1) But if on the server I take a copy of something inside the Local Quest ref like the objectives array then it is not empty

kindred widget
clever hound
kindred widget
#

You need C++ to replicated UObjects as subobjects unless that's changed recently.

kindred widget
#

Also don't make this RPC directly after creating it either. It still won't resolve correctly. It won't have time to replicate to the client before the RPC reaches it.

clever hound
kindred widget
#

You have to do it through the outer. Sec

ancient adder
#

Get the outer actor and call AddReplicatedSubObject()

#

I think this is not possible in 5.1 or 5.0, you have to override some functions in the actor

kindred widget
#

Your UObject needs to be a C++ base and override IsSupportedForNetworking(), and return true.

In the outer, either an Actor or ActorComponent, you set this in it's constructor.
bReplicateUsingRegisteredSubObjectList = true;
And then you can use this to replicate the object.
AddReplicatedSubObject(ItemToAdd);
Worth tracking these in an array to call this when finished with them.
RemoveReplicatedSubObject(ItemToRemove);

clever hound
kindred widget
#

That is object instantiation. What I just wrote out is how you replicate it after that.

clever hound
dark parcel
#

is get player controller bad for multiplayer?

clever hound
dark parcel
#

πŸ‘

kindred widget
# dark parcel is get player controller bad for multiplayer?

@clever hound It depends on the context. In most networking code, your classes have a way to get the related controller they need. You should never, under any circumstances rely on the index to get a controller or character.

Also GetPlayerController at index zero can return a client player controller on the server under rare conditions while server travelling in listenserver mode.

If you're using it for UI, it's pointless, UserWidgets have a GetOwningPlayer function to get their relative, local controller.

So in general there's not really much use case for the generic GetPlayerController/Pawn/Character in most code.

clever hound
kindred widget
clever hound
kindred widget
#

What class is this in?

clever hound
#

BaseEnemy

#

Character

kindred widget
#

Why does your enemy need access to the local player controller?

clever hound
#

So is this bad then?

kindred widget
#

That might be fine, but I'd recommend switching that to a simple GetPlayerCameraManager->GetCameraLocation. It's project agnostic and doesn't care about your character.

And I would only suggest this if you really need a 3D widget. Anything screen space should be done in screen space UI and never in a WidgetComponent.

clever hound
#

Its VR project

#

Everyting is in world space

kindred widget
#

I'd maybe rely on the playercamera manager still. Less hard references to classes that might contain heavy assets. And you can copy paste it elsewhere later with no changes, like a new project if need be, portable.

clever hound
#

Ok ill keep that in mind

blazing spruce
#

Hey, what's the best way to replicate the head rotation of my characters? im calling the CalculateHeadRotation function on the Event Blueprint Update Animation event in the animation bp, server sees it fine ofc but clients dont see other players head rotation?

fair latch
#

I suggest having the replicated variable in the character actor.

blazing spruce
loud frost
#

Which server is best for unreal engine game hosting ??

sage light
#

Hey guys, we are looking to implement voice chat features to our game. I wanted to ask which solution in your opinion would be the best based on your experience -
I was thinking about playfab party because we are already using playfab servers and playfab matchmaking, but it seems like it would require some overhead. Wouldn't it be much easier to find a plugin/solution that uses the existing dedicated server for trasnmitting the voice chat data rather than using a different micro service for that?

unique cloak
#

Does anybody know are these lines don't do anything? I even tried to use the damaged actor overhead widget and it still didn't work, ideas?

  • btw, these functions are fine and I use them in another class and they are working fine I have no idea why it doesnt work here on ReceiveDamage. please help πŸ™‚
rich locust
#

you need to carry UI updates to client side

unique cloak
unique cloak
winged badger
#

You can just call ShowPlayerName(DamagedActor) from your client RPC

#

And not dupe code

crystal palm
#

hi

crystal palm
#

Anybody knows how can I get controller Id of my pawn or a reference to it?
I want apply my posses just into that pawn in box collision

crystal palm
fossil spoke
#

The Pawn?

#

If so, just Cast to Pawn, the Actor that the Sphere Trace returns.

crystal palm
fossil spoke
#

Why would you post an image that contains outdated code???

#

Post the most up to date code.

crystal palm
#

I don't have access to my pc

tribal badge
#

So I just had my friend download a packaged version of the game. In my game locally I have a Create Game and Join Session call. They worked perfectly fine when I used it locally. However, when my friend tried to find my session it didnt pop up.

Do i have to have an online subsystem configured to support this logic, or does the base multiplayer/online functions handle this?

icy jetty
#

well, it's not going to automagically let him connect to you over the internet

tribal badge
#

So if I am understanding this correctly. Session discovery only works on LAN unless im using steam sockets? Unreal multiplayer works, but I would need to connect to the IP directly?

tribal badge
icy jetty
#

your create game and join session worked perfectly fine when you used it locally, on your own system, but your friend cannot find your session over the internet, is how I read that

tribal badge
#

yes, followed by 'do i need an online subsystem configured to support this logic, or does the base multiplayer/online functions handle this?'

#

the answer is yes I need an online subsystem to support this. How does your response help lead me to that answer?

icy jetty
#

afaik you can also connect without an online subsytem, using IP, but you need to program that into it

tribal badge
#

yeah thats what I had just figured out moments before you responded

#

but its good to know now

#

better than something wrong with my netcode

icy jetty
#

might also to have to open ports and whatnot tho

#

to avoid firewall blocking inbound connections

knotty briar
#

Jus a general question, I’m sure this goes here as it’s networking related. Basically yk how there’s a small jitter right on the client’s pawn in multiplayer, im not sure if it would work, currently my input system is set up in the pawn, where it runs a server even then the multicast even when input is triggered, if I move the input into my controller instead but keep the main movement system in the pawn and call that function from the controller would that fix the jitter

#

Cut the server and client ain’t fighting anymore and the client never updates it anymore

#

Only the server does

#

Although that’s probably how it was before too

#

I jus don’t know if anyone’s tried it so if anyone has and noticed a difference would you let me know

#

Cuz I’m in abut of a hurry on this so if it fixes it then ima happy and if it doesn’t then I don’t wanna waste time on it as I have 5 days left out of the ten days we had

amber barn
#

hi guys, has anyone implemented a knockback without physics? im using addmovement right now and no matter how big i make the vector the pawn doesn't move much

small grail
amber barn
small grail
#

In short, the character movement controlled by the animation.

#

Same as your character doing rolling

amber barn
#

hmm still not sure what youre talking about, when a projectile hits my playerpawns they need to get knocked back x units or with x force, im doing this atm
FVector force = GetActorForwardVector() * 100000000.0f;
AddMovementInput(Force, 10.0f);

value of force doesn';t change the knockback distance

small grail
# amber barn hmm still not sure what youre talking about, when a projectile hits my playerpaw...

Well, what I mean is not controlling the movement by programming, instead, if you have an animation for the character being hit by the projectile, the hit animation has the root motion movement set there to control the distance being knockback. If you don't have any animation for it, it feels a bit weird right? And movement input doesn't work for that.
You need to use Add Impulse method.

amber barn
#

ah ok i see what you mean more now, i dont need an animation right now just moving is ok to proof of concept it

if i use add impulse i need to enable physics and i dont wanna do that haha

small grail
#

Hmm, I don't think you need that since I did it before. You can add impulse to the movement component IIRC

amber barn
small grail
amber barn
small grail
amber barn
#

yeah for me anyway 😦

icy jetty
amber barn
icy jetty
#

hang on let me check the launch node code

#

are you setting that knockbackvelocity somewhere?

amber barn
#

yeah just found the problem sorry

the code isn't running OMEGALUL

thecharacter is null

#

i dont know why though

limber cloak
#

can someone tell me if its possible to change the mesh of uskeletalmeshcomponent in multiplayer for all clients (I only manage to change for host)?

covert mirage
#

hello everyone, what online subsystem (eos,steam,google or something) should I choose for developing multiplayer for android/ios ?
I need the matchmaking functionality to work in android/ios

small grail
covert mirage
#

So EOS subsystem really doesnt work in mobile then πŸ˜…
just found the redpoint eos plugin
does it provide EOS subsystem functionality to work on mobile platform ? including matchmaking

small grail
#

EOS is kinda a shell. You still need the native online subsystem for your mobile os I think.

#

If you do need to login user to their mobile platform, you have to load the native online subsystem.

#

But if you wanna do crossplatform matchmaking, then EOS helps.

loud frost
#

I just do only creating session and joining session

#

Didnt done matchmakinh

boreal bison
#

I'm trying to have my UI show whose turn it is, so I create it in the first image, and in the second image I have a gamestate event dispatched that gets called on the UI to show whose turn it is, but for some reason Get Owning Player only ever gets the server's playerstate and I can't figure out why.

sinful tree
# knotty briar Cuz I’m in abut of a hurry on this so if it fixes it then ima happy and if it do...

For perspective, the Character Movement Component included with the Character class in Unreal is over 3000 lines of C++ code, and it's whats in there that allows for smooth, client predicted movement.

The actual solution is you make a replicated movement component in C++ and look at how Unreal did it with the Character Movement Component, and then you adapt it to what you need, which could likely take you longer than 5 days to do.

arctic minnow
#

How would I replicate this right?

#

πŸ™‚ πŸ™‚

#

πŸ™‚ πŸ™‚

boreal bison
arctic minnow
#

Make the pickup work on multi player this also this is all the code related to this

#

it puts it in my side in multiplayer but picking it up does not replicate for both clients

#

πŸ™‚ πŸ™‚

crystal palm
#

hi
i'm making a multiplayer game and i want to possess the actor in the trigger box how can i do it?
image of that

#

@fossil spoke its the new code

sinful tree
sinful tree
#

You'll have to figure it out then, as that's how you'd do it.

crystal palm
#

ok ty

arctic minnow
#

πŸ™‚ πŸ™‚

#

πŸ™‚ πŸ™‚

crystal palm