> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rpg-leveling.zuxaw.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mathematical Formulas

> Monster-level XP, level-difference multipliers, zones, and progression.

# Mathematical Formulas

In **0.2.0**, XP and progression use a **monster-level-based system** with **level-difference multipliers** and **zones**. This replaces the previous health-based XP formula.

***

## How the New System Works

Your XP gains depend on **two main factors**:

1. **Monster level** - Base XP scales with the monster's level (higher level = more base XP).
2. **Level difference** - How close the monster's level is to yours. Fighting monsters near your level gives the best XP; farming much easier or much harder content is heavily penalized.

***

## XP Gain from Mobs

### Base XP (Monster Level)

Base XP is determined by the **monster's level**:

```
Base XP ≈ MonsterLevel × √MonsterLevel   (conceptually; implementation may use level² scaling)
```

| Monster Level | Approx. Base XP |
| ------------- | --------------- |
| 1             | \~1             |
| 50            | \~353           |
| 81            | \~729           |
| 100           | \~1,000         |

Higher-level monsters give more base XP.

### Level Difference Multiplier

The **difference between your level and the monster's level** applies a multiplier:

| Your Level vs Monster Level | Multiplier   | Result                                  |
| --------------------------- | ------------ | --------------------------------------- |
| **Same level** (±0)         | **1.5×**     | **Best XP!**                            |
| **1–5 levels higher**       | 1.1× – 1.5×  | Great XP                                |
| **6–25 levels higher**      | 1.0×         | Normal XP                               |
| **26–30 levels higher**     | 0.5×         | Reduced (50% penalty)                   |
| **31–40 levels higher**     | 0.4×         | Low (60% penalty)                       |
| **41–50 levels higher**     | 0.3×         | Very low (70% penalty)                  |
| **51+ levels higher**       | 0.2×         | Minimal (80% penalty)                   |
| **1–5 levels lower**        | 1.4× – 1.0×  | Good XP                                 |
| **6–25 levels lower**       | 0.96× – 0.2× | Decreasing XP                           |
| **26+ levels lower**        | 0.1×         | Very low (90% penalty, trivial content) |

You can disable the **underleveled XP penalty** (rows where the monster is higher than you) via `EnableGapLevelXpReducer: false` in config - you will get full XP (1.0×) from higher-level monsters. See [Configuration](configuration) or [Difficulty Scaling](difficulty-scaling).

**Best strategy:** Fight monsters within **±25 levels** of your level. **Same-level** or **slightly higher** (±5) gives the highest bonuses.

### Final XP Formula

```
Final XP = Base XP(monster level) × Level Difference Multiplier × RateExp × ZoneRateExp
```

| Variable                        | Description                                                                                                                                                    |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Base XP**                     | From monster level (see table above)                                                                                                                           |
| **Level Difference Multiplier** | From your level vs monster level (see table)                                                                                                                   |
| **RateExp**                     | Global XP rate from RPGLevelingConfig (default 1.0; e.g. 2.0 = double XP)                                                                                      |
| **ZoneRateExp**                 | Per-zone XP multiplier from ZoneLevelConfig (default 1.0; e.g. 2.0 = double XP in that zone, 0.5 = half). Applied to mob kills and block break XP in the zone. |

**Example (Level 81 vs Level 81 monster, RateExp 3.0, ZoneRateExp 1.0):**\
Base 729 × 1.5 × 3.0 × 1.0 = **\~3,281 XP** per kill.

***

## Block break XP (mining / woodcutting)

XP is awarded when players break eligible blocks (ore/mineral/gem for mining; log/tree/trunk for woodcutting). The formula uses `BlockXPBaseMining` or `BlockXPBaseWood`, player level, zone level, `RateExp`, and `ZoneRateExp`. See [0.2.0 formulas - Block XP](0.2.0/formulas#block-xp-formula) for the full math.

**Exclusions:** In [RPGLevelingConfig.json](config-main#block-xp-blacklist), **`BlacklistedXPBlocks`** lists block type IDs that never grant break XP (case-insensitive exact match). Default: `Tw_Feed_Carnivore,Tw_Feed_Herbivore` (Animal Husbandry feed troughs). Set to `""` to allow XP from all eligible blocks. Use **`EnableBlockXP: false`** to disable all block-break XP.

***

## Crop harvest XP and Harvest stat

**Added in 0.3.9 (The Harvest Moon Update).**

### Crop harvest XP

XP is awarded when players harvest **mature crops** (F key / sickle on crop blocks and direct-harvest plants). Uses tier multipliers from [HarvestingConfig.json](config-harvesting):

```
harvestXP = BlockXPBaseHarvesting × HarvestTierNMultiplier × playerScale × zoneMultiplier × RateExp × ZoneRateExp × XpRateMultiplier
```

| Variable                   | Description                                                                          |
| -------------------------- | ------------------------------------------------------------------------------------ |
| **BlockXPBaseHarvesting**  | Base per harvest (default 2.0)                                                       |
| **HarvestTierNMultiplier** | Tier 1–4 multipliers (defaults 1.0 / 1.5 / 2.5 / 4.0)                                |
| **playerScale**            | `1 + (playerLevel - 1) × BlockXPPlayerLevelFactor` from main config                  |
| **zoneMultiplier**         | From zone level mid and `ZoneLevelFactor` (same style as block break)                |
| **XpRateMultiplier**       | From [XPCurveOverridesConfig.json](config-xp-curve-overrides) for the player's level |

Per-player **cooldown** (`HarvestXPCooldownSeconds`, default 45) limits XP from the same plant. See [Harvesting Config](config-harvesting) for blacklists and per-crop tier overrides.

### Harvest stat (yield procs)

Allocated **Harvest** points roll for bonus crop stacks on harvest (configured in [StatsLevelConfig.json](config-stats)):

```
doubleChance% = min(HarvestMaxDoubleChance, harvestPoints × HarvestDoubleChancePerPoint)
tripleChance% = min(HarvestMaxTripleChance, harvestPoints × HarvestTripleChancePerPoint)
```

Triple is only rolled when double does not proc. **Double** adds 1 extra stack; **triple** adds 2 extra stacks.

### Tame XP

When **`EnableTameXP`** is true in [RPGLevelingConfig.json](config-main#tame-xp), taming a creature awards:

```
tameXP = calculateXPFromKill(playerLevel, mobLevel, config) × TameXpMultiplier
```

Uses the same monster-level and level-gap math as kills. Role blacklist: **`BlacklistedTameEntityRoles`**.

***

## Zones and Monster Level Ranges

The world is divided into **zones** with different monster level ranges:

| Zone  | Name             | Monster Levels | Best For                |
| ----- | ---------------- | -------------- | ----------------------- |
| **1** | Emerald Grove    | 1 – 25         | Early game (Level 1–30) |
| **2** | Howling Sands    | 25 – 50        | Mid game (Level 20–55)  |
| **3** | Borea            | 50 – 75        | Late game (Level 45–80) |
| **4** | Devastated Lands | 75 – 100       | End game (Level 70–100) |
| **5** | Skylands         | 85 – 100       | Max level               |
| **6** | Poisonlands      | 90 – 100       | Ultimate challenge      |

### Monster Level Variation (±5)

Monsters in a zone have **±5 level variation** around their base. Same zone, same “type” of monster can be different levels (e.g. 30, 33, 37, 40). This adds variety and keeps combat less predictable.

***

## Zone Colors on the HUD

The HUD shows the **current zone** and its **color** based on how it fits your level:

| Color                     | Meaning                 | XP                        | Action                      |
| ------------------------- | ----------------------- | ------------------------- | --------------------------- |
| **White**                 | Too easy (−26+ levels)  | 10% (90% penalty)         | Move to a harder zone       |
| **Green**                 | Good match (±25 levels) | 100–150% (full + bonuses) | **Stay here**               |
| **Orange / Red / Purple** | Too hard (+26+ levels)  | 20–50% (50–80% penalty)   | Come back when higher level |

**Pro tip:** If the zone name is **green**, you're in the right place for the best XP.

***

## XP Required for Level

Total XP required to reach a level:

```
XP_required = LevelBaseXP × level^2.5 + LevelOffset   (level ≥ 2)
XP_required(1) = 0
```

The exponent **2.5** (not squared) gives a steeper curve: easier early levels, much harder at high levels.

| Variable        | Description                                                                                                                    |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **level**       | Target level                                                                                                                   |
| **LevelBaseXP** | Base for level formula (default 150.0 in config; examples below use 50.0)                                                      |
| **LevelOffset** | Added to total XP per level. Only affects **XP needed for 1→2**; for 2→3 and beyond it cancels out when taking the difference. |

**Examples (LevelBaseXP = 50.0, LevelOffset = 0.0):**

| Level | XP Required  |
| ----- | ------------ |
| 1     | 0 (starting) |
| 2     | 283          |
| 10    | 15,811       |
| 50    | 883,884      |
| 100   | 5,000,000    |

### Per-range XP-earned multipliers (XP curve overrides)

XP **earned** and **level-up cost** can be scaled per player-level range via [`XPCurveOverridesConfig.json`](config-xp-curve-overrides). `XpRateMultiplier` applies on top of `RateExp` / `ZoneRateExp`; `LevelCostMultiplier` scales XP needed for the next level (HUD, `/lvl info`). Levels outside any range use `1.0` for both. Example: `[{From: 80, To: 100, XpRateMultiplier: 3.0, LevelCostMultiplier: 0.5}]` triples XP earned and halves grind to level up at levels 80–100.

### XP Needed for Next Level

```
XP_needed = XP_required(level + 1) - XP_required(level)
```

***

## Progression and Monsters per Level

Approximate **monsters to kill per level** when fighting **same-level** monsters (RateExp 3.0, LevelBaseXP 150, default formulas). **"XP per level-up"** is the range for **one** level step in that band (e.g. 1→2 needs \~850 XP, 9→10 needs \~10,500 XP). Total XP to go 1→10 is much higher (\~47,400).

| Level Range | XP per level-up (min – max) | XP per Kill   | Monsters per level-up |
| ----------- | --------------------------- | ------------- | --------------------- |
| 1 → 10      | 849 – 10,984                | 4.5 – 122     | 189 – 90              |
| 20 → 30     | 34,809 – 60,089             | 403 – 703     | 86 – 85               |
| 50 → 60     | 134,566 – 172,496           | 1,591 – 2,039 | 85                    |
| 80 → 82     | 270,849 – 277,111           | 3,220 – 3,281 | 84                    |
| 90 → 100    | 326,656 – 372,192           | 3,845 – 4,433 | 85 – 84               |

**Total (1 → 100, same-level farming):** \~**9,000 – 12,000 monsters** (order of magnitude), depending on exact rates and level choices.

***

## Stat Points

Same as 0.1.9:

* **Stat points per level:** 5 (configurable)
* **Max level:** 100
* **Total at max:** (100 − 1) × 5 = **495** stat points

See [Configuration](configuration) for `StatPointsPerLevel`, `StatValuePerPoint`, and related options.

***

## Summary

| Topic          | 0.2.0 behavior                                    |
| -------------- | ------------------------------------------------- |
| **XP source**  | Monster **level** (not max health)                |
| **Multiplier** | **Level difference** (you vs monster)             |
| **Zones**      | 6 zones with level ranges; HUD shows zone + color |
| **Variation**  | ±5 monster level within a zone                    |
| **Best XP**    | Same-level or ±5 levels; **green** zones          |
| **Penalties**  | Too easy (white) or too hard (orange/red/purple)  |

For **difficulty scaling** (monster damage, HP, level-gap combat), see [Difficulty Scaling](difficulty-scaling).
