You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:render_worker_overlay() keys its per-worker rendering state by worker name (worker_overlay_nodes, _overlay_sprite_cache_frame, _overlay_sprite_cache_carrying), but worker names are not unique at the population cap. recruit_worker() cycles names with current % Constants.WORKER_NAMES.size(), and the pool has exactly 10 entries — so the 11th worker (cap 12, reachable with 5 huts) duplicates "Jun", the 12th duplicates "Mara", etc. When two workers share a name they also share a single TextureRect: the second worker overwrites the sprite's position/frame, so both workers render at one location and animation frames are wrong. #242/#247 addressed duplicate names only up to 10 workers ("prevent name collisions when recruiting multiple workers") and test_recruit_unique_names only exercises 4 recruits, so the residual collision at 11+ is untested and unfixed.
Evidence:
scripts/main.gdrender_worker_overlay() — worker_overlay_nodes.has(name) returns the existing node for a duplicate name; _overlay_sprite_cache_frame[name] / _overlay_sprite_cache_carrying[name] gate texture assignment per name
scripts/colony_sim.gdrecruit_worker() — var next_index: int = current % Constants.WORKER_NAMES.size() (cycles; 11th recruit gets index 0)
scripts/constants.gd:5 — WORKER_NAMES has 10 entries; WORKER_CAP_BONUSES = {"hut": 2} + BASE_WORKER_CAP = 2 -> cap 12 with 5 huts
tests/test_recruit_worker.gdtest_recruit_unique_names — asserts uniqueness only for range(4) recruits (cap 4)
Overlay rendering is keyed by a stable per-worker identity (e.g., array index or a unique worker id), not name
A sim/UI test with 12 workers (5 huts) shows every worker rendering at its own position with its own animation frame, including two workers named the same
Problem:
render_worker_overlay()keys its per-worker rendering state by worker name (worker_overlay_nodes,_overlay_sprite_cache_frame,_overlay_sprite_cache_carrying), but worker names are not unique at the population cap.recruit_worker()cycles names withcurrent % Constants.WORKER_NAMES.size(), and the pool has exactly 10 entries — so the 11th worker (cap 12, reachable with 5 huts) duplicates "Jun", the 12th duplicates "Mara", etc. When two workers share a name they also share a singleTextureRect: the second worker overwrites the sprite's position/frame, so both workers render at one location and animation frames are wrong. #242/#247 addressed duplicate names only up to 10 workers ("prevent name collisions when recruiting multiple workers") andtest_recruit_unique_namesonly exercises 4 recruits, so the residual collision at 11+ is untested and unfixed.Evidence:
scripts/main.gdrender_worker_overlay()—worker_overlay_nodes.has(name)returns the existing node for a duplicate name;_overlay_sprite_cache_frame[name]/_overlay_sprite_cache_carrying[name]gate texture assignment per namescripts/colony_sim.gdrecruit_worker()—var next_index: int = current % Constants.WORKER_NAMES.size()(cycles; 11th recruit gets index 0)scripts/constants.gd:5— WORKER_NAMES has 10 entries;WORKER_CAP_BONUSES = {"hut": 2}+BASE_WORKER_CAP = 2-> cap 12 with 5 hutstests/test_recruit_worker.gdtest_recruit_unique_names— asserts uniqueness only forrange(4)recruits (cap 4)9b6553b(Expand WORKER_NAMES pool and add badge colors for all workers #242) — pool expansion to 10 was the intended fix for Expand WORKER_NAMES or add unique name generation #227; it does not cover the 11th+ workerAcceptance: