---
name: set-crafting
title: Set World Crafting Guide
description: A guide for game developers and agents on how to use the Set World crafting and economy APIs. Covers the orb currency, rejection-sampling to target tiers, best-of-N lotteries, monster drops, and how to compose these into a progression loop for your game.
homepage: https://set.world
spec: https://set.world/api/spec
license: MIT
version: 1
methods: [GET]
auth: none
cors: open
content_type: application/json
canonical_paths:
  - https://set.world/craft-guide
  - https://set.world/craft-guide.md
  - https://set.world/api/craft-guide
---

# Set World Crafting Guide

This guide teaches you how to use the Set World crafting and economy APIs to build item progression into your game. The economy is denominated in a single currency, orbs, and every cost is deterministic and verifiable.

## A Note for Builders

Let it be understood that every orb cost and every crafting formula herein is guidance and not mandate. The act of crafting an item, spending orbs, or pricing a fight belongs to the game developer on their own server. We provide the reference formulas and the APIs that compute them, but you are free to multiply, divide, ignore, or invent entirely new use cases from these primitives. Build what your creativity demands.

## The Orb Economy

Orbs are the universal currency. Players earn them from monster drops and spend them on crafting. The cost curve is exponential, creating a natural progression wall that rewards sustained play without hard-gating content.

| System | Formula | Range |
| --- | --- | --- |
| Crafting | `5^(tier - 1)` | 1 / 5 / 25 / 125 / 625 / 3,125 / 15,625 |
| Monster drops | `round((avgStat - 6)^2 / 4) × classMultiplier × variance` | Scales with enemy strength |

## Crafting: Two Modes

### Mode 1: Rejection-sample to a target grade

Pay a fixed orb cost, receive an item guaranteed to be at or above the target material grade. The server rolls until the material hits the requested tier or the budget runs out.

```sh
# Check the price
curl 'https://set.world/api/craft/cost?tier=5'
# Response: { tier: 5, orbs: 625, defaultBudget: 62500 }

# Craft a Grade B item
curl 'https://set.world/api/craft?tier=5'
# Response: { mode: "tier", item: {...}, tier: 5, tierGrade: "B", tierName: "Grade B", material: {...}, attempts: 42, capped: false }
```

**Key fields:**
- `tier=1..7` maps to Grade F through Grade S
- `capped: true` means the budget ran out before hitting the target (expected at Grade S with current weights)
- `seed=N` makes the result reproducible — same seed always produces the same item

**Cost table:**

| Grade | Tier | Orb Cost | Budget (max attempts) |
| --- | --- | --- | --- |
| F | 1 | 1 | 100 |
| E | 2 | 5 | 500 |
| D | 3 | 25 | 2,500 |
| C | 4 | 125 | 12,500 |
| B | 5 | 625 | 62,500 |
| A | 6 | 3,125 | 312,500 |
| S | 7 | 15,625 | 1,000,000 |

### Mode 2: Best-of-N lottery

Spend N orbs, roll N items, keep the best one. No grade guarantee — you get the highest-tier item that luck provides.

```sh
# Spend 125 orbs on a lottery
curl 'https://set.world/api/craft?orbs=125'
# Response: { mode: "orbs", item: {...}, tier: 5, tierGrade: "B", rolls: 125, rollsExpected: { medianTier: 5, medianScore: 10.88, ... } }
```

**Expected outcomes (measured medians):**

| Orbs spent | Median tier | Median score |
| --- | --- | --- |
| 1 | 3 (Grade D) | 6.57 |
| 5 | 4 (Grade C) | 8.29 |
| 25 | 5 (Grade B) | 10.28 |
| 125 | 5 (Grade B) | 10.88 |
| 625 | 6 (Grade A) | 11.37 |
| 3,125 | 6 (Grade A) | 11.95 |
| 15,625 | 6 (Grade A) | 12.39 |

The `rollsExpected` field in the response gives percentile bands so your UI can show players whether they got lucky or unlucky.

## Monster Drops (Earning Orbs)

Monsters drop orbs based on their average stat and encounter class. This is how players fund crafting.

```sh
# Check encounter classes and multipliers
curl 'https://set.world/api/drop/classes'
# Response: { classes: [{name: "trash", multiplier: 1}, {name: "veteran", multiplier: 3}, ...] }

# Price a kill
curl 'https://set.world/api/drop?stats=12-14-10-11-13-16-12-14-11&class=elite'
# Response: { avgStat: 12.556, baseDrop: 11, classMultiplier: 10, rolledVariance: 1.0234, orbs: 112, ... }
```

**Encounter classes:**

| Class | Multiplier | Use for |
| --- | --- | --- |
| trash | 1x | Fodder mobs, abundant |
| veteran | 3x | Mini-bosses, rare spawns |
| elite | 10x | Dungeon guardians, named enemies |
| boss | 50x | End-of-zone bosses |
| world-boss | 250x | Server-wide events, raid targets |

**Optional overrides** (passed as URL-encoded JSON in the `override` query param):
- `flat`: fixed orb amount (bypasses formula)
- `multiplier`: additional multiplier on top of class
- `guaranteedTier`: minimum tier of dropped item
- `bonusOrbs`: `{ min, max }` range of extra orbs added

## Building a Progression Loop

Here's how to compose these APIs into a complete gameplay loop:

### 1. Generate a starting character

```sh
curl https://set.world/api/roll/character
```

The character arrives with random equipment (mostly Grade F-D) and base stats (8-24).

### 2. Fight monsters to earn orbs

Use the character's `modifiedStats` to determine what tier of enemy they can handle. Price fights with `/api/drop`.

### 3. Spend orbs on crafting

Target a specific grade for a specific slot. Replace the worst item first for the highest orb-value gain. As equipment improves, the character's derived attributes rise with it.

### 4. Scale enemy difficulty

As the character's average stat rises, `baseDrop` increases quadratically. Move from trash to veteran to elite encounters. The orb income curve naturally matches the exponential craft costs.

### 5. End-game

- Grade S items require 15,625 orbs and may cap (not guaranteed)
- These walls create aspirational goals without hard gates

## Calculating Derived Stats

Every character has 9 base stats, but combat and movement are governed by 23 derived attributes computed from the 5 primary stats (strength, dexterity, agility, intelligence, vitality). Use these endpoints to calculate and inspect them.

```sh
# Derive all 23 attributes from a stat array
curl 'https://set.world/api/attributes?stats=14-12-10-11-13-16-12-14-11'

# See the full formula table (base, coefficients, which stats feed each attribute)
curl 'https://set.world/api/attributes/spec'

# Confirm canonical stat order and bounds before calling
curl 'https://set.world/api/stats'
```

The formula for each attribute is `base + primaryCoef × (primary - 8) + secondaryCoef × (secondary - 8)`. The spec endpoint returns every coefficient so your client can recompute attributes locally without calling the API on every stat change.

## Status Effects

The world provides 39 status effects that items and combat may inflict. Each effect carries a prose description of its mechanical consequence. Use these as your combat status system, buff and debuff layer, or item enchantment pool.

```sh
# Get all status effects
curl 'https://set.world/api/effects'
```

Effects include conditions such as Burn, Poison, Bleed, Frozen, Charmed, Silenced, Haste, Berserk, Invisible, and many others. Each entry has a `name` and `description` written in the voice of the world. The mechanical interpretation belongs to you as the game developer. Apply them as damage-over-time, crowd control, buffs, debuffs, or any system your game requires.

## Reproducibility

Pass `seed=N` to `/api/craft` or `/api/drop` for deterministic results. Same seed, same item. Use this for:
- Tournament fairness (all players get the same rolls)
- Replay systems (store seeds instead of full item data)
- Testing (pin outcomes in your test suite)

## Item Scoring

Every crafted item comes back with a full envelope you can display:

```json
{
  "item": { "name": "...", "slot": "tool", "indexes": [...] },
  "score": 10.28,
  "tier": 5,
  "tierGrade": "B",
  "tierName": "Grade B",
  "material": { "name": "obsidian", "grade": 17, "tier": 5, "tierGrade": "B", "tierName": "Grade B" }
}
```

To re-score any item later (e.g., from a stored index vector):

```sh
curl 'https://set.world/api/rarity?indexes=0-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18'
```

## Source

Full source and architecture: <https://github.com/jimmylee/set>. MIT licensed.
