#multiplayer

1 messages · Page 176 of 1

gusty slate
#

C++ OnRep isn't automatically called on the server as well?

#

as BP one does

cursive steeple
gusty slate
#

Thank you

thin stratus
#

I would, but I'm on the edge on it being actually full ends correct

#

One thing for example is the Independent Tick part

#

It's more reasonable to use FixedTick and add the Smoothing

#

And other implementation details like Crouching being a LayeredMove.
We aren't doing that internally, which either means there are multiple ways, or one of the two is less ideal

#

And there is some more stuff that I find lacking.

  • ProposedMove isn't fully set (bHasDirIntent for example isn't properly set)
  • MoveInput should already be WorldSpace (old Engine version?)
  • Pretty sure Jumping, similar to Teleport should refund RemainingMs
  • Some Variable Types are set to 3d instead of just using the correct FVector etc. type
  • MovementUtils seem to be jamming multiple MovementModes into single functions (scales badly)

While I value resources like this, I don't see where it is worth more than the existing examples that Epic provides.

I gladly pin it if the repo is cleaned up, updated to latest 5.4 Mover code and if it holds some more information about the Tick and Smoothing part.

pallid mesa
#

I personally had a better time following Snaps code than epic's for what its worth, its simpler, less cumbersome to follow. And also, its customly built from the ground up, can help peeps to do their own implementations easier.

Now, we are not 100% sure if its the right way to go, as there's no public info about some of the topics:

  • Regarding the Tick/Smoothing, ye not sure.... epic hasn't pronounced themselves about it either! so... ye idk
  • Regarding the layered moves... I also implemented sprint doing this and so far... doesnt look too sus 🤷‍♂️ Ay would love to ask J. Hare himself what would he do hahaha XD

Although this is a nice list of feedback, will forward it to her! Thanks exi, lets see if I can help her a bit to solidify it as a community sample

manic trellis
#

I have setup a nameplate system for players.
according to this flow show in the points,

  • I have a player name veraibale is replicated using on_rep.
  • Name is setting from Widget through player controller
  • Name widget is setting in player character class
    The code working for the player who are joining togather but those player who join the game late do not have the name for all the players joined before it's joining.
    help me fix this issue.
    thanks in advance
thin stratus
#

Including using FixedTick

pallid mesa
#

ye I figured u had ur own rodeo haha :>

#

But at the same time exi i think the existing examples of epic fall a bit short and arent very pedagogical to show u how to implement ur own thing, thats where i see the value. Lets see if we can clear out these points 🙇

thin stratus
#

More comments, less debug code, more commitment to the implementation, no unused files, fixing of bugs and missing code (like bHasDirIntent), and maybe some more info in the readme in general.

#

Right now it feels like a quickly thrown together snippet that isn't maintained

civic turtle
#

hey sorry for the late response i fell asleep after that message lol. I did not need to open any ports on my router or do any extra stuff with it. All i did was download the steam subsystem with unreal, set up servers creating/ joining, make sure you have steam open prior to running the EXE and it should work

plush lotus
#

Hello i'm facing an issue regargind local mutliplayers. I can play with 4 players. so each players has it's own camera.. so then it's a big issue for the FPS and the performance of the game. Do you have any tips or solution that i should considere to be able to have a game 100% functional with 4 camera?

undone needle
#

Familiarize yourself with Profiling Tools to identify where your performance issue is coming from would be the best advice in that situation

tiny pier
#

building servers gives an error "Unable to build while Live Coding is active. Exit the editor and game, or press Ctrl+Alt+F11 if iterating on code in the editor or game"

lament flax
#

PDAs arent replicated, but are they at least still valid on server ?

kindred widget
fossil veldt
# thin stratus And there is some more stuff that I find lacking. - ProposedMove isn't fully set...

I use independent tick currently because Epic hasn't yet shown they are committing to fixed tick, even their examples don't do their own interpolation so i'm assuming Epic is also using independent internally. Since I haven't seen any inclination yet of how Epic plans to use this I didn't bother to implement it on fixed tick, after all fixed tick was an NPP feature that was highly work in progress for a long time even before Mover.

Re crouching being a layered move, you can find examples of Epic doing similar and it lets you make usage of transitions.

  • Yeap fair enough on ProposedMove.
  • MoveInput was defaultly not in WS on older versions, they did some breaking changes towards end of 5.4 release
  • Jumping doesn't need to refund the remaining MS because you still perform the move for that frame even if you jump
  • Yea fair enough on using templated vector type
  • This was actually intentional, but yea I suppose it doesn't hurt to break them apart for flexibility

As for what it offers over default example samples - those are afaik built on top of the ported CMC implementation, they aren't ground up and none of them are first person implementations.

errant mulch
#

hello guys! a few days ago i posted this question regarding a problem with rpc, basically, i wanted a replicated actor to make a small animation when a player approaches and presses "E", but it didnt work for the rest of the clients, i did what they recommended me and put an event on the server, and make that event call a multicast that performs the action for the animation.

now the thing works, but only when im playing on the standalone server,and this frustrates me, because i have a feeling that i have done things with rpc before that worked perfectly without multicasts or several functions

this is the bp that i currently have after the changes, i tried changing where does the function executes, and even linking the E key to both the server and the client functions, to no avail

what i am missing or what i am doing wrong?

kindred widget
# errant mulch hello guys! a few days ago i posted this question regarding a problem with rpc, ...

Your issue is that you are not respecting ownership.

To make a ServerRPC, the actor or component on said actor making the RPC is required to be owned by the player. This needs to be set both on the client and on the server. This is normally set on both simply by setting it on the server as this is a replicated property.

Your Powerup is not owned by anyone.

So to get around this, what normally happens is that your Pawn or similar would have an RPC on it for a general Interact. You'd pass the actor reference through the RPC and call an interface function on the thing that would do what you need it to do one the server which then it can replicate or multicast whatever to everyone.

thin stratus
errant mulch
thin stratus
#

For fixed tick you "only" need to add the smoothing for the owning client/autonomous proxy. Rest works fine.

#

This does currently need one to expose the FixTickTime or whatever it is called on the Manager. But mentioning seems reasonable at least

#

The jumping part I don't quite see. Jumping is a layered move and iirc even epic refunds the Ms, cause the jump is not part of the actual walking move anymore

kindred widget
thin stratus
#

But implementation may differ. Over all I just think the repo needs a clearer setup to serve as a good resource.

#

Again I gladly pin it if you clean it up a bit

fossil veldt
#

sweet

#

ty

thin stratus
#

No worries

errant mulch
kindred widget
#

It is restrictive and on purpose. It's meant to signify that this player has ownership over the actor and that they're allowed to use it. You don't want Player2 to shoot Player3's rocket launcher.

#

There are ways around it if you reeeeeeally want to get fucky with netcode. But quite honestly it's not worth it and you should just make a nice interaction system.

errant mulch
#

its funny because the way i was trying to make an "ownership system" for the powerup, is the same way that i would make an interaction if this was a single player, with collision boxes and stuff

kindred widget
#

Yeah, tbf it's rare that you enable input on generic actors. It's usually more of a very specific reason. Interactions are usually done by picking the best target for the player. Usually via line trace or through an overlap gather and filter. Reasons for this are also because this system can be much easier displayed to UI. There isn't issues with multiple actors fighting to show their stuff in UI when only one system controls what is the current interact target. Place the interact system on the playercontroller or pawn and that system can also RPC for you to do server interactions on the target.

errant mulch
#

yeah i know it was a weird move, my line of thought was that it was better for each actor to handle their own inputs, because i tried to use an event dispatcher to get this done at it was giving me the same problem

#

anyway, i will probably be back here after changing the interaction system, this thing has been a real pain to fix because i still struggle with bp comunication and how things work with client-server-client replication

#

i feel really bad when i have to come here after trying tons of stuff because i feel like i cant fix this things on my own even if my life depends on it

quasi tide
thin stratus
# quasi tide Thoughts on it compared to the good ol' CMC? (I already know Snaps thoughts 😅)

Hm, ultimately, I would just say this: If you don't need a FixedTick solution that ties together multiple NPP Simulations right about now, then Mover is probably not worth looking into yet. CMC is most likely superior in Bandwidth and Performance. NPP itself seems in maintenance mode, so that's not so great. Mover is a solid base, but needs work. They are working on it though I guess.

#

You can do a lot with Mover and you can probably reproduce whatever CMC Movement Modes you had in Mover just fine.

#

But if you want this to have other NPP simulations tie into your Movement, you would need to use FixedTick and that lacks smoothing. While adding smoothing is relatively simple, it needs changes to the plugin.

#

Even without FixedTick, corrections aren't smoothed either.

#

There is still a lot that needs to be done to have it work really nicely out of the box for all users, especially Blueprint users. And there doesn't seem to be a big focus on that for Epic at the moment.

#

So if you really need to tie, idk, your Weapon System to your Movement, or your custom GAS to your Movement etc., then sure go for it, but be aware that you'd need to use Fixed Tick and add the smoothing

#

IndependentTick only reconciles the simulation instance that got corrected

#

I think Mover should go through some more iterations and QOL updates

#

And yes, it's a lot of negative points, but I think those are the more important ones.

#

I think the main thing stopping me from actively suggesting to use it over CMC is the lack of support from Epic and the current state of it based on that, together with the look into the future of how quick improvements may come.

#

If I see more Mover/NPP changes on main or in the patch notes then that would be great

#

And I say all of that while I'm helping moving the whole movement system from my Client over to NPP, so they can use it together with all their other systems that are moved to use NPP with FixedTick so we have a straight forward way to have the game systems rely on each other :D

pallid mesa
#

On the other side there's the new net-physics stuff, which has improved a lot lately. Actively used in Lego.. in fact in the talk itself epic mentioned that they had to hack something together in the cmc to make their character work in conjunction with these physics because mover wasnt ready by then

mystic zodiac
#

Hello, I have a realy Big Problem with Repclicate Static Mesh Instances.

I have a BP with several Static Mehs Instace Components for Diferent Trees

and a Startup Event stat collects Transforms for these Instances and take them in a array
https://blueprintue.com/blueprint/knnjra1r/

this array is rep notifying and replicate these trees to the Clients.

with a small amount of instances like 300 or so it works. But i have much of these BP on my map and it dont work up to 30.000 instances

is there a better way? or some settings do do this ?

fleet scarab
#

Hey everyone, I'm currently learning about replication and put together a small test. It's a clock that can be sent one of four positions, and then rotates from there on the client side.

I've noticed that when my Pick Random Time event picks the same number, it runs the OnRep_ClockPosition function on the server, but not the client. On the client the clock hand continues to rotate, but on the server it goes back to the picked position and rotates from there causing a sync issue.

What's the correct way to handle this? Should I be instead sending the final rotation value through? Seems a bit excessive for something that could be handled client side and remain correct.

kindred widget
# fleet scarab Hey everyone, I'm currently learning about replication and put together a small ...

For starts, even outside of multiplayer, your arrow is moving in a way that is not correctly framerate independent. Someone at 30fps will have a slower clock than someone at 60fps.

Even if you fix that though you can still end up with an out of sync client if they late join due to that join setting their clock rotation while others will have already been rotating.

If you're interested in precision I would recommend setting two states in like a struct. One being the random placement. The other being the time it was set. Your Gamestate has a replicated time offset you can use to relatively sync clients to a time value. This would let you use the difference of the time it was set to the current time from the gamestate to set the hand in the correct position while replicating the least amount of data. This ignores the FPS issue due to simply moving to the correct spot each frame and is resistant to late join issues.

fleet scarab
hollow gate
#

@thin stratus Hey, i got super busy in the past few weeks i didn't get the chance to do this. i got to it this weekend so here's the repo https://github.com/TrueKaizoku/UnrealEngineNPP/tree/5.4-With-NPP-Features . this is a fork of the engine with smoothing added to network prediction as it was intended (2 services for fixed and independent) . intending to add few more improvements and features before calling it a day. i also made the changes to mover to make it work with smoothing fully.

#

Might need to separate the subtract function into get offset and apply offset to make it clearer what is called exactly and when .but with this fixed tick is fully implemented and can be used without any issue for any simulation , as long as it implements the needed function in the sync/aux state and the Finalize Smoothing in the driver.

kindred widget
barren patrol
#

any tips for testing a Windows PIE client against a linux server running locally in wsl?

#

i used to just call open 127.0.0.1:7777 to connect locally before but I guess the wsl side has it's own network stack and IP. I tried the IP in wsl hostname -i and that didn't work either.

