항목 | 내용 |
---|---|
📅 작업 기간 | 2025.3.12 ~ 2025.05.03 (약 1.5개월) |
🎮 장르 | 3인칭 액션 RPG |
💻 개발 언어 | C++ |
👥 팀 구성 | 개인 프로젝트 |
🧩 담당 파트 | 플레이어 / 적 AI |
🛠️ 개발 엔진 | 언리얼 엔진 |
GitHub | https://github.com/KYWorld/PalworldProject |
https://www.youtube.com/watch?v=GogdZGq0ry8
구현 목표 |
---|
플레이어 기본 이동 시스템 |
무기 시스템 |
플레이어 공격 시스템 |
구현 목표 |
---|
적 AI 시스템 |
적 무기 시스템 |
플레이어 / 적 전투 시스템 |
구현 목표 |
---|
HUD 제작 |
적 AI 위젯 연동 |
맵 추가 |
사운드 추가 |
플레이어 클래스
classDiagram
%% ───── Interface (상태 종료 인터페이스) ─────
class IIStateable {
<<interface>>
+End_BackStep()
+End_Damaged()
+End_Dead()
}
ACPlayer ..|> IIStateable : 상태 애님 종료 시 호출
%% ───── 플레이어 클래스 ─────
class ACPlayer {
+Weapon : UCWeaponComponent*
+State : UCStateComponent*
+HealthPoint : UCHealthPointComponent*
+Movement : UCMovementComponent*
+Parkour : UCParkourComponent*
+Target : UCTargetComponent*
+UserInterface : UCUserWidget_Player*
}
%% ───── 무기 시스템 (컴포넌트 기준) ─────
class UCWeaponComponent {
+SetMode()
+GetSubAction()
+GetDoAction()
+GetEquipment()
}
class UCSubAction {
+Pressed()
+Released()
}
class UCDoAction {
+DoAction()
+Begin_DoAction()
+End_DoAction()
}
class UCEquipment {
+AttachToMesh()
+DetachFromMesh()
}
%% ───── 파쿠르 / 타겟 / 상태 / 체력 ─────
class UCParkourComponent {
+TryParkour() %% 높이, 거리 기반 파쿠르 실행
}
class UCTargetComponent {
+Toggle()
+Change()
+GetNearlyFrontAngle()
+RotateToTarget()
}
class UCStateComponent {
+SetIdleMode()
+SetActionMode()
+SetDeadMode()
}
class UCHealthPointComponent {
+TakeDamage()
+GetCurrentHealth()
}
class UCMovementComponent {
+EnableControlRotation()
+DisableControlRotation()
+PlayEvade()
}
%% ───── UI ─────
class UCUserWidget_Player {
+UpdateHealth()
+UpdateTarget()
+ShowCrosshair()
}
%% ───── 관계 정리 ─────
ACPlayer --> UCWeaponComponent
ACPlayer --> UCStateComponent
ACPlayer --> UCHealthPointComponent
ACPlayer --> UCMovementComponent
ACPlayer --> UCParkourComponent
ACPlayer --> UCTargetComponent
ACPlayer --> UCUserWidget_Player
UCWeaponComponent --> UCSubAction
UCWeaponComponent --> UCDoAction
UCWeaponComponent --> UCEquipment
무기 시스템 클래스
classDiagram
%% ───── 무기 시스템 핵심 클래스 ─────
%% 컴포넌트 (시작점)
class UCWeaponComponent {
+SetMode(EWeaponType)
+GetAttachment()
+GetEquipment()
+GetDoAction()
+GetSubAction()
}
%% 에셋 (생성 담당)
class UCWeaponAsset {
+BeginPlay(ACharacter*, UCWeaponData**)
}
%% 데이터 (구성 요소 집합)
class UCWeaponData {
+GetAttachment()
+GetEquipment()
+GetDoAction()
+GetSubAction()
}
%% 구성 요소 (장착 및 행동)
class ACAttachment {
+OnBeginEquip()
+OnUnEquip()
+OnBeginAction()
}
class UCEquipment {
+Equip()
+UnEquip()
+GetEquipped()
}
class UCDoAction {
+DoAction()
+BeginPlay()
+TickComponent()
}
class UCSubAction {
+SubActionStart()
+SubActionEnd()
}
%% 데이터 구조체
class FEquipmentData
class FDoActionData
class FSubActionData
%% ───── 흐름 관계 (상위 → 하위) ─────
UCWeaponComponent --> UCWeaponAsset : 무기 에셋 로딩
UCWeaponAsset --> UCWeaponData : 무기 데이터 생성
UCWeaponComponent --> UCWeaponData : 무기 상태 참조
UCWeaponData --> ACAttachment : 부착물 보유
UCWeaponData --> UCEquipment : 장비 보유
UCWeaponData --> UCDoAction : 행동 보유
UCWeaponData --> UCSubAction : 서브 행동 보유
UCEquipment --> FEquipmentData : 장비 설정 사용
UCDoAction --> FDoActionData : 기본 행동 설정
UCSubAction --> FSubActionData : 서브 행동 설정
공격 관련 클래스
classDiagram
%% ───── 캐릭터 클래스 ─────
class ACPlayer {
+UCWeaponComponent* Weapon
+TakeDamage()
}
%% → 플레이어 입력을 받아 무기 시스템을 실행하며, 공격 시 TakeDamage 처리도 가짐
class ACEnemy {
+UCHealthPointComponent* HealthPoint
+TakeDamage()
}
%% → 적 캐릭터로서 공격당할 시 TakeDamage를 통해 체력 감소
%% ───── 무기 컴포넌트 ─────
class UCWeaponComponent {
+DoAction()
+SubAction_Pressed()
+SubAction_Released()
}
%% → 무기 타입에 따라 일반 공격(DoAction)과 보조 입력(SubAction) 처리 분기
%% ───── DoAction 베이스 및 파생 클래스 ─────
class UCDoAction {
+DoAction()
+Begin_DoAction()
+End_DoAction()
+SendDamage(FHitData)
}
%% → 실제 공격을 실행하고 타격 충돌 후 데미지를 전달
class UCDoAction_Combo
class UCDoAction_Bow
class UCDoAction_Warp
UCDoAction <|-- UCDoAction_Combo
UCDoAction <|-- UCDoAction_Bow
UCDoAction <|-- UCDoAction_Warp
%% → 콤보/활/워프 공격 각각 별도의 실행 방식 구현
%% ───── SubAction 베이스 및 파생 클래스 ─────
class UCSubAction {
+Pressed()
+Released()
}
%% → 보조 입력(우클릭 등)에 대한 동작 정의 (ex. 활 차징 시작/해제)
class UCSubAction_Bow
UCSubAction <|-- UCSubAction_Bow
%% → 활 차징 중 시점 고정, 사운드 재생 등 담당
%% ───── 데미지 구조체 및 이벤트 ─────
class FHitData {
+PlayEffect()
+PlaySound()
+ApplyDamage()
+CameraShake()
+Launch()
}
%% → 피격 시 시각, 음향, 넉백 등 다양한 피드백을 통합적으로 보관
class FActionDamageEvent {
+FHitData Hit
+Owner
+Causer
+DamageAmount
}
%% → 실제 데미지를 전달할 때 사용하는 정보 묶음
%% ───── 체력 컴포넌트 ─────
class UCHealthPointComponent {
+TakeDamage(float)
+IsDead()
}
%% → 체력 계산 및 사망 여부 판단
%% ───── 관계 정리 ─────
ACPlayer --> UCWeaponComponent
UCWeaponComponent --> UCDoAction
UCWeaponComponent --> UCSubAction
UCDoAction --> ACEnemy
UCDoAction --> FHitData
FActionDamageEvent --> FHitData
ACEnemy --> UCHealthPointComponent
적 클래스
classDiagram
%% ───── Interface ─────
class IIStateable {
<<interface>>
+End_BackStep()
+End_Damaged()
+End_Dead()
}
%% ───── Base Enemy ─────
class ACEnemy {
+TakeDamage()
+Damaged()
+End_Damaged()
+End_Dead()
-HealthPoint : UCHealthPointComponent*
-Movement : UCMovementComponent*
-State : UCStateComponent*
}
ACEnemy ..|> IIStateable
%% ───── Enemy_AI ─────
class ACEnemy_AI {
+Tick()
+GetTeamID()
+GetBehaviorTree()
+GetPatrolPath()
-Weapon : UCWeaponComponent*
-Behavior : UCAIBehaviorComponent*
-LabelWidget : UWidgetComponent*
-CursorWidget : UWidgetComponent*
-TeamID : uint8
-BehaviorTree : UBehaviorTree*
-PatrolPath : ACPatrolPath*
}
ACEnemy_AI --|> ACEnemy
%% ───── AI Controller ─────
class ACAIController {
+OnPossess()
+OnUnPossess()
-Perception : UAIPerceptionComponent*
-Sight : UAISenseConfig_Sight*
-BehaviorComponent : UCAIBehaviorComponent*
-Enemy : ACEnemy_AI*
}
%% ───── 상태 컴포넌트 ─────
class UCStateComponent {
+SetIdleMode()
+SetDeadMode()
+SetDamagedMode()
+IsIdleMode()
+IsDeadMode()
+IsDamagedMode()
-Type : EStateType
-bInSubActionMode : bool
}
%% ───── 관계 정리 (핵심 구성 요소) ─────
ACEnemy --> UCHealthPointComponent
ACEnemy --> UCMovementComponent
ACEnemy --> UCStateComponent
ACEnemy_AI --> UCWeaponComponent
ACEnemy_AI --> UCAIBehaviorComponent
ACEnemy_AI --> UWidgetComponent : Label/Cursor
ACEnemy_AI --> UBehaviorTree
ACEnemy_AI --> ACPatrolPath
ACAIController --> UAIPerceptionComponent
ACAIController --> ACEnemy_AI