[Lyra] 라이라 스타터 게임 개요 요약

1000·2024년 5월 2일
1

UE5 Study

목록 보기
2/8

유튜브 UE KR에 공개되어 있는 라이라 스타터 게임 개요 영상을 보고 요약한 내용입니다.
대략적으로 이해한 내용만 간추려 작성하였습니다. 보다 정확한 내용은 영상 참고 부탁드립니다.


Modular gameplay

  • 코어한 게임 프레임워크 액터는 Character/Pawn, Controller, Player State, Game State 입니다.
    라이라에서 제안하는 새로운 게임 프레임워크는 게임 플레이를 한 곳에 모두 추가하는 방식 대신 위 액터들에 구성하는 것입니다.

Experience

  • Experience는 여러 게임 플레이 룰을 모듈 방식으로 설명합니다.
    기존의 GameMode를 데이터 기반 방식으로 대체한다고 생각하면 편합니다.

Experience의 구성요소

  • 활성화 해야하는 여러 Game Feature Plugins
  • 플레이어나 봇이 컨트롤 하는 Pawn Data
  • Experience를 로드할 때 수행해야 하는 Actions 리스트
UCLASS(BlueprintType, Const)
class ULyraExperienceDefinition : public UPrimaryDataAsset
{
	GENERATED_BODY()

public:
	ULyraExperienceDefinition();

	//~UObject interface
#if WITH_EDITOR
	virtual EDataValidationResult IsDataValid(TArray<FText>& ValidationErrors) override;
#endif
	//~End of UObject interface

	//~UPrimaryDataAsset interface
#if WITH_EDITORONLY_DATA
	virtual void UpdateAssetBundleData() override;
#endif
	//~End of UPrimaryDataAsset interface

public:
	// List of Game Feature Plugins this experience wants to have active
	UPROPERTY(EditDefaultsOnly, Category = Gameplay)
	TArray<FString> GameFeaturesToEnable;

	/** The default pawn class to spawn for players */
	//@TODO: Make soft?
	UPROPERTY(EditDefaultsOnly, Category=Gameplay)
	TObjectPtr<const ULyraPawnData> DefaultPawnData;

	// List of actions to perform as this experience is loaded/activated/deactivated/unloaded
	UPROPERTY(EditDefaultsOnly, Instanced, Category="Actions")
	TArray<TObjectPtr<UGameFeatureAction>> Actions;

	// List of additional action sets to compose into this experience
	UPROPERTY(EditDefaultsOnly, Category=Gameplay)
	TArray<TObjectPtr<ULyraExperienceActionSet>> ActionSets;
};

Game Feature Plugins

  • Game Feature Plugins은 일반적인 플러그인과는 다릅니다.
    런타임에 활성화를 동적으로 컨트롤하는 게임로직이 있기 때문입니다.
  • 플러그인이 활성화 되었을 때 수행할 Action을 표시합니다.
  • Asset Manager를 쉽게 확장하고 스캔할 Primary 에셋의 유형을 새로 정의할 수 있습니다.

Actions

  • Action은 Game Feature와 Experience에 포함될 수 있습니다.
  • 활성화, 비활성화 됐을 때 필수 에셋을 미리 로드하고 코드를 실행하는 역할을 합니다.
  • 일반적인 액션의 예는 어빌리티 추가, 컴포넌트 추가, 위젯 추가 등이 있습니다.

Pawn Data

  • 플레이어나 봇이 컨트롤 하는 Pawn의 데이터
  • Pawn Data의 구성 요소는 ① 실제로 월드에 스폰할 플레이어 폰 클래스 종류, ② 폰을 빙의할 때 사용할 디폴트 카메라 모드, ③ 폰에 부여할 초기 Ability Set, ④ Ability relationship mapping, ⑤ Input Configuration 가 있습니다.
UCLASS(BlueprintType, Const, Meta = (DisplayName = "Lyra Pawn Data", ShortTooltip = "Data asset used to define a Pawn."))
class LYRAGAME_API ULyraPawnData : public UPrimaryDataAsset
{
	GENERATED_BODY()

public:

	ULyraPawnData(const FObjectInitializer& ObjectInitializer);

public:

	// Class to instantiate for this pawn (should usually derive from ALyraPawn or ALyraCharacter).
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Pawn")
	TSubclassOf<APawn> PawnClass;

	// Ability sets to grant to this pawn's ability system.
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Abilities")
	TArray<TObjectPtr<ULyraAbilitySet>> AbilitySets;

	// What mapping of ability tags to use for actions taking by this pawn
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Abilities")
	TObjectPtr<ULyraAbilityTagRelationshipMapping> TagRelationshipMapping;

	// Input configuration used by player controlled pawns to create input mappings and bind input actions.
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Input")
	TObjectPtr<ULyraInputConfig> InputConfig;

	// Default camera mode used by player controlled pawns.
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Camera")
	TSubclassOf<ULyraCameraMode> DefaultCameraMode;
};

Ability Set

  • Ability, Gameplay Effects, Attributes로 구성된 그룹
  • 플레이어를 대상으로 부여하거나 제거할 수 있습니다.
    Ability Set은 Hero Data, Experience 또는 Game Feature의 Actions, 장비의 장착에 따라 부여할 수 있습니다.
  • Ability는 캐릭터가 새로운 액티브 또는 패시브 Ability를 수행하도록 합니다.
    액티브 어빌리티의 예시로 점프나 수류탄 투척 등의 능력입니다.
    패시브 어빌리티는 저절로 트리거 되는 능력으로, 예시로 캐릭터가 사망하고 몇 초 후에 리스폰 되는 능력입니다.
  • Gameplay Effects는 적용될 때 마다 Attributes를 변경합니다.

  • Attributes는 Ability System에 노출된 액터의 수치상 State를 의미합니다. 예시로 HP, 보유 탄 개수 등이 있습니다.

UCLASS(BlueprintType, Const)
class ULyraAbilitySet : public UPrimaryDataAsset
{
	GENERATED_BODY()

public:

	ULyraAbilitySet(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());

	// Grants the ability set to the specified ability system component.
	// The returned handles can be used later to take away anything that was granted.
	void GiveToAbilitySystem(ULyraAbilitySystemComponent* LyraASC, FLyraAbilitySet_GrantedHandles* OutGrantedHandles, UObject* SourceObject = nullptr) const;

protected:

	// Gameplay abilities to grant when this ability set is granted.
	UPROPERTY(EditDefaultsOnly, Category = "Gameplay Abilities", meta=(TitleProperty=Ability))
	TArray<FLyraAbilitySet_GameplayAbility> GrantedGameplayAbilities;

	// Gameplay effects to grant when this ability set is granted.
	UPROPERTY(EditDefaultsOnly, Category = "Gameplay Effects", meta=(TitleProperty=GameplayEffect))
	TArray<FLyraAbilitySet_GameplayEffect> GrantedGameplayEffects;

	// Attribute sets to grant when this ability set is granted.
	UPROPERTY(EditDefaultsOnly, Category = "Attribute Sets", meta=(TitleProperty=AttributeSet))
	TArray<FLyraAbilitySet_AttributeSet> GrantedAttributes;
};

User-Facing Experience

  • Experience를 플레이 레벨과 연결하여 프론트엔드에 메타 데이터(타이틀 설명, 아이콘, 디폴트 Experience인지 등)를 표시합니다.
  • User-Facing Experience는 Primary Asset 이고 런타임에서 에셋 매니저를 통해 Experience를 검색할 수 있다.

