Skip to content

[P3] Rotating "build X" goals complete on foundation placement, not structure completion #349

Description

@itsmiso-ai

Ask: Make the rotating "build X" goals require a completed structure to count progress, matching the same-named milestone, instead of completing the moment a foundation is placed.
Expected files: scripts/rotating_goal.gd, tests/test_goal_progression.gd

Problem:
RotatingGoal.compute_build_progress counts a build toward the build_hut/build_workshop/build_garden goals whenever build.kind or build.build_kind equals the target kind, with no check on build.complete. Because a build object is created with "kind": "hut" the instant the foundation is queued (see queue_structure_at), current_progress becomes non-zero immediately on placement, and since is_goal_complete for GOAL_TYPE_BUILD only requires current_progress > 0, the goal now completes and grants its reward (e.g. the +1 food trickle) as soon as the player places the foundation — before any materials are hauled or the structure is actually finished. This is inconsistent with the same-named milestone: MilestoneManager.evaluate_milestone for MILESTONE_TYPE_BUILD explicitly requires bool(build.get("complete")), so the milestone and the rotating goal disagree on when "Build a hut" is achieved. The player sees the garage reward fire early and the milestone still pending, a confusing discrepancy in the core progression loop.

Evidence:

  • scripts/rotating_goal.gd compute_build_progress — counts build.get("kind", "") == target_kind or build.get("build_kind", "") == target_kind with no complete check
  • scripts/rotating_goal.gd is_goal_completeGOAL_TYPE_BUILD returns current_progress > 0
  • scripts/main.gd queue_structure_at (≈line 1285) — creates the build with "kind": kind and "complete": false at placement
  • scripts/milestone_manager.gd evaluate_milestone MILESTONE_TYPE_BUILD — guards on bool(build.get("complete")), the contrasting behavior
  • tests/test_goal_progression.gd _test_compute_build_progress — current test asserts progress counts builds without a complete field, codifying the placement-based behavior

Acceptance:

  • After placing a foundation for a hut (build not yet complete), the build_hut rotating goal does not complete.
  • The build_hut goal completes only once a matching structure is complete: true.
  • tests/test_goal_progression.gd is updated to include an incomplete build that does not count and a completed one that does.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/foreman-coderForeman coding loop worker.auditAudit, review, or investigation work.priority/p3Low priority.status/doneWork is complete.tech-debtTechnical debt from audits.type/bugBug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions