#multiplayer

1 messages · Page 172 of 1

swift bay
#

Hey guys, could someone point me in the right direction? I am currently trying to do the following: I have a GameInstance Subsystem that offers functionality to create and join channels (like the one in WoW for example, /1 General, /2 Trade etc.). As GI Subsystems cannot replicate, I want to create an Actor for that Subsystem to replicate relevant information, as Epic suggests. Therefore I tried to create the ReplicationHelper Actor in Initialize of the Subsystem , however only the server spawns the Actor. I also get following warning:

LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: ChannelManager /Engine/Transient.UnrealEdEngine_0:GameInstance_16.ChannelManager_0 NOT Supported.

bReplicates is enabled for the Actor.

I added logs, the initialize of the GI SubSystem is invoked on all players (Server&Client), but the spawning does not work. I thought about it and I assume the spawning from the client has to happen via a RPC to the server? If that is the case, this will not work as I can't trigger a Server RPC via a GI Instance?
Should I spawn this actor via playercontroller for example?

Any advice would be appreciate!

coral badger
#

As a general rule of thumb you always want to host on Linux for scaled production, as it is usually about 4x cheaper.

manic trellis
#

hello,
there I am working on a basic Multiplayer setup in which I am having problem like,

  • late joiners did not get the replicated information for all the previously joined users.
#

thanks in advance.

woeful ferry
#

yes, it is

cosmic yoke
#

hello, in my multiplayer project i can swap between pawns and i'm trying to detect when the controller changes for a pawn and i've noticed that for clients the OnRep_Controller function, NotifyControllerChanged function and the ReceiveControllerChangedDelegate delegate don't always trigger, isn't this a bug?

#

it makes it hard to reliably do changes that depend on that, i had to use OnRep_PlayerState instead

fossil spoke
#

Generally speaking yes.

However I cant remember if the engine manages resolving an unloaded class on the Client from the network.

I have come across problems before where it hasnt. Mind you, this was on a replicated property.

It might be worth you doing a test where you force preload the class on the Client and then send the RPC to see if that correctly resolves the class.

unique kelp
fossil spoke
unique kelp
fossil spoke
#

Its functions the same as a raw pointer in any other context

#

AFAIK

unique kelp
#

hm, I'll keep digging then, see if it pops up again

#

ty for the help!

quartz star
#

Hey there, just to make sure, the ELifetimeRepNotifyCondition REPNOTIFY_Always will trigger the OnRep Function when I change the value of the variable on the server without having to call the OnRep Function manually?

DOREPLIFETIME_CONDITION_NOTIFY(ThisClass, CurrentShipSpeed, COND_SimulatedOnly, REPNOTIFY_Always);

So in my case, if i change CurrentShipSpeed on the server, it triggers the OnRep_CurrentShipSpeed automatically?

past meteor
#

If you have set your UPROPERTY on CurrentShipSpeed to be OnRep_CurrentShipSpeed

quartz star
#

alright thank you

woven basin
# quartz star Hey there, just to make sure, the ELifetimeRepNotifyCondition ``REPNOTIFY_Alway...

It will always call the OnRep to all clients if the value changed or not (i.e. X is 2 before and after, it will still call OnRep). The alternative is it will only call OnRep to clients if the value changed on the server (i.e. X is now 3 instead of 2)

Regards of either setting - it wont call OnRep on the server itself for its local copy in c++. You have to call that manually if you want the server to call itself.

quartz star
woven basin
fossil veldt
#

It's not as far along as it was but oh well, I gotta try and get it to feel as nice as it did

lost inlet
#

so how's Mover?

thin stratus
#

Depends on what you want to hear about

lost inlet
#

it was more of a reaction to the above link which is using Mover

fossil veldt
#

It's just an extension of NPP really hiding much of the uglies away

thin stratus
#

Mover itself is really not doing too much. Basically just a StateMachine

#

+- some helper features specifically for movement

#

It stands and falls with NPP

fossil veldt
#

yea it's really just a big wrapper and CMC modularized into utils

thin stratus
#

Currently trying to figure out how they want Swimming and Transitions for it to work out. The Native Mode is not finished.

fossil veldt
#

and the layered moves system is freaking awesome

#

the fact you can take any movement system and just bolt on root motion is the shit

thin stratus
#

Yeah, I'm a bit annoyed by their "Refund Spent Time" stuff

karmic briar
#

im still confused with Mover API to be honest

lost inlet
#

so yeah I hope NPP gets some love through this

karmic briar
#

seeing other peoples implementation usign Mover genuinely help me a lot seeing how to utilise it

thin stratus
#

Mover allows to do the same stuff in different ways fwiw

#

Snaps, for example, implements Crouching through a LayeredMove in the linked repo, with MoverTransitions.
Pretty sure we don't do that and we also wouldn't want to do that. Depends on the game.

#

Although it looks like the CrouchTransition is not used, but either way, ours isn't a LayeredMove.

thin stratus
lost inlet
#

very dissonant when there's a movement plugin in active development using it

thin stratus
#

Think the plugin has less than 5 peeps working on it. There aren't many commits for it either. Last stuff iirc was some fixes to BasedMovement, but as of right now, I get big corrections when landing on a moving Platform with that.

#

I wouldn't suggest switching to Mover/NPP if you can't fix/add stuff yourself, or unless they show more interest in pushing it further.

#

As much as CMC is a pain, it's probably the more robust solution for movement by itself.

#

Think the only reason we moved over to it is cause we tied multiple Simulations (e.g. Weapons) into Movement prediction and that is overall easier with NPP/Mover.

fossil veldt
#

you can literally just scale the wish vel in the walk mode itself if you prefer, Crouch layered move just made more sense to me

#

that's the thing I love about Mover actually is that it doesn't seem to necessarily care so much what you do with it or make so many rules on how to use it

woven basin
#

but Mover2.0/NPP offers no further intergration with GAS - is that correct?

fossil veldt
woven basin
#

stamina/predication/running and all that fun stuff

#

with rollbacks/corrections

fossil veldt
#

you can do that as far as I can tell

#

I talked alot w @pallid mesa about this

#

I think for stamina specifically youd implement it as a blackboard value

#

and then externally set it from the GAS ability

#

There's a line between using sync state and blackboard that is at the moment unclear to me, but I believe blackboard is more suitable for externally available R/W states

half iris
#

Would anyone know how to properly handle a player disconnecting from a multiplayer session when using the Advanced Sessions BP plugin?

I am wondering if this requires particular steps that are handled from the plugin, or if there is engine bp functionality that should be ran instead

half iris
torn hawk
thin stratus
#

NPP only solves CMC+OtherSimulation

#

Or at least could solve

woven basin
#

cool - thought so based upon the conversation a few days ago. Was just double checking.

Back to GMC then...

thin stratus
#

If you only need a better Movement system, that's probably an option yes

#

If you also want to tie in other predicted simulations, then you might want to give Mover a try after all

woven basin
#

yeah - GMC has been pretty good so far. It actually has all the other stuff like sync'd network clock etc sorted as well, so it kind of is more of a prediction system with movement built on top if that makes sense. I'm in the early days, but the discord chats seem positive and a few smart people in there doing good things, so that is always a good thing too

#

(I know there is a network clock sync blog in the pins in here, its just an example of how GMC solved a few things that are all related for one related issue)

quasi tide
woven basin
#

yeah - that's what I'm exploring now.

And they have built a GAS alternative that ties directly into GMC - so all your "gas" style stuff is directly linked into movement. So ability rollback, cooldown prediction etc - its all handled inside of GMC. Seems cool so far.

thin stratus
#

Sounds nice

woven basin
#

meh - the release of Mover 2.0 - its a valid discussion to determine which path people want to go down. And there are demos on the marketplace page?

lament flax
#

Hello

How should i combine a GAS sprint abilty with the CMC to make everything smooth between owning client and other clients ?

quasi tide
#

Pro - it comes out of the box with UE 5.4. But in preview mode.
Con - don't know if Epic even cares about it.

#

It's still far too early in its lifecycle

lost inlet
#

the bar is pretty low for Epic caring about something

#

"is this used in Fortnite y/n?"

nocturne fiber
#

Hello everyone.
In the sea of struggling there's my voice that echoes around many others.
And here i am, asking again for support from those who can swim better than me.

#

I have a problem ( of course)

#

not only mentally ( at this point) but in a more concrete way and precisely about player controller.

#

i'm a little fish that knows very little about programming and even if this is the reality I'm already working on a multiplayer game.

#

yes i know that is bad , I know that is difficult , much more than a single player, but this is my actual project.

now the question is ( hopefully being read from those willingly to help) why the heck my controller does not work with client side?

dark parcel
#

client only have their own controller

#

wdym controller doesn't work with client side?

#

what does thatt even mean

nocturne fiber
#

I switched place for input setting from character to controller cause in this game there are many characters( bipedes and spaceships)

#

why the normal setting does not work in my client?

dark parcel
#

what tnormal setting

#

what actually don't work

nocturne fiber
dark parcel
#

I don't know what "normal" is

#

on posses run on server machine

#

when u bind input, u want to do it in that target machine

nocturne fiber
#

okay and how can I use this on client

#

cause my client didn't respond to command

#

but worked a month ago

#

I don't know what's wrong

nocturne fiber
#

what am I missing?

#

on possess, possessed pawn should return every possessed pawn

#

why there isn't trace of my client pawn?

dark parcel
#

On posses run in the server machine only

nocturne fiber
dark parcel
#

run the code in client side if u want to bind input

#

in other word dont do it OnPosses

nocturne fiber
#

?

#

a rpc?

#

with custom event?

dark parcel
#

I bind mine via AcknowledgePossesion

#

that function run on client

nocturne fiber
#

mmh

dark parcel
#

but that's not exposed to blueprint

#

u can do RPC client if you don't do cpp

#

altough I wont touch multiplayer without knowing cpp

nocturne fiber
#

maybe is better stick to standard "input on character blueprint" instead having these on controller at this point

dark parcel
#

on Possess -> Run Client RPC Function that binds input

nocturne fiber
#

why the print on character blueprint outputs the same C 0 controller on server and client?

#

I managed to get both player moving now ,but I wonder if there's a problem in the logic

thin stratus
nocturne fiber
#

cause when I print on character it says this.

dark parcel
nocturne fiber
#

so it's normal?

#

both controller have the same name

#

how can I rename it

dark parcel
#

one problem at a time

#

fix the bind input first?

nocturne fiber
#

already have both character working now

#

on character blueprint

#

both moves and replicates eachother

dark parcel
#

Begin play is the wrong place to do multiplayer stuff most of the time

nocturne fiber
#

okay

dark parcel
#

@nocturne fiber Read the compendium and see what objects are replicated

#

then read it 12 more times

quasi tide
#

I think this is in @chrome bay or @thin stratus territory.

latent heart
lost inlet
#

legally distinct q3 movement

fossil veldt
latent heart
#

And the other thing?

fossil veldt
latent heart
# fossil veldt which do you mean

Well I asked if it was still teh same movement, just no longer based on quake... and you replied that it was no longer based on quake.

fossil veldt
#

it's not the same movement no

latent heart
#

Ah ha.

fossil veldt
#

It's a custom implementation this time by myself

#

mileage may vary

latent heart
#

Similar to quake?

fossil veldt
#

Not sure really, I'm just cooking and seeing where it ends up

latent heart
#

Ah. Fair enough!

#

But cool stuff. Thanks for sharing. 🙂

fossil veldt
#

No worries!

#

I'm not happy with how it feels atm, especially the damper force calc, it started feeling much more sluggish than before

#

so that's atm my priority to fix

#

you can get it feeling nice ish by playing around with the WalkSpeed and AirDamping cvars but aiming to get it feeling good out of the box, people were sad I took the sample down so i've put it up really before it's ready for prime time

#

The basics are there tho

#

I accidentally made it feel like the CMC lol

latent heart
#

Cool cool. At least one of my guys are taking a look to see how you've done stuff! Make sure they haven't messed up something simple!

fossil veldt
#

hah

latent heart
#

Have you tested it over the network yet?

fossil veldt
#

yep was workin fine

latent heart
#

Sweet!

#

I do wonder how it'll cope over the network for us. We'll be doing speeds of up to hundreds of m/s.

fossil veldt
#

If you test it out lemme know! my goal is to get it highly battle tested

latent heart
#

Will do!

fossil veldt
#

I'm using it for my own game so any of the changes I do there are going to trickle down

latent heart
#

What sorta game you making?

fossil veldt
#

It's a voxel factory game

latent heart
#

Neat!

#

We're going to utterly fail at mp fps 😄

fossil veldt
#

hah nice! fps is fun

latent heart
#

It's our passion.

fossil veldt
#

I decided this time around to go with something other than FPS since I made FPS for pretty much 10 years straight

latent heart
#

Cool!

fossil veldt
#

it's so damn fun, but yeah it's kinda fun to solve some new problems

#

factory game has some interesting ones

#

and voxel too

latent heart
#

Well if you wanna help out on a community project involving a different kind of fps, you're welcome to join! 😛

fossil veldt
#

Oh neat, ur project is open source?

quasi tide
#

Heck yes - time to commit some awful code.

#

Someone has to. Keep you on your toes.

latent heart
#

Nah, not open source.

fossil veldt
latent heart
#

auto Auto = auto()

quasi tide
#

Each commit message will just be "I'm sorry"

latent heart
#

Lol

fossil veldt
latent heart
#

Neat!

fossil veldt
#

I sent a friend req

quasi tide
#

@fossil veldt So OnGenerateMove just creates the state and OnSimulationTick is what does the actual movement?

fossil veldt
#

Generate move creates a substep

#

simulation tick aggregates all the substeps applying them as 1 move

#

Mover is a little funky in that they mixup the "substep" terminology, in mover terms a generate move is a "sub tick"

#

substep is like, each component of a move

#

as far as i understand it atm anyway :)

quasi tide
#

Too much 🧠

#

Why no Thing->JustFreakingMoveCorrectlyDangIt()

fossil veldt
#

it's not that arcane tbh you have proposed moves which are a move generated by a substep and then the move record which is like a list of moves that happens

#

and you can use the move record to collapse all of the substeps down into just one move which then the NPP tick can process

#

and it allows you to handle relevancy for specific moves

fossil veldt
#

Why no Thing->JustFreakingMoveCorrectlyDangIt()
Also tbf that is actually pretty much what generate move is btw

#

the rest is really more than anything boilerplate

dark edge
#

I'm working on a graph physics engine that's great for that sort of stuff and I'd like to extend it to handle factory game things

fossil veldt
#

Modularized into DOD subsystems

#

the voxel stuff is on voxel module on it's own subsystem, factory stuff in the game module on a subsystem

dark edge
# fossil veldt Modularized into DOD subsystems

Sounds a lot like my approach.
Subsystem per thing type (would be 1 or many depending on how different the data is for each factory type thing)
Subsystem per domain (ItemQueue for factory game, power, etc)
The subsystems each hold an array of the data type they care about. FactoryModel for the one, and ItemQueue or BeltSegment or whatever for the other.
Then it's just a few graph functions to hook it all together, condense chains of BeltSegments into single instances, and let FactoryModels know what BeltSegments they are yoinking from and yeeting to. The whole sim runs without Actors, the Actors are just a view of it.

quasi tide
#

They're both European and it is Friday night for them. I'd imagine it'll be a minute before they interact.

lament flax
#

and was 18:00 when you first pinged

quasi tide
#

So? After an entire week of looking at UE - they probably don't want to.

lament flax
#

true

#

im just saying its not night night

quasi tide
#

Fine - let's ask the other resident expert on multiplayer: @fathom aspen

fathom aspen
#

I'll say UB since I don't know 😄

#

Do latent actions get associated with the actor? I'm not really sure of their instantiation/association process, but I have a high chance of beliveing they will get destroyed all along

quasi tide
#

@whole grove 👆

unique ferry
#

weird thing happening i used a line trace to figure out where my object is spawniing and it is spawning but it is invisible in multiplayer, but not sp, why?

#

component does replicate?

runic pelican
#

Hello, i'm new on the discord and i need some help, where can i expose my issue ? I have a multiplayer issue

unique ferry
#

Probably here lol

runic pelican
#

Perfect !

#

So, the probleme is : i have a smal HUD with variable (like mana progressbar and stamina progresse bar) I can use it perfectly but when i start to replicate. The server use the HUD client and the client use the HUD server. Any Ideas ?

#

small*

fathom aspen
#

Oh ok, good to know, because I don't think this applies to UObjects as well, or do they? hmmm
For travelling you don't need a multiplayer environment, no?

unique ferry
sinful tree
fathom aspen
#

World collapses kek

runic pelican
fathom aspen
#

Fingers crossed!

sinful tree
fathom aspen
#

I've never been as enthusiastic, since the last time you tried LC and it collapsed magnificently

#

Right, feels like the best addition ever

#

Like why do we have this unreal_dragon

#

Yeah last time I saw it was in one of the outdated Epic tuts

#

Enforcing new practices/tools by activating them in example projects by default check

unique ferry
#

WP?

#

oh they love shoving that down people's throats

runic pelican
#

@unique ferry if u can send me the link of your tutorial, it ll be really helpfull

fathom aspen
#

I even recall making a community post on that and I can never recall what was the workaround to switch to WC

#

