#multiplayer

1 messages ยท Page 238 of 1

round glacier
#

Here is the listen server client's perspective

#

So client sees self (local): C_0 (GUID 272) and other client (simulated) C_1 (GUID 271)
Listen server client see self: C_0 (GUID 271) and other client C_1 (GUID 272)

tardy fossil
#

yeah the names can be different for actors that are spawned

grand kestrel
#

Nah I can see how you'd do it
But tbh I don't have a reason to use it anymore ๐Ÿ˜„

pallid mesa
#

and i applaud you for making ur efforts public ;3

meager heart
#

Checking in with this again, I tried replicating a single object property and am still getting the same issue

Does anyone else have experience in replicating dynamically constructed objects? The docs make it seem pretty straight forward using the registered suibobject list but all of my uobjects are nullptr on the client

This manager actor is marked as always relevant as well

meager heart
sonic obsidian
#

Are replicated variables always ready on begin play?
if a spawn a actor on the server and set one of its replicated variables that were exposed on spawn, when begin play fires on the client will that value from the server be "ready" - Replicated

#

Basically are all properties marked for replication sent from the server to the client as part of the actors initial replication

thin stratus
sonic obsidian
thin stratus
sonic obsidian
thin stratus
sonic obsidian
kindred widget
#

Where did you verify it with prints? Because CurrentBloom is not replicated.

toxic lion
#

I'm having issues with UObject duplication
I have editor instanced UObjects that I'm trying to duplicate in an RPC
but when i do so, they don't get properly replicated to the client

It does replicate to the client if I simply create a new object, so I'm guessing there are some internals that aren't being properly set when duplicating the object

#

When it's duplicated, I'm calling AddReplicatedSubobject on the owning component, and uobject does overried IsSupportedForNetworking

mild sonnet
#

How would one do multiple maps and multiple modes without manually creating every combination of mode and map? Or would the "mode" be handled by something besides the gamemode class?

kindred widget
toxic lion
dark edge
#

idk why people insist on items being UObjects

#

just keep it data

kindred widget
#

That would be perfectly fine. But you have to duplicate them on the server.

#

Personally I'm all for UObjects as items. I coded mine that way. The UObject is just runtime data though. It houses a pointer to a data asset for anything static that doesn't change.

toxic lion
#

so i built them to be modular. I can add or remove modules instead of subclassing
for instance a durability module that stores max durability, and current durability

#

if i store that data in the DA, how would i go about actually using that in the uobject wrapper?

#

rooThink1 actually my modules are currently subobjects that don't really need to be uobjects. It may work if instead they're just structs, and i copy them over to the wrapper uobject

kindred widget
#

The DA would store Max Durability and a default durability stat. When you instantiate the object it has all default stats set. Static stats like maxes that never change you read from the DA, changing stats you read from the object. Easy enough with a Check object for state, if it doesn't have it, check the DA.

#

How you define your stats is up to you. You can do it as simple as a GameplayTag/Float. I do another DataAsset/Float. Cause that item stat has a lot of data associated with it too. Name, Icon, description, etc etc.

toxic lion
#

yeah that's smart. thanks for the tip.

#

gonna see if I can rewrite the system a bit smarter using the DAs as read only data

unkempt tiger
#

Is there some command I can use as a client to reconnect to the current server for debugging purposes?

mighty valley
#

A guy earlier told me not to have a replication here

dark edge
#

you really need to not have stuff coming from 2 screens away, it makes it impossible to follow

thin stratus
#

That != check is strange

#

Unless that current weapon is an asset and not an actor

mighty valley
mighty valley
thin stratus
# mighty valley

Yeah, unless (locally) disabled, Tick will run on every instance of an actor.

mighty valley
#

Oh

#

So, what you mean is that every tick, it's running this code on every BP_ThirdPersonCharacter?

dark edge
#

Which can be fine

#

you would be locally updating bloom everywhere, independently

#

which could be fine

mighty valley
#

Yeah, just tested it, not what I wanted at all

dark edge
#

I mean your other option is to get delayed bloom values from server that aren't butter smooth

#

it's up to you

#

nothing about multiplayer is easy

mighty valley
#

This isn't at all what I am asking for

#

I am asking to show the bloom on the crosshair

dark edge
#

When does the shot happen, after a round trip from server or instantly on your screen?

mighty valley
#

I am the biggest idiot in the whole world

#

It was working this whole time

#

My second client screen was too small to show it

#

I am so sorry to have wasted your time

dark edge
#

classic

mighty valley
#

The good thing is that I can laugh at my own mistakes

blazing spruce
#

I made it so that when the player tries to join the session it finds sessions again and checks if the session the player is trying to join is contained in the Results output before letting the player join the session however I don't like that it needs to find all sessions and then check if its contained in the Results, i'd much rather just search for the exact session the player is trying to join if its possible.. I'm using Advanced Sessions so the Find Sessions Advanced node has a Filters array input, anyone know how i can use this to make it filter for the session the player is trying to join?

#

There is a 'Get Session ID as String' node but i dont know how i can use that to pass in as a filter to make it only search for that exact session id?

wet crypt
#

Hey any idea how can i replicate this

#

this is for a jumpscare animation with blend camera but it only works on server , when this event is triggered by client it effects the server

lethal wraith
#

Hey, I was wondering. Imagine I have two players who pick an item at the same time. Both clients send that information to the server, however client 1 request arrived at the server first and the server proceeds to delete the object. After some time, when client 2 request gets to the server and the server tries to delete that object. Will that cause an error in the server or will the server just ignore it?

#

I was thinking about implementing lag compensation for this. But being a coop game I dont think I should worry too much with fairness.

So I maybe I could just hide the objects for the other clients and delete after some ms? However this still doesnt solve my problem, because that can still throw an error if the client 2 connection is really bad, unless I make the server ignore requests that were sent 1s ago for example.

thin stratus
thin stratus
#

If cheating doesn't matter to you then that's fine i guess.

#

And about the delay, you'd want to ensure the object is valid before access it.

thin stratus
#

Also strange that JoinSession succeeds.

lethal wraith
thin stratus
#

If it's a replicated actor that is picked up then the second client will pick up a nullptr ulimately

wet crypt
lethal wraith
#

I mean, I use pickups with line traces, when the player pickups i just hide the object on the client

thin stratus
lethal wraith
#

and only add the item to the inventory after server response

thin stratus
#

You add the item locally?..

lethal wraith
#

nope

thin stratus
#

after server response
sounds like that

thin stratus
#

Not surprising that it only calls on the Server

lethal wraith
#

well, thank you very much

thin stratus
#

Only if that returns true you do your jump scare.

#

That makes sure it only triggers for the player that triggers the hit

wet crypt
#

So here's a Chasing Code For ai the problem is it only chases the server and ignores the client any idea how to fix it

thin stratus
#

That will always return the Server's Character

#

You probably want to make use of the Actor pin of your function?

#

Like , isn't that the sensed one?

wet crypt
#

You mean this right

thin stratus
#

Yeah. I assume that's the actor that got sensed

wet crypt
#

alright let me give it a try

thin stratus
#

Like you currently check if the actor that was sensed is the server's character

#

Not sure why

#

You can probably remove that branch and just use the Actor variable for the Select Object?

wet crypt
#

thats probably cause i have 0 knowledge in ai stuff and looked up a tutorial

#

and the problem is solved but ai just changes targets but

#

im gonna fix it with

#

blackboard etc.

#

thats another story

thin stratus
#

Yeah you need to add some logic so it doesn't change every time this triggers haha

wet crypt
#

thanks man you helped me a lot today

#

have a great day

tacit furnace
exotic wasp
ripe lotus
#

thanks a lot man, i'll try again on monday. i'll try with your sample. thanks so much.

nova wasp
#

APawn::GetBaseAimRotation should get remote pitch

cold cipher
#

for some reason the game after using servertravel the host was sent back to the menu

I confirmed the server travel did run
also had steam plugins
while my backups not long ago doesn't have the same problem, while having same blueprint for server travel
can anyone help?

#

even if only host is there this problem still persisted

grand kestrel
#

@nova wasp@pallid mesa this is with bOrientRotationToMovement = true and bUseControllerRotationYaw = false and my new bRotateToLastInputVector = true with the actor TIP ๐Ÿ™‚
And with 0.01 MaxAcceleration so he doesn't move lol

#

For this kind of movement mode I typically add minor turns, like even a 15 degree turn
You can generally just blend turns to get the exact size you want, e.g. a 60 degree turn blended with idle at 0.5 = 30 degree turn, or 180 + 90 turn at 0.5 = 135 degree turn
With this I just have Lyra's 90 and 180 anims

#

These are the params you get
And ofc it supports multiple stances/states

#

You can use the starts and pivots in CitySample (or any if you extract the root motion) and it will let the BlendRotation curves interpolate away the TIP, for animation accurate starts/pivots

#

So unlike Lyra's bUseControllerRotationYaw only TIP, mine supports bOrientRotationToMovement and bUseControllerDesiredRotation as well

bright summit
#

when profiling on built game with steam sessions active.. is it steam ID or what? it looks like steam ID

#

yep this is steam ID

bright summit
#

ok I am wondering what can be causing it. In one video you can see physics being synced on ~10ms ping at the BEGINNING of play. It looks ok, but after some time playing at the same ping it is getting more and more laggy. What can be causing this? where to search for the issue?

split siren
bright summit
#

can I check phys corrections like cmc?

split siren
bright summit
#

it looks like it is not updated frequent enough

tardy fossil
#

Sun stepping on?

#

Also substepping

bright summit
#

yeah I have substepping on

#

also I AM NOT USING ASYNC PHYSICS

#

p.ShowNetCorrections shows for physics some white lines and I assume they are indicating that where physics was updated

bright summit
#

Ok I think I fixed that by slapping Predictive Interpolation to the static mesh BUT. When chaos object is getting fractured the huge lags come in to the physics replications, that's the issue for now

tardy fossil
#

ah, I havent messed with replicated destruction much unfortunately

bright summit
#

it looks like it's eating so much bandwith

#

but only one fractured object?

#

when I looked into profiler - it is the most eating bandwith object

unkempt tiger
bright summit
#

as you can see when fractured object gets deleted replication is smooth again

unkempt tiger
#

seems a bit jittery even without the fractures

bright summit
unkempt tiger
#

you should definitely test for jitters with around 50-ish ping at least and say 1% packet loss

bright summit
#

lol I know

#

but I turned it off to find the issue with so much lagging after fracturing the object

unkempt tiger
#

ah gotcha

#

yeah the fractures should definitely not be consuming so much bandwidth, idk why fracture replication isnt turned off by default

#

each piece is incredibly insignificant, not to mention stationary

bright summit
#

it is turned off by default

unkempt tiger
#

oh ok

bright summit
#

but I propably have somewhere fractured pieces replication enabled

#

because I was playing with it sometime

unkempt tiger
#

