Task.assignee is single-valued, but build_days promises multi-pawn construction #111
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder#111
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of milestone #5. The data model and the documentation currently contradict each other.
BuildingType.build_daysdocuments pawn-days with a worked example:But
Task.assigneeis a singleint, andTaskManager.claim(id, pawn_id)overwrites it. One task can only ever be worked by one pawn, so the three-pawn case in that docstring is unreachable — a second pawn claiming the task would silently displace the first.The pawn-day unit itself is fine and worth keeping: it falls straight out of a work loop where each assigned pawn contributes one unit per tick (see #110). The question is only whether a task can hold more than one assignee.
Options:
assignees: Array[int]withclaim()appending andrelease(id, pawn_id)removing one.next_for()needs a cap so a task is not claimable without limit — probably amax_workerson the task, defaulting to 1.BuildingType's docstring so it stops promising something the model cannot do. Revisit when there is a reason for two pawns to share a site.(2) is the smaller change and is probably right for now — with ~10 pawns in a colony, parallel construction is a nice-to-have rather than a core loop. But the docstring must not keep claiming otherwise.
Whichever way it goes, #75's work loop needs to know, because "the pawns working this task" is a lookup it performs every tick.
AC:
BuildingType.build_daysdocstring corrected, and a note onTask.assigneesaying single-assignee is deliberateclaim/release/next_forupdated with tests for two pawns on one task, and one pawn not displacing anotherDecision: option 2, defer. Single assignee stays for now.
Multi-pawn work is wanted, and the design is settled enough to write down, but it is not what #75 needs to get a pawn onto a building site. Filed as #117: each task type caps the workers it allows (construction 3, hauling 1), a new task opens one slot, and the player opens the rest deliberately by selecting the site. That last part is the reason it cannot land now — it needs #78's selection to hang the UI off, and #75's work loop has to exist before there is anything to parallelise.
So for #75 the lookup is unambiguous: one task, at most one assignee,
claim()overwrites.Remaining AC here, both documentation:
BuildingType.build_days— the worked example promises "3.3 days with three pawns", which the model cannot do. Reword to state the pawn-day unit and that elapsed time equals the authored figure while a task takes one worker, pointing at #117 for the rest.Task.assignee— note that single-assignee is a deliberate deferral, not an oversight, and link #117.#117's spec (2026-09-28) takes multi-pawn work on now, which makes
build_days' "3.3 days with three pawns" true once the player opens three slots. #117's PR updates that docstring to say so, and will close this issue.