Denominate build effort in pawn-days #107
No reviewers
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!107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "88-build-time-unit"
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?
Closes #88.
BuildingType.build_timewas anintwith no unit, and its authored values predate the clock — under any tick reading, 10 was one second.The decisions
The unit is pawn-days — one pawn working for one day. #66 settled this without naming it, by making
Task.work_remainingcount work-ticks: elapsed time is an output of how many pawns are assigned, not an input. A 10 pawn-day mine is 10 days with one pawn and 3.3 with three.Authored in days, stored in ticks.
build_days: floatonBuildingType;build_work_ticks()is the single conversion site, wrappingGameCalendar.days_to_ticks()so that #70 and the tooltip do not each write the arithmetic. Most of this was already in place — #87 landeddays_to_ticks()and its tests, documented "see #88" — so this PR is mostly the application of a decision already made.The 10 / 5 / 3 ratios are preserved, per the balance table in #88's comment.
colony_rocket.tresnow statesbuild_days = 0.0explicitly: the Colony Centre lands already built, and an inherited default could not say whether the zero was deliberate.The tooltip says "Build time: 10 pawn-days", not "10 days". The familiar wording reads as elapsed time, and every crewed build would beat it — a promise the game then breaks. Buildings with
build_days == 0.0show no build-time line at all rather than "Build time: 0".Scope note: one AC deferred
#88's last AC asks that "a BuildingType authored at N days yields the expected
work_remainingon the task it produces".ConstructionTaskdoes not exist yet —entities/tasks/holds onlytask.gdandtask_manager.gd, and the task type is #70. The conversion is tested directly instead, and the deferral is recorded in the test file's docstring. #70 has been commented so it picks up the assertion.Also updated #70's stale AC by comment: it says
work_remainingstarts attype.build_timeticks, which was wrong on the field name and on the unit twice over.Verification
New
test/unit/test_building_type.gd— 12 tests: the conversion, the accessor agreeing withGameCalendarrather than reimplementing it, the authored catalogue's values and their work-tick equivalents, the rocket's zero, tooltip pluralisation and decimal formatting, and two tests that build the real card and read back the rendered tooltip text.Full suite headless — 463 tests, 462 passing, 1 pre-existing pending (#85 placeholder). No orphans.
Tooltip appearance verified manually, headed, by hovering the placement palette.
get_parsed_text()only proves the string, and a tooltip needs a hover to appear at all, so this could not be automated -gl_compatibilitydraws nothing headless. "pawn-days" is a longer line than the bare number it replaced, so the panel was checked by eye rather than assumed.Incidental: a stale
build_timereference intest_game_clock.gd's header comment now reads "a duration of 600 ticks".🤖 Generated with Claude Code