Stats and affixes

Fiber’s whole pitch is that your power comes from what you craft and wear, not from grinding levels. That only works if the stats underneath are solid. Over the last month I built the stat system, item affixes, crafting, and an equipment screen to see it all.

Five stats, three pools

Every entity, player or enemy, has five base stats. They all start at 5.

StatWhat it feeds
StrengthMax HP, physical damage, physical damage reduction
DexterityMax SP, crit chance, dodge
IntelligenceMax MP, spell damage, crit damage
WisdomSP regen, elemental resistance
LuckDrop rate, crit chance, crit damage

Those feed three resource pools. HP and MP only come back from items, rest and abilities. SP, stamina, refills on its own at a rate set by Wisdom, and it’s what your moves spend. Jumping and the basic attack both cost stamina, through a small action system that any entity can use.

Every derived stat is a formula in one file, so balancing means editing one place. Max HP is 50 + STR × 10, crit chance is DEX × 0.5 + LCK × 1 capped at 100%, and so on.

The first HP, SP and MP bars, with stamina going into jumps and attacks

Modifiers that don’t care about order

Gear and buffs change stats through modifiers, each with an additive and a multiplicative part. They’re grouped by where they came from, so equipping a sword adds one group and unequipping removes it in one call. The math is deliberately boring:

effective = (base + all additives) × (1 + all multipliers)

STR 10, sword +3, blessing +15%:
(10 + 3) × 1.15 = 14.95

Because everything is summed before it’s multiplied, the order you equip things in never changes the result. That rules out a whole class of bugs, and it means the stat screen can just ask for a number.

Items: what it dropped with, and what you add

Every item has two kinds of affixes.

Intrinsic affixes are rolled when the item drops and stay with it forever:

Crafted affixes go into slots that you control. An item starts with two slots and can be expanded to four with Weaver’s Thread. Anything you put in a slot can be swapped out later.

Every affix has a grade: Common, Uncommon, Rare, Epic or Legendary. Each grade’s value range starts at or above the previous grade’s ceiling, so upgrading an affix re-rolls it into a range that’s always better. Drops lean toward lower grades, and every intrinsic affix rolls its grade on its own, so one item can mix a Rare base stat with a Common random affix.

Item cards: grade-colored affixes, crafted slots and a stat comparison

Crafting with thread

Materials are all fiber: Barbed Thread for offensive affixes, Ember Silk for fire, Weaver’s Thread for slot expansion, and Raw Fiber for base stats. Each material comes in all five grades. Crafting or upgrading an affix costs one material per tag on the affix, at the grade you’re aiming for, so a Rare offensive fire affix costs a Rare Barbed Thread and a Rare Ember Silk. Mapping a tag to a material is content, not code, so adding a new material doesn’t need a programmer.

The crafting system has eight operations, including crafting, upgrading, rerolling, slotting, extracting and salvaging. Corruption is the gamble: it can reroll an item or grant it a boon, but a corrupted item can’t be crafted on again. Its random rolls are injected, so the tests can check every outcome deterministically.

The last piece this month was unbinding. You can pull a crafted affix out of an item for free and keep it in your inventory to slot somewhere else. Removing things used to be destructive, and making it free is meant to encourage experimenting.

Not every affix is a number. Effect affixes trigger on hit, on kill, on crit, when you take damage, when a resource crosses a threshold, or are always on. A registry hooks each one up to the combat and stat events when you equip the item and unhooks it when you take it off. Move speed and jump height are regular stats, so movement affixes get the same math as everything else.

Seeing it all

None of this is fun if you can’t see it. The inventory now has an equipment column, a stat summary that updates live as you equip, and an item card that pops up on hover. When you hover an item, its card compares against what you have equipped and highlights each stat that would go up in green or down in red. To have something to test with, a random drop spawner on the test map throws one of everything at you.

Equipping drops and watching the stat summary change

Next: the enemies. They can fight back now, but hits don’t feel like much yet.

← More posts