how many physics objects do you plan to support in your game?

bright summit
#

don't know yet, that's the reason I am checking the possibilities of replication KEKW

bright summit
#

I have smooth sync plugin bought which can fix this easliy

unkempt tiger
#

ideally, it shouldnt be jittery with fluctuating 150-300 ping and 2% packet loss

bright summit
#

I am asking about default behaviour, not implementing interpolation, predictions. Only using built-in UE things

unkempt tiger
#

oh, i dont know

#

this entirely depends on which replication solution is being used, the forces applied on the actors, etc

#

i see your player is also grabbing objects

#

that means that indeed some kind of prediction is preferable

#

and most solutions to predicting a replicated physics object introduces jitters

bright summit
#

yeah turned on fracutred replication and it is ok

kindred widget
#

Would someone happen to remember how to pull a user's avatar image generically from their user info? I recall looking this up at some point, but I seem to be having difficulty finding it again.

grand kestrel
#

I assume they use Lyra method
But if its different then sure

wet crypt
#

Hey does anybody know how to make multiplayer compatible level streaming , the level streaming should be rendered for each client individualy like a certain part of map should only be loaded on one client

viscid tapir
#

Hello! What is TIP ?

thin stratus
#

"Turn In Place" I guess

#

@viscid tapir

viscid tapir
#

yeah that makes sense

thin stratus
ripe lotus
#

hey man, turns out my code with a timer worked. beats me why.
one caveat with your sample is that HasAuthority does not implies it's the server. depending how the actor is set up might return true on a client.
now i need to try it with the rest of the code.
thanks a lot.

thin stratus
thin stratus
#

You'd only get a true result if you spawn it locally.

#

Saying "spawned/owned" is probably not the best thing either, but an Actor in the level that isn't even marked as replicated should still return false for Clients.

ripe lotus
#

it also messes up with the intention of the code. you're not really checking if it's on the server, you're checking for authority. so the code does not reflect the intention in this case. and checking for server is not that difficult anyway.

#

but yeah i understand that's what everyone does and gets taught.

thin stratus
#

I fully agree that as server check is better if you want to ensure it only runs on the server no matter what

#

It's just that it's a very specific case in which you start spawning actors locally that have an authority check in them

ripe lotus
#

yeah could be.

thin stratus
#

And in that case I usually expect the person to somewhat know what they are doing

ripe lotus
#

i'm making a framework for non-tech ppl. and they tend to create issues. specially since the framework needs to support both standalone and networked scenarios. so specially with the later it makes it quite prone to issues of this kind.

ripe lotus
thin stratus
#

I think I had to spawn exactly 1 actor in the past 6 years locally that had an auth check in it to have it also work replicated. Very specific prediction setups

thin stratus
ripe lotus
#

thanks yeah, you could say it's case dependent. i'm not a purist. and i let ppl have their preferences. in this case i just thought it was worth explaining the difference. i've seen many devs that learnt to use hasAuth having all sort of problems once they've realized it wasn't exactly checking for server. i tend to rather to make sure ppl are aware.

wet crypt
#

like can i make it work with a custom event being set to "run on server" or "run on owning client"

thin stratus
# wet crypt do you happen to know a certain way , tutorial or something like that and its a ...

It's been a long while but I'm sure we didn't load the streaming levels of client a on client b if they weren't in the same one in The Ascent.
There might be a setting in UE, Project Settings, that enables/disables replications of streaming levels loaded by the server.
If so, you'd then handle that yourself. I wouldn't use an RPC but rather some replicated state variable with information about the levels that need to be loaded

#

The Listen Server will still need to load all streaming levels that have clients in them

tacit furnace
thin stratus
#

That's just the level blueprint which is an actor

#

I would need to check for myself again. Will see if I find some time tomorrow

split siren
#

Just wanted to share my first "win" in Iris. Custom prioritizer inspired by the included FOV prioritizer with visualisation. (Cubes slowly fade to red but whenever they receive a network update they turn back to green). It aint much but it's something..

#

Basically it prioritizes updating Actors that are in the vision cone of the player. I made it a bit smaller to test it and see it.
Are there any built-in tools for debugging prioritizers in Iris?

grand kestrel
#

That is same as lyra, mesh based turn in place

dark parcel
#

Locally spawned actor only exist in the local machine.

#

In the context of what you asked (multicasting) it makes 0 sense to use local spawned actor.

ripe lotus
dark parcel
#

So switch has authority check is susficient

#

If someone tries to do mc from actor that locally spawned then they don't know what they r doing

ripe lotus
#

my point was that sometimes ppl makes mistakes, not that someone intentionally spawned on client. though more than that, like i said, my intention was to just clarify that. and bring to awareness. as well as having clarity on intention. i'm still/always learning, so maybe someone else would like to know too.
but i understand your point, thanks.

quasi tide
devout sonnet
thin stratus
split siren
thin stratus
split siren
# thin stratus Yeah it was some distance between 2 points where the second point was missing th...

I did find another bug when messing with the FOV prio, but it's related to replication of client views.
Server by default creates a View (used for filtering/culling etc) from ActorLocation and ActorRotation (not the camera comp).

The issue is that client sends CameraLocation and Rotation ONLY upon pawn movement location change, not actor rotation or camera change.
So client can move camera, zoom in/out and never inform the server.

I fixed it by manally marking PC->PlayerCameraManager->bShouldSendClientSideCameraUpdate = true; when client changes camera position, but I wonder if making a check in the default behaviour would make sense to include actor rotation or even camera changes.

On the other hand, the default will be enough for 99% of the cases. Do you think its worth a pull request?

thin stratus
#

There should be a UDN post about this, in case you have UDN (my wife just said).

split siren
split siren
thin stratus
thin stratus
dark parcel
#

is there any limit on how many uint8 we can have in FSavedMove?

#

and if so, is it a common practice to tied anything related to movement to it? Like bVaulting, bTurnInPlace, etc.

split siren
nova wasp
lament flax
split siren
thin stratus
#

Keep in mind that you can, by now, send whatever you want to the Server in the CMC.

#

The Flags that were part of the ServerMove RPC are an outdated thing.

#

It sends a Container by now.

upbeat basin
#

What is the purpose of netdrivers? Is it just a wrapper around sockets? And different store platform drivers are just to listen/connect sockets using the given platform id/user (<SteamID>:<port> for example)?

thin stratus
#

Did ColdSummer leave the Server? Can't ping them lol

thin stratus
upbeat basin
#

Oh sorry, yeah there is. I was looking at IpNetDriver. Let me check it

karmic briar
#

hey folks im racvking my brain trying to think of a solution for turn in place with multiplayer, im using cmc and the net correct is "fine" ish but idk why im using mesh bash turn in place with rotation the mesh itself for turn in place with using cmc control rotation. for some reason the mesh always jitter at the end. i tried to use the absolute rotation but still the same.. is there a solution to just turn the capsule itself? like turn in place using capsule and the mesh and animation is just purely visual?

or is that not posible with unreal with cmc?

thin stratus
#

Might not answer all your questions but try that first I guess

upbeat basin
#

Also yeah it doesn't show here as a mutual channel with ColdSummer, don't know what happened though

thin stratus
#

Probably a person you want to talk to. Not MeshBased, but I guess they can help you a bit.

karmic briar
#

Causes jitter on sim proxies oh my god yes this is my exact problem.!!! i havent experience the other issuesd vaei mentioned but this one especially is my problem

does the actor based TIP rotation the capsule itself? or what does he mean by actor based?

#

cant believe someone have a solution for this exact problem

#

i'll probably wait for vaei solution when its out

#

๐Ÿ™‚

#

i havent tried up to 180ms but with p.netshowcorrection1 and netemulation.pktlag=100 it always net correct at the end or turnining and it will jitter

#

thanks exi for the reference too ๐Ÿ™‚

upbeat basin
#

I wish there could be more documentations/information/comments like this available for the depths of the engine

upbeat basin
# thin stratus isn't there a huge comment in the header

From what I've seen there, would it be possible to debug why a client can't travel to server by checking handshake in server's UWorld and client's UPendingNetGame as well as AGameMode::PreLogin if I can't understand the reason from the logs? ๐Ÿค”

#

Hmm maybe the answer is no for my case.. Client can't even continue to UPendingNetGame::SendInitialJoin after initializing the connection

tame kraken
#

Hello, is it possible for a player controller to not be valid while the character is?

I had a bug presented by another user where we were supposed to set the view target to the character away from the first camera but it didn't.

All other operations that are associated with this action happened except the Set View Target with Blend

The only way I could replicate this is if I made the player controller invalid.

But I do the get function: is my player controller valid if not -> Get controller -> cast to my player controller
if valid return the variable

but how can it be invalid in this case?
either the Get Controller itself returned invalid
or the casting to my player controller failed
or the is valid failed

this is the only place i set the player controller variable

the user also reported being kicked out of the game so i wonder if that's related

i appreciate the guidance on this matter

upbeat basin
#

If you have the logs from the player or can reproduce the issue on your end, there can be info about why you get kicked as well

#

If the client is returning back to main menu directly upon connection, it might be due to game version mismatch between server and client for example

#

It'll be something like this

LogNet: UNetConnection::SendCloseReason:
LogNet:  - Result=ControlChannelClose

and more information below

tame kraken
#

i can face issues where the player controller isn't able to find the controlled pawn, so it could be that the character didn't get possessed

these happen when i do these kicks to prevent the players from getting above the max players i set for the game mode

upbeat basin
#

Well if controller returns null for the controlled pawn then not possessing can be the issue as well, yes. You need to debug to see what's exactly happening that you're not expecting

peak lintel
#

Hello. I want to glide/doge left or right. The problem is now, that it continues to go forward, only after the timeline ends (after updating the new location). How can I solve this?
Edit: it's in Update (timeline). Just some edits, when took the screenshot

thin stratus
#

Overall, that's not really the best setup for Multiplayer movement. The CharacterMovementComponent will fight you

#

Custom stuff will most likely need C++ if you want it correction-free.

tame kraken
peak lintel
#

Yes, it's in the update pin connected. Just edited before taking the scrn to test something and forgot about it.
Any other ideas how to dodge left/right? I've tried launch character, but my character is a flying one (a dragon), so it's throing it, into the space and I couldn't solve this. Add Impulse, doesn't create a smooth dodge also.

upbeat basin
tame kraken
# upbeat basin Well even the default setup of GameMode (which already does pawn creation throug...

the issue happens with this kick I do, so i am trying to figure it out

