#multiplayer

1 messages ยท Page 29 of 1

quasi tide
#

Movement is not the issue.

#

It is very specifically rotation

fathom aspen
#

Ez mode you would check if NetMode is ListenServer.

fathom aspen
quasi tide
#

Movement works as expected.

#

I know why it is behaving like this. Just want to be clear about that.

#

Which is why I asked the question that I did.

fathom aspen
#

So basically you are saying that this nasty method is what causing the behavior we see?

quasi tide
#

Yes. Because I tell it to use the default implementation if it's not local.

#

I can't do it another way because I don't have a camera for remote clients.

#

Thus my question

pallid mesa
#

there is a bug on backwards rotation on cmc for orientmovement

quasi tide
#

This is not a bug in my case.

fathom aspen
quasi tide
#

No.

fathom aspen
#

Ok I get it

quasi tide
#

Overriding the method allows me to just check the orientate to movement box and have the CMC rotate shit for me

#

The small window in the video is the correct behavior

#

And it works perfectly fine for local only.

fathom aspen
#

Right, but you don't have camera for sim proxies

quasi tide
#

Correct

#
auto* Controller = Cast<APawn>(GetOwner())->GetController();
if (Controller->IsLocalController())
{
    if (Acceleration.SizeSquared() < KINDA_SMALL_NUMBER)
    {
        // don't rotate if we don't need to
        return CurrentRotation;
    }
    auto Forward = Cast<APlayerController>(Controller)->PlayerCameraManager->GetActorForwardVector().GetSafeNormal().Rotation();
    return Forward;        
}
return Super::ComputeOrientToMovementRotation(CurrentRotation, DeltaTime, DeltaRotation);
pallid mesa
#

this the bug

fathom aspen
#

I hate saying replicating camera's rotation is the solution

quasi tide
#

I know the different ways to solve this. I just want to know if there is something in there that I'm overlooking.

pallid mesa
#

take a read to the github post, maybe it helps to get an insight of things you might be overlooking at

#

specially at the explanation from Hoffman

#

and I mean it, seriously.

#

I've read all you wrote

quasi tide
#

the purpose of ComputeOrientToMovementRotation is to rotate the character's forward vector to match it's acceleration vector. This means if the player is accelerating backwards they will turn around rather than back pedaling.
Yes, this is how I understood the function as well. As well as the intention.

#

And no - I am not encountering this bug (and honestly, never have)

delicate adder
#

Anyone know a source for a logspam of:

LogNetPlayerMovement: Error: ServerSendMoveResponse: Failed to find a NetConnection/PackageMap for data serialization!
?

quasi tide
#

Again - I already know the why, the how, and potential fixes. I was simply asking if anyone knew any other approach.

pallid mesa
#

using the controller yaw input and disabling orientrot

fathom aspen
#

And wasn't accepted? Weird

pallid mesa
#

its a tough problem

#

since for me and in my brain...

#

it makes sense that when you backpedal

#

it just...backpedals

#

but apparently this isn't desired

#

LOL

fathom aspen
#

Good that I'm not the only grounded kid for once

quasi tide
#

I would not expect the character to back peddle if I have a boolean flipped called "orient rotation towards movement"

pallid mesa
#

I haven't checked to see if something has changed to fix this

#

the fact i found out this way of doing tank control was rather interesting lol

quasi tide
# pallid mesa using the controller yaw input and disabling orientrot

This doesn't solve the problem either. The problem is not with the local machine. It is specifically with the remote machine. It is happening because it is using the default implementation for how the calculate the rotation. If I only use controller yaw, the problem ends up being the same, just slightly different.

pallid mesa
#

but if u use the controller rotation and turn off the orient rotation to movement... then remote machines will see the rotation you've set locally in your controller, dont they? (Unless I'm missing something, I'm half asleep)

delicate adder
pallid mesa
#

you shouldn't be doing that, no

split siren
#

If there are 2 variables I need to replicate together and have it guaranteed that they will not be replicated separately, is wrapping them in an Atomic Ustruct the correct approach?

fathom aspen
#

That is if they are POD types

#

And they are changed at the same frame, or a frame before the frame where they gathered for replication

split siren
#

After rapid googling, do I assume correctly that FVector is not POD since it has constructor?

fathom aspen
#

In Unreal terms, non-PODs are: UObjects and FString (or prolly FText?) FNames

split siren
#

So pointer would not be guaranteed to arrive in the same frame as the pod counterparts. And that would re-trigger the OnRep function.

fathom aspen
#

Right. OnRep is your friend there

split siren
#

Is there any other way to replicate the whole Ustruct? Or wait for it to arrive completely? I guess something like that has to be implemented already, since we can do RPC calls with ustructs.

fathom aspen
#

Keep track of OnReps and notify server of when they are all called

#

There is PostRepNotifies but that is at the actor level

split siren
#

Thanks so much for the explanations. How would I know as a client that I have received the whole Ustruct to know when to notify the server? Is there like hash of the ustruct to compare what I have received with?

fathom aspen
#

I don't think there is. Seems like you will have to do it yourself. I guess you can do it at the time you deserialize inside NetSerialize. Check that the data you got is valid and mark a bitflag that you always check if was all marked to fire your own "PostRepNotify"

#

And on another note, I think if you change the structs properties at the same frame you will get them to replicate in the same packet, regardless of whether the struct is atomic or not. Atomic though guarantees that you never end up in a state client-side that never existed server-side because by nature it replicates the whole struct each time an update to one of its properties is sent

pallid mesa
#

lmao I jut wrote an article about that ๐Ÿคฃ

split siren
#

Oh really? Would you mind sharing it?

#

I would love to learn more

pallid mesa
#

check pinned comments

fathom aspen
fathom aspen
fathom aspen
pallid mesa
#

wait why

#

i dont see correlation between the POD concept from C and this

#

is there a new definition for POD types that... I dont know of?

fathom aspen
#
/**
 * FNetBitReader
 *    A bit reader that serializes FNames and UObject* through
 *    a network packagemap.
 */
#

They are the "unmapped properties"

pallid mesa
#

why is that? Any reason?

fathom aspen
#

๐Ÿ˜›

pallid mesa
#

i understand for uobjects

#

but what's the deal with fnames?

fathom aspen
#

Good question.

#

legacy reasons?

pallid mesa
#

you can ignore my question if you like, I'm completely asleep X'D

fathom aspen
#

Nah I asked myself the same question, but couldn't answer it so it's fine.

#

This is the point where I wait for 3rd party to come in

pallid mesa
#

Yes because... FStrings

#

and FNames...

fathom aspen
#

And things... got complicated ๐Ÿ˜”

pallid mesa
#

hahaha

#

yeap that rings a bell

#

when did it get deprecated?

#

Any reason?

#

I see! Makes sense

fathom aspen
#

But I can still say POD just fine in #cpp right?

pallid mesa
#

tbh... I've been stuck in 11 for a long time (outside unreal)

#

I've been learning modern C++ just recently haha

#

legacy reasons mostly

#

same reason ive been using opengl es 2.0

fathom aspen
pallid mesa
#

its noted down already

#

Latest I did was a silly exercise with concepts

#

yes, as I said I've been lately learning it haha

delicate adder
pallid mesa
#

you dont need to

delicate adder
#

Well if I don't set it manually, it is a SimulatedProxy, and Gameplay Ability System doesn't let you activate abilities if you are SimulatedProxy ๐Ÿ˜ฆ

fathom aspen
delicate adder
#

๐Ÿค”

fathom aspen
#

Yes, that is a good point to think about

delicate adder
#

Failure to call Super ๐Ÿคฆโ€โ™‚๏ธ

still arch
#

Quick question, on my character in begin play I server RPC spawn another ACharacter which will act as a "follower" of sorts.
When i try this in game with 1 player it spawns 1 follower, when 2 player it spawns 2, but then when I try 3 players, it spawns 4, and for 4 players 6 are spawned.

#

I cant really understand why I get this behaviour, anyone has any clue?

fathom aspen
#

Because firing server RPCs isn't reliable in BeginPlay

#

And in any other event before the actor is possessed

still arch
#

Alright, that makes sense, that was sloppy of me.

fathom aspen
#

That being said, you should fire server RPCs from events like:

  1. OnRep_Owner
  2. OnRep_Controller
  3. Restart
  4. AcknowledgePossession
#

I'm biased to 3

#

Don't know if that's by chance, or if that's because it stands for my birth month

still arch
#

Thank you, I will read up on all those and find what's best suitable.
Basically, when my character spawns, I want an animation for the follower to play and then for it to spawn.

#

3 is my birth month aswell, so it seems like a place to start atleast!

fathom aspen
#

Keep in mind that BeginPlay fires on both, server and client

#

So you don't need to fire server RPCs at all

#

Just check if(HasAuthority()) and that means you're on server

fathom aspen
still arch
#

Yes, that's why I picked ACharacter, so that movement gets replicated out the gate. I hope that applies to SetActorLocation and things like that as well. In the future I also aim to be able to "Take over" the follower and fly around as it.

#

Short answer, yes, it should be replicated.

fathom aspen
#

I'm not sure what you mean by "follower", but it seems like you want to attach it to character's mesh/root

#

And yeah make sure it's set to replicate and you spawn it server side like I demonstrated before

#

No RPCs involved

still arch
#

It's a bot, that follows you around and that you will be able to interact with and that will fight with you basically.
Can I attach a Character to an actor?

fathom aspen
#

Oh then you don't want to attach xD

#

It has its own CMC, as it's a character after all I suppose

#

And yeah following should be done by BTs and all that jazz

still arch
#

I thought that was smart, to get the movement replicated and for me to implement some kind of posess functionality where I can fly around as the bot so to speak. BT's? what does that acronym stand for? Need to look that up, I was planning to add some following logic in the Tick function on the Character.

fathom aspen
#

Behavior Tree(s)

#

I mean if you want flying mode then your CMC should support that. I'm not that super fledged with the CMC to say what it entails and what it doesn't. You also got floating pawn movement component, but that isn't networked.

still arch
#

Alright, you've given me a lot of things to research, this is great. Thank you.

#

@fathom aspen If I do it in Restart and with "HasAuthority" the bot only seems to spawn for the clients and not for the listen server.

#

Just realized, sorry for pining you.

fathom aspen
#

HasAuthority was meant for BeginPlay, but it should work fine even for Restart

still arch
#

Alright, I'll do some debugging, when I do server RPC I get one extra bot so something is off.

fathom aspen
#

Ah nvm, Restart doesn't fire for simulated proxies, so you won't see the follower spawned for them

#

Use BeginPlay with HasAuthority

#

Again, you don't need to RPC at all

still arch
#

Where can I find info on what functions run where?

#

Or is that something you pick up along the way?

fathom aspen
#

Just trace the function and know when it's called

#

Exactly, more of an experience than anything else

tame pier
#

Is it realistic to want to start working on simple networking if I'm just now learning c++

#

with some previous coding experience

#

So I've heard

#

Im thinking of just between friends, 3rd person shooter pvp, with abilities and some AI

short arrow
#

Some games can show you packet loss (pretty sure fortnite does) anyone know how it's done?

#

it shows you in a packaged game.

fathom aspen
#

I should have checked if it has deprecated stuff, sigh

#

ShooterGame ftw

tame pier
#

:(

fathom aspen
#

No idea why it took me long to find that nasty message of mine

#

As noted beneath it, UNetConnection has all that packet loss properties

tame pier
#

What about it is really complicated? Just asking as a precaution
Telling the server a player pressed W and then running code based on that sounds simple enough, doesn't this apply to everything else? Bullets etc

#

or I should ask whats the most complicated aspect in a game like that

fathom aspen
fathom aspen
#

You can be hit by different level of complexities, and what feels complex for one might be easy for other

quasi tide
#

Yeah - what you're wanting is definitely not simple in execution.

#

Conceptually it is simple, sure.

#

To the end player it is simple, sure.

#

But actually doing it? Definitely not.

tame pier
#

๐Ÿ˜ญ

quasi tide
#

Oh I know - I'll just tell the server that I hit the player and pass the player ref. Easy.

#

Congrats - you have now introduced an easy way to cheat

#

With AI as well - don't forget that

#

And abilities.

tame pier
#

well abilities are basically bullets

#

:p

quasi tide
#

Do you want bullet drop?

tame pier
#

hmm, sure?

quasi tide
#

๐Ÿ™ƒ

tame pier
#

what

quasi tide
#

That's more complexity on top of what you already have, lol

tame pier
#

surely you can just tell the server bullet position

#

and its dropping by x

quasi tide
#

Absolutely.

#

And surely I can fake it

fathom aspen
#

But it's easy to server-rewind

quasi tide
#

Yeah - if you're James

fathom aspen
#

I wish MP was easy Sadegcry

tame pier
#

have you done anything similar?

fathom aspen
#

Wondering if that's the reason why #multiplayer keeps being calm

quasi tide
#

It's calm because f*** networking. But also โค๏ธ networking

#

At least you know that it is your move as well.

fathom aspen
#

That is too hard for me. I'm making Arma using BP-only and with the help of Udemy + YT

quasi tide
#

You own it. Not some 3rd party server

fathom aspen
#

Yeah how come I forget, I already watched that 8 hours YT video to conclude that

wintry dirge
#

Hey Zlo, I've come across this double speed animation issue today, did you discover any other solutions?

Running Standalone, as the listen server, or Running 2+ clients shows no animation play rate issues

Running 1 client makes the animations play at 2x play rate

tame pier
fathom aspen
#
  1. Ensure objects are stably named.
  2. Async load stuff.

EZ.

#

I'm sure someone did, because I can hear asynchronous music playing in the background

#

Host migration you mean?

#

Because that can be understood as host migration heh

#

Then that must be some sorcery I haven't learned/discovered yet

#

And it's funny because it has mmo in it kek

#

That he fears to uncover because things... might get complicated

#

Cool, Laura was right

uncut atlas
#

i know about online subsystem steam and how u can setup player hosted servers (listen servers). does the session interface work on consoles as well (xbox & playstation) to set up listen servers?

fathom aspen
#

Here's a fun question: Why does an object (non-Actor specifically) persist a seamless travel when outer'd to a persistent object?

#

Example: Create a UObject, outer it to GameInstance, seamless travel, that UObject persists to the new level

quasi tide
#

Hunter is 100% working on an MMO in UE. Ashes of Creation. Was on my radar like 2 years ago, but kinda just dropped off ๐Ÿ˜…

fathom aspen
#

Hunter you should work harder to bring it to Duro's radar again

#

I have faith in you

quasi tide
#

Well it dropped off because it was in like paid early access alpha, but the price was too high for my tastes.

#

So I was just like, ehhh - I'll wait n' see.

#

Wizard gameplay needs to be fun for me to enjoy it though ๐Ÿ˜…

fathom aspen
#

I watched a trailer of it a while ago and it was fun. Should prolly watch gameplay footage and see how it goes

still rampart
#

I havnt used it yet but Ive been considering it

#

Scratch that I got confused on which plugin I was talking about

fathom aspen
#

UE5Coro has nothing to do with that heh

#

Unless @whole grove made sure it does by the grace of dragonHell

quasi tide
#

Coro just makes doing coroutines in UE5 easier/possible.

#

How you decide to use it is completely up to you

#

You must be using C++20 to use it though.

#

Because it relies on the coroutine stuff in C++20

fathom aspen
#

Oh I'm on phone and I literally forgot what 2) was lol. I see now how they related to coro xD

lilac drift
#

I've been working on a multiplayer game for a few days and am working on my respawn function. Currently I have it set up to create a new first person character at a spawn point. How can I make my possess function run on the server but then pass my client's player controller through to the possess function?

rose egret
#

how do I get previous value in BP OnRep_ ? is it possible ?

upbeat basin
upbeat basin
upbeat basin
winged badger
#

whenever OnRep fires you can store the Value into OldValue

#

and OldValue will be pre "replication" value

upbeat basin
winged badger
#

a normal variable in that blueprint of the same type

#

its ugly, but hardly more so then BP OnRep is

upbeat basin
#

Oh you mean holding another variable for the old value, I see

#

So still no builtin support for it on BP right?

winged badger
#

BP doesn't even have OnRep

#

its a property changed callback, not replication callback

#

you can set the value locally on client and watch the OnRep fire

#

so i wouldn't hold my breath for an overloaded blueprint replication callback function anytime soon

regal geyser
#

When 2 characters with capsule radius bump into each other, there is a good chance that they will get "stuck" meaning one clients needs to avoid the other one. Is there a way how I could implement "slippery" capsule radius, meaning when 2 clients bump into each other they will just "slide" around each other and continue in their path?

There's RVOAvoidance which pretty much does what I need, the issue is that this doesn't work (If i'm correct) in multiplayer games, because clients will suffer from severe network corrections.

chrome bay
#

RVOAvoidance is for AI anyway, so it doesn't help MP. Technically characters will slide around each other, but because you get updates about them at different times, it's very likely they could just be snapped into each other. There's not really a closed form solution.

#

The simplest method is to make players ignore each other when moving, or you could try adding a thinner capsule which blocks pawns inside the existing ones. You could also force characters which are overlapping after moving to ignore each other.

elder sable
#

I try to replicate an array of actors in my gamestate with a replicatedusing function, someone told me the array shoudl be fully replicated but some actors are null in the array. I added the gamestate as owner to those actors, and set alwaysrelevant et replicated in the ctors, did i forgot something ?

chrome bay
#

It won't be fully replicated

fathom aspen
#

The OnRep will fire each time one of its elements replicates

elder sable
#

Oh, when can i know when it will be ?

chrome bay
#

Zero guarantee the array will be full of valid pointers, even if they are always relevant

#

You have to check each time OnRep is called

fathom aspen
#

There is nothing like this OnRep fired -> the array has fully replicated

chrome bay
#

OnRep will also be called when it changes size - it could have no valid ptrs

elder sable
#

Mhh is that better to use rpc then ? Looks annoying

chrome bay
#

no it's not

fathom aspen
#

Golden rule time

chrome bay
#

State = properties

#

RPC = events only

elder sable
#

So i have to loop on the array to check element validity every time ?

chrome bay
#

yes

elder sable
#

๐Ÿ˜ฆ ok

chrome bay
#

But you should expect to do this whenever you're dealing with pointers to other objects

elder sable
#

Mhh

fathom aspen
#

James, what do you think the reason FNames are assigned NetGUIDs? Vori asked me that last night and I couldn't answer lol

chrome bay
#

I don't think they actually are - last time I checked the only FNames that replicate via ID are the hardcoded ones in names.inl or whatever that file is

#

But if I had to guess I'd say maybe it's a legacy thing for package names

#

Though Epic did plan to add this, like 4 years ago

#

Would be nice tbh - so many things could benefit from FNames replicating via GUID instead of string

#

I think Coalition added that

fathom aspen
#

I see, yeah makes sense. Thanks!

scenic turtle
#

Hello everyone, I would like to know how to do that after selecting a particular character to spawns on client side and then we travel to the server map, we spawn as that character and not the default one. (as It currently happens). Should I store this selected Pawn actor in the Game Instance or the Game state or? Thanks for the help.

upbeat basin
#

My recommendation and experience was setting the Character as None (so it won't be created automatically) and spawning it with desired class at desired time from server

jade patrol
#

hey, is it possible to test reconnection of the client in pie? i tried open 127.0.0.1 from console but it does not work

upbeat basin
#

Also if initial connections are okay for your case, it's possible to add clients during PIE runtime

jade patrol
#

oh, how can i do that?

upbeat basin
#

You'll get this Add Client button during PIE on this panel when you enable it

scenic turtle
#

Because currently it will just spawn me as the default character

upbeat basin
#

I wish we could set the number of clients to 0 and let dedicated server run its own from PIE as well but I guess that's not possible

jade patrol
upbeat basin
scenic turtle
upbeat basin
#

I see, if that's the case GameInstance is what you're looking for. It's a singleton that persist during the entire duration of your running game client. But it doesn't replicate. So it can be used to store values between levels. That's what you read I believe

#

Once you're connected to server you'll need to send that variable to server with an RPC though. GameInstance doesn't replicated, it only exists for each standalone game instance (hence the game I guess)

#

And then you'll need to spawn the character and possess on server

#

But be aware that this is not the most secure way to do as you tell server what to do from your client. Someone can hack your game to select a character that they don't own, for example

fathom aspen
upbeat basin
scenic turtle
#

Okay will check the pins and will try to work with the GameInstance class, so basically I would have to forward that variable to the GameMode in the end, right? Sure WizardCell, thanks for the input also.

fathom aspen
#

Also that's if you are hard traveling, if I'm seamless traveling I will be using PlayerState::CopyProperties

fathom aspen
#

GameMode is server-side tho

#

So retrieving GameInstance in GameMode will end up retrieving the server-sided one sadly

scenic turtle
#

Right, so how would I get this character variable to the game mode through Player Controller?

fathom aspen
#

Correct

#

You got the plot

scenic turtle
#

GameInstance-> Player Controller-> Gamemode then

fathom aspen
#

Pretty much yeah

scenic turtle
#

okay, will figure it out then thanks so much for the help WizardCell & Layso!

verbal tendon
#

Has anyone done custom non game-related UDP connections before through UDP? I'd be curious what classes were used for handling the connection as well as data serialization on both the sending and receiving end. I'm designing a plugin that connected from the packaged game to a plugin that runs inside the editor

random nymph
#

Every now and then some of our clients get this repeated in their log file when failing to join a multiplayer game with IP
[2022.11.07-12.29.35:440][ 21]PacketHandlerLog: FAESGCMHandlerComponent::Incoming: received encrypted packet before key was set, ignoring.
Any ideas?

lilac drift
upbeat basin
#

That's why I asked if you're asking how are you going to find that controller on server, because there is no way to do it from client

grizzled stirrup
#

Asked a few days ago in #online-subsystems but no response, thought it may be worth trying there. It seems sessions can be destroyed without players being kicked and the match goes on without any issue. Does this mean that sessions are purely used to get other players to join your game, and once they have joined (and assuming joining in progress isn't intended), sessions can be destroyed without affecting the outcome of the match?

#

I am mainly asking to try and get around what seems to be a bug: if I disable join in progress once a match has started, but after a match I re-enable the allow join in progress bool and update the session settings, new players still can't join. However if I destroy the session back in the lobby and create a new session that allows joining in progress, both the players from the previous game / session stay in the lobby AND new players can join

#

It seems to all work fine now I'm just wondering if this could cause any issues that I haven't encountered

chrome bay
#

Sort of makes sense really, the session exists mostly for the online backend side of things. I expect if you kill the session, Steam would no longer show what server you are in for instance.

grizzled stirrup
#

So I imagined if the session was destroyed, players would be kicked

#

But doesn't seem to be the case which means my workaround here is likely fine

chrome bay
#

It might be diff platforms behave differently but I honestly don't know. There's probably a lot of "bad" stuff that occurs if you're connected to a server that you aren't actually in a session with

#

But I've no idea, rather not find out ๐Ÿ˜„

grizzled stirrup
#

I wish the update join in progress bool thing would work as intended so I don't have to do this ๐Ÿ˜„

#

But I'll keep an eye out on strange behavior on other platforms

#

Since players that are brought back to the lobby when the current session is destroyed and the new one is created aren't technically in the session anymore

#

Which actually creates other problems since it could mean too many players join a lobby.... ok need to find another way around it I think ๐Ÿ˜„

pine reef
#

Hi I'm studying multiplayer in a top down template and what I'm trying to achieve is to replicate that cursor movement in order that all player could see all cursors. The setup I did, I think it's setting the same position to all instead of respecting each user

unborn solstice
#

Hi, I try to create multiplayer game. I have a problem
When I want to kill enemy from server - its okey, but from client - its work only at client.
Replications in enemy blueprint included. When I debug my code, I release that the problem is when I want co cast my weapon blueprint to enemy blueprint - its does not working. But I can cast to third percon character from weapon blueprint. How to make when client kill enemy - server know about it.

pine reef
verbal tendon
pine reef
fathom aspen
#

GetPlayerController(0) spotted

pine reef
#

and how it should be?

fathom aspen
#

You want to use GetController

#

And gate tick with IsLocallyControlled

fathom aspen
#

Not in multiplayer at least

pine reef
#

thank you

#

how Im going to connect those?

fathom aspen
# pine reef

Literally just replace GetPlayerController(0) with GetController

#

Ah you want to cast to PlayerController

pine reef
#

alright

fathom aspen
#

And you're good to go

pine reef
#

it worked thank you @fathom aspen

dawn verge
#

Can anyone help me out this scenario?
I'm trying to develop a multiplayer persistent world game with a dedicated server and i want a service that manages player data and functions like logging them in and their last positions and their inventory.....I need some guidance as i have searched about online but i only got how to do that for peer to peer games but not for dedicated servers.... Can anyone help? Please DM

fathom aspen
#

Have you checked last message in pins?

pseudo gull
fathom aspen
#

tl;dr not going to be an easy task

pseudo gull
#

bump, wonder how most of the apps like virbella, spatial , or bigscreen out there got it working

fathom aspen
#

Because they have a whole team dedicated to that and again because it's possible.

unborn solstice
pine reef
#

oh my bad, it's not fully working yet. the cursor from server is replicated, but the client is not

fathom aspen
fathom aspen
#

How do you set that?

pine reef
#

sorry, I dont understand the question

#

the cursor is that decal from top down template

fathom aspen
#

"Curosor to World" property that you supply the server RPC with

#

I just want to see how you set that property

pine reef
fathom aspen
#

Oh ok

#

Are decals stably named? They are if they are added through the SCS

pine reef
#

is there a chance that this cats is failing when is client?

fathom aspen
#

That's the question you should be asking the compiler

#

Or debugger**

#

Debug

unborn solstice
fathom aspen
#

Ok let's start with ditching GetPlayerCharacter(0)

fathom aspen
unborn solstice
#

this is the weapon, what spawn at the begin play for the player

fathom aspen
#

Then when you spawn the weapon you want to assign the character as owner

void dagger
#

I am working on a project that is built on top of the Collab Viewer template. I have added a comment list to store all annotations created, display them to all users and also have the ability to delete annotations and have them delete everywhere for everyone. I was able to succesfully add these annotations to the server and replicate them to the client, but am having some issues when trying to delete the annotation from the list.

It is meant to be deleted when the plater click on the 'x' of the BP_AnnotationText scene component. Therefore, whenever the player clicks on the 'x', it loops through an array that stores all annotation created and finds the matching annotation and BP_AnnotationText by comparing their comment entries. The problem arises when I try to set a variable that stores the specific annotation reference that has to be deleted. I am doing this the same way the Collab Viewer template sets variables on the sever for every component necessary in BP_AnnotationText, but when it reaches the event that sets the variable 'AnnotationToRemove' it reaches as 'none', How can this happen if were passing it as soon as it finds it.

Below I will attach screenshots of the process I just explained.

Image 1: loops through array and finds annotation to delete, then returns it.

Image 2: function in image 1 and 3 is executed when player clicks on 'x'

Image 3: AnnotationToRemove is set on server (this is where the variable is being set to NONE.)

Image 4: finds annotation to remove and executes (at this point variable is obviously none since its not being set correctly in image 3).

Thank you.

fathom aspen
void dagger
#

please heelp

vestal bobcat
#

Could someone explain to me why, if an actor is placed in the level by hand (through the editor before runtime) is considered unowned ? I was expecting such actors to be owned by the server, but they are server owned only if spawned by a server RPC.

fathom aspen
#

Owner is an actor. An actor is never owned unless assigned an owner. Server-owned actors are actors that their owner is anything but an actor that links back to a UNetConnection. Any other actors (null-owned) behave pretty much like their server-owned counterparts.

#

So null-owned actors or server-owned are under the server-owned umbrella

vestal bobcat
#

ok thanks for the info. However I stumbled upon some differences between the two especially with RPCs. A server RPC from unowned actor was dropped, if invoked from a client for example.

fathom aspen
#

Even if server-owned, it will still get dropped.

#

Same behavior

vestal bobcat
#

ohh you are right, I missed that part of the table.

pine reef
#

I just need the cursor from client to replicate

elder sable
#

Replication is server to client

#

You want to send the cursor data to the server ?

pine reef
#

I want that all player can see all players cursor

elder sable
#

Client send data to server and then the server replicates, you need to add the first step

pine reef
#

can you be more specific in where I need t change the code to achieve this behavior? cause from my understanding it's already doing it, I'm sorry that I dont get it

grizzled stirrup
pine reef
#

ok

#

what is the right way to handle this situation ?

elder sable
#

Use something replicated to all clients, PlayerState for example

grizzled stirrup
#

I would periodically replicate down the cursor location as a RepNotify variable and have the client constantly interpolating the position on tick

flint hollow
#

i havent even touched network stuff but i wanna ask anyway. are ragdoll and procedural physics animation at all feasible over network? any session size.

grizzled stirrup
#

Yes but lining them up can be very difficulty. You can have them simulating locally though if differences in the simulation are acceptable

#

Though I know Chaos is now running differently to PhysX in that regard so networked physics may be easier

glad escarp
#

Alright. Maybe a weird/complicated question but here goes:

  • I have a main menu map which pulls up, as you may have already astutely guessed, my main menu.

  • From there, I have a "Host Game" option which starts a session without loading a new map.

*My goal here is to press host game and then it acts as a lobby. Players join and ready up (this functionality is already programmed).

Is there a way to set the listen console command when the map loads in? Or should I be looking to open a new level that is listening when the player clicks on "Host Game"?

grizzled stirrup
#

You can have your game open to an empty map that instantly then opens your lobby level with the ?listen argument, then you can do hosting without travel

flint hollow
latent heart
#

Though you don't really want to start accepting incoming connection requests if you aren't hosting a game.

elder sable
latent heart
#

Even if you later reject them.

grizzled stirrup
#

Opening a level with ?listen doesn't do any sesssion stuff

#

AFAIK at least

elder sable
grizzled stirrup
#

You'd need to create a public session before anyone could join

latent heart
#

That's not a good thing.

grizzled stirrup
#

But would anyone actually be able to join if a session wasn't present? I do it purely out of convenience as I too have a lobby level that you load right into and it's a bit of a pain to have to travel to a new level when starting multiplayer stuff

#

But I'm curious as to ways this could backfire, I can't join or see other players' games until they create a session

latent heart
#

It's akin to "Hey, I'll run my webserver even though I don't need it because I can't be bothered to turn it on or off later" which is absolutely not a security risk.

grizzled stirrup
#

I mean if it's a multiplayer game and you'll be playing via listen servers I'm not sure this is an issue is it?

#

Are you broadcasting or communicating this anywhere? I thought it'll have zero effect on bandwidth or anything else and just if you were to then create a session you could advertise your game

glad escarp
# grizzled stirrup You can have your game open to an empty map that instantly then opens your lobby...

Thanks Kyle that totally makes sense. So let me back-brief to make sure I'm understanding the flow.

  1. My main menu level loads. (there is no session and the level is not listening yet)
  2. My player clicks on "Host Game"
  3. This loads an independent Host Game Level which is listening and which also creates/adds to viewport, my host game widget
  4. From there the host can configure settings and launch the game to server travel all the players in the "lobby" to the selected map.
latent heart
#

It's a security concern. Nothing to do with bandwidth.

#

You shouldn't start opening sockets if you don't need to.

#

It's absolutely awful design.

grizzled stirrup
#

Is it possible to load into a lobby and invite friends without beacons and without traveling though? Just doing it out of convenience

elder sable
glad escarp
grizzled stirrup
#

Beacons are complicated I would stick to listen for now unless you want to get your feet wet, the steam party plugin is a good place to start

elder sable
glad escarp
grizzled stirrup
# latent heart It's a security concern. Nothing to do with bandwidth.

Wouldn't most multiplayer games that use listen servers also have this security concern though? I had thought Steam sockets is fairly secure with the relay stuff. I'm just trying to imagine how this could be exploited, I can move back to a traditional main menu and only travel when sockets are needed but I have a drop in / out kind of system and it sucks to make players quit and reload an autosave if doing multiplayer

latent heart
#

Just because you can't think of a way to exploit them doesn't mean there isn't one.

#

And nobody may ever exploit them, but that isn't a reason to be lax about it.

grizzled stirrup
#

Even so, if it's a drop in / out game, it makes life much easier for players to just invite friends at any time rather than having to leave, hard travel and then restore auto saves before they can join

pine reef
#

I tried the approach of using rep notify in the cursor location, but in the end I have the same result

latent heart
#

You don't store passwords in plain text "just because you're probably never going to be hacked"

glad escarp
latent heart
#

If you want your game to allow hot joins like that, sure, leave the socket open. But usually it's an option for games.

#

Single player vs multiplayer.

grizzled stirrup
#

Yeah I'm just saying that by playing pretty much any multiplayer game with listen servers, the majority of your time will be opening those ports or joining other sessions. I get that it'd be optimal to only open them when creating but that can add a lot of friction to the join process

latent heart
#

And it's definitely not required when you're just sitting in a menu.

grizzled stirrup
#

Yeah I may look into a better system and force players to travel when hosting in that case

latent heart
#

Tbh, the real issue is UE requiring you to re-open the map to change netmode if that's even true.

grizzled stirrup
#

I haven't found a way to get other players to join without opening a map with ?listen but I'd LOVE to be proven wrong

#

As it would make life much easier

latent heart
#

Yeah.

glad escarp
latent heart
#

I'm not saying it's easy or desirable to have to manage sockets, but you should at least try to be careful. ๐Ÿ™‚

grizzled stirrup
#

Yeah I hadn't really thought about it, I had thought about it more like, open the level with multiplayer in mind should players choose to play that way or not

#

Rather than have to figure out separate paths for single and multiplayer

#

As mentioned, having to deal with auto saves and hard travels mid game is frustrating for players

#

Who may just want their friends to join the action without interruption

latent heart
#

Absolutely.

#

Usually thjat's just handled with something like a private / friends only / open type option when you start a game.

grizzled stirrup
#

Yeah! In this case you load into a hub so I suppose I could make players start their session as a multiplayer session, re-travel to the hub and then start playing

#

Then they could do drop ins with less friction

latent heart
#
#

Looks like it requires an engine change for full support

#

But you can do it once without issue.

grizzled stirrup
#

No way that's great

#

Thanks for the find

latent heart
#

Np

glad escarp
#

Wow. I've even google searched "Unreal Engine switch to listen server without loading new map" and didn't find that. You're a wizard

grizzled stirrup
#

Looks like no engine modifications needed at least from what I can see

#

Seems to be just 2 func overrdies

latent heart
#

unreal engine start and stop listening for connections without changing map

#

๐Ÿ˜›

glad escarp
latent heart
#

Super interested to know if that works!

#

And maybe if you need to maybe make a custom netdriver...

glad escarp
latent heart
#

By "custom net driver" I mean "extend the default netdriver, override a method and copy+paste the code, but take out the line that says 'you can't do that twice'" ๐Ÿ˜›

glad escarp
#

hahaha. I follow you now.

latent heart
#

That's seriously half my current project. I swear 99% of the engine code makes silly assumptions.

glad escarp
#

I suppose that's the main drawback to using a robust framework like UE versus a custom built engine.

safe iris
#

Hey, im new to networking and having issues with my networked point lights not displaying the correct color assigned to them, what can i do about that?

#

hmm thats interesting

#

why wouldnt just a literal variable work?

#

so FLinearColor instead of a replicated variable

#

doesnt really make sense to me

quasi tide
#

Networking is largely a lie. You tell machines across the network the current state of the game and then the code that gets executed makes it look like they are in sync.

#

It needs to be replicated so the light on Machine B shows the correct color.

#

Just setting the color on one machine doesn't mean it'll change on another.

#

You have to tell it to do so.

#

OnRep variables is one way (and the correct way in this case) to accomplish this.

safe iris
#

hmmm

#

understood

#

let me do that right now and update if it works

fathom aspen
#

(It works, you're welcomeโ„ข๏ธ)

safe iris
#

i know but like im not really getting how im supposed to update the variable client side

#
void AEnterTheVOIDPawn::OnRearLightColorUpdate()
{
    if (IsLocallyControlled())
    {
        RearLightColor = FLinearColor::Red;
        GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("CLIENT UPDATED VARIABLE"));
    }
}
#

is locally controlled gets skipped completely

#

or am i supposed to do this some other way

fathom aspen
#

Because you shouldn't be checking IsLocallyControlled

#

It's meaningless

#

And if you do you prolly wanted OwnerOnly replication condition

#

And that's not what you want

#

On server set a replicated property of FLinearColor -> OnRep fires -> Get the point light and set its color to the repped down color

safe iris
#

ok so i have to do RearLightColor = replicated value that i have to get from somewhere?

verbal tendon
#

You're struggling with the basics, there are plenty well documented tutorials on this topic

safe iris
safe iris
#

i suppose ill just keep looking

verbal tendon
#

Please look at the pinned messages. Not Epic's documentation

safe iris
#

oh, okay

fathom aspen
verbal tendon
#

It's also easier to play around with this in Blueprint to get a grasp of how networking works in Unreal, and then look at doing it in C++

#

BP allows you to fail fast and easily, once you really understand how replication and networking works, you then increase the difficulty by doing it in C++

safe iris
#

understood

#

thank you

#

ill try my best

#

i have to do it in c++ tho so its gonna take time ๐Ÿ’€

glad escarp
safe iris
#

IVE DONE IT

#

IVE DONE ITTTTTTTTTTTTTTT

#

YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

#

๐Ÿ˜ˆ

fathom aspen
#

CONGRATSSSSSSSSSSSS

glad escarp
#

So I'm wondering if I'm just beating my head against a wall for no good reason. The easiest flow for a listen server lobby seems to be like this (please correct me if I'm wrong):

  1. Player clicks "host game"
  2. We open a lobby map with ?listen
  3. In this new lobby map, we have a menu that only shows up if the player is the server which has options (or if I want to make it interactible actors in the map, I can just leave them default because if they aren't replicated, only the server player will be able to do anything with them.
  4. Then when players are ready and the host launches the game, we server travel all players to the selected map
fathom aspen
#

Congrats you passed the "listen server class"

glad escarp
latent heart
glad escarp
latent heart
#

Something like that, yes.

#

Replicate the "start game info" struct or whatever

glad escarp
#

ah. ok that makes sense.

proven fog
#

Why would my actor have a different transform when I join a dedicated server, instead of standalone?

fathom aspen
#

Because some other client did so before you joined?

proven fog
#

It's just me

fathom aspen
#

Thought I'm the only one capable of doing sorcery, turned out that dedicated servers have already passed that milestone ๐Ÿ˜”

proven fog
#

Actually the blueprint sets its rotation a couple of seconds into BeginPlay

#

The door is rotated like it should be, the door frame is what has the wrong rotation, but it should already be detached...so I think the detachment is happening on the client after the rotation

fathom aspen
#

This is the point where showing code becomes crucial, but from the sounds of it yes it's something like what you said

proven fog
#

Yeah it was just a rotation that happened on the server before the client connected

peak sentinel
#

@valid imp what decorator?

fathom aspen
#

Decorator is an AI term

peak sentinel
#

but BTs are mostly unrelated in multiplayer context so it confused me

fathom aspen
#

They meant to say RPC type I guess

quasi tide
#

They are 100% talking about RPCs

fathom aspen
#

The answer to your question is because it's not needed by Epic @valid imp

peak sentinel
#

general way of doing it is just having a non RPC function and calling that on both client and server rpc

fathom aspen
#

Pretty much the same reason why TMaps are not replicated yet

#

I like how we answering the OP without them taking part in the conversation

peak sentinel
#

and why category sorting is not done etc etc

peak sentinel
fathom aspen
#

Ah so we are talking via beacons now?

peak sentinel
#

oh thats something i never studied yet PandaOhNo

quasi tide
#

The engine is so vast ๐Ÿ˜…

quasi tide
valid imp
#

Aarg you are answering here!

quasi tide
#

Yeah - multiplayer stuff being answered in #multiplayer. Wild.

peak sentinel
valid imp
fathom aspen
#

Wait dragonHell told you that? When are they fixing dormancy in BP then?

peak sentinel
quasi tide
#

Annotations or decorators are fine. But in UE, they're not either. They're macros.

peak sentinel
#

Decorator == property specifier btw.

quasi tide
#

There is no @ syntax for UE

peak sentinel
#

#define @ Evil_Patrick

quasi tide
#

Which is what UFUNCTION()'s are

valid imp
#

Woops

#

My mind is tricking me

peak sentinel
#

I'm lost btw, but Duroxx seems to understand the questions

quasi tide
#

UFUNCTION(Server, Reliable) is still a macro.

peak sentinel
#

so I can leave bye

valid imp
#

Alright, UFUNCTION is a macro, good. I apologize for the confusion, I spent too much time doing TS at work.

#

CodeGenerationMacroAnnotationThingy then

fathom aspen
quasi tide
#

Playing multiplayer is fun. Making multiplayer is the exact opposite.

valid imp
#

Is it fun writing your own CGMATs ๐Ÿ˜„ ?

fathom aspen
valid imp
#

I just want to do less boilerplate like this:

    void ServerOwningMyFunc(); // Call MyFunc(), and if not locally controlled also call ClientMyFunc()
    UFUNCTION(Client, Reliable)
    void ClientMyFunc(); // Will just call MyFunc()
    void MyFunc();
thin stratus
#

Multiplayer gave me depression

peak sentinel
quasi tide
#

compendium bible

peak sentinel
#

but still pain

#

and confusing for new teammates to adapt

fathom aspen
peak sentinel
#

i love bread

valid imp
#

If I wanted a nice little project with plenty of teammates I'd do something simple and singleplayer ๐Ÿ˜ฆ

thin stratus
#

I think it's too late for that haha

#

But, the good thing is, I'm now in the position to make my employees suffer through Multiplayer, so I don't have to.

quasi tide
#

Progress

peak sentinel
#

but to make UHT parse custom specifiers that are not meta, you gotta fork

fathom aspen
valid imp
#

Cool, I'll check that out. Thank you ๐Ÿ™‚

fathom aspen
#

I will make sure to upvote when you PR

peak sentinel
#

there is also a plugin named UnLua might give more insights than LuaScriptGeneratorInterface thing

twilit radish
thin stratus
#

I just want less boilerplate code overall. The amount if sh*t to write if you want to keep proper access restriction of variables

twilit radish
#

Meta=(AllowPrivateAccess="true")

#

๐Ÿ˜„

thin stratus
#

I need UHT to just generate me some public getter I can implement if I want

#

And Setter

fathom aspen
#

I kept saying I want less boilerplate until I discovered GAS

thin stratus
#

HAHA

#

That shit fest

fathom aspen
#

I'm dead, that was quick

twilit radish
#

There's a reason Laura is the Microsoft CEO of programming.

thin stratus
#

*despressionยฒ

peak sentinel
twilit radish
thin stratus
#

@fathom aspen GAS made me finally create an internal Plugin that exposes all the stuff that I need in almost every project

peak sentinel
#

ComposableGas

thin stratus
#

SaltyCore

fathom aspen
peak sentinel
thin stratus
#

It basically has almost all GameFramework classes with all the extra code that one might need in BP + all the boiler plate Code for GAS, and DataAsset stuff

twilit radish
thin stratus
#

Just not Game Specific things

peak sentinel
#

I thought of that too, though was too busy and I hated gas back then so I gave up before starting.. But I guess I'm going to have to create one soon

thin stratus
#

Like, right now you can basically create LazyLoaded GAS Character or Actors just by adding the Plugin.
Only thing I haven't added yet is some automated way to add ini entries

#

Removes a ton of mindless code work

#

Specially all those AbilityTasks and AsyncTasks that GAS kinda needs

thin stratus
twilit radish
#

I know. But still flashbacks ๐Ÿคฃ

thin stratus
#

hehe

peak sentinel
#

like only one of them works, rest of them has empty tick function or just dont work

twilit radish
#

We should all make a company together named "Unreal Slackers & Co", make a MMORPG, fail horribly and then run away with the kick starter money for the game. ~~Also sorry if I'm being way too off-topic. Goes towards #lounge ~~

fathom aspen
peak sentinel
#

oh yeah, that was hilarious to read

quasi tide
#

And they never went back and fixed it

fathom aspen
#

Butbutbut they will after they make the fortnite skins

verbal tendon
fathom aspen
#

Pretty sure they did

#

If Manny/Quinn could give daily reminders to gate with authority and use OnReps

verbal tendon
#

That would probably explain the observed behaviour. Client doing BeginPlay logic when they join the server, resulting in dev looking confused ๐Ÿ˜„

#

Every time I find one of Epic's TODOs I lose a little faith in humanity, ngl ๐Ÿ˜‚

quasi tide
#

Meh - UE is still the best 3D engine available to us peasants. By no small margin either.

fathom aspen
#

Ok then your punishment is to Livecode 1000x starting now

#

I should have told you to convert all your cpp structs into BP ones ๐Ÿ˜”

stone niche
#

Hi, I am running a dedicated server for a multiplayer FPS. After just over two hours without restarting or changing a level, I get the server hitching for 250ms every 24 seconds.
After investigation I found this starts at 8192 seconds server time, reload the level, server time starts back at zero, all fine till 8192 seconds then the movement corrections start again.
This does not happen in PIE, only in Development and Staging releases.
Any ideas if this is a known thing? it seems kind of specific as 8192 is a power2 number.

hexed pewter
#

I wanted to test joining/creating multiplayer session from 1 computer using oracle virtual box, but I have this issue where virtual machine only supports up to 256 of vram. Is there any way around this, should I use different program for creating virtual machines?

fathom aspen
#

laughs in double

stone niche
#

4.27 and 5.0

fathom aspen
#

Wow, 5.1 is our savior, I can't count the number of bugs they fixed

peak sentinel
#

do double even replicate

#

never tried

quasi tide
peak sentinel
#

what skelewhy

fathom aspen
#

But I still need that to trigger the old damage system

peak sentinel
stone niche
#

Thanks, I'll give it a try, was waiting to 5.1 full release for some other fixes when they broke non-seamless travel.

fathom aspen
#

They screwed seamless too, so it's fine

quasi tide
#

I'm indifferent about #enhanced-input-system. On one hand, I like the new stuff. On the other, I don't want to learn another darn thing, as well as make my input be asset based.

peak sentinel
#

inputs are asset based now?

quasi tide
#

Your mapping, yes.

peak sentinel
#

offtopic but your twitter banner is hilarious ๐Ÿ˜„

#

"designing scalable experiences for large player counts"
solution: ||kill them||

olive kraken
#

Steam doesn't allow no-seamless travel, correct?
I'm trying to get a hard reset of a level, and a travel that destroys and reconstruct everything would be ideal. Any way around of traveling without using seamless and using steam?

fathom aspen
#

Edit Steam SDK?

olive kraken
#

haha

#

gotcha

#

So it comes all from their side

fathom aspen
#

But why is the question tbh? Seamless is preferred over non-seamless anyways

#

Peeps are dying to seamless travel between servers depression

olive kraken
#

It is just a bunch of things to keep track and reconstruct, garbage collect, reset state of many things (doors, gates, etc)

fathom aspen
#

Have you checked AGameModeBase::ResetLevel()?

olive kraken
#

yeah

#

which fires a reset per actor with its own logic, correct?

#

thing is, that is gonna be a big bunch of work

#

cause most of objects have a ton of states

#

maybe lazyness, was trying to pull the cable of hard reset

fathom aspen
#

That is still preferred over non-seamless traveling.

olive kraken
#

yeah, experimented with that, proceduralism doesnt fit well

#

need to travel to another level, and go back to the same one

#

seamless travel to the same level won't fire most of the function I need to fire in the game mode

#

only the swap controller event

fathom aspen
#

Prolly there is some type of sorcery you can do to reset actors to their CDO state

olive kraken
#

yeah, that is why I was brute forcing things as much as I could

#

guess I'm looking for something a bit more customize that need some backend

#

will play around with reset anyway

#

wanted to confirm the steam limitation before I get paranoid ๐Ÿ™‚

#

thanks for that

glad escarp
#

Another random question for you smart folks: Isn't the GameMode override on a map supposed to override your last game mode? I'm opening a new map from my main menu widget and it doesn't spawn in with the right pawn or controller

stone niche
#

We use Steam and hard travel, you cannot do a seamless when switching game modes and levels, even if you try seamless the UE code drops back to a hard travel.
It is just that the Steam subsystem is bugged in 5.0 so the connection is lost and we have to join the server again, its fixed in 5.1 though.

fathom aspen
#

Also make sure you save if you're doing that standalone

glad escarp
fathom aspen
#

Then check what GameMode is being spawned and why

#
GameMode: Created by GameInstance when server loads the map inside UGameInstance::CreateGameModeForURL(), called by UWorld::SetGameMode(), called by UEngine::LoadMap().
#

"cycle" doesn't seem the correct word in this context, maybe I should just replace it with "calls"?

#

Violence is my middle name

#

order seems nice. Should I give you props:jk: in the article now?

quasi tide
#

"Shoutout to Laura from the Unreal Slackers Discord for helping with clarifying some details"

glad escarp
fathom aspen
quasi tide
#

If it weren't for Tim Sweeney, we wouldn't be having this conversation. So thanks Papa Tim.

fathom aspen
#

Can I hot reload instead?

#

Give me the description I will do it for you

#

thatsyourproblem.jpg

quasi tide
fathom aspen
#

How about: "My #cpp collection tips that I got blocked for"?

quasi tide
#

Use that as the description @fathom aspen ๐Ÿ‘†

fathom aspen
#

Done.

red musk
#

If a character is travelling at a very high velocity, i.e. they're dashing for example, it looks a little choppy for remote players.

Doesn't seem like its a server correction issue or anything, seems like it might be remote players aren't actually smoothly simulating, and it's just updating position via replication beats; is that the case for remotes, or is there simulation happening on your client for them to smooth their movement?

fathom aspen
#

But how would I understand the content if I don't know the blog name?

#

Oh promising, don't

#

But I like being able to edit your posts. Evil_Patrick

fathom aspen
#

Or I have dragonHell powers

fathom aspen
red musk
#

Whichever one is deprecated

fathom aspen
#

GMC is better, fite me

#

Me neither, waiting for some kind soul to buy it and give me their opinion

#

Shame on me I just got to know the joke. Thanks Google (tho I know you broke Sadegcry ) or that was Meta?

#
WhileActive will be called every time an Actor enters the relevancy range of a GameplayCueNotify_Actor. OnRemove will be called every time an Actor leaves relevancy range of a GameplayCueNotify_Actor.

From GAS compendium. Can someone confirm that tranek meant to say "connection" instead of "Actor"?

#

I'm 99.9999% sure but I want that confirmation so I can sigh

#

Right, but the whole relevancy system goes around actors having a relevancy range that is checked against connections

#

I'm not excluding what you said, it's just unnatural to me

#

GAS is weird anyways

#

Oh yeah I like how they invested in the docs for that function

#

Seems like that is just the TargetActor you apply the GC on.

#

Nice GC can have double meanings now

#

Well time to take my ๐Ÿ’Š

hexed pewter
#

Steam overlay does show up in standalone-editor but doesn't show up in shipping version. Did i forget something trivial?
edit: fixed, I forgot steam_appid.txt file in Game/Binaries/Win64

humble edge
#

My dedicated server is shutting down itself we play and someone dies and respawns multiple times. Anyone who experienced similar issue?

plush wave
#

Can you call HasAuthority() on a player controller?

quasi tide
#

Yeah

marble gazelle
ember vine
#

anyone know what the #if dedicated server / #if client macros are ?

fathom aspen
#

There is #UE_SERVER but that excludes code from client build if that's what you mean

latent heart
#

If you want to check in code if you're a server or client when it's not build-defining, you could check netmode or whatever.

fathom aspen
#

That is IsNetMode(NM_DedicatedServer) for example

ember vine
#

this is early initialization im not sure if netmode is set in time - yea im looking to exclude code from client builds/server builds

#

i'm writing up external backend communication code basically

fathom aspen
#

I don't know how early that is, but NetMode can be problematic in earlier times

safe iris
#

Ok tbh multiplayer is very interesting

#

Ill read up the stuff pinned here

fathom aspen
#

Amazing. Pick the beginner friendly ones first so you don't get frustrated

latent heart
safe iris
#

Absolutely

latent heart
ember vine
#

ooh yeah okay, thanks ๐Ÿ‘

sage light
#

Hi guys, I have enabled the network prediction plugin on my UE 5.1 project. Objects now fall very slow, what can cause this issue?

#

I have the physics set to be asynchronous

#

Here are my plugin settings

fathom aspen
#

Not that I use it, but fwiw it's not a stable plugin yet

#

And currently on hold afaik

sage light
#

I'm aware of it, but still want to give it a chance as it can fit my project well if I can solve this one problem

grizzled stirrup
#

For simulating basic rigidbody physics (barrels, boxes etc.) in multiplayer, what option do you prefer?

A: Simulate physics on server and replicate movement at a high enough interval (30-60 times per second) to avoid choppiness on client
B: Simulate physics locally and allow deviations?

#

Of course it depends on the game but in this case it's secondary actors that don't have much of an influence on gameplay but still should make sense if player A says "look I'm kicking this thing" and player B doesn't even see the thing because it simulated differently on their machine, that'd be weird

#

OR I guess you could simulate with a low net update rate and interpolate location and rotation on the client which may be the best of both worlds

dark edge
#

It does a decent enough job

#

I would only ever replicate if it was necessary for gameplay purposes tho

#

I'd never replicate clutter and cosmetic only physics

grizzled stirrup
#

Do you know if it's possible to enable rotation interpolation?

#

I could disable replicated movement and just have my own replicated FVector_NetQuantize ServerLoc and FRotator ServerRot and lerp to them on tick on each client local machine

glad escarp
#

In regards to the conversation yesterday about listen server flow. Should I start a session and then open my lobby map or should I open the lobby map (with listen) and then start a session?

dark edge
#

Look in project settings

#

I haven't touched it since 4.27 but it should still be around.

grizzled stirrup
#

In 4.27?

#

Damn great

#

Thank you

dark edge
#

It doesn't just interpolate, it tries to maintain smooth acceleration etc and "nudge" physics into the right state

#

it can also extrapolate

grizzled stirrup
#

Wow this is really great, so many options! Never have seen this before. So all I need to do in order to make use of these params is to have a simulated component Mesh->SetSimulatePhysics(true); and this is true? SetReplicatingMovement(true);

dark edge
#

I've only ever set the params in BP.

grizzled stirrup
#

As in I'm not supposed to be adding some kind of PhysicsMovementComponent to my actor or whatever?

#

The engine will just use these as soon as a simulating object has the Replicated Movement flag set to true?

dark edge
#

Those are the tuning settings. It can replicate any physics enabled component

#

you don't need to add anything

#

but the stock settings are really strict and rubberbandy. You'll want to tune them. Maybe even look at the source code to see what they're doing.

grizzled stirrup
#

Thanks this is great, already seeing better results

dark edge
#

Make sure you test with 2 windows and doing stuff clientside (to test the correction)

#

It'll look great if you make the settings really loose, but then they'll diverge

grizzled stirrup
#

For sure! I have a pretty bad case scenario set up by default and as you said the default settings are far too strict

#

Just trying to figure out how to make the rotation smoother

#

Tried raising all error limits

#

But there's still jarring hard snaps for each network update

#

Movement is fine

grizzled stirrup
#

Ah I needed to lower it!

#

Not raise it like the others

#

Works great now thank you for the help

#

Bandwidth down from 30K to 4K ๐Ÿ˜„

#

And that can likely be crushed even more with more tweaks

dark edge
#

This is what I use for my vehicle game, I only replicate the chassis and turrets movement, not wheels etc

quasi tide
#

30K? Jeebus

dark edge
#

I dont' care if client and server disagree on wheel bounce from a speed bump, as long as they agree on the RESULTANT chassis movement

grizzled stirrup
# quasi tide 30K? Jeebus

Yeah was just testing to see what the bandwith was like at acceptably smooth update rates, don't worry wasn't planning on shipping like that ๐Ÿ˜„ Now I can get away with 2-4 updates a second and let the interp stuff handle the rest

grizzled stirrup
#

Can't believe I've never seen these settings. I guess I saw the football in fortnite that was rubberbanding like crazy and assumed there was no built in interp stuff for physics ๐Ÿ˜„

#

And have always heard how hard physics replication is but I assume people are talking about rocket league situations in that case

#

Where the ball needs to be very accurate

#

And is very relevant to gameplay

dark edge
#

If you're ok with stuff starting on the server then replicating out, it's trivial.

#

The hard part is doing the physics on owning client AHEAD of time and handling the discrepancies. THat's what Rocket League is doing.

grizzled stirrup
#

Got it, makes sense!

#

Final thing, is it possible to have a different gravity scale per simulated actor? I have the global gravity scale working great for my character but movement is floaty on the simulated objects

#

I don't see anything other than a checkbox to enable / disable gravity

#

I can always have an AddForce(0.0f, 0.0f, -MyGravity * DeltaTime) call on tick but surely there's a gravity scale around?

dark edge
#

Can Character override gravity for itself?

#

I'd do that and have global gravity be the real thing

grizzled stirrup
#

Cool will do that even though it'd be interesting to have certain actors float more than others but I suppose mass will handle some of that

#

IT's funny, gravity has to be set from -980 down to like -5000 for it to be fast enough to be believable but this may be down to mass. Though I've always noticed default gravity in UE is extremely floaty

dark edge
#

Gravity will seem floaty if you are much bigger than a realistic scale, it'll seem really fast if you're much smaller.

grizzled stirrup
#

Also makes sense ๐Ÿ™‚

thin tulip
#

Is it possible to create a new actor that acts as an autonomous proxy? One that doesn't inherit from Pawn or PlayerController, I mean.

#

Looking for another option to send RPCs from client to server that isn't a Pawn or PC.

grizzled stirrup
#

As long as the client owns that actor they can AFAIK]

thin tulip
#

There's SetAutonomousProxy on AActor, which you can probably call on the server. I'm gonna give it a shot.

fathom aspen
#

Which also unfortunately won't help you much

#

A client-owned actor has to own that actor

chrome bay
chrome bay
#

IIRC the way PhysX integrates gravity is a bit different too

#

I always got very different results doing it myself

grizzled stirrup
thin tulip
#

I'll dig into how player controllers do it since those spawn in both places.

fathom aspen
#

Right. Client owning some actor, means a client-owned actor owning that actor

#

Owning happens server-side

#

Always

thin tulip
#

Hm, so you mean like literally MyNewProxyActor->SetOwner(SomePlayerController)?

fathom aspen
#

Literally spawn a replicated actor server-side, and inside its FActorSpawnParams specify Owner to either PC/PS/Pawn

fathom aspen
#

Either that or SpawnParams

thin tulip
#

Gotcha, that makes sense to me. Thank you!

serene furnace
#

Hey there !
I'm having a question about this small code :

  • Is this begin / end overlapped natively replicated, of is it replicated cause my pawn class is set to replicated
    -Any way to cancel the native replication of certain functions ?
  • How to know if an event is already natively replicated ?

Cause no matter the code I do as long as I use this function, everyone sees each others widgets xD

fathom aspen
#
  1. Yes.
  2. Engine modification.
  3. Usually by testing.
#

What you're looking for tho is IsLocallyControlled

#

You don't want that widget to show for simulated proxies I guess, so you use that

#

So basically you check DoesImplementInterface && IsLocallyControlled

shy yarrow
#

does seamless travel work with open level instead of executeConsole?

fathom aspen
sinful tree
# serene furnace Hey there ! I'm having a question about this small code : - Is this begin / en...

The events themselves are not replicated. The client and the server themselves can detect anything that may overlap and will trigger the event only on their instance. If you have an actor that is not replicated spawned on the server, and it overlaps, then it will trigger that event only on the server. Similarly, if you have an actor spawned only on the client, and it overlaps, it'll trigger that event only on the client.

The way to gate it is by using a branch checking IsServer or IsLocallyControlled (if you're checking against a player character for example)

shy yarrow
fathom aspen
#

You haven't provided sufficient information for me to be able to answer the question

#

I wanted the bio medal instead @whole grove ๐Ÿ˜”

shy yarrow
#

after I press start button , the game map HUD will be appear but the UI of the lobby map will not be removed !!!!

fathom aspen
#

Now you explained things better

#

You will have to remove them yourself manually

shy yarrow
#

how I can remove it manually ? with using remove from parent ?

fathom aspen
#

Have you tried clicking any of the links I sent?

#

This for example should get you to your end goal ^

dry pebble
#

have an issue where the host can't hear the clients jump/footstep sounds from Anim Notify Play Sound but the client can hear the host and other clients. Any ideas? Using steam too

fathom aspen
#

We might figure out what's going on if we saw relevant code

shy yarrow
fathom aspen
#

Your GameMode spawns and loads fine, it's that function that isn't working properly. Debug your code and figure it out

shy yarrow
fathom aspen
#

Yes because PostLogin doesn't get called in seamless travel

#

It gets called for hard travel

shy yarrow
#

so any thing can I use instead?

fathom aspen
#

You might want to use HandleStartingNewPlayer

#

That gets called regardless of the travel type

shy yarrow
#

thank you

fathom aspen
#

By the way all of what I said up to this point is in that compendium

shy yarrow
#

yes thank you , I will read all that

shy yarrow
serene furnace
#

Thanks for the answer guys, thats making more sense to me, I need to work more with the "is locally controlled", and lurn more about it, I been having several issues with that ^^

shy yarrow
#

does ping in UE5 has bug ? it always shows 9999 !!!

dry pebble
# fathom aspen We might figure out what's going on if we saw relevant code

hmm there is no code for this, just a Play Sound Anim Notify for running or jumping which is in a state machine. I tried adding the Anim Notify too called Footstep and linking it up with a Play Sound at Location, but it only fires for clients, not the host. Such a weird bug. The Anim Notifys in a animation montage work for the server (when the client moves for e.g), but don't fire for the Anim Notify Play Sound in the animation itself

hallow orbit
#

assuming you use steam

chrome bay
shy yarrow
hallow orbit
# shy yarrow Yes I using Steam

yeah the ping doesnt work in blueprints, it needs to ping from an actual server in the real world, without that it will print 9999

cold moat
#

Guys, the HUD class only runs on client, as far as I know, correct?

hallow orbit
#

depending on how you do it. yea

cold moat
#

I'm spawning a widget on the HUD class, like this, and then from the player I do the following to use it

#

but doing this, it seems like every player uses the same HUD?

hallow orbit
#

btw on the widget ref, disconnect the bottom blue line and use the end of the set to get into the add to viewport

cold moat
full tree
hallow orbit
#

i dont have any experience with the HUD class, but the **get player controller (0) ** could be why

#

since that grabs the servers controller

cold moat
#

how should I do it? D: I'm not very sure on how to reference the player

#

for example the "owning player" I have no idea what to connect there

full tree
cold moat
#

That's why I used GetPlayerController(0), because I thought locally there is only one player (?)

sinful tree
grave fog
#

Hi I am new at unreal engine I want to build mobile mutiplayer listen server . how can I save players important date like how many coins he has ? I dont want to save them localy so they cant cheat .If there is a video explaining this, I would appreciate it.

cold moat
sinful tree
grave fog
#

yes

cold moat
sinful tree
sinful tree
# cold moat I'm playtesting as listen server + 1 client

Ok, in that case Get Player Controller 0 may not necessarily resolve correctly on the listen server itself as it contains all client player controllers as well - it should always be at index 0, but in some instances I believe it may not be. Otherwise, there doesn't appear to be anything specifically wrong with this set up if your intention is to have the HUD spawned for everyone, each client and the host will have their own copy of the HUD spawned.

cold moat
#

Hm I quickly tested playing with 2 clients only

full tree
cold moat
full tree
#

if you want to change some variables and make it visible for everyone it should be located on element existing for everyone for example pawn (to not compilate too much)

#

or any other replicated actor

sinful tree
# cold moat

That's an indication that either the HUD wasn't spawned where you're trying to access it (like on a dedicated server), or your cast failed indicating you haven't set the HUD class in your game mode settings. You could also be attempting to call this function before the HUD was created.

full tree
#

btw it is better to use GetOwningPlayerController

cold moat
#

My guess then is that all players are using the server HUD instead of having their own each one

sinful tree
#

HUD and UI/Widgets only exists on the local instance of the game.

cold moat
#

The HUD is created on begin play, I'm taking some time to get damaged, so I don't think that's the situation

sinful tree
#

Ideally, you'd remove your HUD from all game logic and use event dispatchers that your HUD can then bind to so it listens to whatever it needs to listen to and updates itself.

#

So instead of doing something like
Player Takes Damage > Get HUD > Update HUD

You'd do:
HUD > Bind to Player "Damage" Event Dispatcher > Update HUD when event dispatcher is triggered
Player Takes Damage > Signal "Damage" Event Dispatcher

full tree
cold moat
cold moat
sinful tree
# cold moat

The error message you received here is specifically speaking to the HUD class itself, not a widget. It says "Get PlayerHUD As Player HUD" which is a direct reference to the function name and the return value. Again, an indication that either the HUD hasn't be created when this function is called, or you haven't set the correct HUD class in your game settings.

#

Or the GetPlayerInformationWidget is invalid.

cold moat
#

the widget call should work, tried debugging/printing the variable/ref once it is created and it is there hm

#

isn't the HUD created almost instantly when the game begins?

full tree
#

Maybe will be better to follow some yt tutorial, should be plenty with player health, and then next step will be multiplayer

cold moat
#

I tried finding some tutorials but there always some differences on how the person set their widget itself, its complicated, but I'll try to search some more

full tree
#

Hey guys, in today's video I'm going to be showing you how to create a dynamic health bar in Unreal Engine 5. This tutorial will show you how to use a custom image for a custom health bar design, link the player's health to the bar, and display this on the screen. This is very easy to expand on and customise. The custom image is also optional.

...

โ–ถ Play video
cold moat
#

I'm sure I'm lost somewhere

sinful tree
grave fog
#

@sinful tree how to prevent cheating while using listen server?

grave fog
#

I must use dedicated server to prevent cheating

bitter oriole
#

And anti cheat, and player reports, and...

cold moat
bitter oriole
#

Good luc kwith multiplayer on phones

sinful tree
#

No. You must use non-distributed dedicated servers. As soon as you allow anyone to host servers (whether dedicated or listen) other than yourself, your external data storage system will need to be accessed and would be getting updated by other people, meaning you cannot prevent players from cheating.

bitter oriole
#

tbh

plush wave
#

Anyone else using the SocialToolkit?

cold moat
#

So, was following that video sent before, just set the player to create the HUD, nothing else

sinful tree
#

Where is this event begin play?

cold moat
#

On the player character

fathom aspen
#

IsLocallyControlled?

sinful tree
#

Are you trying to access the HUD while running on the server or something (again, usually dedicated servers have this problem)

cold moat
#

I'm playing as two clients hmmmm

sinful tree
#

Ok, so "As Client" indicates dedicated.

#

Begin Play fires on all clients and the server.

fathom aspen
#

Evil setting

sinful tree
#

I dunno why they would do that XD

cold moat
fathom aspen
#

Some junior dev added it prolly

cold moat
#

Like authority somehow?

sinful tree
#

But anyway, dedicated servers cannot load UI by default.
Yes, you can use IsServer or HasAuthority

#

But you have another problem.

#

If you're doing this in the player character, Begin Play fires on all clients as well. So you'll have multiple widgets showing up on your screen for every player character.

#

As WizardCell suggested, you may want to use IsLocallyControlled ๐Ÿ™‚

fathom aspen
#

IsLocallyControlled is my go to node in such situation for the simple reason that widgets, HUDs, etc. exist locally

cold moat
#

I'll be honest I only did on the player because the video told me to, I was so lost with this that I just accepted xD

fathom aspen
#

So even listen servers get widgets as they should

cold moat
#

I was aiming to manage player HUD on the HUD class (spawning and modifying) because it feels more organized?

sinful tree
#

And that's actually the better place to do it.

fathom aspen
#

HUD's middle name is "widgets manager"

fathom aspen
cold moat
#

I'll go back on doing it inside the HUD class then, I love some organized blueprints pepeCheers

#

also quick doubt, is is possible to get reference of other players inside the HUD class since it is a local class?

fathom aspen
#

There is no player class

#

Well there is but you meant to say Pawn?

#

You can but you shouldn't need to

sinful tree
#

There is player state, player character, player controller.

#

Player controller is inaccessible to clients.

#

Player character can only be considered sometimes accessible as their character may despawn.

#

Player State is always relevant.

cold moat
#

Oh sorry I meant like, on my player UI I want to have the group information like on a MMO, where you can see your friends health etc, is it possible to grab these networked variables to use on HUD?

sinful tree
#

Yes

sinful tree
#

Generally speaking, that means you'd have to have those values stored on a player state if you want them to always be relevant.

fathom aspen
#

UI shouldn't carry/hold state

#

It should display it

cold moat
#

Oh that's very interesting

#

Basically UI is literally "display stuff" and not manage it

sinful tree
#

"player clicked the button to activate whatever is in slot 1"

fathom aspen
#

Yes, and pls make sure it's the old damage system so you look old school

#

Not my type, I prefer Udemy, fite me

sinful tree
fathom aspen
#

I see you declared war warning

pallid mesa
#

Hehe

fathom aspen
pallid mesa
#

Its my birthday man, give me some leeway

#

thanks haha

#

u got something new written down?

#

i have yet to check it out

fathom aspen
pallid mesa
#

@fathom aspen ๐Ÿฅ“ โ˜ ๏ธ

fathom aspen
#

Shhh don't let them know

cold moat
#

Just to make sure I'm 100% on the same page......... (sorry) HUD class is local, and to manage widgets, on my game where I want to create stuff to more than the local player, when I create (for example) a player status widget I should reference the player owning it... right?

for example the local player (player 1) I spawn it and set the owner to player 0 as he is the local player (and for others that's subject to another day of trial and error)?