All posts

No Shared Loot

Companions carried the same weapon forever, and everything the party earned went to the player

5 min read
game-systems
companions
economy
architecture
Comic: the knight shows off a new sword while the barbarian admits he has carried the same axe since the adventure started, then the party physically restrains the knight from claiming an entire treasure chest for himself.
Comic: the knight shows off a new sword while the barbarian admits he has carried the same axe since the adventure started, then the party physically restrains the knight from claiming an entire treasure chest for himself.

Twenty hours into a campaign, my character had upgraded weapons three times, swapped armor twice, and was carrying a bag of magic items. Finnick, who had been in the party since hour one, was still attacking with the same generic shortsword he spawned with. So was every other rogue in the game, because they were all the same shortsword.

Companion combat stats came from a hardcoded table keyed on class. Rogue meant shortsword, one d6, armor class 14. Fighter meant longsword and armor class 16. A companion's gear could not change because there was no gear — the table was consulted fresh every fight, and nothing a companion owned was ever read by combat.

That made loot a single-player system in a party game. A beautiful longbow drops and your ranger companion cannot use it, because her attacks come from a table lookup that has never heard of it. The chest in the comic is only funny because it is accurate: the player takes everything, and the party carries the same equipment from level one to the end.

The Purse That Reset Every Turn

While mapping the fix, I found something worse. Companions have their own gold and can buy things at merchants on their own initiative — a system that shipped earlier and had passing tests. In a live game, none of those purchases survived.

The game engine is rebuilt from scratch on every request. Companion purses lived inside a manager object that was rebuilt along with it, re-initialized to twenty-five gold and an empty pack each time. The function that was supposed to serialize purses into the save had zero callers. Finnick would buy lockpicks, the narration would describe him pocketing them, the gold would be deducted. One turn later the engine would rebuild, and the lockpicks and the deduction were gone.

The tests were green because every test exercised a single request. The bug only exists between requests, in the gap the test harness never crosses. State that is not written to the save does not exist, no matter how correct the code that computes it is.

Inventory as Real State

The rebuild moves companion inventory onto the save itself. Each companion has a persistent ledger: gold, a pack of items with real stats, and equipment slots for weapons, armor, and shield. Everything that touches companion belongings — purchases, sales, gifts, loot — reads and writes that ledger, so it rides the same save path as the player's own inventory.

Combat now derives companion stats from what they actually have equipped. The weapon's dice, the attack bonus from their ability scores, the armor class from what they wear under proper fifth-edition rules. The old class table survives as a fallback for saves that predate the system, so nothing breaks, but the moment a companion equips something better, their numbers change.

Upgrades equip automatically under a strict rule: the new item must be measurably better than the current one. Ties never displace anything, which matters more than it sounds, because of what came next.

Nick and Knack

Once companions could own things, the things could carry story. Finnick's profile always said he names his daggers; the daggers now exist. Nick rides his main hand and Knack his off hand, a matched pair with a notch in one blade he refuses to have repaired. Every companion got a loadout authored from their backstory the same way — Seraphine's watch-issue longsword has a notch filed into the crossguard for every life she has saved since resigning, and Grimjaw's greataxe is the last object that survived the night his clan burned.

The strict-upgrade rule protects these. A generic dagger from a market stall is exactly as good as Nick on paper, and it will never replace him, because equal is not better.

Named items also picked a fight with an older system. The anti-slop filter hunts hallucinated NPC names in the narration and replaces them from approved name pools. A test run turned "Star-chart Medallion" into "Star-chart Adela" — the filter saw a capitalized word it did not recognize and assumed the narrator had invented a person. The fix feeds every item name that mechanically exists in a companion's ledger into the filter's allowlist at runtime. An item the game state can prove is real is never slop, and that rule covers item names that have not been invented yet.

Buying, Selling, and the Chest

Companions can now sell as well as buy, and the player can hand any item to a companion by saying so. All of it runs through the same contract as the rest of the game: the narrator emits a small tagged signal when a transaction completes, and code validates it before anything changes. A companion cannot sell an item they do not own, and a merchant's narrated price gets clamped into the range the economy system allows, so a hallucinated windfall never pays out.

Loot gold now splits evenly across the party, with a plain ledger line so you can see it happen. Items still go to the player to hand out — but a companion who sees a longbow in the pile will say something about it. They just will not grab it. The knight in the comic gets restrained by his party; in the game, the party is polite and the restraint is code.

What Is Not Done

Knack is honest in the narration and cosmetic in the math: dual wielding grants no off-hand bonus attack yet, because the companion action economy has no slot for one. Companions also cannot hand items back to the player, and nothing limits how much a companion can carry. All three are logged and none of them undo the core change — what a companion owns is now a fact the game remembers.