---
name: set-algorithms
description: A map of Set's full math reference at https://set.world/algorithms. Use when a task needs the exact derivation behind a Set number or rule and you want to read only the right section, such as rarity, grades, crafting odds, salvage, trait hashing, seeds and contentVersion, drops, attributes, the combat fallback, or the weapon, armor, dungeon and Anima rules of Set's own game layer.
license: Free to use when obtained from set.world, commercially too (the API, what it returns, the skills and downloaded models). The source code of Set is © Jimmy Lee under CC BY-NC 4.0 and its commercial use needs a paid waiver.
metadata:
  version: "0.8.10"
  title: Algorithms
---

# Algorithms

`https://set.world/algorithms` is Set's math contract: every formula and rule needed to recompute a Set number or re-implement a behaviour in another engine. It is one long Markdown document (about 260 KB, 4,700 lines). Do not load it whole unless you must. Fetch it once, then read the section you need by its heading; the section numbers below are stable and are what every other skill cites.

```sh
curl -s https://set.world/algorithms -o algorithms.md
grep -n '^## \|^### ' algorithms.md          # the section map with line numbers
```

Most tasks never need it: the shorter skills carry the working formulas ([Calculations](https://set.world/skills/calculations), [Crafting an item](https://set.world/skills/crafting-an-item), [Derived stats](https://set.world/skills/anima-derived-stats), [Derived combat](https://set.world/skills/anima-derived-combat)).

## Part one: the API (§1 to §12)

These sections are the product's math. A change here moves `contentVersion`.

| Section | Read it for |
| --- | --- |
| §1 Unified rarity score | The six-factor probability and `−log10` score; §1.1 the quality table |
| §2 Grades | Material-only grading (`material-grades-3`), every material's grade, exact shares per roll |
| §3 Orbs | §3.1 guarantee and lottery crafts with exact odds tables; §3.2 stat boost prices; §3.3 salvage and the sink proof |
| §4 Trait stat modifiers | The pinned FNV-1a hash, tiers, magnitudes, application; §4.4 the optional equipment bonus |
| §5 Verification | What must be re-recorded when weights change |
| §6 Why this design | The intent behind the economy; §6.1 weighted draws, `mulberry32`, `deriveSeed`, the forge and the content fingerprint |
| §7 Comparing boost and craft prices | A price table across both curves |
| §8 Monster drops | The drop formula, encounter classes and overrides |
| §9 Derived attributes | The 23 attributes and the power rating |
| §10 Levels and item power | Why Set has no level curve; item power budgets and theme channels |
| §11 API surface | Which endpoint serves which section |
| §12 Basic lightweight combat | The optional, experimental fallback: one attack, initiative windows, replay |

## Part two: the local game layer (§13 to §15)

These sections describe AnimaSystem, Set's own browser game on top of the API. They never change an API response, a birth or `contentVersion`.

| Section | Read it for |
| --- | --- |
| §13.1 to §13.3 | Weapon mass from geometry, the punch baseline, stamina cost, clocks |
| §13.4 to §13.8, §13.32 to §13.34 | Launch families, flight, reload, range and the 30-unit ceiling |
| §13.9 to §13.17, §13.49 to §13.51 | Whips, slings, returning throws, harpoons, tethers |
| §13.18 to §13.21, §13.31 | Teams, locomotion, moving attacks, fixed aim points, blocking |
| §13.22 | Tempo and practice targets |
| §13.23 to §13.27 | Item Orb and WorldSphere, Repulse, gunfire, the Hand cannon |
| §13.28 | The embedded army battle |
| §13.29 | The mathematical review and its limits |
| §13.30 | Level and orb scaling (`anima-scaling-5`) |
| §13.35 to §13.48, §13.55 to §13.57 | Held-item models, grips, shields and handles |
| §13.47 | Model weight and stamina-priced damage |
| §13.52 to §13.54, §13.58 to §13.61, §13.66, §13.68 | Worn armor: cloth, plates, hands, fingers, neck, head, capes, layering |
| §13.63 | Item materials and their looks |
| §13.64 | Trait colours |
| §13.65 | Whole-number damage, health and stamina |
| §13.67 | Crowd performance rules |
| §13.69 | Reach: tempo and windup |
| §13.70 | AnimaSystem: material rating, protection, ward, weight, stamina recovery, with the full material tables |
| §13.71 | The range pause and the fair line; heavy shots |
| §13.72 | Magic: Flick, Repulse, Gaze, rings, Rupture and resistance |
| §14 | The initiative dungeon (`dungeon-initiative-1`) |
| §15 | Anima: coordinates, geometry, rig, skin weights, IK, every motion, ragdoll, surface, eyes, camera and clip export |

## Part three: techniques (§16)

Rendering and interface techniques: Bayer dithering, the liquid-metal buttons, header flames, the craft stone, still portraits, the dungeon's shading, and an index of every technique with its source file.

## How to cite it

Refer to a rule by its section number and version stamp, for example "§3.1.2, `lottery-3`" or "§13.70, `anima-system-10`". A stamp names the current rule; when the stamp changes, the numbers in this document and in the skills change with it.

## Companion documents

| Document | URL | Content |
| --- | --- | --- |
| Readme | `https://set.world/readme` | What Set is, how to run it, every endpoint in one table |
| Simulation | `https://set.world/simulation` | The research studies, what the evidence establishes and what it does not |
| Gameplay math review data | `https://set.world/gameplay-math-review.json` | A recorded CPU review of the weapon math at earlier rule versions |
| Scene scaling data | `https://set.world/api/guides/scene-scaling-data` | Recorded scaling checks at an earlier profile |

The two data files predate the current lottery, grading and AnimaSystem; read them as history, not as current values.

## Evidence limits

The formulas are exact arithmetic over the tables. They do not establish frame rates, visual acceptance, competitive balance or that every battle ends. Sampled tables are labelled as samples and kept apart from exact ones.
