#multiplayer
1 messages · Page 271 of 1
my experience with chaos mover half a year ago is that it crashed when I would open the bp
probably advanced since then if fortnite is using it?
if it's good enough for hundreds of players in a map for fortnite, I have no qualms with physics based movement
They did commit a bunch of stuff the past 6 months for Chaos Mover.
But the point remains that Mover in itself is not even close to the feature level and robustness of the CMC.
Sadly stuff like this only ever comes to light when a project is already on the way for a few months or something more complex is needed.
I just wish it was easier to mesh with GAS prediction
no we still use CMC atm, but im working on switching as we only have very basic movement
and in my tests mover is faster than CMC for what we need
It has started making progress though, they implemented crouch and stuff, and basically it works just like how CMC works in its base form
ofc it requires a lot of different thinking, cause inputs are not how you do it via CMC
you have to send the state snapshots in
like WantsToCrouch and not already crouching
im not sure they are using it in Battle Royale
iirc it was used in Lego side
im pretty sure battle royale still uses CMC..
Yeah, BR is still using CMC most likely.
But FN Creative is moving to Mover
I seen't it at UE fest
yeah creative is like the playground
you dont want to break the main Battle Royale
thats the money maker
kinda sad that they gave up with Save the world though
as that was what Fortnite was
Yup
but BR exploded (thanks to Pubg at the time) and ofc Fortnite with its less serious play style to PubG exploded.
RIP STW and Paragon and UT
Paragon was a shame
UT was doomed as soon as fortnite exploded
cause they pulled the team into Fortnite
for BR right?
Yup
yeah and most of them left now
i always wanted to take UT4 and carry it on, but getting permission from Epic
cause its all there stuff, you cant jus tmake a game using UT5
UT4*
It's the little things though. CMC has a lot of smaller functions and chunks of code that handle different edge cases. Such as jumping on and off a platform or all sorts of things against cheating.
Mover, at least when I started using it, literally crashed if you destroy the actor while it is being moved by based movement.
You can do the basics, but it's just not "battle tested" and is lacking the stuff that the CMC received based on noticing problems.
I 100% agree with this ^^^^
Mover is nowhere near production use ready.
We are making an FPS-Z title inspired by Tribes, so we have walking, jumping, jetting, skiing and we also added the ability to ski on walls and wall-jump. So far it's all working great with Mover, and I do like how modular it is.
The main issue that inspired me to ask the original question was that I noticed that simulated proxies could sometimes look quite juddery at high speeds (you can hit 200mph if you're good with movement), and my hypothesis which was later confirmed by you guys is that NPP isnt properly simulating movement when forward predicting, so it's constantly having to get updates from the server which becomes noticeable when movement per tick is so high
So my experience with Mover is pretty positive overall, its just frustrating that it isn't well documented or, as in the case with NPP, finished
Hopefully the Chaos mover can fill that missing piece
Tbh moving at such high speeds is kinda niche, you might end up having to handle your own smoothing/simulation of those pawns even on another framework
Yeah mover 2.0 is just their prototype. Any engine movement component also is going to be less suitable the more you move away from generic movement. I built a movement component from scratch for my platformer because getting Mario movement physics from CMC or another option wasn't going to happen
It's so much work tho, makes you appreciate CMC all the more
IIRC First Person Rendering fixes that, it's production ready in UE 5.7. It's just really good as it provides you with many other features you'll need in your case like accurate self shadows in first person, there is an Unreal Fest video talking about it somewhere.
How do I fix the jittering of chaos vehicles on client side?
What is IIRC?
If I recall correctly
Oh okay
am i setting up correctly right?
overloaded GetMesh()
USkeletalMeshComponent* ASoldierCharacter::GetMesh(int32 Index) const
{
if (Index == 0) Super::GetMesh();
else if (Index == 1) return FPS_Mesh;
}
what is this overloading?
GetMesh() has no parameters and is not virtual
you should probably just make a separate function for getting the other mesh
If you do need something that gets it based on the local perspective it should consider being the local view target (which is cached on pawns)
just fixed it yeah
doing it
APawn::IsLocallyViewed for example
this is how OwnerNoSee and OwnerOnlySee work, they use the view target to figure out if they are a component attached to the view target or not
This is nice because changing view targets will change what you see
i was following this tutorial
Project Files : https://www.patreon.com/posts/39705781
This is the 2nd episode of unreal engine multiplayer first person shooter series. When we play multiplayer first person games, we don't need a character mesh for our character apart from the arms as we see the game in first person perspective. But when we see other players, they should have ...
i dont understand how can i use that ?
you can call functions and use their return value to change what the code does
I was just saying for if you needed to figure out which mesh was the "active" one dynamically
how can i fix this?
void UCombatComponent::EquipWeapon(AWeapon* WeaponToEquip)
{
UE_LOG(LogTemp, Warning, TEXT("SoldierCharacter: %p"), SoldierCharacter);
UE_LOG(LogTemp, Warning, TEXT("WeaponToEquip: %p"), WeaponToEquip);
if (SoldierCharacter == nullptr || WeaponToEquip == nullptr)
{
return;
}
EquippedWeapon = WeaponToEquip;
EquippedWeapon->SetWeaponState(EWeaponState::EWS_Equipped);
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetMesh());
}
EquippedWeapon->SetOwner(SoldierCharacter);
}
void UCombatComponent::OnRep_EquippedWeapon()
{
EquippedWeapon->SetWeaponState(EWeaponState::EWS_Equipped);
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetMesh());
}
}
void ASoldierCharacter::ServerEquipButtonPressed_Implementation()
{
if (Combat)
{
Combat->EquipWeapon(OverlappingWeapon);
}
}
should i replace GetMesh with FPS_Mesh?
It depends on the perspective
I do not know what that means
void UCombatComponent::EquipWeapon(AWeapon* WeaponToEquip)
{
UE_LOG(LogTemp, Warning, TEXT("SoldierCharacter: %p"), SoldierCharacter);
UE_LOG(LogTemp, Warning, TEXT("WeaponToEquip: %p"), WeaponToEquip);
if (SoldierCharacter == nullptr || WeaponToEquip == nullptr)
{
return;
}
EquippedWeapon = WeaponToEquip;
EquippedWeapon->SetWeaponState(EWeaponState::EWS_Equipped);
if (SoldierCharacter->IsLocallyControlled())
{
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetFPSMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetFPSMesh());
}
}
else
{
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetFPSMesh());
}
}
EquippedWeapon->SetOwner(SoldierCharacter);
}
void UCombatComponent::OnRep_EquippedWeapon()
{
EquippedWeapon->SetWeaponState(EWeaponState::EWS_Equipped);
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetMesh()->GetSocketByName(FName("RightHandSocket"));
if (SoldierCharacter->IsLocallyControlled())
{
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetFPSMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetFPSMesh());
}
}
else
{
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetFPSMesh());
}
}
}
wait, i'll send a ss
IsLocallyControlled should be IsLocallyViewed unless you plan to never have spectating/replays in first person
no replay but spectating yes
you also appear to be using GetMesh in both cases for local and non locally controlled
void UCombatComponent::EquipWeapon(AWeapon* WeaponToEquip)
{
UE_LOG(LogTemp, Warning, TEXT("SoldierCharacter: %p"), SoldierCharacter);
UE_LOG(LogTemp, Warning, TEXT("WeaponToEquip: %p"), WeaponToEquip);
if (SoldierCharacter == nullptr || WeaponToEquip == nullptr)
{
return;
}
EquippedWeapon = WeaponToEquip;
EquippedWeapon->SetWeaponState(EWeaponState::EWS_Equipped);
if (SoldierCharacter->IsLocallyControlled())
{
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetFPSMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetFPSMesh());
}
}
else
{
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetMesh());
}
}
EquippedWeapon->SetOwner(SoldierCharacter);
}
void UCombatComponent::OnRep_EquippedWeapon()
{
EquippedWeapon->SetWeaponState(EWeaponState::EWS_Equipped);
if (SoldierCharacter->IsLocallyControlled())
{
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetFPSMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetFPSMesh());
}
}
else
{
const USkeletalMeshSocket* HandSocket = SoldierCharacter->GetMesh()->GetSocketByName(FName("RightHandSocket"));
if (HandSocket)
{
HandSocket->AttachActor(EquippedWeapon, SoldierCharacter->GetMesh());
}
}
}
I have no idea what I'm looking at here either, you have not described which images show which perspectives
if you change just two lines it might be better to just edit the message instead of pasting the giant code block again
Top left is client and big one is server
i want the gun for Simulated Proxies to be attached with fully body
but for the client/server who have equipped the weapon to have gun attached to FPS Mesh
debug it I guess
this will silently fail if it can't find the socket because it does not ensure or log an error
Socket exists.
prove the AttachActor is being called in all cases
add {,,UnrealEditor-Engine.dll}::GPlayInEditorContextString to your debug watches or just get GetDebugStringForWorld(World)
i'm not that good with deep UE knowledge. kinda beginner-intermediate.
can u pls explain how can i do this?
it is REALLY important that you understand how to debug stuff in your IDE here
what this is is a global variable you can watch in the watch window
that shows the name of the current world
this is useful so you can figure out if you breakpoint on player 0, 1, 2, the listen server, etc
you can also just spam debug logs if this is difficult to set up. You can get this string by calling GetDebugStringForWorld
ohk
just to be clear you are aware of what a breakpoint is, right?
yes
just don't know what {,,UnrealEditor-Engine.dll}::GPlayInEditorContextString this is
yeah this thing is an unfortunate wacky prefix you need to use to tell your debugger about which module that type is in
it's weird... in an idea world we could just use "GPlayInEditorContextString "
some IDES might be smarter about resolving this than others
in my case (I forget why) my custom engine has renamed the base module which is annoying
yours should just be UnrealEditor-Engine though
just add it to the watch
most of the time you will only care about local variables/this but it can be useful to see other things consistently
but what should i look into for this?
in single player
debugging is kinda easier even with breakpoints
this is for OnRep_EquipWeapon
@nova wasp I'm using IsLocallyControlled. If I also use NetRole == Simulated proxies, and attach it to full body mesh for simulated proxies.
Make sense or illogical?
I already said to use IsLocallyViewed
I suppose you may also need to swap between the two as well if view targets change
also debugging will be difficult if you are not using DebugGame Editor
Changing configuration?
Okay, but IsLocallyViewed placed on OnRep or Equip only?
that depends on what each one is supposed to do, I have no context for when it runs and on which sides
Just see the game like COD
Cod MW2 (2009) to be specific
Each loadout prefixed per mission (level)
Basic multiplayer coop (Spec Ops)
Quest system (Missions / story progression)
I think I am asking about the code I am seeing, I don't really need to know everything else about the game
it helps I guess to get an idea of what you want but I am asking on which sides each function runs on
does EquipWeapon run only for the local player? from something else?
The EquippedWeapon is Replicated Property but COND_OwnerOnly. OnRep is for all the clients/other player to update the property for that client so they can also see the weapon is equipped by the player.
if it's COND_OwnerOnly how are the simulated proxies going to see it
you are describing the complete opposite
Equip Weapon run for local player (also via RPC if called on server) but OnRep is called as well whenever the Equip is called since property of EquipWeapon is updated.
is this onrep firing on simulated proxies or not?
If I just set to Replicated Property, it'll be attached to all player
Didn't implemented the firing rn
I am referring to the function being called
Sorry for the bad english
all good, if I say anything confusing I can try to make it easier to understand
Yes it is firing
The issue is, OnRep is actually attaching the gun to fps mesh which it shouldn't be
Basically, if you Equip a weapon. I'll see gun on your full body mesh not the fps mesh. While you see, then you'll see the gun on your fps mesh
That's a lot of text, quick question: Is this about attaching a WeaponActor to FirstPerson and ThirdPerson meshes?
Yes
I am super lost because you are saying the replicating condition is owner only, but is firing on sim proxies
if there are TWO distinct properties we need to know that, we can only see what you show us
There is one key thing about this, which I'm not sure was mentioned, so I'm throwing it in:
Attachment in itself is replicated, which means whatever the Server attaches to will be replicated and attaches to on Clients by default.
ah, I should have asked if the weapon has replicated movement too
Of course with the little note that the Actor you are attaching has to be replicated.
that's a good point
Wait, I'll public my GitHub repo
ReplicatedMovement isn't requited for this.
It happens by default for every Actor that is replicated.
/**
* Used for replicating attachment of this actor's RootComponent to another actor.
* This is filled in via GatherCurrentMovement() when the RootComponent has an AttachParent.
*/
UPROPERTY(Transient, ReplicatedUsing=OnRep_AttachmentReplication)
struct FRepAttachment AttachmentReplication;
Just click on the weapon actor and see if it's replicated
UPROPERTY(ReplicatedUsing = OnRep_EquippedWeapon)
AWeapon* EquippedWeapon;
THE ACTOR ITSELF... not a pointer to it
also yeah I guess if this is replicating it and resolving it would have to be replicated
void ASoldierCharacter::ServerEquipButtonPressed_Implementation()
{
if (Combat)
{
Combat->EquipWeapon(OverlappingWeapon);
}
}
void ASoldierCharacter::EquipWeapon()
{
if (Combat)
{
if (HasAuthority())
{
Combat->EquipWeapon(OverlappingWeapon);
}
else
{
ServerEquipButtonPressed();
}
}
}
void AActor::GatherCurrentMovement()
{
if (IsReplicatingMovement() || (RootComponent && RootComponent->GetAttachParent()))
these are the code
weapon is replicated
@pliant cypress The point is that your WeaponActor, if replicated, will automatically replicate Attachment Information and handle attachment in OnRep_AttachmentReplication.
If you additionally handle attachment in your own code, e.g. via some OnRep, you are fighting that.
You will need to override the OnRep_AttachmentReplication in your Weapon.
okay, then you are fighting attachment replication
you can simply override ::OnRep_AttachmentReplicationto not do anything as a simple band-aid fix
there is a special macro to disable replicating a property manually but I would rather not look it up right now
Correct. Other games simply don't use Actors for the Weapons, but have a WeaponMesh they attach, which doesn't have that issue.
But overriding the OnRep_AttachmentReplication is a valid solution imo
nah... you can still use an actor just fine
just making it replicated by a separate object
Yeah sorry, I meant for the WeaponMeshes and the Attachment part.
i can overwrite but what should i do in overwrite for the solution? because i don't understand the solution
For starts you'd just leave it fully empty.
just leave it empty
you can just not call the super
why would it need to do anything here?
it might be valuable to ignore it only if it's for a certain actor maybe? I don't know
for example if you know it's for a character, ignore it but use it if it's replicating attaching to a vehicle
Your problem is that Unreal Engine takes the Attachment Information, replicates it, and applies it. Means that if your Server attaches the Weapon to the ThirdPerson Mesh, it will do that for Clients too.
But you want to do this manually in your own OnRep_EquippedWeapon, at which point you have to disable the default behavior.
And you do that by overriding OnRep_AttachmentReplication in your WeaponActor and just leaving it fully empty (also no Super call).
i am on ListenGame so whenever a player attach weapon. For the player, it should be FPS mesh but for other including server if sevrer player didn't equipped, should be Third Person Mesh (full body mesh)
Yeah that's all good and you are doing that in your OnRep_EquippedWeapon already.
Just override that function we mentioned and leave it empty.
okay, testing that now. Building the code
did you actually override it for the weapon?
void AWeapon::OnRep_AttachmentReplication()
{
// Empty
}
i did
I am a bit worried there might be one or two more places that can use attachment replication
but this should help
No worries. You can be happy that you are using C++, cause Blueprint peeps are lost on this :D
eXi figured it out, I was not even thinking about the weapon 😛
LoL, i'm more good with C++ than blueprints unless it's about small work
I didn't even know what the problem was, I just threw in that the Actor does this crap by default :D
one question
how to debug multiplayer?
single player is good, set breakthough and check
Gotta be more specific.
what about client and server side debugging
I already told you to add the PIE debug name to watches
yes
just changed configuration to Debug editor
this is a big subject and there are a lot of different things unreal can do to help here... for starters you can just literally click on things in the editor
debugGame edtor?
yes, you need to be in debug/debuggame to debug c++
otherwise all code will be optimized away
you should read the pins in #cpp to get started
ohk
When playing in the Editor and you are using a Single Process, which one almost always does, then you can't specifically choose if you want to breakpoint Server or Client. If a function is called on both, then you just have to check if the breakpoint hit on the the one you want to debug and if not, continue until it does.
The Watch that Megafunk mentioned can help with that, as it tells you, in most cases, which one caused the breakpoint.
Not sure how non-Single Process behaves here in Editor.
If you have a packaged build, then that problem somewhat resolves itself, as you'd attach your IDE to either the Client or the Server process anyway.
If you attach it to both at once, then you are back at the Breakpoint being able to call for either.
If you breakpoint functions that you 100% know are only calling on Server OR on Client, then the Breakpoint will also only hit on that one, so that part is straightforward.
For multiple Clients, you'd still want the Watch to know which Client caused it.
you can use conditional breakpoints if possible or even just add an if statement that switches on local network mode to make a breakpoint only hit for clients
sometimes temporary debug stuff like that is helpful
conditional breakpoints are unreliable
True, that can help. I'm not having much luck with Conditional Breakpoints, in general, though.
also a lot of debug printing in PIE can actually be sent FROM the dedicated server to display in other worlds but I forget the details
I would recommend just using the visual logger honestly... it can split categories for each instance in the options
If you want to print some value that you know can print on both sides or generally multiple players, etc., you'd want to also print the NetRole if you can (not always available).
just use GetDebugStringForWorld
no need to make a new thing
Ah, yeah that could also work. I'm just used to printing NetRole.
and yeah this stuff can just be hard... it can really help to make dedicated in-game debugging tools
that for example just debug draw where things are
so you can turn a cvar on or something and see more information for a certain thing
I make HEAVY use of visual logging when dealing with network movement code
it helps that way to be able to scrub through things
🙂 great advices. Thanks for this too
Yeah I'm quite blessed with NPP/Mover having a dedicated Insights view that lines up the data to frames. I hate debugging network movement code when needing to check values due to ping..
well
i'm making sprint now
in CMC as you suggested
Yeah, that Insights View is also not a reason to use Mover haha, stay with CMC:
Sprint only in forward and forward diagonal. Not backward or right/left
do you have to package your game everytime you want to test a new feature?
No, but you should package once in a while to ensure what you think works in Editor does work in a packaged game. Specifically shipping.
so the dedicated server doesn't need to be packaged again before I test in the editor?
No, you shouldn't mix packaged builds and the Editor anyway.
You can play in the Editor with a dedicatd server by just selecting "Play As Client" in the settings.
If you test packaged builds, you should build Server AND Client and test them together.
alright ty
virtual FSavedMovePtr AllocateNewMove() override;
Is this removed from FNetworkPredictionData_Client?
i'm getting red lines on ths
class FNetworkPredictionData_Client_Soldier : public FNetworkPredictionData_Client
{
public:
FNetworkPredictionData_Client_Soldier(const UCharacterMovementComponent& ClientMovement);
typedef FNetworkPredictionData_Client Super;
virtual FSavedMovePtr AllocateNewMove() override;
};
you need to reason about what is happening
it looks like corrections are occuring so you need to consider if the server version is doing the same thing
the cmc is ulitmately just playing the same saved moves back on both sides and trying to get close, if it doesn't get the same information it cannot resolve the same position
Hi! I want to separate the hands in the first-person view of my multiplayer game. In the local view, I attach the fishing rod blueprint to each player's FP hand, and if not, it attaches to the third-person hand. In the FP view, the fishing rod is in a different location than in the TP. How can I replicate the hook on the end of the fishing rod? When I replicate movement of the bp_hook, the hook is in the same place in all players, but because the fishing rods are in different positions, it appears incorrectly in either the TP or FP. Furthermore, because the TP has physical animation and locomotion animations, the fishing rod is constantly moving, while in the FP view, it remains stationary. Is there a way to do this?
Server is working fine.
It's the client side
I did watch cmc architecture video to understand it, but a bit confusing
https://discord.gg/uQjhcJSsRG
In this video I go over the architecture of the CMC to outline a high level understanding of the processes performed by this component.
Helpful links for understanding Client-Side Prediction:
https://www.gabrielgambetta.com/client-side-prediction-server-reconciliation.html
https://www.gabrielgambetta.com/client-s...
I was following his next part for sprint so after I can implement forward only sprint
Same problem as mine. You just need to override the FAttachment Rules
And leave it empty
So then you can implement your custom Attachment setup
Such as for simulated proxies, you can attach the rod to TP mesh and for player, attach to hand
@rotund linden
Override this function in AActor so you can setup the rod attachment correctly
I'm attaching the fishing rod to FP and TP hands there's no problem with that. The problem is replicating the hook at the end of the fishing rod. Because the rod positions are different in the FP and TP
Perhaps the Location of Hit isn't replicating well?
The hook is attached to the rod with a physics constraint. I use replicate movement on the hook, and the position is the same for everyone. But because the rod is positioned differently in different views, in third-person view, it looks like the hook is floating in the air. You can see it in the video. This is because there are animations in third-person, but not in FPS and the rod positions don't match.
Since the hook doesn't move in FP, it doesn't move in TP either
Perhaps something blocking it?
Can't know until we see code.
Bro, the problem has nothing to do with that. I’ll explain it to you in the simplest way because you didn’t understand. In FPS, the hook just stays in place and doesn’t move up or down. In TPS, since there’s an idle animation, it moves up and down, but because the hook is fixed, it looks like it’s hanging in the air. There’s nothing blocking it or anything like that
I think this is a bit too complex of an issue for you. Thanks for your help, but our problem doesn’t have a simple solution or logic
Lol, you’re just making the job look more complicated
It's okay, I thought i could offer some help though.
Gotcha
Perhaps your FP hand is blocking the Rod since it cannot be seen, the collision exists
Thanks, I think there was a little misunderstanding
there's no collision
i turned it off
Then sorry, it's really a complex for me.
We’re already explaining to you what’s causing the problem. You don’t need to find it—the issue is already known and it’s written in the messages we sent you. Nothing is blocking the fishing rod
The problem comes from the animation difference between FPS and TPS, lol
No problem thanks for your efforts
I just discovered that The Finals are doing 100 percent sever side movement and logic and I’m baffled.
First question is how would I be able to even test this myself? Having movement fully sever side for example, and 2 how can a fast paced game like that feel good and be 100 percent server authoritative?
Hearing that they would most likely not even be using ue for the server. But this confuses me as I have no ideas how that would be setup?
Where did you hear that? I hardly doubt they don't have client prediction
they definitely don't lol
it would feel absolutely terrible
there's no way to have server side only movement not feel laggy with any network latency
can anybody please take a look?
in the video the finals creative director (iirc the guy speaking on the devlog) said they used server AUTHORATIVE, this doesnt mean there is no client prediction
@crisp shard
Looks like your sprinting isn't implemented in CMC correctly
This is my custom CMC. Just turned off my laptop.
Tbh it's bit hard to understand CMC
Prediction data and saveddata
The standard way of fixing this is to spawn a local non-replicated version of the weapon actor the server attaches to you, and keep track of it to destroy it when the actor is deattached/destroyed. You do this on OnRep of the currently held weapon property.
But as long as OnRep_AttachmentReplication works for you, it's all good
Yes
Now the sprint is currently my issue. I understand it's server side only
And also Crouch
There is a repo by Vaei pinned in this channel, you can study it and see how sprinting is implemented
Or just add it as a plugin
Though I didn't overloaded or made a custom, just added Crouch and checked. Worked fine on server but it didn't crouched on client side. But a jitter like server rejected the client's Crouch validation
Okay
Hi, could you please tell me how to fix an issue where, whenever any
client disconnects from the Listen server, the server crashes with this error?
What should I check? I really need help…
Engine version: 5.6.1
Plugins are shown in the screenshot.
The error in the crash reporter:
`Assertion failed: MappedClientConnections.Remove(ConstAddrRef) == 1 [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\NetDriver.cpp] [Line: 6918]
BackroomsLostRunners_Win64_DebugGame
kernel32
ntdll`
Guys, I'm bit confuse between what things to do in C++ and in Blueprints.
After fixing sprinting and Crouch, I'll be working on ADS and Weapon Clipping. So I want to understand, since ADS is for local player but the crosshair or aim offset would be affected in future, should I do ADS in Blueprints or C++ ? How do you distinguish what to do when and when to use both together
Network related things to be for sure work in C++
Ah that might be it. This is where I heard that. And yes I thought the exact same thing, like there is no way they don’t have clients side prediction lmao. cc: @thin stratus @exotic wasp
I just do everything in c++, if you can do it in c++ then why not?
i don't know c++ but if i did, i'd bascially make all classes and base systems in c++ and then i'd extend things in blueprint, but this is just instincts as i only make structs and enums in c++ rn... lol
It's not an either/or decision. Learn what makes C++ and Blueprints different, what they have in common, and how to use them together effectively. We'll also learn a thing or two about performance optimization and some basic software design concepts.
Read the article version: http://awforsythe.com/unreal/blueprints_vs_cpp/
00:00 - Introduction...
https://www.youtube.com/watch?v=flEtQBPtBTc
(slightly less) relevant.
How to determine whether or not you should be using Blueprints or C++.
noob question: for listen-server multiplayer game using seamless travel from lobby->game, where does one idiomatically store game state ? Controllers/GameMode/GameState are not the same across levels. Feels weird using GameInstance since that feels super-global
(if you're kind enough to answer, please use discord reply 😄 )
Yes game instance is the only thing that travels. So anything that needs to be traveled should be in game instance.
There are other ways too with blueprint objects and data table maps.
other stuff than game instance can "be transfered" between levels when using seamless travel
but as you will see some types are destroyed and recreated, but in c++ there are virtuals that you can implement to copy data
You can keep actors across travel
Playerstate also has copyproperties
Can be done in BP alsl
Also
Very cool
cool thank you all. I suppose I'll identify the host user and keep important things in a struct or something on gameinstance until the session is destroyed.
i definitely read that article btw Fishy. It's amazing.
was also looking around in World .cpp to verify how GameMode copies stuff around
It doesn't really copy stuff across world travels.
yeah I'll use them eventually right now I'm super green with UE so just figuring things out and setting up the boring parts of a "game"
things like player controllers are recreated tho
yeah and can override stuff to copy data there. but was thinking about gamemode stuff, where the "game" is the same but the mode class wil change
Localplayer doesn't get destroyed
We use copy properties I'm playerstate for seamless travel
Just root every object 
yeah feels lame storing non-player game data with the "server player" tho IMO
Gamestate also had that ?? Can't remember
(i'm coming from normal-ass day job programmer background)

Have to be with the times
It’s true, I’ve seen it
you can travel and ask the world to change the used GM with Game URL option
If not absolute, you can set a new game mode by adding the following option to the URL :
?Game=Full/Path/To/MyGameMode
been having fun digging around in UE5 source. been not having fun learning how fucked up C++ is as a language after not touching it for 15 years
UE++ is pretty cool tho
Someone here is a huge C++ fan, arguably it’s biggest fan. His name is @quasi tide
Always ping him when you tell him how long you love c++.
was digging around in the delegatesImpl code for a bit yesterday 😵💫
C++ is bad really. Es0eciallly compared to modern languages etc. Hence why they ate trying to make it more relevant.
??
i like c++
(UE c++)
I have a simpler one in my engine
std::move_only_function baby
yeah UE C++ seems pretty decent tbf.
It was stale for years last few tears they have really tried yo make it relevant. Instead of being stuck I'm 1990s
Tell that to VS2026
My phone auto correct sucks
Still looks like a windows 95 application
was trying to trace whether .Broadcast for dynamic multicast from C++ -> blueprint did any memory copy and utlimately got lost in the sauce
If you’re dealing with Blueprints you’re not wrong like 99% of the time if you just assume there is some copying or memcpy in there somewhere
yeah it was mostly curiosity. because I noticed the BP events didn't generate event params unless I declared as const TArray<foo> & and got to thinking whether that reference was maintained.
(way off topic here heh)
I really wanted that to say 'socks'.
Dump on some of my notes on interesting parts of UE networking
- General UE networking resources
- About NetDriver
- About the replication process
- About Push Model
- About Dormancy and relevancy
- About Channels
- About Fast Array
- Uncomplete list of net types
Keep in mind those are updated over time as I learn more
oooh nice
@thin stratus might be worth a pin
Another followup, this section talks about using an AInfo transferred between different gameModes: https://wizardcell.com/unreal/persistent-data/#5-getseamlesstravelactorlist
Actually UE was designed to work with C++ and Blueprint both together
I've seen this
You're not forced to use it though, I mean there are things where it makes sense not to use c++ like in Anim bps. It's probably a matter of preference shrug
also bp nodes trigger my ocd lol
Yes
Though my most of the work is done in C++
And I prefer it too
I once made an escape room in blueprint only
End up making spaghetti
AnimBPs are a funny thing to mention as their EventGraph (not AnimGraph) etc. is so expensive that Epic added a checkbox to notify you that you should be doing stuff in its C++ parent instead.
Can I do the multithread thing in c++ though?
forgot what it's named
Never knew this though. I'll keep that in mind when I revisit my anim bp as it needs big refactoring
i use states for my animbp and let that just do the work instead of animation blueprint update node
exi is a god so he probally knows more as me, but that seems to work for me
need to learn c++ for the animation sharing plugin though
my animations are not that important for the style im working on
You might benefit from reading my wiki
https://github.com/Vaei/LocoTips/wiki
is there way to make interface functions with Server / Remote flags?
🤔
Doing anim logic in c++ is so much nicer than BP. Just collect the data from GT in NativeUpdateAnimation and then do the logic in NativeThreadSafeUpdateAnimation and just use Live Coding when iterating. Wonder who started the meme that you need BP for animation logic and now every noob parrots it. Probably someone who doesn't even make games.
"Worker Threads update asynchronously away from the Game Thread." Thats not true. There is a single AnimThread. That will be bottleneck for GT for example when doing BP only procedural animation. Luckily C++ can solve it.
GT will be waiting for that slow ass BP.
The slow-path for animbps truly is distinctly slower
Random Q, but is tile based movement possible in unreal? Similar to RuneScape? Point and click but there are set “tiles” for movement
Everything is possible.
Lmao was pretty much typing this
Guess I’m asking “how” but that’s probably not a simple answer
When you click, trace to the landscape (or whatever) and round to the nearest tile and tell your pawn to go there.
Seems the answer was simple lol
I guess you’d just have to manage tile size and really that’s that
Pretty much
Not even manage, just decide tile size
How you move the character and what you move them on is a bigger question, really.
Yea, like timeline it / lerp / etc to get to the desired position. Numerous ways all with probably pros and cons. And of course movement would be 100p server side at that point
lots of iris updates recently !!
curious about iris, but also don't want to go through the process of converting what i have to iris for replication... but also don't know how difficult or what that would entail
They've been updating the multi server plugin to work with Iris. Def the future.
I don't know enough about rep graphs to know.. I've only recently started learning unreal
How do I replicate variables from player state to the server? sever does not read the correct client set info.
That's great! Noted. It's really the only thing I'm doing in bp which is ironic. 
Frame everything in terms of your tile coordinates, then convert to world dimension on demand for when something needs to be in the world
My units location is FIntVector2(12,32), that means it should be in the world at FVector(1200.0, 3200.0, 0.0)
Just have some functions to convert from world to tile and back and voila
the world to grid conversions already exist
but it's trivial, it's just a divide and round
yea thats a simple way to frame it, thanks for sharing that
are you doing this yourself ?
for your project/game ?
Kind of
not the tile based movement but an abstract tile representation that gets turned into 3d stuff
Could easily add movement stuff to this tho
bit of a personal take, but i am slightly rethinking all of my movement mechanics, as i feel realtime movement done properly is going to be a bit more difficutl to get correct in the way i'd like. i have solutions avaialbe like GMC and maybe getting into custom movement component stuff, but it's just out of my league at the moment and im kind of thinking of changin movement completely.... but i could just be tweaking
oh btw if you want a nice queryable way to ask "what is at this grid location" try a map of IntVector to Thingy
then it can be sparse
My one recommendation if you go a grid based approach is to have the visuals FOLLOW the grid. That is, moving a thing should be setting its grid coordinates, which happens instantly, then the visual stuff happens in response to that.
A bit like a chess game, your piece instantly moves, but the cosmetics layer shows a nice sliding animation etc.
It's kinda like a model and a view
the model is the abstract "game" which is the grid representation etc. The view is the 3d actors and animations and timelines
hm, so you mean, i'd click location to move to and (on server) the player/character immediately is "teleported" there, and then the visual representation is essentially "faked" in whatever fashion
Sure, assuming it's a game where that can be a thing. Otherwise it might step there 1 tile at a time, or whatever. Point being, the true state of the game is the grid representation, not what's visible.
The query "where is my character" shouldn't return some partial grid coordinate because they're animating right now
as far as the Game™ is concerned, your character is at an integer grid coordinate.
Anything else is just cosmetics on top
yes, i actually love this appraoch, in theory. it would just be something i'd have to decide on, cuase it would be a significatn change
What's the game?
dealing with latency and movement w combat is just ... very challenging to get to feel good
like the game im working on ?
yeah
tbh, i couldn't really answer this question. which might be a bigger problem lmao. but it's an open world with the standard RPG like mechanics, location based states (safe zones, world zones, and a "wilderness"). pvp combat, you can start different game modes as well, a duel arena mode (1v1, 2v2, etc) and another mode i call "release", essnetially like capture and release but 2 sides and they both have their own objectives. these games can be started in the open world and it will "block off" those areas during game
i think i've gottent o the point tho, where i need to scale back a lot of things, and hone in on what i want . but movement is something that really bothers me, and i dont know if it's the movement or like i said above, im just tweaking lol
it's set in a "suburban" like area tho
How much of that works right now
everything i mentioned works
Yeah it all depends on what the combat is meant to feel like i guess
that doesn't scream grid based
there's some more than that, but they all dont connect yet, so hard to say they are importnat to the overarching gameplay as of yet
right. what i love the most is how i've built the scaling of levels and combat items, but they are super simple but everthing can be upgraded and you can levelup skills, and the combo of this does add some interesting dynamics to combat, but i feel like i've based it too much off of what i loved about runescapes combat, without it being runescape based combat. so, it's realtime, and i just don't think it feels that great ? lol
it's third person pov, and characters are actually 2D sprites, but in a 3d world. controls are semi standard, although i do have flying... which of course would not work in a tile based movement setup lol
i'll have to peep what that is
Baldur's Gate etc
ahhh, i've actually never played
flying can work tile based
Position = 3,4,1 is flying
3,4,0 is on the ground
3,4,-1 is below ground (somehow)
lmao "somehow"
or underwater
that makes sense tho, and if you saw my current world, it's probably not the most "tile based movement friendly"
as, im sure you'd probabaly want a semi flat world
yeah I don't really feel like tile based is the play here tbh
click to move or continuous movement?
it's probably not, like i said about... prob just tweaking
currently? you can just move freely like any typical client controlled realtime movement game
I'd just keep that and tune it if that's what the thing was designed around
click to move or grid based movement can work but they really need a lot more depth in the other systems to be attractive. Nobody wants to play grid based Mario for example
yea, i think i do need to fine tune the movement in general, which is compltetly standard as of now apart from sprinting and flying (probably incorrectly) done in cpp/custom movement component
yea 100 percent. best part about what i like about the tiled based setup is simply the fact that latency is a non-issue at that point. or in other words, there's not client prediction / "making it feel good" for all of things that the client "thinks" it's doing
and real time combat / etc in theory is more fun, but the output of dmg, and reciving dmg, is not as simple to make feel good . at least not like the games i've played
bascially struggling with the most common of issues, and it's nothing that crazy, but i do want to get movement to feel better and make events like combat be less about crazy movement and more about levels and items
and nothings broken, im just being critical i think
im realizing im semi venting here gentlemen, appreciate the discourse tho
hey yall im looking for networking advice, tldr I have a randomly generated dungeon and im spawning and destroy room actors on the server and then looping them to replicate with a delay. I pretty much have put delays in everything but after it finishes it cause the server to freeze which I presume the host sending a backlog of actors to the clients. Im just looking for any advice to go about solving the freeze
Just replicate the random seed and let everyone generate the same level layout locally.
id have to rebuild the whole system because its a collision based try and test generation sys
Can almost guarantee that it's a rewrite that's worth doing. Not only will you get rid of your current issue, there'll be a LOT less to replicate.
The only thing you need then is for each client to tell the server when they've finished their respective generation, so that the game doesn't start until they're all ready.
I'm thinking about doing something like that, is there some common way to do that but get replicated actors?
That is, the seed results in some door actor being placed somewhere. Can it be replicated, just as if it was placed on a saved map in the editor?
Hello friends! Sorry this is probably extremely simple, and yet I hit a wall
When a player is eliminated, I want them to unposses their pawn and possess a spectator pawn instead. This has to happen from the server's gamemode, which decides which player should spectate or not depending on the situation
There seems to be no easy way to do it:
- Changing possession of the controller on the server does nothing, because the controller is not replicated
- Overriding player state in C++ to set "bIsSpectator" to true, changes nothing (do i have to do something after that?)
- Restarting the player after setting their player state to bIsSpectator does nothing either
i have a widget component on all bp_firstpersoncharacter that replicates and is designed to appear for all players. for some reason, the host cannot see these widget components, only clients are able to see it. the clients can see the hosts widget, the clients can see other clients, but the host cannot see any. any idea?
you should setup proper tests
what do you mean?
server is the only thing that can change possessin
so server just tells the controller to possess X pawn
not sure what the issue is
The issue is it does nothing 🙂
On the gamemode script, I spawn a spectator pawn, then I make the controller of the client possess it - nothing happens from the clients POV. In standalone mode it works, but not in client mode
then your doing something fundamentally wrong
i cant see your code/bp
the spectator pawn needs to be replicated also
Thank you for informing me I'm doing something fundamentally wrong. I will post my Blueprint shortly
I'm sure many people do! I'm sure it's very simple to do, actually
This is why I'm confused I've been trying it for more than an hour by now and no matter what approach I take I don't get the expected result
This is a very simple example of what I did that didn't work - we are in the gamemode here
When the player "dies" the server calls this function
Note that I've succesfully broke in there with the debugger and can assure you the server is executing this code
In fact, in standalone mode, this works gracefully. In multiplayer mode, running a client, the client does not possess anything when this code is ran. Whatever possession occurs on the server for that controller, is not replicated to the client
You seem to have a lot of experience with Unreal, so I've read up about how Controllers are not replicated per se but their states are - so I've been supposing that calling possession on the controller is useless from the Serverside because the Server's controller instance is not the same as the Client's controller instance for a same client. This is why I've been trying my luck with PlayerStates instead as they are shared between client and server
However setting bIsSpectator & bIsSpectatorOnly on state, despite that the change is replicated, does nothing more than the BP I've shared above
By all means if you have a fundamentally right way to approach this problem that would make spectators work simply, please share it with me - I believe I've exhausted the first two pages of every google search I could find
i have a widget component on all bp_firstpersoncharacter that replicates and is designed to appear for all players. for some reason, the host cannot see these widget components, only clients are able to see it. the clients can see the hosts widget, the clients can see other clients, but the host cannot see any. any idea?
It seems that you spawn this component locally
Starting from the top, and I apologize if these questions seem basic, simple, or have been asked.
1:) Can you show that the server is the context that’s calling this function?
2:) Can you show that the player state you’ve passed in is the correct player state?
3:) Can you confirm if the spectator pawn is the one that’s included in the engine, or one of your own?
What actually happens when you call this function? Nothing? Does the viewport of the client change? Do you get errors, warnings, etc? It’s difficult to debug with the limited information you’ve provided
Thank you for your answer, no problem 🙂
Sorry however but since I've been at it for hours I've ended up finding another solution for my problem - I simply unpossess and set the view position on the client at the desired position (it's a static shot of the level). It was simply too much hassle to make it work and no resources I could find online provided relevant help 🙁
- It was indeed the server calling that function, because it's Gamemode - and that is only executed on the server (clients get side effects & state changes)
- There is only one player whose state gets passed so it couldn't have been another one - moreover i was monitoring the two instances of the game on the same screen so i would have seen if another player suddenly spectated
- The spectator pawn was one of my own but the one from the basegame also did not work
Hopefully if somebody else stumbles into the same problem they'll have more luck fixing it than me
shouldnt i?
i found the issue
when i set visibility for the widget, it doesnt work for the hostr
if you spawn things locally, they are local, thats basic rule of replication
it should be local. each client should only be able to see the ones they can access
but even when the host is in the conditions where it can see the widget, the "set visbility" node doesnt work
i tested it, it runs through the code, its just that it ignores the set visibility for the widget
any idea why @fallen fossil
default spectator class doesn't replicate by default, so when the server spawns it, its not spawning on clients so the clients cant possess it. need to make a custom class the inherits the spectator pawn class and set it to replicate
Hey friend any chance u can help
Struggling lots
?
Ok, so
The widget is a component on every BP first person character
It only comes visible to a player when they are close to another player
when they’re far, the widget disappears
This works just fine for all players except the host
For some reason, even when the host approaches another player, the widget still won’t appear
I’ve narrowed the problem down to this node
The set visibility, it never takes place for the host
@fallen fossil is that helpful?
Where do you run this code?
Where is widget spawned?
Where u want to see widget?
Do you have more than 1 widget?
No
The widget should be seen as an actor component so in the screen of the player that sees it
The widget is spawned as a widget component in BP-first person character
The code I sent, where visibility is changed, is ran inside actor
uh, it though you meant components
is your widget even visible before hiding?
https://getgreenshot.org/
this app is great for screenshots
Greenshot - a free screenshot tool optimized for productivity
No
It’s not
It gets set visible
When under conditions
It works for clients
Even when I set it default visible, the host still cannot see it
Even when its default visible
which net mode u run ?
Try seeing widget without interaction first. did u attach them to viewpoer?
Not sure, but it works for clitents
Clients
I mean,
Does Client1 changes visibilty?
Do you want to see it on Client1?
since its in components list, it should be on each instance
hi how can i clients run "run on server" events on actor on world
actor calling RunOnServer must be owned by this client
I tryed set owner node but not working
Owner should player controller or Pawn?
its ownership chain, it depends if pawn is owned by client then its ok
In need for click events its fixs with player controller
See how it should be? And how it doesn’t work for the host
Add print commands when u show them
I guess they show somewhere else xd
But the print command confirmed that for host, this line of code runs, but doesn’t change viability
You should install ShareX to grab proper screenshots and short recordings.
Recordings and pictures like this make it really difficult
See in the corner the print text confirmed that it ran through the code
Just the visibility didn’t change
Didn’t know that was a thing, but I can
Would be appreciated.
Does this recording work for now? Or do I need to install the software. The whole point is just to show that for the host, it is activating the code to show the widget, but for some reason it stays invisible
What you need to do is share proper screenshots of your BP code that is relevant to this. From start to end.
The video just shows the problem, but without seeing what you are doing we can't really help.
Unless one of us has a 🔮 sitting around.
Will do. Gimme a moment to collect
Darn, left it at the dry cleaners
thats most of it @thin stratus
some other small stuff but thats most ofg whats going on here
Or @fallen fossil if ur still available
What calls the Trace function?
@toxic cobalt
There doesn't seem to be any replication related logic involved here. Should each player only see the widget if they themselves get close to the actor or should it show up on all of the players if just one of the players gets close?
Only the involved player should see
Bp first person character
No sorry
Event tick in the AC_InteractionTrace
And tick is only activated by BP first person character
heres the logic @thin stratus
where do you set Focused ?
Hey guys,
I've got these physics in my game where getting bonked sends you flying a bit, how can I accurately replicate the position of where the skeletal mesh went? Eventually Clients go out of sync somehow after a few bonks.
Also any tips on making the physics nicer? Currently I am only simulating the pelvis on the server and the rest of the bone physics are done locally, which.. is not very nice to be honest, any one got any ideas to make this more wow? : )
So characters stand up after getting bonked, so they need to stand up for all players at the location where the ragdolled mesh is.
Should I hide my current mesh and spawn a different actor where the skeletal mesh is the root of the actor for specific replication of ragdoll location?
Uh let me check
this is in the arctor component its just a function inside of it
this is a tough problem... one way to deal with it is similar to what you have now where you have the pelvis/torso anchored via a constraint to a ball which is the thing that actually moves
storing the full bone positions would be fairly expensive bandwidth wise so getting the rough area is probably more important
#cpp message
an example of how a commercial game solves something similar
learning how to wire up server travelling. Got some code running on the listen server to seamless travel.
GetWorld()->ServerTravel(TEXT("/Game/ThirdPerson/Lvl_ThirdPerson"));
Works in PIE, (both with and without enabling seamless in PIE). When I package dev build, I get a failure that it cannot load the map. What have I messed up? (Just using the third person sample map as the destination).
[2025.09.21-22.44.24:178][ 26]LogWorld: Error: Unable to travel to '/Game/ThirdPerson/Lvl_ThirdPerson' - file not found
[2025.09.21-22.44.24:178][ 26]LogGlobalStatus: Warning: UEngine::BroadcastTravelFailure Travel failed, type: ETravelFailure::InvalidURL, reason: "Invalid URL: /Game/ThirdPerson/Lvl_ThirdPerson?Name=Player?Listen"
[2025.09.21-22.44.24:178][ 26]LogNet: Warning: Travel Failure: [InvalidURL]: Invalid URL: /Game/ThirdPerson/Lvl_ThirdPerson?Name=Player?Listen
[2025.09.21-22.44.24:179][ 26]LogNet: TravelFailure: InvalidURL, Reason for Failure: 'Invalid URL: /Game/ThirdPerson/Lvl_ThirdPerson?Name=Player?Listen'```
can you open the level normally in the packaged build? are you certain it was packaged?
i am not certain. I am very fresh and may not have set up things properly
also don't write in the level as a string in code if you can avoid it here...
yeah I was thinking about wiring it up as a BP reference but to start I wanted to just test it out.
how do people normally reference levels to CPP code
TSoftObjectPtr<UWorld> I guess
you could also just use the asset registry to find all worlds and list them out, whatever
do most just normally do this in BP graph?
If that's easier, sure? This kind of thing is totally fine to do in BP if it exposes what you need
oh, thats a neat idea, imma look into it 😮 thx
(btw turns out it wasn't being packaged, and for now I just explicitly added it in packaging settings)
@fallen fossil @thin stratus any help further or do you guys not really know what to do
Where is the setup being called from?
Pretty sure you call this from BeginPlay, right?
And that would be too early for your IsLocallyControlled check.
If it turns out that you are indeed calling it from BeginPlay, then I can tell you why it's affecting the Server but not the Clients.
- For the Server and Clients, the Pawn/Character is first fully spawned by/on the Server.
- Then it will be possessed by the PlayerController of the individual player, also on the Server.
Now, BeginPlay works slightly different for them.
- For the Server, BeginPlay will call after 1. but before 2. This will lead to the Pawn/Character not having a valid PlayerController on BeginPlay, so IsLocallyControlled will return false.
- For the Clients, BeginPlay will most likely call when the Pawn/Character gets locally spawned from replication, but the key difference is that the PlayerController will already be set, as the whole "Spawn + Possess" happened in the same frame on the Server and replicated down to the Client as part of the initial bunch.
- There is a chance that this does in fact not guarantee that the Client will have a valid PlayerController in BeginPlay.
- BeginPlay, on Clients, is controlled by the GameState being valid and having "InProgress" as MatchState replicated. That will trigger the general BeginPlay on the World. Actors that are newly spawned will check if the World has begun play already, and if so call their own. Otherwise, they wait on the MatchState kicking things off.
The result is, that your Server can't deduce if the Pawn/Character is their own or not.
Solution: Use "OnControlledChanged", or whatever the event is called, to check if the Pawn/Character is locally controlled, or rather as an entry point for your Setup function.
@toxic cobalt ^
I've heard some people saying to use rigs for that as it's possible to replicate less information as rig controllers will control several bones at ones. Though I haven't seen anyone doing that for anything complex like a humanoid skeleton
that's not a bad idea if you just send individual limbs
but it just seems a lot easier to just have one thing
Jambax mentioned that they also replicate velocity... How do you get velocity of a bone?
if it's simulated it has a velocity
and if you can't get the velocity from the body instance somehow, you could easily just store the previous position and compare the distance covered over time
of course if you have to teleport this value must account for that
I guess I should've tried searching for the keywords under the skeletal mesh component first 😅
Yeah, that works. I'm doing a little bit of ragdoll replication for my game as well, and I was only doing position and location, and it didn't look that good. Maybe replicating velocity will help it a little bit
I’ll try this. Again, the clients work fine, just the host cannot see the widgets properly (clients can). The host CAN see the regular actors widgets(button and doors) just not the clients.
Would adding a delay onto event begin play change anything?
Delays should never be used to fix stuff in Multiplayer.
I already told you what you can do instead of using BeginPlay.
Are you should that will work? Consideringt things already work for non-character widgets
Are you calling the setup code on BeginPlay?
Yes
It’s the same code, it’s all one system for interactions
Then the change is gonna have some effect either way, even if it doesn't fully fix your problem.
You shouldn't check IsLocallyControlled on BeginPlay.
Ok
If the issue or part of it still persists, then we can check further.
Is “oncontrolledchanged” a built in function for unreal? Or how exactly would I make them myself
I’ll fix it and let u know
It's built in. Pawn/Character should have it.
Not sure about the exact wording, but something with Controller Changed.
Ok, let me implement that
Unless you are using a really old UE version..
Thanks so much bud
Hey all, what's the best way to spawn a non replicated actor with the actor bReplicates set to true by default?
Come again?
Maybe I deemed it unworthy? Maybe I didn't see the ping? Maybe I forgot? Who knows.
{
bReplicates = true;
}```
spawn this ^ actor without replicating it
i got my suspicions
Set the boolean to false.
That's controlling the replication after all.
I also want to replicate it in some cases.
Do I need to make a new method like:
{
bReplicates = newReplicates
}```
And call it after it gets spawned?
There is SetReplicates already.
Yeah, you could do that.
If it's decided by the spawner, then you can try spawning it Deferred and then setting that based ons ome condition.
maybe you could make a child class where the only difference is that it doesnt replicate. spawn that when you dont want rep
AFPSProjectile* const NewProjectile = GetWorld()->SpawnActorDeferred<AFPSProjectile>(...);
NewProjectile->SetReplicates(SomeCondition);
NewProjectile->FinishSpawning(...);
Hey, has anyone played around with Unreal's replay? The DemoNetDriver. I thought it'd replicate multicast events during a replay but they seem to not be triggering. It's for a singleplayer project though. I tried to see how they implemented replays in the Lyra project but it's too complex for me to understand.
Well it's not going to be easy since replays will only really work if your game fully supports networking. For multicasts, which actor did you choose because I vaguely remember having to override GetFunctionCallspace (or something similarly named) to get it to work
I'm calling custom events (set to multicast) in my thirdpersonchar in hopes that they'd get recorded into the replay. The movement replays well, and I managed to trigger some event using repnotify. But i hoped there was a simpler way with the multicast... Having a repnotify for every event doesn't sound like a good aproach.
I saw this too: https://forums.unrealengine.com/t/multicast-not-called-in-replays/381362/2
I'm currently creating a multiplayer project which involves frequent changes in speed (sprinting to crawling to walking etc). I was changing walk speed by setting 'max walk speed' as you would in single-player, but I noticed that when i simulate a bit of ping, you get rubber banding , because this is server-authoritative and not client-predictive.
However, by using the character movement component's crouch function, there is in-built client prediction, so the change in speed is smoothed out.
All I want to do is add some more movement modes, which function like 'crouching', and are identical to walking but have preset max speeds, and client-predictive speed transition when you swap between them.
Unfortunately, it looks like you can only add these by editing your character movement component in c++. If anyone would be willing to walk me through that process, I would really appreciate it - I feel like if you know what you're doing it should take 10 minutes, but I don't so I've been at it for days and chatgpt hit a wall!
Now I'm at my PC, this is a very old post. The problem I was thinking of if you're sending RPCs to the demo player controller - that did need some extra logic to get working
Otherwise can't say I've had an issue
And for that specifically, was overriding CallRemoteFunction
How can i lower the fps threshold for cmc to combine moves?
My laptop does not allow going over 60fps and i need to test if combining moves works fine
Edit: should be GetClientNetSendDeltaTime
anyone working with custom c++ server?
Does anyone happen to now, if I replicate a large array of class references, how much data does each class reference actually take? Is it just a memory address? If so how does that work when replicating, given the server and client will have different memory addresses?
Its an Network Guid that is actually transported
Which is mapped to Objects
These are always the same for on disk Objects
In iris it will send the full class path once and then negotiate a shared tiny ID
it's not just a memory address... it has no clue what the memory is on the other side
so it must resolve the path
at least all asset-style classes will work that way afaik
You should just use network insights to measure to see if it's even an issue
Ok so even if an actor of that class isn't spawned in the world, it still has a network guid?
If you do find that there is too much data being sent (for some reason) you could just try to bundle multiple assets together under one asset if possible
See what Megafunk wrote in addition.
If it hasnt been mapped yet, it will send the full path
This allows the engine to load the class first
If it hasnt been used yet
It would be unlikely for this to be a big cause for bandwidth issues unless you have thousands of unique things that all must be sent at once imo
or have really restrictive bandwidth needs
OK thank you both! Much appreciated.
One thing I do wonder is if you could basically "pre-heat" the mappings
but I really doubt there's much need for that
If you wanted to you could make your own ultra simple ID to class mapping
Precache them so they are on disk?
more so just do the path export earlier before the player spawns in
so they spread out the cost more
I think the best you could do is just load in assets before they need to be referenced
yeah probably
I know thats what we do
and yeah the forced "we need this loaded RIGHT NOW" is a far greater problem than bandwidth of sending the class path
Like, we preload all Weapons, so they dont need to be fetched during flight
that's a good idea
that way a new one doesn't appear by surprise and force a hard load
Its much easier to do that now, since RAM is pretty inexpensive.
Unfortunately I am working on a PS4 game lol
Yeah, well what prompted us to do it was that we came across an issue where some of our Weapons would not load on Clients when they were replicated by SImualted Proxies.
We found that they were just never being loaded by the Class getting repped
So we just preloaded them all
Which has other benefits.
Iris does have a weird extra mode where you can actually still async load referenced packages, they just defer the entire packet payload (fairly complicated but it's just storing the data for later)
but even in that case you can still have mistakes happen
some things just force a hard load
Id be curious to know if our issue with Client loads is fixed in UE5
GAS gameplay cues are a big source of "oh god spawn this right now"
for example
depending on how they are set up
Yeah I hate that about GCs
yeah I'm not sure how it works exactly here... I kinda assumed it would force a reference
I never managed to get ot the bottom of why it was happening, so cant say if it was a bug or just an order of operations issue on our end or something...
yeah tbh I can't blame you for just pre loading them
even if it's a bit of a bodge it fixes multiple issues
I heard the current series of consoles still has limits due to their shared RAM setup. So one still has to be cautious about loading too much when wanting to release on consoles
Yeah I made a big generalization there, completely ignoring consoles.
Understandable
I just always get reminded of trying to add a second nav mesh for The Ascent only to face the harsh truth of 300-600MB RAM being lost xD
The previous Xbox generation wasn't happy about that idea.
Anyone have any tips for me to get smoother movement in UE5.6 multiplayer? I'm finding that clients are stuttering around when their frame rate is higher than the server tick rate (which I've set to 60).
I've tried to increase NetworkMaxSmoothUpdateDistance & NetworkNoSmoothUpdateDistance to 200 and 300, but it's not really helping.
Capping the players frame rate to 60 entirely fixes the issue but I'd prefer if the player could have whatever frame rate their PC lets them run at
Custom movement code or just the unchanged CMC?
And is it the movement that stuttering or the animation?
hey does anyone know of any resources teaching how to make stuff your pawn can enter and control like cars, tanks, jets, and mounted machine guns? Bonus points if it uses gas!
im sure i could figure out something on my own, but i want to know what the best practices are for things like these beforehand!
Custom movement where I orbit around an actor, no animation plays, just that the set actor location and rotation is super stuttering on higher frame rates
void UPlayerAimComponent::ApplyOrbitAtAngle_Common(APawn* P, const FVector& PivotLoc, float AngleDeg, ETeleportType TeleportType)
{
if (!P) return;
const float Rad = FMath::DegreesToRadians(AngleDeg);
const FVector2D Offset2D(OrbitRadius * FMath::Cos(Rad), OrbitRadius * FMath::Sin(Rad));
FVector NewLoc(PivotLoc.X + Offset2D.X, PivotLoc.Y + Offset2D.Y, P->GetActorLocation().Z);
NewLoc.Z = FindGroundZForPawnAtXY(NewLoc, PivotLoc.Z);
const float YawToPivot = (PivotLoc - NewLoc).ToOrientationRotator().Yaw;
const float FinalYaw = YawToPivot + MeshYawCorrection;
P->SetActorLocationAndRotation(NewLoc, FRotator(0.f, FinalYaw, 0.f),
/*bSweep=*/false, nullptr, TeleportType);
if (ACharacter* Char = Cast<ACharacter>(P))
{
if (UCharacterMovementComponent* Move = Char->GetCharacterMovement())
{
Move->bOrientRotationToMovement = false;
Move->bUseControllerDesiredRotation = false;
}
Char->bUseControllerRotationYaw = true;
Char->bUseControllerRotationPitch = false;
Char->bUseControllerRotationRoll = false;
}
if (AGolfPlayerControllerBase* PC = GetOwnerPC())
{
PC->SetControlRotation(FRotator(0.f, FinalYaw, 0.f));
}
}
Are you doing anything in your CMC itself with SavedMoves?
Nah, I just call this function through these local and server functions, was hoping the local would fix how it looked on the client
void UPlayerAimComponent::ApplyOrbitAtAngle_Local(float AngleDeg)
{
if (!OrbitPivot) return;
if (APawn* P = GetOwnerPawn())
{
ApplyOrbitAtAngle_Common(P, OrbitPivot->GetActorLocation(), AngleDeg, ETeleportType::None);
}
}
void UPlayerAimComponent::ApplyOrbitAtAngle_Server(float AngleDeg)
{
if (!OrbitPivot) return;
if (APawn* P = GetOwnerPawn())
{
ApplyOrbitAtAngle_Common(P, OrbitPivot->GetActorLocation(), AngleDeg, ETeleportType::None);
}
if (AActor* Owner = GetOwner())
{
Owner->ForceNetUpdate();
}
}
Right, well, the 60FPS limit is usually combined moves, but if you aren't doing anything in the CMC, then that's not it.
The code you shared seems to be modifying the Transform of the Character, which is not really allowed outside of the CMC:
You are affecting the movement simulation with that and that causes corrections.
If this is all ControlRotation based, then you should only call this locally and only change the ControlRotation. Then set the Character to follow the ControlRotation. The rest should work automatically. There is no need to manually update the Character Transform or to RPC this.
Ok thanks, so I guess my per frame transforms are completely bugging out when the frame rates too high. I'll try change it now
Thank you, i can already see it's much smoother using the player controller than just applying transform outside
I've just realised, it isn't just control rotation based, the character has to physically move around the ball as well, so maybe this isn't an approach i can continue with? But i do see that simply having the control rotation done through player controller is very smooth on the server
If you need to move the Character predictively and it's not possible through setting MovementInput and ControlRotation, you'll need a custom CMC most likely.
I could use some help with replication. Cause different things are occuring on the host side than the client side. If anyone have some time to spare i would appretiate it a ton. Working on a school assignment.
Hello, how would you guys go about attaching a character to another character in a way that the two characters wouldn't move too far away from each other (a few meters), and also let character A to move character B closer when character A gets too far, but not viceversa? E.g. constrain the two characters together, and let one of them drag the other one if they walk too far away?
i would maybe use the attach actor to actor possibly
That way one character won't be able to move at all. I need the two character be able to move, but not too far away from each other as they're bound together
I'm talking about something like Chained Together, but with one character completely dominating the movement when the chain is stretched the most
what about some sort of tether like an invisible cable component?
I don't think that cable component affects the CMC movement in any way?
maybe not
I could always use normal physics constraint actor, but I don't think that it's deterministic, so it will cause desync between simulations. I'm not sure, so that's why I'm asking for opinions
maybe you could add a hitbox to the characterA with collisions setup just for charB
..
looking for some networking wisdom: if i put my maps in a struct will i be able to replicate them properly?
No, use array with structs for that
Could you elaborate?
like a giant invisible box with collisions for your characters
its not array oriented data
Hello everyone. I'm facing a weird issue with SetActorRotation in my multiplayer tests. I have a listen server and a connected client in a PIE session. If I call setActorRotation for the player in the listen server, it works as expected and both the server and the connected client see the correct rotation. But if that is called for the player in the connected client, the rotation looks correct in the client, but not in the server. I do see a rotation change in the server but it's completely wrong. I added a log right after the call to SetActorRotation, and in the log the rotation has the right value in both client and server, which is even weirder. Does anyone know what can cause that?
How would I go about playing a sound on an actor component that's attached to a character, only for the client that owns the character. Without having to go inside the character to call an owning client event
Im running into the component being owned by the server, regardless of what its attached to
Actually, nevermind. My issue does not seem related to SetActorRotation, but with an animation that plays right after it. It's still a bit weird since this animation plays only in the upper body and has absolutely no rotation at all, but at least that gives me something to investigate.
Very difficult
Not difficult in concept, difficult to do that in the framework of the CMC and make it play nice with all the prediction and correction going on
What are we supposed to be seeing here
I’m not sure if this is multiplayer or online subsystem but I’ve heard the project cannot be online multiplayer if the projects is blueprints any validity
2nd "but I've heard" today. of course you can do multiplayer games in BP-only projects. not like I'd recommend it, and it's impossible to do any custom predicated behaviour with the CMC
Nvm, it's fixed
You can do a multiplayer game in BP only but it'll be a tough go, depending on the game
BP only Advance Wars, sure
BP only Battlefield, not happeneing
Yeah no nothing complicated more like that company game standard wise
You know the company where players are searching facilities trying to make it out I never played it but watching it happen seems pretty cool’s but I want people to be able to play with friends and such so I think that’s a good starts
Sorry lethal company
can you use an FInstancedStruct for some polymorphic rpc pipeline ? or do you always need to explicitly have the struct as an arg
You can use a base struct that all your rpc structs extend from?
really ? i can just inherit a ustruct and theres no issues ? and just pass the base type ?
i just assumed it wouldn't be that easy
I think you can, yes.
Or if you want to go a bit more ham, serialise it all to a TArray<uint8> 😛
We do that with a uint8 as a type id. Cos we just like doing that kind of thing.
hmm, must be a way to do that while also using the UE NetSerialize functions u put on the struct
i am working on multiplayer game that connects player through steam and when i host the game and other player can also join the game but when i leave the game in between and host again clients can find my session but not able to join it ? I don't know why it is happening but when client restart its game it can join the game
Using epic online or steam sessions online
steam
I want to get a system like that started 😩
what
So other players can join a session or create their own
any player can join or host sesssion
but the player who host the session quit the game in between and create another session then player can't join the session but they find the hosted session
Does Iris have a way of preventing a player from receiving actors at all?
I.e. I want the player to pretty much have everything irrelevant to it (except its player controller/player state, and maybe game state)
I'm doing some tomfoolery to make the engine think runtime spawned actors are statically loaded from the map (they're not) so I need to ensure the server doesn't try to send data about those actors to the player until they have the full map "generated"
I'm ensuring the names are stable for replication manually, so I just need to make it so the player doesn't get any data until they're ready
yes, filters
and net groups
as for this I am curious if you can defer them in another way
Yeah I knew about filters but it felt like the same thing as overriding IsNetRelevantFor() in all actor base classes and returning false for the player
i.e. janky, even though what i'm doing is really hacky, I feel like there's a better way
I vaguely recall the replication internals having some kind of way of deferring dependant packets but it's more for asset loading
Is the risk that these get sent too early and stuff falls through the map?
Why can't you just receive them and then suspend simulation/visuals until they are ready?
The engine yells that it can't find a statically referenced actor on the map
I'm tricking the engine into thinking dynamically spawned actors on the server & client are static/map-loaded
"I'm doing some tomfoolery to make the engine think runtime spawned actors are statically loaded from the map" - why? Is this to make them a stable name for speed reasons? to have them spawned locally?
I don't want them destroyed when irrelevant
I only want replication to stop, just like map loaded actors
hmmm... you can override actors being destroyed for network reasons to just not do that
you can tear off instead etc
I'm thinking there has to be a nicer way to do that that isn't outright fooling the engine... this is not exactly a weird thing to do to just filter
from some engine digging the only thing that tells the engine not to destroy them is if they're loaded from map/fully stable for networking
which you can manually mark an actor as, but the engine just whines with the whole "failed to serialize net actor" spam on client/server if it can't find an actor you're supposed to have loaded already
that's the part i'm trying to avoid
(+ well, I'd like if it the client didn't have other players/actors in the game running while they're spawning the map from the data they have anyway)
let me look around for a second
that's my research from last time
if it helps
Checked regular replication & Iris' way of doing it and they both have the same checks from what I gathered
Iris can deal with making an actor ending replication not be destroyed locally... but I don't know if you can easily make it restore that connection to the replicated object later
notable mention to the Epic engineer with the // Fixme: this should be a setting comment, yes I would've loved if this was just a setting on actors instead
I am really thinking filtering would just be easier here
So just filter out everything for players that are loading/generating the map
AFAIK it should just restore it later, it'll assume it's a map loaded actor, just like the engine already does without Iris
i.e. you can have a map loaded actor not be relevant but stay spawned, you just won't get networking updates for it until it becomes relevant again
95% sure at least
I'm just worried that making it think it's a stable named object will break other things
I feel like there has to be another way to do this...
If it's not a stably named object it'll also try spawning the actor on the client, which is what I don't want to do
I want to network the map data to the client manually, and then have it spawn the map actors with the correct "stable" names the server would have
That way I can also cache the map to a file on the client if it's not gonna change
and just read from it the next time the client connects
TearOff in Iris would kinda work but I don't see/think you can "re-attach" after that
like in regular replication, afaik you can't undo that action
I think if you got REALLY cheesy it might be possible to fool the bridge into using an existing object
to resolve the incoming network id
I'd still have to ensure the bridge didn't try to resolve before the client finished spawning the map
right?
seems like group filtering might be the way to go
The online documentation seems outdated, Iris source itself is... confusing
yeah I would really recommend just net groups and filtering because I think that would definitely work even if it's a bit annoying to have this ack step to wait on it
Some old info I had about those seems to be wrong now?
Does the map only get generated once per level?
Iris has changed a fair bit. Your best best is to use the actual existing network filters for guidance
yeah, the server generates the map/loads it from a file after opening an empty level, players wait for it to do so, then once it has, it sends the data to the players, who then need to spawn it locally
I'm wondering if I can make a filter group that only allows connections that have finished creating the level to receive the actor
And then I just pop that on most actors outside of the game state/player controller etc, anything I didn't lie about or need during that step
What I'm confused about is inclusion/exclusion groups. If I have an inclusion group, is the actor only relevant to connections inside this group?
Is exclusion just the inverse, where the actor is relevant to all connections except those in the group?
Past documentation made it seem an inclusion group only worked to negate a dynamic filter's exclusion
for example
[/Script/IrisCore.NetObjectFilterDefinitions]
+NetObjectFilterDefinitions=(FilterName=Spatial, ClassName=/Script/IrisCore.NetObjectGridWorldLocFilter, ConfigClassName=/Script/IrisCore.NetObjectGridFilterConfig)
also always double check iris docs for ini things... the only real reference is the actual live code/config
they have changed some of these ini config naming schemes in the past
I wanted to avoid a dynamic filter since you can only have one and using it for this seems like a waste 
unless you can have multiple now
Ooh it's one a at a time? argh
I mean
you can just have it do double duty if it must do something else
well apparently one object can only have one dynamic filter
yeah
docs also say "don't use dynamic filters unless absolutely necessary since they're way more expensive than group filtering"
which makes sense since groups are just glorified bitmasks at the end
I think maybe a group for
Unloaded players
Loaded players
and these special actors that need to wait should only be in loaded players
then move connections that say they are done loading to Loaded players
is my guess
assuming connections can change group membership
If an object has just one inclusion group, does the engine default to exclusion for any connection not in that group?
yeah seems like they can
yeah I wish I remembered more but I am mostly familiar with the raw packet reading on the client part here more so than filtering
Hopefully we get more documentation soon since Iris is now Beta in 5.7
Surprised that's not on the roadmap
Also doesn't help that Iris looks like it's written by a mad scientist
I understand it's squeezing performance everywhere it can but it gives me whiplash every time I try to follow along
It's funny because it's easy to understand what they're doing, but trying to follow along is hard
and then you have stuff like this
Well AFAIK the for(;DeletedObjects;) would be equal to a while(DeletedObjects != 0)
I guess it would be hard to follow along when they do silly choices like that lol
Not sure what the implications are of using one over the other.
From what I see in code comments, inclusion groups only override dynamic filters?
* Inclusion groups are used to allow overriding the effect of dynamic filtering which can be useful to always allow replication of team specific objects for example.
* Add a group to the filtering system. This group is used only for filtering out objects. Exclusion groups are processed before dynamic filters, those implemented by UNetObjectFilter.
* By default an exclusion group disallows replication for all objects in it. Use SetGroupFilterStatus to change the behavior.
this is for exclusion groups
so like, using SetGroupFilterStatus(), I can "invert" what they do?
this is so confusing
Iris code is pretty tough to follow because it tends to prefer doing things with raw integer ids and c arrays
the internals are about as tryhard as you can get
they pretty much use 0 unreal containers
yeah
Pedal to the metal
which sometimes makes sense but sometimes I question if they just didn't know about an existing unreal type...
I'm all for it, just wish the docs were a little less confusing
which in fairness it's not like I could rattle off every bitset template lol
* By default an exclusion group disallows replication for all objects in it. Use SetGroupFilterStatus to change the behavior.
like what does that do? if I change the filter status, what's the new behaviour?
Epic please my sanity
from what I see in code, if I change the filter status to Allow it just ignores the filter?
super useful /s
like yeah sure maybe if I wanna disable a filter temporarily but rip
Wish I could just poke someone who works on Iris heh
Not sure how to word this question.
But, is there anyway to disable whatever C++ auto fixes replicated actor refs?
Actor 1, with a ref to actor 2.
If you are near 1, but no 2, the var is invalid.
But, when you get near 2, it suddenly becomes valid, without any extra var replication from my understanding?
Or, is this some like innate "feature" of how object references work deep in C++?
The engine updates mapped references when they can be resolved on a client
What exactly are you trying to do?
I'm not exactly sure what I'm doing yet.
Its for future experiments/ doing shit.
Just specific vars, not every var, since I know that'd break a ton of stuff.
I don't think you can disable that behaviour without some engine modifications
Unless there's a macro definition/cvar you can use for that, but none come to mind
After taking a break for dinner, I think I found out that it can be done simpler.
You can have one exclusion group, let's say PlayerLoadStatus, which excludes all connections by default.
Then, when a player has the map fully loaded, you can do ReplicationSystem->SetGroupFilterStatus(GroupHandle, PlayerConnectionId, UE::Net::ENetFilterStatus::Allow);
So yeah I was just being dumb
Just need to find out if inclusion groups override that
As long as they don't, then whatever
Does Iris consider all objects as always relevant by default?
I figured out that without a source build, you can still run the custom config in Shipping using the same -customconfig=Steam trick that you use with the editor.
I've been trying to find a way to make it work without the CLI arguments OR a source build though...
Seems like if you're building for multiple Targets, Epic just expects you to be building from source at that point.
Hell yeah.
They do it for performance.
I do it because I learned a bit of C in 1997 and it stuck.
We are not the same.
"How did you make it fast?"
"We decided to not use any of Unreal"
TI was right!!!
generic container good enough for most uses but certain applications benefit from a custom made container
SHOCKER
wee little bump
Search for siliex talking to Cedric about Iris. siliex talks about stuff like this I believe. It was a thread when Cedric was trying to figure out relevancy.
found it yeah
kinda helps, kinda doesn't? still confused somehow heh
i'll try it out
Hello, I imagine this is a fairly common problem, but I'm still a beginner and have been trying to replicate my physics on an authoritative server for several days now. I'm using the Smooth Sync plugin, which works relatively well for all my mechanics, but when my clients' first-person characters try to push my physical objects, they experience constant rollbacks. When the plugin is disabled, my clients can push the objects without any problems, but their movements are jittery. I've tried changing the plugin settings, but it doesn't make much difference. Has anyone else encountered this problem? (i don't know if i should ask this in physics or multiplayer channel)
<@&213101288538374145>
Have you tried only allowing the servers proxy to move it?
Yes that's the case in the video i sent
Vid shows your overlap moving it locally, then the server correcting, then the server overlap moving it.
If i turn off the collisions locally, my client character will move trough the physics cube due to smooth sync interpolating it
don't disable collision, still needs to block all pawns.
Set your servers tick rate
Okay done, so to allow only the server proxy to move my physics objects what am i supposed to do ?
Test it with the new server tick
might not need to adjust anything else
because on your screen the box is in the way until the server moves it
What's the box's replication setup, just replicate movement and that's it?
No the Smooth Sync plugin overides the Replicate movement
The smooth sync parameters
If i disable the Smooth Sync plugin and activate native movement replication, i don't have rollbacks anymore but the movement of my physics props avec very jittery
Smooth sync interpolate and extrapolate my physics objects to have a smooth movement over the network, im guessing i have server corrections because my character is overlapping the physics props server side, but i don't know how to fix this, sorry if i'm being slow, i am new to physics replication and i am having trouble finding documentation
You can tune physics replication to be less strict
Do you understand the problem though? On your computer, your character is in the future relative to the server's view of the world, but server authoritative movement of the box is in the past.
Yes i understand that, but the thing is whenever there is even a small amount of interpolation, my client will have rollbacks. Should i do a client side prediction ?
I would suggest you first have a loose enough sync on the box that the client can locally push it away from where the server is saying it is
doesn't have to be much
right now on the client your character is running into a box it can't move because it's position is constantly being set from the server.
On the server the character is pushing the box just fine
but on the client, the character is predictively moving and running into the lagging box
Say your ping is 1 time unit
at T = 3, you are moving your character. At that moment, the server sees you at T = 2, and you see the box at T = 1
you are bumping into the box
networking is hard as shit, especially when you mix prediction with non-predicted stuff
Okey i tried to loose the sync on the box but i still had rollbacks, it seems that the plugin is working differently from the network physics settings of unreal,for i don't fully grasp the working of all this networking stuff i might turn off the plugin for now and just use the native tools, it looks like it works better for character collisions. Thank you for your patience. If you have by any chance any good docs to learn games networking i'll gladly take it !
When testing multiplayer in PIE, is there any way to force a delay between when the server is started and when the client is started and connects?
Not for the first client I believe. But you can manually late join the second
It's a setting you can enable that then adds a button next to the start stop buttons for adding another client
For testing I really like just making a couple bat files to launch server and client
it's a nice middle ground between PIE and shipping
That would probably do what I need. Do you know where I can find that setting?
Project Settings or Editor Preferences
Late Join or something like that
Just search for it
A few cmc questions, recommended way(s) to handle cmc ground friction changes? Saw that i could add surface types to a project wide array somewhere as well i think? Lastly is there a combined friction calc type setting or type?
i'm using this code for FABRIK, TP mesh. should i do the same but with IsLocallyControlled() for FP mesh??
if (bWeaponEquipped && EquippedWeapon && EquippedWeapon->GetWeaponMesh() && SoldierCharacter->GetMesh())
{
LeftHandTransform = EquippedWeapon->GetWeaponMesh()->GetSocketTransform(FName("LeftHandSocket"), ERelativeTransformSpace::RTS_World);
FVector OutPosition;
FRotator OutRotation;
SoldierCharacter->GetMesh()->TransformToBoneSpace(FName("hand_r"), LeftHandTransform.GetLocation(), FRotator::ZeroRotator, OutPosition, OutRotation);
LeftHandTransform.SetLocation(OutPosition);
LeftHandTransform.SetRotation(FQuat(OutRotation));
}
