Hi.
I have a listen server and 1 client.
I have a client controlled Pawn. Pawn has
UPROPERTY(Replicated,BlueprintReadWrite)
TArray<FTransform> Bones
Anim Node calls to Pawn with bones every frame and Pawn every frame calls UpdateBones(bones) what is
UFUNCTION(Server, WithValidation, Unreliable)
void UpdateBones(const TArray<FTransform>& aBones);
Server updates the Bones with aBones and as it is replicated, all clients has an updated bones what is good.
Problem I have is UpdateBones_Implementation
called three times per second only.
Client/server runs on same machine, so there is no network lag at all.
I do run server in PIE, and client starts in separate window.
Thanks for the help
###Added:
It has nothing with RPC eventually.
I do update variable, array of bones on my actor within AnimNode::Evaluate_AnyThread
, and I do call RPC at UpdateBones
on Actor Tick.
So, I do not call RPC from AnimNode. But, if I remove Anim Node from my AnimBP, there is no any delay on server. RPC received instantly.
I’m not sure what could be a reason for it. Next I would try to update variable on AnimBP, and pass variable from AnimBP to ActorBP via AnimBP’s Event Graph
###Added 2:
Im not sure what is happening and how it works.
I did add to my actor one more
TArray<FTransform> LastBones;
From AnimNode I do copy bones to this array:
Output.Pose.CopyBonesTo(ownerActor->LastBones);
Actor’s Tick Looks like
Super::Tick(DeltaTime);
UpdateBones(Bones);
so… AnimNode put data to LatestBones
. Tick Updates with Bones
UpdateBones_Implementation called straight away. No problems here.
As soon as I change UpdateBones(Bones) to UpdateBones(LatestBones) I start to have same issue. UpdateBones_Implementation called with 0.3s delay.
Added:
Thats Funny… I decreased number of Transformations in Array and delay decreased as well. Now I send half of all transforms (30 instead of 60) and my delay halved.
Is there any buffer size or long serialization/deserialization process?