26.06.16 TIL

김민준
∙∙조회 10

GAS 1일차

Run on Server

  • 서버에서 재생

multicast

  • 서버에서 클라이언트로 재생

Run on Owning Client

  • 자신의 클라이언트에서만 재생

 

Switch Has Authoritiy (블루프린트)

Authority(권한) - 서버 환경에서만 실행

Remote(원격) - 클라이언트 환경에서만 실행

 

Attribute = Hp, Mp, Level, Gold 등의 스탯 정보

AttributeSet = 저런 속성들의 집합 (속성들을 한 곳에 모아서 관리하는 클래스)

ASC(AbilitySystemComponent) = UActorComponent를 상속받은 컴포넌트 클래스

plain text
GAS를 사용하고 싶은 Actor는 반드시 이 컴포넌트를 소유해야 함

Attribute의 지속성이 필요한 경우 PlayerState가 소유하는 것이 더 적합

 

ASC초기화 -OwnActor와 AvatarActor 정보를 넣어주는 초기화가 필요함

-서버에서는 Pawn이 Controller에 의해 possess된 뒤 초기화함

 

ASC의 SetReplicationMode

markdown
3가지 mode

	1. Full - GameplayEffect를 모든 클라이언트에게 Replicate한다

2. Mixed - GamePlayEffect를 오직 소유한 클라이언트에게만 Replicate,

		GamePlayTag와 GamePlayCues는 모두에게 Relpicate

3. Minimal - GamePlayEffect를 아무에게도 Replicate하지 않고

		 GamePlayTag와 GamePlayCues를 모두에게 Replicate

 

블루프린트 연결 흐름

C++ ASC -> BP Character -> UI Widget -> Health Bar