---
title: "ワールドスキーマ"
description: "Yumina のワールドファイル WorldDefinition の完全な JSON 構造をフィールドごとに。識別情報、エントリ、変数、ビヘイビア、インターフェース、オーディオ、設定。"
---

# ワールドスキーマ

Yuminaのワールドは `WorldDefinition` というJSONオブジェクトとして保存されます。これが完全なスキーマです。

## 最上位の構造

```json
{
  "id": "uuid",
  "version": "20.0.0",
  "name": "World Name",
  "description": "Short description",
  "author": "Creator Name",
  "language": "en",

  "entries": [],
  "variables": [],
  "rules": [],
  "reactions": [],

  "rootComponent": null,
  "components": [],
  "audioTracks": [],
  "bgmPlaylist": null,
  "conditionalBGM": [],
  "customUI": [],

  "entryFolders": [],
  "customTags": [],
  "customTagColors": {},
  "editorMode": "advanced",

  "settings": {
    "maxTokens": 12000,
    "maxContext": 200000,
    "temperature": 1.0,
    "topP": 1,
    "frequencyPenalty": 0,
    "presencePenalty": 0,
    "playerName": "Player",
    "lorebookScanDepth": 2,
    "lorebookRecursionDepth": 0
  }
}
```

## フィールドリファレンス

### アイデンティティ

| フィールド | タイプ | 説明 |
|-------|------|-------------|
| `id` | string | UUID、自動生成 |
| `version` | string | スキーマバージョン。現在は `"20.0.0"` |
| `name` | string | ワールド名(1〜200文字) |
| `description` | string | 短い説明(0〜10,000文字) |
| `author` | string | クリエイターの表示名 |
| `language` | string(任意) | BCP 47言語コード(`"en"`、`"zh"`、`"ja"`など)。TypeScriptインターフェースには存在するがZodスキーマでは任意 |

### コンテンツ

| フィールド | タイプ | 説明 |
|-------|------|-------------|
| `entries` | WorldEntry[] | AIが読むすべてのコンテンツ。キャラクター、ロア、ルール、挨拶 |
| `variables` | Variable[] | ビヘイビアルール付きのゲーム状態定義 |
| `rules` | Rule[] | WHEN/IF/THEN自動化トリガー |
| `reactions` | Reaction[](任意) | イベントパターンベースのルール(新しいシステム)。undefinedにできる |

### プレゼンテーション

| フィールド | タイプ | 説明 |
|-------|------|-------------|
| `rootComponent` | RootComponent \| null | カスタムUIの仮想ファイルシステム(React/TSX) |
| `components` | GameComponent[] | 組み込みUIコンポーネント(ステータスバーなど) |
| `audioTracks` | AudioTrack[] | BGM、SFX、アンビエントトラック |
| `bgmPlaylist` | BGMPlaylist \| null | 自動再生音楽の設定 |
| `conditionalBGM` | ConditionalBGM[] | 状態トリガーの音楽 |
| `customUI` | CustomUIComponent[] | 旧UIシステム(代わりにrootComponentを使う) |

### 組織化

| フィールド | タイプ | 説明 |
|-------|------|-------------|
| `entryFolders` | EntryFolder[] | エントリ整理用のフォルダ構造 |
| `customTags` | string[] | クリエイター定義のエントリ用タグ |
| `customTagColors` | Record\<string, string\> | カスタムタグ用のTailwindカラークラス |
| `editorMode` | `"simple"` \| `"advanced"` | エディタの複雑度レベル |

### Settings

| フィールド | タイプ | デフォルト | 説明 |
|-------|------|---------|-------------|
| `maxTokens` | number | 12000 | AI応答あたりの最大トークン |
| `maxContext` | number | 200000 | 最大コンテキストウィンドウサイズ |
| `temperature` | number | 1.0 | AIの創造性(0.0〜2.0) |
| `topP` | number | 1 | Nucleusサンプリングしきい値 |
| `frequencyPenalty` | number | 0 | 繰り返しトークンへのペナルティ |
| `presencePenalty` | number | 0 | 既出トークンへのペナルティ |
| `playerName` | string | "Player" | デフォルトの <code v-pre>{{user}}</code> 置換 |
| `lorebookScanDepth` | number | 2 | キーワードをスキャンする直近ターン数 |
| `lorebookRecursionDepth` | number | 0 | トリガーされたエントリがエントリをトリガーする深さ |
| `topK` | integer(任意) | — | 候補トークン数を制限(min: 0) |
| `minP` | float(任意) | — | 最小確率しきい値(0〜1) |
| `structuredOutput` | boolean(任意) | false | JSON出力形式を強制 |
| ~~`lorebookBudgetPercent`~~ | ~~number~~ | — | **非推奨** — トークン予算は削除済み。すべてのトリガーされたエントリが含まれます |
| ~~`lorebookBudgetCap`~~ | ~~integer~~ | — | **非推奨** — 上記参照 |
| ~~`layoutMode`~~ | ~~string~~ | — | **非推奨** — レイアウトは自動。フィールドは無視されます |
| ~~`uiMode`~~ | ~~string~~ | — | **非推奨** — レイアウトは自動。フィールドは無視されます |
