# Game Instance

<figure><img src="https://215355839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc8AVbPtcUOjcVrQx9Eyu%2Fuploads%2Fh6QWc6qXWgEk9ShFZL5d%2FGameInstance.png?alt=media&#x26;token=26d4752b-492b-481f-a7b2-9d2bed8a089a" alt=""><figcaption></figcaption></figure>

### 1. Core Game Data (Scriptables)

| Field                       | Type                  | Purpose                                                           |
| --------------------------- | --------------------- | ----------------------------------------------------------------- |
| **Currency Data**           | `CurrencyData[]`      | Defines every currency (ID, icon, rarity, max amount).            |
| **Character Data**          | `CharacterData[]`     | Stats, visuals, skills, unlock costs for all playable characters. |
| **Icon Items**              | `IconItem[]`          | Player profile icons.                                             |
| **Frame Items**             | `FrameItem[]`         | Avatar frames for profiles and leaderboards.                      |
| **Inventory Items**         | `InventoryItem[]`     | Equippable items that modify character stats.                     |
| **Character Types**         | `CharacterTypeData[]` | Elements / classes with advantage / weakness relationships.       |
| **Map Info Data**           | `MapInfoData[]`       | Metadata for maps (scene name, theme, rewards).                   |
| **Quest Data**              | `QuestItem[]`         | Daily / weekly / story quests: objectives and rewards.            |
| **Coupon Data**             | `CouponItem[]`        | Redeemable promo codes.                                           |
| **Shop Data**               | `ShopItem[]`          | Items & bundles sold in the in‑game shop (IAP or soft currency).  |
| **Battle Pass Data**        | `BattlePassItem[]`    | Tier rewards for the current season.                              |
| **New Player Reward Items** | `RewardItem[]`        | One‑time starter pack for brand‑new accounts.                     |
| **Daily Reward Items**      | `RewardItem[]`        | Login streak rewards.                                             |

***

### 2. PvP Configuration

| Field         | Type            | Notes                                                                                                                                                              |
| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Pvp Modes** | `PvpModeData[]` | References to `Arena1x1`, `Arena2x2`, `Arena3x3`, `TdmBattle`, `BattleRoyaleModeData`. Each asset contains time limit, score target, team size, map rotation, etc. |

***

### 3. Authentication Settings

| Setting                       | Description                                                |
| ----------------------------- | ---------------------------------------------------------- |
| **Min / Max Password Length** | Hard limits enforced on account creation.                  |
| **Complexity Flags**          | Booleans for uppercase, lowercase, numbers, special chars. |

#### Name Change Settings

| Setting                | Default | Description                               |
| ---------------------- | ------- | ----------------------------------------- |
| **Ticket Currency ID** | `TKN`   | Currency consumed when changing nickname. |
| **Min / Max Length**   | 3 / 20  | Allowed character count.                  |
| **Tickets Required**   | 1       | Amount of tickets charged per rename.     |
| **Need Ticket?**       | ☑       | Toggle free vs. paid rename.              |

***

### 4. Battle Pass Settings

| Setting                             | Value | Meaning                                         |
| ----------------------------------- | ----- | ----------------------------------------------- |
| **Max Level**                       | 100   | Highest tier obtainable.                        |
| **Base EXP**                        | 1 000 | XP required for tier 1.                         |
| **EXP Increase / Level**            | 0.1   | 10 % additional XP per next tier.               |
| **Season Length (Days)**            | 30    | Season duration.                                |
| **Pass Currency ID**                | `DM`  | Currency used to purchase premium track.        |
| **Pass Price**                      | 1 000 | Cost of premium pass.                           |
| **BattlePass EXP Reward in Battle** | 210   | Extra XP awarded on match victory.              |
| **BattlePass duration in days**     | 60    | Grace period to claim rewards after season end. |

***

### 5. Account Levels

The template supports global account experience separate from character mastery.

| Setting                 | Default      | Description                                                                               |
| ----------------------- | ------------ | ----------------------------------------------------------------------------------------- |
| **Max Level**           | 50           |                                                                                           |
| **Initial / Final Exp** | 100 → 10 000 | Range for the EXP curve.                                                                  |
| **Progression Method**  | Exponential  | Curve used to auto‑fill the `Account EXP Per Level` array (button provided in Inspector). |

***

### 6. Gameplay Defaults

| Setting                          | Purpose                                                 |
| -------------------------------- | ------------------------------------------------------- |
| **Map Name MainMenu**            | Scene shown on first load.                              |
| **Scene to return after Battle** | Where the game returns post‑match (default: `Home`).    |
| **Currency Reward in Battle**    | Soft currency ID granted for completing a match (`GO`). |

***

### 7. Elemental Combat Modifiers

| Variable                      | Default | Description                                       |
| ----------------------------- | ------- | ------------------------------------------------- |
| **Advantage Damage Increase** | 0.4     | +40 % damage when attacker has element advantage. |
| **Weakness Damage Reduction** | 0.4     | −40 % damage when attacker is weak.               |

***

### 8. Character Mastery

| Setting                 | Default                   | Description                                                             |
| ----------------------- | ------------------------- | ----------------------------------------------------------------------- |
| **Max Level**           | 20                        |                                                                         |
| **Initial / Final Exp** | 20 → 1 000                |                                                                         |
| **Progression Method**  | Linear                    | Used for per‑character mastery progression. Auto‑fill button available. |
| **Mastery Levels**      | `CharacterMasteryLevel[]` | Optional array with custom names / icons per tier.                      |

***

### 9. Platform & Prefab References

| Field                    | Description                                                                       |
| ------------------------ | --------------------------------------------------------------------------------- |
| **Controller Reference** | Drag your `CharacterEntity` prefab/script here so `GameplayManager` can spawn it. |
| **Platform Type**        | `PC` or `Mobile` – switches default control scheme.                               |
| **World Type**           | `World 3D` or future `World 2D`.                                                  |
| **Mobile Gameplay UI**   | Prefab for on‑screen joystick / buttons.                                          |
| **Desktop Gameplay UI**  | Prefab with keyboard / mouse hints.                                               |

***

#### Best Practices

* Always add new currencies or items here **before** referencing them in other scriptable objects.
* Keep `GameInstance` on a bootstrap scene object tagged **DontDestroyOnLoad**; destroying it will break cross‑scene references.
* After editing shop or reward data, remember to export JSON again if you use the WebSocket backend.

***

Need additional fields explained? Ping us on Discord: <https://discord.com/invite/EGGj77g3eQ>
