#multiplayer
1 messages ยท Page 280 of 1
basically this "missing" would get you stuck attacking
which might not be a big deal in practice
what do you mean? Ive been using this setup for all my montages so im hoping its not completely wrong ๐
it's not "wrong" at all, it's just that if this doesn't reach you you miss it
if it's unreliable
ok i get it. would setting it to reliable not fix that?
property replication is also "unreliable" in practice as you can miss things here and there but it will be entually correct
yeah using reliable would fix it but it might be pricy to make it reliable if this happens a lot
also late-joiners would miss it but that probably doesn't matter for something so short lived
montages wouldnt be getting executed every frame, maybe every 20 frames for short ones. there could be a few montages at a time for several players + enemies though
i dont know how bad that is
it's probably not so bad at that scale
whats the other option?
using an onrep that describes the montage state
with maybe even an increnting number for uniqueness
if you find reliables work here you can absolutely stick with it and just measure bandwidth to see if it gets bad
sending the name will be kinda brutal on default replication though either way
I would recommend turning that into an integer of the sections
no need for an entire string here
as they both have the same montage asset
sending the montage asset the first time will send it as a string but it will be resolved to a smaller id for future sending (so it's perfectly fine here)
I think worst case even with it unreliable, most montages are not looping, and the looping ones will be overridden the next time a montage is played so its not that bad
if it gets stuck looping you could arguably add a simple timer that goes "wait, you should not be doing this at all right now"
as a timeout so to speak
if it's not reasonable to be attacking for 4 seconds straight without a new rpc
yeah in cases like that for sure
I will make a note of onreps though for when I refactor all this stuff, thanks
The best example of "fully featured" montage replication is probably the GAS component
(you don't need to use all of GAS to use that part, it's just an onrep that ticks on the server to see what's new about the montage while a montage is playing)
but you don't need to go that far
you kinda already figured out how to send a section etc
would you suggest using GAS? i didn't want to jump into that because I dont know much about whats going on in general and it seemed daunting. I'm not doing any PVP stuff or worried about cheating, probably going to have client authority over movement to be safe too if thats relevant
GAS is more useful if you need a an ability client-prediction setup
or are already familiar with it
but you probably do not need it for this... I think you might find some of it useful but it is very complicated in both good and bad ways
it has a lot of awesome ideas that would be useful outside of it but also a lot of complexity and requires C++ to really use (might be some plugin that exposes it but... eh)
you are on the right track just using client auth movement for a co-op game
you dodge an insane amount of complexity by doing that
(yeah people could speedhack but... I personally would not care lol)
ah shit swtching from the debug key input didnt actually fix it, i just forgot i turned use controller rotation yaw on in defaults
Are you running on a listen server or dedicated setup?
simple thing might be to just draw the current state of that bool in-world
to see wtf it's doing over time
listen server
no plans for dedicated servers
well this works its just not what I read online
do you have "p.NetEnableListenServerSmoothing on?
I would suggest not using a separate rpc
include that inside of the montage rpc
or inside of the montage as an anim state
2 rpcs = one could show up and one could show up N frames later
you are introducing more randomness this way
adding a boolean value to an rpc costs... 1 bit of network bandwidth
it's almost free
I reuse the montage rpc for every montage though, and I'm only using this controller yaw bool for this one function
then make a new rpc that does the montage with an extra bool param?
trying to avoid making a new rpc or changing an existing one is not worth introducing more complexity in network timing (by having this be 2 separate ones)
thanks fot the tip
i have rebuilt the map then rebuilt the server and client but when the client joins they are getting booted
you could override APawn::FaceRotation to do exactly what you want but idk if BP has an equivalent (could just bonk the rotation on tick arguably)
might be relevant... not sure
well it seems to work for now, going to have to rework everything eventually when I know more
thanks for talking me through all that
sorry i dont quiet follow the log
this is a forum post that tells you what to do
You can revert to the old behavior with the -pieviaconsole command line flag when running the uncooked server (e.g. UnrealEditor.exe YourProject.uproject -server -pieviaconsole โฆ). Though this may introduce issues (that Iโm not aware of) that the commit was fixing.
(not sure if it will work or not, just all I could find)
Yeah thats cool ill test it out cant hurt this is in package build tho
void ACbPlayerController::BeginPlay()
{
Super::BeginPlay();
AHUD *hud=GetHUD();
}
my gethud is returning null value always in player controller but my playerhud has already added widget in the viewport does anybody know about this issue as this problem is only there on client
clients receive their hud class from an rpc
ClientSetHUD_Implementation
i think client create their own hud and server will no have any hud refernce so there is no usage of rpc
feel free to put a breakpoint on beginplay of your hud
there is no need to guess
i have another project where i am getting hud and they are working
currently i am facing this issue in this new project
yes in begin play the hud is null but how it is working in my other project
I am trying to help you solve the problem... I do not need to know about your other projects
if you figure out what creates the hud you can figure out when you can run your code here in beginplay there instead
yes i just want to know the concept how hud is not valid on client as it should be the part of client as server do no have any usage of hud
I already told you how to figure that out
at no point did I tell you the server has a HUD on it for that player
I am telling you that the server sends an RPC that tells which HUD class to use to the player controller
you do not need to DM me, you can just read the messages I sent earlier
a default AHud is created in post init components but the "real" intended one is from a server->client RPC
which on a listen server just runs on itself
you could change this to always use the same HUD class spawned in the same place locally each time and just ignore the rpc way too if you wanted to
the intention here I assume was that servers can set a new hud class
how can i do this
spawn your own hud actor using your class in the same way they do
and then override AGameModeBase::InitializeHUDForPlayer_Implementation or just override APlayerController::ClientSetHUD_Implementation to do nothing
I don't really know if this is better than just using the default way or not but I see no reason this would have obvious issues
big downside being if you plan to have differnet huds based on conditions
just want to know that my hud is adding widget to viewport on client and still player controller gethud() value is null how? there must be a refernce of it on client
?
the rpc way makes it so the server can choose which hud class is spawned (which is kinda neat but... I think most games just use the same HUD class every time lol)
I told you twice now to just debug what spawns the hud on the client by adding a breakpoint in beginplay
I already told you what did it, you told me you don't think it's true and I told you you can prove it with a breakpoint
I'm struggling to communicate with you here man lol
sorry if my earlier messages were not clear
i am just confused because i am wondering how my previous things are working
replication order is kinda arbitrary
so I have no idea
a packet with an rpc or replication can show up whenever it wants
it just... tends to be close
it could be the older projects had the new object + the rpc for it show up and be read in the same frame due to the connection having less in the bunch but I have no clue how the initial bunch works with rpcs and player controllers as they are kinda the handle to the connection
or maybe the older project just spawned the hud manually? I can't see what your old project is doing or if the way this works has changed (I'm reading 5.7)
feel free to open the old project and... add a breakpoint like I mentioned earlier
i have developed whole game and never used these functions for setting hud as things are working correctly in the game and i am wondering why these things are currently not
if it's based on an rpc there is NO gaurantee EVER it will run before beginplay
as far as I know
it is a reliable RPC but that doesn't really gaurantee the timing, just the order relative to other reliables
but it's possible something changed between versions I am not aware of
did your old game not have a custom HUD class?
i have and my widgets are added through it
I still have no clue, why it won't work
Sure you're looking at the Server? Usually red for me.
Actually, I have no idea. But the selected piece is contained in a section which has "server" in it.
I started as client, so there has to be a server running.
CVD will have two tracks at the bottom, one is server the other client. Just uncheck the visibility of the client(s)
The Engine is kidding me...
Now it works on dedicated server.
But I did not change a single thing.
I just shut down my pc over night and started the engine again from rider...
Even the animation is not root motion anymore and it works...
I hate magic
Im trying to get the player controller on a client so i can do a "set view target with blend" to set the camera location at the beginning of the game for character select, whats the best way? im using BP
Whats the best way depends on where you want to access it from.
If you are trying this from the Pawn, you can access its Controller directly.
The same can be said for the PlayerState.
ye, i just noticed that i was actually able to get it, it was something else causing issues
Keep in mind that PlayerControllers only exist on the owning client for that client.
(and on the Server obviously)
I cant get the thing to work on the client so im gonna ask for help, here the issue, i set the view target to a custom camera in the map and it works fine but half a second later it switches to the pawn camera, i am assuming some event is switching the camera target back, does any 1 have any idea?
im calling the logic inside a pawn right after the character select widget is created so it has to be something that takes a while to be called i belive
You may need to look at a few properties on the PlayerCameraManager
They control if the Server overrides the Camera position
Ive forgotten their name off the top of my head
so you think that the server is overriding the camera target, is this like an event or do you happen to know if this happens after a certain event? cause if i put a delay on the thing it works so its not overriding the position all the time
I have no idea man, it all depends on exactly what it is you are doing. You have barely paraphrased what you are doing so I couldnt even properly speculate.
let me show you
behind that tick is just the creation of a widget
im not doing anything complicated
i tried those 3 events and they all have the same result
the server spawns a "character select pawn" which is the deafault pawn of the gamemode, that paawn than creates a widget which you can click to select your character, the character selection is not relevant to the problem since im just trying to have the camera in fixed place when the default "character select pawn" is spawned
it works fine on the server
and with a delay
ok so i found a solution, i used the event "OnBecomeViewTarget" i have no idea where this is being called in code but it is clearly being called way after possesed or even tick, if some one knows the chain of calls that leads to this specific let me know cause it sounds usefull for the future.
I can't play InteractionSound if SimulatePickupVisuals(); is a reliable Client RPC, but it works if I change it to NetMulticast.
- What can cause it?
void APickup::Interact_srv(class ASurvivalCharacter* Taker)
{
if (IsPendingKillPending() || !CanInteract(Taker)){
UE_LOG(LogTemp, Warning, TEXT("Interact_srv::404"));
return;
}
const FItemAddResult AddResult = Taker->GetInventoryManager()->TryAddItem(Item);
if (AddResult.ActualAmountGiven < Item->GetQuantity())
{
Item->SetQuantity(Item->GetQuantity() - AddResult.ActualAmountGiven);
}
else
{
if (PickupCollisionSphere)
PickupCollisionSphere->DestroyComponent();
if (InteractionComp)
InteractionComp->SetActive(false);
SimulatePickupVisuals();
SetActorHiddenInGame(true);
SetLifeSpan(1.5);
}
}
void APickup::SimulatePickupVisuals_Implementation()
{
if (InteractionSound)
{
UGameplayStatics::PlaySoundAtLocation(this, InteractionSound, GetActorLocation());
}
}
who calls it? who owns who calls it? when is it called?
Character
and passing self
character calls Interact_srv using a server rpc
it being a server rpc describes what kind of rpc it is, not who calls it
leaving out context here is not helpful
the kind of rpc changes what it does based on the ownership of who calls it
server reliable rpc in character class doing a line trace and calling Interact_srv from a detected pickup item passing self
did you describe this being from client or server earlier or what
the KIND of rpc it is and which side calls are are two distinct pieces of information I refuse to assume
I would assume you want to call a server rpc from a client that owns the character
but I cannot see that
so so the client picks it up, sends the server and RPC saying it did
and the server emits an rpc saying to play the pickup sound to everyone else (other clients etc)
interaction is server authoritative, when server interact and item is added to inventory successfully, I want to play interaction sound on the owning client using
UFUNCTION(Client, Reliable)
void SimulatePickupVisuals();
if I change it to netmulticast, it works
but I wan to use a clean cilent rpc to just play sound for the owning client
well
since the player does not own the pickup
I do not see how it would be a valid client rpc
hmm, so this is the reason for netmulticast working?
you can see the chart here shows what happens in each case
which client would it send this to if nobody owns it?
so multicast sends it to everyone including whoever happened to pick it up
so I have to pass it back to the taker to exec a client rpc on character?
it could just be a component on the playerstate or player controller, pawn whatever
you don't need to have all of your client/server back and forth rpcs in one place
you can see epic kinda slamming it all in one place in the playercontroller header though lol
there's even a dedicated ClientPlaySound rpc in there (no reason to not make your own though... I would prefer to control this myself)
will also send it to the taker controller passing the sound
arguably all they need to know about is the item asset type or instance and the item could just tell it what sound is interesting to play (if any)
it would make more sense to me for this to be an event from the inventory item being added
than a distinct rpc
but since this probably doesn't happen often and if this is easier to get going its probably fine
it seems a bit questionable to make just a visual/auditory effect reliable in some ways too but if you think it's bad to miss you don't want to miss it
so up to you
I have like +200 types of items, each got unique sound
each pickup will load its single sound from assets and play
there isn't much difference between sending a sound asset and an item asset (class path I assume?) but ideally the one with less unique values will result in less full paths sending?
yeah sound path
If the pickup knows what the sound is why can't it just be local anyways
So the RPC says "play your sound" and the item instance actor knows which one to play (or loads it etc)
there hundred of copies in the level of the pickup placed of each type
I use FString Path insted of USoundBase* in each pickup
If you want to talk about doing stuff for perf reasons my first thought would be to not use actors I guess lol
why...
that sounds like a soft class/asset path with extra steps
do I have any other choice for world pickups?
and I have custom actors which are super lite and without all those stuff that pickup don't needs
if it works it works
but in my mind you could make this much faster with a buffer of lightweight ism instances per cell that have a fast array like some simple network manager
but it would be not ideal if these move a lot or have unique replication data per class... also this will take a while to make vs just a simple actor
so don't bother with that unless you are seeing spikes from there being a ton of actors to make
I would say at the very least I would hope they aren't all spawning in in 1 frame (you may need to in some cases but I think it's probably possible to slice a lot)
hmm, yeah
loot manager is spawning them in different frames
also more network objects = more potential polling if network dirtiness is not handled well with pushmodel stuff
each spawn has a random delay from 3 to 6 sec
that sounds good, you should be chilling then perf wise
random is a bit silly when it could just do N per frame from a buffer but if it works it works
yeah so far I don't see any issues with it
game can reach +1k FPS if not limited to some amount ๐
and at 40fps it runs smoothly like butter
client and server perf are distinct issues
yeah, it was an issue in an intense fight when my 50 friends starts shooting at each other, bullets spawning was very performant
I changed it to bullet pools
now its fine
now when a client equips a weapon, 5reserved projectiles are spawned in the weapon and they re used if the mag has ammo
proper loading screen
should run in its own thread to avoid freeze
this works perfectly
APlayerControllerBase* PC = Cast<APlayerControllerBase>(Taker->GetController());
if (!PC) {
return;
}
if (!AddResult.ErrorText.IsEmpty())
{
PC->ClientShowNotification(AddResult.ErrorText);
}
else
{
PC->ClientPlaySound(InteractionSound);
}
also implemented error message logging on client screen showing reason why can't they pickup this item
i just noticed replicated movement uses replicated variables/onrep... wouldn't the reliable nature of replicated variables introduce uneeded overhead? especially with something changing as often as position? or is it not enough to matter
Replicated variables are eventually reliable. They are not ACKed (not in the same way reliable RPCs are anyway), and there is no guarantee about receiving every update sent.
ohhhh ok, yeah that makes sense
Hello friends im making a trebuchet and i want an ammo type to be a multishot ammo which shoots like 4 projectiles instead of the standard 1.
Im wondering if its better in this case to have each projectile be its own actor OR have 1 actor and each projectile will be a component with its own physics. So in this case 4 projectiles means 1 actor with 4 sphere components or something.
Would appreciate a recommendation!!! Thanks!!
I'd keep it easy for yourself and spawn 4 actors, unless there's any particular reason to avoid that in your case.
sanity check: if actor is dormant in network profiler waste should be 0? Because I am setting dormancy for an actor and waste is still 99% ๐
(using push model btw)
When I set only relevant to owner the "Update HZ" is equal which is set in Actor Frequency, but when when only relevant to owner is off, update hz is nearly 0
with SetNetDormancy(DORM_DormantAll);
Did you end up going with physical bullets using collision or a custom ballistic trajectory simulator?
I believe so
but "waste" might not mean what you think for an object doing nothing
yeah I mean Update HZ
that was what I wanted to ask for
not Waste
and it seems that when Only Relevant to owner ignores the dormancy ๐ค
I have a problem, that UAnimNotifyState::NotifyEnd is called every frame, after UAnimNotifyState::NotifyBegin was called.
But it seems, this only happens on the server.
I start the montage through a GameplayAbility
It doesn't matter, if I don't run the montage on the client
I debugged and ActiveAnimNotifyState is empty almost every time.
I made a breakpoint condition on HasAuthority
This is just a tiny curiosity, for one of those like It saves like 0.00001% performance
But, does the server calling a server replicated event/ function.
Make it go through extra hoops, or does it know that the server is calling a server event, and turns it into a normal function call?
object pooling
https://www.youtube.com/watch?v=f797l7YTcgc
The Object PoolPattern:
Software Design Patterns are like a guide on how to write good code, whether you're using Blueprints or C++, knowing good software practices is a MUST!
This video goes over the Object Pool Pattern which is used to optimize performance and memory by reusing objects in your game.
Download the project files and support my ...
what I only changed is , when the character equipped a weapon, spawn pool for this weapon, and when unequipped, destroy the pool
Hello, Im working on a survival multiplayer project messing around with replication and I dont know much about it but the best way for me to learn is to do so
So Im working on a modular attribute system for the player how it works
call modify attribute event from anywhere (not replicated)
switch has authority
3 if authority calls the internal function
if not calls server event then calls said internal function
Is there a question here that you wanted answered?
Im confused.
If you are doing attributes, you should probably research the Gameplay Ability System plugin.
GAS already solves this for you.
Interesting, I haven't seen much on it but I'll take a peek.
Thank you!
Reading up on "flipping" a replicated variables condition between "Owner_Only" and "None"
I would like to ideally have a "inventory" struct replicate to owner only normally. And when an actor dies, it replicates to all so clients can see what items can be looted.
Is this possible in C++? Seems like people have tried but failed to make it work properly.
Something something ResetReplicatedLifetimeProperty.
In theory this is only used for changing Replication Settings in a child class.
Because you aren't allowed to call DOREPLIFETIME for the same property twice.
Although I'm half sure RESET_REPLIFETIME_CONDITION doesn't do anything special that wouldn't be possible to handle in DOREPLIFETIME, but that's a choice by Epic.
The problem you have is that it requires the OutLifetimeProps.
Thanks Cedric. Yeah that's what my digging through the engine code was pointing towards, but it didnt seem like a properly catered for use-case
Yeaaaah, I mean.... I wonder if you could just call GetLifetimeReplicatedProps by hand.
void ASomeActor::ChangeRepCondition()
{
TArray<FLifetimeProperty> OutLifetimeProps;
GetLifetimeReplicatedProps(OutLifetimeProps);
RESET_REPLIFETIME_CONDITION(ASomeActor, SomeProperty, COND_None)
}
Pretty sure there is more to it
Cause GetLifetimeReplicatedProps would just collect new ones.
Must be a way to get and update the original ones. hm.
Honestly, a better approach might as well be just keeping the Inventory as COND_None and putting it onto the PlayerController by default. And once the player died, moving it to the PlayerState/Character.
Or, have it on its own Actor that overrides IsNetRelevantFor, and have it COND_None there, and return if it's relevant for a given Connection via IsNetRelevantFor based on the owner being Dead or not.
Yeah, I think I'm going to go for a bit of a caveman approach of using two replicated variables, one with no condition and one that has a owner-only condition.
- Use the owner-only one as a "private" inventory for locally controlled client updates
- Use the no-condition one as a "Public" inventory which we use as needed, i.e. a character dies, lootable items
Then two relatively simple on rep delegates With server calls for handling local Listen servers to hook in the UI
Was trying to be a smart ass and just use one replicated struct and just toggle its replication condition
Might be worth looking at replication graph or iris? Or even just a custom replication condition
Committing for this stuff to Replication Graph when it's actively being phased out and replaced by Iris doesn't make sense.
And Iris itself won't "fix" this either. Custom replication condition could work if that was an option.
Oh I didn't know it was being phased out, haven't heard of Iris, hope it has a UI 
I'm trying to get OSS Steam setup using the 481 Spacewar test Steam ID.
When I send an invite to friends they don't join my session but it works when I'm testing myself with multiple standalones. Do I need to get an ID for it to work?
no
what your log says when friend tries join the game
I didn't even think to check. Thank you!
@pallid mesa Hi there! Have you tried to make network physics work for the case when I have a APawn (owned by client) and AActor, both with network components, and I want to apply some force to AActor from APawn? I didn't manage to make it work on client yet
I have tried to do it like that:
- APawn selects AActor to work this, sends request to the server to SetOwner(GetController()) and SetAutonomousProxy(true) to AActor;
- NetworkComponent on AActor sets SetIsRelayingLocalInputs(true);
- In tick() APawn sends FVector to AActor
- In tick() AActor uses this FVector and put it into AsyncInput
I wonder do I miss some important bits here, for now forces are applied on a client, but not on server, so the body gets corrected back to server's position
I didn't get any logs when my friend accepted my invite. I have a print string for OnPostLogin but that doesn't fire. It does move them to the lobby level i made but they aren't in my lobby.
iirc fast arrays aren't supported by the push model ?
I assume it is 5.6 and AdvancedSteamSessions?
5.7 and AdvancedSteamSessions
Are u using steam sockets? if not, you should because in +5.6 without it advanced steam sessions do not work
i'm not really sure what you mean by steam sockets. I'll look it up
I have steam sockets enabled in plugins
Google AI Overview says:
Using Advanced Sessions with Steam Sockets can be challenging due to potential conflicts, and it's often recommended to disable the Steam Sockets plugin to get the Advanced Sessions plugin working for basic Steam session functionality, especially in older versions of Unreal Engine. If you do enable Steam Sockets, you will need to manually configure your engine to use the SteamSocketsNetDriver in DefaultEngine.ini to avoid issues.
eh
Thanks I'll read this
you must change your network driver to steam sockets
and next time do not belive into AI overview shit
xD
This is in the DefaultEngine.ini:
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
bRelaunchInSteam=false ; Generally false for testing in Editor/Standalone
bInitServerOnClient=true
GameServerQueryPort=27015
bVACEnabled=0
GameVersion=1.0.0.0
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
yeah, you don't use steam sockets
change it as pointed in the docs and it should start working
I've read through the Multiplayer Network Compendium (great resource!) on cedric-neukirchen.net.
One thing I'm trying to understand how to implement, is the scoring system. It seems like I'd want to update an individuals score in their playerstate.
What's the correct way to have an object send a player reference to have points added to their score? "Get Player state"? Or, get game state and implement a function in there?
There shouldn't be any sending here
????? big chain of stuff ?????? -> on server, some authoritative stuff happened that is scored -> number go up
What's the context here, when and why does score go up?
An example maybe from my end. A piece of fruit. On collision or when player steps into it. Originally, I had the fruit get a component from the player, which had a function to accept a point increase. Then, the players total increases and the fruit removes itself from the game.
Total player score is held in the players character. Is there a way to move this so that the fruit collected somehow notifies something other than the player? I was thinking, notifies the 'server' that player X got it, and then the server does checks, and updates score as needed?
Very simple start. Rather than a component in the actor handling it, I'd want it to be handled somewhere else? Or am I overthinking it?
New total and success are just there for now until I decide how I want to handle everything.
@thorn hornet So, this isn't really a multiplayer problem, at least not mainly.
The Score should probably live in the PlayerState.
Your trouble is "How do I get the PlayerState when it's the PlayerCharacter/Pawn that overlapped?", I assume.
You usually handle the Overlap (or the Interaction for example) inside the Actor that the Player overlapped (or interacted) with.
In there you usually have a reference to the PlayerCharacter/Pawn. Overlap naturally has it due to the OtherActor pin (interaction requires you to pass it along).
To ensure that you always take the correct PlayerState, you need to stay "relative" to the Player Object you currently have. In this case the PlayerCharacter/Pawn.
On that Pawn, you can call "GetPlayerState", which returns the PlayerState of the Player that controlls that Pawn.
(if that Pawn is possessed, etc. etc.)
That PlayerState you can then cast to your own child class and call AddPoints on.
The Multiplayer part of this is relatively small. The important thing is that almost none of this should happen on the Clients, which is why I said originally that it's not really a Multiplayer problem.
Yeah, this is my first dive into multiplayer stuff. Trying to wrap my head around it all. I'm a pentester / hacker by profession, so I find myself worrying about the 'security' and authority stuff. I felt like the fruit calling the function in the component of the pawn, would be less authorative or could open the game to some form of cheating. Vs something like "telling the server". But, I was thinking maybe I hadn't fully understood the authority parts of your write-up
For the Overlap case, you have an easy life, because the Overlap is supposed to happen on Server and all relevant Clients. That happens naturally because the PlayerCharacter/Pawn literally moves into the collision on each relevant Client and the Server due to it being replicated in the first place.
Which means the BeginOverlap can simply be guarded by "SwitchHasAuthority", so all of the stuff behind it only runs on Authority, which in this case would be the Server.
After that you can grab the PlayerState, increment the Score and destroy the Pickup. The Score would be a replicated variable so everyone gets the right value replicated back to them for that player.
The Pickup would be a replicated Actor, so the Destroy call by the Server destroys it on everyone.
For the Interaction case, that I'm only taking about due to the image you've sent, you need to ensure that you call a ServerRPC in the PlayerCharacter/Pawn (or a Component on it, depends on how you set this up) that simply tells the Server that the Player wants to interact. After that, the Server can do the Line Trace, or whatever else you are doing for Interaction, and call OnInteract on the Pickup, passing the Instigator (PlayerCharacter/Pawn) along. Inside the Pickup you then do the same thing: SwitchHasAuthority (for sanity) -> GetPlayerState from Instigator Pawn -> Cast -> Increment Score -> Destroy PickupActor.
Reading / trying to digest and understand.
Very much appreciate all the information!
It's relatively important that you keep Server RPCs rare and only use them to communicate information to the Server that the Server doesn't know about already or can't figure out itself.
In cases such as Interaction, you would only send an RPC when the Interact Key is pressed/released, as all the other stuff can be figured out by the Server.
Going to tinker some and see if more questions come up.
Thank you!
just trying to do a drag and drop inventory and hotbar. to put it basicly it works in the inventory the item is from . but trying to get it to another is the problem.
I have 2 inventory components of the same class the only difference is hotbar widget.
video of demonstration. https://youtu.be/fzNi3fpbZvs
double check that you have references to the correct inventory components
does transfer item work without the drag and drop? If you just hook a debug key up to transfer an item from A to B, does that work? Does it update the UI when you do that?
make sure the underlying logic works before the UI layer is placed on top
press button to move item, press button to empty entire inventory on the ground, etc
ya, when I do a print string on it , it has the right name. it has the write everything when you look at it on a debug. so its valid and not valid at the same time. both the main inventory and hotbar use the same logic the only thing different is the "To Inventory"
should the referances to the inventories be replicated or just the inventories t hemselves
Inventories themselves can work just fine if the bit that crosses the network when you drop the dragged thing is "I want to transfer item x from inventory y to inventory z"
if inventories themselves are replicated than the server doesn't care about anything besides the drop. The drop is when you send a transaction request RPC
drag from inventory widget and drop in world -> "I want to drop item X from inventory Y"
drag from inventory widget and drop in another inventory widget -> "I want to transfer item X from inventory Y to inventory Z"
Anyone here have any insight on Mover / Chaos Mover and how one-shot events should be handled?
I have seen some examples where jumping is handled via two bools (bIsJumpPressed and bIsJumpJustPressed), and I've also seen it handled via one integer (JumpCount).
I believe this is because there used to be issues for some devs, where the replication backend might miss the temporary boolean changes.
well just set up a chest and i can drag n drop from main inventory to the chest. my mind is gonna implode lmao
in a seamless travel, is there any chance the game mode will call StartPlay before all connected player controllers have called PostSeamlessTravel
"One shot event" where in the flow?
If this is the case you could just wait for both of these to occur and continue after (checking in each one etc)
assuming you get the complete set of known connections you are waiting on that you can track safely if somebody doesn't make it etc
ah, seems this is tracked in AGameMode::NumTravellingPlayers
so I presume you could just wait on that being 0 with some timeout etc
yea like my issue is with 3 players in my game I manually overrided the ReadyToStartMatch function with a check on the NumTravelingPlayers variable to see when it's zero, but sometimes it constantly stays and never goes to zero.
But I have a timeout in my code, and when it hit the timeout it starts the game anyway, and oddly enough, suddenly all the players are there
yeah lol that's what I have
oh I'm a loser idiot
timeout was set ultra early
no need to be so hard on yourself lol
oh I'm joking dw
I think I tend to not like using a timeout but given how much is going on here that I do not understand I think a timeout seems okay
yeah same
like if a client gets stuck in between does it just boot them after not getting any packets etc
no clue
wish I knew as well
could maybe glean something if you inspected AGameMode::InactivePlayerArray?
which is the array of player states when a player disconnects
I have a problem, that UAnimNotifyState::NotifyEnd and UAnimNotifyState::NotifyBegin are called every frame, after UAnimNotifyState::NotifyBegin was called.
But it seems, this only happens on the server.
I start the montage through a GameplayAbility.
It doesn't matter, if I don't run the montage on the client
I debugged and ActiveAnimNotifyState is empty almost every time.
I made a breakpoint condition on HasAuthority
I am avoiding killing a character until the server says so, even if its health dropped below zero in the clientโs game state.
but I am getting in to an issue where if the other character used a first-aid kit just before receiving a deadly attack, but the server don't know about it yet because of latency ?
killer has 30ping
victim has 130ping
server will listen first to the 30 pinger!
could give the healing a bit of a delay or something if you're trying to predict health going up when using a med kit client side
then the client wont see their health go up and then be killed and feel cheated
currently player starts to heal, it plays an animation of using an item, when the animation ends it calls a notify on server to actually consume the health item.... the issue is client starts using the item before the server starts it, so client finish it first and server after
between this event when client finished using the item and server not, and got killed by someone they will definitely feel like cheated
if the death is delayed, the killer will feel like victim cheated ๐
this article talking about the exact issue that I have currently
https://copyrat90.github.io/2025/04/05/fast-paced-multiplayer-2.html
๋ณธ ํฌ์คํธ๋ Gabriel Gambetta์ Fast-Paced Multiplayer (Part II): Client-Side Prediction and Server Reconciliation๋ฅผ ํ๊ตญ์ด๋ก ๋ฒ์ญํ ๊ฒ์ ๋๋ค. This post is a Korean translation of the Fast-Paced Multiplayer (Part II): Client-Side Prediction and Server Reconciliation by Gabriel Gambetta.
unfortunately I think most games just accept that as an acceptable condition
you could do something similar with rollback kinda like what you do to verify gunshots
how can i freeze the CMC (ignore movement input) and restore the velocity/acceleration afterwards ?
its hard to find how exaclty the Velocity is increased over time
Hey, is there any recommended way to replicate a physics handle mechanic? My current implementation works, but the client sees a slightly laggy movement of the grabbed object. It doesnโt stutter, but itโs noticeably delayed and kind of โfloaty.โ My logic right now is that I call SetTargetLocation on the client on the tick and also call SetTargetLocation with the same location through the server on all clients. On the server the movement of the held object is perfectly smooth, but on clients itโs a bit off.
Maybe you guys have any tips for this kind of implementation.
Hey! Is it possible to use level streaming with p2p multiplayer? I am using a blueprint interface to interact with a manhole, and once done trying to teleport the player underground and load the level on the client side. I got set visibility working on either the host or the guest but not both. Any tips would be appreciated
its local so you gonna run it propery on server/client
also, what solution are using for p2p in UE ?
I am not quite sure as my partner did that part, but mainly lan and 3rd party. Now that i think about it it's local network not p2p.
Can you expand a bit on that
The server loads the level and tells the client to load it as well.
If the level that gets loaded name is the same, actor replication will work
I've always done it with an OnRep property that holds level information
So when the server loads the level and adds the data to the array, it replicates to the client, and the client responds by loading it themselves
Then wouldn't it be replicated to all clients?
Hmmm so how would i go about doing that? Right now i have a custom event with server replication and another with multicast for most interactive objects.
Sorry if this is very basic, haven't touched multiplayer much yet
Could shove the array property in PlayerState and make the property replication condition OwnerOnly
I'm not sure that normal arrays can get a per element callback so you might have to use a fast array. Not sure if that's changed recently
Would it otherwise be possible to have all the levels loaded on the server and change the visibility/unload client side only?
Server will always have the level loaded. You can change visibility on the server and it will hide it from clients, I think
But things in those levels will probably still replicate
Oof i think I'm a bit out of my depth here
It's not as bad as you think
Hello, does anyone know why the object might be doing this weird movement? It looks like Simulate Physics is what makes it do that. As a quick workaround I disable physics for a second for it to snap in place, but I'd like to see whether there's a better solution
how did you attached?
using lerp from a to b?
I don't want to lerp, I need it to be instant
I would try lerp with with high value alpha for testing
if it works it will be easy to debug further
could also be NetworkSmoothingMode
disabling it could solve it for this cube actor
Attached player actor to car' s component through server multicast
attachment is already replicated, you don't need multicast for attachment specific logic
just attach by server
Does that remove jitter to passenger?(non possesser)
no, for jitter removal you need to set some properties after server attached the component to component or actor to actor whatever
and those properties should be set by multicast, some of the variables are not replicated in those properties
Can you elaborate what are those? I'm kind of intermediate in unreal engine
once you attach character to vehicle by server, in the same frame call a multicast function.
multicastfixJitter_implementation()
if (HasAuthority())
{
CharacterMovement->DisableMovement();
CharacterMovement->StopMovementImmediately();
}
CharacterMovement->SetMovementMode(MOVE_None);
CharacterMovement->bIgnoreClientMovementErrorChecksAndCorrection = true;
//Reduce network smoothing to minimize jitter
CharacterMovement->NetworkSmoothingMode = ENetworkSmoothingMode::Disabled;
Target->bUseControllerRotationYaw = false;
Target->bUseControllerRotationPitch = false;
target is the passenger, not driver
driver is pocessing the vehicle it has no jitters
jitters only apply to passengers because vehicle controller is trying to override rotation/location of the passenger controller
this is why you need to disable those jitters on passenger
im getting slight jitter, with the method you said, i don't know what to do with network smoothing mode, so i plugged it there. did i do anything wrong or missed anything?
these should be on server
if (HasAuthority())
{
CharacterMovement->DisableMovement();
CharacterMovement->StopMovementImmediately();
}
in a multicast add a sequence node
in the first pin check if server, connect them
second pin should the rest of the properties on server/client both
when you call multicast on server it will be called on server and all clients, so you can check if server or switch has authority
ill check this in 4 hours. power out, ill ping you once i try this
sure, just let me know how it goes
I fixed my jitters on the same approach
for you it should also work
im gonna try it now, can i follow this in DM? cuz it will be helpful to revisit without clutter
what is DM? you mean private message?
yes
I think you can start your thread
and others will also be able to help you if the issue not resolved
non possessed player attached to other actor jitters
my world is made almost entirely of replicated actors, i set the initial net speed of players pretty low so the initial replication doesn't saturate.. but im having a hard time figuring out when the initial actor replication has finished for a client... i guess theres no straightforward way to do that huh? one idea i have is to have the server replicate the number of actors and on the client side increasing a counter in AActor::PostNetInit but that seems a little janky
or maybe the client can loop over all replicated actors and check to see if they have all begun play.. that seems a bit easier
this looks fine replicate the number of actors and onrep to notify all clients about the actor state
Hi there, just forwarding a question from cpp channel:
What is the current progress of the Mover plugin wrt multiplayer? Is is stable? Which engine version is required?
Anything that can make us get rid of the heavy CMC ๐ค
- Epic works on Chaos Mover. Not sure how far that is, but given the recent commits they are still fighting with it
- NPP Mover I have no clue. We are using it but our NPP and Mover are both !heavily! changed. I did see they recently added Iris support to NPP, even though that looked a bit... well let's just say it could be done better...
In terms of features for Mover itself, I'm half sure it's still lacking a lot of the battle tested stuff that CMC has.
So you can basically try NPP Mover or Chaos Mover and in both cases you should be prepared to:
- Fight bugs.
- Reimplement features that CMC has.
- Probably perform "engine" changes (you can pull the plugins into your project's Plugins folder fwiw, so they replace the Engine ones, but that's still an engine change down the line, given you have to merge new stuff in).
If you are comfortable to patch NPPMover/ChaosMover in C++/custom Engine and you want to trade that against the heavy CMC, then you can go for it. Having worked with NPPMover for so long and followed the commits on Mover and NPP, I would if at all go with Chaos Mover, but most likely continue to use the CMC.
You should probably also ask yourself why you even want to use Mover instead of CMC. Mover isn't necessarily cheaper depending on what you are doing. Epic is adding tracing into ChaosMover in commits with messages that suggest that they are trying to figure out why it's expensive. And NPPMover is certainly not cheap or cheaper. NPPMover has this little "one backend for fixed tick simulation" bait hanging around and that might also work for a lot of peeps, but if that's a key requirement you might want to check if NPP actually covers what you need and doesn't have hidden pitfalls. And ChaosMover has the "everything under one physics simulation" bait, which is potentially worth more, but multiplayer physics are a beast to tame and Epic is still working on that.
I don't need physics or anything fancy, just simple walking - hopefully without some of the overhead of CMC that we don't need.
Engine changes are okay, but none of us are experienced network programmers..
But thank you for answering.
Our profiling suggests that CMC is the main performance bottleneck in our game. I have not used Mover before, and just want a quick overview if it's worth the time invested to set it up - I wouldn't do that I think if it's too unreliable
For reference, our game is a top-down 3d shooter with flat/light-bumpy terrain. For all intents and purposes, the collision shapes could be represented by a circle projected onto the ground.
If I want certain actors only available on certain clients I do have to implement IsNetRelevantFor for them right, there is no way around that?
Nothing global or so, so that not every actor needs to inherit from a custom class.
the owning client or other clients?
there's 3 views here.
What the owning client sees, what the server sees, and what other clients see.
I want to make smooth movement for the owning client mostly, bcs he โinteractsโ and cares the most about movement from physics handle
What's your physics replication setup? Remember that if you're using ACharacter, your movement is locally predicted, but physics is not.
You have a predicted thing "carrying" a non-predicted thing
What do you mean by saying physics setup? If itโs possible can I message you priv tommorow? I dont have access to the PC right now, it will be easier to talk with project open
Was checking out the new GASP 5.7 update, and I was curious about montages / sliding.
The livestream suggested that 'it just worked', but I'm finding all sorts of issues not present in the CMC. I've attached a video of one example. This will also happen with the montages - the client cannot handle it.
Anyone know of any settings I might need to change / modify to get it to work well, or is it just broken still?
this is on average latency. I wouldn't expect the client to freak out so much though (top left corner - it's teleporting all over the place, though it looks smooth to everyone else). I am not sure why the client would have such a fundamentally different result from the server, I wouldn't expect the prediction to be so off.
Particularly in this circumstance where you're not bumping into anything. In those contexts, CMC can have like no net corrections even at like 500 m/s
this was in fixed tick rate, if I don't use a fixed tick rate the server sees a bunch of jittery characters
simulated proxies look slightly less jittery, like you can tell they're jittering on the server but a smoothing is applied somewhere
Hey folks,
I am trying to understand the Actor roles.
My understanding about dedicated server setup (Like valorant, dota 2) is shared in the screenshot. This also correlates to the official documentation on Actor Role and Remote Role
I am not sure how the roles work in a Listen server setup (Like minecraft, left for dead, etc) where let us say Player 1 is hosting the game.
Can someone explain or point me to a good resource?
This is my educated guess but I have no clue what the roles will be for the player 1's character in the Host machine.
Have you considered starting a game with 2 players, one listen server and printing the roles of different Actors? :D
Player 1 on Host will be authority for both roles iirc.
But you can just print them fwiw. Also keep in mind that you are listing this stuff for possessed pawns/characters. Clients usually have SimProxy for their role. AutoProxy is mostly only found for said pawns/characters.
Hehe, I know that I can print it. It's just that the computer I have available to me at the moment cannot run unreal so I am diving into the character movement component using unreal's source code in github. My choice is waiting until tomorrow to perform this test when I'll be at my PC or ask here.
Both local and remote role being ROLE_Authority in the host machine makes sense to me.
Ram limited or something? Even a decade old laptop should be able to run Unreal.
No, It's a Macbook M1 Pro. Unreal's PIE runs at 10 fps in it so I never install it in this.
Hm. I don't know much about M1 Pro Macbooks, but is this before or after you set all the scalibility settings to low and turn off stuff like Lumen?
Cause for testing code, you don't need any fancy graphics.
If it runs 10FPS on a fresh project, then there might be a world where it runs 30-60FPS if you turn expensive render features and the overall quality off/down.
since tmap is not supported for replication
UPROPERTY(Replicated)
TMap<EWeaponAccessorySlot, class UAccessoryItem*> Attachments;
error : Replicated maps are not supported.
should I use replicated TArray of structs ?
UENUM()
enum class EWeaponAccessorySlot : uint8
{
Sight,
Muzzle,
Grip,
Magazine,
Buttstock,
Foregrip,
UpperRail,
LowerRail,
MAX
};
USTRUCT()
struct FWeaponAttachmentSlot
{
GENERATED_BODY()
UPROPERTY()
EWeaponAccessorySlot SlotType = EWeaponAccessorySlot::None;
UPROPERTY()
class UAccessoryItem* Accessory = nullptr;
bool operator==(const FWeaponAttachmentSlot& Other) const
{
return SlotType == Other.SlotType && Accessory == Other.Accessory;
}
bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess)
{
Ar << SlotType;
Ar << Accessory;
bOutSuccess = true;
return true;
}
};
UPROPERTY(Replicated)
TArray<FWeaponAttachmentSlot> Attachments;
should I use replicated TArray of structs ?
Yes. With the note that, depending on what you are actually replicating there, you should not only use a TArray but a FastArray.
fast array because changes to a property inside one of the structs will not trigger the repnotify function on the array ?
if yes, I am not using repnotify in this case
still I need fast array?
No, it's more about per element replication. If your Array and Struct are small, then a TArray is fine. But, for example, an inventory can definitely benefit from a FastArray.
btw, the habit of using a TMap solely due to it mapping a Key to Value isn't necessarily good. For small counts of elements, the hashing of a TMap Key is probably more expensive than looping over a TArray.
If you want to keep the simplicity of throwing in a Key and getting a Value back, TArray always offers FindByKey and FindByPredicate.
FindByKey requires you to have an operator== that takes in the KeyType you want to find by. In your case, EWeaponAccessorySlot.
FindByPredicate allows you to find an entry based on whatever context you are in right now, if that makes sense. So it's a bit more dynamic, since you don't necessarily have to pre-plan your struct with an operator overload, cause you just write a lambda that compares one or more properties of an entry of the TArray to whatever you capture (which is what I mean with context I guess).
for this exact reason I first thought of TMap where only hold one key at a time, so any same object will be replaced instead of duplication ...
yeah I will use tarray now it seems also fine
Yeah, you aren't alone with that thought. TMap is really useful, but I do see people "overuse" it for tiny lists, mainly for the Key <-> Value mapping, while TArray can offer the same, potentially cheaper due to HashFunctionCost > ArrayLoopCost.
The worry about duplicated entries is fair, but you combat that by keeping the TArray private: and exposing functions to add/remove elements to it. That way you can always check if the entry exists already.
Pretty sure there are more "ByKey" functions too that might be useful.
TArrays are also pretty versatile in terms of what container they actually are. Like you can HeapPush and HeapPop etc. on a TArray and use it as a Heap with a sorting function.
ElementType * FindByKey ( const KeyType& Key )
SizeType IndexOfByKey ( const KeyType& Key ) const
Relatively sure Contains should accept the Key too if there is an == operator for it.
And if in doubt, you can always use the ByPredicate versions and just wrap them into your own functions in whatever class holds the TArray.
Super thanks, I think there will be no issue by following these suggestions
will implement it and test it, if there will be issues will tag
UAccessoryItem* GetAttachment(EWeaponAccessorySlot Slot) const
{
const FAttachmentData* Found = Attachments.FindByPredicate([Slot](const FAttachmentData& Data)
{
return Data.Slot == Slot;
});
return Found ? Found->Attachment : nullptr;
}
Yeah, for example. Again, you can probably add an operator== overload for the enum to the struct and just use FindByKey if you wanted to.
struct FAttachmentData
{
// [...]
bool operator==(const EWeaponAccessorySlot Slot) const
{
return SlotType == Slot;
}
// [...]
};
const FAttachmentData* const FoundAttachmentData = Attachments.FindByKey(Slot);
return FoundAttachmentData ? FoundAttachmentData->Attachment : nullptr;
Wrote that just here into Discord, so might have typos or so.
FAttachmentData is FWeaponAttachmentSlot? Not sure if you renamed that.
USTRUCT()
struct FAttachmentData
{
GENERATED_BODY()
UPROPERTY()
EWeaponAccessorySlot Slot;
UPROPERTY()
UAccessoryItem* Attachment = nullptr;
};
when you call attach function check if local->attachtofppmesh else attach to tppmesh
better use one tpp mesh, just move camera when you are in fpp mode and attach the camera to player head socket
this way you will avoid the hassle of dealing with two meshes
If you can use C++, then the Actor approach is probably the simplest.
The native Attachment replication will try to attach it to whatever the Server did, so without C++ access to override that behavior, it is a bit nasty.
If you can't use C++, you might be better off keeping the state of the Weapon still in an Actor, but handling the Attachment with predefined Components on the Character.
So once equipped, you pull the SkeletalMesh, potential Material overrides, AnimBlueprint, etc. out of the WeaponActor's Data and assign them to the pre-spawned/attached Components on the Character. Means the WeaponActor itself won't really have any visuals.
Could probably also get away with spawning the Components runtime, just gotta be careful with runtime spawned stuff if it has to be net-addressable (aka if you need to pass it through an RPC).
There is probably even a world where your Weapon could just be a DataAsset and the WeaponActor is replaced by a runtime spawned ActorComponent for the State, but at that point it gets a bit too fancy and you might be better off just learning the small part of C++ to do that replicated Attachment change x).
Then use the Actor + override OnRep_Attachment or whatever it's called.
For my ue5.7 project, Would you guys recommend switching to Iris if i can on my current project, or should I wait 5.8 to be sure its stable ?
just use owner no see and only owner see
view targets already do all the work for you here
I would suggest not creating a first person mesh for things that are never the view target though
no context = stick with the default
That doesn't fix attachment
OwnerOnlySee/OwnerNoSee only really works if they go the SkeletalMeshComponent on Character way.
yeah I guess to add to that you want a weapon mesh that is build for both sides (1p and 3p) that just share the same source information of what is on it
and just... update it
I guess i just want to use the latest available tools but yeah i don't have a real reason to switch. It's just so i prepare myself for future updates but if the migration is too heavy i'll just skip it
That's where you gotta override the OnRep_Attachment stuff
I must add that it's only for my little side project which is just a prototype for the moment
No, the Weapon.
the main and most important migration cost will be if you
- use custom netserializers (they should be turned into iris serializers which are quite complicated to write... not sure if the last resort fallback works for user code yet)
- use replication graph (it is gone)
- replays are gone (complicated but generally speaking they do not work the same)
main real reason to switch earlier - have a lot of replicated objects or connections and need better perf now
Then stick with the current default.
Nothing. You leave it blank, because that's what otherwise causes every Client to do what the Server did.
Instead, you attach manually in whatever OnRep you have that defines if the weapon is equipped.
E.g. if you have Character::OnRep_EquippedWeapon, then you do it there.
generally speaking in my mind the weapon actor being a distinct replicated object is not meaningful unless you want to add random stuff to ever weapon
generally speaking clients only need to know about what the weapon should look like and the rest they can derive from which way the character is looking and if they are firing
Yeah, there you can do IsLocallyControlled -> Attach to 1P Mesh, otherwise 3P Mesh
Correct, but they are also not offering that info. :D
UE also has the First Person View stuff by now.
I never said to never use an actor
You ultimately gotta choose yourself, tbh.
You can absolutely overengineer this if you want to.
my point is to not bother replicating a distinct object if you don't have good reason to (or if you just think that's more simple... you can do what you want lol)
to me it's less of a headache to just spawn the weapon actor for them locally based off of replicated state from the character actor (or a component on it or whatever)
why?
You can spawn a non-replicated Actor locally. But you won't get around having "something" keep replicated state.
it could just be a struct that the weapon gets given by something else
you can use variables to pass information between objects in c++
Okay i understand, for my case i really don't need it so yeah i'll stick to the default and juste read the entire doc to prepare for future. Thanks !
I can only say that if you have no specific reason not to just use a replicated Actor for your Item/Weapon, then I wouldn't bother engineering something else.
You can route RPCs through the WeaponActor, use Ownership to limit what gets replicated to it, and what not. You can always come back and change it if you want to later.
fwiw even more typical usecases might see unique differences in onrep order and rpc ordering that might cause headaches but it's overall going to be flipping a cvar and then forgetting about it
it does a truly insane amount of bending over backwards to be seamless (as much as it can be! it's impressive to me though)
The comment about the 3rd person shadow is worth considering though.
Doesn't necessarily change anything about the Actor part.
does "working with Fortnite's 2017 weapon code" mean you are reverse engineering their project?
But the Attachment part would work differently fwiw, cause you kinda need both MeshComponents, where one is set to only render the shadow but nothing else for the local player.
okay I have no idea what else "working with Fortnite's 2017 weapon code for this" could imply then
I think they are referring to me mentioning that you might always need a 3p mesh + weapon to use as the character's shadow
#multiplayer message
this is generally done because first person "viewmodels" are kinda just floating arms
but you don't NEED to... you could just animate everything nice enough to never move the body around in weird ways or have floating arms
or you might not care about shadows
cool
Well if you picture your Character with a ThirdPersonMesh (UpperBody, LowerBody, Arms, Legs, Head) and FirstPersonMesh (Arms), and you think about attaching the Weapon, that has one single SkeletalMeshComponent, to either of them. And you then want that the local player sees their own full-body shadow, including the Weapon, you'll run into a problem :D
this is a very good way to learn Unreal stuff
If you don't care about the shadows, then the attachment replication stuff should be fine.
Valid.
If I want actors only be replicated to certain actors, do I use IsNetRelevantFor?
And can I change it dynamically?
Or is ther another way of doing it?
the concept of 1p mesh and 3p mesh is so problematic when it comes to deal with both for cosmetics
in a single character class 3p mesh + 3p anim class + 1p mesh + 1p anim class ๐
this is why I use only 3p mesh + 1 anim class, and play with camera with magic
when it needs to hide some area of the character in 1p mode, just use hide bones function on local client thats all
and in your anim class blend by bool if 1pmode, blend 1p animations state
you only need one anim instance, you use two anim states in it
if 1p mode, locally set ip mode to true in anima class, so other player will your tpp animation and you will be blending 1p animation
your 1p mesh and tpp mesh using the same skeleton
just delete the 1p mesh and use 3p mesh for both modes
you hide bone by function which takes the bone name
hiding bone will hide the mesh part
theres also the "copy pose from mesh" node that can be used in anim instances
don't need to hide bone in anim class
you do it in your character class
nah
get mesh in your character class and call hide bone by name
than use a material with mask to hide this area
yes you can do it
yes it is, and having two meshes in the character class for player is a trouble and it an old approach
now you can play with camera and set its location or attach to any other socket on character
like for 1p, attach it to the head socket
Hello friends. I am making a trebuchet right now and i have a problem with the projectile not looking smooth when its shot.
The projectile which is another actor is attached to the end of the trebuchetโs sling. To shoot it the trebuchet swings its arm by playing an animation and releases the projectile actor by calling detachactorfromcomponent() followed by enablephysics. Heres the problem. When its released the projectile stutters a bit before going on its way.
Has anyone worked on something similar and knows how to fix? I think the problem might be how i attach the projectile to the sling so if anyone knows the correct way i should be doing this please let me know! Thanks!!!
P.S. the stuttering problem began when i enabled async physics tick, but i think i am doing something fundamentally wrong with how i attach the projectile actor to the trebuchet
Two meshes is in theory fine. Especially if their bone count is different. Client of mine does the same. They also have a first person body that reuses the third person anim instance.
Just stay away from the EventGraph in the AnimBP and use a common parent for the First and Third Person AnimInstance so you don't need to code things twice.
For hiding bones I'm pretty sure there is a built-in feature that doesn't need any scale or material tricks.
And then you can also look into Linked Anim Layers for the weapon specific animations, as that doesn't need to sit in the main anim instance.
Imho you're better off having two character meshes for first person, because if your game has shadows you're going to need the 3P character in first person anyway.
Unless your game is one of those ones that takes the very realistic approach of "my 1P character doesn't have 1P specific animations, even it it looks weird in 1P" (e.g. a bodycam game). Or you're making one of those first person games that isn't really a shooter (think mirrors edge style parkour).
Because first person view model animations look extremely shonky when you see them from a third person perspective, and that includes when you look down and see your shadow. You don't want to look at your character's shadow and see that the clavicles are all warped up to be parallel with your head, and your arms are bent at an unnatural angle to frame the hands and gun on screen.
Unless you want to animate a dedicated camera bone, you also potentially have to deal with issues like the player's head bobbing up and down, giving a subset of users motion sickness. Since third person anims aren't going to keep the head still. Though you could probably mitigate that procedurally with Control Rig or something.
They already said they don't care about the shadows.
Ahh I missed that
Trying to comprehend something here...
I have this simple Multicast RPC setup in an Actor Component attached to a player Character.
Why is it that the Print String never fires on clients unless the Multicast is set to "Reliable"?
e: Thanks for the thumbs up! An answer would be preferred, however.
I have been making a project based on the first person template. I just noticed that if I put network emulation to average and rotate the player on the listen server, the simulated client sees a lot of jitter in the rotation. Anyone know what causes that?
Here's what it looks like
Do you think it's work looking into Iris?
I'm currently trying to figure out how to replicate certain actors only to certain clients.
I've found that I maybe override IsNetRelevantFor or that the Replication Graph might also be a viable option and I'm wondering if I maybe want to look into Iris for that as well?
You can't send information fast enough to other machines to make it look smooth.
Hence for position / rotation, you want to interpolate on the receiving end to give that smooth effect.
Just use IsNetRelevantFor
Currently trying Iris, do you think it is so bad?
I really like the replication group approach seems really nice.
I mean you can use that too, but Iris is still in development. Not sure it's worth fighting bugs for something you can do in the current system.
My first tests appear to work quite well and as long as they don't ditch it and it's a future thing, but i assume they will improve on it, since it's used in fortnite and tehre was even a talk about it.
But maybe it's also me regretting, some time ago not trying mover and implement things with the CMC. ๐
But if it really won't work out, Iris is super easy to disable again.
Not sure about Iris and ChaosMover (which is probably what Epic seems to focus one the most based on recent commits). NPP Mover just got Iris support, I believe, but not sure that's part of 5.7 yet.
I feel like Chaos Mover can be viable in 1-2 years. NPP Mover is more for the peeps that like to experiment and are fine with patching up an incomplete base at the momen.
Chaos mover can send input as iris serializers now
It's hard to tell what Epic's plans really are tbh. But based on commit history, Chaos Mover is seemingly their focus.
Overall, I would probably never not recommened CMC to <generic multiplayer game>, given how absolutely battletested and feature-rich it is.
One thing I never see anyone talk about is the AsyncCMC code. I don't know if that's enabled by default, but the CMC has seemingly multi-threaded code in it by now.
AsyncCMC is a sort of forgotten side project as far as I can tell
basically they just copy pasted the entire cmc code into a new file
and made it sort of threadsafe and then tried to make the default cmc pass work to it
It's definitely going to be more simple to use something like chaos fixed tick mover in terms of threading
Metaphor of forgotten side projects.
it's a cool idea but it really makes it hard to search for cmc code lol
doing character sweeps in parallel is trivial to do but making it work well with interacting between other characters and game logic is not so simple
Chaos Fixed Tick? I don't know enough about Chaos.
Chaos mover is using that afaik
The Fixed Tick part of Mover comes from NPP.
Not sure if Chaos has a fixed tick implementation internally.
uh
yes it does
that's entirely how most of the chaos replication scheme does stuff... it uses a fixed async tick for consistency
I'm still trying to find a proper frame number that client and server can agree on within Chaos to point to the same physics state.
Even CVD's setting to use that network frame isn't in sync.
that's kinda what the chaos replication plugin tries to do
The frame one can get from the system doesn't seem to work though :/
E.g. if you grab the transform of a Chaos Vehicle and that Frame and compare those on Server and Client, they won't line up.
grab it how?
It's been multiple weeks since I tried it. Can't tell you from the top of my head.
Chaos mover literally has a TSimCallbackObject in it in case you need code to look at
this is how things add ticking to chaos async fixed tick (there are others though)
It was meant for hit validation. For NPP it's easy. Sending the SimProxy Interp From and To frames and the Interp Prcentage to the Server as an AutoProxy leads to a pretty accurate state.
why is the interp percentage not based on local timing? that's surprising to me
What do you mean?
"Sending the SimProxy Interp From and To frames and the Interp Prcentage to the Server"
SimProxies in NPP don't get every FixedTick Frame replicated.
They have some To and From frame they interpolate between and a percentage that is based on their local tick.
if it's based on the local tick why is it sent
So if yo uwant to tell the server what the client is seeing, you gotta send it those values.
How else would you do it?
just use local state and interp from there... the distance could be considered locally trivially to me
What local state?
Do you know how NPP works internally? Otherwise, this might be just missing info.
Or maybe I'm not clear enough. The 3 properties are sent from Client to Server for weapon hit validation.
I am probably missing something but I do not see why you would need to ever send the interpolation alpha between two states over the network unless you somehow cared about the client using that state exact right now as some timing value.. I don't really know how the npp works in terms of interp stuff
oh, you should probably include what you mean earlier lol
I did write that though
of course you would need the interp value for them hitting something in between interpolations
^
Maybe not clear enough, but yeah.
ah, I didn't connect you meant shooting at something in-between
Yeah sorry.
And that's what I want a similar thing for for Chaos Mover.
Eh
Chaos in general.
fixed async tick has been in Chaos for years
Cause we have Chaos Vehicles that can be shot at. And Hit Validating those, not sure.
Yeah, but that alone doesn't ensure that there is a Frame Number that is directly tied to the State that is in sync between both of them.
You can open CVD and look at Server and Client and change the Sync Mode to the Network Frame or whatever it is called.
It still doesn't really line up.
(CVD = Chaos Visual Debugger)
it won't ever truly line up... it's not a deterministic sim afaik
this is not Photon Quantum
When the client receives state information from the server, it compares them with the cached physics state in its history for the corresponding physics frame. If the state information differs enough, it triggers a physics resimulation.
Yeah, but the frame number it was able to get that they use for the CVD setting was as useful for checking an old transform of a vehicle as using the NPP frames that have nothing to do with Chaos.
As in, not useful at all.
the fact that NPP and chaos replication are two separate things is absolutely mindbendingly confusing
Ya
I think Chaos Vehicles are also not locally predicted, or?
If you put some latency in and push the throttle, there is a delay, right?
chaos vehicles support both according to docs
so they can be predicted if you want
and resimulated
since they are part of the async physics tick they are kinda just in there as is
Hm yeah, not sure how far that is. I think one of the previous UE versions only just started that
"how far" depends on alot
basically you cannot give a huge leash to a client here or else you will have an apocalyptic 10+ frame rollback
Maybe we should communicate "how far" via "Experimental" "Beta" "Side-Project".. 
rollback netcode leans heavily on delaying input to render it later and reduce misses/ distance from valid frames etc
so I assume they have some caps on that
True, NPP keeps a Tick Offset and "how many frames to rollback" mostly depends on the ping.
I did try chaos modular vehicles out at one point and I found it kinda frustrating to make anything with
very hard-coded with stuff for no reason in a lof of places
All I want is a number I can send to the Server that more or less (doesn't have to be exactly the same) points to the same "state" on Server and Client.
obviously ping affects the actual delay... what I mean is you need to have caps
you cannot support simulating the game 1000 times
at least not the typical unreal game
But yeah, right now I just use the NPP Frame Number and give Chaos Vehicle Hit Validation a bigger threshold. It's just a "not sure what else to do" solution.
does NPP frame tie into the chaos async fixed sim history or what
Not at all.
uh... I think you might be using the wrong number then lol
It's just a "not sure what else to do" solution.
I'm very much aware that I'm using the "wrong" number.
But the "right" number doesn't exist.
well
you can look into how their history buffers look and draw what each one looks like
The number that Epic shows in CVD as a Network Sync Frame is as useful as using the NPP frame :D
yeah I would assume the cvd frame is useful
it's possible that this thing does not work on global frames but is more local per object
Could be. Do they resimulate the whole physics scene or just some of it?
see FChaosSimModuleManagerAsyncCallback::OnPreSimulate_Internal I guess
Will try in the future. Currently nothing planned for improving this and I can't do that on my own due to client project. You can still head-shot a player that is in a vehicle at 150-200ms ping, so I could care less. Our Hit Validation is pretty much just "could the project reach the HitResult location" plus "is it HitResult roughly where the Character/Vehicle is".
The beauty of not having animations on the Server means you can freaking forget about proper Hit Validation -.-
yeah if you are already doing that well at 200ms that is awesome
I've basically been trying to get Jolt to work in a similar way for a while now... the cool part is Jolt actually can be fully lockstep but I'm getting fed up with the complexity of actually doing that
I would rather be close enough
Yeah, if the Server would tick anims, I could probably validate hits that are as old as the frame buffer allows for Mover (not for Chaos though).
Epic is pushing a bunch of performance analysis related commits for Chaos Mover. Hopefully it's not gonna be more expensive than the CMC lol.
well
Also not sure if Chaos Mover allows async physics or not.
the good news is the cost is somewhat linear
Or if that's even a problem I guess.
if you only do the expensive stuff in an async chaos callback at 60hz and swap it back
it's fairly isolated from the critical path
unless the main thread is waiting on a big sim
it might swap buffer for all I know though
True, might be less of a problem if one uses the async version of physics.
They couldn't have chosen a worse term with the async vs sync physics.
The second someone who doesn't know what that is about reads that they will be like "But, duuuuh, physics is already on a different thread and async."
But I guess I wouldn't find a better term -.-
since the resim is all async callbacks I am confused how this isn't async
turning on insights once could reveal if it's executing as a task or not
The Sync/Async part is about GameThread <-> PhysicsThread communication.
no reason it can't run on the main thread but
no need to guess
ah, you mean game thread code writing to it in the main tick
In Sync Mode, the GT will wait for the PT to provide the data back at the end of the Frame.
In Async Mode, the PT can perform multiple loops and even cross the EndFrame mark of the GT before it reports results back.
So "sync" here means "in sync with the GT tick".
Terribly confusing.
ah, that makes sense
In my case I kinda just start a new tick whenever enough time elapses
I used to have it on a task thread (with no forced wait) but I disliked how much input was delayed
so I suppose I'm not really doing it fully async in a sense
The docs link doesn't lead to anything anymore -.-
And the card description is wrong I think LOL
most docs and guides recommend enabling this for chaos replication modes (network physics component stuff)
When enabled, this new feature runs the physics simulation in its own separate Physics Thread as opposed to running on the Game Thread.
Yeah sure, we run the phys sim on the GT.
serves me right for assuming the comment would accurately describe it at all lol
I think Async Physics might actually improve the whole fixed tick stuff for Chaos.
Cause the PT can then keep on ticking at its fixed tick rate, no matter what the GT does.
Resimulations only happens on the clients, the server never correct itself since it has authority. If the server were to have a different result after having processed the same inputs as on the client then the client needs to perform a resimulation to correct itself based on the servers outcome.
huh... that is surprising
Right, so it can't do some of the stuff the CMC does.
Like accepting the Client's state.
I guess that's not a bad idea due to how slow user input could be and given you have 60+ people connected
it would be doing a LOT of work
Yeah
Also potentially cause other Clients to resimulate. Sounds like a domino effect of resimulations.
No clue about the quality of this, but found this post when looking for Async Physics Tick info.
https://levelparadox.com/2024/05/12/how-to-use-async-physics-tick-unreal-engine-5-4-c-blueprint/
Someone on Reddit who hasn't lost their marbels yet.
Are they correct, however? I don't think so :D
I think the whole Async Physics Tick is even more confusing to the general audience than it is to us.
there are bp callbacks for some of it I guess...
Yea I still have to look into mover and see how it works, but I've done the replication thing with the iris groups now, that was super nice so far. But time will tell if it was the right decision or if I have to rework it. ๐
my custom network movement system uses fixed async tick but i had to do some some kinda janky stuff for moving kinematic stuff..
also physics rollback does make it roll back too which was kinda annoying lol
How would I implement a multiplayer listen-server match setting like this? Currently, these values are stored inside my GameMode class; some of them, like WarmUpDuration, are replicated to the clients through GameState. Where do I store these match setting values?
Is this already with connected clients?
No, I don't plan on having a server lobby. Game starts on gameplay level by default and clients join the session goes to gameplay level aswell. I was thinking on keeping the settings in GameUserSetting for the server hoster
Depending on how many settings, you can also pass them along the OpenLevel command.
?Setting1=Value1?Setting2=Value2 etc.
And then grab the Options String on the other map's GameMode and parse it again.
That means I should create a console variable for each setting?
Those aren't console variables. They're just options in the GameMode's Options string.
another option might be to use a save game object which the game mode class could load and apply
with the added benefit of stuff being saved
how much does it cost in bandwith to have the server send a new transform to the client ?
does it do 1 RPC per component ? or can it compact them if multiple scene components move in a same frame
anyone have idea how i setup a volume specific to a player ?
it s basic thing but cant find tutorial and AI just tell shit random
for now anyone enter the volume is cast to everyone
If its a Pawn, you can use stuff like IsPlayerControlled
AI respons to this problem : ๐คฃ
where i plug that ?
That still won't work by the way
Because all of the player pawns are going to be player controlled
Your absolutely right, I completely misread what he was asking for
there is a volum in the volume and i want it affect only players inside . for now affect everyone
How are you identifying which player a volume reacts to?
*volume in the lvl
Oh, so you want it to affect all players inside and only players?
just a behing overlap
Language barrier issue here I think.
Then do what Matt said.
@tulip kiln Drag from your Cast, search IsPlayerControlled
Plug it into a Branch node
Getting it right by accident. #winning
Yes
If that is true, that means that pawn is a player.
Yes, that will only allow Players to execute that code
You could also cast to a pawn instead by the way
To avoid hard referencing issues with casting to a BP.
what does it mean ? i m really mentally retard for multiplayer things lol
Got nothing to do with MP
ok i see
but i think that ok really few thing in the level can be all hard reference
Do whatever you want. I'm just letting you know.
like 2 volume 3 buton
Its just better practice
yes true
thanks for your help . better respons that all ai that just told random shit
hmmm some how doesnt work anymore
before was casting to everyone but now feel it cast to no one
at least dont play the print screen at the end
You are extremely new to Unreal, I would suggest that you dont start with a Multiplayer project.
You will have better success with a Singleplayer only experience.
i dont work alone on my project i m just the guy making the map
but if i can solve stuff before asking other guy that good i want to learn
Which player do you want to know about a collision with?
Local player?
Then you need Is Local controlled or something like that (I forget the exact function name)
ok i try that
ok this make error
2025.12.08-11.08.36:585][310]PIE: Error: Blueprint Runtime Error: "Accessed None trying to read (real) property LastHitBy in Pawn". Node: Branch Graph: EventGraph Function: Execute Ubergraph BP Remove Fog BP Blueprint: BP_RemoveFog_BP
Because you need to get the controller from the pawn
No
no error but no rint string
lol sorry
You get the controller from the pawn
Then check if that is a local player
That's how you check if it is local
like that ?
No
No
You got the controller
So now you check if it is locally controlled
You are getting the instigator
Yes
it show the error
Then paste the error that you get
That is probably because it is hitting it on an AI - which, if I recall, doesn't exist on clients
So you need to add the check in there to see if it is a player controller
mmm... i will investigate (by looking how my guy solve MultiPlayer problem so far xD ) . thanks for time spent
is locally controlled
like one in the bottom ?
from text i understand error comme fron the get controller
yea errror came from get controller
if i remove no error
Read that chain of calls.
You don't care if the heroshooter's controller's instigator is locally controlled, you care if the heroshooter is locally controlled.
yea i tried that nothing happen
Thing happened -> was it a B_Hero_ShooterMannequin? -> yes -> was it locally controlled? -> yes -> ok do the thing
Does the print string ever fire in any situation ever?
yes if i remove is localy controlled
Are you only enableing overlaps on server or something?
What are you actually trying to do here, and what's your setup besides what's been posted.
Is simplify maximum for test there is nothing more that what on the screen . Just volume overlap. Maybe there is a bad setting somewhere. I will check that
If I just put the cast all work but if only 1 player. If I put more nothing work
assuming B_Hero_ShooterMannequin can trigger overlaps with the BoxTop everywhere, this cast and branch should succeed on the machine the pawn is being controlled from, and only on that machine (server or client). If that's not the case then it's something else.
Will recheck all when front of computer. Thanks for all the suggestions
after putin tick interval to 0.1 instead 0 seems it start to work...
is i put 2 player one returne the true node
but if only 1 player not working
alos only host is working
well has they are not local seem s correct probably
well that opposite sorry only work for client not the server side
i tried that but output is not message from server side
if i play as client it work
specific to which player?
I scrolled down but still don't understand what you are after.
as client, you are going to get null on other people controller but it's own.
Hi guys !
I can't find the solution on how to possess existing pawn for clients in multiplayer
I am using blueprint and i spawn multiples pawns (not all the same)
but i can't figure out how to possess them
as GM is only on the server, i read that i can't use PC but then i don't understand how to do it
can someone help me please ?
Possess (on Controller) is BlueprintCallable
so I'd use that
but you MUST call it from the server
Possession should be done by the server. Just make sure the function to possess run on server passing the target controller (the client you want to possess the pawn for example).
if it's a client action, then yeah, you'd need to send a server RPC. but you'd probably be using your game specific player controller class for that anyway
so the only context you'd pass is the pawn you want to possess, since server RPCs must be called through an actor the client owns
I don't know where you read that you can't use PC.
Server has everyone's PC.
if you want to initiate the possession event from client machine, then send server RPC so it runs on server's copy of the actor.
Thanks guys !
I will do that !
I would've thought that was misinterpreting something
like a client only knows about its own player controller
typically a client would request the server to possess something.
would be weird imo if player 2, request the server for player 3 to possess something.
if that were the goal, then that's server side exclusive business to begin with.
Another question: how do you make sure each player doesnโt choose the same pawn to possess ?
Server deal with the possession and the check.
Client Reqest to possess hero A for example.
Server check if Hero A is already possesed by another player.
If it is then reject and inform the client that the possession is denied.
If not possesed yet, then proceed.
when i play has host dont work. also when i die i realise ... need also to found how link that to all camera and not the character
thanks !
Is it possible to move an AI Actor with Mover?
The "Mover Examples" plugin implements its AI movement by having the AI be a Pawn, and then moves it using "AI MoveTo". But I'm trying to use Mover without the AI having a Controller. (the Mover documentation literally promises that Mover can be used on Actors)
Btw. also using "MoverNetworkPredictionLiaisonComponent" (I think this is the non-Chaos ?), as that is what the "Mover Examples" is also using.
(UE 5.5.4, Mover 1.0)
I also constantly get this warning message, which I don't understand: LogMover: Warning: Attempted to queue an unregistered movement mode: NavWalking
The movement mode should be added already (= registered??) like in this screenshot.
If I set "Starting Movement Mode" to Falling, it doesn't complain except for runtime (second screenshot)
If I set "Starting Movement Mode" to NavWalking I get this warning: LogMover: Warning: Invalid StartingMovementMode 'NavWalking' specified on BP_TestMoverCrawler_C_2. Mover actor will not function.
If I set "Starting Movement Mode" to Walking, the editor crashes!
Is this an issue with simply updating the engine to 5.7 and then trying again?
Probably. Mover is very experimental.
You can use Mover on Actors, but AIs, at least the built-in ones, are very much Pawn/AIController based.
If the MoverModes are in the list of the MoverComponent, then they should be registered. I wouldn't necessarily queue the MoverMode on Tick though...
Well, Mover is, as Daekesh said, experimental. Crashes can totally be normal atm.
Alright! I will try to run it on 5.7, and probably describe the result in here for anyone curious. Thanks!
Hello everybody!
Sorry if I'm bringing a dumb question here.
But in 5.7 I cannot make server travel work for some reason. And the setup is super simple.
I believe I used to do it this way, but for some reason it just doesn't work on 5.7.
I read about the Steam Sockets thing, that I needed the plugin and the config file configuration, and I did both. But even so, it doesn't work.
Any kind soul could guide me in the right way here? ๐
Thank you very much, everyone
Hey guys, I'm not sure if my problem is more linked to multiplayer or to animations. I have a really weird behavior when i play a montage with an anim notify on multicast. The notify is triggered two times on the server while the animation is only played once. I changed the montage tick type of the anim notify from queue to Batching point and after doing this it was not triggering the anim notify twice. I don't really understand what is happening. And this is only happening on the client side.
I don't really understand why it is only happening when i play on client
Is it maybe due to some rollback ?
no its because the montage is played twice (Server and Client)
its a known thing. I know a video which explains how and why gimme one sec
In this video, we fix a couple of bugs that are caused by notify windows when used in animations that run in a networked environment.
tl;dr we will be using anim notifies instead of anim notify States/Windows because they don't work as expected in multiplayer.
โจ Support the channel & get exclusive perks on Patreon:
https://www.patreon.com/Al...
here he explains how and why
Okay he is definetly talking about the same problem I have, the only difference is that my AnimNotify is not a window but an instant one and I still have the problem
that shouldnt matter
In his case, the problem is only appearing when he has anim notifies windows
But yeah I think it's the same problem but I can't apply his fix to my case as I am already using instant anim notifies
hmmm
if the problem is alr known maybe there are different fixes for different anim notifies
I searched on internet but couldn't find any fix except putting the anim notify tick type to branching point
I guess I will just keep this fix for now
But it looks more like a workaround than an actual fix
maybe someone else in the dc has a good solution for that
Yeah definitely a workaround. Anim notifies inherently have problems when used for gameplay. Often the solution is to parse the notifies and setup your own gameplay timers to trigger events.
Yeah okay i see, that's what I thought, thanks !
Actually, @grand kestrel from here wrote something about it, and also provides a plugin that may be an easy fix for you?
https://github.com/Vaei/LocoTips/wiki/Anim-Notifies
Hi there! My game is crashing when doing a server travel in multiplayer and while I've tracked down the cause, I'm not sure why it's happening and how I can maintain the functionality I need otherwise.
Basically, I just want actors with ASCs to check for tags on the local player to determine whether they should be visible or not. So on Begin Play for the ASC, I look for a local player, get their ASC, and sub to the relevant tag/event. However, in multiplayer and when server travelling, that local player doesn't always seem to be ready at this point. So I have these actors also sub to a game state delegate for when a new local player is recognized.
The player character tells the game state to fire this delegate on its OnRep_PlayerState, and that specifically is what sometimes crashes the game after a server travel. It'd be nice to understand why that would cause a crash in the first place, but an alternate solution would also be appreciated.
Hello! I am replicating this physics simulating helicopter in my game, for the server all the movement is smooth and looks great. Hovever on the client side its choppy and laggy and unplayable, what could cause this?
Its only the server thats doing the calculations for the helicopter movement and applying the force every tick, i also turned of simulate physics for the client becuase i assume its not needed. Does anyone have an idea what could cause this jitter?
The video shows the issue
The images shows a bit of my setup
You'll get better results running the physics on each machine and loosening up the replicated physics settings a bit
Unless you roll your own system to interpolate and smooth the movement on the client
you meen applying force and doing calculations clientside? wont that cause desync immideatly?
Yes. And no it won't, look into how the physics replication works
everywhere i read it says that its best to let the server do all the physics, is that not correct ... ?
Depends.
This is my project, butter smooth with fairly bad network emulation.
https://youtu.be/LeR16i_bZO8?si=hUE3WIV3lSKiYD7_&t=57
The server can only send over the physics state so often, it isn't doing it every frame.
You either need to make your own smoothing system for the client to interpolate between states, or use the physics replication system (which basically does that)
ok, but isnt the physics replication system being used by default? Because then it would be smooth right?
Yes it's on be default, but its settings are very strict so you get a lot of hard snaps
read that
i will read that looks like what i need ,thank you
so you mean my issue could have to do with that?
in some tutorials i saw the replicated physics looked great straight out the box, thats why i dont understans my issue, my guess it has to with me adding force every tick or soomething
yup
i tested now and just letting the helicopter fall in the beginning is smooth, and synced
so it seems like there is some issue when i apply forces
idk how i should replicate it correctly
this is ran on the server
do you know if this is a good way or could this cause any issues?
doesn't look great, it should be like this:
Tick -> (on all machines) -> add force based on some replicated state (collective, cyclic, yaw)
that way the client can do some simming BETWEEN updates, and the physics interpolation has less work to do.
https://www.youtube.com/watch?v=0X7yCnfye3c
In this clip note the red and green debug boxes. Red is where the thing is on the server, green is on client. The difference is from the ping latency.
I am using the same base character for all of the players in my game. but now when i equip something with one character it equips it for the other characters. how do i seperate the characters so equiping something doesnt equip it for all of the players?
You need to do it dynamically.
So on spawn, give them something.
Or have them select something from a screen
W/e
Really can't say much without more specifics on how your game is
But the crux is - it needs to be dynamic
Its always helpful to provide some code relevant to the question you are asking.
How are you performing the equipping?
Im using mutable and just testing. so i set it up to equip pants. I change the number of players in the editor to 2. then when i run the game and press my debug key both characters toggle the pants each time i press it. So Im not sure the best way to give each player their "independence" per say
Im not familiar with Mutable unfortunately, but I would hazard a guess towards you misunderstanding something about that system and how it works.
Or at least, how to use it properly.
Poor Matt - won't get to use Mutable for probably another decade
Don't remind me ๐
Is it good?
Please tell me it sucks
And Im not missing out on much
๐
It is supposed to make customization (think like character skins or weapon skins, etc..) a lot easier.
Anywho - I don't have much experience with it personally because our game doesn't need it.
it made it very simple for me, but now im hung up on the multiplayer portion of it
But it sounds like you're changing the asset that both classes are pointing to.
So then both classes get word of that change and then do their onrep
I think you are right. Is it best to make children of the class?
Show the code that you're using to do said change.
Would have to dig into it to see if the "instance" is actually an instance.
Epic likes to pull pranks on people from time to time.
im still learning about instancing and im trying to figure out how each player can have their own instance. because i believe i have them linked together right now
Based on what you're saying is happening though - pretty sure the issue is what I said. You're changing the asset that both reference.
Not too familiar with Mutable, so can't help much more than that.
Maybe there is some step that is missing to make it unique per instance or something
Ill keep researching it. I know im not the first to work on this. wont be the last either haha
Do debug keys fire everywhere, not just on actors with input enabled on them?
Could be that you're literally telling 2 actors to both swap their pants
That too. But I assumed this was on the player. And input should be routed through the player controller there first.
Humor me, gate that by IsLocallyControlled
i just made a child of that same character and took to debug key off of the other character and it is still doing it.
child class still has the parents code
child or copy?