I'll give it a 3/10 if it doesn't crash

unique ferry
fathom aspen
#

You live to learn new hacks everyday

runic pelican
unique ferry
#

here you go

runic pelican
#

thanks you!

unique ferry
#

whenever he mentions health just replace with stamina and ignore the other two bars

#

then you just need to add depletion on 'shift' key pressed from your character bp

#

if you don't want pickups and stuff you can obviously skip to 5:00 @runic pelican

runic pelican
#

yeah i m allready at 5:00

unique ferry
#

actually, he might be using a function he built previously so not sure that would be useful

runic pelican
#

I will investigate

unique ferry
#

If not, maybe have a look at this

runic pelican
#

i just want to understand properly how replication work. i don't realy unsderstant it all.

unique ferry
#

Sorry lol, it's been a while since I played around with my stamina stuff

unique ferry
#

Hello guys, in this quick and simple tutorial we are going to learn the multiplayer replication basics for your multiplayer online games in Unreal Engine 5.
↪️Check out awesome Unreal Engine courses: https://bit.ly/GorkaGamesWingfoxCombat

Check out my Steam Game! https://bit.ly/3rVlXU1
Follow me on Twitter: https://twitter.com/GorkaGames
Subscr...

▶ Play video
#

Literally perfect video to understand basics of mp

runic pelican
#

specially with the " is locally control"

unique ferry
#

👨‍🏫 My Patreon link:
https://www.patreon.com/kekdot
Download Project Files | Premium Tutorials | Courses

💦 Get our Game on Steam | Kekdot Center:
https://store.steampowered.com/app/1487180/Kekdot_Center/


🧑🏻‍🚀Get the project files here on Patreon: https://www.patreon.com/posts/66842088

In this video we take a look at the basics of replica...

▶ Play video
#

this guy breaks it down really well as well

runic pelican
#

perfect thank you !

unique ferry
#

He also has some further tutorials where he explains authority and local controls too that he will link in the video

#

Np, I hope it helps. They helped me.

quasi tide
#

Prefer Kekdot over Gorka.

#

Gorka just wants your views

latent heart
#

Did you try using it?

unique ferry
#

I feel like he has a lot to learn still, but he's like 13

#

Im jealous

quasi tide
#

Don't be jealous of someone who is just copypasta

#

He just constantly spams. That's his schtick.

#

We have had to regularly fix stuff from his tutorials for people in #gameplay-ai

unique ferry
#

He is the top dog of youtube tutorials in terms of views tbh. Usually actual good people get ignored

quasi tide
#

Promote people who actually teach.

latent heart
#

In general cross-level object lookup is very janky in UE.

unique ferry
#

The engagement he's getting on his crappy 'hit and run' tutorials is amazing

#

Everyones like 'omg youre so great'

#

What part of a 2 part tutorial on how to make a survival game is great

#

Wheres the rest?

#

Smh

#

Kid annoys me. Told him to stop spamming and he blocked me on Facebook

#

Personal vendetta

latent heart
#

Lol

quasi tide
#

Just stop.

unique ferry
#

Lmao #boycottgorka

honest rain
#

hey everyone 🙂 I am scratching my head over an issue : I am spawning a niagara effect in my player controller that should be replicated on both server character and client character, that goes like this : event run on server => event multi cast that spawns the FX. Client side, the FX is correctly spawned for the client character and the server character so all good. Server side : FX is being spawned only for server, but not for client. Would you have any idea why ?

unique ferry
#

it was but a mere slip in my judgement

honest rain
thin stratus
#

You will want to post the code tbh

unique ferry
#

no, no , i enjoy a guessing game

unique ferry
#

is it on begin play? is the player calling it?

honest rain
unique ferry
#

sounds a bit contorted, if the event level up is called then link it directly to the server node > multicast > spawn fx, ensure the component replicates perhaps?

#

in your niagara effect settings, 'component replicates' try ticking that on

thin stratus
#

LevelUP should already be happening on the Server

#

RunOnServer event to LevelUp is pretty wrong

#

Please show your code

honest rain
honest rain
unique ferry
#

what's the point of executing on server twice?

#

just change 'level up effect' to multicast

#

and do the logic there

thin stratus
#

Why is "LevelUp" a ServerRPC

honest rain
runic pelican
#

@unique ferry @sinful tree Thank you guys it work now !

thin stratus
#

Also the Multicast is in the PlayerController, right? @honest rain

#

PlayerController doesn't exist on other Clients

honest rain
honest rain
thin stratus
#

Yeah so, point number 1. Never ever ServerRPC that stuff

honest rain
thin stratus
#

The only stuff you ServerRPC are player inputs from Devices or UI

#

If you press the Key to fire your Weapon or whatever, that's what you RPC

#

Everything after that is Server side

#

Killing the enemy and getting XP

#

Is all Server-side

#

There is no need for any further Server RPC

#

If you have Server RPCs for stuff that doesn't communicate Player Input, or basically stuff the Server can't know about, then that's most certainly wrong

#

And point number 2. PlayerController doesn't exist on other Clients

#

It's Server and owning Client

#

If you Multicast in that, it will only reach those two

#

For the Server (if listenServer) only the Server

#

Put the Multicast into the Character or move that logic over to the PlayerState fwiw

unique ferry
#

how do you ensure that? don't you need a server node for that?

thin stratus
#

?

fathom aspen
#

ouch

unique ferry
thin stratus
#

The point is that you only communicate stuff to the Server that the Server can't possibly know about

#

Which is almost always either Input from a Device

#

Such as Key Presses on KB/Mouse/Gamepad

#

Or UI interactions (if needed)

unique ferry
#

ok and if it's anything else, do you just multicast?

quasi tide
#

I ServerRPC the enemy that I hit and do very very very little validation checks. Fite me Cedric ✊

thin stratus
#

Once you RPCd e.g. the KeyPress for Shooting a Weapon, you are on the Server

#

Every Linetrace, DealDamage, etc. call is on the Server

fathom aspen
#

I do communications via HTTP requests, fite me Duro

thin stratus
#

Unless you RPC back to the Client/s

unique ferry
#

according to you that isn't right?

thin stratus
#

Why

#

BeginPlay already calls on everyone that this Object (Actor) spawns on

thin stratus
#

But that's two different things

unique ferry
#

oh well I got confused

thin stratus
#

ServerRPC being OwningClient -> Server

fathom aspen
#

aha, if the old ones are finishing then that's a good sign to being with

thin stratus
thin stratus
fathom aspen
#

I know it will feel like crap, but just for fun

unique ferry
#

for some reason i have a similar issue where my object is not visible on client side :/

thin stratus
#

But it's good to maybe do it barebones once to learn what is actually going on

unique ferry
#

i spawn something and do a trace to check where it is, the trace is there but the object isn't

honest rain
#

I moved this over to character with multicast, being called from PC controller with run on server event and that works wonder ❤️

thin stratus
#

I will slap you with a printed out version of my compendium if not, I took lessons on this from Duo.

honest rain
thin stratus
#

Like, whatever code is calling the LevelUp ServerRPC should not be on the Client either I guess

#

The ServerRPC in theory is fine, it's just at the wrong location. It should happen as early as whatever triggers the whole chain of events that leads to a level up

honest rain
#

well I thought that important calculations should come from server side, and I dont want to do these calculations on character since characters are only client sides right ?

thin stratus
#

The second part of your sentence is wrong

#

I fully ignored the question cause I have no clue what the answer is.

#

But thanks for sharing!

#

Naive thought what have been that the Latent Action somewhat shares lifetime with the object it triggered, back up to whatever world owns that

fathom aspen
#

Interesting findings... thanks for them

thin stratus
#

So I would have thought if you move worlds, the chain will nuke the latent action

#

If you rename the action to the new world, then idk, magic

#

What scenario does this question come from anyway?

quasi tide
#

Probably UE5Coro

fathom aspen
#

Taking precautions from UBs

#

also that

thin stratus
#

And that might cause you to code real garbage

quasi tide
#

If I was a bettin' man, I'd say she wants to make sure UE5Coro handles seamless traveling properly. Which is most often used in MP games.

fathom aspen
thin stratus
#

It's somewhat of a mystery to me in most cases what actually survives a (seamless)travel. Besides the obvious of course.

#

There is so much going in the Engine that I wouldn't be surprised if the LatentActionManager doesn't even care what world stuff is coming from

#

epic does some strange manual cleanup too

honest rain
thin stratus
#

I'm not gonna read your Persistent Data Compendium @fathom aspen

#

There can only be one Compendium

fathom aspen
fathom aspen
thin stratus
#

Then some projects I had to hook into PreClientTravel to clean up the Widgets for SeamlessTravel

#

Cause otherwise you saw the Lobby UI on top of the rest if the Controller or whatever survived the travel.

#

And today i don't even know if that's still needed.

fathom aspen
#

What's cool is these things happen silently and catch us off guard when we upgrade XD

thin stratus
#

What caught me offguard is PlayerController not calling BeginPlay after a SeamlessTravel if its the same class.

quasi tide
#

Yuuuuuuuuuuuuuuuuuuuuuup

thin stratus
#

Who thought that's a good idea

quasi tide
#

That was a fun one

#

Epic likes these kinds of pranks

thin stratus
#

I'm half sure my Lobby Kit still has that bug cause I forgot to fix it

fathom aspen
#

Yeah that's super bizzare

thin stratus
#

I feel like the PlayerController should reset bHasBegunPlay or so

unique ferry
#

why does this not work in mp but works in sp 😦

thin stratus
#

Why do you reply to Air_Juan :D

#

And what kind of god forsaken code is that

unique ferry
#

because i watched some tutorials yesterday and i am putting my knowledge to the test

thin stratus
#

So

#

Let's start simple: What Actor is that code in?

fathom aspen
#

because i watched some tutorials
That's your problem

unique ferry
#

no actor

#

it's an empty bp

#

it's a spawning bp, i put it in the world to spawn things

thin stratus
unique ferry
#

did i mess that up already

thin stratus
#

BP_Airdrop has what kind of ParentClass?

honest rain
thin stratus
#

Now they start crossanswering questions

unique ferry
thin stratus
#

I will go to bed if you continue this

quasi tide
#

Why are you multicasting a spawn?

fathom aspen
quasi tide
#

Just set the actor to replicate and spawn it on the server

thin stratus
unique ferry
#

class Actor!

unique ferry
thin stratus
#

OH, maybe it's an Actor then

#

So it's some random Actor in your scene

unique ferry
#

ya

thin stratus
#

Right, then let's take your code apart

#

Since it's placed into the World, even if you would have not marked it as Replicated, it would call BeginPlay on everyone who is part of that World.
Which is usually every Player.

#

And with that info, the RPC from Client to Server is already redundant

#

Cause it already calls on the Server.

#

Now further, Client to Server RPC require the specific Client that calls the RPC to OWN the Actor.

#

An Actor placed into the Scene is not owned by any Client by default, so that RPC is dropped on any Client trying to call that.

#

So you basically made a glorified SwitchHasAuthority with that

#

And then, you go ahead and call a Multicast to spawn an Actor.

honest rain
thin stratus
#

The Multicast is redundant due to BeginPlay already calling on everyone

#

And if the Actor you are spawning is marked as replicated, then it shouldn't even be spawned on Everyone, but just from the Server, so it naturally replicates down

unique ferry
#

this is like quantum physics to me

thin stratus
#

So that code picture is as wrong as it can be :D

unique ferry
#

i need to read this again

thin stratus
#

That includes the Server

#

Put a print string into it and see for yourself

unique ferry
honest rain
#

I see

thin stratus
#

Dropped as in "Never made it to the Server"

unique ferry
#

oh right

thin stratus
#

If all that BP should do is spawn a Replicated Actor

#

All you need to do is

#

BeginPlay -> SwitchHasAuthority -> OnAuthority -> SpawnActor

#

With the added requirement that said Actor you wish to spawn is marked as Replicated

quasi tide
#

Or drag it into the world and unmark the "Net Load On Client" option for a roundabout way of doing it 😈

thin stratus
unique ferry
#

ok so... i did this

thin stratus
unique ferry
#

and ... some actors work (without the 'replicates' condition even being on)

#

some actors don't? (with or without the 'replicates' condition)

#

doesn't make much sense 😦

thin stratus
#

If "i did this" still refers to your code you posted, then idk what that actually all causes

unique ferry
thin stratus
#

Yeah that should spawn them on Server, and if they are marked as replicated, also on Clients eventually

unique ferry
#

this works/ doesn't work based on what bp i select

#

there are actors that i cannot seem to spawn

thin stratus
#

I mean, you are spawning with a scale of 55, 55, 55

unique ferry
#

i like it

thin stratus
#

Are you sure that's a good idea

unique ferry
#

yeah

#

it looks good in singleplayer

thin stratus
#

Does it spawn on the Server, or not at all?

unique ferry
#

it spawn on singleplayer (server?) but not on client

#

it's a simple bp i am trying to spawn with a mesh

#

i turned on replication on it but nothing spawns in mp

#

only in (server?) side

thin stratus
#

Singleplayer doesn't mean Server fwiw

unique ferry
#

on 'standalone'

#

it works

#

but on 'play as client'

#

doesn't 😦

thin stratus
#

So you have 3 settings:

Standalone
Listen Server
Client

unique ferry
#

yes

thin stratus
#

Standalone means every player is unconnected, their own game, no one is a server, no connection, nothing

#

Listen Server means there is a Client that counts as the Server (in the Editor that's the first player basically), and other Players are Clients

unique ferry
#

oooh i think this makes sense now

#

ok so it works in Listen Server

thin stratus
#

Client (or Play As Client) starts a Dedicated Server, and every player is a Client

unique ferry
#

now i assume i need to multicast?

quasi tide
#

No

thin stratus
#

The 3 nodes are all you need if the Actor is marked as replicated ( the one you spawn )

unique ferry
#

It is

thin stratus
#

Eh

#

That's a Component Setting

#

Not an Actor Setting

unique ferry
#

oh?

#

yes! this is on too

#

still nothing on client 😦

thin stratus
#

Can you place a PrintString into the BeginPlay of the Actor you are spawning?

unique ferry
thin stratus
#

And see what prints

unique ferry
#

okay

#

that's all

#

am I meant to get a client response? because for some reason it's not multicasting to clients

#

server knows about it, but client is not being told about it?

#

am i understanding this correctly?

thin stratus
#

You are in theory meant to get a Client Print

unique ferry
#

I did not get one

#

I guess that is my issue

thin stratus
#

What are your settings for Playing atm?

#

Play as Client still with 1 Player or so?

unique ferry
#

with 2

#

play as client with 2 clients, none receive anything, print string of actor spawned returns server response

thin stratus
#

How far away are your 2 Clients from the center of the map when they spawn?

#

Cause you are spawning at 0,0,0

#

And Actors have a NutCullDistance

#

They won't spawn if they are too far away

unique ferry
#

i can try spawning at player location maybe? brb

thin stratus
#

I would just put your spawner next to the player spawn

#

And do GetActorLocation

#

And connect that to the SpawnTransformLocation

#

So that Door doesn't spawn at 0,0,0

unique ferry
#

nothing 😦

#

players are quite close to centre of map anyways hence why server side looks okay

#

spawns maybe 20 m away

thin stratus
#

Are you not getting an Error for that code during run time?

unique ferry
#

no

#

why would i

thin stratus
#

There is no guarantee that the Player is there when the Server calls BeginPlay for that Actor

unique ferry
#

maybe because the project isn't so huge it loads up quickly

thin stratus
#

Just remove these

#

And put the spawner next to the Player spawns

unique ferry
#

done

#

nothing

#

may i just remind you that some bps work and some don't

#

so pretty sure it's to do with the settings on the actor i am trying to spawn, although replicates is on

#

so not sure what other settings could be impeding this to spawn in client only

#

very confusing error

#

😮

#

i think i found something

#

one of the actors i am trying to spawn has a set projectile speed, that speed, on server, is very slow, but on client, basically teleports the item to another dimension

#

if i put the speed at 0, it works, but very weird that it treats the same speed differently on client/server

#

do you have any idea why this is happening? 😦

unique ferry
#

I was interested in seeing it but the contact us button doesnt work on my PC or mobile

thin stratus
#

Works fine on my end

unique ferry
#

Yeah. I cant use the contact us button at all

thin stratus
#

Oh that one. That's strange.

#

Top right one works fwiw

unique ferry
#

Hard to spot on mobile, but got there in the end, thx

thin stratus
#

Yeah idk what broke the button on the LayerSlider. Seems like the plugin gave up.
It was set to link to the correct page but well. Hardcoded the url to the sub page now into it. Thanks for letting me know.

#
  1. Plain Actors have no Interpolation/Smoothing. ReplicateMovement will literally just override the local Transform with the new one.

  2. In theory, yes. It's mostly NPP that solves it, that is the backbone to Mover.

molten matrix
#

I thought I knew how to interpret the role/remoterole properties, but I just ran into something that does not match my understanding.

I have an object that can be interacted with by both client pawns and AI pawns. This "interaction" happens using a capsule overlap. When the pawn steps into the capsule, OnComponentBeginOverlap triggers and stuff happens.

When the player's pawn interacts with the object, OnComponentBeginOverlap triggers twice. Once on the client (object has role SimulatedProxy and pawn has role AutonomousProxy) and once on the server (object and pawn both have role Authority). This makes total sense to me.

When the AI pawn interacts with the object, OnComponentBeginOverlap only triggers once. It triggers on the server, which makes sense. The pawn has role Authority. However the thing that I don't get is that the object has role SimulatedProxy.

I was assuming that the role of all objects were Authority on the server, but it seems like that's not the case. And why does the role of the object change from Authority to SimulatedProxy depending on which pawn interacts with it?

#

Rubber ducking debugging at its best. I think I figured it out. It seems like the AI pawn only exists on the client side. So that's why the object's role is SimulatedProxy.

Now I just need to figure out why the pawn didn't spawn on the server, even though it ran inside an RPC targeted for the server...

unique ferry
#

if it runs in the controller then that is client side only

#

otherwise i'm not sure

molten matrix
#

I called a Server RPC from my cheat manager into my Game Instance subclass, and in that function I ran World->SpawnActor and that still seemed to create it on the client

#

That's very strange to me. According to @thin stratus 's compendium here https://cedric-neukirchen.net/docs/multiplayer-compendium/remote-procedure-calls if I do a Server RPC the only options (looking at the column marked "Server" in each of the table) are either "Runs on Server" or "Dropped".

So how come that even though my RPC is marked UFUNCTION(Reliable, Server) inside that method GetNetMode() returns NM_Client?

Other ways for Replication are so-called “RPC”s. Short form for “Remote Procedure Call”.

sinful tree
mild lynx
#

What would be the best way to handle Keeping track of Individual Score, and Replicating it to all players for a Scoreboard?

From what I understand, I am using the Gamemode to say what to do upon getting a point for a player. Should I store that score in that players PlayerState? Every tutorial I see handles the scoreboard part in Game State using a custom Struct but I'm a bit confused on how to pass these varriables down while keeping track of new Connections/Disconnections. Should the struct exist on both the GameMode and GameState?

#

Should the order be something like GameMode->PlayerState->GameState? or just GameMode->GameState? It just seems way easier to update a Score that is attached to PlayerState since it's easy to grab from a Controller

kindred widget
#

Depending on your necessity, PlayerState already has a Score property.

mild lynx
#

My concern with PlayerState is that Scoring and Stats may represent very different things depending on the game mode. Should I make a custom PlayerState per game mode?

kindred widget
#

Depends. If you have varying score types that you need to track, I would vote for a component on the playerstate that you can add at creation of it. Each GameMode should know how to handle the stats component it adds.

fossil spoke
#

You can create PlayerStates for each differing GameMode if you need them to have different scoring states

plush wave
#

Setting a replicated variable direction on a Player State results in it not getting actually replicated right?

#

Doesn't the clients Player Controller need to make an RPC call that then changes the Player State?

quasi tide
plush wave
#

Right, but I thought that the server owned player states. Making local changes to a Player State replicated variable on a client would not replicate up to the server I think.

#

I think an RPC call has to be made from the clien'ts player controller to then update something on the player state

molten matrix
fossil spoke
#

Therefore you need a Client to send an RPC to the server in order to cause a variable to replicate (after the server changes its value)

#

Changing the value on the Client only ever affects that Client

#

Clients cant cause other Clients variables to change

torpid lantern
#

How might I go about replicating the rotation of a directional light? I'm wanting the server to emulate day/night cycles. I don't see anywhere on the PIE DirectionalLight to replicate, nor are my RPCs working.

plush wave
sinful tree
# molten matrix This seems to be it. Moving it to the player controller fixes it. Just strange t...

The tables won't match as you're not working with replicated actors. Running a "Run On Server" event on an actor that only exists on the client will still execute, but only on the client as a replicated copy of it doesn't exist on the server.

Requirements and Caveats
There are a few requirements that need to be met for RPCs to be completely functional:

  1. They must be called on Actors or a replicated Subobject (e.g. a component)
  2. The Actor (and component) must be replicated
quasi tide
#

So, your equipped sword could make an RPC to update the PlayerState for w/e reason

plush wave
#

How would the client have ownership of the sword? If it spawns it then it owns it but it is also only spawned locally.

kindred widget
# torpid lantern How might I go about replicating the rotation of a directional light? I'm wantin...

You don't replicate the light so much. Usually in cases like this you'll have some sort of map actor, or a component on the gamestate. Something like that which will house your time of day. This value gets replicated, and you drive a myriad of things off of it such as directional light rotations, material collection parameters, etc. As there will likely end up being more than just a single light that needs updated via time of day.

sinful tree
torpid lantern
kindred widget
molten matrix
torpid lantern
#

Gah, now I'm stuck on my RPCs. What's off with my sequence here?

Triggered from client, on Player Controller.

Goal is to get both players to observe the shift in Directional Light source.
Result from my code is only initiating player observes change

kindred widget
#

Don't use RPCs. The light's direction is a state. Generally always replicate state.

torpid lantern
#

and use an OnRep notify from the state?

kindred widget
#

Yep, or tick whatever needs it.

dark parcel
#

I will use tick and interpolate since it won't update fast enough

pallid mesa
pallid mesa
thin stratus
#

We will probably not tie everything into NPP, but it becomes pretty quickly pretty clear that systems that affect each other all have to run through NPP.

#

Otherwise you get into the same problem that GAS + CMC + XYZ has

#

We will work around the non-NPP stuff in our project a bit, but it's less than ideal.

pallid mesa
#

lets see what this "better prediction methods" means in epic's GAS roadmap

thin stratus
pallid mesa
sudden harbor
#

Does blood VFX (decals) need to be replicated?

short arrow
#

For example if you wanted blood decal to appear on the floor after being hit by a sword, you'd call a multicast event named MC_BloodDecal. From that event you'd spawn the blood decal

heady copper
#

hhello guys

#

good morning

#

been trying to figure out whythis rpc is not working

#

i mean am checking if its a client or server before sending it it works on server but not client please help

thin stratus
#

Just fyi, you can just call the non ServerRPC in your ServerRPC again

#

No need to duplicate the code

heady copper
thin stratus
#

What is BPXController?

#

Is that a PlayerController?

heady copper
heady copper
thin stratus
#

What is "the controller" though? What is the Parent Class of that BP

heady copper
thin stratus
#

Okay, then the ServerRPC should function just fine. What makes you believe it's not working?

heady copper
thin stratus
#

Did you put a print string into the SetCueTargetDirection function as well as into the RPC (given you aren't reusing the SetCueTargetDirection atm) to see what calls?

heady copper
#

but it does on the server

thin stratus
#

Then please do that first

heady copper
#

ok thanks

thin stratus
#

You aren't calling anything locally, as you only RPC to the Server when you are the Client.
If you aren't replicating the Cue location back to the Clients, then it won't move for them.
And in theory you shouldn't do that anyway, cause then you introduce some latency to the Mouse moving the Cue.

#

You might want to call the Cue code locally too, to predict it.

#

I'm not sure what the requirements for your game are, so I can't give much more help then that.

heady copper
#

thanks

neon summit
#

when using p.showcorrections what is the white debug lines?

patent moth
#

Hello

lost relic
#

Im trying to get my VR character working in Multiplayer. And the biggest Issue Im facing is the player head and hand movement is not replicating to clients. so I changed My animbp run the setting positions of the hands and head from the RPC events, but nothing changed what am I doing wrong?

sinful tree
# lost relic Im trying to get my VR character working in Multiplayer. And the biggest Issue I...

Animation blueprints don't replicate. It looks like you're trying to set replicated values on them / call RPCs on them, which won't work. Values that you want replicated usually should be contained on the replicated actor that is utilizing the animation blueprint. So if this is being used by a character, you'd replicate those values on the character and use them within the animation blueprint.

You shouldn't be multicasting something that is stateful. You have 3 values here whre you're setting something in a replicated variable. If your intention is to have this value replicate, then all you need to do is set these on the server ( again, not in the animation blueprint). If you want things to change after the new value is received, have those variables set as Rep w/ Notify, and then use the generated functions to call that additional logic.

lost relic
#

Sounds like thats what your saying above. I will refactor.

olive kraken
#

Hey! questions about good practices. Is this the preferred way to get a local save file, in P2P when you are client?
Any other workflow to consider?

sinful tree
olive kraken
lusty palm
#

smoothsync or gmc what is better?

unique ferry
#

Hello, I'm confused. Why is my item ' despawning' in multiplayer when too far?

#

It's not even that far, anything more than 20 000 units and it's gonzo

#

I noticed there is a setting called Cull Distance which seems to be just what I need, but it's already set to like 99999999

solar stirrup
#

If you want it to always be relevant, tick bAlwaysRelevant in the class defaults

unique ferry
#

yup, perfect, that was it, thank u

white quartz
#

I am wanting player 0 to always spawn at one player start and player 1 to always spawn at a different one. How would I go about doing that?

graceful falcon
#

@white quartz You could create a map and assign
Player 1 with the Player Start 1,
Player 2 with the Player Start 2.
etc

You could do in the GameMode blueprint.

You get all actors of class from the playerstarts and for the onpostlogin event you can assign for each player controller an index in the map.

sinful tree
# olive kraken Yeah, sorry, no p2p but client-server. In an scenario with a host and a client, ...

You can load a save game from any actor, what is important in multiplayer is if you're running that code on the server or on the client as some actors are replicated, meaning they exist on both the server and client. So what "local" is depends on what machine is currently executing the code.

Here's some examples to try and clarify:
I can have an instance of a player controller that is assigned to a client and it has a button input that will load the save file. If I press that input on that particular client then it's going to load the save on that client.

If I am a listen server, I have a copy of both my player controller, and a client's player controller, and they are both set up with those same inputs, but I also have seperate input that is hooked up to another function on the player controller called "Load Game" that executes the "Load Save Game From File". If I press the first input on the listen server's copy of the game, it'd be loading the save file on the listen server as it is using my player controller. Even still, let's say as the listen server I got a reference to the other client's player controller, and I called the "Load Game" function on it, it wouldn't do anything more than load the save file still on the listen server as I'm still executing on the listen server.

Now to complicate things further, let's say I had a "Run On Server" RPC called "Load Game Server" that then executes the "Load Save Game From File". I am on my client and press an input that executes "Load Game Server". The RPC would then call to the server, and the server then calls "Load Save Game From File" so then the file you'd be loading is on the server, even though the input started on the client, and the RPC exists on the client's player controller.

white quartz
olive kraken
sinful tree
olive kraken
#

Got it, and I imagine likewise casting to the game instance in a PC, wich is the client, will filter any other machine that is not that local machine.

#

Similar to local widets, etc, I suppose

#

I'm just trying to figure out the best place in UE Framework to call your own save files without accidentally call server one due to RPC

white quartz
white quartz
#

Found this solution on the forums, will try it and report back. https://forums.unrealengine.com/t/attaching-a-character-to-player-start-how/70545/2

misty birch
#

When I enable physics prediction in project settings my vehicle pawns refuse to move, I can't find any documentation on it. Basically theres a lot of input lag between the client and vehicle movement, if I make it client authorative then the client and server go out of sync even with reliable events to change the inputs.

white quartz
#

screenshot is from the forum post

lost relic
lost relic
#

As VR hand and head positions need to be constantly updated with tick to be 1-1 with the player for a good experience , and Now Im trying to replicate this for multiplayer and doing it on the server, the lag issue is becomming apparent and its not a good VR experiance waiting for the server to update the position of the lclient player hands and such, Also I can imagine this becomming a real issue with multiple vr players as thats a lot of network traffic being sent. So My question is how do I keep the client experiance fast and responsive and feeling like its done locally, but also show replicate the position for other players to see, running this on both the server and the client ?

loud frost
#

right side server and left side client , can you tell why that animation not working in client side

thin stratus
#

Possibly cause whatever drives the AnimBP isn't properly replicated

thin stratus
loud frost
#

i am actually using ALS plugin

thin stratus
tardy fossil
#

yeah thats how i handle my multiplayer VR. I sent an unreliable RPC every 0.05 seconds (20 fps) and just have the clients smooth it out

vagrant grail
#

Why is "OnSwapPlayerControllers" not being called when I switch from the Lobby Level to the Mansion level ?

thin stratus
vagrant grail
thin stratus
#

And you tested outside Editor?

vagrant grail
thin stratus
#

Are both GameModes using the same Controller class maybe?

vagrant grail
thin stratus
#

Then not sure. You might need to breakpoint in cpp

vagrant grail
formal solar
#

you are using 2 separate gamemodes

vagrant grail
thin stratus
#

That shouldn't matter

formal solar
#

ok

thin stratus
#

In theory if the PCs are different and the GameModes are set to Seamless travel and you test in standalone/packaged, it should call

formal solar
#

What setup are you using? Game mode only exists on server so you will only see that print string on server

vagrant grail
formal solar
#

ah right well u should only see it on host

vagrant grail
vagrant grail
formal solar
#

Not sure what it could be then, is it essential to use this node? There might be ways round it

vagrant grail
formal solar
#

onpostlogin is a useful one in the gamemode, there are a lot of similar events inherited from game mode base (and I think some more only accessible in C++)

vagrant grail
formal solar
#

Just fyi there is a list of player states automatically collected by the game state
But game state does not load up straight away sometimes

#

You will have options, just can be hard to wrap your head around

neon summit
#

can anyone tell me what the white box means when I move my pawn?

#

it shows when using p.showcorrections. I'm sure its with replicting the movement but I don't see any info online of what the box means. It starts empty then fills up halfway diagonally and repeats and I get jittering when it restarts

worn light
#

i want to replicate mouse location to both on server and client but its not working can u guys tell me whats the problem

formal solar
#

There is a lot wrong here the first thing, what is 'mouse location'?

#

Show what your function does

worn light
formal solar
# worn light

Also, why is your 'run on server' event a multicast and not actually run on server?

formal solar
#

You have an event called 'Run on server' which is literally not set to 'Run on Server'

worn light
#

will it work now

formal solar
#

no, you are setting variables wrong

#

You need to pass the vector in as a paremeter to the events
Think about it - I assume you are testing using 'play as client'? So dedicated server model?

worn light
formal solar
#

listen server setup and dedicated server setup are different things

#

Unless you are extremely technically gifted with a lot of experience or have a big team/ a lot of money then you should do listen server model

worn light
worn light
formal solar
#

well regardless the main thing you are doing is not understanding how variables get communicated

#

Think about it - if you're on a random client and press 'left alt' and set the location vector - how does the server know about that?

worn light
formal solar
#

Then when you do the 'run on server' event (pretending for a minute you actually run this on server), you grab the location variable to set the same location variable? But on server the location variable will be 0, because you never sent a message from the client telling the server what value it was, so you are just saying 0 = 0

worn light
#

oh hmm ah i see

#

so i have to use parameter in run on server event then set the variable and then do multicast?

#

ok it is working now , but from server to client not , i also need to ask that do i need to send the location from server to clients ? like its necessary?

vagrant grail
formal solar
worn light
formal solar
#

you can also set the variable to replicate

#

and just setting it on server will automatically change its values on all clients

neon summit
#

is it possible to smoothly replicate a pawn's movement in blueprints?

worn light
worn light
formal solar
formal solar
# worn light

this is still wrong because you make the same mistake with your 'multicast' event

#

what are you multicasting?

neon summit
#

I know but I thought about using that but I'm wanting to use the floatingpawnmovement so I made a pawn. Unfortunately with floating pawn component doesn't work well. I'm just not sure about using character class for my spaceship

formal solar
#

you send a message from the server to clients, for each client to print to the player what the current 'location' value is.... on the client

worn light
formal solar
#

but you never told the client what the value was

worn light
formal solar
#

you are working in 2 player?

#

try testing in 3/4 player because it will clear up some confusion

formal solar
#

you don't even need to set the value locally

#

basically all you need to do, when you get your line trace result, send that info to the server via a run on server event and in the server event, set a replicated variable

#

then all clients will see it

worn light
#

oops it didnt record those clients screens

formal solar
#

if you do a repnotify then you can attach a print string message to the variable being changed

worn light
#

what is a difference between repnotify and replicated in variables

#

because if both are replicating then why they added same thing 2 times

formal solar
#

this dropbox is your best friend

#

Repnotify works slightly different in blueprint and C++

worn light
#

hmm also i need to learn all those replication conditions , because it doesnt show its description

formal solar
#

If you set it to repnotify then you get an 'onrep' function that calls on all clients when the variable changes, in this function you can do stuff like print the variable value

worn light
formal solar
#

it notifies clients

#

when it changes

worn light
#

ok

formal solar
#

I'm not sure of the specifics

#

I think in C++, you must change repnotify variables on server

#

then server will know about it by default

#

in blueprint I think it is automatically handles to inform server + all connected clients from wherever it is called

worn light
formal solar
#

I may be wrong, I just call them from server anyway

#

look at listen server testing because if you actually want to make a game or work on a small project that is most likely what you will be working with. Unless you are just curious, or maybe want to join a big team one day.

worn light
#

i writed ur code what u said above to do

formal solar
#

and the location is set to repnotify?

#

Look at the functions in your blueprints, you will have a new function called 'OnRepLocation'

#

Attach your print string to that, with location as input to the print string

worn light
formal solar
#

Disconnect your 'multicast' event

worn light
worn light
#

ok i got the function

#

what do i do with it now

formal solar
#

pull out a print string from your function and in the print string attach your location variable

#

then you can see how it works

worn light
#

like this

formal solar
formal solar
#

try that and see

formal solar
worn light
vagrant grail
formal solar
#

when you create a session

worn light
formal solar
worn light
worn light
formal solar
#

You ask a beginner question and are now complicating the whole thing with some advanced code

worn light
formal solar
#

im trying to show you basics of repnotify

formal solar
raw thunder
#

Hello everyone,
I am making an action RPG game and would like to have a login flow like so:
-Client logs in (I am using the CommonUser Subsystem)
-Client chooses a character save
-Client choose to host or browse to join a game with this character data (need to send to the server in case joining)

What is not destroyed during the connection process to keep this character data?

worn light
formal solar
# vagrant grail Im' not sure to understand 🤔

This is in my game state I have in the level I travel to (the 'is server' check might actually be redundant, but anyway the logic will only execute on host) to create a replicated variable in the game state that tells all players how many players we want

#

This is what I do in my game mode, essentially wait for a) the game state to be loaded and then b) All players to be logged in

#

'num players' is automatically update in the game mode as a class default

worn light
formal solar
#

controller index is different to index in an arbitrary array

lost relic
#

If you could I would like to see how you did that, especially the smooting out part

lost relic
#

thx

thin stratus
#

The Smoothing part is basically just having some StartValue and a TargetValue.

TargetValue is whatever newly got replicated, StartValue is the previous CurrentValue.

If you do it FixedTime, like b2soft says, you would need to track the time since the last replication happend and divide that by the FixedTimeMs to get an alpha from 0 to 1.

lost relic
# thin stratus "SimulatedOnly"

just one more thing. so I have the full understanding , doing it like this is basically updating the server position of the hand transfrom from the local ?

thin stratus
#

or fwiw, you can also just get the Difference between "TargetValue" and whatever "CurrentValue" is and move x% from A to per Frame. There are a bunch of options.

thin stratus
lost relic
#

what I did or my understanding?

thin stratus
#

You shouldn't be setting a RepNotify Variable inside an OnRep function

vagrant grail
#

Why this doesn't disable players movement ?

thin stratus
#

The idea is that the Client tells the Server, via RPC, what the expected WorldTransform is.

lost relic
#

ok I read it as such. so just leave it empty then ?

thin stratus
#

The Server uses the Transform Input of the ServerRPC to set a RepNotify variable that is limited to Simulated only.

#

And then in the OnRep yo use that variable to set the Transform of the Hand.

thin stratus
vagrant grail
lost relic
thin stratus
lost relic
#

yes

thin stratus
#

That wasn't directed at you

vagrant grail
thin stratus
#

APawn uses it to block the AddMovementInput call locally already

#

You should confirm that the boolean in that struct are actually correct

#

And maybe print IsMoveInputIgnored on tick in your PlayerController to see if that actually is changed properly

vagrant grail
thin stratus
#

If ithat's in the PC, then that's normal

#

One Server is the Server's PC

#

The other is the Client's PC

#

Not sure then, the value is used in AddMovementInput

vagrant grail
thin stratus
#
void APawn::Internal_AddMovementInput(FVector WorldAccel, bool bForce /*=false*/)
{
    if (bForce || !IsMoveInputIgnored())
    {
        ControlInputVector += WorldAccel;
    }
}
thin stratus
#

At leas the struct is fwiw

#

But it's a local thing, so it doesn't matter if the Server's Version of the Client's PC has it wrong

vagrant grail
#

Maybe it's because all of that stuff is in the c++ class I guess

vagrant grail
#

Oh that's because what you shown was in "Pawn" which is what's inheriting my PlaygroundCharacter.cpp

vagrant grail
unique ferry
#

so... ai controllers can't call server rpcs?

raw thunder
unique ferry
prisma belfry
#

Quick question: When running game from editor as listen server, there seems to be two GameInstances correct? but only one asset manager?

modest crater
#

Just looking into AdaptiveNetUpdateFrequency here and wanted to confirm something.

Does this mean I am going to need to be extra attentive to each actor that is replicating and ensure propper values, for example my ACharcter inherited class has these as default, which 2 times a second or .5s per update in its worst case seems kinda low, even for a worst case, am I correct in this assumption?

thin stratus
prisma belfry
#

yeah I've confirmed there are the two game instances at least

hoary spear
#

Interfaces dont discriminate

formal solar
pearl walrus
#

Anyone able to help me figure out what needs replication?I I read the documentation but I made my Lobby UI and menus without replication in mind so now I need to go back and properly apply it

formal solar
#

you want to call server RPCs from the player controller that clicks stuff @pearl walrus

#

dont try to call server RPCs from inside widgets

pearl walrus
#

Hmm so do I just apply it to all my custom events or variables in my playercontroller?

raw thunder
#

Hello everyone,
Is it possible to join a session without loosing client data? (Maybe no map travel?)

Let me explain what I would like to do:
-A client selects his character from different save files (locally).
-He can join friends from his friend list or host his own server.
-When he joins a server he keeps all his choices (eg. character selection) and the group is displayed on his screen (With each player's custom characters) he also RPCs to the server his choices.
-He can still invite friends to the group etc.
-Then the server can launch the game and load the map when everyone is ready (Or everyone launches the game separately, not sure about this part (late joining)).

I struggle with the part where the client joins the server, when I do that a new map is loaded and the client is fully initialized (GameMode spawns the PlayerController, PlayerState etc) and I loose the client datas, only GameInstance is kept.

I currently use the Common Session Subsystem to create, host and join sessions.

sinful tree
# raw thunder Hello everyone, Is it possible to join a session without loosing client data? (...

Whenever you connect to a server it's going to be a hard travel using Unreal's networking system, which means you will always lose basically all loaded info except for what you have stored in the GameInstance, and of course, save games.

So if you have choices you want a client to make before they join a server, you'd need to set up a system to store those choices in the GameInstance, and after connecting (ie. after Begin Play on their player controller fires on their local machine) read those values from the GameInstance, use them locally or send an RPC with the data of those choices so the server can then use and replicate those values to everyone else.

thin stratus
#

You could use Beacons

#

They are a lightweight connection that doesn't actively join the Server's map

#

Requires C++ though iirc

#

This guy posted some stuff about it quite a while ago

raw thunder
raw thunder
#

Thank you

#

I recently played "Tribes of Midgard" (made with UE) and the lobby is quite nice. When joining a group you don't have a loading screen or what ever.

thin stratus
#

You will ultimately have to travel when you want to play

#

But for the initial connection, beacons would be enough

#

It's a bit like those "Main Menu Parties" of most competitive games

idle tundra
#

Hey, is someone here familiar with the ALS-refactor plugin for Unreal, I have a problem with syncing it when using custom networking.

raw thunder
quasi tide
idle tundra
quasi tide
#

I am chill though

vagrant grail
thin stratus
idle tundra
quasi tide
#

What was clarified? 🤔

icy jetty
#

The clarification

lost relic
# thin stratus You are mixing stuff up a bit.

So I had another crack at it and nothing seems to have changed so Asking If I did this correctly , First i set the onrep value from the RPC SERVER event , pic:1, then in the onrep function I set another value I created which is now being used by the anim BP for the hand position Pic:2 then in the ANIMATION BP im using that transfrom to position the IK hand, pic:3 not sure what I missed

thin stratus
#

So, what actually moves your hands? The Actors World Location or the AnimBP?
I assume the Actors World Location, cause that's the one you are getting.

Your ServerRPC needs a Transform Parameter. You Client needs to set that with the Actor Transform of the Hand. You can't get the Transform like this on the Server, cause then that's no the Client's Version.

And for the second variable, that seems largely redundant if you aleady have a transform variable you can use.

modest crater
#

Does BP graph do ANY sort of compression or packing behind the scenes? Networking in BP seems expensive

thin stratus
#

And then you put the two GetWorldTransform calls where you call that RPC

lost relic
#

a control rig is using the hand transfroms im sending to the animbp to do IK arms

modest crater
#

Like do you need scale if so that could already save on 12bytes an not do a transform

thin stratus
modest crater
#

I know you are debugging or figuring it out but Im just saying

#

actually its 24 isnt it since theyre doubles 8*4 = 24

lost relic
thin stratus
#

And the TransformVariables would be Replicated->SimulatedOnly, cause the owning Client and the Server are setting them manually, they only need to replicate to the Simulated Proxies.

#

There are multiple ways to solve this overall

#

The time between updates will probably not be .2 second for the SimProxy.

#

So just going from A to B in .2 seconds is probably not going to work here (that's what I suggested first).

#

It could be that updates come in faster or slower than .2.
I think if A was "normal", and B was "late" and C was "normal" again, you'd need to extrapolate until B arrives, yeah

#

I can't type :D

lost relic
# thin stratus In theory what your code needs to do is: EventTick -> IsLocallyControlled -> Br...

Thanks seems to be moving in client now to , But I have hand position lag 😦 and im getting other issues now where my character works as normal on as listen server, but in client if the values are set to simulated only, my character mesh is stuck at world origin on the player , but looks ok on the client. turning of simulated seems to correct it but its not working with roomscale and charactero is no moving with me , only mesh., I dont expect yuo to know why any of this is happening, but thought I would mention it

thin stratus
#

Otherwise your LocalClient will have 0,0,0 in them

lost relic
#

no

thin stratus
#

EventTick -> IsLocallyControlled -> Branch -> True -> SetTransformVariables -> ServerRPC_SetTransformVariables(TransformVariables)

lost relic
#

ok ty

lost relic
thin stratus
#

You can fwiw set them before calling the RPC and use them as inputs

#

You still need to set them inside of course

#

Cause that's the Server-side

lost relic
#

ok , this is kinda confusing

thin stratus
#

Why

lost relic
#

I get it , but without theis help I doubt I would have

thin stratus
#

These variables have default values if you don't set them.
The Server sets them in the ServerRPC.
The SimulatedProxies get the values replicated.

#

The Local Client, in your current setup, never sets the variables.

#

And we want to set them locally instead of including the local client in the replicated setup, because otherwise the local client would have a delay

#

Cause the local client would then tell the Server about the values and wait for them to replicate back to it, which is one full RoundTripTime.

#

Instead, set them by hand locally before calling the RPC

#

Or fwiw after calling the RPC, it doesn't really matter

bright summit
#

swapped null online subsystem for steam one, trying to test on 2 differenet accs, 2 different pcs and it can't find session. Any ideas?

thin stratus
#

Custom AppID?

bright summit
#

no, 480

thin stratus
#

Both Accounts properly show that they are playing Spacewars?

bright summit
#

yeah

thin stratus
#

Both properly have the Steam Overlay show up?

bright summit
#

yes

thin stratus
#

Are they friends?

bright summit
#

yes

thin stratus
#

How many results do you allow on the FindSessions node? @bright summit

bright summit
thin stratus
#

Try 100

#

Steam will return you 10 results for Spacewars, not 10 results for your specific UE game

#

It can always be that the 10 results are from other GameDevs, which might all be filtered when trying to parse on UE's end

bright summit
#

ok, sometimes it was showing weird results, but I will try

thin stratus
#

Other than that, I would suggest you enable some logs and read your logs.

#

You could enable LogOnlineSession LogOnline LogOnlineServices

bright summit
#

where to do this? in .ini file?

thin stratus
#

And fwiw, check if you are using the older SteamNetDriver or the newer SteamSockets stuff

thin stratus
#

log LogCategory VeryVerbose

#

I don't know where to place it into the ini, so can only give you the console command above

lost relic
#

Just thought I would share My improvment , I used my original system as the local first, then passed there values to the Serverside RPC_ Neater and solves other issues I was having . still have a some hand Lag which I dont know why

bright summit
thin stratus
#

Yes

bright summit
#

I don;t know if my .ini configuration looks right

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

; If using Sessions
bInitServerOnClient=true

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"```
#
[2024.04.14-17.56.50:231][431]LogOnline: VeryVerbose: OSS: FOnlineAsyncTaskManager::AddToOutQueue [FOnlineAsyncEventSteamRichPresenceUpdate got new information about user 76561199143269563]
[2024.04.14-17.56.55:068][114]LogOnline: Verbose: STEAM: FOnlineAsyncEventSteamRichPresenceUpdate got new information about user 76561199143269563
[2024.04.14-17.56.55:068][114]LogOnline: VeryVerbose: OSS: FOnlineAsyncTaskManager::AddToOutQueue [FOnlineAsyncEventSteamRichPresenceUpdate got new information about user 76561199143269563]
[2024.04.14-17.56.58:117][157]LogBlueprintUserMessages: [WB_MainMenu_C_2147482470] Join Game
[2024.04.14-17.57.05:335][654]LogOnline: Verbose: STEAM: FOnlineAsyncEventSteamRichPresenceUpdate got new information about user 76561199143269563
[2024.04.14-17.57.05:335][654]LogOnline: VeryVerbose: OSS: FOnlineAsyncTaskManager::AddToOutQueue [FOnlineAsyncEventSteamRichPresenceUpdate got new information about user 76561199143269563]
[2024.04.14-17.57.07:838][522]LogOnline: VeryVerbose: OSS: FOnlineAsyncTaskManager::AddToInQueue [FOnlineAsyncTaskSteamFindLobbiesForFindSessions bWasSuccessful: 0 NumResults: -842150451]
[2024.04.14-17.57.07:840][523]LogOnline: VeryVerbose: OSS: FOnlineAsyncTaskManager::GameTick Starting serial task [FOnlineAsyncTaskSteamFindLobbiesForFindSessions bWasSuccessful: 0 NumResults: -842150451]
[2024.04.14-17.57.07:840][523]LogOnlineSession: Verbose: STEAM: Starting search for Internet games...
[2024.04.14-17.57.07:840][523]LogOnlineSession: Warning: STEAM: Unable to set search parameter LOBBYSEARCH: Value=true : Equals : -1
[2024.04.14-17.57.08:169][637]LogOnline: Verbose: OSS: Async task 'FOnlineAsyncTaskSteamFindLobbiesForFindSessions bWasSuccessful: 1 NumResults: 0' succeeded in 0.330600 seconds
[2024.04.14-17.57.08:169][637]LogOnline: VeryVerbose: OSS: FOnlineAsyncTaskManager::AddToOutQueue [FOnlineAsyncTaskSteamFindLobbiesForFindSessions bWasSuccessful: 1 NumResults: 0]
[2024.04.14-17.57.08:169][637]LogOnlineSession: STEAM: Found 0 lobbies, finalizing the search
[2024.04.14-17.57.08:169][637]LogOnline: VeryVerbose: OSS: FOnlineAsyncTaskManager::AddToInQueue [FOnlineAsyncTaskSteamFindServers bWasSuccessful: 0 Results: 0]
[2024.04.14-17.57.08:169][637]LogOnline: VeryVerbose: OSS: FOnlineAsyncTaskManager::GameTick Starting serial task [FOnlineAsyncTaskSteamFindServers bWasSuccessful: 0 Results: 0]
[2024.04.14-17.57.08:169][637]LogOnlineSession: Verbose: STEAM:  "gamedir" "unrealtest" 
[2024.04.14-17.57.09:047][943]LogOnlineSession: Warning: STEAM: Server response IP:15.removed - 
[2024.04.14-17.57.09:047][943]LogOnlineSession: Warning: STEAM: Removed incompatible build: ServerBuildUniqueId = 0x00000000, GetBuildUniqueId() = 0x01a22caa
[2024.04.14-17.57.09:047][943]LogOnlineSession: Verbose: STEAM: Server query complete '0' eServerResponded (Server success)
[2024.04.14-17.57.09:047][943]LogOnline: Verbose: OSS: Async task 'FOnlineAsyncTaskSteamFindServers bWasSuccessful: 1 Results: 0' succeeded in 0.878459 seconds
[2024.04.14-17.57.09:047][943]LogOnline: VeryVerbose: OSS: FOnlineAsyncTaskManager::AddToOutQueue [FOnlineAsyncTaskSteamFindServers bWasSuccessful: 1 Results: 0]
[2024.04.14-17.57.09:048][943]LogBlueprintUserMessages: [WB_JoinGame_C_2147482464] Finished searching for servers``` logs

I removed IP of found session
short arrow
# bright summit

It's worth noting that App ID 480 (spacewars) is region locked

bright summit
#

It's same region...

thin stratus
#

[2024.04.14-17.57.09:047][943]LogOnlineSession: Warning: STEAM: Removed incompatible build: ServerBuildUniqueId = 0x00000000, GetBuildUniqueId() = 0x01a22caa

#

That might also point to both games not using the same build

#

The Search itself seems successful

short arrow
#

By region I mean server locked in steams case. US - Los angels steam server cannot find servers in US - Carson city

#

There's no US - Carson city steam server but im just making an example

#

Both are in the same region, but are a different steam serve connection or whatever

thin stratus
#

I mean it reads like they just test on 2 PCs

#

Not even with a different person idk

#

So region shouldn't be an issue

bright summit
#

I am testing in 2 other PCs in same network

short arrow
#

Are both being launched through the packaged game? You cannot connect through unreal unless you are using unreal source

bright summit
#

yes it's packaged

thin stratus
#

Hm, very strange. You could try using SteamSockets instead of the older SteamNetDriver fwiw