||```C++
void AShotballGameMode::PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage)
{
// Log the number of players before checking
UMyBlueprintFunctionLibrary::PrintWarning(this, FString::Printf(TEXT("@@ Current number of players: %d, Max players: %d"), CurrentPlayerCount, MaxPlayers), true, true, FLinearColor::Yellow, 5.0f, FName("PlayerCountWarning"));

// Check if the number of players exceeds the maximum allowed
if (CurrentPlayerCount >= MaxPlayers)
{
    ErrorMessage = TEXT("@@ PLAYERS GREATER THAN MAX PLAYERS.");
    FGameModeEvents::GameModePreLoginEvent.Broadcast(this, UniqueId, ErrorMessage);

    UMyBlueprintFunctionLibrary::PrintError(this, "@@ PLAYER JOINED WHILE GREATER THAN MAX PLAYERS");
    
    UMyBlueprintFunctionLibrary::PrintCaution(this, FString::Printf(TEXT("@@ Attempted to join session when full. Max players: %d, Current players: %d"), MaxPlayers, CurrentPlayerCount), true, true, FLinearColor::Red, 5.0f, FName("SessionFullCaution"));

    return;
}

// Increment the player count after verifying there's space
CurrentPlayerCount++;

// Call the base class implementation
Super::PreLogin(Options, Address, UniqueId, ErrorMessage);

// Log a message indicating successful pre-login
UMyBlueprintFunctionLibrary::PrintSuccess(this, FString::Printf(TEXT("@@ Player passed PreLogin check. Current players: %d"), CurrentPlayerCount), true, true, FLinearColor::Green, 5.0f, FName("PreLoginSuccess"));

}```||

maybe that's the kicked player who got their controlled pawn invalidated

upbeat basin
#

Well there shouldn't be anything to invalidate. Pawn should be created on PostLogin. If they aren't accepted during PreLogin then there shouldn't be any try to spawn a Pawn at all

#

Again, where do you try to reach your pawn in the controller? Is it BeginPlay? Is it on the server or the client?

tame kraken
grand kestrel
#

Yeah I boiled down my actor based TIP to an actor component that Character & CMC make a call to, then a few helper functions
The anim graph stuff involve a couple of calls too
The video of the Fortnite TIP didn't look very good, but ofc they're going for function over form, and theirs is a strafe only TIP (because that's all they need)

thin stratus
#

You just need to travel with ?MaxPlayers= option iirc.

#

AGameSession should handle that.

quiet yarrow
#

im struggling to figure out how to replicate some bones ragdolling on my chaos vehicle

anyone have tips or resources to point me in the right direction?

my plan is just to replicate one bone and have the other bones follow that. Just cant seem to get even one bone replicated in ragdoll

tame kraken
subtle kernel
#

hey guys, is there any chance that begin play won't be called on simulated proxy when actor becomes relevant again? Or maybe it has some delay.. :/

mild sonnet
#

(AddRotation doesnโ€™t work on clients after deleting unrelated Voxel Plugin mesh)

Iโ€™ve been testing my character logic in one world. When I delete one Voxel Plugin mesh, the character can't turn around (using addRotation.) I see the values change, so it's trying.

There is no reference to the object in the character. It serves no purpose other than as a collision body.

I'm doing client authoritative rotation. So it doesn't ask permission from the server to turn.

This is a really strange and frustrating issue. Any help would be appreciated

grand kestrel
#

I am absolutely confused by something
Move combining (which occurs >60fps unless disabled via cvar) is causing my clients to update their rotation at half the rate if I modify their rotation on tick
Losing my sanity trying to figure this one out ๐Ÿ˜

#

DebugServerAnim = server draws physics bodies (pink)

grand kestrel
#

OK nah. I was wrong. I see what's happening now
When combining it's being restored to the start of the frame, and I was applying something that's outside of the saved moves, so that was getting tossed when combining

grand kestrel
#

Amazing how simple it is to fix once I figured out what was happening ๐Ÿ˜„

#

Combined move issues are so frustrating because they appear while you have high fps (>60)
Then you start opening stuff up to figure out what the issue is
With all the editor windows open your fps is now <60, combining stops, and the issue is gone ๐Ÿ˜„

odd gulch
#

While testing multiplayer in Unreal Engine, I noticed that my client's foot movements are replicated with a jittery effect. In the video I sent, this issue can be clearly seen, as the client's movements appear this way to other clients and the server. What should be done about this? Is this a normal situation, or is there a solution for it?
https://cdn.discordapp.com/attachments/1286148616842645652/1338714702511079424/DN.mp4?ex=67ac16b9&is=67aac539&hm=4c1e1abe63174c3f2a6d40faee3efed1954c62e7dbe8d8957a97ced5d968e01d&

grand kestrel
odd gulch
grand kestrel
#

Try using it and see if the issue gets worse, set 60/60/60/60 for incoming/outgoing (no packet loss)

#

And use p.netshowcorrections 1 so you can see if any de-sync occurs

grand kestrel
#

Wait that ping is insane, it should be ~150 with those settings, hold on

#

Let me open editor and screenshot

#

There is insufficient information to see the issue
Would need to see code/bp
And also the network settings on CMC if they've been changed

odd gulch
#

The ping is 150 on the client, and there's no issue with that. The high ping showing on the server panel is just because it's not in focus while I'm managing the client. There's no problem with that, but the foot trembling is a bit annoying.

#

One minute, I might have answered my own question. I'll run a quick test and get back to you.

odd gulch
#

I will package my session, run a test with another computer, and provide a clear feedback.

#

If I did this by mistake, Iโ€™ll laugh at myself.

grand kestrel
unreal mulch
#

Hey everyone, im trying to make a turn based game in UE, and im struggling to figure out how to implement a pawn initiative turn order system. My main issue is deciding how to communicate between Players, Map, and Gamemode. I want to avoid casting to the gamemode so ive been looking into interfaces and delegates. Is there a reason to pick one over the other, or are there other ways to do this?

grand kestrel
#

If you want to communicate with the GameMode, well, you can't, it only exists on server
I can't answer your question but you probably want to use GameState for most of that stuff

odd gulch
# grand kestrel That's just game dev ๐Ÿ˜„ Laughing at yourself.

I tested it with a friend now. When Iโ€™m the server and look at the client, even when the client's ping is between 30-40, I can see the clientโ€™s feet trembling/lagging. But when I'm the client and the other is the server, I see the character from the clientโ€™s perspective very smoothly. Why is this happening?

fossil spoke
grand kestrel
#

@nova wasp @pallid mesa @thin stratus
I've finished my actor based TIP if any of you are interested in taking a look
I will make a video later, then put it in releases channels, promote it a bit etc.
But for now its finished and usable
https://github.com/Vaei/TurnInPlace

fossil spoke
unreal mulch
odd gulch
#

I couldn't figure out the reason.

grand kestrel
#

hmm I don't have those issues

#

So I'm not really sure how to advise you

bright summit
#

can you recommend me some good multiplayer courses? I watched a lot of stuff on youtube and lot of them turns out show bad habbits and practices like using NetMulticast and even ClientRPC (in some vid guy told that we shouldn't even use clientrpc because we can do stuff in other way). Need to learn more to better understand multiplayer mechanics with GOOD practices. Can be paid courses

odd gulch
grand kestrel
#

There are also plenty of good resources pinned to channels like this one

bright summit
#

and we shouldn't really use it

odd gulch
grand kestrel
#

The pins. Check the pins ๐Ÿ˜„

#

Mods keep those up to date

#

They're relevant

bright summit
#

I read all the pinned stuff but I need something practical

dark parcel
fossil spoke
#

Yes check the pins, there is never a single place that gives you everything you need to learn properly

dark parcel
#

Covers client prediction, server rewinding , rtt, etc.

fossil spoke
#

A large portion of knowing how to do things properly just comes from time and experience.

grand kestrel
#

Yep its a long ass journey ๐Ÿ˜„

fossil spoke
#

Very long, years long.

bright summit
fossil spoke
#

Reading a couple of tutorials or courses (even good ones, if they even exist) isnt going to make you a guru over night

dark parcel
fossil spoke
#

You need to expose yourself to real world problems and battle through solving them.

#

Do that enough times and you come out the other side with a wealth of knowledge

#

You will learn more this way than any course/tutorial could ever teach you.

dark parcel
#

To me that requires tremendous time. I mean ultimately have to solve some problem of my own.

#

But when working 12 hours a day and can only spend game dev time as hobby

#

Just watching some foundation helps

#

Because it compiles a lot of concept into one packet

fossil spoke
#

Thats just a fact of reality, dont expect to become an expert if you barely commit any time to something.

#

There is nothing wrong with not being an expert.

#

Just dont expect to make great things.

#

Harsh but true.

dark parcel
#

I only take what I need from tutorial too

#

Didn't need to copy 100%

bright summit
#

I am talking about the course which tells the good theory, not making me an expert in one day xD I know that the practice is key to understand things but I gave you an example with multicast/client rpc, most of tutorials/courses shows them as something of daily use

dark parcel
#

Youtube tutorial will just mislead you

#

Often used multi cast incorrectly

bright summit
#

that's the reason I am asking about courses, I thought there exist one which is good and shows good practices

dark parcel
#

Stephen ulbari multilayer shooter shows how to implement client prediction and server rewinding

fossil spoke
#

Thats just something you aggregate yourself over time.

dark parcel
#

Client talking to server = server rpc

dark edge
bright summit
dark edge
#

Make an openable door open in multiplayer in the 3rd or 1st person template project.

grand kestrel
dark parcel
#

Just need to be used in the right context

#

Doing something stateful on multicast is not

fossil spoke
grand kestrel
dark edge
#

This has the same smell as "casting bad, now I have an interface per class for reasons"

fossil spoke
grand kestrel
#

Mine even comes with a cat

#

Would recommend

fossil spoke
#

@grand kestrel

    /**
     * Turn in place component
     * We do not create it here, but use FindComponentByClass() in PreInitializeComponents() that it can be added to
     * the character in Blueprint instead to allow for Blueprint derived components
     */
    UPROPERTY()
    TObjectPtr<UTurnInPlace> TurnInPlace;
#

Doesnt UE5 allow you to override components directly in the component details now?

#

For this exact reason

grand kestrel
#

I thought so but I couldn't find it there ๐Ÿ˜

fossil spoke
#

Hmm

grand kestrel
#

Oh maybe its because I hid so many categories lol, let me try

fossil spoke
#

Heh

#

Maybe

grand kestrel
#

Yeah lemme try unhiding em

#

Heh yep there she is

#

Thanks for making me look at this closer ๐Ÿ˜„

fossil spoke
#

Nice

#

lol

grand kestrel
#

Fixed ๐Ÿ™‚

#

Have almost finished writing out the wiki, just need to add the multiplayer section
Tomorrow evening I make video ๐Ÿ™‚

thin stratus
grand kestrel
#

Didn't think about it, will amend ๐Ÿ˜„
Edit: Done-zo

thin stratus
#

Yeah I think the files would need to say MIT instead of all right reserved. Not that I'm much better with licences. ๐Ÿ˜…

grand kestrel
#

Eventually I'll update my other plugins too
But I do think license > some text in a source file, I hope ๐Ÿ˜›

thin stratus
#

For the demo stuff you could potentially just add a map and GameMode that are already set up using the demo character.
Maybe something like the GameAnimationSample, where there are some "buttons" on the floor you can walk over to get more information or enable some different modes or debugging.

#

Makes it nicer to just jump in and play around with

#

The actual tip I will have a look at later. Need to handle an office move in an hour and then get back to Mover MotionMatching

grand kestrel
#

Oh yeah that's a good idea

grand kestrel
#

Done ๐Ÿ™‚

modest crater
#

Just a clarification if anyone knows the answer

When a property bunch is sent for an actor it is done unreliably, how would the server know they aren't dropped? Does the client send back some kind of ack? Just curious because say I had an infrequently updated value and as I update it lets say it just happened to be dropped, is this a case of it just sits at the old value until its updated again on the server and re sent or is there an ack like I would assume? (but even then doesn't that kinda make it being unreliable moot?)

upbeat basin
# modest crater Just a clarification if anyone knows the answer When a property bunch is sent f...

Just read the big comment section at the beginning of NetDriver.h yesterday and from what I understand, yes, both server and client should sending acks for each packet to each other. But not acknowledged situation is only detected when a packet is being received with a bigger number than (previous+1). So it kind of makes your concern valid I guess, like what happens when there is a gap between the dropped packet and the next packet, that I don't know.

You might want to check that out yourself, maybe I'm missing something

#

ACK and NAKs are under --- Detecting Outgoing Dropped Packets ---

modest crater
#

Yeah that's quite a comment KEKW

I'm not sure if its specific enough property replication or just goes over the general RPC replication (I know properties replication is just a bunch in an RPC, so if there is nothing special with properties then yeah I would assume nothing happens until the next update and hopefully that isn't dropped too)

I would have thought property replication (even though its lossless) would be guaranteed you_think_about_that

Appreciate the heads up for that comment though, I was looking in the actor channel

upbeat basin
#

I thought it's talking about the general rule for any packet being sent, whether it's for an RPC and/or property replication ๐Ÿค” I'll probably read that comment a lot more to get a full grasp of it. I'd appreciate if you can share any more information you may find about how reliable, reliable is

#

Wait I just realized you said property replication is unreliable?

#

How and why is that? My thought process was assuming it was reliable and how would it detect the dropped packet to request the data back

modest crater
# upbeat basin I thought it's talking about the general rule for any packet being sent, whether...

Exactly, its talking about RPCs in a broad sense (which is still great info) I am just not sure if the property replication system has way to ack since you would think they do

as for reliable RPCs, they are guaranteed to be executed in the same order for the actor channel, so
A->SomeReliableRPC1()
B->SomeReliableRPC2()
A->SomeReliableRPC 3()

Then A is promised to run 1 and 3 in order but 2 can be before or after (esp if 1 is dropped, then 3 needs to wait in a queue)
This will probably help you a lot if you haven't read it https://dev.epicgames.com/documentation/en-us/unreal-engine/replicated-object-execution-order-in-unreal-engine#replicatedusingorder

Epic Games Developer

Execution order guarantees for replicated properties and remote procedure calls on receiving machines in Unreal Engine.

upbeat basin
#

Okay I'm a bit baffled about the terms so I'll try to get my head around with rereading, including the one you sent as well. Thanks!

#

We do need a "network compendium compendium" to index useful resources including docomments..

thin stratus
#

I do have a list at the end of the current compendium. Could extend that at some point

grand kestrel
#

I'm making two predictions for my turn in place plugin:

  • No one will ever beat it
  • No one will care much about a turn in place system
    aPES_Cry
dark parcel
#

I do love a turn in place system

#

ALS community version has done that and replicate it?

#

pretty sure they do, I haven't test with lag though.

upbeat basin
#

Well it's on my list of "check this one" that just keep growing and I haven't started to check yet.. Where do you place this within your predictions, that's up to you

upbeat basin
#

Hey @prisma merlin, sorry for the ping. Were you able to solve your issue you mentioned on #cpp message ? I'm having exactly same log message with oss eos right now. There are lot's of forum posts on that as well but couldn't see any solution or information yet

formal turtle
#

Hey does anyone know is it possible to disable region locking for session finding (Steam subsystem)?

#

finding sessions per your Steam client download region is what i mean

#

I dont want that to happen. is there a way to disable that via some argument in DefaultEngine.ini?

short arrow
#

you're probably using 480 app ID?

#

if you wanna test globally you're gonna have to fork over 100 bucks to steam

hybrid meteor
#

Guyss i am making only a two player multiplayer game but i have a problem relating to movement. Basically beacuse in real testing there is lag or ping so whenever a player tries to move it sends the message to server and then the server moves the character and then it is replicated but this results in delay in input and actual movement which is frustrating for client, even if i work it around and when the input comes i move the character locally and then call server then the server will execute movementt but because there is lag and delay so when the client moves locally and some moments later the server moves the character it results in snapping the character back in clients screen. And i am into this problem for 2 days and cant figure it out how to solve this. Please someone help

nova wasp
#

The default character movement component uses client prediction out of the box

#

you either use a correctly done client prediction setup with an ACharacter (and change it correctly to predict and playback moves without issues) or you just make movement client authoratative with game network settings if it isn't a game you anticipate people cheating in

formal turtle
hollow oasis
#

Hey, I'm trying to restart level where players fights by opening this level one more time (Open Level (by object reference)), I use it in GameMode blueprint. My Listen server works but Client is not traveling to correct map, client goes to default project map. I tried it in Editor and I work on Mac M-chip.
Does anyone have idea what do i do wrong?
(i can send Blueprints)

dark parcel
#

I haven't done much traveling but from what I read in multiplayer,
Open level (hard travel) is only for when the server host the map and when client join the host for the first time.

Anything after that, you should use server Travel. It will allow the server to travel to a new map and then it will call client travel to all the clients

hollow oasis
#

am i right that Server travel is only cpp function?

upbeat basin
hollow oasis
#

if execute command yeah?

upbeat basin
#

If you just want to restart the game on the same map, there is AGameMode::RestartGame too which is BP callable as well

hollow oasis
#

it worked! thank you<3

#

okey, it works only if i check on 2 clients (with unchecked run on one process) it works, but if i have 1 client and 1 listen server, only listen server travels

upbeat basin
#

With ServerTravel or RestartGame?

hollow oasis
#

server travel

upbeat basin
#

Do the client just stay on the old map or return back to the main menu?

hollow oasis
#

client do nothing

upbeat basin
#

As far as I know it should either follow server to the new map or get disconnected and return back to main menu. I don't know how something in between can happen

hollow oasis
#

okey im dumb, i did net.Allowseamless something and it works

#

leaerning ue5 be like ๐Ÿ˜›

#

thanks for help โค๏ธ

upbeat basin
#

That's still weird to me, I can do ServerTravel without seamless travel being enabled ๐Ÿค”

upbeat basin
#

Is seamless travel required for server travel or not?

thin stratus
#

It's not, but it's suggested

#

If you don't use it, it will disconnect the Clients which will try to reconnect once the Server is ready.

#

That's also why it's not working properly with Steam.

upbeat basin
#

Then just enabling net.AllowPIESeamlessTravel shouldn't solve the problem. That's why I was confused

thin stratus
#

net.AllowPIESeamlessTravel that's only needed if you try to SeamlessTravel in the Editor.

#

You'll otherwise get a warning and the game remains in the current map

upbeat basin
#

The stated issue was server travelling but client remaining on the previous map, is that resulted from the same thing as well?

thin stratus
#

No

#

Server and Client would stay in the same level if it's SeamlessTravel in PIE without enabling that experimental cvar

upbeat basin
#

So, I'm happy that the issue is solved but it's unclear (at least to me) what was the solution, that's why it was weird for me

hollow oasis
#

same for me but if it works... it works ๐Ÿ˜›

thin stratus
#

Could be that it leaves the Client kinda broken. But Drock should see a warning in the logs if they tried to Seamless ServerTravel with the value off.

#

Try doing the same in Standalone. That's usually a better indicator.

daring gorge
#

hi
i have an inventory component in the player controller,
i wish to be able to equip, use items from the inventory so i used an interface thats implemented in my character,
my items are UObjects that are made to replicate and i have a reference to the possessed pawn in the inventory,

#

However when i try to equip/use item, it seems to fire it on a different client instead of the character that owns it

upbeat basin
#

What kind of a sorcery is that

#

Is it possible that you're using GetPlayerController(0) or something equivalent?

subtle kernel
#

guys, I'm kinda stuck. I have an actor, this is a door. I need to sync it's state open/close to all clients. I also would like to broadcast open/close animation.
actor replicates, I have replicated IsOpen variable and OnRep function and added this variable to GetLifetimeReplicatedProps.

Now, when I try to call SetIsOpen_Server I get:
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_DungeonDoor_C_1. Function SetIsActive_Server will not be processed.

Who is supposed to own this Door actor? :/

daring gorge
#

im sending the character ref that i set on server on event on possess to the interface as target

#

i tried to print the character reference its setting and turns out all clients are setting the character reference to a particular character rather their own

#

which i dont understand since im directly passing the ref from event possess to the server rpc

upbeat basin
subtle kernel
daring gorge
#

yea sure

subtle kernel
upbeat basin
#

Well server doesn't own it but still has authority over the actor. You either need to route your open request through an actor you own (controller/state/pawn) or call SetOwner with a desired player owned actor to make it be able to call RPCs

daring gorge
#

`void UInventoryComponentBase::Server_SetCharacter_Implementation(AMyCharacter* InOwnerCharacter)
{
//if (InOwnerCharacter->Implements<IInventoryCharacterInterface>())
//{ OwnerCharacter = InOwnerCharacter;}
if (!IsValid(InOwnerCharacter))
{
UE_LOG(LogTemp, Error, TEXT("Server_SetCharacter: Received NULL character!"));
return;
}

OwnerCharacter = InOwnerCharacter;
UE_LOG(LogTemp, Warning, TEXT("Server_SetCharacter: OwnerCharacter set to %s by %s"),
    *OwnerCharacter->GetName(), *GetOwner()->GetName());
Client_SetCharacter(InOwnerCharacter);

}`

#

this is how i set the character ref

subtle kernel
upbeat basin
#

Well I prefer InteractionComponents over interfaces or direct calls like this. You can send your interaction request through your component (that again resides on some actor you own) to server and let server decide what to do with the request

#

But, yes you can call a server RPC on your controller with door as the argument and call the door's function inside the server RPC for a simple workaround

subtle kernel
#

I mean I can have hundreds of different actors with different interfaces

#

I will have to make a component in PC for each of them to interact..

upbeat basin
#

Well if that's the case I, again, would recommend a component. Client sending an interaction request, server checking whether there is a target (something to interact) and calling the interaction function of the target

subtle kernel
#

I see, ooookay

upbeat basin
#

I don't know how logical this is but I even prefer splitting InteractableComponent (to add on objects I want to interact) and InteractorComponent (to add on players)

subtle kernel
#

maybe I can make some manager actor and make it own interactable objects like that

daring gorge
#

any idea why my characters setting differently๐Ÿ˜ข

subtle kernel
#

so I can call it directly

daring gorge
subtle kernel
daring gorge
#

this is my equip item for example

daring gorge
subtle kernel
daring gorge
#

the actual setting character code is where im printing it

#

then i have a Client_Equip too

#

`void UInventoryComponentBase::Client_EquipItem_Implementation(AMyCharacter* InCharacterOwner,UObject* Item)
{
UE_LOG(LogTemp, Warning, TEXT("Client: Attempting to equip item"));
if (!IsValid(Item))
{
UE_LOG(LogTemp, Error, TEXT("Client: Received nullptr Item! Equip failed."));
return; // Prevents crashing when calling Execute_EquipItem
}
if (!IsValid(InCharacterOwner))
{
UE_LOG(LogTemp, Error, TEXT("Client: OwnerCharacter is NULL! Cannot equip item."));
return;
}
if (InCharacterOwner != OwnerCharacter) // Ensure correct owner
{
UE_LOG(LogTemp, Error, TEXT("Client: Character mismatch! Expected %s but got %s"),
*OwnerCharacter->GetName(), *InCharacterOwner->GetName());
return;
}
if (!IsValid(InCharacterOwner) || !IsValid(OwnerCharacter))
{
UE_LOG(LogTemp, Error, TEXT("Client: One of the characters is NULL! InCharacterOwner: %s, OwnerCharacter: %s"),
*GetNameSafe(InCharacterOwner), *GetNameSafe(OwnerCharacter));
return;
}

UE_LOG(LogTemp, Error, TEXT("Client: Character Expected %s and %s"),
    *OwnerCharacter->GetName(), *InCharacterOwner->GetName());
UE_LOG(LogTemp, Warning, TEXT("Client: Equipping %s"), *Item->GetName());
IInventoryCharacterInterface::Execute_EquipItem(InCharacterOwner, Item);

`
this also says its a mismatch

#

i tried to work around it by passing in the character ref from the server RPC

haughty ingot
#