/** Description of settings used to display experiences in the UI and start a new session */
UCLASS(BlueprintType)
class ULyraUserFacingExperienceDefinition : public UPrimaryDataAsset
{
	GENERATED_BODY()

public:
	/** The specific map to load */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience, meta=(AllowedTypes="Map"))
	FPrimaryAssetId MapID;

	/** The gameplay experience to load */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience, meta=(AllowedTypes="LyraExperienceDefinition"))
	FPrimaryAssetId ExperienceID;

	/** Extra arguments passed as URL options to the game */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience)
	TMap<FString, FString> ExtraArgs;

	/** Primary title in the UI */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience)
	FText TileTitle;

	/** Secondary title */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience)
	FText TileSubTitle;

	/** Full description */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience)
	FText TileDescription;

	/** Icon used in the UI */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience)
	TObjectPtr<UTexture2D> TileIcon;

	/** The loading screen widget to show when loading into (or back out of) a given experience */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=LoadingScreen)
	TSoftClassPtr<UUserWidget> LoadingScreenWidget;

	/** If true, this is a default experience that should be used for quick play and given priority in the UI */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience)
	bool bIsDefaultExperience = false;

	/** If true, this will show up in the experiences list in the front-end */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience)
	bool bShowInFrontEnd = true;

	/** If true, a replay will be recorded of the game */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience)
	bool bRecordReplay = false;

	/** Max number of players for this session */
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=Experience)
	int32 MaxPlayerCount = 16;

public:
	/** Create a request object that is used to actually start a session with these settings */
	UFUNCTION(BlueprintCallable, BlueprintPure=false)
	UCommonSession_HostSessionRequest* CreateHostingRequest() const;
};

GamePlay Experience - Input Mapping and Bind

  • Pawn Data에 InputMapping이 있고 InputMapping은 InputAction(IA_)이 키에 매핑된 것입니다. 예시로 LShift 가 IA_Dash에 매핑된 것.
    InputAction을 InputTag로 설정하는 InputConfig도 있는데, 예시로 IA_Dash가 InputTag.Ability.Dash로 설정된 것.
    그러면 Pawn은 Ability Set을 가지고 있고, Ability Set은 InputTag를 이용해 특정 Ability에 링크합니다. 예시로 InputTag.Ability.Dash가 GA_HeroDash에 링크된 것.
  • 즉, LShift를 누르면 InputTag.Ability.Dash가 Pawn에 호출 되고, Pawn은 해당 태그와 연결된 GA_HeroDash를 트리거합니다.
USTRUCT(BlueprintType)
struct FLyraInputAction
{
	GENERATED_BODY()

public:

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	TObjectPtr<const UInputAction> InputAction = nullptr;

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Meta = (Categories = "InputTag"))
	FGameplayTag InputTag;
};

/**
 * ULyraInputConfig
 *
 *	Non-mutable data asset that contains input configuration properties.
 */
UCLASS(BlueprintType, Const)
class ULyraInputConfig : public UDataAsset
{
	GENERATED_BODY()

...

	// List of input actions used by the owner.  These input actions are mapped to a gameplay tag and are automatically bound to abilities with matching input tags.
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Meta = (TitleProperty = "InputAction"))
	TArray<FLyraInputAction> AbilityInputActions;
};


USTRUCT(BlueprintType)
struct FLyraAbilitySet_GameplayAbility
{
	GENERATED_BODY()

public:

	// Gameplay ability to grant.
	UPROPERTY(EditDefaultsOnly)
	TSubclassOf<ULyraGameplayAbility> Ability = nullptr;

	// Level of ability to grant.
	UPROPERTY(EditDefaultsOnly)
	int32 AbilityLevel = 1;

	// Tag used to process input for the ability.
	UPROPERTY(EditDefaultsOnly, Meta = (Categories = "InputTag"))
	FGameplayTag InputTag;
};

Lyra Inventory Item Definition

  • 아이템을 주웠을 때 어떤 일이 발생할 지 정의
  • Fragment를 직접 추가하고 생성할 수 있으며, 아이템의 다양한 옵션을 정의할 수 있다. (장착 가능 여부, 아이콘 등)

Lyra Equipment Definition

  • 플레이어가 아이템을 장착했을 때 정의
  • 오버라이드할 Ability를 결정하고 아이템 사용 시 발생하는 이펙트와 코스메틱 관련 사항을 결정한다.
profile
Game Programming

0개의 댓글