mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
Companion: he carries his wounds, rations his slots, and heals himself
Three defects, all the same mistake, all found by sweep and not by tests: the companion has no database row for a thing to persist onto, so the thing "arrives fresh next time" — which for a resource means infinite. 1. His spell slots refilled every fight. The ledger went on his combat SEAT, and a seat is per-session. A human rations one pool across a 30-room run and gets it back at camp; rationing it IS the caster's game. Now on expedition_party.companion_slots_used, refreshed at camp. (Worth ~0pp alone — a run holds only ~2 real fights, so the pool never binds. I predicted this was the whole answer. It was not.) 2. His BODY refilled every fight. buildFightSeats seated him at Stats.MaxHP and the close-out skipped him — "he arrives fresh next time", said the comment. That is an infinite body: he soaked a share of every fight's incoming and then reset, while the humans beside him bled all the way to camp. THIS was the carry. Now expedition_party.companion_hp; healed at camp; a dropped companion returns on 1 HP rather than as a corpse, because there is no companion-death rule and inventing one inside a bug fix would be a second feature. 3. No autopiloted caster had ever healed ITSELF. simPickAllyHeal skipped `i == seat` and bailed on !IsParty(), so a solo cleric carried cure_wounds for a whole run and never once cast it. Now simPickHeal: heal whoever is worst off, which is sometimes you. Measured, 640 runs/arm, like-for-like (the leaders whose role-fill gives Pete a Cleric, against a human Cleric follower of the leader's own level): solo 69.0% + a human cleric 77.6% (+8.6pp) + Pete 66.1% (-2.9pp) The reference arm is the point. Against SOLO even a mace-only Pete looked like a carry — but parties are designed to be safer, so solo is the wrong yardstick. Against a human peer the real bug appeared: a gearless, level-penalized hireling was out-clearing a fully-geared human cleric of the leader's own level by 15pp, because he was the only combatant in the game who healed to full between fights. With the free lunches gone he is honest, and honestly a net negative — which is exactly the plan's §2 diagnosis, unmasked: a below-median seat cannot pay for its own enemy scaling (+15% boss HP and 2.4 enemy actions a round instead of 1). §2(a) is next, and the sweep now argues FOR it; before this commit it would have made things worse. Self-heal moved solo 66.1% -> 66.2%, so the balance corpus is undisturbed and no re-baseline is owed. It is also NOT the answer to §6 — casters reach for a healing consumable first and the sim stocks them, so a human rarely falls through to the spell. Pete carries no consumables, so it is his only heal. Claude-Session: https://claude.ai/code/session_01J5SQZWoLmL3M3mw2XmHHdy
This commit is contained in:
@@ -410,6 +410,32 @@ func runMigrations(d *sql.DB) error {
|
||||
// where isCompanionSeat holds — a player's row never consults them.
|
||||
`ALTER TABLE expedition_party ADD COLUMN companion_class TEXT NOT NULL DEFAULT ''`,
|
||||
`ALTER TABLE expedition_party ADD COLUMN companion_level INTEGER NOT NULL DEFAULT 0`,
|
||||
|
||||
// The companion's spell-slot ledger, "used" per slot level, as a compact
|
||||
// CSV of six ints (index 0 unused; cantrips cost nothing).
|
||||
//
|
||||
// It has to live on the *expedition*, next to the class and level it is a
|
||||
// pool for. A human caster's slots are dnd_spell_slots rows that persist
|
||||
// across every fight of the run and only come back at camp, so rationing a
|
||||
// pool across a 30-room day IS the caster's game. The first cut of this
|
||||
// parked the companion's ledger on his combat seat instead — and a seat is
|
||||
// per-session, so he walked into every single fight with a full pool. The
|
||||
// sim caught it: a level-penalized, gearless hireling out-cleared a human
|
||||
// cleric of the leader's own level by 15pp.
|
||||
`ALTER TABLE expedition_party ADD COLUMN companion_slots_used TEXT NOT NULL DEFAULT ''`,
|
||||
|
||||
// The companion's body, carried across the run. -1 means "unset" — he is
|
||||
// at full, which is what a fresh hire is.
|
||||
//
|
||||
// He used to re-seat at full max HP for *every* fight, because he has no
|
||||
// dnd_character row for his HP to persist onto and the close-out skipped
|
||||
// him ("he arrives fresh next time"). That is an infinite body: a player
|
||||
// bleeds across a 30-room run and only heals at camp, while the hireling
|
||||
// soaked half the incoming damage and reset. Measured, it is most of why a
|
||||
// gearless, level-penalized hireling out-cleared a human cleric of the
|
||||
// leader's own level — his party fled 5 runs out of 640 where the human
|
||||
// party fled 56.
|
||||
`ALTER TABLE expedition_party ADD COLUMN companion_hp INTEGER NOT NULL DEFAULT -1`,
|
||||
}
|
||||
for _, stmt := range columnMigrations {
|
||||
if _, err := d.Exec(stmt); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user