#

I must be missing some configuration or detail, but not sure what to look at from here.

thin stratus
thin stratus
#

Probably only works if you are logged into an account that is connected to ue

twin juniper
#

I'm connected tho

barren patrol
hollow gate
devout sonnet
#

Does epic have any projects to help understand how RPCs work?

thin stratus
twin juniper
#

Does anyone know why Mover movement samples have so much stuttering? Is there a setting I forgot to turn on?

thin stratus
twin juniper
# devout sonnet Does epic have any projects to help understand how RPCs work?

https://www.youtube.com/watch?v=KsORRtBOJYc&t=1323s

It's not an example and it's not my favorite style of presentation but this video is what made the most sense to me

BRY

📹 Part 4 of our replication series unlocks limitless potential with Multicast and RepNotify! In this video, we dive deeper about how Unreal Engine's Actor Replication really works as well as introduce ourselves to a variable replication and how combining the power of variable replication with an event driven design can help us build a multiplaye...

▶ Play video
thin stratus
#

Mainly asking to know if that is not enough

twin juniper
#

can you resend the link or I don't know why it doesn't work

hollow gate
#

then you don't have everything setup. that is the engine repo. i would double check if the github account you are trying to open the links from is the same one linked to your epic account.

twin juniper
#

this is valid

pallid mesa
twin juniper
#

Is it just broken

devout sonnet
twin juniper
hollow gate
# twin juniper Is it just broken

you can try redoing the github account connection maybe. but once you accept the email invitation it would work. possible you did it a while ago and didn't accept the invite. which is valid for 7 days only. yo ucan confirm whether yo uare in on not by looking at your github profile under your name there is the list of organizations you are part of. Epic Games should be there.

twin juniper
#

I did it 20 mins ago and didnt check my emails

hollow gate
twin juniper
#

lol ok thx

queen escarp
#

to set bOnlyAllowAutonomousTickPose to false do anyone know if they fixed this in Ue 5 ?

#

or is tere a way to toggle this in editor now ?

gilded vapor
#

Are you asking if you can set it in blueprints?

#

its not broken though

queen escarp
#

yeah

#

well no but "toggable" atleast'

#

or should be*

gilded vapor
#

Are you locked into using BP exclusively?

#

it would be super easy to just create a node yourself

queen escarp
#

well no but i only do it ive done it in cpp before but i need guidance then x)

gilded vapor
#

you caught me in a good mood

#

ew why did it format like that

queen escarp
#

he

#

nice

#

so where do i put >)

#

or

gilded vapor
#

this one^^

queen escarp
#

i just drag n drop it ?

gilded vapor
#

is your project blueprint only?

queen escarp
#

no

gilded vapor
#

Then you can just drag/drop it into <YourProject>/Source/<Module>/CharacterMovementLibrary.h

#

recompile

queen escarp
#

oh

#

<Module>

#

dont have thaty :/ ?

gilded vapor
#

Module will probably just be a folder

#

probably your project name by default

queen escarp
#

ah y

gilded vapor
#

This is better I had an extra variable you dont need

queen escarp
#

ok ty

#

testing

#

to recompile

#

do i rebuild or ?

gilded vapor
#

yes

#

you need to rebuild

queen escarp
#

okok

#

noice

#

hm can i test it somehow :P?

#

im guessing it works so super ty!"

gilded vapor
#

You can just print string "GetAutonomousPose"

#

and then set it

#

and then get it again and see if it changes

queen escarp
#

oh so wait u added a node now

#

not change anything by default ?

crisp shard
#

has anyone been using mover 2.0 in ue 5.4? curious if its got any hype to it for multiplayer movement solutions

gilded vapor
#

The default value is not changed

latent heart
queen escarp
#

oh ok

gilded vapor
queen escarp
#

hmm icant find it

crisp shard
#

and what are replays?

gilded vapor
queen escarp
#

hm ok how do i compile ?

latent heart
latent heart
#

It does not come with lyra by default.

crisp shard
crisp shard
latent heart
#

It's a lot lighter.

latent heart
#

Something people have forgotten about if they're born this millennium, apparently.

queen escarp
#

@gilded vaporhow do i comile* 😛

gilded vapor
queen escarp
#

aye it already is a c+++

gilded vapor
#

even if your project is already c++ it will tell you how to compile

queen escarp
#

im using steam advance sess so

#

oh

crisp shard
# latent heart It's a lot lighter.

sick, i want to try it out but don't want to replace the current one, i just feel it's gonna be a hassle but when it's out of expereimental i'd 100 percent just go for the switch

#

base cmc just too limited

#

w/o cpp, and i only be using bps cause noob

latent heart
#

Mover isn't going to be any better.

crisp shard
latent heart
#

It's more generic and well built.

queen escarp
#

@gilded vapor hm i have 2x different .sln files in my folder is that wrong :/?

#

i renamed my project a while ago

gilded vapor
#

well one of them is probs for your project

queen escarp
#

shooter royal is the old name

gilded vapor
#

and the other is just a random file hahah

#

you can delete both

queen escarp
#

oh ok

gilded vapor
#

right click on your project -> generate project files

crisp shard
queen escarp
#

hm still dont have it :/

latent heart
crisp shard
#

or basic sprint

latent heart
#

Different.

queen escarp
#

@gilded vapori dont get it im rebuilding doing all that but the file isent creating a c++ file from it

crisp shard
queen escarp
gilded vapor
#

building isn't going to create a C++ from?

latent heart
gilded vapor
#

Do you mean a .cpp file?

queen escarp
#

yeah

gilded vapor
#

its a standalone header it doesn't need a cpp file

queen escarp
#

oh

crisp shard
#

lol im just talkinga bout simply replicated movement related things. like if i wanted to replicate sprinting or a dash, would it perform better under latent enoirnment VS base cmc

queen escarp
#

@gilded vapor hm ok so i still cant find it, i need to be any specific class or something or am i missing something ?

#

oh found it

#

im dumb

#

lel

#

cool ty!

#

is that being replicated or do i need to run it on server or rpc the change also ?

obtuse field
#

It looks like live coding is breaking my dedicated server. What can I do about it?

chrome quest
#

Don't use live coding then. Turn it on, so you can't hot reload, but don't bother with it.

kindred widget
#

Enable Livecoding, Disable Reinstancing.

obtuse field
#

Reinstancing was disabled when it happens

#

Btw. What is reinstancing?

latent heart
#

It re-instances objects with the new changes.

#

Recreates them.

gilded vapor
manic token
#

So, currently the biggest benefit of using Mover/NPP is so we have a singular prediction system, in which different gameplay systems (movement, abilities...) can interact with each other more easily.
Conversly, methods like using CMC or Mover with GAS, result in having multiple prediction systems, where potential interop will be a problem.
What I'd like to know, since I'm lacking experience to tell, is what would be some concrete common examples of such interop problems. For example, is simple stuff like sprinting or slowing abilities already problematic? The logic for these would probably be implemented as bWantsTo flags in CMC getting set by GAS lets say. I haven't noticed any problems when working this way.
Maybe the problems only start when we want attributes to be used/shared by multiple systems? Like stamina for sprinting between GAS and CMC.

I would love to hear more concrete examples of where any of you guys ran into issues, and how you worked around them.

hollow eagle
#

Interop isn't really the main benefit of mover. If you need GAS (which solves an entirely different problem than NPP, even if it includes some prediction functionality) then you need GAS - and the issues you will have integrating it with mover are going to be similar to with CMC.

#

Eventually if GAS prediction is rewritten to take advantage of NPP then things might be different. But either way, the main benefit of mover is flexibility - CMC was/is a very rigid and annoying to use framework if you needed to do anything outside of the basic movement modes.

thin stratus
# hollow gate <@94211915902889984> Hey, i got super busy in the past few weeks i didn't get t...

How much work would it be for you to maybe outline the exact change you did? Not sure how straightforward it is to search and spot all the modifications.
I know you have a readme, but for a team that can't use the 5.4 custom engine (cause they have their own), is there something to make it a bit simpler?
We for example also aren't on 5.4, so just comparing the NPP Source might not work

thin stratus
hollow eagle
# manic token So, currently the biggest benefit of using Mover/NPP is so we have a singular pr...

In terms of interop problems, it's mostly around GAS having its own state that it manages which is completely disconnected from Mover/CMC.
For example, CMC has a "wants to crouch" flag it sends over the network from client to server. If you make a crouch ability in GAS that sets the flag, you now have two separate systems saying "I want to crouch". And those systems could disagree - if GAS rejects activation of the ability on the server you now need to roll back state in CMC in case it already started moving with the crouch. If you try to protect against this by having CMC check with GAS on the server then you run the risk of introducing further mispredictions because CMC cannot roll back the state of GAS to see if crouching was allowed at the time the client sent it.

One solution is to avoid GAS driving movement at all. Let CMC report movement modes to GAS (with loose tags, for example) and query for active abilities based on tags to cancel them. Basically emulate what a real ability would do in terms of cancelling other abilities/applying tags but without actually using an ability. Let CMC be fully authoritative over its own state, and GAS just gets to look at the result of movement via tags without being able to directly affect them.

thin stratus
#

There are some exceptions, like RootMotionSources

#

Or RootMotion Montages in general

#

But if you alter e.g. MovementSpeed via a GE in any kind of way, you gonna run into corrections one way or another

#

And we are only talking about predicted stuff

#

If it#s something set from outside then that's always gonna be a correction of course

#

An enemy stunning you will lead to a correction, but that's normal

#

So "only" predicted actions that affect movement

#

E.g. if you have AimDownSight that slows you while aiming and you predict this outside of CMC/NPP, you will most likely run into corrections

#

You'd need to thunnel it all through CMC's ServerRPC, which people have done in the past

#

Or use NPP for your other system so that everything runs through the same ProduceInput and SimTick stuff

#

Which of course doesn't allow GAS then

#

You may also come up with an inbetween NPP system

#

That allows the client to predict any kind of value change for ~RTT

#

Server trusts for that amount of time

#

And if the value is not the same after that time, client probably did something wrong

#

But that's nasty and if you go with NPP you should turn everything into NPP systems that need prediction

manic token
#

Thanks for the great replies, you've cleared this up for me completely!!

#

I also worded that poorly, clearly the biggest benefit of Mover is the advantages it offers vs CMC (flexibility, modularity...). But another huge potential benefit is that it uses NPP, which we can use as the prediction system for other stuff we make too.
If you decide to write your own GAS to have a clean solution for movement influencing abilities, it would probably be easier to do so on top of NPP, as opposed to rolling your own prediction system, or hacking the entire thing into CMC.

#

Now lets just hope Epic decides to invest seriously into NPP/Mover for the future, 🤞for GAS 2.0 to be integrated as well 😂

woven basin
lament flax
#

Hello,
So, I heard that you can replicate a pointer, i would like to know how this is done.
The main goal behind this is that i want to replicated a pointer to a UObject

tight bison
#

Hello, I have an issue wit the host player.
I have this AttributeEvents ActorComponent on my player, which broadcasts a delegate where a widget listen for to update over head health/mana bars.
I Initialize this OnRep_PlayerState for clients, it works fine, it gets the widget, sets the "WidgetController" which triggers various event and let widget bind to AttributeEvents' delegates.
But for the Host Player, OnRep_PlayerState doesn't get called. I assume it's because host is the server so no replication is needed. But when i try to get the widget in InitAbilityActorInfo, the widget is null becasue it's a server and i cannot set "WidgetController" on it. so widget don't listen, and i can't get the widget to assign it.

Is there any way to make this work?, or do i need to call a multicast from the server and do all these in the RPC to make it work for everybody. But it seems wasteful to send an RPC to make thing work on the server player.

Thanks!

thin stratus
#

But again, you can do probably all the Movement stuff with Mover (in C++). It just depends a bit on your requirements.

hollow gate
thin stratus
#

Is it just all one commit that adds the changes?

#

39db27063a0d162bdef77af3b1a7e29959ad485a?

#

NPP changes look relatively straight forward. More or less what I imagined them to be after our last talk

hollow gate
thin stratus
#

Basically just a new Service for either of the Tick Types that has an Update and a Finalize function.
Some new Driver functions so we can listen to that stuff in the Driver (LiaisonComp for Mover).

#

And then calling those next to the other tick and finialize calls

#

Makes sense

#

Sad that this isn't there by default. Doesn't look like something they couldn't add in a day or two of work

#

Probably half a day if it's your own system, but well

hollow gate
#

Yeah NPP changes are simple . Add service, register it and call it in manager.
It's not too much. But i assume the devs working on mover are not that deep in tbe NPP plugin yet. My guess they will do smoother for mover rather than adding a service.

thin stratus
#

Even if they deny it, they might use it to speed up adding these features to NPP

#

I know it's a lot of time/effort needed for this stuff, just wondering

hollow gate
#

After i finish some of the other things i mentioned in read me.

thin stratus
#

Alrighty

#

Do I understand correctly that the NPP + Mover changes in that commit mimic the SmoothingComponent setup?

#

The Mover changes look like it at least

hollow gate
#

It's same logic

thin stratus
#
  • including BasedMovement stuff, which I think the SmoothComp didn't have
#

At least mine doesn't

hollow gate
#

Get state diff and blend out the offset for correction.
Smoothing comp did have something for based movement too. Just offsetting the target and last structs saved. Just like i do in servic

thin stratus
#

Ah right, there was this extra callback for BasedMove

#

NetworkPredictionProxy.ReadSyncState<FMoverSyncState>() here you added the ReadType. Is that using some default value in the 5.4 version?

#

(don't have the Engine at hand atm)

hollow gate
#

The read type is actually an input in the original NPP function mover calls. But mover doesn't use that input , because up until now the "presentation" state was not valid for those ticking simulation so read automatically read simulation.. but after my changes presentation state is valid , so need to make sure we read correct state

#

So yes It was using Presentation as default value in engine version

thin stratus
#

so read automatically read simulation..

So yes It was using Presentation as default value in engine version

#

You mean Simulation I assume :P

#

Thanks for explaining, that makes sense. Thanks for sharing, this is probably a huge thing for everyone who wants to use NPP (and Mover) with FixedTick

hollow gate
#

So input to function was presentation by default. Function itself check if input is presentation and presentation was not valid it returns simulation. Whoch was happening until now. But now presentation state is valid so the validity check will pass and will return presentation by default. Not what we want.

hollow gate
cloud crown
#

Is there any git repo with sas and eos inbuilt Template with pubg like lobby system ?

crude comet
#

Hello, everyone! I have a question: If I spawn replicated actor on server. That Actor has some replicated properties. If I will set these properties on the server in the same tick as Actor is spawned, will they always arrive in the same bunch on Client, or they could arrive in different bunches?

manic token
# thin stratus I would argue that if you just want to replace CMC, Mover might still be a bit b...

Don't worry, I've already got that from reading through most of your previous messages relating to Mover 😉
I'm still gonna dive into Mover though, since my plans for the future involve complex movement influenced by weapons and abilities, and potentially physics interactions too.
Also because I'm still in the research/tech demo stages, so I want to try it out. Especially if it ends up being the more future proof approach.

thin stratus
thin stratus
#

Not sure if you want to spawn it deferred for that though

crude comet
thin stratus
#

I think it's 100% true, cause the replication stuff happens at the end of the frame, so it would send any changes you did to the Actor.
But this is one of those things that I somewhat accepted and never actually looked into :D

crude comet
# thin stratus I think it's 100% true, cause the replication stuff happens at the end of the fr...

I just do not want to write logic, which I can't be 100% sure of. I might look into the engine code myself, just do not have time for it right time, thought that mb someone knows the answer. Anyway, in any case I can rewrite it another way, to make sure everything is replicated correctly, just was really curious about the case :-).

Thx for the answer! If anyone can 100% prove that such replication will work on client as was said, I'd appreciate the help! Or at least if Epic somewhere says something about it.

coral badger
# crude comet I just do not want to write logic, which I can't be 100% sure of. I might look i...

From my experience, I would never rely on something like that being always true 100% as there might be some combinations of cases when that spawned actor's properties become of a lesser priority for the network, or the other side of it would be making that actor always be in front of the priority queue in comparison to everything else in your game. But then, does that fit your game use case; can you allow that? And is that actor ever irrelevant to someone else for some other reasons? Do all clients need to have its' properties available or just the client that spawns it? I would try to answer such questions first before I code some sort of a universal 100% solution (as in assuming that its' properties will always be there right away).

crude comet
coral badger
#

With networking, the code can even be solid and work perfectly 99% of the time, but then over internet there can be a case where your data just isn't there on that first frame. So, depends on your use case etc. eXI is right, of course.:)

thin stratus
#

To be fair, the thing in question can probably be 100% true

#

Cause the question is if UE sends the updated Variables of a newly Spawned Actor to the Client if they are set in the same frame.

#

And there won't be a 50/50 chance

#

Either it does or it doesn't.

coral badger
#

What if the data of that spawned actor does not fit into the packet that frame?

#

Or am I thinking in some archaic terms and this is something that just works in UE? Cause I've written my own networking from scratch and there were some use cases that made me paranoid.

thick vector
#

Hi,
I used similar method of https://vorixo.github.io/devtricks/data-stream/ (Chunked RPC) to send server's save slot to clients (about 150KB), but after sending is completed, replication doesn't work for about 5-10 seconds. Then, positions and other things suddenly replicated. It seems because there are many data queued (UNetConnection::QueuedBits) and the network is saturated (UNetDriver::ServerReplicateActors_MarkRelevantActors) until the queue is freed.
I couldn't find any better solution to send large array of data to clients, using custom socket make porting game harder and had its own headaches such as port forwarding and NAT. Is there any other solution or tricks?

lament flax
#

can i change a repnotify struct "at once" so it doesnt trigger OnRep each time i change a member ?
its only a struct of 2 members so i might just set it using the struct constructor

silent valley
undone needle
#

There's something I don't quite grasp 100% yet;
Slot based Inventory System;
I have a delegate function that when called, refresh the inventory UI on owning client. That event exists inside my Inventory Widget.
That delegate is declared in C++ on my InventoryActorComponent Which is added on my player's pawn.

Everything is working fine, when I call the function transfer slot to move an item to another place, I call my NetMulticast Function which broadcast my delegate, thus making the server and pawn aware that the player moved the place of an item in my inventory.

Now, something I realised this morning is that by calling my NetMulticast, I let everyone aware in the pawn's relevancy that the player moved something in his inventory, which is, bad. So I'm trying to change my NetMulticast function to a Server function, which works fine on the server. I then created a new function to run the same updateInventory broadcast on the owner client, and that is the part that doesn't work, the player never refreshes the inventory until I close and open it again. Anyone has a clue what I might be doing wrong?

midnight palm
#

Hello there, I hope it will not be interpreted as spamming as I asked also in #virtual-reality, but the question could be posted here too I guess

#

So, I was wondering: let say I have 10 peoples in a room and I want them to enjoy a VR experience together with a quest 2. Would it be possible for each people to run their own instance of the game, but also see the people around them so they dont bump into each other ?

thin stratus
#

Cause NetMulticast goes from Server to all Clients that have an instance of the Actor.
And ServerRPC goes from owning Client to Server

#

That's very very different

undone needle
#

Yeah and that's the behavior I want, because like you said, NetMulticast goes from Server to ALL clients.
All players doesn't need to know that one player moved an item in his inventory

thin stratus
#

So, here is the thing

#

UI is owning Client only, right?

undone needle
#

yes

thin stratus
#

We ignore shared UI on chests for now

#

In case that exists

undone needle
#

it wont so lets ignore i

thin stratus
#

Now, your Client is the one moving Items from A to B.
If you have a ListenServer, then in this scenario, it's still a Player, even if not a Client.

#

There are several iterations you usually go through to get this nice and smooth, so let's start with the working but not nice and smooth version.

undone needle
#

Its dedicated server btw, but yes please continue, im with you thus far

thin stratus
#

Whenever your Player moves an Item from A to B, it sends a ServerRPC with what was moved where to the Server.
The Server then checks if the moving is allowed, and then performs the actual changes.
The changes possibly should trigger an OnRep (ReplicatedUsing) function.
For this let's assume the Inventory is a simple Array of Structs or so.
Changing it will trigger an OnRep_InventoryArray.

In that OnRep_InventoryArray you can call your Delegate. If you only want to notify the local Client you can change the replication settings of the InventoryArray to OnlyOwner, so that other Clients don#t even get the Data.

#

This should just work, but adds latency to the Inventory

#

Cause the local Client has to wait the full RTT to get the changes to update the UI.

#

At this point you iterate on your solution, allowing the Client to locally, in addition to the Server RPC, check if they can perform the changes and just predict performing them.

#

Now the problem comes when you move the Item from A to B and from B to C so fast that the move from A to B hasn't replicated back yet. This is where it becomes a bit yucky, because now we are deep in prediction land. And I wouldn't really go that far, what I would do for the Inventory is simply accept the changes on the Server as long as they can be performed. And if the Server ever notices something not working, that's when you send a RELIABLE RPC to the Client with the fully authoritive inventory array, and simply override the clients version.

#

For something more dynamic like movement this would be a bit crap, but for inventory it should be enough

#

The RELIABLE RPC iteration would not have the OnRep fwiw

#

But there are a lot of ways to make such an Inventory. You could also just not care about the delay.

#

Or you could make it Client Authoritive if you don't care about cheating that much and just accept whatever the Client says

#

But ultimately, you wouldn't need a ClientRPC and a ServerRPC in the same function

#

The UI action to move something triggers a ServerRPC, no matter what iteration you are in

#

And the Server then does its thing to move the item

#

After that you either have the OnRep. Or you predicted the change locally and don't need to tell the Client unless whatever they tried to do was wrong.

undone needle
#

and with an onRep would replicate to the client and refresh the ui afterwards

thin stratus
#

Yeah assuming your Inventory Array wouldn't need to replicate to other clients

#

You can do the DOREPLIFETIME with condition and limit it to owner

#

And then the OnRep would only call for the owner

#

I would suggest you think about this a bit and maybe write down some setups and think about the pros and cons.

#

With multiplayer, everything is a pain :P

undone needle
#

Okay yeah that makes a lot of sense, I think I understand about 90% of what you just said, but that is more than plenty to send me in the right direction. Thank you a thousand time, I truly appreciate you taking the time!
And I totally agree with that last statement, I spend more time in my thought in front of the PC thinking about how everything will work and where I can sacrifice to have it work as best as possible and ultimately, this feels like the best course of action for my needs.
Thanks again!

mental pendant
#

anyone managed to test multiple game instances with two gamepads? right now only my first gamepad gets routed to the listen server

raw dagger
#

Hi there, so apologies if a solution could've been found online, my google abilities have failed me. I have been having what I think is a relevancy problem but I must be missing something, would appreciate any info.

This is in blueprint -> Actor Replicates and all other replication settings are set to default (Awake, bAlwaysRelevant=False, etc)

OnHasAuthority=True call and toggle an OnRep bool

The OnRep function will then only ever be called on the server and fail to replicate down to the client.

I'm spawning in next to the actor and have had a go at jacking up all of my relevancy settings just incase, tried a scrub delay but there's no race condition anyway. Setting bAlwaysRelevant=True also works.

AFAIK OnRep should be a state saved on the server and when it becomes relevant to a client it will update them? So bit confused why it would fail despite being right next to the actor. (Have tried this on a test actor as well and had the same result.) Is there something I'm missing, do I need bAlwaysRelevant=True to be able to use repNotify's? That seems wrong

cursive steeple
raw dagger
cursive steeple
lament flax
#

Every 0.x secs im calling a function that does stuff then modify a repnotify property.
the server calls DoStuffOnNotified right after, and the OnRep_ method of the modified property calls DoStuffOnNotified

DoStuffOnNotified broadcasts a delegate

the issue is, at random times, the delegates arent fired anymore on clients (like for 10s i can have no calls, then it will call with the latest value)
can it be because im stacking to much calls ?

brazen anvil
#

To make a character look up and down and have others see it, does the control rotation have to be replicated? Or is it possible to do without replicating anything?

lament flax
vagrant roost
#

is the mover 2.0 out yet? my instict tells me obviously this must be the old version

pallid mesa
#

mover 2.0 is out in ur 5.4

vagrant roost
#

isnt it if you only build the source code, not the launcher version?

#

i thought i read something about that

dry dove
#

Hello, i new a dedicated server with UE, i have duplicated the target file to target for server and when i want to copile it i have this error :

UATHelper: Packaging (Windows): Creating makefile for ThridPersonServer (no existing makefile)

lost inlet
lament flax
#

Performance wise, if i have something like a timer showing on UI, i should run it locally so there is no obvious delay, and from server call something on finish ?

vagrant roost
#

lol

lost inlet
#

"mover 1.0" doesn't exist, it was only called "2.0" because long-term it's an effort to replace the CMC

vagrant roost
#

ah ok i gotcha

#

thanks

brazen anvil
#

Is push replication worth doing?

robust ridge
#

Hi,

I am having an issue with the server (listen server) not sending information to the clients. When a player ready ups, their widget is updated to show that player is ready and its updated on both the client and the host. But when the host goes to ready up, it only updates the host's widget and doesn't update on the client.The "server_testing" is set to Run On Server and the custom event under it is sent to Mutlicast. I have no idea what might be causing this and any help would be appreciated!

sinful tree
#

They can only be referenced on the server and the owning client of that player controller..

#

The thing is, you don't need a reference to the player controller to do any of this. You are on the pawn. You can use the PlayerState.

tiny saddle
#

Hi, I’m making a multiplayer VR game where each player has a special ball. I want the ball to have client authoritative transform / movement and I have not been able to get it working. The ball does not need to collide with other player’s balls. Cheating is not a concern for the game. Below is how the ball’s position can be changed:

player holds ball with a physics handle

actor component on the ball that sets the balls location and rotation while ball is in flight

physics simulation for when the ball collides with the the world

Given the above ways that the ball’s position can be changed by it’s owner, is it possible to just replicate the ball’s transform using the owning clients data? I want the ball’s position to be extremely smooth, as smooth as offline play for the owning player.

The ball is a blueprint inheriting from StaticMeshActor. On the class defaults I have set replicate movement true, net load on client true, replicates true, replicate physics to autonomous proxy to false.

When in a multiplayer session the ball transform only changes for the owning player.

Does anyone have any thoughts or suggestions?

robust ridge
winged badger
cerulean karma
#

Hi Everyone. Any idea why my "Move To" Node works on server and standalone but not on a client? Video for reference (First Move To and then using Follow which works when holding down cursor)

#

That little spasm they do when i click it's just the Follow node responding, I might change that later but if i disconnect it, the character running on the server is still able to move with MoveTo but the client is not

#

I'm not sure if it might be something related to my movement component? but if so why would "Follow" work?
I'm pretty new and this is the first multiplayer test i've done

#

This is what MoveTo looks like:

#

Vs. Follow:

#

Found the reason, this option was toggled off:

glad robin
#

@thin stratus I love the multiplayer blog posts, read through it while trying to improve my system and everything works great I just didn't fully understand/get why use the FDelegateHandle.

So right before we create the session we call that: CreateSessionCompleteDelegateHandle = sessionInterface->AddOnCreateSessionCompleteDelegate_Handle(CreateSessionCompleteDelegate); and if I understand this is ensuring that in CreateSession() when it broadcasts, our CreateSessionCompleteDelegate we bound in the constructor fires. But then why do we unbind after instead of just binding it initially and leaving? I like how it feels cleaner because it's not necessary anymore but is that the only reason, just because we won't necessarily use it again until we create another session?

Edit: Immediately after sending I realized that we do get the SessionInterface at the start of the functions. I don't fully get the online system but I imagine this object can/does change so we have to add/clear just to ensure not touching the old one. Am I correct in this thinking?

torpid lantern
#

I feel like this is a silly question, but I'd like to explore it: is there a way to use the GameInstance as a secure vehicle to transfer a player data payload (inventory, attributes, etc.) from Server A to Server B along with the player's connection?

I'm wondering if I can maybe send an encrypted package on the GameInstance, and decrypt it server-side after player connection? Would this be a viable option, or am I way off-base in my thinking?

My Linux admin & REST skills are super weak, so I'm looking at ways to keep logic in Unreal, if possible.

sinful tree
torpid lantern
#

Thank you and a curse upon cheaters everywhere.

undone needle
#

Is there a way to make an AActor with no owner to become relevant only to the people within its net cull distance squared? I've been trying to figure it out but cant seem to grasp that part

hollow eagle
#

that's exactly what NetCullDistanceSquared does

undone needle
#

Yeah but, What I don't get are, the replication options on the blueprint instance I need to check to make it understand that is what I want. any documentation on their behaviors? Unreal's comment leaves me with 100questions about what to check and in which circumstances

hollow eagle
#

just set NetCullDistanceSquared, don't set always relevant

#

don't set only relevant to owner

undone needle
#

Mmhh.. Maybe I'm not using the right approach for my case then. I currently have a storage which, when I get out of range, it disappears, but the content doesn't show when I interact with it.
But, If I check net load on client, the content shows when I interact with it, but the storage seems to always stay relevant even when I get out of range...

thin stratus
glad robin
# thin stratus It's generally good to clear your delegate bindings when you don't need them any...

Ah I've been using them a lot more recently and never seem to clear but I will go through everything with that in mind aha. Thanks!

Only other question/thing I noticed was that because in all the different functions (CreateSession for ease of reading) after calling CreateSession(), if failed we broadcast on our delegate failed, but it also broadcasts bWasSuccessful in the OnCreateSessionCompleted(FName, bool). This function I assume is called on both successful and failed creation, so would be double broadcasting correct?

Anyways love the site, really set me in right direction after I found the other night.

thin stratus
glad robin
thin stratus
#

And we also broadcast ours if we never get to call the UE one

#

Our custom one is the one that we bind to if we want to react to our create session call. The UE one is only relevant for the create session call internally

glad robin
#

Yea I was just thinking that when it fails it would technically broadcast the OnCreateSessionEvent twice to ourselves because in CreateSession() and OnCreateSessionComplete() it broadcasts false and bWasSuccessful respectively. I imagine it wouldn't cause any problems, like if I was just set up to it to toggle button active it would just reactivate button twice aha

thin stratus
#

OnCreateSessionComplete is called from within the UE Subsystem. If we haven't actually called the UE CreateSession call yet for example then the Complete one won't call either

#

I think it also doesn't call it if the CreateSession call returns false on the same frame. I will have a look once I'm at the office

glad robin
#

I figured there may be some weird interaction somewhere. Oh well hasn't caused me any problems aha so I'm sure I just missing something 😛

undone needle
thin stratus
glad robin
#

I completely blanked on the clearing the binding right before haha

thin stratus
#

CreateSession doesn't broadcast the inner delegate if it fails directly.

#

UE CreateSession that is

glad robin
#

Yea I was only looking at our one

thin stratus
#

If it fails the same frame you are supposed to use the returned boolean

glad robin
#

But I completely missed until you said that haha

thin stratus
#

In theory it's enough if the server tells the client the Timestamp when the Timer should end

#

At least for like round timers and such things

#

For that it might be required to have a better synced net clock ( there are pinned posts about this )

#

If you have more complex situations then having a timer on both sides is also fine. Depends a bit on the situation as usual

#

I wouldn't say this has too much to do with performance

lament flax
#

Its prison type game where as time passes routines changes and stuff.
1 fake hour is about 10 real life minutes (~).

lament flax
thin stratus
#

@lament flax You probably only want to show the timer locally and let the server trigger the main events that happen after x minutes

hoary spear
#

Thats what made the most sense for me aswell. Server authority events. With client timer 'prediction'. Or a local timer, as one would say

#

If there was something granting extra time, That would be an RPC or an OnRep variable with the additional time

#

Regarding your question of overloading the netdriver, i highly doubt thats what happened. The max queue is pretty decent in my estimation

lament flax
#

okay thanks

normal valley
#

is there a handy list somewhere of server hosting solutions for unreal with their pros/cons?
the only two sort of complete solutions appear to be AWS Gamelift and MS Playfab (which does not allow you to push Linux servers?)

thin stratus
#

PlayFab should allow Linux Servers

#

Ages ago they only allowed doing that via commandline

#

Web interface only supported windows

#

I sure hope after all those years they support that now. Otherwise I got a con for you :D

#

Biggest con for all of those is the cost

maiden flame
#

It's also possible to just use regular server hosting/virtual machine cloud services, from the same providers, or others.
Cons: Cost again 😅
Although, I have a feeling these servers for games "packages" can't be cheaper than a custom configuration.

worthy oak
#

Throwing in 2 cents. While that’s 100% true you should still consider a scaling solution to make it cheaper. You don’t wanna pay for a server at 4 am with 0 players on it 😂

maiden flame
#

Definitely. You can configure rest times for servers, and dynamically allocate resources depending on traffic too.

worthy oak
#

Indeed 😄

normal valley
#

@thin stratus in your experience what has been the most straight forward solution to setup and maintain?

normal valley
#

doing more research, anyone got experience with agones :P?

sour dragon
#

Hello, just in general. When i swing my Hatchet in my UE Project with 100/100 ping theres a noticable delay because its currently server authoriative. Is it better advised to only client predict the swing animation or also the hit? Is there any BP way to do client prediction for this? I just want the smoothest possible gameplay for the player, if he actually hit something or delayed aint a big problem.

wet mica
#

Hello! How to correctly rotate my top-down character? Character always shoud facing to cursor position. So, on cursor movement input i got this handler:

FHitResult CursorHit;
    if (!GetHitResultUnderCursorByChannel(UEngineTypes::ConvertToTraceType(ECC_Visibility), true, CursorHit)) return;

const FVector CharacterWorldLocation = Dwarf->GetActorLocation();
const FVector TargetPosition = FVector(CursorHit.Location.X, CursorHit.Location.Y, CharacterWorldLocation.Z);
const FRotator FinalRotator = FRotationMatrix::MakeFromX(TargetPosition - CharacterWorldLocation).Rotator();

What the best practice to smoothly rotate character for multiplayer in this case? If i rotate it by control rotation, my movement (WASD) inputs start to work incorrectly, couse AddMovementInput work with same axis. Should i change rotation in AutonomousOnly_proxy instantly, and replicate FinalRotator to simulated only?

dry dove
#

anyone available for help on replication cube, i've sucess to make dedicated server, the first move works but the position of my cube isn't the same on both clients

normal viper
static charm
#

hey guys, trying to do basic replication and i cant find onbegin overlap (box), i understand i dont have the same box icon (what box is this?) , also i cant get the same output for ** set vector parmeter value**

What am i missing

first image and 3rd image is a tutorial

#

is my variables

pine tangle
dry dove
# normal viper Something like that

@normal viper this fixed my pb :
https://www.youtube.com/watch?v=H4frXTRwZqI

I think i have to think first what has to be 100% replicated what has to be calculated on client side to avoid overload my server

This shows you how to replicate an object simulating physics across all clients, and how to make a blueprint class out of one so you can call events on your replicated physics object.

▶ Play video
static charm
pine tangle
static charm
#

dunno what i do here to add it to target this varible, left is there, mine is right

normal viper
dry dove
#

@normal viper also, better to start making things in blueprint and then if performances issues i change the slow bp to c++?

normal viper
# dry dove <@716996204872859659> also, better to start making things in blueprint and then...

Yeah, I mean you can prototype fast in the blueprint and some things you probably want to make in C++. I'm kind of begginer myself so unless I will have heavy problems with overload I'm not thinking yet about c++, maybe I will decide to exchange something at the end of development cycle but for now if you are beginner like me, it's really hard to focus on learning all at once, there is so much. Master one thing, then jump into another. The best combo is to know both of them but I cannot imagine learning both at the same time tbh.

#

and I guess if something is already in blueprint, there should be no problem into deleting blueprint and writing it in C++ and connecting with whole system

dry dove
#

yeah, i think a good thing to do, to merge short & long term, is to make base class on c++ and extend it with BP, so the work will be easyer in case of rework

normal viper
#

but if you know c++ then nothing is stopping you and it would be recommended to do these things for performance

#

yeah

dry dove
#

It's matter time of feature vs performances

normal viper
#

i mean I heard that it's overall much better and easier to program with c++, once you know it..

#

and blueprints later are often kind of limiting what you can do

dry dove
#

like going to buy smth to supermarket, depend of the time you have, you can go walk there or take the car xd

normal viper
#

but its not my problems yet when you are beginner 😄

dry dove
#

hehe anyway, thanks you a lot for your time

visual mountain
#

Finding my client is having null returns when trying to access an item in the game. Was wondering how to rectify this, and figured it would be a few toggles in the items replication. I'll figure it out eventually through trial and error but a definitive explanation would do me a lot more good if anyone has one.

neon temple
#

I am work on a multiplayer game so i have to set fpp animation for owner mesh i.e. fpp and tpp animations for the other players. Both of the meshes are hidden from each other. But I'm not able to figure out what condition should I place in my function
I have a struct which holds all the anims

#

I have the animation logic in a custom cmc

undone needle
#

Been toying a lot with this yesterday with the same problem almost, here's what I understand so far from it;
Only Relevant to Owner is self explanatory I think, only the owner of the item receives the replicates call
Always Relevant, stay away from it, unless you have something that every1 needs to always be aware of, all the time
replicate movements.. replicates the movements.
Net Load on Client; Forces the client to load all the items with this upon launching the map. Regardless of their position again. Not the most efficient.
Net Use Owner Relevancy; Uses the owner replication relevancy to determine this object relevancy as well, useful when you have an independent actor tied to a player for instance, a pet would be a good example.
Replicate; If it replicates to server or not.

If you check replicates but none of the above or almost, you get the Net Cull Distance parameter that determines the ranges of the object relevancy. Meaning, if your player is within the object relevancy, it will start replicating to that (or those) player(s), otherwise, it won't and the GB will collect it if it was previously loaded. keep in mind in a third person project, by default, your player location is the camera, not the pawn

neon temple
raven cedar
#

Is there a best practice for getting the Player ID controller of a pawn? I keep attempting to do so but always end up with the playercontroller_base being set to 0, even if running on standalone.
Any guidance would be greatly appreciated! It has me completely stuck. Is this the right way to pull the local player ID?

lost inlet
raven cedar
lost inlet
#

What is a "player ID" in this context? I'm assuming you're aware of what a player controller is, right?

raven cedar
#

Player ID being the PlayerController reference to the individual player. I am trying to within the pawn allow an interact onto an actor, which references the correct player controller during the interact

lost inlet
#

This is completely muddled terminology

dark edge
#

Not sure if that's a part of your problem but could be

lost inlet
#

And what's the player controller's role in an interaction? You can call a server RPC on the pawn anyway since you're possessing it and therefore have net ownership

dark edge
#

What are you actually trying to to do? When x happens, you want x to happen.

raven cedar
#

I am fairly new to unreal engine, although I am attempting to have the pawn character interact with an actor the have the same blueprint interface:
Said actor needs to then update the GameState with values pulled out of the GameMode for current players that are in the game, and current players that are ready (Updated by an interaction on the actor)
Seems like its working except for my ability to get the correct character controller. In the picture, the Interactor is a object reference to my playercontroller. LookAtActor is a reference to the object of the Actor

#

Apologies if this is confusing

lost inlet
#

And what is a BP_Player_Master

raven cedar
normal viper
normal viper
# raven cedar This is the player pawn

So if you run a game, and you have 4 clients (players). I think for each of them they all game ''their own'' playercontroller which is 0. So yeah in the world there is 4 players controller, but the player controller 0 is always the one that is asigned to the client.
So it's not like you have to write different code for player 0, player 1, player 2, player 3. Everyone is player 0, for themselves. Not sure if i'm 100% right and if its helpfull.

tiny pier
#

I get a crash when calling "GetWorld()" in my game mode, works fine on solo play

void AMainGameMode::OpenNewLevel(FString LevelToOpen)
{
    UE_LOG(LogTemp, Warning, TEXT("Open Level Called"));
    GetWorld()->ServerTravel(LevelToOpen);
}```

I get this breakpoint error in AActor::GetWorld() function
``Exception thrown: read access violation. **this** was nullptr.``

```cpp
    if (!HasAnyFlags(RF_ClassDefaultObject) && ensureMsgf(GetOuter(), TEXT("Actor: %s has a null OuterPrivate in AActor::GetWorld()"), *GetFullName())
        && !GetOuter()->HasAnyFlags(RF_BeginDestroyed) && !GetOuter()->IsUnreachable())```
static charm
#

Hey guys i have a game idea, 3 diff places (imagine chunks of map), these all can get siged down by enmes in certain times, when this is siged down, everyone will be teleported from that set area, back to menu screen , then the area that got deotyed needs to reload itself, is it possible

normal viper
static charm
solar stirrup
#

Check that the gamemode pointer isn't null when calling a function on it

torpid lantern
# static charm ooo coooool any video links

I think an underrated skill is learning how to ask questions. Ambiguous questions will often result in vague answers. Nobody here knows what "sieged down" means or what your requirements are.

What you might want to do is breakdown this idea into smaller, more actionable ideas; and research them independently or ask very specific questions.

Here's my attempt at that, based on your brief blerb:

  • Figure out how to partition a level into these three places
  • Figure out how to get a list of actors within each partition
  • Figure out how to send a command and teleport these actors to a different location/level
  • Figure out how to reset a partitioned section of level

I think having each "chunk of map" be its own level would greatly reduce complexity for all of these points and I refer you to this site to learn more about multiplayer travel: https://cedric-neukirchen.net/docs/multiplayer-compendium/traveling-in-multiplayer

tiny pier
solar stirrup
#

you mean GameState?

#

show your code

tiny pier
solar stirrup
#

GameState exists on clients yes

tiny pier
#
void AGarrysGameGameState::SetLevelToOpen(ULevelData* LevelData)
{
    if (IsValid(LevelData))
    {
        UE_LOG(LogTemp, Warning, TEXT("Opening level %s"), *LevelToOpen);

        LevelToOpen = LevelData->GetLevelName();
        MainGameMode->OpenNewLevel(LevelToOpen);
        GameInstance->SetCurrentLevel(LevelData);
    }
    else
    {
        UE_LOG(LogTemp, Warning, TEXT("Level Invalid"));
    }
}```
vital furnace
#

Good evening. This message is a request for help addressed to experienced developers working with Unreal Engine. I am currently working on a multiplayer soccer game (similar to Rocket League). I’ve developed the multiplayer aspect using the Steam plugin and some YouTube tutorials, but I’m facing challenges because I’m trying to do something different from what I see in those tutorials.

The issue I’m encountering is that I want to organize players who join the game into teams. One idea that came to mind is to create a variable within the Extra Settings that serves as a counter for each team. Another idea was to create an array of Player Controllers for each team. However, I’m unsure how to modify variables within the Extra Settings once the session has already been created.

I would appreciate hearing about your approach to solving this problem and, if possible, any blueprints, videos, audios, or links that could help not only with this specific issue but also with the broader scope of the project. 🎮🚀

static charm
# torpid lantern I think an underrated skill is learning how to ask questions. Ambiguous question...

thanks alot for this great help

The idea is bascially

3 diff realms (citys), on 1 map , with 3 prisons , all these said maps ( maps as in just 3 citys on 1 map) can be travelled to from all 3 diff realms

only when said Sige weapons is summoned by prisoners most of the said city can be sieged down or i can make it simple for now (only prison doors/ vault can be damaged and broken into,

Once the prisoners have completed this they will get kicked to menu , so i can reset that city)

brazen anvil
#

This is running 2 clients in "Client" mode. I am breaking on Begin Play of a weapon that is being spawned. Why do 6 instances of the rifle exist? Shouldn't only 4 exist?

#

Is it because each client is also creating a instance of the other players rifle?

sinful tree
brazen anvil
tiny pier
peak wadi
#

is there a way to still use something like Anim Notifies to set values, since ABPs do not replicate, and if so how would one go about it?

I get an "no owning connection" error when I try.

sinful tree
peak wadi
#

explains why any iteration I've went with failed with exact same warning

sinful tree
#

You're probably getting that message because a client is also playing back that animation, and you're asking it to call an RPC on an actor it doesn't own.

peak wadi
#

ye

#

I assume hard-coding that info instead of using anim-notifies is the next work-around

#

a bit messy, but it'll get the job done

#

forgot to say, ty for confirming this 🙏

#

at least I can move on quicker now

dark edge
#

@peak wadiTypically the pattern is such that some game state (movement, abilities, etc) drives animation, which can drive notifies that do things like play sounds and particles etc

#

if it's a notify for gameplay (hit detection etc), you can either run it clientside and have the server OK the results of that in some way, or have the server run it too, and use the servers notify to do the actual thing (hitting something)

peak wadi
#

working on the combo system for the character, and I was using the anim notify to basically give me a time-frame where additional input will be saved/queued for the following attack

so it does have to do with game logic that should absolutely be replicated across the board, and I should probably have been more informed on the matter before I went w/ it.

Good news is, the work-around is easy if a bit less convenient.

tiny pier
#
void AGarrysGameGameState::SetLevelToOpen(ULevelData* LevelData)
{
    if (IsValid(LevelData))
    {
        Server_OpenLevel(LevelData); // Called by client
                UE_LOG(LogTemp, Warning, TEXT("Opening level by client");
    }
}

void AGarrysGameGameState::Server_OpenLevel_Implementation(ULevelData* LevelData) // Not running
{
    if (HasAuthority())
    {
        UE_LOG(LogTemp, Warning, TEXT("Opening level %s"), *LevelToOpen);
    }
}``` why does the Server function not run? it has UFUNCTION(Server, Reliable) and game state has replicates turned on
#

been stuck on this for hours, seems like game states just throws all my knowledge out the window

sinful tree
#

RPCs can only be sent to the server on client owned actors, so like their player controller, playerstate or their controlled pawn, or a component attached to one of these actors, or any actor that have one of these as owners.

tiny pier
#

what would you suggest to use when using a ServerTravel function?

#

also does the server just not run game state code cuz i tried has authority without an rpc and it never ran it

sinful tree
#

You'd have to make sure the server is running it.

#

In some ways it doesn't really matter where you'd call the RPC, just so long as it is one of those actors. It's probably just easier to put it on the player controller as it's something that isn't specific to a controlled pawn (unless you wanted only certain pawns to be able to execute this command) and it isn't really something tied to the state of a Player.

tiny pier
#

wont player controller cause ServerTravel to be called multiple times since there are multiple instances

solar stirrup
#

RPCs are called on the instance you call them on so no

sinful tree
#

Player Controller 1 on Client 5: Presses Input > Calls RPC to Server
Server: Receives RPC from Client5 on Player Controller 1 > Executes code on Player Controller 1

#

If you wanted the server to do something for every player controller....
Player Controller 1 on Client 5: Presses Input > Calls RPC to Server
Server: Receives RPC from Client5 on Player Controller 1 > Gets All Player Controllers > Loops through > Executes code on each PlayerController

tiny pier
sinful tree
#

Or at the very least, one spawned on the server?

tiny pier
#

dont think it'll change much tho might be wrong

sinful tree
#

It kind of won't... If it's an actor spawned on the server, then hopefully the server itself is managing its state. And if so, then the server should be able to execute what it needs to based on the values it knows.

#

And if it's running on the server, there is no need for an RPC call to the server.

#

Server RPCs are for communicating specifically from a client owned actor to the server.

#

Actors not owned by the client would get the "No owning connection" message if you're trying to call a Server RPC on them.
If the actor is spawned locally on the client then it has no connection to the server normally (you can get client spawned actors to link up with a server spawned actor that isn't marked as replicated, but there's a bit of work to do it).

karmic panther
#

Will AudioCapture component work fine for online voice chat? Because VOIP from advanced session is not working at all for me

torpid whale
#

when my AI attacks me and I am the client, the damage is not recognized, the event is passed first through the server and then through the multicast, is this wrong?

sinful tree
#

If you wanted a damage number to appear, then yea, that'd be a multicast during the point where you're applying the damage.

graceful flame
torpid whale
#

Apply PointDamage

#

And my character have Event Point Damage

graceful flame
#

So on the character being damaged do you have AnyDamage event setup?

graceful flame
#

Do you have it setup to subtract the damage amount from a health amount?

torpid whale
#

i have a print string only in the event on my character

#

and this is not executed

graceful flame
torpid whale
graceful flame
#

okay thats dealing damage and how about for the receiving end using AnyDamage

torpid whale
#

he doesn't receiver either if i use the anydamage

graceful flame
#

I think you might be using the same Event PointDamage twice instead of one on the actor that deals damage then AnyDamage event on the actor that receives damage

graceful flame
#

Then you use the damage float value to adjust health

torpid whale
graceful flame
#

okay I see you have Apply Point Damage but i havent seen any screenshots using the AnyDamage event.

#

AnyDamage deals with incoming damage so you can adjust health values or whatever

torpid whale
#

but i cant use the event pointdamage?

graceful flame
#

Event PointDamage is how you inflict damage

torpid whale
#

And i receive the damage with event pointdamage right?

graceful flame
#

no

#

you use AnyDamage because there can be point damage and others

torpid whale
#

:0

graceful flame
#

so AnyDamage deals with ... ANY damage

torpid whale
#

but if i use anydamage, i cannot acces the direction or hit info

lost inlet
#

well the other type of damage is radial damage, but you kinda get what you're given with BP. it's a bit more powerful in C++

#

but it's a little strange to be using the legacy damage system for new development

#

it was supposed to be removed from 5.0 but Epic got cold feet

torpid whale
#

but

#

the system works in standalone if i use pointdamage and event point damage

#

as client, is not working

graceful flame
#

because its authority only

torpid whale
graceful flame
graceful flame
torpid whale
#

if i spawn 2 clients, the first objetive, doesnt receive damage, but the second client (not objetive) receive the damage if i put the client in the trace of the sword

#

why is that?

graceful flame
#

If you want multiple hits in one trace then use a multitrace

twin juniper
#

Can a listen server be achieved in ue5 (a host multiplayer system)?

worthy oak
twin juniper
worthy oak
twin juniper
worthy oak
twin juniper
lost inlet
#

A little bit ages ago, what do you want to do with them?

twin juniper
lost inlet
#

Then why mention it? The common use cases for them are stated in the article

twin juniper
#

"Common actions performed by beacon classes are to request quality-of-service information, reserve a slot in a game that the client wishes to join, receive a list of the names of players in a game, find out the score and running time of a game in progress, and so on. "

lost inlet
#

Well it depends if you're wanting to do something more advanced than an OSS would typically allow since a lot of querying use cases are already covered

#

But reserving slots for a party is a good one

twin juniper
#

if my game would be on steam, should I still use these beacons?

lost inlet
#

It depends

static charm
#

what is the thign that enabls server to have over cap vips

#

or admins

#

so on a 32 cap server a admin can still join

fossil spoke
#

Private slots?

#

Public vs Private slots.

static charm
#

ark has it

#

no matter what the cap of server was they would let u over cap it if had vips with like 2o ish slots

fossil spoke
#

The "cap" on players is a soft cap.

#

You can set the cap to 100, and only let 20 people in freely.

#

The other 80 slots could be left open to a whitelist of players.

#

Its really up to you how you manage all that though.

#

There isnt really any built in mechanisms for this.

#

As its pretty game specific and difficult to generalize.

glad robin
#

In the OnlineSubsystem I see StartSession() marks a Session as in progress (as opposed to being in Lobby or Pending) but what exactly does this do? Is it similar to GameMode's MatchState? I just realized I was thinking of the GameMode's MatchState when working, then realized I don't really know what this one does, as in my previous version I never called StartSession and it seems to work fine.

twin juniper
#

Is OnlineSubsystem better than beacons?

glad robin
#

I'm havn't really looked at beacons, but aren't they mostly different things (like the point in them)?

twin juniper
#

I'm not sure but I've never heard about OnlineSubsystem, so I'll look into them

glad robin
#

OnlineSubsytem is used to provide clear abstraction to common online functionality across different platforms (i.e. Steam, Xbox, Playstatoin). Then you can use to get access to Profiles, Friends, Achievements and bunch of other stuff from all the different services

fossil spoke
#

@twin juniper You should go through the pinned comments in this channel.

twin juniper
#

yea, I'm just gathering info

fossil spoke
#

Everyone that hasnt, should.

modern frigate
#

Hello! I have a help request. I've read the pinned data, I'm a webdev with 10+ years of experience, and I've been working on single player games on UE. I'm trying to work on an extraction shooter (like Gray Zone Warfare).

I'm still on the planning stage and I wanted to ask how this is usually done when it comes to architecture. I know you can connect databases to UE5 but I'd rather leave all DB related logic to a specific dedicated backend that can scale, and have only game logic on the UE5 server. Is this common and expected, or is it uncommon and I should only use UE5?

I found absolutely 0 tutorials on UE replication + custom backend; it's usually one or the other. For MMOs people use the custom backend, but for games that have "matches" it's usually UE replication. Since I want things like inventory and player progression to be saved, I know I'll use a DB, but I wonder if I can have the player connect to the UE game server and have the UE game server connect to the custom backend?

UE Player >>> UE Server <<<<>>>> Custom backend

sinful tree
modern frigate
sinful tree
modern frigate
# sinful tree So that's just it, you'd have the player connect to the backend first, authentic...

Isn't it the other way around? if the player connects to the custom backend, then the custom backend will need to validate data from the UE player; doesn't the UE server do the validation, if it's written correctly? i.e. if data is correctly replicated on the server, shouldn't that be enough to validate data to the user? because then the UE server would connect to the backend, and the backend would only send/receive data

#

(backend would only accept connections from UE servers)

sinful tree
modern frigate
#

Half custom backend, half UE server. Example: user has a widget that sends username/password. It would attempt to connect to the UE server, which would try to open a connection with said username/password; if it fails, then it returns a message back to the UE player and closes the connection. If it works, then the UE server keeps the connection to the UE player, and every data would come to the UE server, which is then replicated to the UE player

#

so if we have an inventory system, and the player tries to move one item from one place to another, it would replicate to the UE server, which would talk to the custom backend

sinful tree
#

So then the answer would be yes, you're wanting to have an unreal game server running to log players in.

modern frigate
#

yep

#

but I feel like it's just more than log in, no? if we're on a "match", then it needs to do all the logic of replication between the server and other players, but it would also need to save data from the user in the backend

sinful tree
#

What I'm suggesting is that you have a connection to your backend that is maintained on the client but is read-only for most data. That connection is then the stream of data that allows your backend to tell the client what to do and can feed it information before it is actually connected to an unreal game server. This connection can also ping the client from time to time to make sure they're still connected, receive messages (even across servers), or anything else that is a level "above" a game server.

Lets say a player logs in using your method, but doesn't queue to do anything, deciding to choose a character for hours or browsing around on whatever you're presenting them before they're actually playing the game, not idling, but not exactly going in to play.... They're essentially using up expensive server time just so that you can pretty much display them some UI.

If you used my method, you're having them connect to the backend directly (as read only only minimal details are allowed to be manipulated!) and authenticating them, and they can receive whatever data from the backend as needed, and make requests to it, you've authenticated them, so you can display them data relating to their own account. They can also request to join into the game and the backend can direct them to connect to an appropriate game server when necessary. This would typically be far less expensive as it doesn't involve running a server meant to be hosting a 3D video game with replication. An example of something like this could be Dead by Daylight - you're free to mess around with your account, you can see all the characters you unlocked, you can set up what certain rollouts are set up to be for whatever characters, but you're not utilizing an actual game server until you've actually done some matchmaking, found the 4 other players that will be joining you, and the backend launches the game server where they all connect and play together.

modern frigate
#

I wanted to avoid duplicating systems like inventory (because then the data will need to be validated if it comes from the client) on the backend, but now it does make sense why GZW pushes the player directly to an instance before they have access to the inventory

#

I'm guessing from your response that I should try to do as much work as possible on the custom backend since (1) I'll have more control over it and (2) it'll be less expensive for the UE server to run

latent heart
#

Expensive 3d replication... that reminds me of the guy that wanted to replicate a scene render of his inventory to update the client. Shudder

lament flax
#

in c++ server RPCs can only be marked as unreliable ?

#

or is it the WithValidation that is required

chrome bay
#

You have to specify either Reliable or Unreliable

#

WithValidation declares the _Validate() function which you can use to validate parameters and auto-kick clients or not. It's optional

pearl bear
#

Hello, I have a question about multiplayer game development. For example, there is an object in the middle of the game and I want to change the color of this object and replicate these changes. It seems that the recommended way here is to create the OnRep_Color method using ReplicatedUsing and assign a value to the Color variable. Then OnRep_Color will be called and replicated in all clients. I would prefer Multicast RPCs instead, but these calls will not run on people who join the game later. I don't like organizing my game code in a way that directly changes the values of its variables. This both makes unit testing difficult and makes it difficult to read. How do you approach such situations?

thin stratus
#

Hello, I have a question about

lament flax
#

is the playerstate owned by the server or the client ?

lost inlet
#

it's spawned by the server in gamemode, but the player controller it relates to owns it (so you can use Server RPCs)

nocturne quail
#

is this best approach to implement these states using On-Rep?
i'm donig it all the time and it works very fine, but i read an article which says on-rep is expensive for these states, should be using Multicast they says...

    // Crouch/Prone :: [Player State related Area]
    void ToggleCrouch(); 
    void ToggleProne();
    void ToggleSprinting();
    UPROPERTY(ReplicatedUsing = OnRep_IsCrouching) bool bCrouching = 0;
    UPROPERTY(ReplicatedUsing = OnRep_IsProning) bool bProning = 0;
    UPROPERTY(ReplicatedUsing = OnRep_IsSprinting) bool bSprinting = 0;
    UFUNCTION() void OnRep_IsCrouching();
    UFUNCTION() void OnRep_IsProning();
    UFUNCTION() void OnRep_IsSprinting();
    UFUNCTION(Server, Reliable, WithValidation)    void ServerToggleCrouch(bool Value);
    UFUNCTION(Server, Reliable, WithValidation)    void ServerToggleProne(bool Value);
    UFUNCTION(Server, Reliable, WithValidation)    void ServerToggleSprinting();
thin stratus
#

The only thing you could consider is joining crouching and proning into a single enum

#

That has standing, crouching and proning

#

Cause they are mutual exclusive

nocturne quail
#

finally i can continue working with it the correct way

thin stratus
#

Idk what you are exactly coding but you might want to consider putting this into the CMC or use Mover in 5.4.

Cause there you would only communicate the desire to crouch and the CMC would then figure out locally and on the server if you can crouch. And the OnRep would only be needed for the simulated proxies cause the local client would predict the change.

#

But I don't know the requirements for your setup there

nocturne quail
lament flax
#

for some reason, when setting a repnotfy var on server, the onrep is never fired (i have 2 instances of my PS, it should fire once on each client side of the PS)

//.h
UFUNCTION()
void OnRep_CurrentRoutineStateGT();
UPROPERTY(ReplicatedUsing=OnRep_CurrentRoutineStateGT)
FGameplayTag CurrentRoutineStateGT = TAG_RoutineStates_Uncompleted;

//.cpp
// in GetLifetimeReplicatedProps
DOREPLIFETIME_CONDITION_NOTIFY(UPlayerRoutineComponent, CurrentRoutineStateGT, COND_None, REPNOTIFY_Always);


void UPlayerRoutineComponent::OnRep_CurrentRoutineStateGT()
{
    // breakpoint here never hit
}

any ideas ?

thin stratus
#

You 100% sure you are setting it on the Server?

lament flax
#

yes

thin stratus
#

Does a breakpoint hit when setting it and is that the Server? :P

lament flax
#

i can see it in debug string + its called in a _Implementation of type Server

thin stratus
#

Hm, probably something "stupid". Don't see it immediately, sorry

lament flax
#

np, ill find it someday

lament flax
#

so maybe something in DOREPLIFETIME_CONDITION_NOTIFY isnt right

tiny pier
#

i cant cast to my game mode in my game state, it returns nullptr but works fine in solo play

MainGameMode = Cast<AMainGameMode>(GetWorld()->GetAuthGameMode());```
#

called in game state if that helps

torpid crest
#

Is there a way how to debug anim blueprint variables in multiplayer?

In singleplayer I use slowmo command but that one doesn't work in multiplayer 😄

tiny pier
#

anim bp doesnt replicate

torpid crest
#

well variables that drives anim bp does replicate so I want to see if they are being passed correctly to anim bp

solar stirrup
#

cleaner ;3

tiny pier
#

will check if that works

tiny pier
solar stirrup
#

show your code

tiny pier
#
void AGarrysGameGameState::SetLevelToOpen(ULevelData* LevelData)
{
    MainGameMode = GetWorld()->GetAuthGameMode<AMainGameMode>();
    if (IsValid(LevelData) && IsValid(MainGameMode))
    {
        UE_LOG(LogTemp, Warning, TEXT("Opening level %s"), *LevelToOpen);

        LevelToOpen = LevelData->GetLevelName();
        MainGameMode->OpenNewLevel(LevelToOpen);
        GameInstance->SetCurrentLevel(LevelData);
    }
    else
    {
        UE_LOG(LogTemp, Warning, TEXT("Level or Game Mode Invalid"));
    }
}```
solar stirrup
#

you're probably calling this on a client

tiny pier
#

thought game state was ran on server

solar stirrup
#

on both

tiny pier
#

how do I get it to be ran on server

#

cuz yesterday i was told server RPC doesnt work on game state

odd iron
#

Hi guys , is it possible to keep same player controller presist on seamless travel ?

dark edge
#

transmitting data from clients to server goes through actors the client owns

#

Their pawn, their playercontroller, their playerstate

tiny pier
#

yeah question is how do I call it on server

#

if it runs on server it should be callable on server

pallid mesa
#

Anyone here tried the resimulation physics replication mode in the editor? My physics controllable objects get through geometry at times when i dont run it in single process (open the thread for a nice story with a conclusion)

urban crystal
#

I've researched how hit reg in games like valorant and CS work with rewinding time to the game state that the shot happened. Is there any good resources on how to actually implement that because I don't understand how they would properly store the character's poses and how to accurately get a synchronized clock in order to send timestamps from client to server.

pallid mesa
#

no, but intuition works really well most of the times LOL

urban crystal
pallid mesa
#

it depends on the problem, really

pallid mesa
#

but no you dont send box data, in this model you only send a timestamp of when the shot happened

#

and you have an array on the server with where the bounding box of the actot was at a time

#

so since you send your timestamp... the server can know where that client was at that time

#

take a read and u will understand it better

urban crystal
#

so we're trusting the client that they hit the enemy as long as they hit the bounding box of where they should be?

pallid mesa
#

yes, we only validate the shot if it falls within the box, yep

urban crystal
#

cool

#

I don't need to get any more specific about it than that for my game I think.

pallid mesa
#

you might not even need this

#

u can do a simple distance check, depending how arcade-ish ur game is

urban crystal
#

im trying to make it pretty competitive so i am caring about stuff like this.

pallid mesa
#

ah perfect then you can start with this 👍

#

and you can do another layer of validation for headshots with extra math (as heads will usually fall on the upper part of the box)

urban crystal
#

would that be second bounding box?

pallid mesa
#

no... you can simply validate heads hits if the hit falls within the upper part of ur box

#

it isnt as accurate as CSGO or Valorant, but building a solution where u have animation determinism is very complicated

#

and timeconsuming

urban crystal
#

yeah this game's gunplay isn't as tight as something like csgo or valorant

#

mine is closer to something like overwatch

pallid mesa
#

:) good luck with it and happy deving

urban crystal
#

thanks

quasi tide
pallid mesa
quasi tide
karmic panther
lean cedar
#

Hey, I have a simple VR Basketball game and now the client is asking to add "multi-player" he basically wants to be able to sync local players score and to be able to have all the players play the game stating in the same time and use the same difficulty level. What would you suggest for that? I feel like the unreal multi-player system is an overkill for something this simple. BTW I don't have any experience with UE multi-player

#

I was thinking about make the game run an http server to receive some messages like score update, or start game. The client is already developing a standalone application to create the game session, so he would call my http server

#

Another option would be using something like socket.io idk

fossil spoke
#

Also kinda sounds like hes just asking for a Leaderboard?

#

Sounds like all hes asking for is that Score be pushed to a DataBase somewhere?

twin juniper
#

Waht do you mean by a 'http server'?

I've done a leaderboard once and it was just a data base on a backend platform, I still don't know how to create your own backend thing...

fleet scarab
#

How can I replicate things like the relative rotation of components to clients in a 'Join in progress' state?

The clients eventually sync their rotation given the correct rep notifies eventually fire, but it would be good to start everything in the same rotation.

#

I'm using blueprint by the way, if that matters :)

dark edge
fleet scarab
dark edge
#

i mean 0.1s, 1s, 100s?

fleet scarab
#

Well in this case, I have a arrow component rotating inside my actor, and I want the rotations to match. At the moment I can't get it to sync to the server when the client joins, it just seems to act its usual client side manner, starting its rotation where its initially set

#

thats my bp (just trying stuff out atm)

#

and the rotation diff

dark edge
#

what does the repnotify do?

fleet scarab
#

its just for testing

fleet scarab
# dark edge what does the repnotify do?

I currently don't have it doing anything

If I set rotation in there, then it'll update rotation every frame, which leads to hitching etc with packet loss and latency

dark edge
#

You aren't doing yourself any favors by havnig the mesh rotate completely independently on all machiens

fleet scarab
#

my thinking is if I can sync that initial rotation, the client can handle the rest

dark edge
#

How do you even know if it's in sync right now? The mesh rotation isn't synced. And you haven't shown what the repnotify does

#

Also what's the update frequency on this actor

#

Is arrow attached to static mesh?

fleet scarab
dark edge
#

show the component layout, what the repnotify is doing, and the actor replication settings

fleet scarab
dark edge
#

you aren't doing anything on rep

dark edge
#

First off, remove the rotation of the mesh. Just rotate the 1 synced thing. Right now your mesh is rotating at different speeds AND starting at different times relative to the arrow. You wouldn't even know if the arrow was synced because the mesh rotation is so out of sync.

#

You don't need a repnotify here, just a replicated variable.

#

And you'll need to implement some smoothing if you want it to be butter smooth. A decent approach might be this.

Tick -> has authority? -> yes -> Thing.Yaw += Speed * DeltaSeconds -> set ReplicatedYaw
-> no -> Error = Thing.Yaw - ReplicatedYaw -> Thing.Yaw += Speed * DeltaSeconds + SomeSmallNegativeNumber * Error * DeltaSeconds

fleet scarab
#

Is there no way to just get the rotation on join and let it run from there?

dark edge
#

don't take my math at face value but something like that is the general form for smoothing

#

I mean sure, but you aren't guaranteed to be in sync, what if the first packet on join is late?

#

Do you care about the speed or the angle or both?

#

If it's just angle and isn't constantly rotating, the typical approach is to interpolate towards a replicated TargetValue

#

you'd do that for AimDirection for example

#

networking is hard as shit, the speed of light is a bitch

fleet scarab
#

hm gotcha. I understand what you're getting at - is it standard to use lerping to replicated values?

dark edge
#

Depends, that won't be great for something that's meant to continuously spin smoothly

#

also if it's really high frequency you might switch to using multicasts, depends on the use case really.

fleet scarab
#

Assuming I'm doing the rotation using detla time, one thought I had was just checking the replicated value against the current and if its above a threshold, just kicking it back into place

dark edge
#

There's a ton of approaches, it's all really dependent on what state of the thing you really care about. Look into the physics replication stuff, they do a lot of smoothing and interpolation and extrapolation

#

if you know it'll always go at some speed, the approach there will be very different from if you don't know what speed it'll be

#

It's all basically PID controllers though at the heart. Calculate some error, and do math on that error to feed into your update of the thing

fleet scarab
#

I currently have turrets in my game that use a pseudo PID controller, instead of feeding clients the server turret rotations, I just tell the client the target

#

and when its locked on, I just send through the rotation to make sure the client hits its mark

#

its seamless enough, even in bad network conditions

dark edge
#

Just telling the target should be enough for that situation. Are the turrets predicted or do they only fire after a round trip to the server?

fleet scarab
#

round trip? if you mean this, it's all server authoritative, client side turrets are almost entirely cosmetic

dark edge
#

I mean to fire a turret, what's the chain of events?

#

does a player fire them or do they have some rudimentary ai

#

is the projectile replicated or is it launched and flying locally on all machines

fleet scarab
#

it's ai, it finds a valid target in range, (that is replicated to clients), everyone points to the target, when the server turret is within a cheese aiming threshold, it fires (rpc multicast)

#

hitscan for now, projectiles in the future

dark edge
#

most of the time the server and client should agree on the turret direction at time of firing

#

but you can always include a direction vector in the fire multicast

fleet scarab
dark edge
#

I wouldn't mess with the turret rotation, just use that direction as the firing direction

#

the turret shouldn't be more than a few degrees off from that unless there's some big time problems

#

Check on your replication frequency though, there should not be much of a delay at all from server to clients beyond ping

fleet scarab
#

yeah I actually noticed that in my testing.

That rotating arrow from before is a god target, and I noticed my turret was bugging out on the client side (that on fire rpc made it flick to the target for one frame then back to its client side target the next). 5 minutes later I realised it's because the rotation of the target isn't synced between client and server, causing that aiming discrepancy

dark edge
#

and since it's all ping delayed they should all more or less see the same thing, just at different times

fleet scarab
dark edge
#

yeah I'd just multicast the projectile initial conditions. I'm working on a projectile system right now that basically just relies on predictable flight and replicated initial conditions

fleet scarab
fleet scarab
#

Okay, I think I found a really good solution

#

both client and server assumes its rotating correctly

#

but the client uses a lerp to smoothly match up to where the server is. so it will probably be a little tiny bit behind, but visually it's very hard to tell looking side by side

quaint tendon
#

How do you reduce the position correction for latency like in Fall Guys? i.e. make the CharacterMovement component not adjust the position as much when the ping is bad?

dark edge
#

I mean they already move like shit, what's another 30 ms of lag

quaint tendon
#

It works for that style of gameplay though, where most of the time is spent not interacting with the other players. Don't need the accuracy. It's like a pseudo-pvp style of networking. It sucks if it's meant to be competitive but Fall Guys isn't an esport game. Neither is my game. There's so much going on having the latency corrections is jarring.

modest crater
radiant grail
modest crater
#

What is the uclass equivalent to NetSerialize for structs? I basicually just want to perform some compression on some data before/after its replicated

chrome bay
#

There isn't one

#

UClass's aren't sent over network like that

modest crater
#

So there is no way to way get to the data before sending it?

chrome bay
#

only properties are sent so if you want to do custom serialization you have to wrap those properties into a struct

modest crater
#

thats what I was afraid of haha, alright i'll have to keep dealing with what I have,

Appreciate it

queen escarp
#

hey this is probably not Multiplayerrelated but

#

but could be realted

#

im spawning an actor "FROM PLAYER CHARACTER"

#

but on the spawned actor

#

its failing ot cast to the owner ?

dark parcel
#

Instigator != Owner

neon summit
#

I believe thr owner would be the controller

ashen plume
#

i was looking through lyra to find out why its movement is so much smoother than the default third person template cmc, but it doesn't really seem to do anything but replicate acceleration and overwrite the simulated movement, which the docs say cmc does out of the box, is this just not true?

rough kestrel
#

Has anybody implemented Vivox for Unreal Engine?

I made my plugin to use Vivox Core but for some reason it stopped working recently.

Any chance this error my be the reason since I get all the logs for token and connection success, the portal shows the user did indeed connect to the server.

VivoxCore: INFO: RTP(0), [::init_connection] Not binding local port

neon summit
#

What would be the best method to attach character mesh in a vehicle in a multiplayer scenario?

lean cedar
#

of the players that are playing locally

lean cedar
coral badger
neon summit
coral badger
#

Just attaching the meshes wont work, since both the vehicle and the character are still networked as separate objects. The network does not know about 'attachment'.

neon summit
#

yeah I not sure how to handle attaching in a network environment. I have this issue with my tractor beam ability too

coral badger
#

The rotation of 90 degrees is a different issue though it seems.

neon summit
#

yeah i have no idea why rotation is different

#

character and scene component both y forward

coral badger
#

If you are using a modified template character blueprint, then the mesh in it is usually turned 90 degrees, so might be it resets to that somehow after the animation.

neon summit
#

wym modified template character bp?

coral badger
#

When you open your character BP, does it have a 90 z rotation on the skeletal mesh component or the root or somthing?

neon summit
#

yeah

#

hm why would it reset tho

coral badger
#

does the animation finish when you have unpossessed the character?

neon summit
#

its just a pose basically its just that position

#

but yes it keeps playing

#

I made it with control rig my first time doing any anims so maybe I did something wrong

coral badger
#

Yeah, can't really help with that one. But what does jitter look like?

neon summit
#

there's no jitter anymore after disabling cmc

coral badger
#

That makes sense yeh

neon summit
#

only problem I have now is the rotation and position of the character not being correct

#

and handling exiting vehicle of course

#

I already have it working perfectly just wanted to put the character in the car rather than making him hidden in game

#

I feel like I might need to make a skeletal mesh component in the car then set that seperately from the character and just set the actually pawn hidden or something

coral badger
#

Not really sure what the best practices for this are. Have you logged the positioning on the client and server to see where the divergence happens?

neon summit
#

but I think my animation the character is above the root and when attaching it attaches to root and thats why he's above the car at least on server side

#

I'm not sure how to log that tbh. I haven't done much with profiling etc.

#

do you mean with unreal insights?

coral badger
#

No, I mean just printing it, but it does look like the root positioning might be the cause.

neon summit
#

Changing root of animation helped alittle.. still rotation problem and server being in the air.. sigh

#

its weird how the client sees correct position while server doesn't. You'd think it would be other way around.

crisp shard
#

Does anyone recommend against using SQL dbs for storing player data and things?

naive umbra
#

I am playing the level as server. If I'm using TP character it seems fine but when I am using UFO character client UFO is not there

#

can anyone help

coral badger
neon summit
#

Is ufo set to replicate all the basic stuff?

naive umbra
neon summit
#

Did you fix it?

naive umbra
neon summit
#

Open bp and check replicates and replicates movement that'd be start

#

I assume it's just a pawn class tho

naive umbra
#

wait let me check

naive umbra
#

I'll talk to you later

#

When you'll be free?

neon summit
#

Alright I'll be free later.. I'm bout to head to bed. Did setting replicates check mark on class defaults do anything?

#

And make sure net load to client is checked too. I think it is by default tho

naive umbra
neon summit
#

Vc?

naive umbra
queen escarp
naive umbra
#

I'll share screen

queen escarp
#

hey im watching a tutorial on how to use a click to move settup

naive umbra
#

And explain everything

queen escarp
#

but this "unposses"/posses" after each click

#

must be really wrong 😮 ?

neon summit
#

I won't be able to do that til Friday

naive umbra
#

We'll discuss on chat

kindred widget
grizzled flicker
#

So I have a ball. A ball that gets hit by things. It replicates relatively smoothly in editor , but upon packaging and using a dedicated server it’s choppy/laggy

#

Idk if I’ll ever solve this one , is it just a matter of upgrading to a better server or is there some code I can add to make it smooth?

gilded vapor
#

unless you want to handle the replication yourself

#

probs a ProjectileMovementComponent would work?

grizzled flicker
#

Interesting thx

queen escarp
#

why dose not AI moveTo Work on Clients ?

#

i unposses before executing

tidal swan
#

if a dedicated server is built from the same source state, but from a different engine, am I going to get "client/server version mismatches"?

trim plume
#

Hi.
Does anyone know how to replicate the motion matching trajectory?
I tried this, and it partly works. If locally controlled, set the replicated variable, and in the anim bp, if locally controlled then use the trajectory directly from the trajectory component, but if not locally controlled, use the replicated trajectory.
Listen server to client works, client to client works as well, however, when it's the clients to the server it does not. Then there's some stuttering/lagging happening with the animations..
Anyone has any knowledge of this? Or can guide me in the right direction?
Any help is greatly appreciated.
Best,
Matias

fierce egret
#

I need replicated objects and dont want to use C++. Can i use actors instead of objects? After all, gamemode is also an actor, but it can be used without being spawned. I just wonder if it will be a problem in terms of optimization.

sinful tree
queen escarp
#

@sinful treeok any way to enable it or ?

sinful tree
#

Yep, project settings

queen escarp
#

orly

#

whats it called ?

sinful tree
sinful tree
queen escarp
#

allow client side navigation ?

#

ive already enabled that :/

fierce egret
sinful tree
#

No. It's per actor, not per connection.

queen escarp
#

problem is it needs AI controller :/ ?

sinful tree
queen escarp
#

yeah that says it needs a AI controller

#

how can i get the player to act on it ?=

fierce egret
#

Well, then... I have an object which is created on server side and reference is none for all clients. Can a client read variable in this object in a user widget somehow?

sinful tree
thin stratus
#

and dont want to use C++
🙃 You gotta though.

sinful tree
# queen escarp how can i get the player to act on it ?=

Assuming you're using "Character", rather than using the MoveTo, set the location as a destination, get the direction from the character to the location, then use the direction and you can then use tick to add movement input to the character.

fierce egret
thin stratus
#

Then make it a plugin

#

Selling a Multiplayer Project on the Marketplace that hacks around to bypass C++ is really shite

fierce egret
#

It's a really big asset with hundreds of functions and I don't know enough to convert it to c++ right now :/

thin stratus
#

Buddy, proper Multiplayer needs C++

#

Then make a Singleplayer Asset

#

Also I'm relatively sure you can add C++ to normal Projects too now-a-days

#

And Plugins can have content fwiw

queen escarp
#

@sinful tree hmm but is there no way to use the ai move to :/?

fierce egret
#

The single-player inventory systems are really not in demand 😄

thin stratus
#

But a Multiplayer Inventory system by someone who doesn't have the C++ knowledge to do it properly is? 🤔

#

A proper Multiplayer Inventory usually uses UObjects, paired with FastArrays

#

And that's C++ land

#

Pretty sure you'd want to sell high quality assets or? :P

sinful tree
thin stratus
fierce egret
#

I'm not doing a massive multiplayer project, just an inventory system. Should I not sell anything if I don't know enough C++

thin stratus
#
  1. That's not what I said
  2. Inventory Systems are very complex, especially in Multiplayer
  3. The tools to make this, especially properly extensible for endusers, require C++
queen escarp
#

@sinful tree hmm

thin stratus
#
  1. You are free to ignore me and make a BP only one and sell it. Ultimately your call
fierce egret
#

There is no way i can use C++ right now, so it doesnt help my problem at all. But thanks for your advice :)

thin stratus
#

The point is that what you are trying to do would require C++. You can spawn thousands of Actors to have replicated data for your items, or whatever the idea is, but that's not the correct way and clocks up the ActorChannels and what not.

  • You can't stop them from replicating to everyone... without C++.
#

The only other option you could choose is to use InstancedStructs, but those aren't as versatile as UObjects

fierce egret
#

I use Structs and the whole inventory system is replicated. I had a moment where the client needed to be aware of a variable in the object. I think I will follow a different way for this.

Apart from that, probably someone who wants to use the inventory in a really big game is aware of using blueprint for this is not right. I'm just aiming to help people with inventory with an example created with a blueprint

undone needle
#

So I'm using lag simulation to confirm my slot inventory system is working properly. One thing I realized is that I want to prevent a player from sending over several server request for the same thing if he's lagging. A Simple solution would seem to use a local boolean, but I dunno, something feels odd about that, can't quite put my finger on it but feels like there must be a more elegant way?

formal solar
#

Hi guys, little confused here. I have an animation setup as follows: when the player presses a key, I do a server check to see if an 'input allowed' bool is true, if not then I set it to true and multicast a transition to a sting attack animation in my anim BP. The sting animation has an anim notify on the final frame which first turns off the bool corresponding to its own attack animation and then sets 'input allowed' to true, via a server function in 'pawn owner'.

This all works ok unless the player spams the attack button. If I attack just as the attack animation ends, what I think happens is the 'input allowed' is set to true but the animation is not registered as being complete on the client pressing the button, so changing the animBP state does nothing, so the animnotify doesn't fire either, the result being the character just permanently freezes.

I can get round this by adding a 0.2 sec delay into my animnotfy, but I don't really want to a) because it disrupts game flow and b) it might not work in a very laggy/ high ping environment. I just want to understand what is going on, my understanding is that animnotifies will call locally on all clients that see the animation (I am using listen server model) and I am multicasting every state change.

dark edge
#

The simplest way to get it in sync is something like this:

Press key -> tell server

Server then handles it from there, multicasting to play the montage if allowed to

#

but that'll have ping delay. Getting around ping delay is an entire topic of itself.

undone needle
unique ferry
#

Is this multiplayer friendly? It has timers 😨

#

I am using this as opposed to a delay, which are a big no no apparently

tiny pier
#

was building servers for an update and got this pop up

lost inlet
#

Well time to rebuild the server binary then

tiny pier
#

did that

vital furnace
#

Good evening. This message is a request for help addressed to experienced developers working with Unreal Engine. I am currently working on a multiplayer soccer game (similar to Rocket League). I’ve developed the multiplayer aspect using the Steam plugin and some YouTube tutorials, but I’m facing challenges because I’m trying to do something different from what I see in those tutorials.

The issue I’m encountering is that I want to organize players who join the game into teams. One idea that came to mind is to create a variable within the Extra Settings that serves as a counter for each team. Another idea was to create an array of Player Controllers for each team. However, I’m unsure how to modify variables within the Extra Settings once the session has already been created.

I would appreciate hearing about your approach to solving this problem and, if possible, any blueprints, videos, audios, or links that could help not only with this specific issue but also with the broader scope of the project. 🎮🚀

sinful tree
# unique ferry

You can use delays, but it depends on what you're using them for.

unique ferry
#

what do you think, would it be acceptable to use a timer for this situation? I would like to ensure that I am doing it the proper way

sinful tree
#

Using a timer would give you a bit better control, like you can pause a timer or invalidate it. A delay you can't.
I'd also recommend using only "Set Timer By Event" as it avoids typos or issues when you may rename a function. You can connect a "Create Event" node to the red square delegate pin and then select a function you want it to call, so long as that function has no inputs, it should be in the list available.

valid frigate
#

Hey, I have the problem that when the listen server tabs out of the Unreal application, the server's performance deteriorates significantly, and clients even get disconnected. Is there any way to force the server to maintain its performance consistently?

glad robin
#

I'm working on friends list stuff right now and is there a way to get access to steam in the editor without having to package and test every time?
Edit: I'm so dumb. I forgot I never activated the plugin, doing that lets me test without packaging haha.

sinful tree
glad robin
#

Swear I tried that and didn't open but maybe I'm crazy will retry haha

#

Nah I'm not crazy aha doesn't open

robust ridge
glad robin
#

It only opens in packaged not regular standalone I've accepted haha

#

Package time not even bad rn so I will live lol

neon summit
#

Should work just having steam open and playing in editor

glad robin
#

Hmmm, well any idea what else could be stopping it?

neon summit
#

Maybe a setting in ini file but idk should just work

robust ridge
#

I know that I had to tinker with the config file for the steam sessions plugin I believe, I had to add a few lines to get it working, not sure if thats the problem though

glad robin
#

This is probably a dumb question but I don't fully undestand something with Session vs Lobby. I get that Lobbies are like session but the stuff like member list and member data is automatically kept in-sync for all clients who are in the lobby whereas session's dont auto sync player lists from host to client but what does this mean?

WHy one instead of the other?

woven basin
sinful tree
# glad robin This is probably a dumb question but I don't fully undestand something with Sess...

This may not be accurate, but it's how I understand it...
A lobby is something you'd join before having all the players join into a session. This allows you to know some details about the players who will be joining you in the game before an actual game is launched. When all players are ready, the session launches and all those in the lobby would join the session. When the session ends, you could have it so the players that were in that lobby still remain in the same lobby and launch another session.
This then means that a session is useful for something already in progress, and if you're connected as a client to the session, then you would have access to the replicated data in the session anyway. A lobby then is useful for retrieving some minimal data from other potential players without having to join into a game server.

plucky pewter
#

Anyone have any familiarity with playfab?

lost inlet
#

Sounds like asking to ask

glad robin
fallen brook
sinful tree
# fallen brook https://discord.com/channels/187217643009212416/221798862938046464/1235758644092...

This isn't what will fix your problem, but this coding is bad.
You're effectively causing something to fire every single frame for every character, and will continue to do so on characters that are not possessed by the local controller.
There is an event on pawns called "Receive Controller Changed" this gives you a reference to the controller possessing it. You can first check if it is a player controller, and then check if it is locally controlled. If locally controlled then you can add your mapping context. Doing this will remove the need for you to multicast on that event, and it will ensure the mapping is added appropriately without having to continually loop.

#

On to your actual problem, are these player characters just placed in the level?

fallen brook
fallen brook
#

the issue only occurs client side as the server side will rotate correctly is they chose that location

#

I may just forget this logic and just spawn the character when the player joins and move them into position when they are ready, placing a "dummy" in place of the actualy character

#

basically skipping the possession

sinful tree
#

You may need to set the control rotation of their player controller as well.

fallen brook
sinful tree
#

It needs to be set on the owning client

fallen brook
#

Should I set that before or after possessing?

#

I’ve tried calling the set control and possess in a Multi cast which didn’t seem to do much different

sinful tree
#

Not sure to be honest. In the default game mode it finds a playerstart and automatically spawns the default pawn in the appropriate rotation and I imagine adjusts the control rotation too.

#

You probably want to use the "Receive Controller Changed" to do it.

fallen brook
#

Curious as to how it would be done if the player entered a “vehicle” wouldn’t that use possess and have a similar logic to what in doing? Oh well I appreciate the help @sinful tree I will mess around a bit more tomorrow but will most likely trash this settup lol go an easier route

naive umbra
glad robin
glad robin
#

Is it just the character isn't showing in the outliner?
Because there is this setting that needs to be switched

naive umbra
glad robin
#

When you choose world Server do you see both characters? and then client do you see both?

#

Replicated asdnoanalksd