관리 메뉴

cyphen156

데이터셋 설계 기록용 본문

잡생각 정리글

데이터셋 설계 기록용

cyphen156 2025. 12. 27. 15:58

────────────────────────────────────────────────────────
[CDN / Asset Packs]
────────────────────────────────────────────────────────
Monsters Pack
 ├─ SkeletonSword (Prefab / Visual)
 ├─ Skeleton
 └─ Slime


────────────────────────────────────────────────────────
[PlacementDataset : StageData]
────────────────────────────────────────────────────────
PlacementEntry
{
    EntityKey   : 17584          // 도메인 오브젝트 ID
    VisualKey   : SkeletonSword  // 사용될 애셋(외형)
    
    Transform
    {
        Position : (x, y, z)
        Rotation : (x, y, z)
        Scale    : (3, 3, 3)
    }

    Weight      : 10             // 배치 가중치 / 확률
}


────────────────────────────────────────────────────────
[DB : Definition / Static Domain]
────────────────────────────────────────────────────────
DomainDefinition
{
    EntityKey : 17584

    Domain
    {
        Domain : 1
        Grade  : n
        Role   : 5
        Class  : 89
    }

    Stats
    {
        HP  : 100
        ATK : 4
        DEF : 6
    }

    DefaultVisualKey : SkeletonSword
    AllowedVisuals
    {
        SkeletonSword
        SkeletonSword_Event
    }
}

내가 뭘하고있는거지....

 

임시 플로우

정리는 지피티가 해놨음

0) 사전 산출물(누가 무엇을 만드나)

디자이너(에디터)

  • PlacementDataset(StageData) 생성
    • EntityKey
    • VisualKey(선택, 없으면 기본값 사용)
    • Transform

서버(또는 빌드/배포 데이터)

  • Definition(DB)
    • EntityKey -> DefaultVisualKey
    • AllowedVisuals
    • 스탯/밸런스 등
  • AssetIndex
    • VisualKey -> AddressablesKey

Addressables(빌드 산출물)

  • Addressables Catalog + Bundles
    • AddressablesKey -> Bundle/Deps/RemoteURL

1) 런타임 부팅 플로우(Manifest → ContentCatalog)

 
[Boot]
  ↓
[Load Manifest (Resources/persistent)]
  ↓
[Verify ManifestMeta → Outdated면 Manifest 본문 갱신]
  ↓
[For each catalog in manifest.catalogs]
    if requiredOnBoot == true
      ↓
    [Verify CatalogMeta → Outdated면 Catalog 본문 갱신]
      ↓
    [Load ContentCatalog (씬 스코프/팩 정책)]
  • 여기서 “Catalog”는 ContentCatalog(씬 스코프) 입니다.
  • Addressables의 catalog(로케이터)와는 별개 개념입니다.

2) 씬/챕터 진입 플로우(ContentCatalog → StageData)

 
[Enter Scene/Chapter]
  ↓
[Read ContentCatalog for this Scene]
  ↓
[Determine allowed packs / optional packs policy]
  ↓
[Load Stage list (Stage0_0, Stage0_1 ...)]
  ↓
[For each Stage]
  ↓
[Load PlacementDataset(StageData)]
  • ContentCatalog는 “이 씬에서 어떤 Stage들을 로드할지”와
  • “어떤 팩(옵션/이벤트)을 사용할지” 정책을 가집니다.

3) 배치 적용 플로우(StageData → 스폰)

각 Placement 엔트리(오브젝트 1개)마다:

 
[PlacementEntry]
  - EntityKey
  - VisualKey? (optional)
  - Transform
        ↓
(1) Resolve VisualKey
    if VisualKey exists in entry
        use it
    else
        VisualKey = DefinitionDB.GetDefaultVisual(EntityKey)
        ↓
(2) Validate policy (optional but 권장)
    if not DefinitionDB.IsAllowed(EntityKey, VisualKey)
        fail or fallback(Default)
        ↓
(3) Map to load key
    AddressablesKey = AssetIndex.GetAddressKey(VisualKey)
        ↓
(4) Load prefab
    prefab = Addressables.Load(AddressablesKey)
        ↓
(5) Spawn & Apply
    instance = Pool.GetOrCreate(prefab)
    instance.Transform = Placement.Transform

여기서 핵심:

  • StageData는 번들/URL을 절대 모릅니다.
  • StageData는 EntityKey/VisualKey/Transform만 줍니다.
  • VisualKey -> AddressablesKey 해석은 AssetIndex가 합니다.
  • 번들/의존성/다운로드는 Addressables가 합니다.

4) “Stage0의 Square를 Stage1의 Red_Triangle로 바꿔치기” 플로우

 
[Server changes PlacementDataset]
  Square VisualKey -> RedTriangle VisualKey
        ↓
[Client next load]
  ↓
StageData reads RedTriangle VisualKey
  ↓
AssetIndex maps -> AddressablesKey(RedTriangle)
  ↓
Addressables needs locator/pack not loaded?
    yes -> load Addressables catalog/pack (Stage1)
           download required bundles
  ↓
Load prefab and spawn
  • “Stage1 전체 다운로드”가 아니라
  • Stage1 팩 중 필요한 번들(및 의존성)만 다운로드됩니다.
  • 단, 팩을 한 덩어리로 빌드하면 체감상 전체처럼 보일 수 있습니다.