---
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 and the skills). Its models, animations and textures, Anima included, are CC BY 4.0: free to use with attribution to Jimmy Lee (j@internet.dev). 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.17.5"
  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 800 KB, 13,000 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 6-factor probability and `−log10` score; §1.1 the quality table |
| §2 Grades | Material-only grading (`set-world-0-17-5-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`, fresh draws from the cryptographic source, 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, §13.60, §13.62 | Launch families, flight, reload, range and the 30-unit ceiling; §13.60 bows aim along the launch tangent; §13.62 the archer's draw |
| §13.9 to §13.17, §13.49 to §13.51 | Whips, slings, whirl delivery, flexible assemblies, returning throws, harpoons, tethers and doubled lashes; §13.11 and §13.12 the performance scene's generated equipment and rendering work; §13.14 shield geometry and animation review coverage |
| §13.18 to §13.21, §13.31 | Teams, locomotion, moving attacks, fixed aim points, living bodies that block locomotion |
| §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 (`set-world-0-17-5-anima-scaling-7`) |
| §13.35 to §13.48, §13.55 to §13.57 | Held-item models, grips, shields and handles; §13.36 the half-strength knockback; §13.46 the shared concrete floor |
| §13.47 | Model weight and the armed hit; the item analysis (`/anima-analysis`) reads every held item from these helpers |
| §13.52 to §13.54, §13.58, §13.59, §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 (`set-world-0-17-5-weapon-reach-3`) |
| §13.70 | AnimaSystem: material rating, protection, ward, weight, stamina recovery, with the full material tables (`set-world-0-17-5-anima-system-16`) |
| §13.71 | The range pause and the fair line; heavy shots (`set-world-0-17-5-anima-system-16`) |
| §13.72 | Magic: Flick, Repulse, Gaze, rings, songs, the rupture waves and resistance (`set-world-0-17-5-magic-11`) |
| §13.73 | Shield block (`set-world-0-17-5-shield-block-2`) and the heavy-weapon block (`set-world-0-17-5-heavy-block-1`) |
| §13.74 | Practice statues: the timber targets of the weapon field and `/anima-object-models`' Group, and their damage numbers |
| §13.75 | The drill and the wrench (`set-world-0-17-5-drill-1`) |
| §13.76 | The `/anima-stratagem` duel (`set-world-0-17-5-anima-stratagem-2`) and the `/anima-battle` battle (`set-world-0-17-5-anima-battle-5`) |
| §13.77 | Stratagems: conditions, acts, the reading and the default (`set-world-0-17-5-stratagem-play-16`) |
| §13.78 to §13.80 | The goedendag, pitchfork, rake, kite shield, flail and war horn; the Anchor and its tether; the Scroll |
| §13.81 | Glance: worn armor turns physical and magic hits aside (`set-world-0-17-5-glance-1`) |
| §13.82 | Precise: a sword's chained backhand (`set-world-0-17-5-precise-1`) |
| §13.83 | Pierce: defense bypass and chance-based chaining along a spatial attack path (`set-world-0-17-5-pierce-2`) |
| §13.84 | Crush: a heavy blunt blow that flattens the target where it stands (`set-world-0-17-5-crush-5`) |
| §13.85 | Disarm: a hooked short blade knocks the offhand item away (`set-world-0-17-5-disarm-2`) |
| §13.86 | Break: a breaking tool breaks a worn piece or the offhand for the fight (`set-world-0-17-5-break-2`) |
| §13.87 | Stick: a sticking pole holds its target, offhand only, until either is hit (`set-world-0-17-5-stick-1`) |
| §13.88 | The `/anima-battle-effects` field: one attacker and one practice Anima per battle effect (the scene outcomes, THORNS! and CLEANSE! among them, and every status effect), paired so each strikes only its own, in rounds of one strike (`set-world-0-17-5-practice-round-11`); each scene outcome made certain with an item that causes it and each buff given from the start (`set-world-0-17-5-anima-battle-effects-15`) |
| §13.89 | Status effects: the 49 the scenes play, their ticks, anchored and strengthened numbers, caps, speeds and damage, control and sides, Petrified's shatter, the surprise strike, the phased pass and the resisted effect, and their flames, particles, ice, stone, veil, mirror images, rainbow skin, smoke cloud and wrapped chains (`set-world-0-17-5-status-effects-14`) |
| §13.90 | Item attributes (`set-world-0-17-5-item-attributes-10`): every prefix, suffix and status effect priced by item quality, the stat exchange rate from level 1 to 99 and the giant-slayer stat pool, status prices by how much of a fight one landing is worth, how quality strengthens an effect and the anchored status numbers, the effect contest and the two-part hit, and what the scenes and the dungeon apply ([Item attributes](https://set.world/skills/anima-item-attributes)) |
| §13.91 | Striking at an elevation (`set-world-0-17-5-strike-aim-1`): every reach counts the height between two Animas, swings and punches turn toward a target above or below, and floor-bound actions reach only their band |
| §13.92 | The Tome's conjured fireballs: 2 per cast, the orbit, the release thresholds, the slow volley, each fireball's dome, the loss and cooldown (`set-world-0-17-5-conjure-3`) |
| §14 | Dungeon mode (`set-world-0-17-5-dungeon-mode-3`) and the dungeon (`set-world-0-17-5-dungeon-initiative-4`): rounds, initiative order, each fighter's timeline and attack budget, adjacency, and the scene rules it adapts |
| §15 | Anima: coordinates, geometry, rig, skin weights, IK, every motion, ragdoll, surface, eyes, camera, clip export and the tattoo |

## Part three: techniques (§16)

Rendering and interface techniques: Bayer dithering, the liquid-metal buttons, the craft stone, still portraits, the dungeon's shading, interface input and layout, the job orchestration every loader runs through (stalls, shared keys, priorities, concurrency slots, barriers; `set-world-0-17-5-orchestrator-3`), the player exploration controller (§16.10: fixed steps, collision, the basin floor, jumping, render interpolation, the entrance darkness and respawn, the volumetric fog march, and the pool's ripples and water), the Keeper's duel and build (§16.11: reaches, the Keeper's rise, its walk of the default stratagem, stamina, hits, the swing ceiling and defeat, and how its words are chosen), 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, `set-world-0-17-5-lottery-5`" or "§13.70, `set-world-0-17-5-anima-system-16`". 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, its pages and asset licenses |
| Simulation | `https://set.world/simulation` | The research studies, what the evidence establishes and what it does not |

## 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.