Please use three ` at the start and the end of the code so it looks closer to this:

int main()
{
  Please();
  return 0;
}
subtle kernel
#

damn, how do I properly declare function that uses interface as parameter? ๐Ÿ™‚

UFUNCTION(BlueprintCallable, Server, Reliable)
void InteractWithInteractable_Server(TScriptInterface<ICOR_InteractableInterface> Interactable);

this gives all kinds of errors I don't understand xD

0>[1/10] Compile [x64] Module.CubesOfRealityProto.6.cpp
0>COR_PlayerController.gen.cpp(1038): Error C2511 : 'void ACOR_PlayerController::InteractWithInteractable_Server(const TScriptInterface<ICOR_InteractableInterface> &)': overloaded member function not found in 'ACOR_PlayerController'
0>COR_PlayerController.h(53): Reference  : see declaration of 'ACOR_PlayerController'
0>COR_PlayerController.gen.cpp(1042): Error C2352 : 'UObject::FindFunctionChecked': a call of a non-static member function requires an object
0>Object.h(1217): Reference  : see declaration of 'UObject::FindFunctionChecked'
0>[2/10] Compile [x64] COR_PlayerController.cpp
0>COR_PlayerController.cpp(111): Error C2511 : 'void ACOR_PlayerController::InteractWithInteractable_Server_Implementation(TScriptInterface<ICOR_InteractableInterface>)': overloaded member function not found in 'ACOR_PlayerController'
0>COR_GameMode.h(15): Reference  : see declaration of 'ACOR_PlayerController'
#

oh, okay:

UFUNCTION(BlueprintCallable, Server, Reliable)
void InteractWithInteractable_Server(const TScriptInterface<ICOR_InteractableInterface>& Interactable);

it works like this

#

I always forget that blueprints wants all const ref :/ is it correct?

upbeat basin
#

I don't think RPCs work within interfaces

subtle kernel
#

It compiled xD

#

let's see

quasi tide
#

They don't - as in, you can't make an interface method an RPC.

upbeat basin
#

Usually you just call an interface function inside of the RPC, instead of combining them

#

I'm also not sure if you can send an object as an interface type it's implementing ๐Ÿค” There was a conversation about not being able to store them like that, I don't know if it's different for parameters, especially for RPC parameters

subtle kernel
#

well, so far it works

subtle kernel
quasi tide
#

InteractWithInteractable_Server is a method from an interface?

subtle kernel
#

No, it's method in PC

#
Interactable->Interact();

this is an interface method call

#

I just relized, that maybe I should use GameplayAbility to do this interaction :/

quasi tide
#

You don't need to

upbeat basin
quasi tide
subtle kernel
quasi tide
#

I'm saying you don't need to use a gameplay ability for interaction.

normal viper
quasi tide
#

You can do it just fine without

subtle kernel
normal viper
#

maybe you have 2 static meshes there? lol ๐Ÿ˜„

daring gorge
#

turns out my code was all correct and working just fine, my UI wasnt : )

subtle kernel
#

client and server created their own meshes

#

btw, guys, is there any way to make some meshes visible in editor only? I mean not in PIE or while game is active

thin stratus
#

HiddenInGame is usually doing the PIE/Game part.

subtle kernel
quiet yarrow
#

anyone know if its possible to do ragdoll + animations with replication with just blueprints?

#

for example I want my arms to use simulated physics while also moving them with animations

thin stratus
#

Might not need ControlRig, but maybe that's a start.

#

Not sure if the Multiplayer part will cause you headache here though.

#

Depends on if hte arms are meant to actively affect gameplay.

quiet yarrow
#

the idea is that they would be sorta stretchy arms that can reach out. When they hit objects I use that data to pick up the object

#

the replication part is the tricky part. Because I've used physical animation, but the issue with that is it doesnt replicate. Not sure how to fix that

#

the animation + physics is solvable. But adding replication to the mix never has gone well so far

peak lintel
#

Hello. Can someone help me understand how can I multicast to specific clients? I have 2 teams, TeamA and TeamB. Each can see their team's name tag, but should not see the enemy names. I can hide/show on tick, but I want to avoid this.
In the first pic, I'm calling game state after a new player joins the game, to refresh all clients
The second image, filters the teams.
The last image is multicasting the widget.

subtle kernel
#

guys, how can I estimate if my project is replication heavy?

thin stratus
subtle kernel
thin stratus
thin stratus
#

"reasonable" is a difficult thing to define though.

#

You can look around the internet for some examples on what kind of bandwidth is acceptable for most connections

subtle kernel
#

is there any guidelines for that? for competitive mp game e.g.

thin stratus
#

With that you could make a Team Actor and override the IsNetRelevantFor function.

#

In there you can check if the is relevant for the given Player, e.g. by checking if they are in some array of that Team Actor.

#

That way the Actor will only replicate to TeamMembers and Multicast RPCs in the TeamActor would thus only reach said team.

quiet yarrow
#

20k bytes in/out is generally decent enough for most games @subtle kernel

thin stratus
#

In BPs you are somewhat stuck with manually targeting them via RPCs like you are doing now.

subtle kernel
quiet yarrow
thin stratus
# peak lintel Hello. Can someone help me understand how can I multicast to specific clients? I...

It is, however, questionable if stuff like this should even be solved via RPCs.
The Team a player is on can be considered STATE, which means it should be a Replicated Variable instead.
That could then be turned into a RepNotify, giving you a method that calls when it arrives on the Clients.
And that method you can decide if you want to show the name tag or not by comparing the team of that player with the one if PlayerCharacter 0.
The only thing you'd need to solve is if the PlayerCharacter 0 doesn't have its own Team replicated yet.
You can do that by having an invalid value for the Team, and a Delegate/EventDispatcher that you call in the OnRep.
If you then try to check the Team of the PlayerCharacter 0, and it's invalid, you can listen to the EventDispatcher and wait for it to replicate. And then call the method to determine if the Name should be visible when the callback comes in.
That's a pretty common race condition problem and its solution.

quiet yarrow
#

networking profiler is nice for finding spikes too, but more confusing to setup

thin stratus
#

And then in theory also what makes up that bandwidth so you can improve it.

subtle kernel
#

last time i've been there, I couldn't understand anything lol xD

thin stratus
#

The Network Profiler (the old one) is similar. Might look earsier but is also outdated fwiw.

subtle kernel
#

like look at something for 20 mins, gain 0 understanding ๐Ÿ™‚

thin stratus
#

Then sit 20 more minutes there.

#

Some stuff takes time

quiet yarrow
#

does it not work or what

thin stratus
#

Idk, but there is a good chance that it's not showing everything that is new in UE.
Unreal Insights might get some special stuff for Iris in the future and what not.

#

You never know.

#

Unreal Insights has support to be extended with new stuff easily, similar to how NPP got its own Insights trace channel.

#

Well "easily".

#

There isn't necessarily a reason to use the old Network Profiler anymore.
Unless it specifically has the information easily available you are looking for.

#

In theory it shows you quite nicely what each of your properties cost

#

At the top you can change it to see what Server to Client X or Client X to Server incoming and outgoing is doing etc.

#

And you can see somewhat instantly what your average, low and max values are in the graph

#

It's not that complicated.

#

Graph is a timeline from left to right. Below that is are the blocks from the LyraHealthSet picture that show what makes up each frame of the timeline.

#

Not everything might be "tagged" to show up, especially with NetSerialize is overridden, but one can tag that stuff then.

#

And on the right side you can see what is the most expensive stuff exclusive and inclusive.

#

*Most expensive stuff based on your current selection (in that screenshot nothing is selected, so it's the whole timeline, but you can also drag the timeline to select a subset of frames to see what was the most expensive thing for that area, or even just a specific frame by double clicking it).

quiet yarrow
#

maybe im dumb, but why can I only open unreal insights and not network insights?

quasi tide
#

UE Insights is so confusing sometimes, lol

quiet yarrow
#

like it just brings up timing insights

#

I want to see what hes seeing

#

??

thin stratus
#

At the bottom right of your editor you have buttons to start traces in the Editor

#

Next to it is a button that opens a submenu

#

And there you can find another submenu for the trace channels

#

Make sure the Net one is ticked, potentially alongside some others.

#

The Networking Insights Tab in Unreal Insights (in case you opened it by hand or opened a trace in general) only works/shows up if you trace for the Net channel.

#

Might also be a combination of channels, but def the Net channel is needed

quiet yarrow
#

I was tracing Net

#

must be something else

thin stratus
#

I can have a look at it tomorrow. Last time I traced was a few months ago to improve NPP/Mover bandwidth

strong junco
#

I'm removing an actor from my replication graph using GridNode->RemoveActor_Dynamic(ActorInfo); but it takes a moment for it to be removed from all the clients. Can I make it happen immediately?

fossil spoke
strong junco
#

Damn

#

I'm making a player temporarily invisible to all other clients, any tips to do that without that buffer period?

fossil spoke
#

Or setup your own property, that replicates

#

So you can change materials or something

mellow stag
#

How would I set an objects visibility ONLY for the client that is in range, for example I have building objects (similar to the game Rust) when a player is in range of the building object it would set the visibility of that only for that/those clients in range

fossil spoke
mellow stag
#

ah that's what I was doing besides the IsLocallyControlled check... i'll try it rn ty โค๏ธ

#

Would this not cause say a player to exit the building visibility range while another play is already inside of it and hide the building for that player? @fossil spoke

#

Ex: player 1 is in building range, Player 2 walks in. then walks out

fossil spoke
#

No, because its only changing visibility locally

#

IsLocallyControlled means, is this on the machine that I as this Player is playing on.

mellow stag
#

ty i'll try it rn. Would I just run this logic on the BuildingActor or should I call owning client rpcs so it replicates correctly?

fossil spoke
#

There should be no RPCs or replication of any kind involved

#

This is literally just a local only effect

mellow stag
#

It's working thank you โค๏ธ

vapid gazelle
#

Does the CMC at all offer an option to be client-authoritative?

This is for those coop games where we explicitly don't want the server to rollback client position, but we want to let each client manage their own state and send those updates to the server, and the server trusts them?

fossil spoke
fossil spoke
# vapid gazelle Does the CMC at all offer an option to be client-authoritative? This is for tho...
    /**
     * If true, and server does not detect client position error, server will copy the client movement location/velocity/etc after simulating the move.
     * This can be useful for short bursts of movement that are difficult to sync over the network.
     * Note that if bIgnoreClientMovementErrorChecksAndCorrection is used, this means the server will not detect an error.
     * Also see GameNetworkManager->ClientAuthorativePosition which permanently enables this behavior.
     * @see bIgnoreClientMovementErrorChecksAndCorrection, ServerShouldUseAuthoritativePosition()
     */
    UPROPERTY(Transient, Category="Character Movement", EditAnywhere, BlueprintReadWrite)
    uint8 bServerAcceptClientAuthoritativePosition : 1;
vapid gazelle
grand kestrel
# vapid gazelle Does the CMC at all offer an option to be client-authoritative? This is for tho...

@fossil spoke
Its really poorly named, because it won't send any server moves so long as that or the function ServerShouldUseAuthoritativePosition() returns true, so it's way more than just the position. I do have a solution for position only.
However, if your game is going to be client auth only, then instead of using that you could also change it in GameNetworkManager::ClientAuthorativePosition

#

@thin stratus btw I updated my turn in place demo map and fixed a bug. You have extra buttons to preview the enabled state
I'm thinking about how to make a video for this plugin, it isn't exactly exciting
Probably just a brief walkthrough and show the demo map?

subtle kernel
grand kestrel
subtle kernel
grand kestrel
#

Oh I introduced a bug in my last update lol

thin stratus
grand kestrel
grand kestrel
thin stratus
grand kestrel
thin stratus
#

I don't see the need to have a video tbh. Text + gifs also works and is easier to fix later.

grand kestrel
#

Hmm yeah tbh

#

PredictedMovement didn't need one

#

Yeah I'll add a "Features" on the wiki overview page

thin stratus
#

Glad to be of service. I shall now return to being 15% awake while staring at my coffee.

grand kestrel
thin stratus
#

To make sure you cover some more timezones.

grand kestrel
thin stratus
#

We usually post our stuff on e.g. Twitter and then retweet it roughly 10 hours later.

grand kestrel
#

Ah didn't that platform die, at least a bit
At least with the Nazi stuff I don't really want to touch it

thin stratus
#

One Q press away from being a good person. *jk

grand kestrel
#

I just realized I never fully re-released PushPawn
Still need to finish the release for PredictedMovement 2.0 as well

thin stratus
grand kestrel
#

I'll do those two next, then I'll do my physics hit react plugin
Then I'm done lol, games next

thin stratus
#

Just a small thing: Maybe see if there are some meta specifier to make it less annoying to work with Structs and Arrays.

#

There are ways to name the entries based on a param for example.
And there are ways to remove the drop down to expand a struct view and what not.

#

It's not super important, but can go a long way.

#

E.g. the Element 1 could say "TurnMode.Strafe" iirc.

#

Which would already help knowing which element was which mode.

grand kestrel
#

Hmm there probably is something

#

I know there is, just don't remember specifics
Will check benui

#

meta=(ShowOnlyInnerProperties)

thin stratus
#

Yeah

#

I was too slow :D

grand kestrel
#

Jinx ๐Ÿ˜›

thin stratus
#

That's a pretty cool one

#

But TurnAngles is a map or?

grand kestrel
#

Huh. Haven't seen/used that

#

TMap<FGameplayTag, FTurnInPlaceAngles> TurnAngles;

thin stratus
#

Ah yeah, that's sad

#

If you would make that a TArray with the Tag being in the Struct, you could make use of it

#

But that's a bit too much to ask for just some UX changes

grand kestrel
#

I think that would be less optimal functionally tho

#

Hmm ShowOnlyInnerProperties did nothing for StepSizes either

#

I guess it wouldn't

#

Yeah that's for structs ๐Ÿ˜„

thin stratus
#

Maybe. can always wrap the Array access with functions similar to the Map.
And it's not like this specific Map will ever be large enough to warrant it being a map over an array.
But again, not really worth it :D

grand kestrel
#

If I wanted to use it then it could go on Params but ew no

thin stratus
#

Some other stuff you can do is make use of the Units and ForceUnits ones

#

For the MinTurnAngle for example

grand kestrel
#

Oh yeah that's a good call

#

And "x" on the play rates

thin stratus
#

I always forget this exists.

thin stratus
grand kestrel
#

Huh. Nice

grand kestrel
thin stratus
#

But yeah, nitpicking at this point. UE isn't that great with array struct maps stuff as of late.

grand kestrel
#

Nah its worth dressing this up a bit

thin stratus
#

ClampMax no?

#

"Delta" is also nice if you want to have control over the step size of some properties.

grand kestrel
#

I wouldn't want to clamp the max, if they want obscene play rates that's up to them

#

Hmm yeah Delta would be good at 0.1

thin stratus
#

Ah but you clamped the UI to 2, that's why I wondered

grand kestrel
#

Yeah that's just so there's a sane slider ๐Ÿ™‚

#

But they can manually enter a higher number too

thin stratus
#

Yeah, other than that, there isn't too much one can do.
If there is some "Enum to Array" setup, having a "statically" sized array matching the enum is quite nice.

#

Sometimes it#s useful to generally fix the size or order of an array

#

But not sure you have any usage for that.

grand kestrel
#

Not for this I wouldn't

#

Or anything I can currently think of

thin stratus
#

Current client is picky on things exposed to designers making the most sense it can and being as easy to use as possible.

grand kestrel
thin stratus
#

So I started putting a bit more thought into this stuff.

grand kestrel
#

Maybe the ignore montage stuff can go in it's own struct

thin stratus
#

Ah and some usage of AdvancedDisplay, as well as combinations of EditCondition EditConditionHides and InlineEditConditionToggle are sometimes nice.

#

E.g. if some property makes no sense to be visible or editable if some other is changed.

grand kestrel
#

Yeah I do have some edit condition/hides on there
Nothing I can inline atm tho

thin stratus
#

Or, if more complex is needed, can also override something in the Uobject.

#

Great, yeah then that's good. The Units are already making it easier to see what angle is supposed to be

#

Degree is obvious until you meet someone expecting rad

#

This guy could use the x too, no?

#

Would be kinda cool (maybe, not sure actually) if one could add some opt-in one liner descriptions of properties that would be displayed below it. Maybe limit to some max length string too.

#

To get like an instant overview.

#

Something one could toggle at the top right.

#

But maybe that would blow up the UI.

#

That's more a general thought. Nothing about your stuff here.

grand kestrel
# thin stratus This guy could use the x too, no?

Its not a multiplier

InterpOutAlpha = FMath::FInterpConstantTo(InterpOutAlpha, 1.f, DeltaTime, Params.MovingInterpOutRate);
NewControlRotation.Yaw = FQuat::Slerp(CurrentRotation.Quaternion(), NewControlRotation.Quaternion(), InterpOutAlpha).GetNormalized().Rotator().Yaw;

I did think about it, but it could be misleading

nova wasp
#

FInterpConstantTo my beloved

grand kestrel
#

Much better

#

Less overwhelming now too, when you first see it

#

Thanks Cedric, as always ๐Ÿ™‚

thin stratus
#

I think that's what the input on the Interp node is too?

grand kestrel
#

True

thin stratus
#

"Rate", for me, is a multiplier.

grand kestrel
#

But it wouldn't be cm/s either, it's... nothing. Yeah. Haha

thin stratus
#

I was able to describe that thing once

grand kestrel
#

Speed works

thin stratus
#

I mean, actually it's a Multiplier

#

xD

#

At least on the Constant one.

grand kestrel
#

Hmm

#

I guess technically it is, since its in a 0-1 range..

thin stratus
#

Not even, gimme a sec

grand kestrel
#

That's a long ass second
Imma go for a walk before it gets dark, back in ~10 ๐Ÿ˜„

thin stratus
#

Yeah, double checking something before I write nonesense

#

FInterpConstantTo moves from Current to Target in a constant rate, hence the name.
It does this by taking the distance between Current and Target:

const RetType Dist = Target - Current;

and adding it back onto Current:

return Current + Dist;

But, the above line is not from the actual function, they actually do this:

return Current + FMath::Clamp(Dist, -Step, Step);

So the maximum distance it can move is some Step value.
And what is Step? It's DeltaTime, optionally scaled.

const RetType Step = InterpSpeed * DeltaTime;

So with an InterpSpeed of 1.0, it will add 1.0 to Target over the course of 1.0 second. In other words, it will take exactly Dist seconds to reach the Target, where Dist is the original distance between Current and Target before Current updates the first time.

--

Here is part of a print of Current = 0.0 , Target = 5.0 and InterpSpeed = 1.0:

TimeSeconds: 00,014 - Current: 00,014 - Target: 05,000
TimeSeconds: 00,198 - Current: 00,198 - Target: 05,000
TimeSeconds: 00,258 - Current: 00,258 - Target: 05,000
TimeSeconds: 00,279 - Current: 00,279 - Target: 05,000
...
TimeSeconds: 04,954 - Current: 04,954 - Target: 05,000
TimeSeconds: 04,972 - Current: 04,972 - Target: 05,000
TimeSeconds: 04,989 - Current: 04,989 - Target: 05,000
TimeSeconds: 05,006 - Current: 05,000 - Target: 05,000

And here is part of a print with InterpSpeed = 2.0:

> TimeSeconds: 00,015 - Current: 00,031 - Target: 05,000
> TimeSeconds: 00,155 - Current: 00,309 - Target: 05,000
> TimeSeconds: 00,209 - Current: 00,419 - Target: 05,000
> TimeSeconds: 00,232 - Current: 00,463 - Target: 05,000
> ....
> TimeSeconds: 02,460 - Current: 04,920 - Target: 05,000
> TimeSeconds: 02,480 - Current: 04,959 - Target: 05,000
> TimeSeconds: 02,499 - Current: 04,998 - Target: 05,000
> TimeSeconds: 02,518 - Current: 05,000 - Target: 05,000

Surprise, it took half as long.

#

So if your InterpOutAlpha starts at 0.0 and goes to 1.0, then a MovingInterpOutRate of 1.0 means it takes 1 second. And 1.0 would mean it takes 0.5 seconds.

#

So it is, in fact, a rate/multiplier :P

grand kestrel
#

Haha nice job ๐Ÿ˜„

#

I will add the "x"

thin stratus
#

Might as well explain what this thing does in your comment.

#

The non-constant one is kinda the same but not, so let's ignore that.

grand kestrel
#

Yeah I don't support that, it has gameplay implications

thin stratus
#

It basically does the same, but instead of clamping the Distance by DeltaTime * InterSpeed, it takes a portion of the Distance.

grand kestrel
#

Isn't framerate independent tho

#

Great for cosmetic stuff

thin stratus
#

So

const RetType Step = InterpSpeed * DeltaTime
return Current + FMath::Clamp(Dist, -Step, Step);

becomes

const RetType DeltaMove = Dist * FMath::Clamp<RetType>(DeltaTime * InterpSpeed, 0.f, 1.f);
return Current + DeltaMove;    
thin stratus
#

Every tick it adds Dist * SomePercent, where Dist is the remaining distance.

grand kestrel
#

You def. get different results at different framerates

thin stratus
#

Higher frame rate makes DeltaTime lower, etc., so this should be framerate independent

grand kestrel
#

Hmm maybe need to test it

thin stratus
#

It's somewhat good to understand these two Interp functions, at least to know what Speed actually does.

#

Sadly it's not as simple as "Halfs the time if doubled" for the non-constant one

nova wasp
#

How far off does it get?

#

I personally would not really mind if it's only a bit off until you get to something extreme like 15hz or something

thin stratus
#

I mean, the math is there. It will do a maximum of 1.0 * dist per frame, and 1.0 would be "all the rest"

#

I don't see this breaking atm

nova wasp
#

If the timing here can result in limbs freaking out that might be an issue but I doubt it will do much but have a bit of a slight pop in the rotation at the end

grand kestrel
thin stratus
#

15 FPS is like 0.06667 or so in deltetime.

#

Hm.

#

I guess I see what you mean.

grand kestrel
#

There are many such people asking about those functions being framerate dependent and its been ages since I looked/tested but I did have the same issues long ago too

#

Our server ticks at a much lower rate than client in Legacy
So if we used InterpTo in a way that affects movement that would cause de-sync

#

I've always stuck with Constant for anything important to gameplay

nova wasp
#

I guess to put it simply for my stupid math brain:

Big frametime at the start of FInterpTo = it uses the "faster" mode and consumes more of the remaining time than if it used lower frametimes at the beginning

So even though the same amount of time passed it would be disproportianately larger?

grand kestrel
#

There is no reason you can't use FInterpConstantTo with a 0-1 alpha and pass the result to an Ease function

#

Or eval a curve

#

That would remain framerate independent

#

And still gives nice falloffs

thin stratus
#

t.MaxFPS 30

TimeSeconds: 09,034 - Current: 04,999 - Target: 05,000
TimeSeconds: 09,067 - Current: 05,000 - Target: 05,000

t.MaxFPS 15

TimeSconds: 08,828 - Current: 04,999 - Target: 05,000
TimeSconds: 08,894 - Current: 05,000 - Target: 05,000
#

Bummer.

#

But I guess that makes sense. Lower DeltaTime means it moves more per frame.

#

In this case twice as much per frame, but it only has half the number of ticks.
But I guess the "take % of remaining dist" breaks it then.

grand kestrel
#

Yeah, its entirely because of the dist

#

I think the result you get doing what I suggested with curves/easing/alpha is nicer and perfectly stable/accurate regardless

thin stratus
grand kestrel
#

Its the best way to go

thin stratus
#

Aloah, this is not allowed to be posted like this. Make a proper post with actual screenshots and what not and post it to #1054845218723209226 .

thin stratus
#

And please read the #rules while you are at it, otherwise you will farm infractions and get banned.

thin stratus
ionic pagoda
#

Hello everyone, Iโ€™m trying to understand how replication works in UE5, and I have a question. Can โ€œRun on Serverโ€ events from the client only be called from blueprints that the player has ownership of? Or only from blueprints present in the GameMode of the level the players are playing on? Or are there other conditions that I might have missed?

#

Thanks a lot to everyone whoโ€™s gonna help ๐Ÿ™๐Ÿผโค๏ธ

lament flax
#

Client needs a client owning connection to call server RPC

#

This includes player controller, and anything that has the PC has owner, Pawn, Character, Player State, ...

#

If you are doing C++ you can override GetNetConnection

kindred widget
dark parcel
#

Can you even do rpc on player state? Afaik that's not owned by the player, or is it?

thin stratus
#

You can

#

It is owned by the Client

dark parcel
#

I c i c

#

Must have confused it with game state

lament flax
#

I had my chest using pawn connection when in the inventory lurkin

upbeat basin
#

I'm still curious if we can just return the local player's connection and be able to run server RPC's without being required to own an actor

slim jay
#

Hey, using an Actor class as a train. It has spatially loaded disabled, replicates enabled and replicate movement enabled. However the tick event is not running on the server even though it works fine in the editor. What could be the issue?

lament flax
#

Tick is called if enabled

#

Your system running at tick is probably the issue

slim jay
#

I also tried adding a word partition streaming source but it didn't solve the issue

upbeat basin
#

Are you sure the problem is just not ticking? Does the actor exist on the server at all?

slim jay
#

Yes it is exist on the server but it disappears when i get close to it. however this only happens when i run the tick event on authority. on the remote side it works fine and moves with sync issues

formal turtle
#

maybe someone can help.. im having an issue with creating widgets in client version of the game. event onpossessed runs only on server, and if i put it inside beginplay of playercontroller class then it causes issues with the 'createwidget' return value (its nullpointer)

#

so what is really the correct way to initialize widgets for a client class?

#

i am guessing Client opens a 127.0.0.1 connection in the background as indicated in logs

upbeat basin
upbeat basin
slim jay
upbeat basin
#

Do you have auth check (if dedicated server) or is local controller check (if listen server) for PlayerController::BeginPlay()? I don't know what would be the result if you create a widget and give owner as a non local player controller

formal turtle
#

if i dont add isvalid then it will return null for some reason. screen is also black for client for some time

#

onpossessed according to forums runs only on server

#

and apawn::restart was used as alternative

upbeat basin
#

Well OnPossessed is not a place to deal with widgets, due to the reason you stated

formal turtle
#

this happens only on client btw. pie editor normal version doesnt do anything bad really nor standalone

dark parcel
#

AcknowledgePossesion runs on client after a possession happend

#

I used that event to do stuff on client

#

not blueprint exposed for some reason

formal turtle
#

server gets initialized first with that hello string

#

then after that error client gets init, prolly why client one fails, idk really

dark parcel
thin stratus
#

BeginPlay calls on everyone, for PlayerController that's Server and Client.

dark parcel
#

oh begin play..

thin stratus
#

You have to lock CreateWidget to the owning client.

#

IsLocalPlayerController -> Branch

#

The call will otherwise once succeed and once fail (for the Server call it on the Client's PC).

formal turtle
#

aight

upbeat basin
formal turtle
#

but ill take a look into it thanks

thin stratus
#

It's deprecated for actually drawing things onto the HUD fwiw.
It's still used internally for debugging and you can use it to store your widget references.

#

That's an optional choice though.

upbeat basin
#

Yup, I prefer it to store client only UI stuff to somewhat similar purposed class both to keep PC a bit cleaner and specific to network/connection only stuff

thin stratus
#

But that's usually C++ I guess

#

I think UT stores some UI stuff there, but that code is a bit old by now.

#

Not sure if Lyra uses it.

#

Well for Widgets. Pretty sure it uses it in general.

upbeat basin
#

Hmm I never considered that, I don't have extended knowledge about ULocalPlayer yet. Its only purpose have been passing the enhanced input stuff for me so far

rich geyser
#

Nobody actually knows what the purpose of ULocalPlayer is and nobody ever will

#

UPlayer for that matter

#

why does Unreal not have clear user management systems that have consistent interfaces among servers and clients?

chrome bay
#

It does lol. ULocalPlayer is a "local" human player, which persists for the lifetime of the game instance

rich geyser
#

what does ULocalPlayer provide though?

upbeat basin
#

Oh I thought the lifetime was similar to UWorldSubsystem

chrome bay
#

Quite a lot... a viewport, the slate user for that player etc.

#

Anything that needs to persist for a human player outside the lifetime of a play world

rich geyser
#

doesn't the viewport exist outside of the ULocalPlayer though?

#

like what actual useful features does ULocalPlayer add?

#

or is it not just some additional layer of unneeded abstraction?

chrome bay
#

It's just "an object" which shares the lifetime of a human player, which seems pretty useful to me. People often think that's the player controller instead but it isn't because the controller is an actor and belongs to the player world

rich geyser
#

it just complicates multiplayer is ways that are entirely unecissary imo

chrome bay
#

It has no relevance to multiplayer

rich geyser
#

except a ton of example code uses it as a way to identify local players

#

you're talking about a multplayer game engine

chrome bay
#

What about splitscreen?

#

That's why you might have more than one

rich geyser
#

couldn't the APlayerController store that info?

chrome bay
#

No because it's an actor, and gets destroyed with when the world is torn down

rich geyser
#

why do you need info about splitscreen after the world is torn down?

chrome bay
#

I mean you can look at the code and figure it out..

rich geyser
#

same thing can be said about everything in unreal though

chrome bay
#

But again slate users, viewports, controller IDs etc.

rich geyser
#

isn't it unnecessarily complicated?

#

why isn't there a single user class?

chrome bay
#

Most of this stuff comes from the UT/Gears days where this framework made a lot of sense to support that kind of game, and it was apparently useful enough to become a core part of the engine

rich geyser
#

Unreal is clearly terrible at multiuser management, and they really haven't mad a big effort to fix it

#

saying this as someone who's been working with it since the UE3 days

chrome bay
#

They won't change it, it all forms part of the underlying gameplay framework which is pretty solid by now

#

I don't really know what makes it difficult tbh, but perhaps I'm used to it

rich geyser
#

well there's no single identifier for a player

chrome bay
#

In an MP game the only single identifier would be the FUniqueNetId that comes from whatever online backend service you use

rich geyser
#

that's not even singular

#

if you're working on a crossplay title

chrome bay
#

yeah but.. how could the engine possibly manage that?

rich geyser
#

....

#

just by registering players to a uuid?

chrome bay
#

Hang on I don't follow here, the FUniqueNetId comes from the online backend and absolutely IS a unique ID for a specific player account

#

You don't get duplicate ID's unless the subsystem backend isn't functioning properly

rich geyser
#

have you worked with EOSPlus?

#

EOSPlus has its own UniqueNetId class,that concats the platform specific id with EOS's ID

#

as far as I know, there's no unique id you can just hold onto that uniquely identifies a player in Unreal among the server and clients

chrome bay
#

That's what you want though right? EOS being a cross-platform backend, it (presumably) links all your unique account ID's from Steam/PS5/Xbox etc. into a persistent ID you can use in-engine to identify that account owner

#

The EOS ID then becomes your UUID

rich geyser
#

i've had to jump through hoops to make it work

#

by extracting the product id from EOS as a unique identifier. But that's not unreal

#

it's not a defense for why Unreal works the way it does

chrome bay
#

IDK how you would solve it any other way tbh

#

I don't know how the engine itself can have a system which uniquelly, globally identifies any user account one could create, that's kind of the job of the backend

rich geyser
#

what... I literally do that

chrome bay
#

Unreals "abstraction" lets you replace the backend ID with whatever suits your game, and the rest of the gamecode can just assume that's your unique identifier

rich geyser
#

it's just an association with the backend id to the engine's id

#

why can Unreal not do that?

chrome bay
#

The engine doesn't have any player UUID though?

#

How can any engine do that without the support of a backend account system? Not sure I'm following.

grand kestrel
#

@thin stratus I posted it here and on r/unrealengine, hopefully it came across as tongue in cheek like it was meant to rather than arrogant lol
And on twitter

kindred widget
grand kestrel
#

That's been going on for literally years

subtle kernel
subtle kernel
swift sorrel
#

Need a bit of a sanity check here; I have a function (head movement of a character) that I want to replicate for gameplay mechanic purposes, but also want keep smooth on the client. Is there a method of replication I can use to make sure that the server retains authority on where the head should be looking at while also keeping the head rotation smooth on the client? (First picture)

Context: the character is replicated (literally using the "Character" base class). The "head" skeletal mesh component that is rotating in this case is also replicated. The rotation of the head is determined by a player's cursor's location (hit result by channel in the player controller) which is communicated to the character blueprint through a blueprint interface, per-tick (Second picture)

The current set-up (in first image) makes the head rotation feel jumpy/laggy when running on the server (since the server doesn't run on the same tick resolution as the client, nor should it). Rotation on standalone is perfectly smooth, as it should be. Is it necessary for it to be on RepNotify (since it's updating per-tick)? Also I set it to reliable just to see if there was a difference in smoothness (definitely more smooth with it set being Reliable but I know that that's also not good to have set for functions that are on a per-tick basis).

Thirdly, this was a previous set-up which worked, but felt dirty due to setting the same property value twice and feeding into the same branch (third image).

Any thoughts or guidance is appreciated!

swift sorrel
#

Could you elaborate?

dark edge
#

Replication condition

#

Replicate to everyone but owner

swift sorrel
#

Hm.. doesn't seem to fix the issue.

#

Would have been nice if that worked, because that seems like exactly what I needed. Maybe I'm missing something somewhere to get that to work as expected ๐Ÿค”

crimson garden
#

Hey folks! What would be the best way to replicate PhysicsHandle behaviour? Should I call grab on server only and replicates transform then, or grab item on server and clients? Currently I have setup where client and server grab the object - it works, but client has like 1 second lag between his mouse movement and transform update and I don't really know how to reduce it.

thin stratus
#

If you start the "grabbing" on the Server by setting the Client as the Owner until they drop it again, you can set a Transform Variable as SkipOwner to avoid applying a delayed transform locally again

crimson garden
#

Yeap, its coop. I don't really care about cheating tbh

thin stratus
#

Only thing you'd need to figure out is the smoothing of the replicated values

#

Aka interpolating from current to new value.

crimson garden
#

so basically, you propose to grab locally -> send to the server new transform -> replicate new transform* to every1 else (with SkipOwner), yup?

#

and how will it work with other physics based items? Will they behave correctly after the interaction with the object held by the Physics Handle? @thin stratus

lost inlet
#

you don't use the CMC or something?

#

because that has jump support already with networking

#

and it predicts the action locally

unique fox
lost inlet
#

character movement component

unique fox
lost inlet
#

why couldn't you?

formal turtle
#

if I use this, why is it that for the listen server, widget reference is still invalid?

#

even though its drawing everything to the screen

#

but is unable to have ref as its "nullpointer"

unique fox
lost inlet
#

no?

#

charactermovement has a jump function

#

the updatedprimitive will just be the capsule component of the character

unique fox
lost inlet
#

well it's going to be difficult to implement a custom jump with clientside prediction in BP, but at least just call your custom jump on the client at the same time you send the server RPC

#

and no, I don't accept unsolicited friend requests

unique fox
lost inlet
#

links to what? you have delay because in response to the input you send a server RPC and then send a multicast back, so at best, you're introducing the round trip time in latency to the jumping player

#

so at minimum, to mitigate that, you'll have to predict the jump happening on the client before you receive any feedback from the server

#

that is what, in essence, clientside prediction is, but with a few more implementation details

unique fox
swift sorrel
#

Ok, I seemed to have found the core of my issue. Somehow I set up the head rotation function in such a way that the character's head rotation is tied directly to the tick rate of the tick event on the player controller ๐Ÿ˜…
So even on the client's side, if the time between ticks is big enough, there is quite a noticeable amount of halting of the head's rotation before reaching the intended value set by the client/server.
To test this, in the player controller portion of the function, I set up a small delay between ticks and added a branch to stop updating the value if the previous and current mouse location values are the same and discovered that the head would just straight-up stop rotating once the tick event stopped (when previous and current values matched), even if the head didn't reach its intended rotation value on the character. Wops ๐Ÿ˜‚

unique fox
dark parcel
#

๐Ÿ˜”

late surge
#

Anyone know why SetControlRotation on the client does not replicate to other clients?

dark parcel
#

not every game would want to replicate the control rotation

#

but lucky for you, there is already something you can use that takes in the value of the control rotation

#

use GetBaseAimRotation()

thin stratus
late surge
late surge
#

I mean it's get base aim rotation. I don't see away to set it.

dark parcel
#

OnTick -> Role == Proxy -> Set Control rotation with interp (Current, GetBaseAimRotation)

crimson garden
# thin stratus Not sure what you mean.

If client pushes cube (for example) that simulates physics, with object held by Physics Handle, every1 will have the same state of the cube? I'm asking bcs Ill change location of the object held by Physics Handle artificially on the server (just interpolating)

dark parcel
#
void AAGPlayerCharacter::AimOffset(float DeltaTime)
{
    if (IsLocallyControlled())
        AO_Pitch = GetBaseAimRotation().Pitch;
    /** Gets proxies characters in server that server don't control. */
    if (GetBaseAimRotation().Pitch > 90.f && !IsLocallyControlled())
    {    /** map pitch from [270, 360] to [-90, 0] because of compression */
        const FVector2D InRange(270.f, 360.f);
        const FVector2d OutRange(-90.f, 0.f);
        float L_AO_Pitch = FMath::GetMappedRangeValueClamped(InRange, OutRange, GetBaseAimRotation().Pitch);
        AO_Pitch = FMath::FInterpTo(AO_Pitch, L_AO_Pitch, DeltaTime, 15.0f);
    }
    else
    {
        AO_Pitch = FMath::FInterpTo(AO_Pitch, GetBaseAimRotation().Pitch, DeltaTime, 15.0f);
    }
}

my code to replicate aiming

#

well it's alerady replicated with GetBaseAimRotation, I am merely interpolating the incoming value

late surge
#

Oh yeah, I was thinking how fps or lyra do the same for rotation replication and you answer it (i think).

dark parcel
#

I don't know how lyra does it. If you want to know, you just gotta dig the source code I guess

thin stratus
#

You can't properly predict it yet. Chaos has some Multiplayer Smoothing by now for that LEGO Fortnite stuff, but overall, Autonomous Physics stuff is not easy to implement into UE.

#

As soon as two people try to interact with the same cube, or affect the same additional cube somehow, you will get problems.

#

Cause both will try to predict it, and both will think they are right.

#

The carried cube can be managed with the RPC + OnRep and some smoothing. But interaction between players is gonna be shite

crimson garden
thin stratus
#
  • NPP doesn't solve Physics prediction
  • NPP is probably quite the shit show still in general
#

I would not dive into it, at least for another couple months, if at all

late surge
dark parcel
crimson garden
formal turtle
#

i was told here yesterday about adding 'islocalcontroller' check but for some reason it spams still errors for me

#

connected players is of type <gamestate> array and its looping through each controller and check if its valid and local, then casts to the playercontroller but for some reason this spams errors when different clients are joining server, thought maybe someone can help with this

tardy fossil
#

should probably call IsValid on the array object before calling GetPlayerController on it

upbeat basin
#

Well there already is a GameState.PlayerArray that is the same as your type (considering <gamestate> is a typo and it's a playerstate array) to begin with

formal turtle
#

playerstate yeah, sorry about that

#

on postlogin adds new player to the state array

#

inside gamestate class

#

otherwise it works as it should

#

i added check for the array object but

#

its now saying about playercontroller being invalid

#

adding another isvalid to the playercontroller fixed the issue but not sure if thats the correct way

upbeat basin
#

Isn't there already a IsValid for controller? Where did you put the extra one?

formal turtle
#

that looks weird but it works lol

upbeat basin
#

I want to say the your elements inside array might be invalid, in case you're adding them the same time they're being created. So like array gets replicated and says "Hey my size is now updated to this" but the object not being in there causing you to have null elements in it

#

Well that's a check for the playerstate, which can go around the problem I stated above

formal turtle
#

gamemode OnPostLogin->cast to the gamestate, pass in the new player state, inside gamestate there is a function which adds the new state to the connectedplayers array, then onrep gets called

upbeat basin
#

Well if you're looking for the correct way here (omitting cpp option if you're dedicated yourself to BP for this project), I might question what's your aim here. Because end result will be just reaching to your local player controller with those checks and casts, which could be handled easier I believe

#

Is it a workaround for not being able to create widgets on PlayerController::BeginPlay even though you're filtering for local control?

formal turtle
#

idk it just felt like putting a bandaid over the issue rather than fixing the underlying issue but i think its to do with timing here and server trying to access these functions whilst i need access to local stuff only to update widgets

#

server is also listenserver in this case so

upbeat basin
#

I'm actually intrigued why you were not able to create widget as listen server, which makes me want to ask if you're %100 sure it's not dedicated server