Skip to content

Health-adjusted round income visibility + export backfill; update completion CTA#36

Open
Spbd1 wants to merge 1 commit into
codex/fix-health-linked-income-and-button-flowfrom
codex/fix-game-flow-and-income-scoring-issues
Open

Health-adjusted round income visibility + export backfill; update completion CTA#36
Spbd1 wants to merge 1 commit into
codex/fix-health-linked-income-and-button-flowfrom
codex/fix-game-flow-and-income-scoring-issues

Conversation

@Spbd1

@Spbd1 Spbd1 commented May 12, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Improve game logic transparency by making it clear that lower health reduces round earnings and ensuring round-level income data is present in exports for analysis.
  • Preserve existing scoring semantics (ROUND_INCOME_POINTS as base) while making health-based adjustments observable and reproducible for replay and exports.
  • Prevent misleading UI text that implies additional survey questions after the game summary by clarifying the post-round/finish CTA.

Description

  • Added an in-game helper note and post-round breakdown so players see that lower health reduces later-round earnings and the per-round income used; changes in components/HiddenCostGame.tsx include the helper note, a result breakdown line, and updated CTA label to "Continue to score table" for the primary flow.
  • Kept the existing health→income rule and ROUND_INCOME_POINTS as the base and used healthBefore when computing a round's roundIncome according to the established multipliers (≥90: 100%, ≥75: 85%, ≥50: 65%, ≥25: 40%, <25: 20%), with the saved round storing roundIncome, baseRoundIncome, and healthIncomeMultiplier.
  • Backfilled missing per-round income fields at export time without overwriting stored data by mapping game.rounds (and replayGame.rounds) through withRoundIncomeFields in utils/researchMetrics.ts and bumped the export constants to RESEARCH_EXPORT_VERSION = "prototype-1.3" and RESEARCH_SCHEMA_VERSION = "hidden-cost-game-research-schema-8".
  • Preserved replay flow and session compatibility by not changing storage keys or destructive behavior; per-round fields remain optional in types/research.ts so older exports remain accepted.

Testing

  • Ran npm run typecheck and the TypeScript check completed successfully.
  • Ran npm run lint and ESLint completed with no warnings or errors.
  • Ran npm run build (Next.js production build) and compilation / page generation completed successfully.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant