Skip to content

[P3] "Stockpile 10 food" milestone measures lifetime harvest, not stockpiled food #334

Description

@itsmiso-ai

Ask: Evaluate the stockpile_food milestone against current stockpiled food instead of lifetime harvested food.
Expected files: scripts/milestone_manager.gd, tests/test_milestone_goals.gd

Problem: The stockpile_food milestone — name "Stockpile 10 food", description "The larder is filling up. Rations secured." — is evaluated by the MILESTONE_TYPE_STOCKPILE branch reading game_state.harvested, i.e. lifetime food gathered, which never decreases. A colony that harvested 10 food and then ate it all completes the milestone while holding 0 food; the "larder" is never actually filled as the name and description promise. The neighboring build_* milestones and the rotating gather_* goals correctly use their own semantics, so this reads as an implementation/description mismatch rather than a deliberate design (the field name harvested vs. milestone type STOCKPILE is the tell). The current tests encode the harvested behavior, so the fix must update both implementation and tests.

Evidence:

  • scripts/milestone_manager.gd evaluate_milestone() MILESTONE_TYPE_STOCKPILE branch — var harvested: Dictionary = game_state.get("harvested", {}); progress from harvested.get(resource, 0)
  • scripts/milestone_manager.gd MILESTONE_CATALOG stockpile_food — name/description promise a stockpile ("larder filling up")
  • scripts/game_state.gd / scripts/colony_sim.gd — current stock is state.resources.food (see apply_food_upkeep()), never consulted by this milestone
  • tests/test_milestone_goals.gd test_evaluate_stockpile_milestone — asserts progress from harvested (no spend scenario)

Acceptance:

  • Progress derives from current resources.food (clamped to target), so spending food regresses progress
  • test_evaluate_stockpile_milestone updated to use resources; add a harvested-then-spent scenario proving progress < total
  • Other milestone types unchanged; suites stay green

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions