#multiplayer
1 messages ยท Page 29 of 1
It is very specifically rotation
Ignore the naked man and messed up animation. Not the focus ๐
Ez mode you would check if NetMode is ListenServer.
Hmmmm, videos are the best
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.
So basically you are saying that this nasty method is what causing the behavior we see?
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
there is a bug on backwards rotation on cmc for orientmovement
This is not a bug in my case.
Ah so I think I misunderstood you. Overriding that method fixes what we saw in the video?
No.
Ok I get it
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.
Right, but you don't have camera for sim proxies
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);
I hate saying replicating camera's rotation is the solution
I know the different ways to solve this. I just want to know if there is something in there that I'm overlooking.
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
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)
Anyone know a source for a logspam of:
LogNetPlayerMovement: Error: ServerSendMoveResponse: Failed to find a NetConnection/PackageMap for data serialization!
?
Again - I already know the why, the how, and potential fixes. I was simply asking if anyone knew any other approach.
using the controller yaw input and disabling orientrot
And wasn't accepted? Weird
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
Good that I'm not the only grounded kid for once
I would not expect the character to back peddle if I have a boolean flipped called "orient rotation towards movement"
yeah I understand aswell why they wouldn't accept it
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
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.
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)
Seems to be occuring when I SetAutonomousProxy(True) on my Character in PossessedBy... is that not a thing I should do?
you shouldn't be doing that, no
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?
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
After rapid googling, do I assume correctly that FVector is not POD since it has constructor?
In Unreal terms, non-PODs are: UObjects and FString (or prolly FText?) FNames
Ah sorry FNames
So pointer would not be guaranteed to arrive in the same frame as the pod counterparts. And that would re-trigger the OnRep function.
Right. OnRep is your friend there
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.
Keep track of OnReps and notify server of when they are all called
There is PostRepNotifies but that is at the actor level
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?
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
lmao I jut wrote an article about that ๐คฃ
check pinned comments
And I'm too greedy to write and not share 
FNames?
The channel was too calm today, I need to write ๐
Yes
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?
/**
* FNetBitReader
* A bit reader that serializes FNames and UObject* through
* a network packagemap.
*/
They are the "unmapped properties"
why is that? Any reason?
Maybe that's my own terminology
๐
you can ignore my question if you like, I'm completely asleep X'D
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
And things... got complicated ๐
hahaha
yeap that rings a bell
when did it get deprecated?
Any reason?
I see! Makes sense
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
You must have come upon "Effective Modern C++", amazing book that I can't find enough time to read through 
its noted down already
Latest I did was a silly exercise with concepts
yes, as I said I've been lately learning it haha
Where/how should I set my Character as Autonomous Proxy? Or is the answer never?
you dont need to
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 ๐ฆ
Well SetAutonomousProxy(true); is already called for you in PossessedBy. Why would you do that yourself
๐ค
Yes, that is a good point to think about
Failure to call Super ๐คฆโโ๏ธ
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?
Because firing server RPCs isn't reliable in BeginPlay
And in any other event before the actor is possessed
Alright, that makes sense, that was sloppy of me.
That being said, you should fire server RPCs from events like:
- OnRep_Owner
- OnRep_Controller
- Restart
- 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
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!
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
I'm not sure what that is, but is it something you want it to be replicated to others?
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.
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
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?
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
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.
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.
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.
HasAuthority was meant for BeginPlay, but it should work fine even for Restart
Alright, I'll do some debugging, when I do server RPC I get one extra bot so something is off.
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
Where can I find info on what functions run where?
Or is that something you pick up along the way?
Just trace the function and know when it's called
Exactly, more of an experience than anything else
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
Some games can show you packet loss (pretty sure fortnite does) anyone know how it's done?
it shows you in a packaged game.
This should get you walking: https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/QuickStart/
I should have checked if it has deprecated stuff, sigh
ShooterGame ftw
:(
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
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
Ofc it doesn't. That is one aspect: Input Handling.
There is no such "most complicated" aspect
You can be hit by different level of complexities, and what feels complex for one might be easy for other
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.
๐ญ
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.
Do you want bullet drop?
hmm, sure?
๐
what
That's more complexity on top of what you already have, lol
But it's easy to server-rewind
Yeah - if you're James
I wish MP was easy 
have you done anything similar?
Wondering if that's the reason why #multiplayer keeps being calm
It's calm because f*** networking. But also โค๏ธ networking
At least you know that it is your move as well.
That is too hard for me. I'm making Arma using BP-only and with the help of Udemy + YT
You own it. Not some 3rd party server
Yeah how come I forget, I already watched that 8 hours YT video to conclude that
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
my friends wouldn't cheat (i think) ๐ญ
- Ensure objects are stably named.
- Async load stuff.
EZ.
I'm sure someone did, because I can hear asynchronous music playing in the background
Props to ZabirH for that info ๐ #multiplayer message
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 
That he fears to uncover because things... might get complicated
Cool, Laura was right
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?
It should be
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
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 ๐
Hunter you should work harder to bring it to Duro's radar again
I have faith in you
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 ๐
I watched a trailer of it a while ago and it was fun. Should prolly watch gameplay footage and see how it goes
Real question though is that one of the benefits for Lauras Ue5coro plugin?
I havnt used it yet but Ive been considering it
Scratch that I got confused on which plugin I was talking about
UE5Coro has nothing to do with that heh
Unless @whole grove made sure it does by the grace of dragonHell
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
Oh I'm on phone and I literally forgot what 2) was lol. I see now how they related to coro xD
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?
how do I get previous value in BP OnRep_ ? is it possible ?
I guess it should be possible to add a param to your OnRep fn with the variable type which should give you the old value
Ah the question is on BP, I don't know about that, sorry
Are you asking how are you going to find out which controller you want to possess new actor with?
whenever OnRep fires you can store the Value into OldValue
and OldValue will be pre "replication" value
Is this being the parameter or something else that I'm not aware of?
a normal variable in that blueprint of the same type
its ugly, but hardly more so then BP OnRep is
Oh you mean holding another variable for the old value, I see
So still no builtin support for it on BP right?
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
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.
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.
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 ?
It won't be fully replicated
The OnRep will fire each time one of its elements replicates
Oh, when can i know when it will be ?
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
There is nothing like this OnRep fired -> the array has fully replicated
OnRep will also be called when it changes size - it could have no valid ptrs
Mhh is that better to use rpc then ? Looks annoying
no it's not
Golden rule time
So i have to loop on the array to check element validity every time ?
yes
๐ฆ ok
But you should expect to do this whenever you're dealing with pointers to other objects
Mhh
James, what do you think the reason FNames are assigned NetGUIDs? Vori asked me that last night and I couldn't answer lol
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
I see, yeah makes sense. Thanks!
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.
Are you trying to keep your character that spawned on client when you connect to server? Sorry and correct me if I'm misunderstanding. But if that's the case I don't think you can keep a client side created character to keep and use as replicated character
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
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
I was using OpenLevel first and then travelling to localhost again to produce this situation but there might be easier ways to achieve the same
Also if initial connections are okay for your case, it's possible to add clients during PIE runtime
oh, how can i do that?
Under the editor preferences
You'll get this Add Client button during PIE on this panel when you enable it
Sorry, about that, might explained the situation in a bit over complicated way :D, so when we launch the app we are not connected to the server yet, we choose our character to spawn as WHEN we travel to the server map, so I am looking for something that will store that decision for me and I will be able to spawn on server map with the desired character.
Because currently it will just spawn me as the default character
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
that's awesome
Oh so you need a way to carry your decision to server and make server spawn that character for you?
yes correct, I was reading about the game instance or game state that I should store this chosen character in either of those but not sure how to do it
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
As Layso stated GameInstance works great, but I'm more biased towards a LocalPlayer subsystem. You might want to check the latest message in pins ๐
Ah I was questioning if it was persistent between levels just a few days ago. Yes using this would be a more "proper" way I believe
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.
GameInstance is, pretty much like GI subsystem or LP subsystem, but I prefer having a centralized LP save subsystem
Also that's if you are hard traveling, if I'm seamless traveling I will be using PlayerState::CopyProperties
Correct. Though you save the character in GameInstance locally (client-side usually)
GameMode is server-side tho
So retrieving GameInstance in GameMode will end up retrieving the server-sided one sadly
Right, so how would I get this character variable to the game mode through Player Controller?
GameInstance-> Player Controller-> Gamemode then
Pretty much yeah
okay, will figure it out then thanks so much for the help WizardCell & Layso!
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
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?
Iโve already got that part down. My issue is that I canโt make the client that died possess the new character because itโs a server only function
Well in that case you need to call it from server
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
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
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.
Ah that's great! Yeah for some reason I imagined it being tied to the listen server connection
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
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 ๐
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 ๐
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
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.
I was watching this video series, and in one of them he explained about it, that you need to be owner of the object to call server function from client
Support the channel through donations. Crypto accepted!
PayPal: https://paypal.me/reidschannel?locale.x=en_US
Patreon: https://www.patreon.com/reidschannel
Bitcoin: 1JFwWHr4X6uAeoZadukzqKjzFBj3Qjy7Sk
Ethereum: 0x2B2Bc108F1Cc0fF899959dEF3226637787d8C3dE
Dogecoin: DNQ33YnhpWoTBokBNVkZP5ub8KTLkpyjpv
Join our community discord!
Discord: https://dis...
What you're probably missing is that you need to communicate the client's cursor to the server, and then the server needs to multicast the information to all clients, and you do that for each player so every player has a different cursor that is displayed, but ignore for the local player ( because you already see and control your own cursor )
GetPlayerController(0) spotted
and how it should be?
Never use GetPlayerXXX functions again
Not in multiplayer at least
Literally just replace GetPlayerController(0) with GetController
Ah you want to cast to PlayerController
alright
Damage is handled server-side (authority) so you want to check health and destroy the pawn/character in question
And you're good to go
it worked thank you @fathom aspen
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
Have you checked last message in pins?
Hi everyone! iยดm considering getting this https://www.unrealengine.com/marketplace/en-US/product/38b887ee46ef471ebdb93d8cfb2ad96a
to make it work in a multiplayer environment so the rest of the clients can see what is being shared. By default this is not replicated, so my question is if is it possible to replicate a media source?
Thanks in advance!
bump, wonder how most of the apps like virbella, spatial , or bigscreen out there got it working
Because they have a whole team dedicated to that and again because it's possible.
But how to do damage, when I have blueprint for my weapon and for my enemy and I can't to cast to enemy from weapon?
oh my bad, it's not fully working yet. the cursor from server is replicated, but the client is not
Wrong reply, and your terminology is nonsensical. This is the point where seeing relevant code becomes crucial.
"Curosor to World" property that you supply the server RPC with
I just want to see how you set that property
is there a chance that this cats is failing when is client?
This is my code. And problem is when I cast to BP EnemyAI, when is client that cast only in client
With the cropped screenshots I have no idea what class that is
this is the weapon, what spawn at the begin play for the player
Then when you spawn the weapon you want to assign the character as owner
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.
And from the weapon it's as easy as saying GetOwner to get the character @unborn solstice
please heelp
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.
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
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.
ohh you are right, I missed that part of the table.
so back to my issue, this video shows what it's happening
I just need the cursor from client to replicate
I want that all player can see all players cursor
Client send data to server and then the server replicates, you need to add the first step
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
Each local player controller is only available on the local machine (or the server) so your multicast would fail (at the part where you are casting to PlayerController)
Use something replicated to all clients, PlayerState for example
I would periodically replicate down the cursor location as a RepNotify variable and have the client constantly interpolating the position on tick
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.
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
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"?
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
thanks and im not sure what would be feasible. im always contemplating some character animation being resolved with physics for a few things. At this stage its mostly about should i bother exploring physics if the prototype is for network.
Though you don't really want to start accepting incoming connection requests if you aren't hosting a game.
You can use beacons for in-menu lobbies
Even if you later reject them.
You won't as long as you don't press the host button
Opening a level with ?listen doesn't do any sesssion stuff
AFAIK at least
So you only listen when the host start the game
You'd need to create a public session before anyone could join
What I mean is, no matter if you have a session open or not, opening with ?listen starts listening for connection requests to join the game.
That's not a good thing.
This makes sense to me.
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
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.
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
Thanks Kyle that totally makes sense. So let me back-brief to make sure I'm understanding the flow.
- My main menu level loads. (there is no session and the level is not listening yet)
- My player clicks on "Host Game"
- This loads an independent Host Game Level which is listening and which also creates/adds to viewport, my host game widget
- From there the host can configure settings and launch the game to server travel all the players in the "lobby" to the selected map.
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.
Is it possible to load into a lobby and invite friends without beacons and without traveling though? Just doing it out of convenience
Do you need a lobby level or is it just a menu ?
No idea how to do this.
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
Well, you can beta test my lobbysystem :p
It's just a menu. Basically I have a main menu widget that pops up in the default game map. I have Host, Join, Settings etc. When a player clicks Host, it brings up a Hosting widget which has ready up functionality and map selection etc.
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
It's not not opening them when you don't need them, not about not using them at all.
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.
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
I tried the approach of using rep notify in the cursor location, but in the end I have the same result
You don't store passwords in plain text "just because you're probably never going to be hacked"
Is your lobby system specific to one OSS? I'm using EOS, utilizing Redpoint's EOS plugin.
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.
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
And it's definitely not required when you're just sitting in a menu.
Yeah I may look into a better system and force players to travel when hosting in that case
Tbh, the real issue is UE requiring you to re-open the map to change netmode if that's even true.
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
Yeah.
Yes. That's what I was hoping there was a solution for. I just want to change the net mode to listen when I click on host game and change it back if they exit the hosting menu.
I'm not saying it's easy or desirable to have to manage sockets, but you should at least try to be careful. ๐
It's generic
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
Absolutely.
Usually thjat's just handled with something like a private / friends only / open type option when you start a game.
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
Hey! I know this is an old post however I came here also looking for this answer and never found one! Iโve managed to get this working correctly, and so far without any bugs too! What im doing is creating my session and on success, Iโm calling into C++ to open up the current level to listen without reloading like so: void URPGGameInstanceAdva...
Looks like it requires an engine change for full support
But you can do it once without issue.
Np
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
Looks like no engine modifications needed at least from what I can see
Seems to be just 2 func overrdies
Much appreciated. I'm gonna try to implement this.
Super interested to know if that works!
And maybe if you need to maybe make a custom netdriver...
If only I were at that level with my coding skill.
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'" ๐
hahaha. I follow you now.
That's seriously half my current project. I swear 99% of the engine code makes silly assumptions.
I suppose that's the main drawback to using a robust framework like UE versus a custom built engine.
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
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.
(It works, you're welcomeโข๏ธ)
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
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
ok so i have to do RearLightColor = replicated value that i have to get from somewhere?
Check the pinned messages and start reading some explanatory material
You're struggling with the basics, there are plenty well documented tutorials on this topic
ive been looking at this https://docs.unrealengine.com/5.0/en-US/multiplayer-programming-quick-start-for-unreal-engine/
...from server, right
i suppose ill just keep looking
Please look at the pinned messages. Not Epic's documentation
oh, okay
And considering RearLightColor magically links to the point light color
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++
understood
thank you
ill try my best
i have to do it in c++ tho so its gonna take time ๐
So far I'm getting "Net Driver Already Exists" errors in the 2 ways I've tried to implement this. Darn
CONGRATSSSSSSSSSSSS
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):
- Player clicks "host game"
- We open a lobby map with ?listen
- 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.
- Then when players are ready and the host launches the game, we server travel all players to the selected map
Congrats you passed the "listen server class"
Lol thanks. Well. I'll redirect my energies then to get this working correctly.
I would have the menu appear for non-hosts too so they can see settings... but not change them.
Right. That makes sense. I would just replicate visual changes and disable functionality if they aren't the server?
Or let's say instead of a menu, I want to have like a ready-room type deal with a map on the table. The host selects an area on the map to deploy to and then I would replicate the visual changes that show what the commander highlighted.
ah. ok that makes sense.
Why would my actor have a different transform when I join a dedicated server, instead of standalone?
Because some other client did so before you joined?
It's just me
Thought I'm the only one capable of doing sorcery, turned out that dedicated servers have already passed that milestone ๐
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
This is the point where showing code becomes crucial, but from the sounds of it yes it's something like what you said
Yeah it was just a rotation that happened on the server before the client connected
@valid imp what decorator?
Decorator is an AI term
but BTs are mostly unrelated in multiplayer context so it confused me
They meant to say RPC type I guess
They are 100% talking about RPCs
The answer to your question is because it's not needed by Epic @valid imp
general way of doing it is just having a non RPC function and calling that on both client and server rpc
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
and why category sorting is not done etc etc
they are replying in cpp though ๐
Ah so we are talking via beacons now?
oh thats something i never studied yet 
The engine is so vast ๐
'Tis a shame that they're not either. Dictionaries are so useful ๐ญ
Aarg you are answering here!
Yeah - multiplayer stuff being answered in #multiplayer. Wild.
Wait, how do you call @twin juniper things? Annotations?
Wait dragonHell told you that? When are they fixing dormancy in BP then?
yeah just like that
๐
Annotations or decorators are fine. But in UE, they're not either. They're macros.
Decorator == property specifier btw.
There is no @ syntax for UE
#define @ 
Which is what UFUNCTION()'s are
I'm lost btw, but Duroxx seems to understand the questions
UFUNCTION(Server, Reliable) is still a macro.
so I can leave 
Alright, UFUNCTION is a macro, good. I apologize for the confusion, I spent too much time doing TS at work.
CodeGenerationMacroAnnotationThingy then
Because I need someone for the fun 
Playing multiplayer is fun. Making multiplayer is the exact opposite.
Is it fun writing your own CGMATs ๐ ?
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();
Multiplayer gave me depression
but... you wrote the compendium 
compendium bible
its possible with meta and IScriptGeneratorInterface
but still pain
and confusing for new teammates to adapt
This one saved me from depression tbf
i love bread
If I wanted a nice little project with plenty of teammates I'd do something simple and singleplayer ๐ฆ
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.
Progress
check LuaScriptInterface then to see example of how script generator interface works, it lets you add custom code to generated files based on what UHT parsed
but to make UHT parse custom specifiers that are not meta, you gotta fork
If you want less boilerplate then please make OnReps call auto on servers
Cool, I'll check that out. Thank you ๐
I will make sure to upvote when you PR
there is also a plugin named UnLua might give more insights than LuaScriptGeneratorInterface thing
"LGTM ๐ " - as he glances over it for a whole second ๐
I just want less boilerplate code overall. The amount if sh*t to write if you want to keep proper access restriction of variables
I need UHT to just generate me some public getter I can implement if I want
And Setter
I kept saying I want less boilerplate until I discovered GAS
I'm dead, that was quick
There's a reason Laura is the Microsoft CEO of programming.
*despressionยฒ
recently I thought C++ involves more boilerplate than an average Java code.. which is called boilerplate programming language these days
Where can I learn this power?
@fathom aspen GAS made me finally create an internal Plugin that exposes all the stuff that I need in almost every project
ComposableGas
SaltyCore
Release to marketplace and see peeps spamming the purchase button
Does it basically include initial boilerplate stuff in a single module?
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
Minecraft plugin name flashbacks
Just not Game Specific things
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
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
It makes more sense if one looks at the company name
I know. But still flashbacks ๐คฃ
hehe
btw since you mentioned -- essentially a #gameplay-ability-system question but since you are guru -- is it just me or most of the ApplyRootMotionVelocity tasks are.. incomplete?
like only one of them works, rest of them has empty tick function or just dont work
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 ~~
I saw this last night:
//TODO: This is still an awful way to do this and we should scrap this task or do it right.
void UAbilityTask_MoveToLocation::TickTask(float DeltaTime)
Really encouraging
oh yeah, that was hilarious to read
And they never went back and fixed it
Butbutbut they will after they make the fortnite skins
Are you executing it in BeginPlay on both client and server?
Pretty sure they did
If Manny/Quinn could give daily reminders to gate with authority and use OnReps
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 ๐
Meh - UE is still the best 3D engine available to us peasants. By no small margin either.
Ok then your punishment is to Livecode 1000x starting now
I should have told you to convert all your cpp structs into BP ones ๐
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.
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?
laughs in double
4.27 and 5.0
Wow, 5.1 is our savior, I can't count the number of bugs they fixed
Yup and they're depreciating classic input system. So better get up to speed with #enhanced-input-system
what 
But I still need that to trigger the old damage system
#enhanced-input-system scares me 
Thanks, I'll give it a try, was waiting to 5.1 full release for some other fixes when they broke non-seamless travel.
They screwed seamless too, so it's fine
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.
inputs are asset based now?
Your mapping, yes.
offtopic but your twitter banner is hilarious ๐
"designing scalable experiences for large player counts"
solution: ||kill them||
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?
Edit Steam SDK?
But why is the question tbh? Seamless is preferred over non-seamless anyways
Peeps are dying to seamless travel between servers 
It is just a bunch of things to keep track and reconstruct, garbage collect, reset state of many things (doors, gates, etc)
Have you checked AGameModeBase::ResetLevel()?
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
That is still preferred over non-seamless traveling.
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
Prolly there is some type of sorcery you can do to reset actors to their CDO state
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
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
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.
You either:
- Not traveling to the right map.
- You think they aren't the right pawn/controller while in fact they are.
Also make sure you save if you're doing that standalone
hmmm. Well I'm definitely traveling to the right map. And the pawn is definitely not the right one. Which is why I'm so confused.
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?
"Shoutout to Laura from the Unreal Slackers Discord for helping with clarifying some details"
Figured it out. I'm dumb. Thanks.
I'm still waiting for you to edit: https://unrealcommunity.wiki/developer-blogs-455nbtri
Looking for a list of Unreal Engine related blogs?
If it weren't for Tim Sweeney, we wouldn't be having this conversation. So thanks Papa Tim.
Can I hot reload instead?
Give me the description I will do it for you
thatsyourproblem.jpg
Should be pretty easy. "Some useful tips & tricks to not suck with UE"
Use that as the description @fathom aspen ๐
Done.
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?
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. 
Pretty sure that is corrections. The CMC does its best to smooth things for you, but you would still want to add your touch
Or I have dragonHell powers
I think you should ask for edit control, but yeah it's somehow evil
Whichever one is deprecated
GMC is better, fite me
Me neither, waiting for some kind soul to buy it and give me their opinion
Laura in #multiplayer soonโข๏ธ ? ๐
Shame on me I just got to know the joke. Thanks Google (tho I know you broke
) 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 ๐
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
My dedicated server is shutting down itself we play and someone dies and respawns multiple times. Anyone who experienced similar issue?
Can you call HasAuthority() on a player controller?
Yeah
did you check if the server maybe just crashed?
anyone know what the #if dedicated server / #if client macros are ?
There is #UE_SERVER but that excludes code from client build if that's what you mean
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.
That is IsNetMode(NM_DedicatedServer) for example
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
I don't know how early that is, but NetMode can be problematic in earlier times
Amazing. Pick the beginner friendly ones first so you don't get frustrated
If you're building with the server or client configurations, you're good (using the macros)
Absolutely
If you want to use a listen server or some such, you might be better off checking for #if !UE_CLIENT rather than #if UE_SERVER, though.
ooh yeah okay, thanks ๐
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
Not that I use it, but fwiw it's not a stable plugin yet
And currently on hold afaik
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
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
WHy not use the built-in physics replication system?
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
As in SetReplicatedMovement(true); ? Seems to interp the movement nicely at low update rates but the rotation is very choppy
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
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?
There's a whole physics replication system with tunable parameters
Look in project settings
I haven't touched it since 4.27 but it should still be around.
It doesn't just interpolate, it tries to maintain smooth acceleration etc and "nudge" physics into the right state
it can also extrapolate
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);
I've only ever set the params in BP.
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?
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.
Thanks this is great, already seeing better results
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
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
Angle lerp
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
This is what I use for my vehicle game, I only replicate the chassis and turrets movement, not wheels etc
30K? Jeebus
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
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
That makes total sense! Anything secondary or cosmetic the client can handle with much more lenient values here
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
The hard part of Rocket league isn't the accuracy, it's the prediction
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.
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?
Can Character override gravity for itself?
I'd do that and have global gravity be the real thing
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
That's mostly due to your size.
Gravity will seem floaty if you are much bigger than a realistic scale, it'll seem really fast if you're much smaller.
Also makes sense ๐
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.
As long as the client owns that actor they can AFAIK]
There's SetAutonomousProxy on AActor, which you can probably call on the server. I'm gonna give it a shot.
Which also unfortunately won't help you much
A client-owned actor has to own that actor
Just spawn an actor that's "owned" by the client? That's the only way anyway
Not for physics-simulating objects, gravity is fixed for the whole scene.
IIRC the way PhysX integrates gravity is a bit different too
I always got very different results doing it myself
Good to know thanks! Got a hacky AddForce setup on tick working for now (applying additonal gravity each frame)
How does the server end up with a representation of that actor, then? If you spawn it on the client the server won't create its own copy, right? Don't you still have to spawn it on the server, replicate it to the client, and then tell the server that the client owns it?
I'll dig into how player controllers do it since those spawn in both places.
Right. Client owning some actor, means a client-owned actor owning that actor
Owning happens server-side
Always
Hm, so you mean like literally MyNewProxyActor->SetOwner(SomePlayerController)?
Literally spawn a replicated actor server-side, and inside its FActorSpawnParams specify Owner to either PC/PS/Pawn
Yes
Either that or SpawnParams
Gotcha, that makes sense to me. Thank you!
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
- Yes.
- Engine modification.
- 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
does seamless travel work with open level instead of executeConsole?
No. OpenLevel is always hard travel, like it's said here: https://wizardcell.com/unreal/persistent-data/#travel-drivers
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)
when I activated seamless travel and use executeConsole , then the UI HUD of the level only be appear and the map not be open , why ? without seamless travel everything work perfect
You haven't provided sufficient information for me to be able to answer the question
I wanted the bio medal instead @whole grove ๐
look at the video
after I press start button , the game map HUD will be appear but the UI of the lobby map will not be removed !!!!
Now you explained things better
Reason being UMG widgets persist seamless travel as it's said here: https://wizardcell.com/unreal/persistent-data/#persistent-objects-on-client-to-destination-map
You will have to remove them yourself manually
how I can remove it manually ? with using remove from parent ?
The science behind the behavior is still being researched: https://wizardcell.com/unreal/persistent-data/#persistent-non-actor-objects-across-seamless-travel and hopefully we get to why that happens
Have you tried clicking any of the links I sent?
This for example should get you to your end goal ^
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
We might figure out what's going on if we saw relevant code
thank you for you help , I removed the widget and now I have another issue , my Level gamemode is different with lobby gamemode, after seamless travel , my Level Gamemode will not be load , I wrote a spawn function inside that gamemode , do you know why?
Your GameMode spawns and loads fine, it's that function that isn't working properly. Debug your code and figure it out
but I put GEngine->AddOnScreenDebugMessage in GameMode PostLogin and it not be called in Seamless travel , in Normal travel it will be run and everything is good
Yes because PostLogin doesn't get called in seamless travel
It gets called for hard travel
so any thing can I use instead?
You might want to use HandleStartingNewPlayer
That gets called regardless of the travel type
thank you
By the way all of what I said up to this point is in that compendium
yes thank you , I will read all that
its work now , thank you , I really Appreciate all your helpโค๏ธ
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 ^^
does ping in UE5 has bug ? it always shows 9999 !!!
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
thats an bug with the steam API
assuming you use steam
The engines built-in Steam implementation is pretty lackluster/barebones to be honest. It's quite common to have to modify or update it
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
Guys, the HUD class only runs on client, as far as I know, correct?
depending on how you do it. yea
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?
btw on the widget ref, disconnect the bottom blue line and use the end of the set to get into the add to viewport
when doing it like on the screenshot, they end up not being the same?
every client + listen server has own instance of hud
i dont have any experience with the HUD class, but the **get player controller (0) ** could be why
since that grabs the servers controller
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
HUD and UI is just local for every player including listen server, if it creates anything it creates it locally, little "computer icon" also tells that is local. GetPlayerController(0) will give you local controller.
But if its local how can other players change the variables and stuff on it?
That's why I used GetPlayerController(0), because I thought locally there is only one player (?)

This event begin play is on your character?
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.
It is on the HUD class
Are you running as a listen server?
yes
I'm playtesting as listen server + 1 client
You can't prevent cheating and allow players (or third party hosting services) to run servers. The moment you give players access to run the server, they are capable of doing whatever they want. If you are trying to save externally there's only so much you can do to prevent faulty data.
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.
Hm I quickly tested playing with 2 clients only
If you change the way you thinking about it it will be easier for you. UI is local and it should show variables located somewhere else not in UI, it basically just a front end, no game logic, no game variables there is just a tool for reading and showing variables.
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
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.
btw it is better to use GetOwningPlayerController
My guess then is that all players are using the server HUD instead of having their own each one
HUD and UI/Widgets only exists on the local instance of the game.
The HUD is created on begin play, I'm taking some time to get damaged, so I don't think that's the situation
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
HUD is automatically created when game mode initialize player
I meant the widget created on begin play inside the HUD class, my bad
This sounds very amazing, I need to learn how to do this though, I don't know how to bind to events
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.
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?
Maybe will be better to follow some yt tutorial, should be plenty with player health, and then next step will be multiplayer
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
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.
...
I'm sure I'm lost somewhere
No. The HUD is created when the PlayerController is created.
@sinful tree how to prevent cheating while using listen server?
You cannot.
I must use dedicated server to prevent cheating
And anti cheat, and player reports, and...
I'll watch it, the part about linking to the player looks good lol
Good luc kwith multiplayer on phones
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.
tbh
Anyone else using the SocialToolkit?
So, was following that video sent before, just set the player to create the HUD, nothing else
Where is this event begin play?
On the player character
IsLocallyControlled?
Are you trying to access the HUD while running on the server or something (again, usually dedicated servers have this problem)
I'm playing as two clients hmmmm
Ok, so "As Client" indicates dedicated.
Begin Play fires on all clients and the server.
There is a setting to load widgets on dedicated in project settings ๐
Evil setting
Shhh
I dunno why they would do that XD
Is there any way I can specify so only the client runs it?
Some junior dev added it prolly
Like authority somehow?
Yes: #multiplayer message
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 ๐
IsLocallyControlled is my go to node in such situation for the simple reason that widgets, HUDs, etc. exist locally
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
So even listen servers get widgets as they should
I was aiming to manage player HUD on the HUD class (spawning and modifying) because it feels more organized?
And that's actually the better place to do it.
HUD's middle name is "widgets manager"
Yes that's a great example as to why videos are a great piece of information
I'll go back on doing it inside the HUD class then, I love some organized blueprints 
also quick doubt, is is possible to get reference of other players inside the HUD class since it is a local class?
There is no player class
Well there is but you meant to say Pawn?
You can but you shouldn't need to
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.
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?
Yes
Yes but don't
Generally speaking, that means you'd have to have those values stored on a player state if you want them to always be relevant.
Oh that's very interesting
Basically UI is literally "display stuff" and not manage it
"player clicked the button to activate whatever is in slot 1"
Yes, and pls make sure it's the old damage system so you look old school
Not my type, I prefer Udemy, fite me
I see you declared war 
Hehe
Who gave you permission to stop writing articles?
Its my birthday man, give me some leeway
thanks haha
u got something new written down?
i have yet to check it out
Happy birthday homie, another amazing year of writing amazing articles โค๏ธ
@fathom aspen ๐ฅ โ ๏ธ
Shhh don't let them know
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)?
