일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- MAC
- Replication
- Aegis
- local prediction
- gameplay effect
- attribute
- Unreal Engine
- 게임개발
- 보안
- C++
- listen server
- CTF
- 언리얼 엔진
- 언리얼엔진
- UI
- ability task
- level design
- widget
- Multiplay
- 유니티
- stride
- rpc
- 게임 개발
- unity
- gas
- os
- animation
- gameplay tag
- photon fusion2
- gameplay ability system
Archives
- Today
- Total
Replicated
** [Drag Down] Animation Local Prediction + RPC ** 본문
void UDDGA_ActionBase::PlayAnim(FName SectionName)
{
FScopedPredictionWindow ScopedPrediction(ASC, !AvatarCharacter->HasAuthority());
// for anim local prediction
MontageTask = UAbilityTask_PlayMontageAndWait::CreatePlayMontageAndWaitProxy(
this,
TEXT("ActionMontage"),
ActionMontage,
1.0f,
SectionName,
true);
MontageTask->ReadyForActivation();
// for other client's fast anim sync
if (AvatarCharacter && ASC)
{
AvatarCharacter->NetMulticastPlayOtherClientMontage(ActionMontage, SectionName);
}
}
자기 자신은 UAbilityTask_PlayMontageAndWait로 로컬 프레딕션,
다른 클라이언트는 RPC로 빠르게 동기화한다
void ADDCharacterBase::NetMulticastPlayOtherClientMontage_Implementation(UAnimMontage* Montage, FName SectionName)
{
if (IsLocallyControlled()) return;
UE_LOG(LogDD, Display, TEXT("[NetMode : %d] NetMulticastPlayAnimMontage_Implementation"), GetWorld()->GetNetMode());
if ( GetMesh() && GetMesh()->GetAnimInstance() )
{
GetMesh()->GetAnimInstance()->Montage_Play(Montage, 1.0f);
if (!SectionName.IsNone())
{
GetMesh()->GetAnimInstance()->Montage_JumpToSection(SectionName, Montage);
}
}
}
RPC는 로컬 컨트롤러는 리턴시킨다
GAS의 철학을 최대한 지키되, 성능은 유지하고자 하였다.
'언리얼 엔진 > Drag Down' 카테고리의 다른 글
[Drag Down] Data-Dirven 설계 (2) | 2025.04.30 |
---|---|
[Drag Down] GAS관리 Actor Component로 분리 (0) | 2025.04.30 |
[Drag Down] 그래픽, 디스플레이, 사운드 메뉴 (0) | 2025.04.30 |
** [Drag Down] SetRelativeLocation Problem in Multiplay Runtime 덮어써짐 문제 ** (0) | 2025.04.30 |
[Drag Down] 메뉴 만들기 #1 커스텀 UserSetting, 메뉴 토글 (0) | 2025.04.23 |